Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return empty string for NULL dataset full name #60

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public Result mapContinuousMetadata(ResultSet rs) throws SQLException {
String description = getDescription(rs);
String parentName = getParentName(rs);
String parentDisplay = getParentDisplay(rs);
String dsFullName = getDatasetFullName(rs);

String max = String.valueOf(jsonBlobParser.parseMax(rs.getString("values")));
String min = String.valueOf(jsonBlobParser.parseMin(rs.getString("values")));
Expand All @@ -41,8 +42,8 @@ public Result mapContinuousMetadata(ResultSet rs) throws SQLException {
rs.getString("stigmatized"), rs.getString("display"), description, min, rs.getString("conceptPath"), parentName,
rs.getString("conceptPath"), rs.getString("name"), parentDisplay, description, // changed
"{}", "", parentName, max, description, rs.getString("dataset"), hashedVarId, rs.getString("conceptType"), rs.getString("name"),
rs.getString("dataset"), rs.getString("stigmatized"), rs.getString("display"), rs.getString("studyAcronym"),
rs.getString("dsFullName"), parentName, parentDisplay, rs.getString("conceptPath"), min, max
rs.getString("dataset"), rs.getString("stigmatized"), rs.getString("display"), rs.getString("studyAcronym"), dsFullName,
parentName, parentDisplay, rs.getString("conceptPath"), min, max
);
return new Result(
metadata, jsonBlobParser.parseValues(rs.getString("values")), rs.getString("dataset"), parentName, rs.getString("name"), false,
Expand All @@ -55,13 +56,14 @@ public Result mapCategoricalMetadata(ResultSet rs) throws SQLException {
String description = getDescription(rs);
String parentName = getParentName(rs);
String parentDisplay = getParentDisplay(rs);
String dsFullName = getDatasetFullName(rs);

CategoricalMetadata metadata = new CategoricalMetadata(
rs.getString("stigmatized"), rs.getString("display"), description, "", rs.getString("conceptPath"), parentName,
rs.getString("conceptPath"), rs.getString("name"), parentDisplay, description, // changed
"{}", "", parentName, "", description, rs.getString("dataset"), hashedVarId, rs.getString("conceptType"), rs.getString("name"),
rs.getString("dataset"), rs.getString("stigmatized"), rs.getString("display"), rs.getString("studyAcronym"),
rs.getString("dsFullName"), parentName, parentDisplay, rs.getString("conceptPath")
rs.getString("conceptPath"), rs.getString("name"), parentDisplay, description, "{}", "", parentName, "", description,
rs.getString("dataset"), hashedVarId, rs.getString("conceptType"), rs.getString("name"), rs.getString("dataset"),
rs.getString("stigmatized"), rs.getString("display"), rs.getString("studyAcronym"), dsFullName, parentName, parentDisplay,
rs.getString("conceptPath")
);

return new Result(
Expand All @@ -70,6 +72,8 @@ public Result mapCategoricalMetadata(ResultSet rs) throws SQLException {
);
}



private static String hashVarId(String hpdsPath) {
String hashedVarId = "";
try {
Expand Down Expand Up @@ -106,4 +110,9 @@ private String getParentName(ResultSet rs) throws SQLException {
private String getDescription(ResultSet rs) throws SQLException {
return StringUtils.hasLength(rs.getString("description")) ? rs.getString("description") : "";
}

private String getDatasetFullName(ResultSet rs) throws SQLException {
return StringUtils.hasLength(rs.getString("dsFullName")) ? rs.getString("dsFullName") : "";
}

}
Loading