Skip to content

Commit 4b2f850

Browse files
committed
Updated measles for decision tables and various updates to complete or fix problems with the scripts based on the current DAK.
1 parent b5d2d90 commit 4b2f850

File tree

67 files changed

+1929
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1929
-19
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ bundles
1010
node_modules/
1111
outputs/*
1212
node_modules
13+
input/vocabulary/valueset/external/

input/cql/IMMZConcepts.cql

+2
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ valueset "MCV Vaccine": 'http://smart.who.int/immunizations/ValueSet/IMMZ.Z.DE9'
1717

1818
valueset "BCG Vaccine": 'http://smart.who.int/immunizations/ValueSet/IMMZ.Z.DE1'
1919
valueset "Cholera Vaccine": 'http://smart.who.int/immunizations/ValueSet/IMMZ.Z.DE2'
20+
21+
code "Completed the primary vaccination series": 'DE203' from "IMMZD" display 'Completed the primary vaccination series'
+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
2+
/*
3+
* Library: IMMZD2DTMeaslesDose0 (IMMZ.D2.DT.Measles.MCV dose 0)
4+
* Rule: Determine if the client is due for a measles vaccination according to the national immunization schedule
5+
* Decision Table: Measles-containing vaccine dose 0 (MCV0) administration
6+
* Trigger: IMMZ.D2 Determine required vaccination(s) if any
7+
*/
8+
library IMMZD2DTMeaslesDose0
9+
10+
using FHIR version '4.0.1'
11+
include FHIRHelpers version '4.0.1'
12+
13+
include IMMZCommon called Common
14+
include IMMZConcepts called Concepts
15+
16+
include IMMZEncounterElements called IE
17+
include IMMZD2DTMeaslesEncounterElements called Encounter
18+
19+
parameter Today default Today()
20+
21+
context Patient
22+
23+
24+
/*
25+
@dynamicValue: Guidance
26+
*/
27+
define "Guidance":
28+
case
29+
when "Client is not due for MCV0" then "Client is not due for MCV0 Guidance"
30+
when "Consider MCV0." then "Consider MCV0. Guidance"
31+
else ''
32+
end
33+
34+
/*
35+
@output: Client is not due for MCV0 Case 1
36+
@pseudocode: "Immunization recommendation status" = "Not due"
37+
*/
38+
define "Client is not due for MCV0 Case 1":
39+
IE."Client's age is less than 6 months"
40+
41+
/*
42+
@output: Client is not due for MCV0 Case 2
43+
@pseudocode: "Immunization recommendation status" = "Not due"
44+
*/
45+
define "Client is not due for MCV0 Case 2":
46+
Encounter."MCV0 was not administered"
47+
and IE."Client's age is between 6 months and 9 months"
48+
and IE."Live vaccine was administered in the last 4 weeks"
49+
50+
/*
51+
@output: Client is not due for MCV0 Case 3
52+
@pseudocode: "Immunization recommendation status" = "Not due"
53+
*/
54+
define "Client is not due for MCV0 Case 3":
55+
IE."Client's age is more than or equal to 9 months"
56+
57+
/*
58+
@output: Client is not due for MCV0 Case 4
59+
@pseudocode: "Immunization recommendation status" = "Not due"
60+
*/
61+
define "Client is not due for MCV0 Case 4":
62+
Encounter."MCV0 was administered"
63+
64+
/*
65+
@output: Client is not due for MCV0
66+
@pseudocode: "Immunization recommendation status" = "Not due"
67+
*/
68+
define "Client is not due for MCV0":
69+
"Client is not due for MCV0 Case 1"
70+
or "Client is not due for MCV0 Case 2"
71+
or "Client is not due for MCV0 Case 3"
72+
or "Client is not due for MCV0 Case 4"
73+
74+
/*
75+
@output: Client is not due for MCV0 Guidance
76+
@guidance: Should not vaccinate client with MCV0 as client's age is less than 6 months. Check for any vaccines due and inform the caregiver of when to come back for MCV0.
77+
@guidance: Should not vaccinate client with MCV0 as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for MCV0.
78+
@guidance: Should not vaccinate client with MCV0 as client's age is more than 9 months.
79+
Check measles routine immunization schedule.
80+
@guidance: MCV0 was administered.
81+
Check measles routine immunization schedule.
82+
*/
83+
define "Client is not due for MCV0 Guidance":
84+
case
85+
when "Client is not due for MCV0 Case 1" then 'Should not vaccinate client with MCV0 as client\'s age is less than 6 months. Check for any vaccines due and inform the caregiver of when to come back for MCV0.'
86+
when "Client is not due for MCV0 Case 2" then 'Should not vaccinate client with MCV0 as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for MCV0.'
87+
when "Client is not due for MCV0 Case 3" then 'Should not vaccinate client with MCV0 as client\'s age is more than 9 months.
88+
Check measles routine immunization schedule.'
89+
when "Client is not due for MCV0 Case 4" then 'MCV0 was administered.
90+
Check measles routine immunization schedule.'
91+
else ''
92+
end
93+
94+
/*
95+
@output: Consider MCV0.
96+
@pseudocode: Create a clinical note.
97+
*/
98+
define "Consider MCV0.":
99+
Encounter."MCV0 was not administered"
100+
and IE."Client's age is between 6 months and 9 months"
101+
and IE."No live vaccine was administered in the last 4 weeks"
102+
103+
/*
104+
@output: Consider MCV0. Guidance
105+
@guidance: May vaccinate client with MCV0 as client is within appropriate age range, MCV0 was not administered and no live vaccine was administered in the past 4 weeks. Check if one of the MCV0 specific scenarios is applicable.
106+
*/
107+
define "Consider MCV0. Guidance":
108+
'May vaccinate client with MCV0 as client is within appropriate age range, MCV0 was not administered and no live vaccine was administered in the past 4 weeks. Check if one of the MCV0 specific scenarios is applicable.'
109+
110+
111+
/*
112+
@test: Test expected results based on example patients
113+
*/
114+
define "Test Validation":
115+
case
116+
when Patient.id = '36.Alt6m' then "Client is not due for MCV0 Case 1" and "Guidance" = 'Should not vaccinate client with MCV0 as client\'s age is less than 6 months. Check for any vaccines due and inform the caregiver of when to come back for MCV0.'
117+
when Patient.id = '37.Abt6m9mLVlt4w' then "Client is not due for MCV0 Case 2" and "Guidance" = 'Should not vaccinate client with MCV0 as live vaccine was administered in the past 4 weeks. Check for any vaccines due and inform the caregiver of when to come back for MCV0.'
118+
when Patient.id = '38.Abt6m9mLVgt4w' then "Consider MCV0." and "Guidance" = 'May vaccinate client with MCV0 as client is within appropriate age range, MCV0 was not administered and no live vaccine was administered in the past 4 weeks. Check if one of the MCV0 specific scenarios is applicable.'
119+
when Patient.id = '39.Agt9m' then "Client is not due for MCV0 Case 3" and "Guidance" = 'Should not vaccinate client with MCV0 as client\'s age is more than 9 months.
120+
Check measles routine immunization schedule.'
121+
when Patient.id = '40.D1' then "Client is not due for MCV0 Case 4" and "Guidance" = 'MCV0 was administered.
122+
Check measles routine immunization schedule.'
123+
else 'No test case set'
124+
end

input/cql/IMMZD2DTMeaslesElements.cql

+70
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,40 @@ define "MCV Primary Series Doses Administered to Patient":
3434
where
3535
exists( I.protocolApplied pa where pa.series = 'Primary series' )
3636

37+
/*
38+
@internal: MCV containing Doses Administered to Patient that are in the Dose 0 series
39+
*/
40+
define "MCV Dose 0 Doses Administered to Patient":
41+
"MCV Doses Administered to Patient" I
42+
where
43+
exists( I.protocolApplied pa where pa.series = 'Dose 0' )
44+
45+
/*
46+
@internal: MCV containing Doses Administered to Patient that are in the Supplementary series
47+
*/
48+
define "MCV Supplementary Doses Administered to Patient":
49+
"MCV Doses Administered to Patient" I
50+
where
51+
exists( I.protocolApplied pa where pa.series = 'Supplementary dose' )
52+
3753
/*
3854
@internal: Number of MCV Primary Series doses
3955
*/
4056
define "Number of MCV Primary Series Doses Administered":
4157
Count("MCV Primary Series Doses Administered to Patient")
4258

59+
/*
60+
@internal: Number of MCV Dose 0 doses
61+
*/
62+
define "Number of MCV Dose 0 Doses Administered":
63+
Count("MCV Dose 0 Doses Administered to Patient")
64+
65+
/*
66+
@internal: Number of Supplementary doses
67+
*/
68+
define "Number of MCV Supplementary Doses Administered":
69+
Count("MCV Supplementary Doses Administered to Patient")
70+
4371
/*
4472
@input: No measles primary series doses were administered
4573
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Primary series") = 0
@@ -61,3 +89,45 @@ define "MCV1 was administered":
6189
define "MCV2 was administered":
6290
"Number of MCV Primary Series Doses Administered" = 2
6391

92+
/*
93+
@input: MCV0 was not administered
94+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines
95+
" and "Type of dose" = "Dose 0") = 0
96+
*/
97+
define "MCV0 was not administered":
98+
"Number of MCV Dose 0 Doses Administered" = 0
99+
100+
/*
101+
@input: MCV0 was administered
102+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines
103+
" and "Type of dose" = "Dose 0") = 1
104+
*/
105+
define "MCV0 was administered":
106+
"Number of MCV Dose 0 Doses Administered" = 1
107+
108+
/*
109+
@input: Measles supplementary dose was not administered
110+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines
111+
" and "Type of dose" = "Supplementary dose") = 0
112+
*/
113+
define "Measles supplementary dose was not administered":
114+
"Number of MCV Supplementary Doses Administered" = 0
115+
116+
/*
117+
@input: Measles supplementary dose was administered
118+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines
119+
" and "Type of dose" = "Supplementary dose") = 1
120+
*/
121+
define "Measles supplementary dose was administered":
122+
"Number of MCV Supplementary Doses Administered" = 1
123+
124+
/*
125+
@input: Measles routine immunization schedule is complete
126+
@pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Measles-
127+
containing vaccines")
128+
*/
129+
define "Measles routine immunization schedule is complete":
130+
[Observation : Concepts."Completed the primary vaccination series"] O where O.value = true
131+
or
132+
"MCV2 was administered"
133+

input/cql/IMMZD2DTMeaslesEncounterElements.cql

+71-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ context Patient
2727
@internal: MCV containing Doses Administered to Patient
2828
*/
2929
define "MCV Doses Administered to Patient":
30-
Encounter."Doses Administered to Patient" I
30+
MeaslesElements."MCV Doses Administered to Patient" I
3131
where
3232
I.occurrence.toInterval() on or before Today
3333

@@ -39,12 +39,40 @@ define "MCV Primary Series Doses Administered to Patient":
3939
where
4040
I.occurrence.toInterval() on or before Today
4141

42+
/*
43+
@internal: MCV containing Doses Administered to Patient that are in the Dose 0
44+
*/
45+
define "MCV Dose 0 Doses Administered to Patient":
46+
MeaslesElements."MCV Dose 0 Doses Administered to Patient" I
47+
where
48+
I.occurrence.toInterval() on or before Today
49+
50+
/*
51+
@internal: MCV containing Doses Administered to Patient that are in the Supplementary dose
52+
*/
53+
define "MCV Supplementary Doses Administered to Patient":
54+
MeaslesElements."MCV Supplementary Doses Administered to Patient" I
55+
where
56+
I.occurrence.toInterval() on or before Today
57+
4258
/*
4359
@internal: Number of MCV Primary Series doses
4460
*/
4561
define "Number of MCV Primary Series Doses Administered":
4662
Count("MCV Primary Series Doses Administered to Patient")
4763

64+
/*
65+
@internal: Number of MCV Dose 0 doses
66+
*/
67+
define "Number of MCV Dose 0 Doses Administered":
68+
Count("MCV Dose 0 Doses Administered to Patient")
69+
70+
/*
71+
@internal: Number of MCV Supplementary doses
72+
*/
73+
define "Number of MCV Supplementary Doses Administered":
74+
Count("MCV Supplementary Doses Administered to Patient")
75+
4876
/*
4977
@input: No measles primary series doses were administered
5078
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Primary series") = 0
@@ -66,3 +94,45 @@ define "MCV1 was administered":
6694
define "MCV2 was administered":
6795
"Number of MCV Primary Series Doses Administered" = 2
6896

97+
/*
98+
@input: MCV0 was not administered
99+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines
100+
" and "Type of dose" = "Dose 0") = 0
101+
*/
102+
define "MCV0 was not administered":
103+
"Number of MCV Dose 0 Doses Administered" = 0
104+
105+
/*
106+
@input: MCV0 was administered
107+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines
108+
" and "Type of dose" = "Dose 0") = 1
109+
*/
110+
define "MCV0 was administered":
111+
"Number of MCV Dose 0 Doses Administered" = 1
112+
113+
114+
/*
115+
@input: Measles supplementary dose was not administered
116+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines
117+
" and "Type of dose" = "Supplementary dose") = 0
118+
*/
119+
define "Measles supplementary dose was not administered":
120+
"Number of MCV Supplementary Doses Administered" = 0
121+
122+
/*
123+
@input: Measles supplementary dose was administered
124+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines
125+
" and "Type of dose" = "Supplementary dose") = 1
126+
*/
127+
define "Measles supplementary dose was administered":
128+
"Number of MCV Supplementary Doses Administered" = 1
129+
130+
/*
131+
@input: Measles routine immunization schedule is complete
132+
@pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Measles-
133+
containing vaccines")
134+
*/
135+
define "Measles routine immunization schedule is complete":
136+
exists( [Observation : Concepts."Completed the primary vaccination series"] O where O.value = true and O.effective.toInterval() on or before Today )
137+
or
138+
"MCV2 was administered"

0 commit comments

Comments
 (0)