<?xml version="1.0" encoding="UTF-8"?><library xmlns="urn:hl7-org:elm:r1" xmlns:a="urn:hl7-org:cql-annotations:r1" xmlns:fhir="http://hl7.org/fhir" xmlns:t="urn:hl7-org:elm-types:r1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" localId="0"><annotation signatureLevel="Overloads" translatorOptions="EnableAnnotations,EnableLocators,DisableListDemotion,DisableListPromotion" translatorVersion="4.9.0" xsi:type="a:CqlToElmInfo"/><annotation errorSeverity="warning" errorType="semantic" message="An operand identifier reference is hiding another identifier of the same name." xsi:type="a:CqlToElmError"/><annotation errorSeverity="warning" errorType="semantic" message="An operand identifier reference is hiding another identifier of the same name." xsi:type="a:CqlToElmError"/><annotation errorSeverity="warning" errorType="semantic" message="An operand identifier reference is hiding another identifier of the same name." xsi:type="a:CqlToElmError"/><annotation xsi:type="a:Annotation"><a:s r="266"><a:s>/*
 * Library: IMMZD5DTMeningococcalContraindicationsLogic (IMMZ.D5.DT.Meningococcal contraindications)
 * Rule: Check for contraindications before administering the vaccine(s) due
 * Decision Table: IMMZ.D5.DT.Meningococcal contraindications
 * Trigger: IMMZ.D5 Determine vaccine(s) to be administered based on contraindications
 */
library IMMZD5DTMeningococcalContraindicationsLogic</a:s></a:s></annotation><identifier id="IMMZD5DTMeningococcalContraindicationsLogic" system="http://smart.who.int/immunizations"/><schemaIdentifier id="urn:hl7-org:elm" version="r1"/><usings><def localId="1" localIdentifier="System" uri="urn:hl7-org:elm-types:r1" version="1.0.0"/><def localId="206" localIdentifier="FHIR" locator="9:1-9:26" uri="http://hl7.org/fhir" version="4.0.1"><annotation xsi:type="a:Annotation"><a:s r="206"><a:s>using </a:s><a:s><a:s>FHIR</a:s></a:s><a:s> version '4.0.1'</a:s></a:s></annotation></def></usings><includes><def localId="208" localIdentifier="FHIRHelpers" locator="10:1-10:35" path="http://hl7.org/fhir/FHIRHelpers" version="4.0.1"><annotation xsi:type="a:Annotation"><a:s r="208"><a:s>include </a:s><a:s><a:s>FHIRHelpers</a:s></a:s><a:s> version '4.0.1'</a:s></a:s></annotation></def><def localId="210" localIdentifier="Encounter" locator="12:1-12:63" path="http://smart.who.int/immunizations/IMMZD5DTMeningococcalEncounterElements"><annotation xsi:type="a:Annotation"><a:s r="210"><a:s>include </a:s><a:s><a:s>IMMZD5DTMeningococcalEncounterElements</a:s></a:s><a:s> called Encounter</a:s></a:s></annotation></def></includes><parameters><def accessLevel="Public" localId="212" locator="14:1-14:36" name="Today"><annotation xsi:type="a:Annotation"><a:s r="212"><a:s>parameter Today </a:s><a:s r="216"><a:s>Date</a:s></a:s><a:s> default </a:s><a:s r="215"><a:s>Today()</a:s></a:s></a:s></annotation><default localId="215" locator="14:30-14:36" xsi:type="Today"/><parameterTypeSpecifier localId="216" locator="14:17-14:20" name="t:Date" xsi:type="NamedTypeSpecifier"/></def></parameters><contexts><def localId="221" locator="16:1-16:15" name="Patient"/></contexts><statements><def context="Patient" localId="219" locator="16:1-16:15" name="Patient"><expression localId="220" xsi:type="SingletonFrom"><operand dataType="fhir:Patient" localId="218" locator="16:1-16:15" templateId="http://hl7.org/fhir/StructureDefinition/Patient" xsi:type="Retrieve"/></expression></def><def accessLevel="Public" context="Patient" localId="224" locator="21:3-22:73" name="Draft Medication Request ID for Meningococcal dose"><annotation xsi:type="a:Annotation"><a:t name="dynamicValue" value="Draft Medication Request ID for Meningococcal dose"/><a:s r="224"><a:s>/*
  @dynamicValue: Draft Medication Request ID for Meningococcal dose
  */
  define "Draft Medication Request ID for Meningococcal dose":
    </a:s><a:s r="230"><a:s r="229"><a:s>First(</a:s><a:s r="226"><a:s r="225"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="226"><a:s>"Draft Medication Request for Meningococcal dose"</a:s></a:s></a:s><a:s>)</a:s></a:s><a:s>.</a:s><a:s r="230"><a:s>id</a:s></a:s></a:s></a:s></annotation><expression localId="230" locator="22:5-22:73" path="id" xsi:type="Property"><source localId="229" locator="22:5-22:70" xsi:type="First"><source libraryName="Encounter" localId="226" locator="22:11-22:69" name="Draft Medication Request for Meningococcal dose" xsi:type="ExpressionRef"/></source></expression></def><def accessLevel="Public" context="Patient" localId="238" locator="41:1-42:65" name="Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note"><annotation xsi:type="a:Annotation"><a:t name="output" value="Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note"/><a:t name="pseudocode" value="&#34;Immunization recommendation status&#34; (where &#34;Type of meningococcal dose&#34; = &#34;Polysaccharide vaccine&#34;) = &#34;Further evaluation needed&#34;"/><a:s r="238"><a:s>/*
@output: Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note
@pseudocode: "Immunization recommendation status" (where "Type of meningococcal dose" = "Polysaccharide vaccine") = "Further evaluation needed"
*/
define "Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note":
  </a:s><a:s r="240"><a:s r="239"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="240"><a:s>"The client has history of severe allergic reactions"</a:s></a:s></a:s></a:s></annotation><expression libraryName="Encounter" localId="240" locator="42:3-42:65" name="The client has history of severe allergic reactions" xsi:type="ExpressionRef"/></def><def accessLevel="Public" context="Patient" localId="244" locator="48:1-49:143" name="Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance"><annotation xsi:type="a:Annotation"><a:t name="output" value="Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance"/><a:t name="guidance" value="Do not vaccinate client with meningococcal if client has history of severe allergic reaction to any component of the meningococcal vaccine."/><a:s r="244"><a:s>/*
@output: Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance
@guidance: Do not vaccinate client with meningococcal if client has history of severe allergic reaction to any component of the meningococcal vaccine.
*/
define "Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance":
  </a:s><a:s r="245"><a:s>'Do not vaccinate client with meningococcal if client has history of severe allergic reaction to any component of the meningococcal vaccine.'</a:s></a:s></a:s></annotation><expression localId="245" locator="49:3-49:143" value="Do not vaccinate client with meningococcal if client has history of severe allergic reaction to any component of the meningococcal vaccine." valueType="t:String" xsi:type="Literal"/></def><def accessLevel="Public" context="Patient" localId="233" locator="28:1-32:5" name="Guidance"><annotation xsi:type="a:Annotation"><a:t name="dynamicValue" value="Guidance"/><a:s r="233"><a:s>/*
@dynamicValue: Guidance
*/
define "Guidance":
  </a:s><a:s r="234"><a:s>case 
    </a:s><a:s r="235"><a:s>when </a:s><a:s r="241"><a:s>"Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note"</a:s></a:s><a:s> then </a:s><a:s r="247"><a:s>"Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance"</a:s></a:s></a:s><a:s> 
    else </a:s><a:s r="248"><a:s>''</a:s></a:s><a:s>
  end</a:s></a:s></a:s></annotation><expression localId="234" locator="29:3-32:5" xsi:type="Case"><caseItem localId="235" locator="30:5-30:240"><when localId="241" locator="30:10-30:117" name="Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note" xsi:type="ExpressionRef"/><then localId="247" locator="30:124-30:240" name="Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance" xsi:type="ExpressionRef"/></caseItem><else localId="248" locator="31:10-31:11" value="" valueType="t:String" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="252" locator="34:1-35:45" name="Has Guidance"><annotation xsi:type="a:Annotation"><a:s r="252"><a:s>define "Has Guidance":
  </a:s><a:s r="253"><a:s r="256"><a:s r="254"><a:s>"Guidance"</a:s></a:s><a:s> is not null</a:s></a:s><a:s> and </a:s><a:s r="263"><a:s r="258"><a:s>"Guidance"</a:s></a:s><a:s> != </a:s><a:s r="259"><a:s>''</a:s></a:s></a:s></a:s></a:s></annotation><expression localId="253" locator="35:3-35:45" xsi:type="And"><operand localId="256" locator="35:3-35:24" xsi:type="Not"><operand localId="255" locator="35:3-35:24" xsi:type="IsNull"><operand localId="254" locator="35:3-35:12" name="Guidance" xsi:type="ExpressionRef"/></operand></operand><operand localId="263" locator="35:30-35:45" xsi:type="Not"><operand localId="257" locator="35:30-35:45" xsi:type="Equal"><signature localId="261" name="t:String" xsi:type="NamedTypeSpecifier"/><signature localId="262" name="t:String" xsi:type="NamedTypeSpecifier"/><operand localId="258" locator="35:30-35:39" name="Guidance" xsi:type="ExpressionRef"/><operand localId="259" locator="35:44-35:45" value="" valueType="t:String" xsi:type="Literal"/></operand></operand></expression></def><def accessLevel="Public" context="Patient" localId="266" locator="55:1-59:5" name="Test Validation"><annotation xsi:type="a:Annotation"><a:t name="test" value="Test expected results based on example patients"/><a:s r="266"><a:s>/*
@test: Test expected results based on example patients
*/
define "Test Validation":
  </a:s><a:s r="267"><a:s>case
    </a:s><a:s r="268"><a:s>when </a:s><a:s r="269"><a:s r="271"><a:s r="270"><a:s>Patient</a:s></a:s><a:s>.</a:s><a:s r="271"><a:s>id</a:s></a:s></a:s><a:s> = </a:s><a:s r="272"><a:s>'Meningococcal78.1'</a:s></a:s></a:s><a:s> then </a:s><a:s r="278"><a:s r="279"><a:s>"Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note"</a:s></a:s><a:s> and </a:s><a:s r="280"><a:s r="281"><a:s>"Guidance"</a:s></a:s><a:s> = </a:s><a:s r="282"><a:s>'Do not vaccinate client with meningococcal if client has history of severe allergic reaction to any component of the meningococcal vaccine.'</a:s></a:s></a:s></a:s></a:s><a:s>
    else </a:s><a:s r="286"><a:s>'No test case set'</a:s></a:s><a:s>
  end</a:s></a:s></a:s></annotation><expression localId="267" locator="56:3-59:5" xsi:type="Case"><caseItem localId="268" locator="57:5-57:314"><when localId="269" locator="57:10-57:41" xsi:type="Equal"><signature localId="276" name="t:String" xsi:type="NamedTypeSpecifier"/><signature localId="277" name="t:String" xsi:type="NamedTypeSpecifier"/><operand libraryName="FHIRHelpers" localId="274" name="ToString" xsi:type="FunctionRef"><signature localId="275" name="fhir:string" xsi:type="NamedTypeSpecifier"/><operand localId="271" locator="57:10-57:19" path="id" xsi:type="Property"><source localId="270" locator="57:10-57:16" name="Patient" xsi:type="ExpressionRef"/></operand></operand><operand localId="272" locator="57:23-57:41" value="Meningococcal78.1" valueType="t:String" xsi:type="Literal"/></when><then localId="288" xsi:type="As"><operand localId="278" locator="57:48-57:314" xsi:type="And"><operand localId="279" locator="57:48-57:155" name="Meningococcal vaccination could be contraindicated. Clinical judgement is required. Create a clinical note" xsi:type="ExpressionRef"/><operand localId="280" locator="57:161-57:314" xsi:type="Equal"><signature localId="284" name="t:String" xsi:type="NamedTypeSpecifier"/><signature localId="285" name="t:String" xsi:type="NamedTypeSpecifier"/><operand localId="281" locator="57:161-57:170" name="Guidance" xsi:type="ExpressionRef"/><operand localId="282" locator="57:174-57:314" value="Do not vaccinate client with meningococcal if client has history of severe allergic reaction to any component of the meningococcal vaccine." valueType="t:String" xsi:type="Literal"/></operand></operand><asTypeSpecifier localId="289" xsi:type="ChoiceTypeSpecifier"><choice localId="290" name="t:Boolean" xsi:type="NamedTypeSpecifier"/><choice localId="291" name="t:String" xsi:type="NamedTypeSpecifier"/></asTypeSpecifier></then></caseItem><else localId="292" xsi:type="As"><operand localId="286" locator="58:10-58:27" value="No test case set" valueType="t:String" xsi:type="Literal"/><asTypeSpecifier localId="293" xsi:type="ChoiceTypeSpecifier"><choice localId="294" name="t:Boolean" xsi:type="NamedTypeSpecifier"/><choice localId="295" name="t:String" xsi:type="NamedTypeSpecifier"/></asTypeSpecifier></else></expression></def></statements></library>