Skip to content

Commit 154223c

Browse files
committed
Added in contraindications and created script for scheduling tables and created resources for the first one to test.
1 parent 4e0fa50 commit 154223c

File tree

52 files changed

+1726
-16
lines changed

Some content is hidden

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

52 files changed

+1726
-16
lines changed

input/cql/IMMZConcepts.cql

+9-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,12 @@ valueset "MCV Vaccine": 'http://smart.who.int/immunizations/ValueSet/IMMZ.Z.DE9'
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'
2020

21-
code "Completed the primary vaccination series": 'DE203' from "IMMZD" display 'Completed the primary vaccination series'
21+
code "Completed the primary vaccination series": 'DE203' from "IMMZD" display 'Completed the primary vaccination series'
22+
23+
code "Potential contraindications": 'DE161' from "IMMZD" display 'Potential contraindications'
24+
code "Currently pregnant": 'DE162' from "IMMZD" display 'Currently pregnant'
25+
code "History of anaphylactic reactions": 'DE166' from "IMMZD" display 'History of anaphylactic reactions'
26+
code "Severe allergic reactions": 'DE167' from "IMMZD" display 'Severe allergic reactions'
27+
code "Severely immunocompromised": 'DE200' from "IMMZD" display 'Severely immunocompromised'
28+
code "Severely immunosuppressed": 'DE165' from "IMMZD" display 'Severely immunosuppressed'
29+
code "Symptomatic HIV infection": 'DE168' from "IMMZD" display 'Symptomatic HIV infection'
+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
2+
/*
3+
* Library: IMMZD18SMeaslesOngoingTx (IMMZ.D18.S.Measles.Ongoing transmission schedule)
4+
* Schedule Table: Countries with ongoing transmission in which the risk of measles mortality remains high (countries that provide first dose of measles-containing vaccine (MCV) at 9 months and second dose of MCV at 15 months)
5+
*/
6+
library IMMZD18SMeaslesOngoingTx
7+
8+
using FHIR version '4.0.1'
9+
include FHIRHelpers version '4.0.1'
10+
11+
include WHOCommon called WC
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+
@output: MCV dose 1 (MCV1)
26+
@description: Provision of MCV1 from the primary series
27+
@trigger: Child's birth
28+
@triggerDate: "Date of birth"
29+
*/
30+
define "MCV dose 1 (MCV1)":
31+
not "MCV1 was administered"
32+
33+
/*
34+
@output: MCV dose 1 (MCV1) Create
35+
@create: The client is due for MCV1 if the client is at least 9 months of age.
36+
*/
37+
define "MCV dose 1 (MCV1) Create":
38+
if "MCV dose 1 (MCV1)"
39+
then 'The client is due for MCV1 if the client is at least 9 months of age.
40+
Due Date: ' + ToString("MCV dose 1 (MCV1) Due Date")
41+
else ''
42+
43+
/*
44+
@dynamicValue: MCV dose 1 (MCV1) Due Date
45+
@pseudocode: "Date of birth" + 9 months
46+
*/
47+
define "MCV dose 1 (MCV1) Due Date":
48+
if "MCV dose 1 (MCV1)" then Max({
49+
Patient.birthDate + 9 months,
50+
IE."Date of Latest Live Attenuated Vaccine" + 4 weeks
51+
})
52+
else null
53+
54+
/*
55+
@dynanmicValue: MCV dose 1 (MCV1) Overdue
56+
@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.
57+
*/
58+
define "MCV dose 1 (MCV1) Overdue":
59+
null
60+
61+
/*
62+
@dynanmicValue: MCV dose 1 (MCV1) Expiration
63+
@pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated.
64+
*/
65+
define "MCV dose 1 (MCV1) Expiration":
66+
null
67+
68+
/*
69+
@complete: MCV1 was administered
70+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Primary series") = 1
71+
*/
72+
define "MCV1 was administered":
73+
Encounter."MCV1 was administered"
74+
75+
/*
76+
@output: MCV2
77+
@description: Provision of the MCV2 from the primary series
78+
@trigger: MCV1 was administered
79+
Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Primary series") = 1
80+
@triggerDate: "Date of birth"
81+
*/
82+
define "MCV2":
83+
"MCV1 was administered" and not "MCV2 was administered. The primary series has been completed."
84+
85+
/*
86+
@output: MCV2 Create
87+
@create: The client is due for MCV2 if the client is at least 15 months of age.
88+
*/
89+
define "MCV2 Create":
90+
if "MCV2"
91+
then 'The client is due for MCV2 if the client is at least 15 months of age.
92+
Due Date: ' + ToString("MCV2 Due Date")
93+
else ''
94+
95+
/*
96+
@dynamicValue: MCV2 Due Date
97+
@pseudocode: "Date of birth" + 15 months
98+
*/
99+
define "MCV2 Due Date":
100+
if "MCV2" then Max({
101+
Patient.birthDate + 15 months,
102+
IE."Date of Latest Live Attenuated Vaccine" + 4 weeks
103+
})
104+
else null
105+
/*
106+
@dynanmicValue: MCV2 Overdue
107+
@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.
108+
*/
109+
define "MCV2 Overdue":
110+
null
111+
112+
/*
113+
@dynanmicValue: MCV2 Expiration
114+
@pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated.
115+
*/
116+
define "MCV2 Expiration":
117+
null
118+
119+
/*
120+
@complete: MCV2 was administered. The primary series has been completed.
121+
@pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Measles-containing vaccines")
122+
*/
123+
define "MCV2 was administered. The primary series has been completed.":
124+
Encounter."MCV2 was administered"
125+
126+
127+
/*
128+
@test: Test expected results based on example patients
129+
*/
130+
define "Test Validation":
131+
case
132+
when Patient.id = '07.Alt9m' then "MCV dose 1 (MCV1)"
133+
when Patient.id = '07.Agt9m' then "MCV dose 1 (MCV1)"
134+
when Patient.id = '07.Agt9mLVlt4w' then "MCV dose 1 (MCV1)"
135+
when Patient.id = '08.D1Alt15m' then "MCV2"
136+
when Patient.id = '08.D1Agt15mLVlt4w' then "MCV2"
137+
when Patient.id = '08.D2' then not "MCV2" and not "MCV dose 1 (MCV1)"
138+
else 'No test case set'
139+
end

input/cql/IMMZD2DTMeaslesDose0Logic.cql

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ define "Guidance":
3131
else ''
3232
end
3333

34+
define "Has Guidance":
35+
"Guidance" is not null and "Guidance" != ''
36+
3437
/*
3538
@output: Client is not due for MCV0 Case 1
3639
@pseudocode: "Immunization recommendation status" = "Not due"

input/cql/IMMZD2DTMeaslesElements.cql

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ define "No measles primary series doses were administered":
8080
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Primary series") = 1
8181
*/
8282
define "MCV1 was administered":
83-
"Number of MCV Primary Series Doses Administered" = 1
83+
"Number of MCV Primary Series Doses Administered" >= 1
8484

8585
/*
8686
@input: MCV2 was administered
8787
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Primary series") = 2
8888
*/
8989
define "MCV2 was administered":
90-
"Number of MCV Primary Series Doses Administered" = 2
90+
"Number of MCV Primary Series Doses Administered" >= 2
9191

9292
/*
9393
@input: MCV0 was not administered
@@ -103,7 +103,7 @@ define "MCV0 was not administered":
103103
" and "Type of dose" = "Dose 0") = 1
104104
*/
105105
define "MCV0 was administered":
106-
"Number of MCV Dose 0 Doses Administered" = 1
106+
"Number of MCV Dose 0 Doses Administered" >= 1
107107

108108
/*
109109
@input: Measles supplementary dose was not administered
@@ -119,7 +119,7 @@ define "Measles supplementary dose was not administered":
119119
" and "Type of dose" = "Supplementary dose") = 1
120120
*/
121121
define "Measles supplementary dose was administered":
122-
"Number of MCV Supplementary Doses Administered" = 1
122+
"Number of MCV Supplementary Doses Administered" >= 1
123123

124124
/*
125125
@input: Measles routine immunization schedule is complete

input/cql/IMMZD2DTMeaslesEncounterElements.cql

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ define "No measles primary series doses were administered":
8585
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Primary series") = 1
8686
*/
8787
define "MCV1 was administered":
88-
"Number of MCV Primary Series Doses Administered" = 1
88+
"Number of MCV Primary Series Doses Administered" >= 1
8989

9090
/*
9191
@input: MCV2 was administered
9292
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Primary series") = 2
9393
*/
9494
define "MCV2 was administered":
95-
"Number of MCV Primary Series Doses Administered" = 2
95+
"Number of MCV Primary Series Doses Administered" >= 2
9696

9797
/*
9898
@input: MCV0 was not administered
@@ -108,7 +108,7 @@ define "MCV0 was not administered":
108108
" and "Type of dose" = "Dose 0") = 1
109109
*/
110110
define "MCV0 was administered":
111-
"Number of MCV Dose 0 Doses Administered" = 1
111+
"Number of MCV Dose 0 Doses Administered" >= 1
112112

113113

114114
/*
@@ -125,7 +125,7 @@ define "Measles supplementary dose was not administered":
125125
" and "Type of dose" = "Supplementary dose") = 1
126126
*/
127127
define "Measles supplementary dose was administered":
128-
"Number of MCV Supplementary Doses Administered" = 1
128+
"Number of MCV Supplementary Doses Administered" >= 1
129129

130130
/*
131131
@input: Measles routine immunization schedule is complete

input/cql/IMMZD2DTMeaslesSupplementaryLogic.cql

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ define "Guidance":
3232
else ''
3333
end
3434

35+
define "Has Guidance":
36+
"Guidance" is not null and "Guidance" != ''
37+
3538
/*
3639
@output: Client is not due for measles supplementary dose
3740
@pseudocode: "Immunization recommendation status" = "Not due"

input/cql/IMMZD5DTMeaslesCILogic.cql

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
2+
/*
3+
* Library: IMMZD5DTMeaslesCI (–)
4+
* Rule: undefined
5+
* Decision Table: Trigger
6+
* Trigger: IMMZ.D5.DT.Measles contraindications
7+
*/
8+
library IMMZD5DTMeaslesCI
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 IMMZElements called Elements
17+
18+
include IMMZEncounterElements called IE
19+
include IMMZD5DTMeaslesEncounterElements called Encounter
20+
21+
parameter Today default Today()
22+
23+
context Patient
24+
25+
/*
26+
@internal: Draft Medication Request for MCV dose
27+
*/
28+
define "Draft Medication Request for MCV dose":
29+
[MedicationRequest: Concepts."MCV Vaccine"] MR where MR.status = 'draft' and MR.intent = 'proposal'
30+
sort by date from (authoredOn as FHIR.dateTime) desc
31+
32+
/*
33+
@dynamicValue: Draft Medication Request ID for MCV dose
34+
*/
35+
define "Draft Medication Request ID for MCV dose":
36+
First("Draft Medication Request for MCV dose").id
37+
38+
/*
39+
@dynamicValue: Guidance
40+
*/
41+
define "Guidance":
42+
case
43+
when "Measles vaccination contraindicated" then "Measles vaccination contraindicated Guidance"
44+
when "Measles vaccination could be contraindicated. Clinical judgement required. Create a clinical note" then "Measles vaccination could be contraindicated. Clinical judgement required. Create a clinical note Guidance"
45+
when "Clinical judgement required. Create a clinical note" then "Clinical judgement required. Create a clinical note Guidance"
46+
else ''
47+
end
48+
49+
define "Has Guidance":
50+
"Guidance" is not null and "Guidance" != ''
51+
52+
/*
53+
@output: Measles vaccination contraindicated Case 1
54+
@pseudocode: "Immunization recommendation status" = "Contraindicated"
55+
*/
56+
define "Measles vaccination contraindicated Case 1":
57+
Encounter."The client is pregnant"
58+
59+
/*
60+
@output: Measles vaccination contraindicated Case 2
61+
@pseudocode: "Immunization recommendation status" = "Contraindicated"
62+
*/
63+
define "Measles vaccination contraindicated Case 2":
64+
Encounter."The client is severely immunosuppressed"
65+
66+
/*
67+
@output: Measles vaccination contraindicated
68+
@pseudocode: "Immunization recommendation status" = "Contraindicated"
69+
*/
70+
define "Measles vaccination contraindicated":
71+
"Measles vaccination contraindicated Case 1"
72+
or "Measles vaccination contraindicated Case 2"
73+
74+
/*
75+
@output: Measles vaccination contraindicated Guidance
76+
@guidance: Do not vaccinate client with measles as measles vaccination is contraindicated for pregnant client.
77+
@guidance: Do not vaccinate client with measles as measles vaccination is contraindicated for severely immunosuppressed client.
78+
*/
79+
define "Measles vaccination contraindicated Guidance":
80+
case
81+
when "Measles vaccination contraindicated Case 1" then 'Do not vaccinate client with measles as measles vaccination is contraindicated for pregnant client.'
82+
when "Measles vaccination contraindicated Case 2" then 'Do not vaccinate client with measles as measles vaccination is contraindicated for severely immunosuppressed client.'
83+
else ''
84+
end
85+
86+
/*
87+
@output: Measles vaccination could be contraindicated. Clinical judgement required. Create a clinical note
88+
@pseudocode: "Immunization recommendation status" = "Further evaluation needed"
89+
*/
90+
define "Measles vaccination could be contraindicated. Clinical judgement required. Create a clinical note":
91+
Encounter."The client has history of anaphylactic reactions"
92+
93+
/*
94+
@output: Measles vaccination could be contraindicated. Clinical judgement required. Create a clinical note Guidance
95+
@guidance: Do not vaccinate client with measles if client has history of anaphylactic reaction to any component of the vaccine (e.g. neomycin or gelatin).
96+
*/
97+
define "Measles vaccination could be contraindicated. Clinical judgement required. Create a clinical note Guidance":
98+
'Do not vaccinate client with measles if client has history of anaphylactic reaction to any component of the vaccine (e.g. neomycin or gelatin).'
99+
100+
/*
101+
@output: Clinical judgement required. Create a clinical note Case 1
102+
@pseudocode: "Immunization recommendation status" = "Further evaluation needed"
103+
*/
104+
define "Clinical judgement required. Create a clinical note Case 1":
105+
Encounter."The client has history of severe allergic reactions"
106+
107+
/*
108+
@output: Clinical judgement required. Create a clinical note Case 2
109+
@pseudocode: "Immunization recommendation status" = "Further evaluation needed"
110+
*/
111+
define "Clinical judgement required. Create a clinical note Case 2":
112+
Encounter."The client has a symptomatic HIV infection"
113+
114+
/*
115+
@output: Clinical judgement required. Create a clinical note
116+
@pseudocode: "Immunization recommendation status" = "Further evaluation needed"
117+
*/
118+
define "Clinical judgement required. Create a clinical note":
119+
"Clinical judgement required. Create a clinical note Case 1"
120+
or "Clinical judgement required. Create a clinical note Case 2"
121+
122+
/*
123+
@output: Clinical judgement required. Create a clinical note Guidance
124+
@guidance: Do not vaccinate client with measles if client has history of severe allergic reactions to any component of the vaccine (e.g. neomycin or gelatin).
125+
@guidance: Client has symptomatic HIV infection. Measles vaccination may be considered if the client is not severely immunosuppressed according to conventional definitions, consider risks of vaccination and make a clinical judgement.
126+
*/
127+
define "Clinical judgement required. Create a clinical note Guidance":
128+
case
129+
when "Clinical judgement required. Create a clinical note Case 1" then 'Do not vaccinate client with measles if client has history of severe allergic reactions to any component of the vaccine (e.g. neomycin or gelatin).'
130+
when "Clinical judgement required. Create a clinical note Case 2" then 'Client has symptomatic HIV infection. Measles vaccination may be considered if the client is not severely immunosuppressed according to conventional definitions, consider risks of vaccination and make a clinical judgement.'
131+
else ''
132+
end
133+
134+
135+
/*
136+
@test: Test expected results based on example patients
137+
*/
138+
define "Test Validation":
139+
case
140+
when Patient.id = '56.CI162' then "Measles vaccination contraindicated Case 1" and "Guidance" = 'Do not vaccinate client with measles as measles vaccination is contraindicated for pregnant client.'
141+
when Patient.id = '57.CI166' then "Measles vaccination could be contraindicated. Clinical judgement required. Create a clinical note" and "Guidance" = 'Do not vaccinate client with measles if client has history of anaphylactic reaction to any component of the vaccine (e.g. neomycin or gelatin).'
142+
when Patient.id = '58.CI167' then "Clinical judgement required. Create a clinical note Case 1" and "Guidance" = 'Do not vaccinate client with measles if client has history of severe allergic reactions to any component of the vaccine (e.g. neomycin or gelatin).'
143+
when Patient.id = '59.CI165' then "Measles vaccination contraindicated Case 2" and "Guidance" = 'Do not vaccinate client with measles as measles vaccination is contraindicated for severely immunosuppressed client.'
144+
when Patient.id = '60.CI168' then "Clinical judgement required. Create a clinical note Case 2" and "Guidance" = 'Client has symptomatic HIV infection. Measles vaccination may be considered if the client is not severely immunosuppressed according to conventional definitions, consider risks of vaccination and make a clinical judgement.'
145+
else 'No test case set'
146+
end

0 commit comments

Comments
 (0)