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: IMMZD2DTRotavirusElements

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

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

Title: IMMZD2DTRotavirusElements
Id: IMMZD2DTRotavirusElements
Version: 0.2.0
Url: IMMZD2DTRotavirusElements
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 Rotavirus used throughout the Immunization CPG

Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
PatientPatient01Out
Rotavirus Doses Administered to PatientImmunization0*Out
Date of Latest Rotavirus Dosedate01Out
Rotavirus Primary Series Doses Administered to PatientImmunization0*Out
Number of Rotavirus Primary Series Doses Administeredinteger01Out
No rotavirus primary series doses were administeredboolean01Out
One rotavirus primary series dose was administeredboolean01Out
Two rotavirus primary series doses were administeredboolean01Out
Three rotavirus primary series doses were administeredboolean01Out
Client's age is less than 6 weeksboolean01Out
Client's age is between 6 weeks and 24 monthsboolean01Out
Client's age is more than 24 monthsboolean01Out
No live vaccine was administered in the last 4 weeksboolean01Out
Live vaccine was administered in the last 4 weeksboolean01Out
Live vaccines was administered in the last 4 weeksboolean01Out
No live vaccine was administered in last 4 weeksboolean01Out
Live vaccine was administered in last 4 weeksboolean01Out
Brand of First DoseCodeableConcept01Out
Brand of Second DoseCodeableConcept01Out
The series administered to the client contains the same productboolean01Out
The series administered to the client is a mixed series or a series with unknown vaccine productsboolean01Out
The series contain more than two dosesboolean01Out
The series contain less than or equal to two dosesboolean01Out
Content: text/cql

/*
  * Library: IMMZD2DTRotavirusElements
  */
library IMMZD2DTRotavirusElements

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: Rotavirus containing Doses Administered to Patient
*/
define "Rotavirus Doses Administered to Patient":
  Elements."Doses Administered to Patient" I
  where
    I.vaccineCode in Concepts."Rotavirus vaccines"

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

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

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

/*
@input: No rotavirus primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Rotavirus vaccines" and "Type of dose" = "Primary series") = 0
*/
define "No rotavirus primary series doses were administered":
  "Number of Rotavirus Primary Series Doses Administered" = 0

/*
@input: One rotavirus primary series dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Rotavirus vaccines" and "Type of dose" = "Primary series") = 1
*/
define "One rotavirus primary series dose was administered":
  "Number of Rotavirus Primary Series Doses Administered" = 1

/*
@input: Two rotavirus primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Rotavirus vaccines" and "Type of dose" = "Primary series") = 2
*/
define "Two rotavirus primary series doses were administered":
  "Number of Rotavirus Primary Series Doses Administered" = 2

/*
@input: Three rotavirus primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Rotavirus vaccines" and "Type of dose" = "Primary series") = 3
*/
define "Three rotavirus primary series doses were administered":
  "Number of Rotavirus Primary Series Doses Administered" = 3

/*
@input: Client's age is less than 6 weeks
@pseudocode: 'Today's date – "Date of birth" < 6 weeks
*/
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 24 months
@pseudocode: 6 weeks ≤ Today's date – "Date of birth" < 24 months
*/
define "Client's age is between 6 weeks and 24 months":
  6 <= Elements."Current Patient Age In Weeks" 
  and Elements."Current Patient Age In Months" < 24

/*
@input: Client's age is more than 24 months
@pseudocode: "Date of birth" > 24 months
@note: This is >= to be consistent
*/
define "Client's age is more than 24 months":
  Elements."Current Patient Age In Months" >= 24

/*
@input: No live vaccine was administered in the last 4 weeks
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Live vaccine" = TRUE) ≥ 4 weeks
*/
define "No live vaccine was administered in the last 4 weeks":
  Elements."No live vaccine was administered in the last 4 weeks"

/*
@input: Live vaccine was administered in the last 4 weeks
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Live vaccine" = TRUE) < 4 weeks
*/
define "Live vaccine was administered in the last 4 weeks":
  Elements."Live vaccine was administered in the last 4 weeks"

/*
@input: Live vaccines was administered in the last 4 weeks
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Live vaccine" = TRUE) < 4 weeks
*/
define "Live vaccines was administered in the last 4 weeks":
  Elements."Live vaccine was administered in the last 4 weeks"

/*
@input: No live vaccine was administered in last 4 weeks
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Live vaccine" = TRUE) ≥ 4 weeks
*/
define "No live vaccine was administered in last 4 weeks":
  Elements."No live vaccine was administered in the last 4 weeks"

/*
@input: Live vaccine was administered in last 4 weeks
@pseudocode: Today's date - latest "Date and time of vaccination" (where "Live vaccine" = TRUE) < 4 weeks
*/
define "Live vaccine was administered in last 4 weeks":
  Elements."Live vaccine was administered in the last 4 weeks"

/*
internal: The brand of the first dose given
*/
define "Brand of First Dose":
  First("Rotavirus Doses Administered to Patient".getDose('1')).brand()

/*
internal: The brand of the second dose given
*/
define "Brand of Second Dose":
  First("Rotavirus Doses Administered to Patient".getDose('2')).brand()

/*
@input: The series administered to the client is a mixed series or a series with unknown vaccine products
@pseudocode: "Vaccine brand" (where "Vaccine type" = "Rotavirus vaccines" AND "Dose number" = 1) ≠ "Vaccine brand" (where "Vaccine type" = "Rotavirus vaccines" AND "Dose number" = 2)
*/
define "The series administered to the client is a mixed series or a series with unknown vaccine products":
  not "The series administered to the client contains the same product"

/*
@input: The series administered to the client contains the same product
@pseudocode: "Vaccine brand" (where "Vaccine type" = "Rotavirus vaccines" AND "Dose number" = 1) = "Vaccine brand" (where "Vaccine type" = "Rotavirus vaccines" AND "Dose number" = 2)
*/
define "The series administered to the client contains the same product":
  "Brand of First Dose" is not null and
  "Brand of First Dose" ~ "Brand of Second Dose"

/*
@input: The series contain more than two doses
@pseudocode: "Total doses in series" > 2
*/
define "The series contain more than two doses":
  ToInteger("Rotavirus Doses Administered to Patient".mostRecent().seriesDoses()) > 2

/*
@input: The series contain less than or equal to two doses
@pseudocode: "Total doses in series" ≤ 2
*/
define "The series contain less than or equal to two doses":
  ToInteger("Rotavirus Doses Administered to Patient".mostRecent().seriesDoses()) <= 2

Content: application/elm+xml
Encoded data (62664 characters)