From bd003804150024946a3efde18603f038cef9e887 Mon Sep 17 00:00:00 2001 From: GeorgeC Date: Wed, 13 Nov 2024 10:39:46 -0500 Subject: [PATCH] Refactor description handling in SearchResultRowMapper --- .../legacysearch/SearchResultRowMapper.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java index e7c09d7..7ae389a 100644 --- a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java @@ -41,15 +41,17 @@ private SearchResult mapSearchResults(ResultSet rs) throws SQLException { log.error(e.getMessage()); } + String description = + rs.getString("description") == null || rs.getString("description").isBlank() ? "" : rs.getString("description"); + Metadata metadata = new Metadata( - rs.getString("stigmatized"), rs.getString("display"), rs.getString("description"), + rs.getString("stigmatized"), rs.getString("display"), description, isContinuous ? String.valueOf(jsonBlobParser.parseMin(rs.getString("values"))) : "", rs.getString("conceptPath"), - rs.getString("parentName"), rs.getString("conceptPath"), rs.getString("name"), rs.getString("parentDisplay"), - rs.getString("description") == null || rs.getString("description").isBlank() ? "" : rs.getString("description"), // changed + rs.getString("parentName"), rs.getString("conceptPath"), rs.getString("name"), rs.getString("parentDisplay"), description, // changed "{}", "", rs.getString("parentDisplay"), isContinuous ? String.valueOf(jsonBlobParser.parseMax(rs.getString("values"))) : "", - rs.getString("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"), rs.getString("parentName"), rs.getString("parentDisplay"), rs.getString("conceptPath") + 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"), + rs.getString("parentName"), rs.getString("parentDisplay"), rs.getString("conceptPath") ); Result result = new Result(