Skip to content

Commit c1ca06e

Browse files
#1488: Fixed MedicationNotRequested.reasonCode cardinality (#1491)
* #1488: Fixed MedicationNotRequested.reasonCode cardinality * Spotlessapply * Fix filename casing issues --------- Co-authored-by: Jonathan Percival <[email protected]>
1 parent 2cf8950 commit c1ca06e

15 files changed

+2834
-2
lines changed

Src/java/cql-to-elm/src/test/java/org/cqframework/cql/cql2elm/qicore/v600/BaseTest.java

Lines changed: 333 additions & 0 deletions
Large diffs are not rendered by default.

Src/java/cql-to-elm/src/test/resources/org/cqframework/cql/cql2elm/qicore/v600/CQMCommon-3.0.000.cql

Lines changed: 433 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
library FHIRHelpersToConceptError version '0.2.000'
2+
3+
using QICore version '6.0.0'
4+
5+
include FHIRHelpers version '4.0.1' called FHIRHelpers
6+
7+
parameter "Measurement Period" Interval<DateTime> default Interval[@2025-01-01T00:00:00Z, @2026-01-01T00:00:00Z)
8+
9+
context Patient
10+
11+
define "Minimal Repro":
12+
[MedicationNotRequested] NoStatinTherapyOrdered
13+
return NoStatinTherapyOrdered.reasonCode
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<library xmlns="urn:hl7-org:elm:r1" xmlns:t="urn:hl7-org:elm-types:r1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fhir="http://hl7.org/fhir" xmlns:qdm43="urn:healthit-gov:qdm:v4_3" xmlns:qdm53="urn:healthit-gov:qdm:v5_3" xmlns:a="urn:hl7-org:cql-annotations:r1" localId="0">
3+
<annotation translatorVersion="3.22.0-SNAPSHOT" translatorOptions="EnableAnnotations,EnableLocators,DisableListDemotion,DisableListPromotion" signatureLevel="All" xsi:type="a:CqlToElmInfo"/>
4+
<annotation xsi:type="a:Annotation">
5+
<a:s r="233">
6+
<a:s>library FHIRHelpersToConceptError version '0.2.000'</a:s>
7+
</a:s>
8+
</annotation>
9+
<identifier id="FHIRHelpersToConceptError" version="0.2.000"/>
10+
<schemaIdentifier id="urn:hl7-org:elm" version="r1"/>
11+
<usings>
12+
<def localId="1" localIdentifier="System" uri="urn:hl7-org:elm-types:r1"/>
13+
<def localId="206" locator="3:1-3:28" localIdentifier="QICore" uri="http://hl7.org/fhir">
14+
<annotation xsi:type="a:Annotation">
15+
<a:s r="206">
16+
<a:s>using </a:s>
17+
<a:s>
18+
<a:s>QICore</a:s>
19+
</a:s>
20+
<a:s> version '6.0.0'</a:s>
21+
</a:s>
22+
</annotation>
23+
</def>
24+
</usings>
25+
<includes>
26+
<def localId="207" locator="5:1-5:54" localIdentifier="FHIRHelpers" path="FHIRHelpers" version="4.0.1">
27+
<annotation xsi:type="a:Annotation">
28+
<a:s r="207">
29+
<a:s>include </a:s>
30+
<a:s>
31+
<a:s>FHIRHelpers</a:s>
32+
</a:s>
33+
<a:s> version '4.0.1' called FHIRHelpers</a:s>
34+
</a:s>
35+
</annotation>
36+
</def>
37+
</includes>
38+
<parameters>
39+
<def localId="208" locator="7:1-7:112" name="Measurement Period" accessLevel="Public">
40+
<annotation xsi:type="a:Annotation">
41+
<a:s r="208">
42+
<a:s>parameter &quot;Measurement Period&quot; </a:s>
43+
<a:s r="226">
44+
<a:s>Interval&lt;</a:s>
45+
<a:s r="227">
46+
<a:s>DateTime</a:s>
47+
</a:s>
48+
<a:s>></a:s>
49+
</a:s>
50+
<a:s> default </a:s>
51+
<a:s r="225">
52+
<a:s r="209">Interval[@2025-01-01T00:00:00Z, @2026-01-01T00:00:00Z)</a:s>
53+
</a:s>
54+
</a:s>
55+
</annotation>
56+
<default localId="225" locator="7:59-7:112" lowClosed="true" highClosed="false" xsi:type="Interval">
57+
<low localId="209" locator="7:68-7:88" xsi:type="DateTime">
58+
<year localId="210" valueType="t:Integer" value="2025" xsi:type="Literal"/>
59+
<month localId="211" valueType="t:Integer" value="1" xsi:type="Literal"/>
60+
<day localId="212" valueType="t:Integer" value="1" xsi:type="Literal"/>
61+
<hour localId="213" valueType="t:Integer" value="0" xsi:type="Literal"/>
62+
<minute localId="214" valueType="t:Integer" value="0" xsi:type="Literal"/>
63+
<second localId="215" valueType="t:Integer" value="0" xsi:type="Literal"/>
64+
<timezoneOffset localId="216" valueType="t:Decimal" value="0.0" xsi:type="Literal"/>
65+
</low>
66+
<high localId="217" locator="7:91-7:111" xsi:type="DateTime">
67+
<year localId="218" valueType="t:Integer" value="2026" xsi:type="Literal"/>
68+
<month localId="219" valueType="t:Integer" value="1" xsi:type="Literal"/>
69+
<day localId="220" valueType="t:Integer" value="1" xsi:type="Literal"/>
70+
<hour localId="221" valueType="t:Integer" value="0" xsi:type="Literal"/>
71+
<minute localId="222" valueType="t:Integer" value="0" xsi:type="Literal"/>
72+
<second localId="223" valueType="t:Integer" value="0" xsi:type="Literal"/>
73+
<timezoneOffset localId="224" valueType="t:Decimal" value="0.0" xsi:type="Literal"/>
74+
</high>
75+
</default>
76+
<parameterTypeSpecifier localId="226" locator="7:32-7:49" xsi:type="IntervalTypeSpecifier">
77+
<pointType localId="227" locator="7:41-7:48" name="t:DateTime" xsi:type="NamedTypeSpecifier"/>
78+
</parameterTypeSpecifier>
79+
</def>
80+
</parameters>
81+
<contexts>
82+
<def localId="231" locator="9:1-9:15" name="Patient"/>
83+
</contexts>
84+
<statements>
85+
<def localId="229" locator="9:1-9:15" name="Patient" context="Patient">
86+
<expression localId="230" xsi:type="SingletonFrom">
87+
<operand localId="228" locator="9:1-9:15" dataType="fhir:Patient" templateId="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient" xsi:type="Retrieve"/>
88+
</expression>
89+
</def>
90+
<def localId="233" locator="11:1-13:44" name="Minimal Repro" context="Patient" accessLevel="Public">
91+
<annotation xsi:type="a:Annotation">
92+
<a:s r="233">
93+
<a:s>define &quot;Minimal Repro&quot;:
94+
</a:s>
95+
<a:s r="244">
96+
<a:s>
97+
<a:s r="234">
98+
<a:s r="235">
99+
<a:s r="235">
100+
<a:s>[MedicationNotRequested]</a:s>
101+
</a:s>
102+
</a:s>
103+
<a:s> NoStatinTherapyOrdered</a:s>
104+
</a:s>
105+
</a:s>
106+
<a:s>
107+
</a:s>
108+
<a:s r="236">
109+
<a:s>return </a:s>
110+
<a:s r="239">
111+
<a:s r="237">
112+
<a:s>NoStatinTherapyOrdered</a:s>
113+
</a:s>
114+
<a:s>.</a:s>
115+
<a:s r="239">
116+
<a:s>reasonCode</a:s>
117+
</a:s>
118+
</a:s>
119+
</a:s>
120+
</a:s>
121+
</a:s>
122+
</annotation>
123+
<expression localId="244" locator="12:3-13:44" xsi:type="Query">
124+
<source localId="234" locator="12:3-12:49" alias="NoStatinTherapyOrdered">
125+
<expression localId="235" locator="12:3-12:26" dataType="fhir:MedicationRequest" templateId="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationnotrequested" xsi:type="Retrieve"/>
126+
</source>
127+
<return localId="236" locator="13:5-13:44">
128+
<expression localId="239" locator="13:12-13:44" xsi:type="Query">
129+
<source localId="240" alias="$this">
130+
<expression localId="238" path="reasonCode" scope="NoStatinTherapyOrdered" xsi:type="Property"/>
131+
</source>
132+
<return localId="243" distinct="false">
133+
<expression localId="241" name="ToConcept" libraryName="FHIRHelpers" xsi:type="FunctionRef">
134+
<operand localId="242" name="$this" xsi:type="AliasRef"/>
135+
</expression>
136+
</return>
137+
</expression>
138+
</return>
139+
</expression>
140+
</def>
141+
</statements>
142+
</library>
143+
144+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
NOTE: Preliminary QICore 6.0.0 uplift to support connectathon 38 testing
3+
*/
4+
library Hospice version '7.0.000'
5+
6+
using QICore version '6.0.0'
7+
8+
include FHIRHelpers version '4.0.1' called FHIRHelpers
9+
include QICoreCommon version '3.0.000' called QICoreCommon
10+
include Status version '2.0.000' called Status
11+
12+
codesystem "LOINC": 'http://loinc.org'
13+
codesystem "SNOMEDCT": 'http://snomed.info/sct'
14+
15+
valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
16+
valueset "Hospice Care Ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1584'
17+
valueset "Hospice Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1003'
18+
valueset "Hospice Diagnosis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165'
19+
20+
code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT" display 'Discharge to healthcare facility for hospice care (procedure)'
21+
code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT" display 'Discharge to home for hospice care (procedure)'
22+
code "Hospice care [Minimum Data Set]": '45755-6' from "LOINC" display 'Hospice care [Minimum Data Set]'
23+
code "Yes (qualifier value)": '373066001' from "SNOMEDCT" display 'Yes (qualifier value)'
24+
25+
parameter "Measurement Period" Interval<DateTime>
26+
27+
context Patient
28+
29+
define "Has Hospice Services":
30+
exists ((([Encounter: type in "Encounter Inpatient"]).isEncounterPerformed()) InpatientEncounter
31+
where (InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)"
32+
or InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)"
33+
)
34+
and InpatientEncounter.period.toInterval() ends during day of "Measurement Period"
35+
)
36+
or exists ((([Encounter: type in "Hospice Encounter"]).isEncounterPerformed()) HospiceEncounter
37+
where HospiceEncounter.period.toInterval() overlaps day of "Measurement Period"
38+
)
39+
or exists ((([ObservationScreeningAssessment: "Hospice care [Minimum Data Set]"]).isAssessmentPerformed()) HospiceAssessment
40+
where (HospiceAssessment as ObservationScreeningAssessment).value ~ "Yes (qualifier value)"
41+
and HospiceAssessment.effective.toInterval() overlaps day of "Measurement Period"
42+
)
43+
or exists ((([ServiceRequest: "Hospice Care Ambulatory"]).isInterventionOrder()) HospiceOrder
44+
where HospiceOrder.authoredOn.toInterval() during day of "Measurement Period"
45+
// and HospiceOrder.doNotPerform is not true
46+
// https://oncprojectracking.healthit.gov/support/browse/CQLIT-447
47+
)
48+
or exists ((([Procedure: "Hospice Care Ambulatory"]).isInterventionPerformed()) HospicePerformed
49+
where HospicePerformed.performed.toInterval() overlaps day of "Measurement Period"
50+
)
51+
or exists ((([ConditionProblemsHealthConcerns: "Hospice Diagnosis"])
52+
union ([ConditionEncounterDiagnosis: "Hospice Diagnosis"])) HospiceCareDiagnosis
53+
where HospiceCareDiagnosis.prevalenceInterval() overlaps day of "Measurement Period"
54+
)

0 commit comments

Comments
 (0)