<?xml version="1.0" encoding="UTF-8"?>
<library xmlns="urn:hl7-org:elm:r1" xmlns:t="urn:hl7-org:elm-types:r1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fhir="http://hl7.org/fhir" xmlns:qdm43="urn:healthit-gov:qdm:v4_3" xmlns:qdm53="urn:healthit-gov:qdm:v5_3" xmlns:a="urn:hl7-org:cql-annotations:r1" localId="0">
   <annotation translatorOptions="EnableAnnotations,EnableLocators,DisableListDemotion,DisableListPromotion" signatureLevel="Overloads" xsi:type="a:CqlToElmInfo"/>
   <annotation message="An operand identifier reference is hiding another identifier of the same name." errorType="semantic" errorSeverity="warning" xsi:type="a:CqlToElmError"/>
   <annotation message="An operand identifier reference is hiding another identifier of the same name." errorType="semantic" errorSeverity="warning" xsi:type="a:CqlToElmError"/>
   <annotation message="An operand identifier reference is hiding another identifier of the same name." errorType="semantic" errorSeverity="warning" xsi:type="a:CqlToElmError"/>
   <annotation xsi:type="a:Annotation">
      <a:s r="327">
         <a:s>/*
  * Library: IMMZD2DTTyphoidElements
  */
library IMMZD2DTTyphoidElements</a:s>
      </a:s>
   </annotation>
   <identifier id="IMMZD2DTTyphoidElements" 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" locator="7:1-7:26" localIdentifier="FHIR" 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" locator="8:1-8:35" localIdentifier="FHIRHelpers" 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" locator="10:1-10:19" localIdentifier="WHOConcepts" 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" locator="11:1-11:27" localIdentifier="WC" 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" locator="12:1-12:29" localIdentifier="WE" 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" locator="14:1-14:32" localIdentifier="Common" 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" locator="15:1-15:36" localIdentifier="Concepts" 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" locator="16:1-16:36" localIdentifier="Elements" path="http://smart.who.int/immunizations/IMMZElements">
         <annotation xsi:type="a:Annotation">
            <a:s r="220">
               <a:s>include </a:s>
               <a:s>
                  <a:s>IMMZElements</a:s>
               </a:s>
               <a:s> called Elements</a:s>
            </a:s>
         </annotation>
      </def>
   </includes>
   <contexts>
      <def localId="225" locator="19:1-19:15" name="Patient"/>
   </contexts>
   <statements>
      <def localId="223" locator="19:1-19:15" name="Patient" context="Patient">
         <expression localId="224" xsi:type="SingletonFrom">
            <operand localId="222" locator="19:1-19:15" dataType="fhir:Patient" templateId="http://hl7.org/fhir/StructureDefinition/Patient" xsi:type="Retrieve"/>
         </expression>
      </def>
      <def localId="228" locator="24:1-27:48" name="Typhoid Doses Administered to Patient" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="internal" value="Typhoid containing Doses Administered to Patient"/>
            <a:s r="228">
               <a:s>/*
@internal: Typhoid containing Doses Administered to Patient
*/
define &quot;Typhoid Doses Administered to Patient&quot;:
  </a:s>
               <a:s r="240">
                  <a:s>
                     <a:s r="229">
                        <a:s r="231">
                           <a:s>
                              <a:s>Elements.&quot;Doses Administered to Patient&quot;</a:s>
                           </a:s>
                        </a:s>
                        <a:s> I</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
  </a:s>
                  <a:s r="237">
                     <a:s>where
    </a:s>
                     <a:s r="237">
                        <a:s r="234">
                           <a:s r="233">
                              <a:s>I</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="234">
                              <a:s>vaccineCode</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="236">
                           <a:s r="235">
                              <a:s>Concepts</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="236">
                              <a:s>&quot;Typhoid vaccines&quot;</a:s>
                           </a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="240" locator="25:3-27:48" xsi:type="Query">
            <source localId="229" locator="25:3-25:44" alias="I">
               <expression localId="231" locator="25:3-25:42" name="Doses Administered to Patient" libraryName="Elements" xsi:type="ExpressionRef"/>
            </source>
            <where localId="237" locator="26:3-27:48" xsi:type="InValueSet">
               <signature localId="239" name="t:Concept" xsi:type="NamedTypeSpecifier"/>
               <code localId="238" name="ToConcept" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="234" locator="27:5-27:17" path="vaccineCode" scope="I" xsi:type="Property"/>
               </code>
               <valueset localId="236" locator="27:22-27:48" name="Typhoid vaccines" libraryName="Concepts" preserve="true"/>
            </where>
         </expression>
      </def>
      <def localId="243" locator="32:1-33:57" name="Typhoid Primary Series Doses Administered to Patient" context="Patient" accessLevel="Public">
         <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="243">
               <a:s>/*
@internal: Typhoid containing Doses Administered to Patient that are in the Primary series
*/
define &quot;Typhoid Primary Series Doses Administered to Patient&quot;:
  </a:s>
               <a:s r="245">
                  <a:s r="244">
                     <a:s>&quot;Typhoid Doses Administered to Patient&quot;</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="245">
                     <a:s>seriesPrimary()</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="245" locator="33:3-33:57" name="seriesPrimary" libraryName="Common" xsi:type="FunctionRef">
            <operand localId="244" locator="33:3-33:41" name="Typhoid Doses Administered to Patient" xsi:type="ExpressionRef"/>
         </expression>
      </def>
      <def localId="248" locator="38:1-39:63" name="Number of Typhoid Primary Series Doses Administered" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="internal" value="Number of Typhoid Primary Series doses"/>
            <a:s r="248">
               <a:s>/*
@internal: Number of Typhoid Primary Series doses
*/
define &quot;Number of Typhoid Primary Series Doses Administered&quot;:
  </a:s>
               <a:s r="252">
                  <a:s>Count(</a:s>
                  <a:s r="249">
                     <a:s>&quot;Typhoid Primary Series Doses Administered to Patient&quot;</a:s>
                  </a:s>
                  <a:s>)</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="252" locator="39:3-39:63" xsi:type="Count">
            <source localId="249" locator="39:9-39:62" name="Typhoid Primary Series Doses Administered to Patient" xsi:type="ExpressionRef"/>
         </expression>
      </def>
      <def localId="255" locator="47:1-48:46" name="Client's age is less than 6 months" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's age is less than 6 months"/>
            <a:t name="pseudocode" value="&quot;Date of birth&quot; &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="255">
               <a:s>/*
@input: Client's age is less than 6 months
@pseudocode: Today's date − &quot;Date of birth&quot; &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 &quot;Client's age is less than 6 months&quot;:
  </a:s>
               <a:s r="256">
                  <a:s r="258">
                     <a:s r="257">
                        <a:s>Elements</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="258">
                        <a:s>&quot;Current Patient Age In Months&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="259"> &lt; 6</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="256" locator="48:3-48:46" xsi:type="Less">
            <signature localId="260" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="261" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="258" locator="48:3-48:42" name="Current Patient Age In Months" libraryName="Elements" xsi:type="ExpressionRef"/>
            <operand localId="259" locator="48:46" valueType="t:Integer" value="6" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="264" locator="57:1-58:59" name="No typhoid primary series doses were administered" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="No typhoid primary series doses were administered"/>
            <a:t name="pseudocode" value="&quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 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="264">
               <a:s>/*
@input: No typhoid primary series doses were administered
@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 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 &quot;No typhoid primary series doses were administered&quot;:
  </a:s>
               <a:s r="265">
                  <a:s r="266">
                     <a:s>&quot;Number of Typhoid Primary Series Doses Administered&quot;</a:s>
                  </a:s>
                  <a:s r="267"> = 0</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="265" locator="58:3-58:59" xsi:type="Equal">
            <signature localId="268" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="269" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="266" locator="58:3-58:55" name="Number of Typhoid Primary Series Doses Administered" xsi:type="ExpressionRef"/>
            <operand localId="267" locator="58:59" valueType="t:Integer" value="0" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="272" locator="66:1-68:50" name="Client's age is between 6 months and 45 years" context="Patient" accessLevel="Public">
         <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="&quot;Date of birth&quot; &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="272">
               <a:s>/*
@input: Client's age is between 6 months and 45 years
@pseudocode: 6 months ≤ Today's date − &quot;Date of birth&quot; &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 &quot;Client's age is between 6 months and 45 years&quot;:
  </a:s>
               <a:s r="273">
                  <a:s r="274">
                     <a:s r="275">6 &lt;= </a:s>
                     <a:s r="277">
                        <a:s r="276">
                           <a:s>Elements</a:s>
                        </a:s>
                        <a:s>.</a:s>
                        <a:s r="277">
                           <a:s>&quot;Current Patient Age In Months&quot;</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
                  <a:s>
  and </a:s>
                  <a:s r="280">
                     <a:s r="282">
                        <a:s r="281">
                           <a:s>Elements</a:s>
                        </a:s>
                        <a:s>.</a:s>
                        <a:s r="282">
                           <a:s>&quot;Current Patient Age In Years&quot;</a:s>
                        </a:s>
                     </a:s>
                     <a:s r="283"> &lt; 45</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="273" locator="67:3-68:50" xsi:type="And">
            <operand localId="274" locator="67:3-67:47" xsi:type="LessOrEqual">
               <signature localId="278" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <signature localId="279" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <operand localId="275" locator="67:3" valueType="t:Integer" value="6" xsi:type="Literal"/>
               <operand localId="277" locator="67:8-67:47" name="Current Patient Age In Months" libraryName="Elements" xsi:type="ExpressionRef"/>
            </operand>
            <operand localId="280" locator="68:7-68:50" xsi:type="Less">
               <signature localId="284" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <signature localId="285" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <operand localId="282" locator="68:7-68:45" name="Current Patient Age In Years" libraryName="Elements" xsi:type="ExpressionRef"/>
               <operand localId="283" locator="68:49-68:50" valueType="t:Integer" value="45" xsi:type="Literal"/>
            </operand>
         </expression>
      </def>
      <def localId="288" locator="76:1-77:47" name="Client's age is more than or equal to 45 years" context="Patient" accessLevel="Public">
         <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="&quot;Date of birth&quot; ≥ 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="288">
               <a:s>/*
@input: Client's age is more than or equal to 45 years
@pseudocode: Today's date − &quot;Date of birth&quot; ≥ 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 &quot;Client's age is more than or equal to 45 years&quot;:
  </a:s>
               <a:s r="289">
                  <a:s r="291">
                     <a:s r="290">
                        <a:s>Elements</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="291">
                        <a:s>&quot;Current Patient Age In Years&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="292"> >= 45</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="289" locator="77:3-77:47" xsi:type="GreaterOrEqual">
            <signature localId="293" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="294" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="291" locator="77:3-77:41" name="Current Patient Age In Years" libraryName="Elements" xsi:type="ExpressionRef"/>
            <operand localId="292" locator="77:46-77:47" valueType="t:Integer" value="45" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="297" locator="86:1-87:59" name="One typhoid primary series dose was administered" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="One typhoid primary series dose was administered"/>
            <a:t name="pseudocode" value="&quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 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="297">
               <a:s>/*
@input: One typhoid primary series dose was administered
@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 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 &quot;One typhoid primary series dose was administered&quot;:
  </a:s>
               <a:s r="298">
                  <a:s r="299">
                     <a:s>&quot;Number of Typhoid Primary Series Doses Administered&quot;</a:s>
                  </a:s>
                  <a:s r="300"> = 1</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="298" locator="87:3-87:59" xsi:type="Equal">
            <signature localId="301" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="302" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="299" locator="87:3-87:55" name="Number of Typhoid Primary Series Doses Administered" xsi:type="ExpressionRef"/>
            <operand localId="300" locator="87:59" valueType="t:Integer" value="1" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="305" locator="95:1-96:45" name="Client's age is less than 2 years" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's age is less than 2 years"/>
            <a:t name="pseudocode" value="&quot;Date of birth&quot; &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="305">
               <a:s>/*
@input: Client's age is less than 2 years
@pseudocode: Today's date − &quot;Date of birth&quot; &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 &quot;Client's age is less than 2 years&quot;:
  </a:s>
               <a:s r="306">
                  <a:s r="308">
                     <a:s r="307">
                        <a:s>Elements</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="308">
                        <a:s>&quot;Current Patient Age In Years&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="309"> &lt; 2</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="306" locator="96:3-96:45" xsi:type="Less">
            <signature localId="310" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="311" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="308" locator="96:3-96:41" name="Current Patient Age In Years" libraryName="Elements" xsi:type="ExpressionRef"/>
            <operand localId="309" locator="96:45" valueType="t:Integer" value="2" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="314" locator="104:1-105:46" name="Client's age is more than or equal to 2 years" context="Patient" accessLevel="Public">
         <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="&quot;Date of birth&quot; ≥ 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="314">
               <a:s>/*
@input: Client's age is more than or equal to 2 years
@pseudocode: Today's date − &quot;Date of birth&quot; ≥ 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 &quot;Client's age is more than or equal to 2 years&quot;:
  </a:s>
               <a:s r="315">
                  <a:s r="317">
                     <a:s r="316">
                        <a:s>Elements</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="317">
                        <a:s>&quot;Current Patient Age In Years&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="318"> >= 2</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="315" locator="105:3-105:46" xsi:type="GreaterOrEqual">
            <signature localId="319" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="320" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="317" locator="105:3-105:41" name="Current Patient Age In Years" libraryName="Elements" xsi:type="ExpressionRef"/>
            <operand localId="318" locator="105:46" valueType="t:Integer" value="2" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="327" locator="189:1-190:97" name="Date of Latest Typhoid Dose" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="internal" value="Date of Latest Typhoid Dose"/>
            <a:s r="327">
               <a:s>/*
@internal: Date of Latest Typhoid Dose
*/
define &quot;Date of Latest Typhoid Dose&quot;:
  </a:s>
               <a:s r="328">
                  <a:s>date from </a:s>
                  <a:s r="329">
                     <a:s>start of </a:s>
                     <a:s r="335">
                        <a:s r="334">
                           <a:s r="331">
                              <a:s r="330">
                                 <a:s>&quot;Typhoid Doses Administered to Patient&quot;</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="331">
                                 <a:s>mostRecent()</a:s>
                              </a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="334">
                              <a:s>occurrence</a:s>
                           </a:s>
                        </a:s>
                        <a:s>.</a:s>
                        <a:s r="335">
                           <a:s>toInterval()</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="328" locator="190:3-190:97" xsi:type="DateFrom">
            <operand localId="329" locator="190:13-190:97" xsi:type="Start">
               <operand localId="335" locator="190:22-190:97" name="toInterval" libraryName="WC" xsi:type="FunctionRef">
                  <operand localId="334" locator="190:22-190:84" path="occurrence" xsi:type="Property">
                     <source localId="331" locator="190:22-190:73" name="mostRecent" libraryName="WC" xsi:type="FunctionRef">
                        <signature localId="332" xsi:type="ListTypeSpecifier">
                           <elementType localId="333" name="fhir:Immunization" xsi:type="NamedTypeSpecifier"/>
                        </signature>
                        <operand localId="330" locator="190:22-190:60" name="Typhoid Doses Administered to Patient" xsi:type="ExpressionRef"/>
                     </source>
                  </operand>
               </operand>
            </operand>
         </expression>
      </def>
      <def localId="323" locator="114:1-116:77" name="The latest typhoid dose was administered less than 3 years ago" context="Patient" accessLevel="Public">
         <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="&quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot;) &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="323">
               <a:s>/*
@input: The latest typhoid dose was administered less than 3 years ago
@pseudocode: Today's date − latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot;) &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 &quot;The latest typhoid dose was administered less than 3 years ago&quot;:
  </a:s>
               <a:s r="324">
                  <a:s r="338">
                     <a:s r="336">
                        <a:s>&quot;Date of Latest Typhoid Dose&quot;</a:s>
                     </a:s>
                     <a:s> is not null</a:s>
                  </a:s>
                  <a:s>
    and </a:s>
                  <a:s r="339">
                     <a:s r="340">
                        <a:s>duration in years between </a:s>
                        <a:s r="341">
                           <a:s>&quot;Date of Latest Typhoid Dose&quot;</a:s>
                        </a:s>
                        <a:s> and </a:s>
                        <a:s r="344">
                           <a:s>Now()</a:s>
                        </a:s>
                     </a:s>
                     <a:s r="350"> &lt; 3</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="324" locator="115:3-116:77" xsi:type="And">
            <operand localId="338" locator="115:3-115:43" xsi:type="Not">
               <operand localId="337" locator="115:3-115:43" xsi:type="IsNull">
                  <operand localId="336" locator="115:3-115:31" name="Date of Latest Typhoid Dose" xsi:type="ExpressionRef"/>
               </operand>
            </operand>
            <operand localId="339" locator="116:9-116:77" xsi:type="Less">
               <signature localId="351" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <signature localId="352" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <operand localId="340" locator="116:9-116:73" precision="Year" xsi:type="DurationBetween">
                  <signature localId="348" name="t:DateTime" xsi:type="NamedTypeSpecifier"/>
                  <signature localId="349" name="t:DateTime" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="346" xsi:type="ToDateTime">
                     <signature localId="347" name="t:Date" xsi:type="NamedTypeSpecifier"/>
                     <operand localId="341" locator="116:35-116:63" name="Date of Latest Typhoid Dose" xsi:type="ExpressionRef"/>
                  </operand>
                  <operand localId="344" locator="116:69-116:73" xsi:type="Now"/>
               </operand>
               <operand localId="350" locator="116:77" valueType="t:Integer" value="3" xsi:type="Literal"/>
            </operand>
         </expression>
      </def>
      <def localId="355" locator="125:1-126:70" name="The latest typhoid dose was administered more than 3 years ago" context="Patient" accessLevel="Public">
         <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="&quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot;) ≥ 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="355">
               <a:s>/*
@input: The latest typhoid dose was administered more than 3 years ago
@pseudocode: Today's date − latest &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot;) ≥ 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 &quot;The latest typhoid dose was administered more than 3 years ago&quot;:
  </a:s>
               <a:s r="356">
                  <a:s>not </a:s>
                  <a:s r="357">
                     <a:s>&quot;The latest typhoid dose was administered less than 3 years ago&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="356" locator="126:3-126:70" xsi:type="Not">
            <operand localId="357" locator="126:7-126:70" name="The latest typhoid dose was administered less than 3 years ago" xsi:type="ExpressionRef"/>
         </expression>
      </def>
      <def localId="360" locator="134:1-135:45" name="Client's age is less than 6 years" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's age is less than 6 years"/>
            <a:t name="pseudocode" value="&quot;Date of birth&quot; &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="360">
               <a:s>/*
@input: Client's age is less than 6 years
@pseudocode: Today's date − &quot;Date of birth&quot; &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 &quot;Client's age is less than 6 years&quot;:
  </a:s>
               <a:s r="361">
                  <a:s r="363">
                     <a:s r="362">
                        <a:s>Elements</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="363">
                        <a:s>&quot;Current Patient Age In Years&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="364"> &lt; 6</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="361" locator="135:3-135:45" xsi:type="Less">
            <signature localId="365" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="366" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="363" locator="135:3-135:41" name="Current Patient Age In Years" libraryName="Elements" xsi:type="ExpressionRef"/>
            <operand localId="364" locator="135:45" valueType="t:Integer" value="6" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="369" locator="143:1-144:46" name="Client's age is more than or equal to 6 years" context="Patient" accessLevel="Public">
         <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="&quot;Date of birth&quot; ≥ 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="369">
               <a:s>/*
@input: Client's age is more than or equal to 6 years
@pseudocode: Today's date − &quot;Date of birth&quot; ≥ 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 &quot;Client's age is more than or equal to 6 years&quot;:
  </a:s>
               <a:s r="370">
                  <a:s r="372">
                     <a:s r="371">
                        <a:s>Elements</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="372">
                        <a:s>&quot;Current Patient Age In Years&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="373"> >= 6</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="370" locator="144:3-144:46" xsi:type="GreaterOrEqual">
            <signature localId="374" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="375" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="372" locator="144:3-144:41" name="Current Patient Age In Years" libraryName="Elements" xsi:type="ExpressionRef"/>
            <operand localId="373" locator="144:46" valueType="t:Integer" value="6" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="382" locator="179:1-184:11" name="Primary series is complete" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Primary series is complete"/>
            <a:t name="pseudocode" value="&quot;Completed the primary vaccination series&quot; (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot;) = 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="382">
               <a:s>/*
@input: Primary series is complete
@pseudocode: &quot;Completed the primary vaccination series&quot; (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot;) = TRUE
@code: Primary series is complete-93
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define &quot;Primary series is complete&quot;:
  </a:s>
               <a:s r="383">
                  <a:s r="384">
                     <a:s>&quot;One typhoid primary series dose was administered&quot;</a:s>
                  </a:s>
                  <a:s>
  or </a:s>
                  <a:s r="415">
                     <a:s>Coalesce(
    </a:s>
                     <a:s r="411">
                        <a:s>
                           <a:s r="385">
                              <a:s r="386">
                                 <a:s>
                                    <a:s>&quot;Typhoid Doses Administered to Patient&quot;</a:s>
                                 </a:s>
                              </a:s>
                              <a:s> Dose</a:s>
                           </a:s>
                        </a:s>
                        <a:s>
    </a:s>
                        <a:s r="388">
                           <a:s>aggregate Result: </a:s>
                           <a:s r="391">
                              <a:s r="405">
                                 <a:s r="403">
                                    <a:s r="393">
                                       <a:s r="392">
                                          <a:s>Elements</a:s>
                                       </a:s>
                                       <a:s>.</a:s>
                                       <a:s r="393">
                                          <a:s>&quot;Completed the primary vaccination series Observation&quot;</a:s>
                                       </a:s>
                                    </a:s>
                                    <a:s>.</a:s>
                                    <a:s r="403">
                                       <a:s>partOf</a:s>
                                    </a:s>
                                 </a:s>
                                 <a:s>.</a:s>
                                 <a:s r="405">
                                    <a:s>references(</a:s>
                                    <a:s r="404">
                                       <a:s>Dose</a:s>
                                    </a:s>
                                    <a:s>)</a:s>
                                 </a:s>
                              </a:s>
                              <a:s> or </a:s>
                              <a:s r="409">
                                 <a:s>Result</a:s>
                              </a:s>
                           </a:s>
                        </a:s>
                     </a:s>
                     <a:s r="412">,
    false )</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="383" locator="180:3-184:11" xsi:type="Or">
            <operand localId="384" locator="180:3-180:52" name="One typhoid primary series dose was administered" xsi:type="ExpressionRef"/>
            <operand localId="415" locator="181:6-184:11" xsi:type="Coalesce">
               <operand localId="411" locator="182:5-183:119" xsi:type="Query">
                  <source localId="385" locator="182:5-182:48" alias="Dose">
                     <expression localId="386" locator="182:5-182:43" name="Typhoid Doses Administered to Patient" xsi:type="ExpressionRef"/>
                  </source>
                  <aggregate localId="388" locator="183:5-183:119" identifier="Result">
                     <expression localId="391" locator="183:23-183:119" xsi:type="Or">
                        <operand localId="405" locator="183:23-183:109" name="references" libraryName="WC" xsi:type="FunctionRef">
                           <signature localId="406" xsi:type="ListTypeSpecifier">
                              <elementType localId="407" name="fhir:Reference" xsi:type="NamedTypeSpecifier"/>
                           </signature>
                           <signature localId="408" name="fhir:Resource" xsi:type="NamedTypeSpecifier"/>
                           <operand localId="403" locator="183:23-183:92" xsi:type="Flatten">
                              <operand localId="401" xsi:type="Query">
                                 <source localId="400" alias="$this">
                                    <expression localId="393" locator="183:23-183:85" name="Completed the primary vaccination series Observation" libraryName="Elements" xsi:type="ExpressionRef"/>
                                 </source>
                                 <where localId="397" xsi:type="Not">
                                    <operand localId="396" xsi:type="IsNull">
                                       <operand localId="395" path="partOf" xsi:type="Property">
                                          <source localId="394" name="$this" xsi:type="AliasRef"/>
                                       </operand>
                                    </operand>
                                 </where>
                                 <return localId="402" distinct="false">
                                    <expression localId="399" path="partOf" xsi:type="Property">
                                       <source localId="398" name="$this" xsi:type="AliasRef"/>
                                    </expression>
                                 </return>
                              </operand>
                           </operand>
                           <operand localId="404" locator="183:105-183:108" name="Dose" xsi:type="AliasRef"/>
                        </operand>
                        <operand localId="410" asType="t:Boolean" xsi:type="As">
                           <operand localId="409" locator="183:114-183:119" name="Result" xsi:type="QueryLetRef"/>
                        </operand>
                     </expression>
                     <starting localId="389" xsi:type="Null"/>
                  </aggregate>
               </operand>
               <operand localId="412" locator="184:5-184:9" valueType="t:Boolean" value="false" xsi:type="Literal"/>
            </operand>
         </expression>
      </def>
      <def localId="378" locator="152:1-153:34" name="Primary series is not complete" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Primary series is not complete"/>
            <a:t name="pseudocode" value="&quot;Completed the primary vaccination series&quot; (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot;) ≠ 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="378">
               <a:s>/*
@input: Primary series is not complete
@pseudocode: &quot;Completed the primary vaccination series&quot; (where &quot;Vaccine type&quot; = &quot;Typhoid vaccines&quot;) ≠ TRUE
@code: Primary series is not complete-93
@decision: IMMZ.D2.DT.Typhoid.Ty21a: Live attenuated Ty21a vaccine schedule
*/
define &quot;Primary series is not complete&quot;:
  </a:s>
               <a:s r="379">
                  <a:s>not </a:s>
                  <a:s r="416">
                     <a:s>&quot;Primary series is complete&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="379" locator="153:3-153:34" xsi:type="Not">
            <operand localId="416" locator="153:7-153:34" name="Primary series is complete" xsi:type="ExpressionRef"/>
         </expression>
      </def>
      <def localId="419" locator="161:1-162:65" name="No live vaccine, other than typhoid, was administered in the past 4 weeks" context="Patient" accessLevel="Public">
         <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="&quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE AND &quot;Vaccine type&quot; ≠ &quot;Typhoid vaccines&quot;) ≥ 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="419">
               <a:s>/*
@input: No live vaccine, other than typhoid, was administered in the past 4 weeks
@pseudocode: Today's date − latest &quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE AND &quot;Vaccine type&quot; ≠ &quot;Typhoid vaccines&quot;) ≥ 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 &quot;No live vaccine, other than typhoid, was administered in the past 4 weeks&quot;:
  </a:s>
               <a:s r="421">
                  <a:s r="420">
                     <a:s>Elements</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="421">
                     <a:s>&quot;No live vaccine was administered in the last 4 weeks&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="421" locator="162:3-162:65" name="No live vaccine was administered in the last 4 weeks" libraryName="Elements" xsi:type="ExpressionRef"/>
      </def>
      <def localId="424" locator="170:1-171:62" name="Live vaccine, other than typhoid, was administered in the past 4 weeks" context="Patient" accessLevel="Public">
         <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="&quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE AND &quot;Vaccine type&quot; ≠ &quot;Typhoid vaccines&quot;) &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="424">
               <a:s>/*
@input: Live vaccine, other than typhoid, was administered in the past 4 weeks
@pseudocode: Today's date − latest &quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE AND &quot;Vaccine type&quot; ≠ &quot;Typhoid vaccines&quot;) &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 &quot;Live vaccine, other than typhoid, was administered in the past 4 weeks&quot;:
  </a:s>
               <a:s r="426">
                  <a:s r="425">
                     <a:s>Elements</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="426">
                     <a:s>&quot;Live vaccine was administered in the last 4 weeks&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="426" locator="171:3-171:62" name="Live vaccine was administered in the last 4 weeks" libraryName="Elements" xsi:type="ExpressionRef"/>
      </def>
   </statements>
</library>
