<?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="279"><a:s>/*
 * Library: IMMZD5DTHPVContraindicationsLogic (IMMZ.D5.DT.HPV contraindications)
 * Rule: Check for contraindications before administering the vaccine(s) due
 * Decision Table: IMMZ.D5.DT.HPV contraindications
 * Trigger: IMMZ.D5 Determine vaccine(s) to be administered based on contraindications
 */
library IMMZD5DTHPVContraindicationsLogic</a:s></a:s></annotation><identifier id="IMMZD5DTHPVContraindicationsLogic" 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:53" path="http://smart.who.int/immunizations/IMMZD5DTHPVEncounterElements"><annotation xsi:type="a:Annotation"><a:s r="210"><a:s>include </a:s><a:s><a:s>IMMZD5DTHPVEncounterElements</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:63" name="Draft Medication Request ID for HPV dose"><annotation xsi:type="a:Annotation"><a:t name="dynamicValue" value="Draft Medication Request ID for HPV dose"/><a:s r="224"><a:s>/*
  @dynamicValue: Draft Medication Request ID for HPV dose
  */
  define "Draft Medication Request ID for HPV 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 HPV 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:63" path="id" xsi:type="Property"><source localId="229" locator="22:5-22:60" xsi:type="First"><source libraryName="Encounter" localId="226" locator="22:11-22:59" name="Draft Medication Request for HPV dose" xsi:type="ExpressionRef"/></source></expression></def><def accessLevel="Public" context="Patient" localId="238" locator="42:1-43:46" name="Human papillomavirus (HPV) vaccination is contraindicated"><annotation xsi:type="a:Annotation"><a:t name="output" value="Human papillomavirus (HPV) vaccination is contraindicated"/><a:t name="pseudocode" value="&#34;Immunization recommendation status&#34; = &#34;Contraindicated&#34;"/><a:s r="238"><a:s>/*
@output: Human papillomavirus (HPV) vaccination is contraindicated
@pseudocode: "Immunization recommendation status" = "Contraindicated"
*/
define "Human papillomavirus (HPV) vaccination is contraindicated":
  </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 is currently pregnant"</a:s></a:s></a:s></a:s></annotation><expression libraryName="Encounter" localId="240" locator="43:3-43:46" name="The client is currently pregnant" xsi:type="ExpressionRef"/></def><def accessLevel="Public" context="Patient" localId="244" locator="49:1-50:95" name="Human papillomavirus (HPV) vaccination is contraindicated Guidance"><annotation xsi:type="a:Annotation"><a:t name="output" value="Human papillomavirus (HPV) vaccination is contraindicated Guidance"/><a:t name="guidance" value="Do not vaccinate client with HPV as HPV vaccination is contraindicated for pregnant client."/><a:s r="244"><a:s>/*
@output: Human papillomavirus (HPV) vaccination is contraindicated Guidance
@guidance: Do not vaccinate client with HPV as HPV vaccination is contraindicated for pregnant client.
*/
define "Human papillomavirus (HPV) vaccination is contraindicated Guidance":
  </a:s><a:s r="245"><a:s>'Do not vaccinate client with HPV as HPV vaccination is contraindicated for pregnant client.'</a:s></a:s></a:s></annotation><expression localId="245" locator="50:3-50:95" value="Do not vaccinate client with HPV as HPV vaccination is contraindicated for pregnant client." valueType="t:String" xsi:type="Literal"/></def><def accessLevel="Public" context="Patient" localId="251" locator="56:1-57:65" name="HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note"><annotation xsi:type="a:Annotation"><a:t name="output" value="HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note"/><a:t name="pseudocode" value="&#34;Immunization recommendation status&#34; = &#34;Further evaluation needed&#34;"/><a:s r="251"><a:s>/*
@output: HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note
@pseudocode: "Immunization recommendation status" = "Further evaluation needed"
*/
define "HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note":
  </a:s><a:s r="253"><a:s r="252"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="253"><a:s>"The client has history of severe allergic reactions"</a:s></a:s></a:s></a:s></annotation><expression libraryName="Encounter" localId="253" locator="57:3-57:65" name="The client has history of severe allergic reactions" xsi:type="ExpressionRef"/></def><def accessLevel="Public" context="Patient" localId="257" locator="63:1-64:157" name="HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance"><annotation xsi:type="a:Annotation"><a:t name="output" value="HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance"/><a:t name="guidance" value="Do not vaccinate client with HPV if client has history of a severe allergic reaction after a previous HPV vaccine dose, or to a component of the vaccine."/><a:s r="257"><a:s>/*
@output: HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance
@guidance: Do not vaccinate client with HPV if client has history of a severe allergic reaction after a previous HPV vaccine dose, or to a component of the vaccine.
*/
define "HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance":
  </a:s><a:s r="258"><a:s>'Do not vaccinate client with HPV if client has history of a severe allergic reaction after a previous HPV vaccine dose, or to a component of the vaccine.'</a:s></a:s></a:s></annotation><expression localId="258" locator="64:3-64:157" value="Do not vaccinate client with HPV if client has history of a severe allergic reaction after a previous HPV vaccine dose, or to a component of the vaccine." valueType="t:String" xsi:type="Literal"/></def><def accessLevel="Public" context="Patient" localId="233" locator="28:1-33: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>"Human papillomavirus (HPV) vaccination is contraindicated"</a:s></a:s><a:s> then </a:s><a:s r="247"><a:s>"Human papillomavirus (HPV) vaccination is contraindicated Guidance"</a:s></a:s></a:s><a:s>
    </a:s><a:s r="248"><a:s>when </a:s><a:s r="254"><a:s>"HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note"</a:s></a:s><a:s> then </a:s><a:s r="260"><a:s>"HPV 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="261"><a:s>''</a:s></a:s><a:s>
  end</a:s></a:s></a:s></annotation><expression localId="234" locator="29:3-33:5" xsi:type="Case"><caseItem localId="235" locator="30:5-30:142"><when localId="241" locator="30:10-30:68" name="Human papillomavirus (HPV) vaccination is contraindicated" xsi:type="ExpressionRef"/><then localId="247" locator="30:75-30:142" name="Human papillomavirus (HPV) vaccination is contraindicated Guidance" xsi:type="ExpressionRef"/></caseItem><caseItem localId="248" locator="31:5-31:220"><when localId="254" locator="31:10-31:107" name="HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note" xsi:type="ExpressionRef"/><then localId="260" locator="31:114-31:220" name="HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note Guidance" xsi:type="ExpressionRef"/></caseItem><else localId="261" locator="32:10-32:11" value="" valueType="t:String" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="265" locator="35:1-36:45" name="Has Guidance"><annotation xsi:type="a:Annotation"><a:s r="265"><a:s>define "Has Guidance":
  </a:s><a:s r="266"><a:s r="269"><a:s r="267"><a:s>"Guidance"</a:s></a:s><a:s> is not null</a:s></a:s><a:s> and </a:s><a:s r="276"><a:s r="271"><a:s>"Guidance"</a:s></a:s><a:s> != </a:s><a:s r="272"><a:s>''</a:s></a:s></a:s></a:s></a:s></annotation><expression localId="266" locator="36:3-36:45" xsi:type="And"><operand localId="269" locator="36:3-36:24" xsi:type="Not"><operand localId="268" locator="36:3-36:24" xsi:type="IsNull"><operand localId="267" locator="36:3-36:12" name="Guidance" xsi:type="ExpressionRef"/></operand></operand><operand localId="276" locator="36:30-36:45" xsi:type="Not"><operand localId="270" locator="36:30-36:45" xsi:type="Equal"><signature localId="274" name="t:String" xsi:type="NamedTypeSpecifier"/><signature localId="275" name="t:String" xsi:type="NamedTypeSpecifier"/><operand localId="271" locator="36:30-36:39" name="Guidance" xsi:type="ExpressionRef"/><operand localId="272" locator="36:44-36:45" value="" valueType="t:String" xsi:type="Literal"/></operand></operand></expression></def><def accessLevel="Public" context="Patient" localId="279" locator="70:1-75:5" name="Test Validation"><annotation xsi:type="a:Annotation"><a:t name="test" value="Test expected results based on example patients"/><a:s r="279"><a:s>/*
@test: Test expected results based on example patients
*/
define "Test Validation":
  </a:s><a:s r="280"><a:s>case
    </a:s><a:s r="281"><a:s>when </a:s><a:s r="282"><a:s r="284"><a:s r="283"><a:s>Patient</a:s></a:s><a:s>.</a:s><a:s r="284"><a:s>id</a:s></a:s></a:s><a:s> = </a:s><a:s r="285"><a:s>'HPV45.1'</a:s></a:s></a:s><a:s> then </a:s><a:s r="291"><a:s r="292"><a:s>"Human papillomavirus (HPV) vaccination is contraindicated"</a:s></a:s><a:s> and </a:s><a:s r="293"><a:s r="294"><a:s>"Guidance"</a:s></a:s><a:s> = </a:s><a:s r="295"><a:s>'Do not vaccinate client with HPV as HPV vaccination is contraindicated for pregnant client.'</a:s></a:s></a:s></a:s></a:s><a:s>
    </a:s><a:s r="299"><a:s>when </a:s><a:s r="300"><a:s r="302"><a:s r="301"><a:s>Patient</a:s></a:s><a:s>.</a:s><a:s r="302"><a:s>id</a:s></a:s></a:s><a:s> = </a:s><a:s r="303"><a:s>'HPV46.1'</a:s></a:s></a:s><a:s> then </a:s><a:s r="309"><a:s r="310"><a:s>"HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note"</a:s></a:s><a:s> and </a:s><a:s r="311"><a:s r="312"><a:s>"Guidance"</a:s></a:s><a:s> = </a:s><a:s r="313"><a:s>'Do not vaccinate client with HPV if client has history of a severe allergic reaction after a previous HPV vaccine dose, or to a component of the vaccine.'</a:s></a:s></a:s></a:s></a:s><a:s>
    else </a:s><a:s r="317"><a:s>'No test case set'</a:s></a:s><a:s>
  end</a:s></a:s></a:s></annotation><expression localId="280" locator="71:3-75:5" xsi:type="Case"><caseItem localId="281" locator="72:5-72:207"><when localId="282" locator="72:10-72:31" xsi:type="Equal"><signature localId="289" name="t:String" xsi:type="NamedTypeSpecifier"/><signature localId="290" name="t:String" xsi:type="NamedTypeSpecifier"/><operand libraryName="FHIRHelpers" localId="287" name="ToString" xsi:type="FunctionRef"><signature localId="288" name="fhir:string" xsi:type="NamedTypeSpecifier"/><operand localId="284" locator="72:10-72:19" path="id" xsi:type="Property"><source localId="283" locator="72:10-72:16" name="Patient" xsi:type="ExpressionRef"/></operand></operand><operand localId="285" locator="72:23-72:31" value="HPV45.1" valueType="t:String" xsi:type="Literal"/></when><then localId="319" xsi:type="As"><operand localId="291" locator="72:38-72:207" xsi:type="And"><operand localId="292" locator="72:38-72:96" name="Human papillomavirus (HPV) vaccination is contraindicated" xsi:type="ExpressionRef"/><operand localId="293" locator="72:102-72:207" xsi:type="Equal"><signature localId="297" name="t:String" xsi:type="NamedTypeSpecifier"/><signature localId="298" name="t:String" xsi:type="NamedTypeSpecifier"/><operand localId="294" locator="72:102-72:111" name="Guidance" xsi:type="ExpressionRef"/><operand localId="295" locator="72:115-72:207" value="Do not vaccinate client with HPV as HPV vaccination is contraindicated for pregnant client." valueType="t:String" xsi:type="Literal"/></operand></operand><asTypeSpecifier localId="320" xsi:type="ChoiceTypeSpecifier"><choice localId="321" name="t:Boolean" xsi:type="NamedTypeSpecifier"/><choice localId="322" name="t:String" xsi:type="NamedTypeSpecifier"/></asTypeSpecifier></then></caseItem><caseItem localId="299" locator="73:5-73:308"><when localId="300" locator="73:10-73:31" xsi:type="Equal"><signature localId="307" name="t:String" xsi:type="NamedTypeSpecifier"/><signature localId="308" name="t:String" xsi:type="NamedTypeSpecifier"/><operand libraryName="FHIRHelpers" localId="305" name="ToString" xsi:type="FunctionRef"><signature localId="306" name="fhir:string" xsi:type="NamedTypeSpecifier"/><operand localId="302" locator="73:10-73:19" path="id" xsi:type="Property"><source localId="301" locator="73:10-73:16" name="Patient" xsi:type="ExpressionRef"/></operand></operand><operand localId="303" locator="73:23-73:31" value="HPV46.1" valueType="t:String" xsi:type="Literal"/></when><then localId="323" xsi:type="As"><operand localId="309" locator="73:38-73:308" xsi:type="And"><operand localId="310" locator="73:38-73:135" name="HPV vaccination could be contraindicated. Clinical judgement is required. Create a clinical note" xsi:type="ExpressionRef"/><operand localId="311" locator="73:141-73:308" xsi:type="Equal"><signature localId="315" name="t:String" xsi:type="NamedTypeSpecifier"/><signature localId="316" name="t:String" xsi:type="NamedTypeSpecifier"/><operand localId="312" locator="73:141-73:150" name="Guidance" xsi:type="ExpressionRef"/><operand localId="313" locator="73:154-73:308" value="Do not vaccinate client with HPV if client has history of a severe allergic reaction after a previous HPV vaccine dose, or to a component of the vaccine." valueType="t:String" xsi:type="Literal"/></operand></operand><asTypeSpecifier localId="324" xsi:type="ChoiceTypeSpecifier"><choice localId="325" name="t:Boolean" xsi:type="NamedTypeSpecifier"/><choice localId="326" name="t:String" xsi:type="NamedTypeSpecifier"/></asTypeSpecifier></then></caseItem><else localId="327" xsi:type="As"><operand localId="317" locator="74:10-74:27" value="No test case set" valueType="t:String" xsi:type="Literal"/><asTypeSpecifier localId="328" xsi:type="ChoiceTypeSpecifier"><choice localId="329" name="t:Boolean" xsi:type="NamedTypeSpecifier"/><choice localId="330" name="t:String" xsi:type="NamedTypeSpecifier"/></asTypeSpecifier></else></expression></def></statements></library>