From 1ffb0ac2fe7769f3366cdd430e437eabfeff6ed8 Mon Sep 17 00:00:00 2001 From: Bryant Austin Date: Wed, 15 Jun 2022 13:32:44 -0600 Subject: [PATCH 1/3] reduce activew ambulatory calls by forcing cacheing --- input/pagecontent/cql/OpioidCDSREC08.cql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/input/pagecontent/cql/OpioidCDSREC08.cql b/input/pagecontent/cql/OpioidCDSREC08.cql index 6c111e6c..02917f28 100644 --- a/input/pagecontent/cql/OpioidCDSREC08.cql +++ b/input/pagecontent/cql/OpioidCDSREC08.cql @@ -84,10 +84,13 @@ define "Exclusion Criteria": ) or Common."End of Life Assessment" +define "Active Ambulatory Opioid Rx": + Common."Active Ambulatory Opioid Rx" + define "Total MME": MMECalculator.TotalMME( "Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" - union Common."Active Ambulatory Opioid Rx" + union "Active Ambulatory Opioid Rx" ) define "On Naloxone": From 454ed9b6769a6cdec3efe9e1cc0d151d20fea4f8 Mon Sep 17 00:00:00 2001 From: Bryant Austin Date: Tue, 21 Jun 2022 15:12:44 -0600 Subject: [PATCH 2/3] turning ServiceRequest into expression so it is cached --- input/pagecontent/cql/OpioidCDSCommon.cql | 9 +++++++-- input/pagecontent/cql/OpioidCDSRoutines.cql | 9 +++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/input/pagecontent/cql/OpioidCDSCommon.cql b/input/pagecontent/cql/OpioidCDSCommon.cql index 1841a195..0cd8cfd4 100644 --- a/input/pagecontent/cql/OpioidCDSCommon.cql +++ b/input/pagecontent/cql/OpioidCDSCommon.cql @@ -214,8 +214,9 @@ define "Admitted/Referred/Discharged to Hospice Care": ) union ( - [ServiceRequest: code in "Hospice Procedure Codes"] E - where E.status.value in { 'planned', 'arrived', 'in-progress', 'finished', 'onleave' } + "Service Requests" SR + where SR.code in "Hospice Procedure Codes" + and SR.status.value in { 'planned', 'arrived', 'in-progress', 'finished', 'onleave' } ) union ( @@ -355,3 +356,7 @@ define function ToRxNormCode(coding List): singleton from ( coding C where C.system = 'http://www.nlm.nih.gov/research/umls/rxnorm' ) + + define "Service Requests": + [ServiceRequest] SR + return SR diff --git a/input/pagecontent/cql/OpioidCDSRoutines.cql b/input/pagecontent/cql/OpioidCDSRoutines.cql index e1d071ed..e1eccbda 100644 --- a/input/pagecontent/cql/OpioidCDSRoutines.cql +++ b/input/pagecontent/cql/OpioidCDSRoutines.cql @@ -62,10 +62,11 @@ define "Conditions Indicating End Of Life Present": define "Order For Palliative Care In Past 90 Days": exists ( - [ServiceRequest: Common."Therapies indicating end of life care"] SR - where SR.status in { 'active', 'completed'} - and SR.intent != null - and FHIRHelpers.ToDateTime(SR.authoredOn) during day of "Palliative Care Lookback Period" + Common."Service Requests" SR + where SR.status in { 'active', 'completed'} + and SR.intent != null + and FHIRHelpers.ToDateTime(SR.authoredOn) during day of "Palliative Care Lookback Period" + and SR.code in Common."Therapies indicating end of life care" ) define "Conditions Including Cancer To Exclude Opioid Management Indicating End-Stage Disease Present": From 1524e77d819c98331481b3c0cbf181b0997936c4 Mon Sep 17 00:00:00 2001 From: capt-mac Date: Mon, 27 Jun 2022 14:36:23 -0600 Subject: [PATCH 3/3] update status to active and completed --- input/pagecontent/cql/OpioidCDSCommon.cql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/pagecontent/cql/OpioidCDSCommon.cql b/input/pagecontent/cql/OpioidCDSCommon.cql index 0cd8cfd4..d8c50855 100644 --- a/input/pagecontent/cql/OpioidCDSCommon.cql +++ b/input/pagecontent/cql/OpioidCDSCommon.cql @@ -216,7 +216,7 @@ define "Admitted/Referred/Discharged to Hospice Care": ( "Service Requests" SR where SR.code in "Hospice Procedure Codes" - and SR.status.value in { 'planned', 'arrived', 'in-progress', 'finished', 'onleave' } + and SR.status.value in { 'active', 'completed' } ) union (