Skip to content

Commit 6b740fc

Browse files
committed
Finished the rest of the scheduling tables.
1 parent 154223c commit 6b740fc

File tree

52 files changed

+1479
-8
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

+1479
-8
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ node_modules/
1111
outputs/*
1212
node_modules
1313
input/vocabulary/valueset/external/
14+
results/*
15+
input/tests/results/**
+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
2+
/*
3+
* Library: IMMZD18SMeaslesDose0LT (IMMZ.D18.S.Measles.MCV dose 0 schedule)
4+
* Schedule Table: Measles-containing vaccine dose 0 (MCV0) schedule Low Transmission
5+
*/
6+
library IMMZD18SMeaslesDose0LT
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: MCV0
26+
@description: Provision of the MCV0
27+
@trigger: Child's birth
28+
@triggerDate: "Date of birth"
29+
*/
30+
define "MCV0":
31+
not "MCV0 was administered" and "MCV0 Expiration" after Today
32+
33+
/*
34+
@output: MCV0 Create
35+
@create: In the following situations, a supplementary dose of MCV should be given to infants from 6 months of age:
36+
• during a measles outbreak as part of intensified service delivery;
37+
• during campaigns in settings where the risk of measles among infants aged under 9 months remains high (e.g. in endemic countries experiencing regular outbreaks);
38+
• for internally displaced populations and refugees, and populations in conflict zones;
39+
• for individual infants at high risk of contracting measles (e.g. contacts of known measles cases or in settings with increased risk of exposure during outbreaks such as day-care facilities);
40+
• for infants travelling to countries experiencing measles outbreaks;
41+
• for infants known to be HIV-infected or exposed (i.e. born to a woman infected with HIV).
42+
*/
43+
define "MCV0 Create":
44+
if "MCV0"
45+
then 'In the following situations, a supplementary dose of MCV should be given to infants from 6 months of age:
46+
• during a measles outbreak as part of intensified service delivery;
47+
• during campaigns in settings where the risk of measles among infants aged under 9 months remains high (e.g. in endemic countries experiencing regular outbreaks);
48+
• for internally displaced populations and refugees, and populations in conflict zones;
49+
• for individual infants at high risk of contracting measles (e.g. contacts of known measles cases or in settings with increased risk of exposure during outbreaks such as day-care facilities);
50+
• for infants travelling to countries experiencing measles outbreaks;
51+
• for infants known to be HIV-infected or exposed (i.e. born to a woman infected with HIV).' + '
52+
Due Date: ' + ToString("MCV0 Due Date") + '
53+
Expiration: ' + ToString("MCV0 Expiration")
54+
else ''
55+
56+
/*
57+
@dynamicValue: MCV0 Due Date
58+
@pseudocode: "Date of birth" + 6 months
59+
*/
60+
define "MCV0 Due Date":
61+
if "MCV0" then WC.LatestOf({
62+
Patient.birthDate + 6 months,
63+
IE."Date of Latest Live Attenuated Vaccine" + 4 weeks
64+
})
65+
else null
66+
67+
/*
68+
@dynanmicValue: MCV0 Overdue
69+
@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.
70+
*/
71+
define "MCV0 Overdue":
72+
null
73+
74+
/*
75+
@dynanmicValue: MCV0 Expiration
76+
@pseudocode: "Date of birth" + 12 months for countries with low levels of measles transmission
77+
*/
78+
define "MCV0 Expiration":
79+
Patient.birthDate + 12 months
80+
81+
/*
82+
@complete: MCV0 was administered
83+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Dose 0") = 1
84+
*/
85+
define "MCV0 was administered":
86+
Encounter."MCV0 was administered"
87+
88+
89+
90+
/*
91+
@test: Test expected results based on example patients
92+
*/
93+
define "Test Validation":
94+
case
95+
when Patient.id = '35.Alt6m' then "MCV0"
96+
when Patient.id = '35.Agt12m' then not "MCV0" // expired
97+
when Patient.id = '35.Agt6mLVlt4w' then "MCV0"
98+
when Patient.id = '35.D1' then not "MCV0" // done
99+
else 'No test case set'
100+
end
+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
2+
/*
3+
* Library: IMMZD18SMeaslesDose0OT (IMMZ.D18.S.Measles.MCV dose 0 schedule)
4+
* Schedule Table: Measles-containing vaccine dose 0 (MCV0) schedule for Ongoing Transmission
5+
*/
6+
library IMMZD18SMeaslesDose0OT
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: MCV0
26+
@description: Provision of the MCV0
27+
@trigger: Child's birth
28+
@triggerDate: "Date of birth"
29+
*/
30+
define "MCV0":
31+
not "MCV0 was administered" and "MCV0 Expiration" after Today
32+
33+
/*
34+
@output: MCV0 Create
35+
@create: In the following situations, a supplementary dose of MCV should be given to infants from 6 months of age:
36+
• during a measles outbreak as part of intensified service delivery;
37+
• during campaigns in settings where the risk of measles among infants aged under 9 months remains high (e.g. in endemic countries experiencing regular outbreaks);
38+
• for internally displaced populations and refugees, and populations in conflict zones;
39+
• for individual infants at high risk of contracting measles (e.g. contacts of known measles cases or in settings with increased risk of exposure during outbreaks such as day-care facilities);
40+
• for infants travelling to countries experiencing measles outbreaks;
41+
• for infants known to be HIV-infected or exposed (i.e. born to a woman infected with HIV).
42+
*/
43+
define "MCV0 Create":
44+
if "MCV0"
45+
then 'In the following situations, a supplementary dose of MCV should be given to infants from 6 months of age:
46+
• during a measles outbreak as part of intensified service delivery;
47+
• during campaigns in settings where the risk of measles among infants aged under 9 months remains high (e.g. in endemic countries experiencing regular outbreaks);
48+
• for internally displaced populations and refugees, and populations in conflict zones;
49+
• for individual infants at high risk of contracting measles (e.g. contacts of known measles cases or in settings with increased risk of exposure during outbreaks such as day-care facilities);
50+
• for infants travelling to countries experiencing measles outbreaks;
51+
• for infants known to be HIV-infected or exposed (i.e. born to a woman infected with HIV).' + '
52+
Due Date: ' + ToString("MCV0 Due Date") + '
53+
Expiration: ' + ToString("MCV0 Expiration")
54+
else ''
55+
56+
/*
57+
@dynamicValue: MCV0 Due Date
58+
@pseudocode: "Date of birth" + 6 months
59+
*/
60+
define "MCV0 Due Date":
61+
if "MCV0" then WC.LatestOf({
62+
Patient.birthDate + 6 months,
63+
IE."Date of Latest Live Attenuated Vaccine" + 4 weeks
64+
})
65+
else null
66+
67+
/*
68+
@dynanmicValue: MCV0 Overdue
69+
@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.
70+
*/
71+
define "MCV0 Overdue":
72+
null
73+
74+
/*
75+
@dynanmicValue: MCV0 Expiration
76+
@pseudocode: "Date of birth" + 9 months for countries with ongoing transmission in which the risk of measles mortality remains high
77+
*/
78+
define "MCV0 Expiration":
79+
Patient.birthDate + 9 months
80+
81+
/*
82+
@complete: MCV0 was administered
83+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Dose 0") = 1
84+
*/
85+
define "MCV0 was administered":
86+
Encounter."MCV0 was administered"
87+
88+
89+
/*
90+
@test: Test expected results based on example patients
91+
*/
92+
define "Test Validation":
93+
case
94+
when Patient.id = '35.Alt6m' then "MCV0"
95+
when Patient.id = '35.Agt9m' then not "MCV0" // expired
96+
when Patient.id = '35.Agt6mLVlt4w' then "MCV0"
97+
when Patient.id = '35.D1' then not "MCV0" // done
98+
else 'No test case set'
99+
end
+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
2+
/*
3+
* Library: IMMZD18SMeaslesLowTx (IMMZ.D18.S.Measles.Low transmission schedule)
4+
* Schedule Table: Schedule for countries with low levels of measles transmission (countries that provide first dose of measles-containing vaccine (MCV) at 12 months and second dose of MCV at 15 months)
5+
*/
6+
library IMMZD18SMeaslesLowTx
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 12 months
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 12 months' + '
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" + 12 months
46+
*/
47+
define "MCV dose 1 (MCV1) Due Date":
48+
if "MCV dose 1 (MCV1)" then WC.LatestOf({
49+
Patient.birthDate + 12 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 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+
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.
88+
*/
89+
define "MCV2 Create":
90+
if "MCV2"
91+
then 'The client is due for MCV2 if the client is at least 15 months.' + '
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 WC.LatestOf({
101+
Patient.birthDate + 15 months,
102+
IE."Date of Latest Live Attenuated Vaccine" + 4 weeks
103+
})
104+
else null
105+
106+
/*
107+
@dynanmicValue: MCV2 Overdue
108+
@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.
109+
*/
110+
define "MCV2 Overdue":
111+
null
112+
113+
/*
114+
@dynanmicValue: MCV2 Expiration
115+
@pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated.
116+
*/
117+
define "MCV2 Expiration":
118+
null
119+
120+
/*
121+
@complete: MCV2 was administered. The primary series has been completed
122+
@pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Measles-containing vaccines")
123+
*/
124+
define "MCV2 was administered. The primary series has been completed":
125+
Encounter."MCV2 was administered"
126+
127+
128+
/*
129+
@test: Test expected results based on example patients
130+
*/
131+
define "Test Validation":
132+
case
133+
when Patient.id = '21.Alt12m' then "MCV dose 1 (MCV1)"
134+
when Patient.id = '21.Agt12m' then "MCV dose 1 (MCV1)"
135+
when Patient.id = '21.Agt12mLVlt4w' then "MCV dose 1 (MCV1)"
136+
when Patient.id = '22.D1Alt15m' then "MCV2"
137+
when Patient.id = '22.D1Agt15mLVlt4w' then "MCV2"
138+
when Patient.id = '22.D2' then not "MCV2" and not "MCV dose 1 (MCV1)"
139+
else 'No test case set'
140+
end

input/cql/IMMZD18SMeaslesOngoingTxLogic.cql

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Due Date: ' + ToString("MCV dose 1 (MCV1) Due Date")
4545
@pseudocode: "Date of birth" + 9 months
4646
*/
4747
define "MCV dose 1 (MCV1) Due Date":
48-
if "MCV dose 1 (MCV1)" then Max({
48+
if "MCV dose 1 (MCV1)" then WC.LatestOf({
4949
Patient.birthDate + 9 months,
5050
IE."Date of Latest Live Attenuated Vaccine" + 4 weeks
5151
})
@@ -97,7 +97,7 @@ Due Date: ' + ToString("MCV2 Due Date")
9797
@pseudocode: "Date of birth" + 15 months
9898
*/
9999
define "MCV2 Due Date":
100-
if "MCV2" then Max({
100+
if "MCV2" then WC.LatestOf({
101101
Patient.birthDate + 15 months,
102102
IE."Date of Latest Live Attenuated Vaccine" + 4 weeks
103103
})

0 commit comments

Comments
 (0)