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

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

This library defines decision support logic for the IMMZ.D18.S.Polio.Birth dose schedule table in the Immunization CPG

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

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

code: logic-library

Date: 2025-09-17 23:03:28+0000
Publisher: WHO
Description:

This library defines decision support logic for the IMMZ.D18.S.Polio.Birth dose schedule table in the Immunization CPG

Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Todaydate01In
PatientPatient01Out
Polio birth dose (a zero dose) was administeredboolean01Out
bOPV birth dose (a zero dose) Expirationdate01Out
bOPV birth dose (a zero dose)boolean01Out
bOPV birth dose (a zero dose) Due Datedate01Out
bOPV birth dose (a zero dose) Overduedate01Out
bOPV birth dose (a zero dose) Createstring01Out
Test ValidationResource01Out
Content: text/cql

/*
 * Library: IMMZD18SPolioBirthLogic (IMMZ.D18.S.Polio.Birth dose schedule)
 * Schedule Table: Birth dose schedule (in countries that are poliomyelitis (polio)-endemic countries or countries at high risk for importation and subsequent spread of polio that follow the combined bivalent oral polio vaccine [bOPV]–inactivated polio vaccine [IPV] schedule)
 */
library IMMZD18SPolioBirthLogic

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 IMMZD2DTPolioEncounterElements called Encounter

parameter Today Date default Today()

context Patient


/*
@output: bOPV birth dose (a zero dose)
@description: Provision of bOPV birth dose (a zero dose)
@trigger: Child's birth
@triggerDate: "Date of birth"
*/
define "bOPV birth dose (a zero dose)":
  not "Polio birth dose (a zero dose) was administered"
  and "bOPV birth dose (a zero dose) Expiration" after day of Today

/*
@output: bOPV birth dose (a zero dose) Create
@create: bOPV birth dose (a zero dose) should be provided within the first week of life and if the client is in a polio-endemic country or a country at high risk for importation and subsequent spread of polio
*/
define "bOPV birth dose (a zero dose) Create":
  if "bOPV birth dose (a zero dose)" 
  then 'bOPV birth dose (a zero dose) should be provided within the first week of life and if the client is in a polio-endemic country or a country at high risk for importation and subsequent spread of polio' + '
Due Date: ' + ToString("bOPV birth dose (a zero dose) Due Date") + '
Overdue: ' + ToString("bOPV birth dose (a zero dose) Overdue") + '
Expiration: ' + ToString("bOPV birth dose (a zero dose) Expiration")
  else ''

/*
@dynamicValue: bOPV birth dose (a zero dose) Due Date
@pseudocode: "Date of birth"
*/
define "bOPV birth dose (a zero dose) Due Date":
  if "bOPV birth dose (a zero dose)" then Patient.birthDate
  else null

/*
@dynamicValue: bOPV birth dose (a zero dose) Overdue
@pseudocode: "Date of birth" + 1 day
*/
define "bOPV birth dose (a zero dose) Overdue":
  if "bOPV birth dose (a zero dose)" then Patient.birthDate + 1 day
  else null

/*
@dynamicValue: bOPV birth dose (a zero dose) Expiration
@pseudocode: "Date of birth" + 1 week
*/
define "bOPV birth dose (a zero dose) Expiration":
  Patient.birthDate + 1 week

/*
@complete: Polio birth dose (a zero dose) was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Poliovirus-containing vaccines" and "Type of dose" = "Dose 0" AND "Birth dose" = TRUE) = 1
*/
define "Polio birth dose (a zero dose) was administered":
  Encounter."bOPV birth dose (a zero dose) was administered"

/*
@test: Test expected results based on example patients
*/
define "Test Validation":
  case
    when Patient.id = '08.Alt1w' then "bOPV birth dose (a zero dose)"
    when Patient.id = '09.Agt1w' then not "bOPV birth dose (a zero dose)"
    when Patient.id = '10.D1' then not "bOPV birth dose (a zero dose)"
    else 'No test case set'
  end
Content: application/elm+xml
Encoded data (41848 characters)