Title: IMMZD18SPolioSequentialLogic Id: IMMZD18SPolioSequentialLogic Version: 0.2.0 Url: IMMZD18SPolioSequentialLogic Status: draft Experimental: true Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2025-06-25 20:08:00+0000 Publisher: WHO Description: This library defines decision support logic for the IMMZ.D18.S.Polio.Sequential IPV–bOPV schedule table in the Immunization CPG Related Artifacts: Dependencies WHOCommon IMMZCommon IMMZConcepts IMMZEncounterElements IMMZD2DTPolioEncounterElements Parameters: Name Type Min Max In/Out Today date 0 1 In Patient Patient 0 1 Out First IPV dose from the primary series was administered boolean 0 1 Out IPV dose 1 boolean 0 1 Out IPV dose 1 Due Date date 0 1 Out IPV dose 1 Create string 0 1 Out IPV dose 1 Overdue Resource 0 1 Out IPV dose 1 Expiration Resource 0 1 Out Second IPV dose from the primary series was administered boolean 0 1 Out IPV dose 2 boolean 0 1 Out IPV dose 2 Due Date date 0 1 Out IPV dose 2 Create string 0 1 Out IPV dose 2 Overdue Resource 0 1 Out IPV dose 2 Expiration Resource 0 1 Out First bOPV dose from the primary series was administered boolean 0 1 Out bOPV dose 1 boolean 0 1 Out bOPV dose 1 Due Date date 0 1 Out bOPV dose 1 Create string 0 1 Out bOPV dose 1 Overdue Resource 0 1 Out bOPV dose 1 Expiration Resource 0 1 Out Second bOPV dose from the primary series was administered. The primary series has been completed boolean 0 1 Out bOPV dose 2 boolean 0 1 Out bOPV dose 2 Due Date date 0 1 Out bOPV dose 2 Create string 0 1 Out bOPV dose 2 Overdue Resource 0 1 Out bOPV dose 2 Expiration Resource 0 1 Out Test Validation Resource 0 1 Out Content: text/cql /* * Library: IMMZD18SPolioSequentialLogic (IMMZ.D18.S.Polio.Sequential IPV–bOPV schedule) * Schedule Table: Sequential bivalent oral polio vaccine (bOPV)–inactivated polio vaccine (IPV) schedule */ library IMMZD18SPolioSequentialLogic 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: IPV dose 1 @description: Provision of IPV dose 1 @trigger: Child's birth @triggerDate: "Date of birth" */ define "IPV dose 1": not "First IPV dose from the primary series was administered" /* @output: IPV dose 1 Create @create: For sequential IPV– bOPV schedules, WHO recommends that the first dose of IPV be given starting from 8 weeks of age with an interval of 4–8 weeks before administration of the second IPV dose. */ define "IPV dose 1 Create": if "IPV dose 1" then 'For sequential IPV– bOPV schedules, WHO recommends that the first dose of IPV be given starting from 8 weeks of age with an interval of 4–8 weeks before administration of the second IPV dose.' + ' Due Date: ' + ToString("IPV dose 1 Due Date") else '' /* @dynamicValue: IPV dose 1 Due Date @pseudocode: "Date of birth" + 8 weeks */ define "IPV dose 1 Due Date": if "IPV dose 1" then Patient.birthDate + 8 weeks else null /* @dynamicValue: IPV dose 1 Overdue @pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated. */ define "IPV dose 1 Overdue": null /* @dynamicValue: IPV dose 1 Expiration @pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated. */ define "IPV dose 1 Expiration": null /* @complete: First IPV dose from the primary series was administered @pseudocode: Count of vaccines administered (where "Type of poliovirus dose" = "IPV") = 1 */ define "First IPV dose from the primary series was administered": Encounter."Number of Polio IPV Primary Series Doses Administered" >= 1 /* @output: IPV dose 2 @description: Provision of IPV dose 2 @trigger: First IPV dose from the primary series was administered Count of vaccines administered (where "Type of poliovirus dose" = "IPV") = 1 @triggerDate: Latest "Date and time of vaccination" (where "Type of poliovirus dose" = "IPV") */ define "IPV dose 2": "First IPV dose from the primary series was administered" and not "Second IPV dose from the primary series was administered" /* @output: IPV dose 2 Create @create: For sequential IPV– bOPV schedules, WHO recommends that the first dose of IPV be given starting from 8 weeks of age with an interval of 4–8 weeks before administration of the second IPV dose. */ define "IPV dose 2 Create": if "IPV dose 2" then 'For sequential IPV– bOPV schedules, WHO recommends that the first dose of IPV be given starting from 8 weeks of age with an interval of 4–8 weeks before administration of the second IPV dose.' + ' Due Date: ' + ToString("IPV dose 2 Due Date") else '' /* @dynamicValue: IPV dose 2 Due Date @pseudocode: Latest "Date and time of vaccination" (where "Type of poliovirus dose" = "IPV") + 4 weeks */ define "IPV dose 2 Due Date": if "IPV dose 2" then Encounter."Date of Latest IPV Dose" + 4 weeks else null /* @dynamicValue: IPV dose 2 Overdue @pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated. */ define "IPV dose 2 Overdue": null /* @dynamicValue: IPV dose 2 Expiration @pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated. */ define "IPV dose 2 Expiration": null /* @complete: Second IPV dose from the primary series was administered @pseudocode: Count of vaccines administered (where "Type of poliovirus dose" = "IPV") = 2 */ define "Second IPV dose from the primary series was administered": Encounter."Number of Polio IPV Primary Series Doses Administered" >= 2 /* @output: bOPV dose 1 @description: Provision of bOPV dose 1 @trigger: Second IPV dose from the primary series was administered Count of vaccines administered (where "Type of poliovirus dose" = "IPV") = 2 @triggerDate: Latest "Date and time of vaccination" (where "Type of poliovirus dose" = "IPV") */ define "bOPV dose 1": "Second IPV dose from the primary series was administered" and not "First bOPV dose from the primary series was administered" /* @output: bOPV dose 1 Create @create: Where a sequential IPV–bOPV schedule is used, the initial administration of 2 doses of IPV should be followed by ≥2 doses of bOPV separated by 4–8 weeks depending on the risk of exposure to poliovirus in early childhood. */ define "bOPV dose 1 Create": if "bOPV dose 1" then 'Where a sequential IPV–bOPV schedule is used, the initial administration of 2 doses of IPV should be followed by ≥2 doses of bOPV separated by 4–8 weeks depending on the risk of exposure to poliovirus in early childhood.' + ' Due Date: ' + ToString("bOPV dose 1 Due Date") else '' /* @dynamicValue: bOPV dose 1 Due Date @pseudocode: Latest "Date and time of vaccination" (where "Type of poliovirus dose" = "IPV") */ define "bOPV dose 1 Due Date": if "bOPV dose 1" then Encounter."Date of Latest IPV Dose" else null /* @dynamicValue: bOPV dose 1 Overdue @pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated. */ define "bOPV dose 1 Overdue": null /* @dynamicValue: bOPV dose 1 Expiration @pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated. */ define "bOPV dose 1 Expiration": null /* @complete: First bOPV dose from the primary series was administered @pseudocode: Count of vaccines administered (where "Type of poliovirus dose" = "bOPV") = 1 */ define "First bOPV dose from the primary series was administered": Encounter."Number of Polio bOPV Primary Series Doses Administered" >= 1 /* @output: bOPV dose 2 @description: Provision of bOPV dose 2 @trigger: First bOPV dose from the primary series was administered Count of vaccines administered (where "Type of poliovirus dose" = "bOPV") = 1 @triggerDate: Latest "Date and time of vaccination" (where "Type of poliovirus dose" = "bOPV") */ define "bOPV dose 2": "First bOPV dose from the primary series was administered" and not "Second bOPV dose from the primary series was administered. The primary series has been completed" /* @output: bOPV dose 2 Create @create: Where a sequential IPV–bOPV schedule is used, the initial administration of 2 doses of IPV should be followed by ≥2 doses of bOPV separated by 4–8 weeks depending on the risk of exposure to poliovirus in early childhood. */ define "bOPV dose 2 Create": if "bOPV dose 2" then 'Where a sequential IPV–bOPV schedule is used, the initial administration of 2 doses of IPV should be followed by ≥2 doses of bOPV separated by 4–8 weeks depending on the risk of exposure to poliovirus in early childhood.' + ' Due Date: ' + ToString("bOPV dose 2 Due Date") else '' /* @dynamicValue: bOPV dose 2 Due Date @pseudocode: Latest "Date and time of vaccination" (where "Type of poliovirus dose" = "bOPV") + 4 weeks */ define "bOPV dose 2 Due Date": if "bOPV dose 1" then Encounter."Date of Latest bOPV Dose" + 4 weeks else null /* @dynamicValue: bOPV dose 2 Overdue @pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated. */ define "bOPV dose 2 Overdue": null /* @dynamicValue: bOPV dose 2 Expiration @pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated. */ define "bOPV dose 2 Expiration": null /* @complete: Second bOPV dose from the primary series was administered. The primary series has been completed @pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Poliovirus-containing vaccines") */ define "Second bOPV dose from the primary series was administered. The primary series has been completed": Encounter."Number of Polio bOPV Primary Series Doses Administered" >= 2 /* @test: Test expected results based on example patients */ define "Test Validation": case when Patient.id = '56.Alt8w' then "IPV dose 1" when Patient.id = '57.Agt8w' then "IPV dose 1" when Patient.id = '58.D1PDlt4w' then "IPV dose 2" when Patient.id = '59.D1PDgt4w' then "IPV dose 2" when Patient.id = '60.D2' then "bOPV dose 1" when Patient.id = '61.D3PDlt4w' then "bOPV dose 2" when Patient.id = '62.D3PDgt4w' then "bOPV dose 2" when Patient.id = '63.D4' then "Second bOPV dose from the primary series was administered. The primary series has been completed" else 'No test case set' end Content: application/elm+xml Encoded data (93420 characters)
This library defines decision support logic for the IMMZ.D18.S.Polio.Sequential IPV–bOPV schedule table in the Immunization CPG
First IPV dose from the primary series was administered
Second IPV dose from the primary series was administered
First bOPV dose from the primary series was administered
Second bOPV dose from the primary series was administered. The primary series has been completed