diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/MetadataResultSetUtil.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/MetadataResultSetUtil.java index 18fe5d8..8348f37 100644 --- a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/MetadataResultSetUtil.java +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/MetadataResultSetUtil.java @@ -31,8 +31,7 @@ public Result mapContinuousMetadata(ResultSet rs) throws SQLException { String hashedVarId = hashVarId(rs.getString("conceptPath")); String description = getDescription(rs); String parentName = getParentName(rs); - // String parentDisplay = getParentDisplay(rs); - String parentDisplay = rs.getString("parentDisplay"); // Testing pediatric fix + String parentDisplay = getParentDisplay(rs); String max = String.valueOf(jsonBlobParser.parseMax(rs.getString("values"))); String min = String.valueOf(jsonBlobParser.parseMin(rs.getString("values"))); @@ -50,24 +49,13 @@ public Result mapContinuousMetadata(ResultSet rs) throws SQLException { ); } - // private static String getParentDisplay(ResultSet rs) throws SQLException { - // return rs.getString("parentDisplay") == null || rs.getString("parentDisplay").isBlank() ? "" : rs.getString("parentDisplay"); - // } - private static String getParentName(ResultSet rs) throws SQLException { - return rs.getString("parentName") == null || rs.getString("parentName").isBlank() ? "All Variables" : rs.getString("parentName"); - } - - private static String getDescription(ResultSet rs) throws SQLException { - return rs.getString("description") == null || rs.getString("description").isBlank() ? "" : rs.getString("description"); - } public Result mapCategoricalMetadata(ResultSet rs) throws SQLException { String hashedVarId = hashVarId(rs.getString("conceptPath")); String description = getDescription(rs); String parentName = getParentName(rs); - // String parentDisplay = getParentDisplay(rs); - String parentDisplay = rs.getString("parentDisplay"); // Testing pediatric fix + String parentDisplay = getParentDisplay(rs); CategoricalMetadata metadata = new CategoricalMetadata( rs.getString("stigmatized"), rs.getString("display"), description, "", rs.getString("conceptPath"), parentName, @@ -107,4 +95,16 @@ private static String bytesToHex(byte[] hash) { } return hexString.toString(); } + + private static String getParentDisplay(ResultSet rs) throws SQLException { + return rs.getString("parentDisplay") == null || rs.getString("parentDisplay").isBlank() ? "" : rs.getString("parentDisplay"); + } + + private static String getParentName(ResultSet rs) throws SQLException { + return rs.getString("parentName") == null || rs.getString("parentName").isBlank() ? "All Variables" : rs.getString("parentName"); + } + + private static String getDescription(ResultSet rs) throws SQLException { + return rs.getString("description") == null || rs.getString("description").isBlank() ? "" : rs.getString("description"); + } }