Title: IMMZD5DTTyphoidContraindicationsLogic Id: IMMZD5DTTyphoidContraindicationsLogic Version: 0.2.0 Url: IMMZD5DTTyphoidContraindicationsLogic Status: draft Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2025-12-05 23:35:21+0000 Publisher: WHO Description: This library defines decision support logic for the IMMZ.D5.DT.Typhoid contraindications decision table in the Immunization CPG Related Artifacts: Dependencies IMMZD5DTTyphoidEncounterElements Parameters: Name Type Min Max In/Out Today date 0 1 In Patient Patient 0 1 Out Draft Medication Request ID for Typhoid dose id 0 1 Out Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. boolean 0 1 Out Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance string 0 1 Out Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note boolean 0 1 Out Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note Guidance string 0 1 Out Typhoid vaccination is contraindicated for Ty21a vaccine. Case 1 boolean 0 1 Out Typhoid vaccination is contraindicated for Ty21a vaccine. Case 2 boolean 0 1 Out Typhoid vaccination is contraindicated for Ty21a vaccine. boolean 0 1 Out Typhoid vaccination is contraindicated for Ty21a vaccine. Guidance string 0 1 Out Guidance string 0 1 Out Has Guidance boolean 0 1 Out Test Validation Resource 0 1 Out Content: text/cql /* * Library: IMMZD5DTTyphoidContraindicationsLogic (IMMZ.D5.DT.Typhoid contraindications) * Rule: Check for contraindications before administering the vaccine(s) due * Decision Table: IMMZ.D5.DT.Typhoid contraindications * Trigger: IMMZ.D5 Determine vaccine(s) to be administered based on contraindications */ library IMMZD5DTTyphoidContraindicationsLogic using FHIR version '4.0.1' include FHIRHelpers version '4.0.1' include IMMZD5DTTyphoidEncounterElements called Encounter parameter Today Date default Today() context Patient /* @dynamicValue: Draft Medication Request ID for Typhoid dose */ define "Draft Medication Request ID for Typhoid dose": First(Encounter."Draft Medication Request for Typhoid dose").id /* @dynamicValue: Guidance */ define "Guidance": case when "Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note." then "Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance" when "Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note" then "Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note Guidance" when "Typhoid vaccination is contraindicated for Ty21a vaccine." then "Typhoid vaccination is contraindicated for Ty21a vaccine. Guidance" else '' end define "Has Guidance": "Guidance" is not null and "Guidance" != '' /* @output: Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note.": Encounter."The client has hypersensitivity to any component of the vaccine" /* @output: Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance @guidance: Do not vaccinate client with typhoid if client has known hypersensitivity to any component of the vaccine. */ define "Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance": 'Do not vaccinate client with typhoid if client has known hypersensitivity to any component of the vaccine.' /* @output: Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note @pseudocode: "Immunization recommendation status" = "Contraindicated" (where "Type of typhoid dose" = "Ty21a") AND "Immunization recommendation status" = "Further evaluation needed" (where "Type of typhoid dose" = "Typbar-TCV" OR "ViPS") */ define "Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note": Encounter."The client is currently pregnant" /* @output: Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note Guidance @guidance: Do not vaccinate client with Ty21a vaccine as live attenuated Ty21a vaccine is contraindicated for pregnant clients. For Typbar-TCV or ViPS vaccine, check if an alternative typhoid vaccine is appropriate for the client, consider risks of vaccination and make a clinical judgement. */ define "Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note Guidance": 'Do not vaccinate client with Ty21a vaccine as live attenuated Ty21a vaccine is contraindicated for pregnant clients. For Typbar-TCV or ViPS vaccine, check if an alternative typhoid vaccine is appropriate for the client, consider risks of vaccination and make a clinical judgement.' /* @output: Typhoid vaccination is contraindicated for Ty21a vaccine. Case 1 @pseudocode: "Immunization recommendation status" = "Contraindicated" (where "Type of typhoid dose" = "Ty21a") */ define "Typhoid vaccination is contraindicated for Ty21a vaccine. Case 1": Encounter."The client is currently taking antibiotics" /* @output: Typhoid vaccination is contraindicated for Ty21a vaccine. Case 2 @pseudocode: "Immunization recommendation status" = "Contraindicated" (where "Type of typhoid dose" = "Ty21a") */ define "Typhoid vaccination is contraindicated for Ty21a vaccine. Case 2": Encounter."The client's HIV status is positive" and Encounter."The client is not immunologically stable" /* @output: Typhoid vaccination is contraindicated for Ty21a vaccine. @pseudocode: "Immunization recommendation status" = "Contraindicated" (where "Type of typhoid dose" = "Ty21a") */ define "Typhoid vaccination is contraindicated for Ty21a vaccine.": "Typhoid vaccination is contraindicated for Ty21a vaccine. Case 1" or "Typhoid vaccination is contraindicated for Ty21a vaccine. Case 2" /* @output: Typhoid vaccination is contraindicated for Ty21a vaccine. Guidance @guidance = Do not vaccinate client with Ty21a vaccine as Ty21a vaccine is contraindicated for clients who are taking antibiotics. Evaluate if other types of typhoid vacccines can be administered. @guidance = Do not vaccinate client with Ty21a vaccine as Ty21a vaccine is contraindicated for HIV-infected client who are not immunologically stable. */ define "Typhoid vaccination is contraindicated for Ty21a vaccine. Guidance": case when "Typhoid vaccination is contraindicated for Ty21a vaccine. Case 1" then 'Do not vaccinate client with Ty21a vaccine as Ty21a vaccine is contraindicated for clients who are taking antibiotics. Evaluate if other types of typhoid vacccines can be administered.' when "Typhoid vaccination is contraindicated for Ty21a vaccine. Case 2" then 'Do not vaccinate client with Ty21a vaccine as Ty21a vaccine is contraindicated for HIV-infected client who are not immunologically stable.' else '' end /* @test: Test expected results based on example patients */ define "Test Validation": case when Patient.id = 'Typhoid41.1' then "Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note." and "Guidance" = 'Do not vaccinate client with typhoid if client has known hypersensitivity to any component of the vaccine.' when Patient.id = 'Typhoid42.1' then "Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note" and "Guidance" = 'Do not vaccinate client with Ty21a vaccine as live attenuated Ty21a vaccine is contraindicated for pregnant clients. For Typbar-TCV or ViPS vaccine, check if an alternative typhoid vaccine is appropriate for the client, consider risks of vaccination and make a clinical judgement.' when Patient.id = 'Typhoid43.1' then "Typhoid vaccination is contraindicated for Ty21a vaccine. Case 1" and "Guidance" = 'Do not vaccinate client with Ty21a vaccine as Ty21a vaccine is contraindicated for clients who are taking antibiotics. Evaluate if other types of typhoid vacccines can be administered.' when Patient.id = 'Typhoid44.2' then "Typhoid vaccination is contraindicated for Ty21a vaccine. Case 2" and "Guidance" = 'Do not vaccinate client with Ty21a vaccine as Ty21a vaccine is contraindicated for HIV-infected client who are not immunologically stable.' else 'No test case set' end Content: application/elm+xml Encoded data (60160 characters)
This library defines decision support logic for the IMMZ.D5.DT.Typhoid contraindications decision table in the Immunization CPG
Draft Medication Request ID for Typhoid dose
Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note.
Typhoid vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance
Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note
Typhoid vaccination is contraindicated for Ty21a vaccine. Clinical judgement is required for Typbar-TCV or ViPS vaccine. Create a clinical note Guidance
Typhoid vaccination is contraindicated for Ty21a vaccine. Case 1
Typhoid vaccination is contraindicated for Ty21a vaccine. Case 2
Typhoid vaccination is contraindicated for Ty21a vaccine.
Typhoid vaccination is contraindicated for Ty21a vaccine. Guidance