Title: IMMZD18SRabiesLogic Id: IMMZD18SRabiesLogic Version: 0.2.0 Url: IMMZD18SRabiesLogic Status: draft Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2025-11-25 20:07:03+0000 Publisher: WHO Description: This library defines decision support logic for the IMMZ.D18.S.Rabies schedule table in the Immunization CPG Related Artifacts: Dependencies WHOCommon IMMZCommon IMMZConcepts IMMZEncounterElements IMMZD2DTRabiesEncounterElements Parameters: Name Type Min Max In/Out Today date 0 1 In Patient Patient 0 1 Out First rabies dose from the primary series was administered boolean 0 1 Out Rabies dose 1 boolean 0 1 Out Rabies dose 1 Create string 0 1 Out Rabies dose 1 Due Date Resource 0 1 Out Rabies dose 1 Overdue Resource 0 1 Out Rabies dose 1 Expiration Resource 0 1 Out Second rabies dose from the primary series was administered. The primary series has been completed boolean 0 1 Out Rabies dose 2 boolean 0 1 Out Rabies dose 2 Due Date date 0 1 Out Rabies dose 2 Create string 0 1 Out Rabies dose 2 Overdue Resource 0 1 Out Rabies dose 2 Expiration Resource 0 1 Out Test Validation Resource 0 1 Out Content: text/cql /* * Library: IMMZD18SRabiesLogic (IMMZ.D18.S.Rabies schedule) * Schedule Table: Rabies schedule (2-dose scheme) */ library IMMZD18SRabiesLogic 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 IMMZD2DTRabiesEncounterElements called Encounter parameter Today Date default Today() context Patient /* @output: Rabies dose 1 @description: Provision of rabies dose 1 @trigger: To be determined by Member States @pseudo: @triggerDate: To be determined by Member States */ define "Rabies dose 1": Encounter."No rabies primary series doses were administered" and not "First rabies dose from the primary series was administered" /* @output: Rabies dose 1 Create @create: Rabies dose 1 should be provided if the client is at a high risk of rabies virus exposure */ define "Rabies dose 1 Create": if "Rabies dose 1" then 'Rabies dose 1 should be provided if the client is at a high risk of rabies virus exposure' else '' /* @dynamicValue: Rabies dose 1 Due Date @pseudocode: To be determined by Member States */ define "Rabies dose 1 Due Date": null /* @dynamicValue: Rabies dose 1 Overdue @pseudocode: To be determined by Member States */ define "Rabies dose 1 Overdue": null /* @dynamicValue: Rabies dose 1 Expiration @pseudocode: To be determined by Member States */ define "Rabies dose 1 Expiration": null /* @complete: First rabies dose from the primary series was administered @pseudocode: Count of vaccines administered (where "Vaccine type" = "Rabies vaccines" and "Type of dose" = "Primary series") = 1 */ define "First rabies dose from the primary series was administered": Encounter."One rabies primary series doses were administered" /* @output: Rabies dose 2 @description: Provision of rabies dose 2 @trigger: First rabies dose from the primary series was administered @pseudo: Count of vaccines administered (where "Vaccine type" = "Rabies vaccines" and "Type of dose" = "Primary series") = 1 @triggerDate: "Date and time of vaccination" (where "Vaccine type" = "Rabies vaccines") */ define "Rabies dose 2": "First rabies dose from the primary series was administered" and not "Second rabies dose from the primary series was administered. The primary series has been completed" /* @output: Rabies dose 2 Create @create: Rabies dose 2 should be provided if previous dose was given more than 1 week ago */ define "Rabies dose 2 Create": if "Rabies dose 2" then 'Rabies dose 2 should be provided if previous dose was given more than 1 week ago' + ' Due Date: ' + ToString("Rabies dose 2 Due Date") else '' /* @dynamicValue: Rabies dose 2 Due Date @pseudocode: "Date and time of vaccination" (where "Vaccine type" = "Rabies vaccines") + 7 days */ define "Rabies dose 2 Due Date": if "Rabies dose 2" then Encounter."Date of Latest Rabies Dose" + 7 days else null /* @dynamicValue: Rabies dose 2 Overdue @pseudocode: To be determined by Member States */ define "Rabies dose 2 Overdue": null /* @dynamicValue: Rabies dose 2 Expiration @pseudocode: To be determined by Member States */ define "Rabies dose 2 Expiration": null /* @complete: Second rabies dose from the primary series was administered. The primary series has been completed @pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Rabies vaccines") */ define "Second rabies dose from the primary series was administered. The primary series has been completed": Encounter."Two rabies primary series doses were administered" /* @test: Test expected results based on example patients */ define "Test Validation": case when Patient.id = 'Rabies08.1' then "Rabies dose 1" when Patient.id = 'Rabies09.2' then "Rabies dose 2" when Patient.id = 'Rabies10.2' then "Rabies dose 2" when Patient.id = 'Rabies11.1' then "Second rabies 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 (45276 characters)
This library defines decision support logic for the IMMZ.D18.S.Rabies schedule table in the Immunization CPG
First rabies dose from the primary series was administered
Second rabies dose from the primary series was administered. The primary series has been completed