Related Artifacts depends-on FHIR model information http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1 depends-on Library FHIRHelpers http://smart.who.int/ig/smart-immunizations/Library/FHIRHelpers|4.0.1 depends-on Library IMMZCom IMMZCommon depends-on Library IMMZc IMMZConcepts depends-on Library IMMZCon IMMZConfig depends-on Library IMMZvl IMMZVaccineLibrary depends-on Library FC FHIRCommon depends-on Library input IMMZD2DTMeaslesInput depends-on Library Wcon WHOConcepts depends-on Code system IMMZ.D IMMZ.D CodeSystem for Data Elements depends-on Value set MCV Vaccine IMMZ.Z.DE9 ValueSet for Measles Vaccines depends-on Value set Pregnancy Status Pregnant Pregnancy status values Parameters Patient out 0 1 Patient Draft Medication Request for MCV dose out 0 * MedicationRequest Draft Medication Request ID for MCV dose out 0 1 id Measles vaccination contraindicated Case 1 out 0 1 boolean Measles vaccination contraindicated Case 2 out 0 1 boolean Measles vaccination contraindicated out 0 1 boolean Measles vaccination contraindicated Guidance out 0 1 string Clinical judgement required Case 1 out 0 1 boolean Clinical judgement required Case 2 out 0 1 boolean Clinical judgement required Case 3 out 0 1 boolean Clinical judgement required out 0 1 boolean Clinical judgement required Guidance out 0 1 string Guidance out 0 1 string Data Requirements Type: Patient (Patient) Type: MedicationRequest (MedicationRequest) Filter Value medication In ValueSet IMMZ.Z.DE9 ValueSet for Measles Vaccines Type: Observation (Observation) Type: Condition (Condition) Type: Condition (Condition) Filter Value code One of these codes: IMMZ.D CodeSystem for Data Elements DE165: Severely immunosuppressed Type: Condition (Condition) Filter Value code One of these codes: IMMZ.D CodeSystem for Data Elements DE166: History of anaphylactic reactions Type: Condition (Condition) Filter Value code One of these codes: IMMZ.D CodeSystem for Data Elements DE167: Severe allergic reactions Type: Condition (Condition) Filter Value code One of these codes: IMMZ.D CodeSystem for Data Elements DE168: Symptomatic HIV infection Contents text/cql /* * Library: IMMZD5DTMeasles (IMMZ.D5.DT.Measles contraindications) * Rule: Check for contraindications before administering the vaccine(s) due * Trigger: IMMZ.D5 Determine vaccine(s) to be administered based on contraindications */ library IMMZD5DTMeasles // Start Skeleton CQL using FHIR version '4.0.1' include FHIRHelpers version '4.0.1' include IMMZCommon called IMMZCom include IMMZConcepts called IMMZc include IMMZConfig called IMMZCon include IMMZVaccineLibrary called IMMZvl include FHIRCommon called FC include IMMZD2DTMeaslesInput called input // End Skeleton CQL context Patient /* @internal: Draft Medication Request for MCV dose */ define "Draft Medication Request for MCV dose": [MedicationRequest: IMMZc."MCV Vaccine"] MR where MR.status = 'draft' and MR.intent = 'proposal' sort by date from (authoredOn as FHIR.dateTime) desc /* @dynamicValue: Draft Medication Request ID for MCV dose */ define "Draft Medication Request ID for MCV dose": First("Draft Medication Request for MCV dose").id /* @dynamicValue: Guidance */ define "Guidance": Combine( { if "Measles vaccination contraindicated" then "Measles vaccination contraindicated Guidance" else '', if "Clinical judgement required" then "Clinical judgement required Guidance" else '' }, ' ' ) /* @output: Measles vaccination contraindicated Case 1 @pseudocode: "Immunization recommendation status" = 'Contraindicated' */ define "Measles vaccination contraindicated Case 1": input."The client is pregnant" /* @output: Measles vaccination contraindicated Case 2 @pseudocode: "Immunization recommendation status" = 'Contraindicated' */ define "Measles vaccination contraindicated Case 2": input."The client is severely immunosuppressed" /* @output: Measles vaccination contraindicated @pseudocode: "Immunization recommendation status" = 'Contraindicated' */ define "Measles vaccination contraindicated": "Measles vaccination contraindicated Case 1" or "Measles vaccination contraindicated Case 2" /* @output: Measles vaccination contraindicated Guidance @guidance: Do not vaccinate due to a contraindication: client is pregnant. @guidance: Do not vaccinate due to a contraindication: client is severely immunosuppressed. */ define "Measles vaccination contraindicated Guidance": Combine( { if "Measles vaccination contraindicated Case 1" then 'Do not vaccinate due to a contraindication: client is pregnant.' else '', if "Measles vaccination contraindicated Case 2" then 'Do not vaccinate due to a contraindication: client is severely immunosuppressed.' else '' }, ' ' ) /* @output: Clinical judgement required Case 1 @pseudocode: Immunization recommendation status = 'Further evaluation needed'" */ define "Clinical judgement required Case 1": input."The client has history of anaphylactic reactions" /* @output: Clinical judgement required Case 2 @pseudocode: Immunization recommendation status = 'Further evaluation needed'" */ define "Clinical judgement required Case 2": input."The client has history of severe allergic reactions" /* @output: Clinical judgement required Case 3 @pseudocode: Immunization recommendation status = 'Further evaluation needed'" */ define "Clinical judgement required Case 3": input."The client has a symptomatic HIV infection" /* @output: Clinical judgement required @pseudocode: Immunization recommendation status = 'Further evaluation needed'" */ define "Clinical judgement required": "Clinical judgement required Case 1" or "Clinical judgement required Case 2" or "Clinical judgement required Case 3" /* @output: Clinical judgement required Guidance @guidance: Check if previous anaphylactic reaction refers to components of the vaccine (e.g. neomycin or gelatin) @guidance: Check if previous severe reaction refers to components of the vaccine (e.g. neomycin or gelatin) @guidance: Vaccination may be considered if the client is not severely immunosuppressed */ define "Clinical judgement required Guidance": Combine( { if "Clinical judgement required Case 1" then 'Check if previous anaphylactic reaction refers to components of the vaccine (e.g. neomycin or gelatin)' else '', if "Clinical judgement required Case 2" then 'Check if previous severe reaction refers to components of the vaccine (e.g. neomycin or gelatin)' else '', if "Clinical judgement required Case 3" then 'Vaccination may be considered if the client is not severely immunosuppressed' else '' }, ' ' ) Content not shown - (application/elm+xml, size = 33Kb) Content not shown - (application/elm+json, size = 57Kb)
Draft Medication Request ID for MCV dose
Measles vaccination contraindicated Case 1
Measles vaccination contraindicated Case 2
Measles vaccination contraindicated Guidance