WHO Immunization Implementation Guide
0.2.0 - ci-build

WHO Immunization Implementation Guide, published by WHO. This guide is not an authorized publication; it is the continuous build for version 0.2.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: IMMZD2DTHibElements

Official URL: http://smart.who.int/immunizations/Library/IMMZD2DTHibElements Version: 0.2.0
Draft as of 2025-08-08 Computable Name: IMMZD2DTHibElements

This library defines context-independent elements for Hib used throughout the Immunization CPG

Title: IMMZD2DTHibElements
Id: IMMZD2DTHibElements
Version: 0.2.0
Url: IMMZD2DTHibElements
Status: draft
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2025-08-08 19:12:11+0000
Publisher: WHO
Description:

This library defines context-independent elements for Hib used throughout the Immunization CPG

Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
PatientPatient01Out
Hib Doses Administered to PatientImmunization0*Out
Hib Primary Series Doses Administered to PatientImmunization0*Out
Number of Hib Primary Series Doses Administeredinteger01Out
Hib Booster Series Doses Administered to PatientImmunization0*Out
Number of Hib Booster Series Doses Administeredinteger01Out
Date of First Hib Dosedate01Out
Date of Latest Hib Dosedate01Out
No Hib primary series doses were administeredboolean01Out
One Hib primary series dose was administeredboolean01Out
One Hib primary series doses was administeredboolean01Out
Two Hib primary series doses were administeredboolean01Out
Three Hib primary series doses were administeredboolean01Out
No Hib booster doses were administeredboolean01Out
One Hib booster dose was administeredboolean01Out
Client's age is less than 6 weeksboolean01Out
Client's age is between 6 weeks and 5 yearsboolean01Out
Client's age is at least 6 weeks and not more than 5 yearsboolean01Out
Client's age is between 6 weeks and not more than 5 yearsboolean01Out
Client's age is more than 5 yearsboolean01Out
Client's age was less than 1 year when first Hib dose was administeredboolean01Out
Client's age was more than 1 year when first Hib dose was administeredboolean01Out
The latest Hib dose was administered less than 4 weeks agoboolean01Out
The latest Hib dose was administered more than 4 weeks agoboolean01Out
The latest Hib dose was administered less than 8 weeks agoboolean01Out
The latest Hib dose was administered more than 8 weeks agoboolean01Out
The latest Hib dose was administered less than 6 months agoboolean01Out
The latest Hib dose was administered more than 6 months agoboolean01Out
Content: text/cql

/*
  * Library: IMMZD2DTHibElements
  */
library IMMZD2DTHibElements

using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'

include WHOConcepts
include WHOCommon called WC
include WHOElements called WE

include IMMZCommon called Common
include IMMZConcepts called Concepts
include IMMZElements called Elements

context Patient

/*
@internal: Hib containing Doses Administered to Patient
*/
define "Hib Doses Administered to Patient":
  Elements."Doses Administered to Patient" I
  where
    I.vaccineCode in Concepts."Hib-containing vaccines"

/*
@internal: Hib containing Doses Administered to Patient that are in the Primary series
*/
define "Hib Primary Series Doses Administered to Patient":
  "Hib Doses Administered to Patient".seriesPrimary()

/*
@internal: Number of Hib Primary Series doses
*/
define "Number of Hib Primary Series Doses Administered":
  Count("Hib Primary Series Doses Administered to Patient")

/*
@internal: Hib containing Doses Administered to Patient that are in the Booster series
*/
define "Hib Booster Series Doses Administered to Patient":
  "Hib Doses Administered to Patient".seriesBooster()

/*
@internal: Number of Hib Booster Series doses
*/
define "Number of Hib Booster Series Doses Administered":
  Count("Hib Booster Series Doses Administered to Patient")

/*
@internal: Date and time of first Hib dose
*/
define "Date of First Hib Dose":
  date from start of "Hib Doses Administered to Patient".earliest().occurrence.toInterval()

/*
@internal: Date and time of last Hib dose
*/
define "Date of Latest Hib Dose":
  date from start of "Hib Doses Administered to Patient".mostRecent().occurrence.toInterval()

/*
@input: No Hib primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Hib-containing vaccines" and "Type of dose" = "Primary series") = 0
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "No Hib primary series doses were administered":
  "Number of Hib Primary Series Doses Administered" = 0

/*
@input: One Hib primary series dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Hib-containing vaccines" and "Type of dose"= "Primary series") = 1
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
*/
define "One Hib primary series dose was administered":
  "Number of Hib Primary Series Doses Administered" = 1

/*
@input: One Hib primary series doses was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Hib-containing vaccines" and "Type of dose"= "Primary series") = 1
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "One Hib primary series doses was administered":
  "One Hib primary series dose was administered"

/*
@input: Two Hib primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Hib-containing vaccines" and "Type of dose" = "Primary series" ) = 2
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "Two Hib primary series doses were administered":
  "Number of Hib Primary Series Doses Administered" = 2

/*
@input: Three Hib primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Hib-containing vaccines" and "Type of dose"= "Primary series") = 3
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
*/
define "Three Hib primary series doses were administered":
  "Number of Hib Primary Series Doses Administered" = 3

/*
@input: No Hib booster doses were administered
@pseudocode: Count of vaccines administered where "Vaccine type" = "Hib-containing vaccines" and "Type of dose"" = "Booster dose") = 0
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "No Hib booster doses were administered":
  "Number of Hib Booster Series Doses Administered" = 0

/*
@input: One Hib booster dose was administered
@pseudocode: Count of vaccines administered where "Vaccine type" = "Hib-containing vaccines" and "Type of dose" = "Booster dose") = 1
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "One Hib booster dose was administered":
  "Number of Hib Booster Series Doses Administered" = 1

/*
@input: Client's age is less than 6 weeks
@pseudocode: Today's date − "Date of birth" < 6 weeks
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "Client's age is less than 6 weeks":
  Elements."Current Patient Age In Weeks" < 6

/*
@input: Client's age is between 6 weeks and 5 years
@pseudocode: 6 weeks ≤ Today's date − "Date of birth" ≤ 5 years
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "Client's age is between 6 weeks and 5 years":
  6 <= Elements."Current Patient Age In Weeks" 
  and Elements."Current Patient Age In Years" <= 5

/*
@input: Client's age is at least 6 weeks and not more than 5 years
@pseudocode: 6 weeks ≤ Today's date − "Date of birth" ≤ 5 years
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "Client's age is at least 6 weeks and not more than 5 years":
  "Client's age is between 6 weeks and 5 years"

/*
@input: Client's age is between 6 weeks and not more than 5 years
@pseudocode: 6 weeks ≤ Today's date − "Date of birth" ≤ 5 years
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
*/
define "Client's age is between 6 weeks and not more than 5 years":
  "Client's age is between 6 weeks and 5 years"

/*
@input: Client's age is more than 5 years
@pseudocode: Today's date − "Date of birth" > 5 years
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "Client's age is more than 5 years":
  Elements."Current Patient Age In Years" > 5

/*
@input: Client's age was less than 1 year when first Hib dose was administered
@pseudocode: "Date and time of vaccination" (where "Vaccine type"= "Hib-containing vaccines" and "Dose number" = 1) − "Date of birth" < 1 year
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "Client's age was less than 1 year when first Hib dose was administered":
  AgeInYearsAt("Date of First Hib Dose") < 1

/*
@input: Client's age was more than 1 year when first Hib dose was administered
@pseudocode: "Date and time of vaccination" (where "Vaccine type"= "Hib-containing vaccines" and "Dose number" = 1) − "Date of birth" ≥ 1 year
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "Client's age was more than 1 year when first Hib dose was administered":
  AgeInYearsAt("Date of First Hib Dose") >= 1

/*
@input: The latest Hib dose was administered less than 4 weeks ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Hib-containing vaccines") < 4 weeks
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
*/
define "The latest Hib dose was administered less than 4 weeks ago":
  "Date of Latest Hib Dose" is not null
    and duration in weeks between "Date of Latest Hib Dose" and Now() < 4

/*
@input: The latest Hib dose was administered more than 4 weeks ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Hib-containing vaccines") ≥ 4 weeks
@decision: 3 primary doses without a booster dose (3p)
@decision: 3 primary doses with a booster dose (3p+1)
*/
define "The latest Hib dose was administered more than 4 weeks ago":
  not("The latest Hib dose was administered less than 4 weeks ago")

/*
@input: The latest Hib dose was administered less than 8 weeks ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Hib-containing vaccines") < 8 weeks
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "The latest Hib dose was administered less than 8 weeks ago":
  "Date of Latest Hib Dose" is not null
    and duration in weeks between "Date of Latest Hib Dose" and Now() < 8

/*
@input: The latest Hib dose was administered more than 8 weeks ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Hib-containing vaccines") ≥ 8 weeks
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "The latest Hib dose was administered more than 8 weeks ago":
  "The latest Hib dose was administered less than 8 weeks ago"

/*
@input: The latest Hib dose was administered less than 6 months ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Hib-containing vaccines") < 6 months
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "The latest Hib dose was administered less than 6 months ago":
  "Date of Latest Hib Dose" is not null
    and duration in months between "Date of Latest Hib Dose" and Now() < 6

/*
@input: The latest Hib dose was administered more than 6 months ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Hib-containing vaccines") ≥ 6 months
@decision: 3 primary doses with a booster dose (3p+1)
@decision: 2 primary doses with a booster dose (2p+1)
*/
define "The latest Hib dose was administered more than 6 months ago":
  not("The latest Hib dose was administered less than 6 months ago")
Content: application/elm+xml
Encoded data (81644 characters)