Skip to content

Commit

Permalink
Merge pull request #223 from cqframework/update2022review
Browse files Browse the repository at this point in the history
Review 2022 updates
  • Loading branch information
c-schuler authored Oct 31, 2022
2 parents b14ea8f + fff98e8 commit 36ee560
Show file tree
Hide file tree
Showing 219 changed files with 21,807 additions and 7,464 deletions.
1 change: 1 addition & 0 deletions _refresh.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
#DO NOT EDIT WITH WINDOWS
tooling_jar=tooling-1.4.1-SNAPSHOT-jar-with-dependencies.jar
# tooling_jar=tooling-cli-2.1.0-SNAPSHOT.jar
input_cache_path=$PWD/input-cache
resources_path=/input/resources
ig_ini_path=$PWD/ig.ini
Expand Down
9 changes: 9 additions & 0 deletions input-cache/txcache/all-systems.cache
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,12 @@ v: {
"system" : "urn:iso:std:iso:3166"
}
-------------------------------------------------------------------------------------
{"code" : {
"code" : "text/cql.identifier"
}, "url": "http://hl7.org/fhir/ValueSet/mimetypes", "version": "4.0.1", "lang":"null", "useServer":"true", "useClient":"true", "guessSystem":"true", "valueSetMode":"ALL_CHECKS", "versionFlexible":"true"}####
v: {
"display" : "text/cql.identifier",
"code" : "text/cql.identifier",
"system" : "urn:ietf:bcp:13"
}
-------------------------------------------------------------------------------------
6 changes: 3 additions & 3 deletions input/examples/encounter-cancer-diagnosis.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
"valueDateTime": "2022-10-10"
}, {
"url": "frequency",
"valueDuration": {
Expand All @@ -28,8 +28,8 @@
"reference": "Patient/example-opioidcds"
},
"period": {
"start": "2022-04-24",
"end": "2022-04-24"
"start": "2022-06-10",
"end": "2022-06-10"
},
"diagnosis": [ {
"condition": {
Expand Down
6 changes: 3 additions & 3 deletions input/examples/encounter-oncologist-participant.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
"valueDateTime": "2022-10-10"
}, {
"url": "frequency",
"valueDuration": {
Expand Down Expand Up @@ -40,7 +40,7 @@
}
} ],
"period": {
"start": "2022-03-24",
"end": "2022-03-24"
"start": "2022-05-10",
"end": "2022-05-10"
}
}
4 changes: 2 additions & 2 deletions input/examples/medicationdispense-ambulatory-opioid.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
"valueDateTime": "2022-10-10"
}, {
"url": "frequency",
"valueDuration": {
Expand Down Expand Up @@ -34,7 +34,7 @@
"subject": {
"reference": "Patient/example-opioidcds"
},
"whenHandedOver": "2022-07-24",
"whenHandedOver": "2022-09-09",
"dosageInstruction": [ {
"timing": {
"repeat": {
Expand Down
8 changes: 4 additions & 4 deletions input/examples/medicationrequest-ambulatory-opioid.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
"valueDateTime": "2022-10-10"
}, {
"url": "frequency",
"valueDuration": {
Expand Down Expand Up @@ -35,7 +35,7 @@
"subject": {
"reference": "Patient/example-opioidcds"
},
"authoredOn": "2022-07-24",
"authoredOn": "2022-09-09",
"dosageInstruction": [ {
"timing": {
"repeat": {
Expand All @@ -54,8 +54,8 @@
} ],
"dispenseRequest": {
"validityPeriod": {
"start": "2022-07-24",
"end": "2022-10-24"
"start": "2022-09-09T00:00:00-06:00",
"end": "2022-12-10T00:00:00-07:00"
},
"numberOfRepeatsAllowed": 1,
"expectedSupplyDuration": {
Expand Down
4 changes: 2 additions & 2 deletions input/examples/medicationrequest-example-opioidcds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<id value="example-opioidcds"></id>
<extension url="http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller">
<extension url="dateLastUpdated">
<valueDateTime value="2022-08-03"></valueDateTime>
<valueDateTime value="2022-10-10"></valueDateTime>
</extension>
<extension url="frequency">
<valueDuration>
Expand All @@ -25,7 +25,7 @@
<subject>
<reference value="Patient/example-opioidcds"></reference>
</subject>
<authoredOn value="2022-08-03"></authoredOn>
<authoredOn value="2022-10-10"></authoredOn>
<reasonCode>
<coding>
<system value="http://snomed.info/sct"></system>
Expand Down
4 changes: 2 additions & 2 deletions input/examples/observation-example-opioidcds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<id value="example-opioidcds"></id>
<extension url="http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller">
<extension url="dateLastUpdated">
<valueDateTime value="2022-08-03"></valueDateTime>
<valueDateTime value="2022-10-10"></valueDateTime>
</extension>
<extension url="frequency">
<valueDuration>
Expand All @@ -23,7 +23,7 @@
<subject>
<reference value="Patient/example-opioidcds"></reference>
</subject>
<effectiveDateTime value="2022-08-03"></effectiveDateTime>
<effectiveDateTime value="2022-10-10"></effectiveDateTime>
<interpretation>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation"></system>
Expand Down
4 changes: 2 additions & 2 deletions input/examples/patient-example-opioidcds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<id value="example-opioidcds"></id>
<extension url="http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller">
<extension url="dateLastUpdated">
<valueDateTime value="2022-08-03"></valueDateTime>
<valueDateTime value="2022-10-10"></valueDateTime>
</extension>
<extension url="frequency">
<valueDuration>
Expand All @@ -18,7 +18,7 @@
<given value="opioidcds"></given>
</name>
<gender value="male"></gender>
<birthDate value="1982-04-14"></birthDate>
<birthDate value="1982-06-21"></birthDate>
<address>
<use value="home"></use>
<type value="postal"></type>
Expand Down
4 changes: 2 additions & 2 deletions input/examples/servicerequest-palliative-care.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "http://fhir.org/guides/cdc/opioid-cds/StructureDefinition/dataDateRoller",
"extension": [ {
"url": "dateLastUpdated",
"valueDateTime": "2022-08-24"
"valueDateTime": "2022-10-10"
}, {
"url": "frequency",
"valueDuration": {
Expand All @@ -28,5 +28,5 @@
"subject": {
"reference": "Patient/example-opioidcds"
},
"authoredOn": "2022-07-24"
"authoredOn": "2022-09-09"
}
18 changes: 9 additions & 9 deletions input/pagecontent/cql/OpioidCDSCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ define function "Prescription Relevant Period"(prescription FHIR.MedicationReque
)
then Interval[
date from prescription.authoredOn,
date from prescription.authoredOn + System.Quantity{ value: GetDurationInDays(prescription.dispenseRequest.expectedSupplyDuration), unit: 'days' }
date from prescription.authoredOn + GetDurationInDays(prescription.dispenseRequest.expectedSupplyDuration)
]
else null

Expand All @@ -254,14 +254,14 @@ define function GetDurationInDays(value FHIR.Duration):
if value is null then null
else
case
when value.code.value ~ 'a' then value.value.value * 365.0
when value.code.value ~ 'mo' then value.value.value * 30.0
when value.code.value ~ 'wk' then value.value.value * 7.0
when value.code.value ~ 'd' then value.value.value
when value.code.value ~ 'h' then value.value.value / 24.0
when value.code.value ~ 'min' then value.value.value / 60.0 / 24.0
when value.code.value ~ 's' then value.value.value / 60.0 / 60.0 / 24.0
when value.code.value ~ 'ms' then value.value.value / 60.0 / 60.0 / 24.0 / 1000.0
when value.code.value ~ 'a' then System.Quantity{ value: value.value.value * 365.0, unit: 'days' }
when value.code.value ~ 'mo' then System.Quantity{ value: value.value.value * 30.0, unit: 'days' }
when value.code.value ~ 'wk' then System.Quantity{ value: value.value.value * 7.0, unit: 'days' }
when value.code.value ~ 'd' then System.Quantity{ value: value.value.value, unit: 'days' }
when value.code.value ~ 'h' then System.Quantity{ value: value.value.value / 24.0, unit: 'days' }
when value.code.value ~ 'min' then System.Quantity{ value: value.value.value / 60.0 / 24.0, unit: 'days' }
when value.code.value ~ 's' then System.Quantity{ value: value.value.value / 60.0 / 60.0 / 24.0, unit: 'days' }
when value.code.value ~ 'ms' then System.Quantity{ value: value.value.value / 60.0 / 60.0 / 24.0 / 1000.0, unit: 'days' }
when value.code.value is null then Message(1000, true, 'Undefined', 'Error', 'Duration unit code is null')
else Message(1000, true, 'Undefined', 'Error', 'Unsupported duration unit code: ' + value.code.value)
end
Expand Down
2 changes: 1 addition & 1 deletion input/pagecontent/cql/OpioidCDSCommonConfig.cql
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ define "PDMP Data Not Reviewed in Past 90 Days Criteria Enabled":

// Recommendation 10
define "Opiate Urine Screening Check Enabled":
false
true

// Recommendation 12
define "Evidence Based Treatment Criteria For Opioid Use Disorder":
Expand Down
17 changes: 5 additions & 12 deletions input/pagecontent/cql/OpioidCDSREC01.cql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include OpioidCDSRoutines version '0.1.1' called Routines
**
** When
** Prescription is for treating acute pain
** Provider is prescribing an opioid with ambulatory misuse potential in the outpatient setting
** Provider is prescribing an opioid with ambulatory misuse potential
** Opioid review is useful for this patient:
** Patient is 18 or over
** Patient does not have findings indicating limited life expectancy
Expand Down Expand Up @@ -51,25 +51,18 @@ define "Acute Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptio
define "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential":
exists( "Acute Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" )

define "Is Recommendation Applicable?":
"Inclusion Criteria"
and not "Exclusion Criteria"

define "Patient Age Less Than 18":
if (Config."Age Less than 18 Years Is Enabled") then
AgeInYearsAt(Today()) < 18
else
false

define "Inclusion Criteria":
"Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential"
and not "Patient Age Less Than 18"
and Routines."Is Opioid Review Useful?"
and Routines."Is Opioid Naive?"

define "Exclusion Criteria":
false

define "Is Recommendation Applicable?":
"Inclusion Criteria"
and not "Exclusion Criteria"

define "Get Indicator":
if "Is Recommendation Applicable?"
then 'warning'
Expand Down
25 changes: 9 additions & 16 deletions input/pagecontent/cql/OpioidCDSREC02.cql
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,6 @@ define "Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescript
define "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential":
exists( "Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" )

define "Is Recommendation Applicable?":
"Inclusion Criteria"

define "Patient Age Less Than 18":
if (Config."Age Less than 18 Years Is Enabled") then
AgeInYearsAt(Today()) < 18
else
false

define "Inclusion Criteria":
"Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential"
and Routines."Is Opioid Naive?"
and not "Patient Age Less Than 18"
and Routines."Is Opioid Review Useful?"
and "No Opioid Treatment Plan Created, was Edited or Reviewed in Past 90 Days?"

define "No Opioid Treatment Plan Created, was Edited or Reviewed in Past 90 Days?":
Config."Opioid Treatment Plan Verification Enabled"
and not (
Expand Down Expand Up @@ -102,6 +86,15 @@ define "Had Opioid Treatment Plan Reviewed in Past 90 Days":
)
)

define "Inclusion Criteria":
"Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential"
and Routines."Is Opioid Review Useful?"
and Routines."Is Opioid Naive?"
and "No Opioid Treatment Plan Created, was Edited or Reviewed in Past 90 Days?"

define "Is Recommendation Applicable?":
"Inclusion Criteria"

define "Get Indicator":
if "Is Recommendation Applicable?"
then 'warning'
Expand Down
23 changes: 8 additions & 15 deletions input/pagecontent/cql/OpioidCDSREC03.cql
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,6 @@ define "Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescript
define "Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential":
exists( "Chronic Pain Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" )

define "Is Recommendation Applicable?":
"Inclusion Criteria"

define "Patient Age Less Than 18":
if (Config."Age Less than 18 Years Is Enabled") then
AgeInYearsAt(Today()) < 18
else
false

define "Inclusion Criteria":
"Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential"
and not "Patient Age Less Than 18"
and Routines."Is Opioid Review Useful?"
and "No Documented Discussions of Opioid Harms and Risks"

define "No Documented Discussions of Opioid Harms and Risks":
Config."Opioid Harms & Risks Discussion in Past 90 Days Criteria Enabled"
and not (
Expand All @@ -81,6 +66,14 @@ define "Ordered Discussions of Opioid Harms and Risks in Past 90 Days Excluding
[ServiceRequest: Common."Opioid counseling procedure"] SR
where SR.occurrence during day of "Opioid Harms & Risks Counseling Lookback Period"

define "Inclusion Criteria":
"Patient Is Being Prescribed Opioid Analgesic with Ambulatory Misuse Potential"
and Routines."Is Opioid Review Useful?"
and "No Documented Discussions of Opioid Harms and Risks"

define "Is Recommendation Applicable?":
"Inclusion Criteria"

define "Get Indicator":
if "Is Recommendation Applicable?"
then 'warning'
Expand Down
18 changes: 6 additions & 12 deletions input/pagecontent/cql/OpioidCDSREC04.cql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include OpioidCDSRoutines version '0.1.1' called Routines
** Prescribe immediate-release opioids instead of extended-release/long-acting (ER/LA) opioids
**
** When
** Provider is prescribing an extended release opioid with ambulatory misuse potential in the outpatient setting
** Provider is prescribing an extended release opioid with ambulatory misuse potential
** Prescription is for treating chronic pain.
** Opioid review is useful for this patient:
** Patient is 18 or over
Expand Down Expand Up @@ -44,24 +44,18 @@ define "Chronic Pain Extended Release Opioid Analgesic with Ambulatory Misuse Po
define "Patient Is Being Prescribed Extended Release Opioid Analgesic with Ambulatory Misuse Potential":
exists( "Chronic Pain Extended Release Opioid Analgesic with Ambulatory Misuse Potential Prescriptions" )

define "Is Recommendation Applicable?":
"Inclusion Criteria"
and not "Exclusion Criteria"

define "Patient Age Less Than 18":
if (Config."Age Less than 18 Years Is Enabled") then
AgeInYearsAt(Today()) < 18
else
false

define "Inclusion Criteria":
not "Patient Age Less Than 18"
"Patient Is Being Prescribed Extended Release Opioid Analgesic with Ambulatory Misuse Potential"
and Routines."Is Opioid Review Useful?"
and Routines."Is Opioid Naive?"

define "Exclusion Criteria":
Common."End of Life Assessment"

define "Is Recommendation Applicable?":
"Inclusion Criteria"
and not "Exclusion Criteria"

define "Get Indicator":
if "Is Recommendation Applicable?"
then 'warning'
Expand Down
Loading

0 comments on commit 36ee560

Please sign in to comment.