From d0f3cc1e8078e9c5e2fe8b73403508b147bcdd4a Mon Sep 17 00:00:00 2001 From: Enola Knezevic Date: Wed, 3 Apr 2024 14:25:02 +0200 Subject: [PATCH 1/3] allowing empty list of sites in request --- resources/query_bbmri.cql | 2 +- src/main.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/query_bbmri.cql b/resources/query_bbmri.cql index b18b894..534205c 100644 --- a/resources/query_bbmri.cql +++ b/resources/query_bbmri.cql @@ -20,7 +20,7 @@ BBMRI_STRAT_CUSTODIAN_STRATIFIER BBMRI_STRAT_DIAGNOSIS_STRATIFIER -PRISM_BBMRI_STRAT_AGE_STRATIFIER +PRISM_STRAT_AGE_STRATIFIER_BBMRI BBMRI_STRAT_DEF_IN_INITIAL_POPULATION true \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index b75f7e2..82412bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -146,7 +146,15 @@ async fn handle_get_criteria( ) -> Result { let mut criteria_groups: CriteriaGroups = CriteriaGroups::new(); // this is going to be aggregated criteria for all the sites - for site in query.clone().sites { + let mut sites = query.clone().sites; + + // allowing empty list of sites in the request because Spot is going to query with the empty list and expect response for the sites in Prism's config + + if sites.is_empty() { + sites = CONFIG.sites.clone(); + } + + for site in sites { debug!("Request for site {}", &site); let criteria_groups_from_cache = match shared_state.criteria_cache.lock().await.cache.get(&site) { From a2d3971bad4c1e4051492c896a12745be7a45c5b Mon Sep 17 00:00:00 2001 From: Enola Knezevic Date: Wed, 3 Apr 2024 15:31:56 +0200 Subject: [PATCH 2/3] removed defensive cloning --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 82412bb..2c196ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -146,7 +146,7 @@ async fn handle_get_criteria( ) -> Result { let mut criteria_groups: CriteriaGroups = CriteriaGroups::new(); // this is going to be aggregated criteria for all the sites - let mut sites = query.clone().sites; + let mut sites = query.sites; // allowing empty list of sites in the request because Spot is going to query with the empty list and expect response for the sites in Prism's config From 74b8f2620197c4816828f7f16dfc1b82e724dbb1 Mon Sep 17 00:00:00 2001 From: Enola Knezevic Date: Wed, 3 Apr 2024 16:34:53 +0200 Subject: [PATCH 3/3] renamed gender stratifier to match catalogue --- resources/body_bbmri.json | 4 ++-- resources/body_dktk.json | 2 +- resources/body_gbn.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/body_bbmri.json b/resources/body_bbmri.json index 6ba91df..955c121 100644 --- a/resources/body_bbmri.json +++ b/resources/body_bbmri.json @@ -23,7 +23,7 @@ "group": [ { "code": { - "text": "patients" + "text": "patient" }, "population": [ { @@ -44,7 +44,7 @@ "stratifier": [ { "code": { - "text": "Gender" + "text": "gender" }, "criteria": { "expression": "Gender", diff --git a/resources/body_dktk.json b/resources/body_dktk.json index 6d636cd..e88b756 100644 --- a/resources/body_dktk.json +++ b/resources/body_dktk.json @@ -44,7 +44,7 @@ "stratifier": [ { "code": { - "text": "Gender" + "text": "gender" }, "criteria": { "expression": "Gender", diff --git a/resources/body_gbn.json b/resources/body_gbn.json index 6ba91df..d6edb11 100644 --- a/resources/body_gbn.json +++ b/resources/body_gbn.json @@ -44,7 +44,7 @@ "stratifier": [ { "code": { - "text": "Gender" + "text": "gender" }, "criteria": { "expression": "Gender",