From 5912b01ac5b1ff446904c0a4d1e8ebdef6f1be53 Mon Sep 17 00:00:00 2001 From: Ryan Amari Date: Thu, 24 Aug 2023 11:29:45 -0400 Subject: [PATCH] ALS-4947: Change filter logic to be AND not OR between 2 any record of filters --- .../hpds/processing/AbstractProcessor.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/AbstractProcessor.java b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/AbstractProcessor.java index e2f6c44a..d76d3d61 100644 --- a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/AbstractProcessor.java +++ b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/AbstractProcessor.java @@ -262,20 +262,16 @@ private void addIdSetsForRequiredFields(Query query, ArrayList> fil private void addIdSetsForAnyRecordOf(Query query, ArrayList> filteredIdSets) { if(!query.getAnyRecordOf().isEmpty()) { - Set patientsInScope = new ConcurrentSkipListSet(); - VariantBucketHolder bucketCache = new VariantBucketHolder(); - query.getAnyRecordOf().parallelStream().forEach(path->{ - if(patientsInScope.size() bucketCache = new VariantBucketHolder<>(); + filteredIdSets.addAll(query.getAnyRecordOf().parallelStream().map(path->{ + if(VariantUtils.pathIsVariantSpec(path)) { + TreeSet patientsInScope = new TreeSet<>(); + addIdSetsForVariantSpecCategoryFilters(new String[]{"0/1","1/1"}, path, patientsInScope, bucketCache); + return patientsInScope; + } else { + return new TreeSet(getCube(path).keyBasedIndex()); } - }); - filteredIdSets.add(patientsInScope); + }).collect(Collectors.toSet())); } }