<?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="338"><a:s>/*
  * Library: IMMZD2DTTyphoidEncounterElements
  */
library IMMZD2DTTyphoidEncounterElements</a:s></a:s></annotation><identifier id="IMMZD2DTTyphoidEncounterElements" 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="7:1-7: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="8:1-8: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="WHOConcepts" locator="10:1-10:19" path="http://smart.who.int/immunizations/WHOConcepts"><annotation xsi:type="a:Annotation"><a:s r="210"><a:s>include </a:s><a:s><a:s>WHOConcepts</a:s></a:s></a:s></annotation></def><def localId="212" localIdentifier="WC" locator="11:1-11:27" path="http://smart.who.int/immunizations/WHOCommon"><annotation xsi:type="a:Annotation"><a:s r="212"><a:s>include </a:s><a:s><a:s>WHOCommon</a:s></a:s><a:s> called WC</a:s></a:s></annotation></def><def localId="214" localIdentifier="WE" locator="12:1-12:29" path="http://smart.who.int/immunizations/WHOElements"><annotation xsi:type="a:Annotation"><a:s r="214"><a:s>include </a:s><a:s><a:s>WHOElements</a:s></a:s><a:s> called WE</a:s></a:s></annotation></def><def localId="216" localIdentifier="Common" locator="14:1-14:32" path="http://smart.who.int/immunizations/IMMZCommon"><annotation xsi:type="a:Annotation"><a:s r="216"><a:s>include </a:s><a:s><a:s>IMMZCommon</a:s></a:s><a:s> called Common</a:s></a:s></annotation></def><def localId="218" localIdentifier="Concepts" locator="15:1-15:36" path="http://smart.who.int/immunizations/IMMZConcepts"><annotation xsi:type="a:Annotation"><a:s r="218"><a:s>include </a:s><a:s><a:s>IMMZConcepts</a:s></a:s><a:s> called Concepts</a:s></a:s></annotation></def><def localId="220" localIdentifier="Encounter" locator="16:1-16:46" path="http://smart.who.int/immunizations/IMMZEncounterElements"><annotation xsi:type="a:Annotation"><a:s r="220"><a:s>include </a:s><a:s><a:s>IMMZEncounterElements</a:s></a:s><a:s> called Encounter</a:s></a:s></annotation></def><def localId="222" localIdentifier="TyphoidElements" locator="18:1-18:54" path="http://smart.who.int/immunizations/IMMZD2DTTyphoidElements"><annotation xsi:type="a:Annotation"><a:s r="222"><a:s>include </a:s><a:s><a:s>IMMZD2DTTyphoidElements</a:s></a:s><a:s> called TyphoidElements</a:s></a:s></annotation></def></includes><parameters><def accessLevel="Public" localId="224" locator="20:1-20:36" name="Today"><annotation xsi:type="a:Annotation"><a:s r="224"><a:s>parameter Today </a:s><a:s r="228"><a:s>Date</a:s></a:s><a:s> default </a:s><a:s r="227"><a:s>Today()</a:s></a:s></a:s></annotation><default localId="227" locator="20:30-20:36" xsi:type="Today"/><parameterTypeSpecifier localId="228" locator="20:17-20:20" name="t:Date" xsi:type="NamedTypeSpecifier"/></def><def accessLevel="Public" localId="230" locator="21:1-21:28" name="EncounterId"><annotation xsi:type="a:Annotation"><a:s r="230"><a:s>parameter EncounterId </a:s><a:s r="231"><a:s>String</a:s></a:s></a:s></annotation><parameterTypeSpecifier localId="231" locator="21:23-21:28" name="t:String" xsi:type="NamedTypeSpecifier"/></def></parameters><contexts><def localId="236" locator="23:1-23:15" name="Patient"/></contexts><statements><def context="Patient" localId="234" locator="23:1-23:15" name="Patient"><expression localId="235" xsi:type="SingletonFrom"><operand dataType="fhir:Patient" localId="233" locator="23:1-23:15" templateId="http://hl7.org/fhir/StructureDefinition/Patient" xsi:type="Retrieve"/></expression></def><def accessLevel="Public" context="Patient" localId="239" locator="28:1-31:48" name="Typhoid Doses Administered to Patient"><annotation xsi:type="a:Annotation"><a:t name="internal" value="Typhoid containing Doses Administered to Patient"/><a:s r="239"><a:s>/*
@internal: Typhoid containing Doses Administered to Patient
*/
define "Typhoid Doses Administered to Patient":
  </a:s><a:s r="251"><a:s><a:s r="240"><a:s r="242"><a:s><a:s>Encounter."Doses Administered to Patient"</a:s></a:s></a:s><a:s> I</a:s></a:s></a:s><a:s>
  </a:s><a:s r="248"><a:s>where
    </a:s><a:s r="248"><a:s r="245"><a:s r="244"><a:s>I</a:s></a:s><a:s>.</a:s><a:s r="245"><a:s>vaccineCode</a:s></a:s></a:s><a:s> in </a:s><a:s r="247"><a:s r="246"><a:s>Concepts</a:s></a:s><a:s>.</a:s><a:s r="247"><a:s>"Typhoid vaccines"</a:s></a:s></a:s></a:s></a:s></a:s></a:s></annotation><expression localId="251" locator="29:3-31:48" xsi:type="Query"><source alias="I" localId="240" locator="29:3-29:45"><expression libraryName="Encounter" localId="242" locator="29:3-29:43" name="Doses Administered to Patient" xsi:type="ExpressionRef"/></source><where localId="248" locator="30:3-31:48" xsi:type="InValueSet"><signature localId="250" name="t:Concept" xsi:type="NamedTypeSpecifier"/><code libraryName="FHIRHelpers" localId="249" name="ToConcept" xsi:type="FunctionRef"><operand localId="245" locator="31:5-31:17" path="vaccineCode" scope="I" xsi:type="Property"/></code><valueset libraryName="Concepts" localId="247" locator="31:22-31:48" name="Typhoid vaccines" preserve="true"/></where></expression></def><def accessLevel="Public" context="Patient" localId="254" locator="36:1-37:57" name="Typhoid Primary Series Doses Administered to Patient"><annotation xsi:type="a:Annotation"><a:t name="internal" value="Typhoid containing Doses Administered to Patient that are in the Primary series"/><a:s r="254"><a:s>/*
@internal: Typhoid containing Doses Administered to Patient that are in the Primary series
*/
define "Typhoid Primary Series Doses Administered to Patient":
  </a:s><a:s r="256"><a:s r="255"><a:s>"Typhoid Doses Administered to Patient"</a:s></a:s><a:s>.</a:s><a:s r="256"><a:s>seriesPrimary()</a:s></a:s></a:s></a:s></annotation><expression libraryName="Common" localId="256" locator="37:3-37:57" name="seriesPrimary" xsi:type="FunctionRef"><operand localId="255" locator="37:3-37:41" name="Typhoid Doses Administered to Patient" xsi:type="ExpressionRef"/></expression></def><def accessLevel="Public" context="Patient" localId="259" locator="42:1-43:63" name="Number of Typhoid Primary Series Doses Administered"><annotation xsi:type="a:Annotation"><a:t name="internal" value="Number of Typhoid Primary Series doses"/><a:s r="259"><a:s>/*
@internal: Number of Typhoid Primary Series doses
*/
define "Number of Typhoid Primary Series Doses Administered":
  </a:s><a:s r="263"><a:s>Count(</a:s><a:s r="260"><a:s>"Typhoid Primary Series Doses Administered to Patient"</a:s></a:s><a:s>)</a:s></a:s></a:s></annotation><expression localId="263" locator="43:3-43:63" xsi:type="Count"><source localId="260" locator="43:9-43:62" name="Typhoid Primary Series Doses Administered to Patient" xsi:type="ExpressionRef"/></expression></def><def accessLevel="Public" context="Patient" localId="266" locator="51:1-52:47" name="Client's age is less than 6 months"><annotation xsi:type="a:Annotation"><a:t name="input" value="Client's age is less than 6 months"/><a:t name="pseudocode" value="&#34;Date of birth&#34; &lt; 6 months"/><a:t name="code" value="Client's age is less than 6 months-41"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule"/><a:s r="266"><a:s>/*
@input: Client's age is less than 6 months
@pseudocode: Today's date − "Date of birth" &lt; 6 months
@code: Client's age is less than 6 months-41
@decision: IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule
*/
define "Client's age is less than 6 months":
  </a:s><a:s r="267"><a:s r="269"><a:s r="268"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="269"><a:s>"Current Patient Age In Months"</a:s></a:s></a:s><a:s r="270"> &lt; 6</a:s></a:s></a:s></annotation><expression localId="267" locator="52:3-52:47" xsi:type="Less"><signature localId="271" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="272" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand libraryName="Encounter" localId="269" locator="52:3-52:43" name="Current Patient Age In Months" xsi:type="ExpressionRef"/><operand localId="270" locator="52:47" value="6" valueType="t:Integer" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="275" locator="61:1-62:59" name="No typhoid primary series doses were administered"><annotation xsi:type="a:Annotation"><a:t name="input" value="No typhoid primary series doses were administered"/><a:t name="pseudocode" value="&#34;Vaccine type&#34; = &#34;Typhoid vaccines&#34; and &#34;Type of dose&#34; = &#34;Primary series&#34;) = 0"/><a:t name="code" value="No typhoid primary series doses were administered-116"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule"/><a:s r="275"><a:s>/*
@input: No typhoid primary series doses were administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Typhoid vaccines" and "Type of dose" = "Primary series") = 0
@code: No typhoid primary series doses were administered-116
@decision: IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule
@decision: IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule
*/
define "No typhoid primary series doses were administered":
  </a:s><a:s r="276"><a:s r="277"><a:s>"Number of Typhoid Primary Series Doses Administered"</a:s></a:s><a:s r="278"> = 0</a:s></a:s></a:s></annotation><expression localId="276" locator="62:3-62:59" xsi:type="Equal"><signature localId="279" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="280" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand localId="277" locator="62:3-62:55" name="Number of Typhoid Primary Series Doses Administered" xsi:type="ExpressionRef"/><operand localId="278" locator="62:59" value="0" valueType="t:Integer" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="283" locator="70:1-72:51" name="Client's age is between 6 months and 45 years"><annotation xsi:type="a:Annotation"><a:t name="input" value="Client's age is between 6 months and 45 years"/><a:t name="pseudocode" value="&#34;Date of birth&#34; &lt; 45 years"/><a:t name="code" value="Client's age is between 6 months and 45 years-52"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule"/><a:s r="283"><a:s>/*
@input: Client's age is between 6 months and 45 years
@pseudocode: 6 months ≤ Today's date − "Date of birth" &lt; 45 years
@code: Client's age is between 6 months and 45 years-52
@decision: IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule
*/
define "Client's age is between 6 months and 45 years":
  </a:s><a:s r="284"><a:s r="285"><a:s r="286">6 &lt;= </a:s><a:s r="288"><a:s r="287"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="288"><a:s>"Current Patient Age In Months"</a:s></a:s></a:s></a:s><a:s>
  and </a:s><a:s r="291"><a:s r="293"><a:s r="292"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="293"><a:s>"Current Patient Age In Years"</a:s></a:s></a:s><a:s r="294"> &lt; 45</a:s></a:s></a:s></a:s></annotation><expression localId="284" locator="71:3-72:51" xsi:type="And"><operand localId="285" locator="71:3-71:48" xsi:type="LessOrEqual"><signature localId="289" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="290" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand localId="286" locator="71:3" value="6" valueType="t:Integer" xsi:type="Literal"/><operand libraryName="Encounter" localId="288" locator="71:8-71:48" name="Current Patient Age In Months" xsi:type="ExpressionRef"/></operand><operand localId="291" locator="72:7-72:51" xsi:type="Less"><signature localId="295" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="296" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand libraryName="Encounter" localId="293" locator="72:7-72:46" name="Current Patient Age In Years" xsi:type="ExpressionRef"/><operand localId="294" locator="72:50-72:51" value="45" valueType="t:Integer" xsi:type="Literal"/></operand></expression></def><def accessLevel="Public" context="Patient" localId="299" locator="80:1-81:48" name="Client's age is more than or equal to 45 years"><annotation xsi:type="a:Annotation"><a:t name="input" value="Client's age is more than or equal to 45 years"/><a:t name="pseudocode" value="&#34;Date of birth&#34; ≥ 45 years"/><a:t name="code" value="Client's age is more than or equal to 45 years-41"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule"/><a:s r="299"><a:s>/*
@input: Client's age is more than or equal to 45 years
@pseudocode: Today's date − "Date of birth" ≥ 45 years
@code: Client's age is more than or equal to 45 years-41
@decision: IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule
*/
define "Client's age is more than or equal to 45 years":
  </a:s><a:s r="300"><a:s r="302"><a:s r="301"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="302"><a:s>"Current Patient Age In Years"</a:s></a:s></a:s><a:s r="303"> &gt;= 45</a:s></a:s></a:s></annotation><expression localId="300" locator="81:3-81:48" xsi:type="GreaterOrEqual"><signature localId="304" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="305" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand libraryName="Encounter" localId="302" locator="81:3-81:42" name="Current Patient Age In Years" xsi:type="ExpressionRef"/><operand localId="303" locator="81:47-81:48" value="45" valueType="t:Integer" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="308" locator="90:1-91:59" name="One typhoid primary series dose was administered"><annotation xsi:type="a:Annotation"><a:t name="input" value="One typhoid primary series dose was administered"/><a:t name="pseudocode" value="&#34;Vaccine type&#34; = &#34;Typhoid vaccines&#34; and &#34;Type of dose&#34; = &#34;Primary series&#34;) = 1"/><a:t name="code" value="One typhoid primary series dose was administered-116"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule"/><a:s r="308"><a:s>/*
@input: One typhoid primary series dose was administered
@pseudocode: Count of vaccines administered (where "Vaccine type" = "Typhoid vaccines" and "Type of dose" = "Primary series") = 1
@code: One typhoid primary series dose was administered-116
@decision: IMMZ.D2.DT.Typhoid.TCV: Typhoid conjugate vaccine (TCV) schedule
@decision: IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule
*/
define "One typhoid primary series dose was administered":
  </a:s><a:s r="309"><a:s r="310"><a:s>"Number of Typhoid Primary Series Doses Administered"</a:s></a:s><a:s r="311"> = 1</a:s></a:s></a:s></annotation><expression localId="309" locator="91:3-91:59" xsi:type="Equal"><signature localId="312" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="313" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand localId="310" locator="91:3-91:55" name="Number of Typhoid Primary Series Doses Administered" xsi:type="ExpressionRef"/><operand localId="311" locator="91:59" value="1" valueType="t:Integer" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="316" locator="99:1-100:46" name="Client's age is less than 2 years"><annotation xsi:type="a:Annotation"><a:t name="input" value="Client's age is less than 2 years"/><a:t name="pseudocode" value="&#34;Date of birth&#34; &lt; 2 years"/><a:t name="code" value="Client's age is less than 2 years-40"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule"/><a:s r="316"><a:s>/*
@input: Client's age is less than 2 years
@pseudocode: Today's date − "Date of birth" &lt; 2 years
@code: Client's age is less than 2 years-40
@decision: IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule
*/
define "Client's age is less than 2 years":
  </a:s><a:s r="317"><a:s r="319"><a:s r="318"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="319"><a:s>"Current Patient Age In Years"</a:s></a:s></a:s><a:s r="320"> &lt; 2</a:s></a:s></a:s></annotation><expression localId="317" locator="100:3-100:46" xsi:type="Less"><signature localId="321" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="322" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand libraryName="Encounter" localId="319" locator="100:3-100:42" name="Current Patient Age In Years" xsi:type="ExpressionRef"/><operand localId="320" locator="100:46" value="2" valueType="t:Integer" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="325" locator="108:1-109:47" name="Client's age is more than or equal to 2 years"><annotation xsi:type="a:Annotation"><a:t name="input" value="Client's age is more than or equal to 2 years"/><a:t name="pseudocode" value="&#34;Date of birth&#34; ≥ 2 years"/><a:t name="code" value="Client's age is more than or equal to 2 years-40"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule"/><a:s r="325"><a:s>/*
@input: Client's age is more than or equal to 2 years
@pseudocode: Today's date − "Date of birth" ≥ 2 years
@code: Client's age is more than or equal to 2 years-40
@decision: IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule
*/
define "Client's age is more than or equal to 2 years":
  </a:s><a:s r="326"><a:s r="328"><a:s r="327"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="328"><a:s>"Current Patient Age In Years"</a:s></a:s></a:s><a:s r="329"> &gt;= 2</a:s></a:s></a:s></annotation><expression localId="326" locator="109:3-109:47" xsi:type="GreaterOrEqual"><signature localId="330" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="331" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand libraryName="Encounter" localId="328" locator="109:3-109:42" name="Current Patient Age In Years" xsi:type="ExpressionRef"/><operand localId="329" locator="109:47" value="2" valueType="t:Integer" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="338" locator="193:1-194:97" name="Date of Latest Typhoid Dose"><annotation xsi:type="a:Annotation"><a:t name="internal" value="Date of Latest Typhoid Dose"/><a:s r="338"><a:s>/*
@internal: Date of Latest Typhoid Dose
*/
define "Date of Latest Typhoid Dose":
  </a:s><a:s r="339"><a:s>date from </a:s><a:s r="340"><a:s>start of </a:s><a:s r="346"><a:s r="345"><a:s r="342"><a:s r="341"><a:s>"Typhoid Doses Administered to Patient"</a:s></a:s><a:s>.</a:s><a:s r="342"><a:s>mostRecent()</a:s></a:s></a:s><a:s>.</a:s><a:s r="345"><a:s>occurrence</a:s></a:s></a:s><a:s>.</a:s><a:s r="346"><a:s>toInterval()</a:s></a:s></a:s></a:s></a:s></a:s></annotation><expression localId="339" locator="194:3-194:97" xsi:type="DateFrom"><operand localId="340" locator="194:13-194:97" xsi:type="Start"><operand libraryName="WC" localId="346" locator="194:22-194:97" name="toInterval" xsi:type="FunctionRef"><operand localId="345" locator="194:22-194:84" path="occurrence" xsi:type="Property"><source libraryName="WC" localId="342" locator="194:22-194:73" name="mostRecent" xsi:type="FunctionRef"><signature localId="343" xsi:type="ListTypeSpecifier"><elementType localId="344" name="fhir:Immunization" xsi:type="NamedTypeSpecifier"/></signature><operand localId="341" locator="194:22-194:60" name="Typhoid Doses Administered to Patient" xsi:type="ExpressionRef"/></source></operand></operand></operand></expression></def><def accessLevel="Public" context="Patient" localId="334" locator="118:1-120:77" name="The latest typhoid dose was administered less than 3 years ago"><annotation xsi:type="a:Annotation"><a:t name="input" value="The latest typhoid dose was administered less than 3 years ago"/><a:t name="pseudocode" value="&#34;Date and time of vaccination&#34; (where &#34;Vaccine type&#34; = &#34;Typhoid vaccines&#34;) &lt; 3 years"/><a:t name="code" value="The latest typhoid dose was administered less than 3 years ago-106"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule"/><a:s r="334"><a:s>/*
@input: The latest typhoid dose was administered less than 3 years ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Typhoid vaccines") &lt; 3 years
@code: The latest typhoid dose was administered less than 3 years ago-106
@decision: IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define "The latest typhoid dose was administered less than 3 years ago":
  </a:s><a:s r="335"><a:s r="349"><a:s r="347"><a:s>"Date of Latest Typhoid Dose"</a:s></a:s><a:s> is not null</a:s></a:s><a:s>
    and </a:s><a:s r="350"><a:s r="351"><a:s>duration in years between </a:s><a:s r="352"><a:s>"Date of Latest Typhoid Dose"</a:s></a:s><a:s> and </a:s><a:s r="353"><a:s>Today</a:s></a:s></a:s><a:s r="356"> &lt; 3</a:s></a:s></a:s></a:s></annotation><expression localId="335" locator="119:3-120:77" xsi:type="And"><operand localId="349" locator="119:3-119:43" xsi:type="Not"><operand localId="348" locator="119:3-119:43" xsi:type="IsNull"><operand localId="347" locator="119:3-119:31" name="Date of Latest Typhoid Dose" xsi:type="ExpressionRef"/></operand></operand><operand localId="350" locator="120:9-120:77" xsi:type="Less"><signature localId="357" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="358" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand localId="351" locator="120:9-120:73" precision="Year" xsi:type="DurationBetween"><signature localId="354" name="t:Date" xsi:type="NamedTypeSpecifier"/><signature localId="355" name="t:Date" xsi:type="NamedTypeSpecifier"/><operand localId="352" locator="120:35-120:63" name="Date of Latest Typhoid Dose" xsi:type="ExpressionRef"/><operand localId="353" locator="120:69-120:73" name="Today" xsi:type="ParameterRef"/></operand><operand localId="356" locator="120:77" value="3" valueType="t:Integer" xsi:type="Literal"/></operand></expression></def><def accessLevel="Public" context="Patient" localId="361" locator="129:1-130:70" name="The latest typhoid dose was administered more than 3 years ago"><annotation xsi:type="a:Annotation"><a:t name="input" value="The latest typhoid dose was administered more than 3 years ago"/><a:t name="pseudocode" value="&#34;Date and time of vaccination&#34; (where &#34;Vaccine type&#34; = &#34;Typhoid vaccines&#34;) ≥ 3 years"/><a:t name="code" value="The latest typhoid dose was administered more than 3 years ago-106"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule"/><a:s r="361"><a:s>/*
@input: The latest typhoid dose was administered more than 3 years ago
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Vaccine type" = "Typhoid vaccines") ≥ 3 years
@code: The latest typhoid dose was administered more than 3 years ago-106
@decision: IMMZ.D2.DT.Typhoid.ViPS: Unconjugated Vi polysaccharide (ViPS) schedule
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define "The latest typhoid dose was administered more than 3 years ago":
  </a:s><a:s r="362"><a:s>not </a:s><a:s r="363"><a:s>"The latest typhoid dose was administered less than 3 years ago"</a:s></a:s></a:s></a:s></annotation><expression localId="362" locator="130:3-130:70" xsi:type="Not"><operand localId="363" locator="130:7-130:70" name="The latest typhoid dose was administered less than 3 years ago" xsi:type="ExpressionRef"/></expression></def><def accessLevel="Public" context="Patient" localId="366" locator="138:1-139:46" name="Client's age is less than 6 years"><annotation xsi:type="a:Annotation"><a:t name="input" value="Client's age is less than 6 years"/><a:t name="pseudocode" value="&#34;Date of birth&#34; &lt; 6 years"/><a:t name="code" value="Client's age is less than 6 years-40"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule"/><a:s r="366"><a:s>/*
@input: Client's age is less than 6 years
@pseudocode: Today's date − "Date of birth" &lt; 6 years
@code: Client's age is less than 6 years-40
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define "Client's age is less than 6 years":
  </a:s><a:s r="367"><a:s r="369"><a:s r="368"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="369"><a:s>"Current Patient Age In Years"</a:s></a:s></a:s><a:s r="370"> &lt; 6</a:s></a:s></a:s></annotation><expression localId="367" locator="139:3-139:46" xsi:type="Less"><signature localId="371" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="372" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand libraryName="Encounter" localId="369" locator="139:3-139:42" name="Current Patient Age In Years" xsi:type="ExpressionRef"/><operand localId="370" locator="139:46" value="6" valueType="t:Integer" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="375" locator="147:1-148:47" name="Client's age is more than or equal to 6 years"><annotation xsi:type="a:Annotation"><a:t name="input" value="Client's age is more than or equal to 6 years"/><a:t name="pseudocode" value="&#34;Date of birth&#34; ≥ 6 years"/><a:t name="code" value="Client's age is more than or equal to 6 years-40"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule"/><a:s r="375"><a:s>/*
@input: Client's age is more than or equal to 6 years
@pseudocode: Today's date − "Date of birth" ≥ 6 years
@code: Client's age is more than or equal to 6 years-40
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define "Client's age is more than or equal to 6 years":
  </a:s><a:s r="376"><a:s r="378"><a:s r="377"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="378"><a:s>"Current Patient Age In Years"</a:s></a:s></a:s><a:s r="379"> &gt;= 6</a:s></a:s></a:s></annotation><expression localId="376" locator="148:3-148:47" xsi:type="GreaterOrEqual"><signature localId="380" name="t:Integer" xsi:type="NamedTypeSpecifier"/><signature localId="381" name="t:Integer" xsi:type="NamedTypeSpecifier"/><operand libraryName="Encounter" localId="378" locator="148:3-148:42" name="Current Patient Age In Years" xsi:type="ExpressionRef"/><operand localId="379" locator="148:47" value="6" valueType="t:Integer" xsi:type="Literal"/></expression></def><def accessLevel="Public" context="Patient" localId="388" locator="183:1-188:11" name="Primary series is complete"><annotation xsi:type="a:Annotation"><a:t name="input" value="Primary series is complete"/><a:t name="pseudocode" value="&#34;Completed the primary vaccination series&#34; (where &#34;Vaccine type&#34; = &#34;Typhoid vaccines&#34;) = TRUE"/><a:t name="code" value="Primary series is complete-93"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule"/><a:s r="388"><a:s>/*
@input: Primary series is complete
@pseudocode: "Completed the primary vaccination series" (where "Vaccine type" = "Typhoid vaccines") = TRUE
@code: Primary series is complete-93
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define "Primary series is complete":
  </a:s><a:s r="389"><a:s r="390"><a:s>"One typhoid primary series dose was administered"</a:s></a:s><a:s>
  or </a:s><a:s r="421"><a:s>Coalesce(
    </a:s><a:s r="417"><a:s><a:s r="391"><a:s r="392"><a:s><a:s>"Typhoid Doses Administered to Patient"</a:s></a:s></a:s><a:s> Dose</a:s></a:s></a:s><a:s>
    </a:s><a:s r="394"><a:s>aggregate Result: </a:s><a:s r="397"><a:s r="411"><a:s r="409"><a:s r="399"><a:s r="398"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="399"><a:s>"Completed the primary vaccination series Observation"</a:s></a:s></a:s><a:s>.</a:s><a:s r="409"><a:s>partOf</a:s></a:s></a:s><a:s>.</a:s><a:s r="411"><a:s>references(</a:s><a:s r="410"><a:s>Dose</a:s></a:s><a:s>)</a:s></a:s></a:s><a:s> or </a:s><a:s r="415"><a:s>Result</a:s></a:s></a:s></a:s></a:s><a:s r="418">,
    false )</a:s></a:s></a:s></a:s></annotation><expression localId="389" locator="184:3-188:11" xsi:type="Or"><operand localId="390" locator="184:3-184:52" name="One typhoid primary series dose was administered" xsi:type="ExpressionRef"/><operand localId="421" locator="185:6-188:11" xsi:type="Coalesce"><operand localId="417" locator="186:5-187:120" xsi:type="Query"><source alias="Dose" localId="391" locator="186:5-186:48"><expression localId="392" locator="186:5-186:43" name="Typhoid Doses Administered to Patient" xsi:type="ExpressionRef"/></source><aggregate identifier="Result" localId="394" locator="187:5-187:120"><expression localId="397" locator="187:23-187:120" xsi:type="Or"><operand libraryName="WC" localId="411" locator="187:23-187:110" name="references" xsi:type="FunctionRef"><signature localId="412" xsi:type="ListTypeSpecifier"><elementType localId="413" name="fhir:Reference" xsi:type="NamedTypeSpecifier"/></signature><signature localId="414" name="fhir:Resource" xsi:type="NamedTypeSpecifier"/><operand localId="409" locator="187:23-187:93" xsi:type="Flatten"><operand localId="407" xsi:type="Query"><source alias="$this" localId="406"><expression libraryName="Encounter" localId="399" locator="187:23-187:86" name="Completed the primary vaccination series Observation" xsi:type="ExpressionRef"/></source><where localId="403" xsi:type="Not"><operand localId="402" xsi:type="IsNull"><operand localId="401" path="partOf" xsi:type="Property"><source localId="400" name="$this" xsi:type="AliasRef"/></operand></operand></where><return distinct="false" localId="408"><expression localId="405" path="partOf" xsi:type="Property"><source localId="404" name="$this" xsi:type="AliasRef"/></expression></return></operand></operand><operand localId="410" locator="187:106-187:109" name="Dose" xsi:type="AliasRef"/></operand><operand asType="t:Boolean" localId="416" xsi:type="As"><operand localId="415" locator="187:115-187:120" name="Result" xsi:type="QueryLetRef"/></operand></expression><starting localId="395" xsi:type="Null"/></aggregate></operand><operand localId="418" locator="188:5-188:9" value="false" valueType="t:Boolean" xsi:type="Literal"/></operand></expression></def><def accessLevel="Public" context="Patient" localId="384" locator="156:1-157:34" name="Primary series is not complete"><annotation xsi:type="a:Annotation"><a:t name="input" value="Primary series is not complete"/><a:t name="pseudocode" value="&#34;Completed the primary vaccination series&#34; (where &#34;Vaccine type&#34; = &#34;Typhoid vaccines&#34;) ≠ TRUE"/><a:t name="code" value="Primary series is not complete-93"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule"/><a:s r="384"><a:s>/*
@input: Primary series is not complete
@pseudocode: "Completed the primary vaccination series" (where "Vaccine type" = "Typhoid vaccines") ≠ TRUE
@code: Primary series is not complete-93
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define "Primary series is not complete":
  </a:s><a:s r="385"><a:s>not </a:s><a:s r="422"><a:s>"Primary series is complete"</a:s></a:s></a:s></a:s></annotation><expression localId="385" locator="157:3-157:34" xsi:type="Not"><operand localId="422" locator="157:7-157:34" name="Primary series is complete" xsi:type="ExpressionRef"/></expression></def><def accessLevel="Public" context="Patient" localId="425" locator="165:1-166:66" name="No live vaccine, other than typhoid, was administered in the past 4 weeks"><annotation xsi:type="a:Annotation"><a:t name="input" value="No live vaccine, other than typhoid, was administered in the past 4 weeks"/><a:t name="pseudocode" value="&#34;Date and time of vaccination&#34; (where &#34;Live vaccine&#34; = TRUE AND &#34;Vaccine type&#34; ≠ &#34;Typhoid vaccines&#34;) ≥ 4 weeks"/><a:t name="code" value="No live vaccine, other than typhoid, was administered in the past 4 weeks-132"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule"/><a:s r="425"><a:s>/*
@input: No live vaccine, other than typhoid, was administered in the past 4 weeks
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Live vaccine" = TRUE AND "Vaccine type" ≠ "Typhoid vaccines") ≥ 4 weeks
@code: No live vaccine, other than typhoid, was administered in the past 4 weeks-132
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define "No live vaccine, other than typhoid, was administered in the past 4 weeks":
  </a:s><a:s r="427"><a:s r="426"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="427"><a:s>"No live vaccine was administered in the last 4 weeks"</a:s></a:s></a:s></a:s></annotation><expression libraryName="Encounter" localId="427" locator="166:3-166:66" name="No live vaccine was administered in the last 4 weeks" xsi:type="ExpressionRef"/></def><def accessLevel="Public" context="Patient" localId="430" locator="174:1-175:63" name="Live vaccine, other than typhoid, was administered in the past 4 weeks"><annotation xsi:type="a:Annotation"><a:t name="input" value="Live vaccine, other than typhoid, was administered in the past 4 weeks"/><a:t name="pseudocode" value="&#34;Date and time of vaccination&#34; (where &#34;Live vaccine&#34; = TRUE AND &#34;Vaccine type&#34; ≠ &#34;Typhoid vaccines&#34;) &lt; 4 weeks"/><a:t name="code" value="Live vaccine, other than typhoid, was administered in the past 4 weeks-132"/><a:t name="decision" value="IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule"/><a:s r="430"><a:s>/*
@input: Live vaccine, other than typhoid, was administered in the past 4 weeks
@pseudocode: Today's date − latest "Date and time of vaccination" (where "Live vaccine" = TRUE AND "Vaccine type" ≠ "Typhoid vaccines") &lt; 4 weeks
@code: Live vaccine, other than typhoid, was administered in the past 4 weeks-132
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define "Live vaccine, other than typhoid, was administered in the past 4 weeks":
  </a:s><a:s r="432"><a:s r="431"><a:s>Encounter</a:s></a:s><a:s>.</a:s><a:s r="432"><a:s>"Live vaccine was administered in the last 4 weeks"</a:s></a:s></a:s></a:s></annotation><expression libraryName="Encounter" localId="432" locator="175:3-175:63" name="Live vaccine was administered in the last 4 weeks" xsi:type="ExpressionRef"/></def></statements></library>