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

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

This library defines decision support logic for the IMMZ.D18.S.Measles.Ongoing transmission schedule table in the Immunization CPG

Title: IMMZD18SMeaslesOngoingTransmissionLogic
Id: IMMZD18SMeaslesOngoingTransmissionLogic
Version: 0.2.0
Url: IMMZD18SMeaslesOngoingTransmissionLogic
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.Ongoing transmission schedule table in the Immunization CPG

Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Todaydate01In
PatientPatient01Out
MCV dose 1 (MCV1)boolean01Out
MCV dose 1 (MCV1) Due Datedate01Out
MCV dose 1 (MCV1) Createstring01Out
MCV dose 1 (MCV1) OverdueResource01Out
MCV dose 1 (MCV1) ExpirationResource01Out
MCV1 was administeredboolean01Out
MCV2 was administered. The primary series has been completed.boolean01Out
MCV2boolean01Out
MCV2 Due Datedate01Out
MCV2 Createstring01Out
MCV2 OverdueResource01Out
MCV2 ExpirationResource01Out
Test ValidationResource01Out
Content: text/cql
/*
 * Library: IMMZD18SMeaslesOngoingTransmissionLogic (IMMZ.D18.S.Measles.Ongoing transmission schedule)
 * Schedule Table: Countries with ongoing transmission in which the risk of measles mortality remains high (countries that provide first dose of measles-containing vaccine (MCV) at 9 months and second dose of MCV at 15 months)
 */
library IMMZD18SMeaslesOngoingTransmissionLogic

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: MCV dose 1 (MCV1)
@description: Provision of MCV1 from the primary series
@trigger: Child's birth
@pseudo: 
@triggerDate: "Date of birth"
*/
define "MCV dose 1 (MCV1)":
  Encounter."No measles primary series doses were administered"


/*
@output: MCV dose 1 (MCV1) Create
@create: The client is due for MCV1 if the client is at least 9 months of age.
*/
define "MCV dose 1 (MCV1) Create":
  if "MCV dose 1 (MCV1)"
  then 'The client is due for MCV1 if the client is at least 9 months of age.
Due Date: ' + ToString("MCV dose 1 (MCV1) Due Date")
  else ''


/*
@dynamicValue: MCV dose 1 (MCV1) Due Date
@pseudocode: "Date of birth" + 9 months
*/
define "MCV dose 1 (MCV1) Due Date":
  if "MCV dose 1 (MCV1)" then Patient.birthDate + 9 months
  else null


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


/*
@dynamicValue: MCV dose 1 (MCV1) Expiration
@pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated.
*/
define "MCV dose 1 (MCV1) Expiration":
  null

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



/*
@output: MCV2
@description: Provision of the MCV2 from the primary series
@trigger: MCV1 was administered
@pseudo: Count of vaccines administered (where "Vaccine type" = "Measles-containing vaccines" and "Type of dose" = "Primary series") = 1
@triggerDate: "Date of birth"
*/
define "MCV2":
  "MCV1 was administered" and not "MCV2 was administered. The primary series has been completed."


/*
@output: MCV2 Create
@create: The client is due for MCV2 if the client is at least 15 months of age.
*/
define "MCV2 Create":
  if "MCV2"
  then 'The client is due for MCV2 if the client is at least 15 months of age.
Due Date: ' + ToString("MCV2 Due Date")
  else ''


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


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


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

  
/*
@complete: MCV2 was administered. The primary series has been completed.
@pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Measles-containing vaccines")
*/
define "MCV2 was administered. The primary series has been completed.":
  Encounter."MCV2 was administered"



/*
@test: Test expected results based on example patients
*/
define "Test Validation":
  case
    when Patient.id = 'Measles08.1' then "MCV dose 1 (MCV1)"
    when Patient.id = 'Measles09.3' then "MCV dose 1 (MCV1)" 
    when Patient.id = 'Measles10.3' then "MCV dose 1 (MCV1)" 
    when Patient.id = 'Measles11.2' then "MCV2" 
    when Patient.id = 'Measles12.3' then "MCV2" 
    when Patient.id = 'Measles13.3' then "MCV2" 
    when Patient.id = 'Measles14.1' then "MCV2 was administered. The primary series has been completed." 
    else 'No test case set'
  end
Content: application/elm+xml
Encoded data (56680 characters)