Title: IMMZD18STyphoidViPSLogic Id: IMMZD18STyphoidViPSLogic Version: 0.2.0 Url: IMMZD18STyphoidViPSLogic 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.Typhoid.ViPS schedule table in the Immunization CPG Related Artifacts: Dependencies WHOCommon IMMZCommon IMMZConcepts IMMZEncounterElements IMMZD2DTTyphoidEncounterElements Parameters: Name Type Min Max In/Out Today date 0 1 In Patient Patient 0 1 Out One typhoid dose from the primary series was administered. The primary series has been completed boolean 0 1 Out Typhoid dose 1 boolean 0 1 Out Typhoid dose 1 Due Date date 0 1 Out Typhoid dose 1 Create string 0 1 Out Typhoid dose 1 Overdue Resource 0 1 Out Typhoid dose 1 Expiration Resource 0 1 Out Typhoid booster dose(s) boolean 0 1 Out Typhoid booster dose(s) Due Date date 0 1 Out Typhoid booster dose(s) Create string 0 1 Out Typhoid booster dose(s) Overdue Resource 0 1 Out Typhoid booster dose(s) Expiration Resource 0 1 Out Typhoid booster dose was administered less than 3 years ago boolean 0 1 Out Test Validation Resource 0 1 Out Content: text/cql /* * Library: IMMZD18STyphoidViPSLogic (IMMZ.D18.S.Typhoid.ViPS schedule) * Schedule Table: Unconjugated Vi polysaccharide (ViPS), 1 dose schedule */ library IMMZD18STyphoidViPSLogic 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 IMMZD2DTTyphoidEncounterElements called Encounter parameter Today Date default Today() context Patient /* @output: Typhoid dose 1 @description: Provision of the typhoid ViPS dose 1 @trigger: Child's birth @pseudo: @triggerDate: "Date of birth" */ define "Typhoid dose 1": Encounter."No typhoid primary series doses were administered" and not "One typhoid dose from the primary series was administered. The primary series has been completed" /* @output: Typhoid dose 1 Create @create: Typhoid dose 1 should be provided if the client's age is over 2 years, and the region recommends typhoid vaccination. */ define "Typhoid dose 1 Create": if "Typhoid dose 1" then 'Typhoid dose 1 should be provided if the client\'s age is over 2 years, and the region recommends typhoid vaccination.' + ' Due Date: ' + ToString("Typhoid dose 1 Due Date") else '' /* @dynamicValue: Typhoid dose 1 Due Date @pseudocode: "Date of birth" + 2 years */ define "Typhoid dose 1 Due Date": if "Typhoid dose 1" then Patient.birthDate + 2 years else null /* @dynamicValue: Typhoid 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 "Typhoid dose 1 Overdue": null /* @dynamicValue: Typhoid dose 1 Expiration @pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated. */ define "Typhoid dose 1 Expiration": null /* @complete: One typhoid dose from the primary series was administered. The primary series has been completed @pseudocode: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Typhoid vaccines") */ define "One typhoid dose from the primary series was administered. The primary series has been completed": Encounter."One typhoid primary series dose was administered" /* @output: Typhoid booster dose(s) @description: Provision of the typhoid ViPS booster dose @trigger: The primary series has been completed @pseudo: "Completed the primary vaccination series" = TRUE (where "Vaccine type" = "Typhoid vaccines") @triggerDate: Latest "Date and time of vaccination" (where "Vaccine type" = "Typhoid vaccines") */ define "Typhoid booster dose(s)": "One typhoid dose from the primary series was administered. The primary series has been completed" /* @output: Typhoid booster dose(s) Create @create: Revaccination is recommended every 3 years for ViPS. */ define "Typhoid booster dose(s) Create": if "Typhoid booster dose(s)" then 'Revaccination is recommended every 3 years for ViPS.' + ' Due Date: ' + ToString("Typhoid booster dose(s) Due Date") else '' /* @dynamicValue: Typhoid booster dose(s) Due Date @pseudocode: Latest "Date and time of vaccination" (where "Vaccine type" = "Typhoid vaccines") + 3 years */ define "Typhoid booster dose(s) Due Date": if "Typhoid booster dose(s)" then Encounter."Date of Latest Typhoid Dose" + 3 years else null /* @dynamicValue: Typhoid booster dose(s) Overdue @pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated. */ define "Typhoid booster dose(s) Overdue": null /* @dynamicValue: Typhoid booster dose(s) Expiration @pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated. */ define "Typhoid booster dose(s) Expiration": null /* @complete: Typhoid booster dose was administered less than 3 years ago @pseudocode: Count of vaccines administered (where "Vaccine type" = "Typhoid vaccines" and "Type of dose" = "Booster dose") ≥ 1 AND Today's date - Latest "Date and time of vaccination" (where "Vaccine type" = "Typhoid vaccines") < 3 years */ define "Typhoid booster dose was administered less than 3 years ago": Encounter."Date of Latest Typhoid Dose" is not null and duration in years between Encounter."Date of Latest Typhoid Dose" and Today < 3 /* @test: Test expected results based on example patients */ define "Test Validation": case when Patient.id = 'Typhoid19.1' then "Typhoid dose 1" when Patient.id = 'Typhoid20.2' then "Typhoid dose 1" when Patient.id = 'Typhoid21.2' then "Typhoid booster dose(s)" when Patient.id = 'Typhoid22.2' then "Typhoid booster dose(s)" else 'No test case set' end Content: application/elm+xml Encoded data (53268 characters)
This library defines decision support logic for the IMMZ.D18.S.Typhoid.ViPS schedule table in the Immunization CPG
One typhoid dose from the primary series was administered. The primary series has been completed
Typhoid booster dose was administered less than 3 years ago