Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowing empty list of sites in request #12

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/body_bbmri.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"group": [
{
"code": {
"text": "patients"
"text": "patient"
},
"population": [
{
Expand All @@ -44,7 +44,7 @@
"stratifier": [
{
"code": {
"text": "Gender"
"text": "gender"
},
"criteria": {
"expression": "Gender",
Expand Down
2 changes: 1 addition & 1 deletion resources/body_dktk.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"stratifier": [
{
"code": {
"text": "Gender"
"text": "gender"
},
"criteria": {
"expression": "Gender",
Expand Down
2 changes: 1 addition & 1 deletion resources/body_gbn.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"stratifier": [
{
"code": {
"text": "Gender"
"text": "gender"
},
"criteria": {
"expression": "Gender",
Expand Down
2 changes: 1 addition & 1 deletion resources/query_bbmri.cql
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,15 @@ async fn handle_get_criteria(
) -> Result<Response, (StatusCode, String)> {
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.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) {
Expand Down
Loading