From 4ec81bc63d9bf9f2f5a54dbf2f9ee9af1cb0ab3a Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Tue, 27 Aug 2024 16:23:48 -0400 Subject: [PATCH 1/2] Update Treatment Endpoint to handle event_type TREATMENT, previously only searched on Treatment --- .../mybatisclickhouse/StudyViewFilterMapper.xml | 6 +++--- .../persistence/mybatisclickhouse/StudyViewMapper.xml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml index c0b2909cd53..7ec8f970f92 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml @@ -189,8 +189,8 @@ value AS treatment, argMin(start_date, start_date) AS treatment_time_taken FROM clinical_event_derived - WHERE event_type = 'Treatment' - AND key = 'AGENT' + WHERE event_type IN ('Treatment', 'TREATMENT') + AND key = 'AGENT' GROUP BY patient_unique_id, value ) ced_inner ON ced_inner.patient_unique_id = ced.patient_unique_id @@ -231,7 +231,7 @@ - event_type = 'Treatment' + event_type IN ('Treatment', 'TREATMENT') AND key = 'AGENT' AND value = '${patientTreatmentFilter.treatment}' diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml index e94d466f6f0..7571d5f9870 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml @@ -442,7 +442,7 @@ patient_unique_id FROM clinical_event_derived - event_type = 'Treatment' + event_type IN ('Treatment', 'TREATMENT') AND key = 'AGENT' AND @@ -465,7 +465,7 @@ count(DISTINCT patient_unique_id) AS count FROM clinical_event_derived - event_type = 'Treatment' + event_type IN ('Treatment', 'TREATMENT') AND key = 'AGENT' AND @@ -493,7 +493,7 @@ patient_unique_id FROM clinical_event_derived - event_type = 'Treatment' + event_type IN ('Treatment', 'TREATMENT') AND key = 'AGENT' AND @@ -537,7 +537,7 @@ argMin(start_date, start_date) AS treatment_time_taken FROM clinical_event_derived - event_type = 'Treatment' + event_type IN ('Treatment', 'TREATMENT') AND key = 'AGENT' GROUP BY patient_unique_id, value From 1bcb80b1f0adc1f283201e924d73f2ddf9f7f389 Mon Sep 17 00:00:00 2001 From: Charles Haynes Date: Tue, 27 Aug 2024 16:46:05 -0400 Subject: [PATCH 2/2] Handle all variations of Treatment --- .../mybatisclickhouse/StudyViewFilterMapper.xml | 6 +++--- .../persistence/mybatisclickhouse/StudyViewMapper.xml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml index 7ec8f970f92..f2ce040188e 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewFilterMapper.xml @@ -189,8 +189,8 @@ value AS treatment, argMin(start_date, start_date) AS treatment_time_taken FROM clinical_event_derived - WHERE event_type IN ('Treatment', 'TREATMENT') - AND key = 'AGENT' + WHERE lower(event_type) = 'treatment' + AND key = 'AGENT' GROUP BY patient_unique_id, value ) ced_inner ON ced_inner.patient_unique_id = ced.patient_unique_id @@ -231,7 +231,7 @@ - event_type IN ('Treatment', 'TREATMENT') + lower(event_type) = 'treatment' AND key = 'AGENT' AND value = '${patientTreatmentFilter.treatment}' diff --git a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml index 7571d5f9870..5af781dfeb0 100644 --- a/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml +++ b/src/main/resources/org/cbioportal/persistence/mybatisclickhouse/StudyViewMapper.xml @@ -442,7 +442,7 @@ patient_unique_id FROM clinical_event_derived - event_type IN ('Treatment', 'TREATMENT') + lower(event_type) = 'treatment' AND key = 'AGENT' AND @@ -465,7 +465,7 @@ count(DISTINCT patient_unique_id) AS count FROM clinical_event_derived - event_type IN ('Treatment', 'TREATMENT') + lower(event_type) = 'treatment' AND key = 'AGENT' AND @@ -493,7 +493,7 @@ patient_unique_id FROM clinical_event_derived - event_type IN ('Treatment', 'TREATMENT') + lower(event_type) = 'treatment' AND key = 'AGENT' AND @@ -537,7 +537,7 @@ argMin(start_date, start_date) AS treatment_time_taken FROM clinical_event_derived - event_type IN ('Treatment', 'TREATMENT') + lower(event_type) = 'treatment' AND key = 'AGENT' GROUP BY patient_unique_id, value