Skip to content

Commit 3425c34

Browse files
committed
Add FHIR Coding Equivalent CQL Code CQL Test
This test uses Encounter.class which is a Coding in R4 to test that the equivalent (~) operator works on FHIR Coding and CQL Code. The test also has a version on one of the Encounter classes to test that equivalent ignores the version of a Coding.
1 parent dcc5866 commit 3425c34

File tree

4 files changed

+177
-8
lines changed

4 files changed

+177
-8
lines changed

modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/measure_test.clj

+3-1
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,8 @@
937937

938938
(testing-query "q60-medication" 2)
939939

940+
(testing-query "q61-encounter-class" 2)
941+
940942
(let [result (evaluate "q1" "subject-list")]
941943
(testing "MeasureReport is valid"
942944
(is (s/valid? :blaze/resource (:resource result))))
@@ -1199,4 +1201,4 @@
11991201

12001202
(comment
12011203
(log/set-min-level! :debug)
1202-
(evaluate "q60-medication"))
1204+
(evaluate "q61-encounter-class"))

modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q38-di-surv.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"resource": {
77
"resourceType": "Patient",
88
"id": "0",
9-
"gender": "male",
109
"birthDate": "2020"
1110
},
1211
"request": {
@@ -21,16 +20,13 @@
2120
},
2221
"request": {
2322
"method": "PUT",
24-
"url": "Patient/1",
25-
"gender": "female",
26-
"birthDate": "2019"
23+
"url": "Patient/1"
2724
}
2825
},
2926
{
3027
"resource": {
3128
"resourceType": "Patient",
3229
"id": "2",
33-
"gender": "male",
3430
"birthDate": "2019"
3531
},
3632
"request": {
@@ -42,7 +38,6 @@
4238
"resource": {
4339
"resourceType": "Patient",
4440
"id": "3",
45-
"gender": "female",
4641
"birthDate": "2018"
4742
},
4843
"request": {
@@ -54,7 +49,6 @@
5449
"resource": {
5550
"resourceType": "Patient",
5651
"id": "4",
57-
"gender": "male",
5852
"birthDate": "2000"
5953
},
6054
"request": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
library "q61-encounter-class"
2+
using FHIR version '4.0.0'
3+
include FHIRHelpers version '4.0.0'
4+
5+
codesystem foo: 'system-120749'
6+
7+
context Patient
8+
9+
define InInitialPopulation:
10+
exists (from [Encounter] E
11+
where E.class ~ Code 'code-120753' from foo)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
"resourceType": "Bundle",
3+
"type": "transaction",
4+
"entry": [
5+
{
6+
"resource": {
7+
"resourceType": "Patient",
8+
"id": "0"
9+
},
10+
"request": {
11+
"method": "PUT",
12+
"url": "Patient/0"
13+
}
14+
},
15+
{
16+
"resource": {
17+
"resourceType": "Patient",
18+
"id": "1"
19+
},
20+
"request": {
21+
"method": "PUT",
22+
"url": "Patient/1"
23+
}
24+
},
25+
{
26+
"resource": {
27+
"resourceType": "Patient",
28+
"id": "2"
29+
},
30+
"request": {
31+
"method": "PUT",
32+
"url": "Patient/2"
33+
}
34+
},
35+
{
36+
"resource": {
37+
"resourceType": "Patient",
38+
"id": "3"
39+
},
40+
"request": {
41+
"method": "PUT",
42+
"url": "Patient/3"
43+
}
44+
},
45+
{
46+
"resource": {
47+
"resourceType": "Encounter",
48+
"id": "0",
49+
"class": {
50+
"system": "system-120749",
51+
"code": "code-120753"
52+
},
53+
"subject": {
54+
"reference": "Patient/0"
55+
}
56+
},
57+
"request": {
58+
"method": "PUT",
59+
"url": "Encounter/0"
60+
}
61+
},
62+
{
63+
"resource": {
64+
"resourceType": "Encounter",
65+
"id": "1",
66+
"class": {
67+
"system": "system-120749",
68+
"code": "code-120826"
69+
},
70+
"subject": {
71+
"reference": "Patient/1"
72+
}
73+
},
74+
"request": {
75+
"method": "PUT",
76+
"url": "Encounter/1"
77+
}
78+
},
79+
{
80+
"resource": {
81+
"resourceType": "Encounter",
82+
"id": "2",
83+
"class": {
84+
"system": "system-120749",
85+
"code": "code-120753",
86+
"version": "version-120852"
87+
},
88+
"subject": {
89+
"reference": "Patient/2"
90+
}
91+
},
92+
"request": {
93+
"method": "PUT",
94+
"url": "Encounter/2"
95+
}
96+
},
97+
{
98+
"resource": {
99+
"resourceType": "Encounter",
100+
"id": "3",
101+
"subject": {
102+
"reference": "Patient/3"
103+
}
104+
},
105+
"request": {
106+
"method": "PUT",
107+
"url": "Encounter/3"
108+
}
109+
},
110+
{
111+
"resource": {
112+
"resourceType": "Measure",
113+
"id": "0",
114+
"url": "0",
115+
"status": "active",
116+
"subjectCodeableConcept": {
117+
"coding": [
118+
{
119+
"system": "http://hl7.org/fhir/resource-types",
120+
"code": "Patient"
121+
}
122+
]
123+
},
124+
"library": [
125+
"0"
126+
],
127+
"scoring": {
128+
"coding": [
129+
{
130+
"system": "http://terminology.hl7.org/CodeSystem/measure-scoring",
131+
"code": "cohort"
132+
}
133+
]
134+
},
135+
"group": [
136+
{
137+
"population": [
138+
{
139+
"code": {
140+
"coding": [
141+
{
142+
"system": "http://terminology.hl7.org/CodeSystem/measure-population",
143+
"code": "initial-population"
144+
}
145+
]
146+
},
147+
"criteria": {
148+
"language": "text/cql-identifier",
149+
"expression": "InInitialPopulation"
150+
}
151+
}
152+
]
153+
}
154+
]
155+
},
156+
"request": {
157+
"method": "PUT",
158+
"url": "Measure/0"
159+
}
160+
}
161+
]
162+
}

0 commit comments

Comments
 (0)