From b2c6346992da6de0d4e546ca019cb629d0ebd666 Mon Sep 17 00:00:00 2001 From: ramari16 Date: Tue, 30 Jul 2024 15:42:23 -0400 Subject: [PATCH] ALS-6279: re-implement genomic info column listing (#114) --- .../avillach/hpds/service/PicSureService.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/PicSureService.java b/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/PicSureService.java index def35e54..6c47f882 100644 --- a/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/PicSureService.java +++ b/service/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/service/PicSureService.java @@ -146,8 +146,20 @@ public SearchResults search(@RequestBody QueryRequest searchJson) { }).collect(Collectors.toMap(Entry::getKey, Entry::getValue)) : allColumns; // Info Values - Map infoResults = new HashMap<>(); - log.warn("Info values no longer supported for this resource"); + Map infoResults = new TreeMap(); + abstractProcessor.getInfoStoreMeta().stream().forEach(infoColumnMeta -> { + //FileBackedByteIndexedInfoStore store = abstractProcessor.getInfoStore(infoColumn); + String query = searchJson.getQuery().toString(); + String lowerCase = query.toLowerCase(); + boolean storeIsNumeric = infoColumnMeta.isContinuous(); + if (infoColumnMeta.getDescription().toLowerCase().contains(lowerCase) + || infoColumnMeta.getKey().toLowerCase().contains(lowerCase)) { + infoResults.put(infoColumnMeta.getKey(), + ImmutableMap.of("description", infoColumnMeta.getDescription(), "values", + storeIsNumeric ? new ArrayList() : abstractProcessor.searchInfoConceptValues(infoColumnMeta.getKey(), ""), "continuous", + storeIsNumeric)); + } + }); return new SearchResults() .setResults(