Title: IMMZD5DTHepatitisAContraindicationsLogic Id: IMMZD5DTHepatitisAContraindicationsLogic Version: 0.2.0 Url: IMMZD5DTHepatitisAContraindicationsLogic 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.D5.DT.Hepatitis A contraindications decision table in the Immunization CPG Related Artifacts: Dependencies IMMZD5DTHepatitisAEncounterElements Parameters: Name Type Min Max In/Out Today date 0 1 In Patient Patient 0 1 Out Draft Medication Request ID for Hepatitis A dose id 0 1 Out Live attentuated Hepatitis A-containing vaccine is contraindicated Case 1 boolean 0 1 Out Live attentuated Hepatitis A-containing vaccine is contraindicated Case 2 boolean 0 1 Out Live attentuated Hepatitis A-containing vaccine is contraindicated boolean 0 1 Out Live attentuated Hepatitis A-containing vaccine is contraindicated Guidance string 0 1 Out Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note boolean 0 1 Out Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note 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: IMMZD5DTHepatitisAContraindicationsLogic (IMMZ.D5.DT.Hepatitis A contraindications) * Rule: Check for contraindications before administering the vaccine(s) due * Decision Table: IMMZ.D5.DT.Hepatitis A contraindications * Trigger: IMMZ.D5 Determine vaccine(s) to be administered based on contraindications */ library IMMZD5DTHepatitisAContraindicationsLogic using FHIR version '4.0.1' include FHIRHelpers version '4.0.1' include IMMZD5DTHepatitisAEncounterElements called Encounter parameter Today Date default Today() context Patient /* @dynamicValue: Draft Medication Request ID for Hepatitis A dose */ define "Draft Medication Request ID for Hepatitis A dose": First(Encounter."Draft Medication Request for Hepatitis A dose").id /* @dynamicValue: Guidance */ define "Guidance": case when "Live attentuated Hepatitis A-containing vaccine is contraindicated" then "Live attentuated Hepatitis A-containing vaccine is contraindicated Guidance" when "Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note" then "Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance" else '' end define "Has Guidance": "Guidance" is not null and "Guidance" != '' /* @output: Live attentuated Hepatitis A-containing vaccine is contraindicated Case 1 @pseudocode: "Immunization recommendation status" = "Contraindicated" (where "Type of hepatitis A dose" = "Live attenuated hepatitis A vaccine") */ define "Live attentuated Hepatitis A-containing vaccine is contraindicated Case 1": Encounter."The client is currently pregnant" /* @output: Live attentuated Hepatitis A-containing vaccine is contraindicated Case 2 @pseudocode: "Immunization recommendation status" = "Contraindicated" (where "Type of hepatitis A dose" = "Live attenuated hepatitis A vaccine") */ define "Live attentuated Hepatitis A-containing vaccine is contraindicated Case 2": Encounter."The client is severely immunocompromised" /* @output: Live attentuated Hepatitis A-containing vaccine is contraindicated @pseudocode: "Immunization recommendation status" = "Contraindicated" (where "Type of hepatitis A dose" = "Live attenuated hepatitis A vaccine") */ define "Live attentuated Hepatitis A-containing vaccine is contraindicated": "Live attentuated Hepatitis A-containing vaccine is contraindicated Case 1" or "Live attentuated Hepatitis A-containing vaccine is contraindicated Case 2" /* @output: Live attentuated Hepatitis A-containing vaccine is contraindicated Guidance @guidance = Do not vaccinate client with hepatitis A as hepatitis A vaccination is contraindicated for pregnant client and may pose a theoretical risk to the developing fetus. @guidance = Do not vaccinate client with hepatitis A as hepatitis A vaccination is contraindicated for severely immunocompromised clients. */ define "Live attentuated Hepatitis A-containing vaccine is contraindicated Guidance": case when "Live attentuated Hepatitis A-containing vaccine is contraindicated Case 1" then 'Do not vaccinate client with hepatitis A as hepatitis A vaccination is contraindicated for pregnant client and may pose a theoretical risk to the developing fetus.' when "Live attentuated Hepatitis A-containing vaccine is contraindicated Case 2" then 'Do not vaccinate client with hepatitis A as hepatitis A vaccination is contraindicated for severely immunocompromised clients.' else '' end /* @output: Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note @pseudocode: "Immunization recommendation status" = "Further evaluation needed" */ define "Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note": Encounter."The client has a history of severe allergic reactions" /* @output: Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance @guidance: Do not vaccinate client with inactivated hepatitis A vaccination if client has had a severe allergic reaction to the previous dose. Do not vaccinate client with live attenuated hepatitis A vaccination if client has severe allergy to components included in the live attenuated hepatitis A-containing vaccines. */ define "Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance": 'Do not vaccinate client with inactivated hepatitis A vaccination if client has had a severe allergic reaction to the previous dose. Do not vaccinate client with live attenuated hepatitis A vaccination if client has severe allergy to components included in the live attenuated hepatitis A-containing vaccines.' /* @test: Test expected results based on example patients */ define "Test Validation": case when Patient.id = 'HepatitisA39.1' then "Live attentuated Hepatitis A-containing vaccine is contraindicated Case 1" and "Guidance" = 'Do not vaccinate client with hepatitis A as hepatitis A vaccination is contraindicated for pregnant client and may pose a theoretical risk to the developing fetus.' when Patient.id = 'HepatitisA40.1' then "Live attentuated Hepatitis A-containing vaccine is contraindicated Case 2" and "Guidance" = 'Do not vaccinate client with hepatitis A as hepatitis A vaccination is contraindicated for severely immunocompromised clients.' when Patient.id = 'HepatitisA41.1' then "Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note" and "Guidance" = 'Do not vaccinate client with inactivated hepatitis A vaccination if client has had a severe allergic reaction to the previous dose. Do not vaccinate client with live attenuated hepatitis A vaccination if client has severe allergy to components included in the live attenuated hepatitis A-containing vaccines.' else 'No test case set' end Content: application/elm+xml Encoded data (48084 characters)
This library defines decision support logic for the IMMZ.D5.DT.Hepatitis A contraindications decision table in the Immunization CPG
Draft Medication Request ID for Hepatitis A dose
Live attentuated Hepatitis A-containing vaccine is contraindicated Case 1
Live attentuated Hepatitis A-containing vaccine is contraindicated Case 2
Live attentuated Hepatitis A-containing vaccine is contraindicated
Live attentuated Hepatitis A-containing vaccine is contraindicated Guidance
Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note
Hepatitis A vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance