From 76b763a6191bbaa77042d525837fd20c723dae37 Mon Sep 17 00:00:00 2001 From: Luke Sikina Date: Mon, 1 Jul 2024 16:02:21 -0400 Subject: [PATCH] Revert "[ALS-6344] - Make new query that retuns patient count and concept count" This reverts commit 5fa91ad4247b3ab8e26ce757fbf48da33a789941. --- .../avillach/hpds/data/query/ResultType.java | 8 +------ .../hpds/processing/CountProcessor.java | 16 -------------- .../processing/PatientAndConceptCount.java | 21 ------------------- .../avillach/hpds/service/PicSureService.java | 3 --- 4 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/PatientAndConceptCount.java diff --git a/client-api/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/data/query/ResultType.java b/client-api/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/data/query/ResultType.java index 380b4db9..4481190b 100644 --- a/client-api/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/data/query/ResultType.java +++ b/client-api/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/data/query/ResultType.java @@ -94,11 +94,5 @@ public enum ResultType { * is suitable to time series analysis and/or loading into another * instance of HPDS. */ - DATAFRAME_TIMESERIES, - - /** - * Count number of patients and number of available concept paths. Useful for federated networks - * where not every concept path in a query is guaranteed to be in a specific portal - */ - PATIENT_AND_CONCEPT_COUNT + DATAFRAME_TIMESERIES } diff --git a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/CountProcessor.java b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/CountProcessor.java index fdac9532..246880b4 100644 --- a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/CountProcessor.java +++ b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/CountProcessor.java @@ -229,20 +229,4 @@ public Map runVariantCount(Query query) { } return response; } - - public PatientAndConceptCount runPatientAndConceptCount(Query incomingQuery) { - log.info("Starting Patient and Concept Count query {}", incomingQuery.getPicSureId()); - log.info("Calculating available concepts"); - long concepts = incomingQuery.getFields().stream() - .map(abstractProcessor::nullableGetCube) - .filter(Optional::isPresent) - .count(); - log.info("Calculating patient counts"); - int patients = runCounts(incomingQuery); - PatientAndConceptCount patientAndConceptCount = new PatientAndConceptCount(); - patientAndConceptCount.setConceptCount(concepts); - patientAndConceptCount.setPatientCount(patients); - log.info("Completed Patient and Concept Count query {}", incomingQuery.getPicSureId()); - return patientAndConceptCount; - } } diff --git a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/PatientAndConceptCount.java b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/PatientAndConceptCount.java deleted file mode 100644 index bcbb37c0..00000000 --- a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/PatientAndConceptCount.java +++ /dev/null @@ -1,21 +0,0 @@ -package edu.harvard.hms.dbmi.avillach.hpds.processing; - -public class PatientAndConceptCount { - private long patientCount, conceptCount; - - public long getPatientCount() { - return patientCount; - } - - public void setPatientCount(long patientCount) { - this.patientCount = patientCount; - } - - public long getConceptCount() { - return conceptCount; - } - - public void setConceptCount(long conceptCount) { - this.conceptCount = conceptCount; - } -} 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 686df5d2..d1d2fb71 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 @@ -455,9 +455,6 @@ private Response submitQueryAndWaitForCompletion(QueryRequest resultRequest) thr case COUNT: return queryOkResponse(countProcessor.runCounts(incomingQuery), incomingQuery).build(); - case PATIENT_AND_CONCEPT_COUNT: - return queryOkResponse(countProcessor.runPatientAndConceptCount(incomingQuery), incomingQuery).build(); - default: // no valid type return Response.status(Status.BAD_REQUEST).build();