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

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

This library defines decision support logic for the IMMZ.D18.S.Measles.MCV dose 0 schedule table in the Immunization CPG

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

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

code: logic-library

Date: 2025-11-13 21:36:17+0000
Publisher: WHO
Description:

This library defines decision support logic for the IMMZ.D18.S.Measles.MCV dose 0 schedule table in the Immunization CPG

Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Todaydate01In
PatientPatient01Out
MCV0 was administeredboolean01Out
MCV0 Expirationdate01Out
MCV0boolean01Out
MCV0 Due Datedate01Out
MCV0 Createstring01Out
MCV0 OverdueResource01Out
Test ValidationResource01Out
Content: text/cql
/*
 * Library: IMMZD18SMeaslesMCVDose0Logic (IMMZ.D18.S.Measles.MCV dose 0 schedule)
 * Schedule Table: Measles-containing vaccine dose 0 (MCV0) schedule
 */
library IMMZD18SMeaslesMCVDose0Logic

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

include WHOCommon called WC

include IMMZCommon called Common
include IMMZConcepts called Concepts

include IMMZEncounterElements called IE
include IMMZD2DTMeaslesEncounterElements called Encounter

parameter Today Date default Today()


context Patient


/*
@output: MCV0
@description: Provision of the MCV0
@trigger: Child's birth
@pseudo: 
@triggerDate: "Date of birth"
*/
define "MCV0":
  not "MCV0 was administered" and "MCV0 Expiration" after Today


/*
@output: MCV0 Create
@create: In the following situations, a supplementary dose of MCV should be given to infants from 6 months of age: 
• during a measles outbreak as part of intensified service delivery;
• 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);
• for internally displaced populations and refugees, and populations in conflict zones;
• 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);
• for infants travelling to countries experiencing measles outbreaks;
• for infants known to be HIV-infected or exposed (i.e. born to a woman infected with HIV).
*/
define "MCV0 Create":
  if "MCV0"
  then 'In the following situations, a supplementary dose of MCV should be given to infants from 6 months of age:
• during a measles outbreak as part of intensified service delivery;
• 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);
• for internally displaced populations and refugees, and populations in conflict zones;
• 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);
• for infants travelling to countries experiencing measles outbreaks;
• for infants known to be HIV-infected or exposed (i.e. born to a woman infected with HIV).' + '
Due Date: ' + ToString("MCV0 Due Date") + '
Expiration: ' + ToString("MCV0 Expiration")
  else ''


/*
@dynamicValue: MCV0 Due Date
@pseudocode: "Date of birth" + 6 months
*/
define "MCV0 Due Date":
  if "MCV0" then Patient.birthDate + 6 months
  else null


/*
@dynamicValue: MCV0 Overdue
@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.
*/
define "MCV0 Overdue":
  null


/*
@dynamicValue: MCV0 Expiration
@pseudocode: "Date of birth" + 9 months for countries with ongoing transmission in which the risk of measles mortality remains high
OR
"Date of birth" + 12 months for countries with low levels of measles transmission
*/
define "MCV0 Expiration":
  Patient.birthDate + 12 months

  
/*
@complete: MCV0 was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Dose 0") = 1
*/
define "MCV0 was administered":
  Encounter."MCV0 was administered"



/*
@test: Test expected results based on example patients
*/
define "Test Validation":
  case
    when Patient.id = 'Measles36.1' then "MCV0" 
    when Patient.id = 'Measles37.3' then "MCV0" 
    when Patient.id = 'Measles38.3' then "MCV0" 
    when Patient.id = 'Measles39.1' then "MCV0"
    when Patient.id = 'Measles40.1' then "MCV0 was administered" 
    else 'No test case set'
  end
Content: application/elm+xml
Encoded data (45760 characters)