WHO Immunization Implementation Guide
0.1.0 - CI Build International flag

WHO Immunization Implementation Guide, published by World Health Organization (WHO). This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/WorldHealthOrganization/smart-immunizations and changes regularly. See the Directory of published versions

Library: IMMZD2DTDTPInput

Official URL: http://smart.who.int/ig/smart-immunizations/Library/IMMZD2DTDTPInput Version: 0.1.0
Draft as of 2024-03-22 Computable Name: IMMZD2DTDTPInput

Related Artifacts

depends-onFHIR model informationhttp://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
depends-onLibrary FHIRHelpershttp://smart.who.int/ig/smart-immunizations/Library/FHIRHelpers|4.0.1
depends-onLibrary IMMZComIMMZCommon
depends-onLibrary IMMZcIMMZConcepts
depends-onLibrary IMMZConIMMZConfig
depends-onLibrary IMMZvlIMMZVaccineLibrary
depends-onLibrary FCFHIRCommon
depends-onLibrary WconWHOConcepts
depends-onCode system IMMZ.DIMMZ.D CodeSystem for Data Elements
depends-onValue set DTP VaccineIMMZ.Z.DE24 Diphtheria-tetanus-pertussis containing vaccines
depends-onValue set Tetanus and Diphtheria VaccineIMMZ.Z.DE28 Tetanus and diphtheria containing vaccines
depends-onValue set Pertussis VaccineIMMZ.Z.DE.12 Pertussis containing vaccines
depends-onValue set Pregnancy Status PregnantPregnancy status values

Parameters

Patientout01Patient
DTP Doses Administered to Patientout0*Immunization
Date of latest DTP Vaccineout01dateTime
Tetanus and Diphtheria containing Doses Administered to Patientout0*Immunization
Tetanus and Diphtheria Booster Doses Administered to Patientout0*Immunization
Date of latest Tetanus and Diphtheria Vaccineout01dateTime
Pertussis Doses Administered to Patientout0*Immunization
Pertussis Booster Doses Administered to Patientout0*Immunization
No DTP primary series doses were administeredout01boolean
One DTP primary series dose was administeredout01boolean
Two DTP primary series doses were administeredout01boolean
Three DTP primary series doses were administeredout01boolean
No tetanus and diphtheria booster doses were administeredout01boolean
No tetanus and diphtheria booster dose was administeredout01boolean
One tetanus and diphtheria booster dose was administeredout01boolean
Two tetanus and diphtheria booster doses were administeredout01boolean
Three tetanus and diphtheria booster doses were administeredout01boolean
No pertussis booster doses were administeredout01boolean
One pertussis booster dose was administeredout01boolean
Client's age is less than 6 weeksout01boolean
Client's age is less than 1 yearout01boolean
Client's age is between 6 weeks and 1 yearout01boolean
Client's age is less than 12 monthsout01boolean
Client's age is more than or equal to 12 monthsout01boolean
Client's age is less than 4 yearsout01boolean
Client's age is more than or equal to 4 yearsout01boolean
Client's age is less than 9 yearsout01boolean
Client's age is more than or equal to 9 yearsout01boolean
Client's age is more than 1 yearout01boolean
Client's age is more than 6 yearsout01boolean
Client's age is between 1 year and 6 yearsout01boolean
Client's age is between 1 year and 6 years oldout01boolean
The latest DTP dose was administered less than 4 weeks agoout01boolean
The latest DTP dose was administered more than 4 weeks agoout01boolean
The latest DTP dose was administered less than 6 months agoout01boolean
The latest DTP dose was administered more than 6 months agoout01boolean
The latest DTP dose was administered less than 1 year agoout01boolean
The latest DTP dose was administered more than 1 year agoout01boolean
The latest tetanus and diphtheria dose was administered less than 4 weeks agoout01boolean
The latest tetanus and diphtheria dose was administered more than 4 weeks agoout01boolean
The latest tetanus and diphtheria dose was administered less than 1 year agoout01boolean
The latest tetanus and diphtheria dose was administered more than 1 year agoout01boolean
Client is currently pregnantout01boolean
The client has a history of anaphylactic reactionsout01boolean
The client currently has a severe acute illnessout01boolean

Data Requirements

Type: Patient (Patient)
Type: Immunization (Immunization)
Type: Observation (Observation)
Type: Condition (Condition)
Type: Condition (Condition)
FilterValue
codeOne of these codes: IMMZ.D CodeSystem for Data Elements DE166: History of anaphylactic reactions
Type: Condition (Condition)
FilterValue
codeOne of these codes: IMMZ.D CodeSystem for Data Elements DE188: Severe acute illness

Contents

text/cql

/*
 * Library: IMMZD2DTDTPInput (IMMZ.D2.DT.DTPInput)					
 */
library IMMZD2DTDTPInput
// Start Skeleton CQL
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'
include IMMZCommon called IMMZCom
include IMMZConcepts called IMMZc
include IMMZConfig called IMMZCon
include IMMZVaccineLibrary called IMMZvl
include FHIRCommon called FC

// End Skeleton CQL
context Patient


/*
@internal: DTP containing Doses Administered to Patient
*/
define "DTP Doses Administered to Patient":
  IMMZCom."Doses Administered to Patient" I
  where
    I.vaccineCode in IMMZc."DTP Vaccine"

/*
@internal: Date of latest DTP Vaccine
*/
define "Date of latest DTP Vaccine":
	First("DTP Doses Administered to Patient").occurrence as dateTime

/*
@internal: Tetanus and Diphtheria containing Doses Administered to Patient
*/
define "Tetanus and Diphtheria containing Doses Administered to Patient":
  IMMZCom."Doses Administered to Patient" I where I.vaccineCode in IMMZc."Tetanus and Diphtheria Vaccine"

/*
@internal: Tetanus and Diphtheria containing Booster Doses Administered to Patient
*/
define "Tetanus and Diphtheria Booster Doses Administered to Patient":
  Take( "Tetanus and Diphtheria containing Doses Administered to Patient", Count("Tetanus and Diphtheria containing Doses Administered to Patient") - 3 )

/*
@internal: Date of latest Tetanus and Diphtheria Vaccine
*/
define "Date of latest Tetanus and Diphtheria Vaccine":
	First("Tetanus and Diphtheria containing Doses Administered to Patient").occurrence as dateTime

/*
@internal: Pertussis containing Doses Administered to Patient
*/
define "Pertussis Doses Administered to Patient":
  IMMZCom."Doses Administered to Patient" I where I.vaccineCode in IMMZc."Pertussis Vaccine"

/*
@internal: Pertussis containing Booster Doses Administered to Patient
*/
define "Pertussis Booster Doses Administered to Patient":
  Take( "Pertussis Doses Administered to Patient", Count("Pertussis Doses Administered to Patient") - 3 )

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

/*
@input: One DTP primary series dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "'Diphtheria-tetanus-pertussis containing vaccines" and "Type of dose" = "Primary series") = 1
*/
define "One DTP primary series dose was administered":
	Count("DTP Doses Administered to Patient") = 1

/*
@input: Two DTP primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = 'Diphtheria-tetanus-pertussis containing vaccines' and "Type of dose" = 'Primary series') = 2
*/
define "Two DTP primary series doses were administered":
	Count("DTP Doses Administered to Patient") = 2

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

/*
@input: No tetanus and diphtheria booster doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Tetanus and diphtheria containing vaccines" and "Type of dose" = "Booster dose") = 0
*/
define "No tetanus and diphtheria booster doses were administered":
	not exists( "Tetanus and Diphtheria Booster Doses Administered to Patient" )

/*
@input: No tetanus and diphtheria booster dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Tetanus and diphtheria containing vaccines" and "Type of dose" = "Booster dose") = 0
*/
define "No tetanus and diphtheria booster dose was administered":
  "No tetanus and diphtheria booster doses were administered"

/*
@input: One tetanus and diphtheria booster dose was administered
@pseudocode: Count of vaccines administered where "Vaccine type" = "Tetanus and diphtheria containing vaccines" and "Type of dose" = "Booster dose" ) = 1
*/
define "One tetanus and diphtheria booster dose was administered":
	Count("Tetanus and Diphtheria Booster Doses Administered to Patient") = 1

/*
@input: Two tetanus and diphtheria booster doses were administered
@pseudocode: Count of vaccines administered where "Vaccine type" = "Tetanus and diphtheria containing vaccines" and "Type of dose" = "Booster dose" ) = 2
*/
define "Two tetanus and diphtheria booster doses were administered":
	Count("Tetanus and Diphtheria Booster Doses Administered to Patient") = 2

/*
@input: Three tetanus and diphtheria booster doses were administered
@pseudocode: Count of vaccines administered where "Vaccine type" = "Tetanus and diphtheria containing vaccines" and "Type of dose" = "Booster dose" ) = 3
*/
define "Three tetanus and diphtheria booster doses were administered":
	Count("Tetanus and Diphtheria Booster Doses Administered to Patient") >= 3

/*
@input: No pertussis booster doses were administered
@pseudocode: Count of vaccines administered where "Vaccine type" = "Pertussis containing vaccines" and "Type of dose" = "Booster dose" ) = 0
*/
define "No pertussis booster doses were administered":
	not exists( "Pertussis Booster Doses Administered to Patient" )

/*
@input: One pertussis booster dose was administered
@pseudocode: Count of vaccines administered where "Vaccine type" = "Pertussis containing vaccines" and "Type of dose" = "Booster dose" =1
*/
define "One pertussis booster dose was administered":
	Count("Pertussis Booster Doses Administered to Patient") = 1

/*
@input: Client's age is less than 6 weeks
@pseudocode: Today's date - "Date of birth" < 6 'week'
*/
define "Client's age is less than 6 weeks":
	IMMZCom."Current Patient Age In Weeks" < 6

/*
@input: Client's age is between 6 weeks and 1 year
@pseudocode: 6 'week' ≤ Today's date - "Date of birth" < 1 'year'
*/
define "Client's age is between 6 weeks and 1 year":
	not("Client's age is less than 6 weeks") and "Client's age is less than 1 year"

/*
@input: Client's age is less than 12 months
@pseudocode: Today's date - "Date of birth" < 12 'month'
*/
define "Client's age is less than 12 months":
	IMMZCom."Current Patient Age In Months" < 12

/*
@input: Client's age is more than or equal to 12 months
@pseudocode: Today's date - "Date of birth" ≥ 12 'month'
*/
define "Client's age is more than or equal to 12 months":
	not("Client's age is less than 12 months")

/*
@input: Client's age is less than 4 years
@pseudocode: Today's date - "Date of birth" < 4 'year'
*/
define "Client's age is less than 4 years":
	IMMZCom."Current Patient Age In Years" < 4

/*
@input: Client's age is more than or equal to 4 years
@pseudocode: Today's date - "Date of birth" ≥ 4 'year'
*/
define "Client's age is more than or equal to 4 years":
	not("Client's age is less than 4 years")

/*
@input: Client's age is less than 9 years
@pseudocode: Today's date - "Date of birth" < 9 'year'
*/
define "Client's age is less than 9 years":
	IMMZCom."Current Patient Age In Years" < 9

/*
@input: Client's age is more than or equal to 9 years
@pseudocode: Today's date - "Date of birth" ≥ 9 'year'
*/
define "Client's age is more than or equal to 9 years":
	not("Client's age is less than 9 years")

/*
@input: Client's age is less than 1 year
@pseudocode: Today's date - "Date of birth" < 1 'year'
*/
define "Client's age is less than 1 year":
	IMMZCom."Current Patient Age In Years" < 1

/*
@input: Client's age is more than 1 year
@pseudocode: Today's date - "Date of birth" > 1 year
*/
define "Client's age is more than 1 year":
	not( "Client's age is less than 1 year" )

/*
@input: Client's age is between 1 year and 6 years
@pseudocode: 1 'year' ≤  Today's date - "Date of birth" ≤  6 'year'
*/
define "Client's age is between 1 year and 6 years":
	not("Client's age is less than 1 year") and not("Client's age is more than 6 years")

/*
@input: Client's age is between 1 year and 6 years old
@pseudocode: 1 year ≤  Today's date - "Date of birth" ≤  6 years
*/
define "Client's age is between 1 year and 6 years old":
  "Client's age is between 1 year and 6 years"

/*
@input: Client's age is more than 6 years
@pseudocode: Today's date - "Date of birth" >  6 'year'
*/
define "Client's age is more than 6 years":
	IMMZCom."Current Patient Age In Years" > 6

/*
@input: The latest DTP dose was administered less than 4 weeks ago
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = 'Diphtheria-tetanus-pertussis containing vaccines') < 4 'week'
*/
define "The latest DTP dose was administered less than 4 weeks ago":
	"Date of latest DTP Vaccine" is not null and duration in weeks between "Date of latest DTP Vaccine" and Now() < 4
/*
@input: The latest DTP dose was administered more than 4 weeks ago
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = 'Diphtheria-tetanus-pertussis containing vaccines') ≥ 4 'week'
*/
define "The latest DTP dose was administered more than 4 weeks ago":
	not("The latest DTP dose was administered less than 4 weeks ago")

/*
@input: The latest DTP dose was administered less than 6 months ago
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = 'Diphtheria-tetanus-pertussis containing vaccines') < 6 'month'
*/
define "The latest DTP dose was administered less than 6 months ago":
	"Date of latest DTP Vaccine" is not null and duration in months between "Date of latest DTP Vaccine" and Now() < 6

/*
@input: The latest DTP dose was administered more than 6 months ago
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = 'Diphtheria-tetanus-pertussis containing vaccines') ≥ 6 'month'
*/
define "The latest DTP dose was administered more than 6 months ago":
	not("The latest DTP dose was administered less than 6 months ago")

/*
@input: The latest DTP dose was administered less than 1 year ago
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = "Diphtheria-tetanus-pertussis containing vaccines") < 1 year
*/
define "The latest DTP dose was administered less than 1 year ago":
	"Date of latest DTP Vaccine" is not null and duration in years between "Date of latest DTP Vaccine" and Now() < 1

/*
@input: The latest DTP dose was administered more than 1 year ago
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Vaccine type" = "Diphtheria-tetanus-pertussis containing vaccines") ≥ 1 year
*/
define "The latest DTP dose was administered more than 1 year ago":
	not("The latest DTP dose was administered less than 1 year ago")

/*
@input: The latest tetanus and diphtheria dose was administered less than 4 weeks ago
@pseudocode: Today's date - Latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria containing vaccines") < 4 weeks
*/
define "The latest tetanus and diphtheria dose was administered less than 4 weeks ago":
  "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

/*
@input: The latest tetanus and diphtheria dose was administered more than 4 weeks ago
@pseudocode: Today's date - Latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria containing vaccines") > 4 weeks
*/
define "The latest tetanus and diphtheria dose was administered more than 4 weeks ago":
	not("The latest tetanus and diphtheria dose was administered less than 4 weeks ago")

/*
@input: The latest tetanus and diphtheria dose was administered less than 1 year ago
@pseudocode: Today's date - Latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria containing vaccines") < 1 year
*/
define "The latest tetanus and diphtheria dose was administered less than 1 year ago":
  "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

/*
@input: The latest tetanus and diphtheria dose was administered more than 1 year ago
@pseudocode: Today's date - Latest "Date and time of vaccination" (where "Vaccine type" = "Tetanus and diphtheria containing vaccines") ≥ 1 year
*/
define "The latest tetanus and diphtheria dose was administered more than 1 year ago":
	not("The latest tetanus and diphtheria dose was administered less than 1 year ago")

/*
@input: Client is currently pregnant
@pseudocode: "Currently pregnant" = TRUE
*/
define "Client is currently pregnant":
	IMMZCom."Pregnant"

/*
@input: The client has a history of anaphylactic reactions
@pseudocode: "Potential contraindications" = "History of anaphylactic reactions"
*/
define "The client has a history of anaphylactic reactions":
	exists(IMMZCom."History of Anaphylactic Reactions Condition")

/*
@input: The client currently has a severe acute illness
@pseudocode: "Potential contraindications" = "Severe acute illness"
*/
define "The client currently has a severe acute illness":
	exists(IMMZCom."Severe Acute Illness Condition")

Content not shown - (application/elm+xml, size = 83Kb)

Content not shown - (application/elm+json, size = 139Kb)