/*
* Library: IMMZD5DTHibContraindicationsLogic (IMMZ.D5.DT.Hib contraindications)
* Rule: Check for contraindications before administering the vaccine(s) due
* Decision Table: IMMZ.D5.DT.Hib contraindications
* Trigger: IMMZ.D5 Determine vaccine(s) to be administered based on contraindications (9)
*/
library IMMZD5DTHibContraindicationsLogic
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'
include IMMZD5DTHibEncounterElements called Encounter
parameter Today Date default Today()
context Patient
/*
@dynamicValue: Draft Medication Request ID for Hib dose
*/
define "Draft Medication Request ID for Hib dose":
First(Encounter."Draft Medication Request for Hib dose").id
/*
@dynamicValue: Guidance
*/
define "Guidance":
case
when "Hib vaccination could be contraindicated. Clinical judgement is required. Create a clinical note." then "Hib 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: Hib vaccination could be contraindicated. Clinical judgement is required. Create a clinical note.
@pseudocode: "Immunization recommendation status" = "Further evaluation needed"
*/
define "Hib vaccination could be contraindicated. Clinical judgement is required. Create a clinical note.":
Encounter."The client has a history of severe allergic reactions"
/*
@output: Hib vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance
@guidance: Do not vaccinate client with Hib conjugate vaccine if client has had allergic reaction or known allergies to any component of the vaccine.
*/
define "Hib vaccination could be contraindicated. Clinical judgement is required. Create a clinical note. Guidance":
'Do not vaccinate client with Hib conjugate vaccine if client has had allergic reaction or known allergies to any component of the vaccine.'
/*
@test: Test expected results based on example patients
*/
define "Test Validation":
case
when Patient.id = 'Hib56.1' then "Hib vaccination could be contraindicated. Clinical judgement is required. Create a clinical note." and "Guidance" = 'Do not vaccinate client with Hib conjugate vaccine if client has had allergic reaction or known allergies to any component of the vaccine.'
else 'No test case set'
end