From a21dc0b332adccce561b90533d88d57a70d26913 Mon Sep 17 00:00:00 2001 From: Ryan Amari Date: Tue, 30 Jul 2024 11:45:57 -0400 Subject: [PATCH] ALS-6279: re-implement genomic info column listing --- .../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(