From 2ea0806e5ce79a4b942c8a2d69f4d883e7a5b26d Mon Sep 17 00:00:00 2001 From: GeorgeC Date: Thu, 14 Nov 2024 15:17:20 -0500 Subject: [PATCH] Revert temp change to test pediatric data --- .../legacysearch/MetadataResultSetUtil.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) 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"); + } }