Skip to content

Commit 816beae

Browse files
authored
Merge pull request #87 from WorldHealthOrganization/clean-dtp
Adding DTP to the cleanup branch
2 parents ef2858b + 6412ba6 commit 816beae

File tree

253 files changed

+9729
-162
lines changed

Some content is hidden

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

253 files changed

+9729
-162
lines changed

input/cql/IMMZCommon.cql

+3
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ define "History of Anaphylactic Reactions Condition":
168168
define "Severe Allergic Reactions Condition":
169169
[Condition: IMMZc."Severe allergic reactions"]
170170

171+
define "Severe Acute Illness Condition":
172+
[Condition: IMMZc."Severe acute illness" ]
173+
171174
define "Symptomatic HIV Infection Condition":
172175
[Condition: IMMZc."Symptomatic HIV infection"]
173176

input/cql/IMMZD2DTDTPDelayed.cql

+309
Large diffs are not rendered by default.

input/cql/IMMZD2DTDTPInput.cql

+109-15
Original file line numberDiff line numberDiff line change
@@ -30,61 +30,77 @@ define "Date of latest DTP Vaccine":
3030
First("DTP Doses Administered to Patient").occurrence as dateTime
3131

3232
/*
33-
@internal: DTP Primary Series Doses Administered to Patient
33+
@internal: Tetanus and Diphtheria containing Doses Administered to Patient
3434
*/
35-
define "DTP Primary Series Doses Administered to Patient":
36-
"DTP Doses Administered to Patient" I where not exists(I.protocolApplied.doseNumber) or ((singleton from I.protocolApplied).doseNumber as string) != 'booster'
35+
define "Tetanus and Diphtheria containing Doses Administered to Patient":
36+
IMMZCom."Doses Administered to Patient" I where I.vaccineCode in IMMZc."Tetanus and Diphtheria Vaccine"
3737

3838
/*
39-
@internal: Tetanus and Diphtheria containing Doses Administered to Patient
39+
@internal: Tetanus and Diphtheria containing Booster Doses Administered to Patient
4040
*/
4141
define "Tetanus and Diphtheria Booster Doses Administered to Patient":
42-
IMMZCom."Doses Administered to Patient" I
43-
where
44-
I.vaccineCode in IMMZc."Tetanus and Diphtheria Vaccine" and ((singleton from I.protocolApplied).doseNumber as string) = 'booster'
42+
Take( "Tetanus and Diphtheria containing Doses Administered to Patient", Count("Tetanus and Diphtheria containing Doses Administered to Patient") - 3 )
43+
44+
/*
45+
@internal: Date of latest Tetanus and Diphtheria Vaccine
46+
*/
47+
define "Date of latest Tetanus and Diphtheria Vaccine":
48+
First("Tetanus and Diphtheria containing Doses Administered to Patient").occurrence as dateTime
4549

4650
/*
4751
@internal: Pertussis containing Doses Administered to Patient
4852
*/
53+
define "Pertussis Doses Administered to Patient":
54+
IMMZCom."Doses Administered to Patient" I where I.vaccineCode in IMMZc."Pertussis Vaccine"
55+
56+
/*
57+
@internal: Pertussis containing Booster Doses Administered to Patient
58+
*/
4959
define "Pertussis Booster Doses Administered to Patient":
50-
IMMZCom."Doses Administered to Patient" I
51-
where
52-
I.vaccineCode in IMMZc."Pertussis Vaccine" and ((singleton from I.protocolApplied).doseNumber as string) = 'booster'
60+
Take( "Pertussis Doses Administered to Patient", Count("Pertussis Doses Administered to Patient") - 3 )
5361

5462
/*
5563
@input: No DTP primary series doses were administered
5664
@pseudocode: Count of vaccines administered (where "Vaccine type" = "'Diphtheria-tetanus-pertussis containing vaccines" and "Type of dose" = "Primary series") = 0
5765
*/
5866
define "No DTP primary series doses were administered":
59-
not exists("DTP Primary Series Doses Administered to Patient")
67+
not exists("DTP Doses Administered to Patient")
6068

6169
/*
6270
@input: One DTP primary series dose was administered
6371
@pseudocode: Count of vaccines administered (where "Vaccine type" = "'Diphtheria-tetanus-pertussis containing vaccines" and "Type of dose" = "Primary series") = 1
6472
*/
6573
define "One DTP primary series dose was administered":
66-
Count("DTP Primary Series Doses Administered to Patient") = 1
74+
Count("DTP Doses Administered to Patient") = 1
6775

6876
/*
6977
@input: Two DTP primary series doses were administered
7078
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Diphtheria-tetanus-pertussis containing vaccines' and "Type of dose" = 'Primary series') = 2
7179
*/
7280
define "Two DTP primary series doses were administered":
73-
Count("DTP Primary Series Doses Administered to Patient") = 2
81+
Count("DTP Doses Administered to Patient") = 2
7482

7583
/*
7684
@input: Three DTP primary series doses were administered
7785
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Diphtheria-tetanus-pertussis containing vaccines' and "Type of dose" = 'Primary series') = 3
7886
*/
7987
define "Three DTP primary series doses were administered":
80-
Count("DTP Primary Series Doses Administered to Patient") = 3
88+
Count("DTP Doses Administered to Patient") >= 3
8189

8290
/*
8391
@input: No tetanus and diphtheria booster doses were administered
8492
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Tetanus and diphtheria containing vaccines" and "Type of dose" = "Booster dose") = 0
8593
*/
8694
define "No tetanus and diphtheria booster doses were administered":
8795
not exists( "Tetanus and Diphtheria Booster Doses Administered to Patient" )
96+
97+
/*
98+
@input: No tetanus and diphtheria booster dose was administered
99+
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Tetanus and diphtheria containing vaccines" and "Type of dose" = "Booster dose") = 0
100+
*/
101+
define "No tetanus and diphtheria booster dose was administered":
102+
"No tetanus and diphtheria booster doses were administered"
103+
88104
/*
89105
@input: One tetanus and diphtheria booster dose was administered
90106
@pseudocode: Count of vaccines administered where "Vaccine type" = "Tetanus and diphtheria containing vaccines" and "Type of dose" = "Booster dose" ) = 1
@@ -104,7 +120,7 @@ define "Two tetanus and diphtheria booster doses were administered":
104120
@pseudocode: Count of vaccines administered where "Vaccine type" = "Tetanus and diphtheria containing vaccines" and "Type of dose" = "Booster dose" ) = 3
105121
*/
106122
define "Three tetanus and diphtheria booster doses were administered":
107-
Count("Tetanus and Diphtheria Booster Doses Administered to Patient") = 3
123+
Count("Tetanus and Diphtheria Booster Doses Administered to Patient") >= 3
108124

109125
/*
110126
@input: No pertussis booster doses were administered
@@ -183,12 +199,27 @@ define "Client's age is more than or equal to 9 years":
183199
define "Client's age is less than 1 year":
184200
IMMZCom."Current Patient Age In Years" < 1
185201

202+
/*
203+
@input: Client's age is more than 1 year
204+
@pseudocode: Today's date - "Date of birth" > 1 year
205+
*/
206+
define "Client's age is more than 1 year":
207+
not( "Client's age is less than 1 year" )
208+
186209
/*
187210
@input: Client's age is between 1 year and 6 years
188211
@pseudocode: 1 'year' ≤ Today's date - "Date of birth" ≤ 6 'year'
189212
*/
190213
define "Client's age is between 1 year and 6 years":
191214
not("Client's age is less than 1 year") and not("Client's age is more than 6 years")
215+
216+
/*
217+
@input: Client's age is between 1 year and 6 years old
218+
@pseudocode: 1 year ≤ Today's date - "Date of birth" ≤ 6 years
219+
*/
220+
define "Client's age is between 1 year and 6 years old":
221+
"Client's age is between 1 year and 6 years"
222+
192223
/*
193224
@input: Client's age is more than 6 years
194225
@pseudocode: Today's date - "Date of birth" > 6 'year'
@@ -222,3 +253,66 @@ define "The latest DTP dose was administered less than 6 months ago":
222253
*/
223254
define "The latest DTP dose was administered more than 6 months ago":
224255
not("The latest DTP dose was administered less than 6 months ago")
256+
257+
/*
258+
@input: The latest DTP dose was administered less than 1 year ago
259+
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = "Diphtheria-tetanus-pertussis containing vaccines") < 1 year
260+
*/
261+
define "The latest DTP dose was administered less than 1 year ago":
262+
"Date of latest DTP Vaccine" is not null and duration in years between "Date of latest DTP Vaccine" and Now() < 1
263+
264+
/*
265+
@input: The latest DTP dose was administered more than 1 year ago
266+
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = "Diphtheria-tetanus-pertussis containing vaccines") ≥ 1 year
267+
*/
268+
define "The latest DTP dose was administered more than 1 year ago":
269+
not("The latest DTP dose was administered less than 1 year ago")
270+
271+
/*
272+
@input: The latest tetanus and diphtheria dose was administered less than 4 weeks ago
273+
@pseudocode: Today's date - Latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria containing vaccines") < 4 weeks
274+
*/
275+
define "The latest tetanus and diphtheria dose was administered less than 4 weeks ago":
276+
"Date of latest Tetanus and Diphtheria Vaccine" is not null and duration in weeks between "Date of latest Tetanus and Diphtheria Vaccine" and Now() < 4
277+
278+
/*
279+
@input: The latest tetanus and diphtheria dose was administered more than 4 weeks ago
280+
@pseudocode: Today's date - Latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria containing vaccines") > 4 weeks
281+
*/
282+
define "The latest tetanus and diphtheria dose was administered more than 4 weeks ago":
283+
not("The latest tetanus and diphtheria dose was administered less than 4 weeks ago")
284+
285+
/*
286+
@input: The latest tetanus and diphtheria dose was administered less than 1 year ago
287+
@pseudocode: Today's date - Latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria containing vaccines") < 1 year
288+
*/
289+
define "The latest tetanus and diphtheria dose was administered less than 1 year ago":
290+
"Date of latest Tetanus and Diphtheria Vaccine" is not null and duration in years between "Date of latest Tetanus and Diphtheria Vaccine" and Now() < 1
291+
292+
/*
293+
@input: The latest tetanus and diphtheria dose was administered more than 1 year ago
294+
@pseudocode: Today's date - Latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria containing vaccines") ≥ 1 year
295+
*/
296+
define "The latest tetanus and diphtheria dose was administered more than 1 year ago":
297+
not("The latest tetanus and diphtheria dose was administered less than 1 year ago")
298+
299+
/*
300+
@input: Client is currently pregnant
301+
@pseudocode: "Currently pregnant" = TRUE
302+
*/
303+
define "Client is currently pregnant":
304+
IMMZCom."Pregnant"
305+
306+
/*
307+
@input: The client has a history of anaphylactic reactions
308+
@pseudocode: "Potential contraindications" = "History of anaphylactic reactions"
309+
*/
310+
define "The client has a history of anaphylactic reactions":
311+
exists(IMMZCom."History of Anaphylactic Reactions Condition")
312+
313+
/*
314+
@input: The client currently has a severe acute illness
315+
@pseudocode: "Potential contraindications" = "Severe acute illness"
316+
*/
317+
define "The client currently has a severe acute illness":
318+
exists(IMMZCom."Severe Acute Illness Condition")

0 commit comments

Comments
 (0)