<?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="372">
         <a:s>/*
  * Library: IMMZD2DTBCGEncounterElements
  */
library IMMZD2DTBCGEncounterElements</a:s>
      </a:s>
   </annotation>
   <identifier id="IMMZD2DTBCGEncounterElements" 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:46" localIdentifier="Encounter" 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" locator="18:1-18:46" localIdentifier="BCGElements" path="http://smart.who.int/immunizations/IMMZD2DTBCGElements">
         <annotation xsi:type="a:Annotation">
            <a:s r="222">
               <a:s>include </a:s>
               <a:s>
                  <a:s>IMMZD2DTBCGElements</a:s>
               </a:s>
               <a:s> called BCGElements</a:s>
            </a:s>
         </annotation>
      </def>
   </includes>
   <parameters>
      <def localId="224" locator="20:1-20:36" name="Today" accessLevel="Public">
         <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 localId="230" locator="21:1-21:28" name="EncounterId" accessLevel="Public">
         <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 localId="234" locator="23:1-23:15" name="Patient" context="Patient">
         <expression localId="235" xsi:type="SingletonFrom">
            <operand localId="233" locator="23:1-23:15" dataType="fhir:Patient" templateId="http://hl7.org/fhir/StructureDefinition/Patient" xsi:type="Retrieve"/>
         </expression>
      </def>
      <def localId="239" locator="28:1-29:67" name="BCG Doses Administered to Patient" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="internal" value="BCG containing Doses Administered to Patient"/>
            <a:s r="239">
               <a:s>/*
@internal: BCG containing Doses Administered to Patient
*/
define &quot;BCG Doses Administered to Patient&quot;:
  </a:s>
               <a:s r="243">
                  <a:s r="241">
                     <a:s r="240">
                        <a:s>BCGElements</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="241">
                        <a:s>&quot;BCG Doses Administered to Patient&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="243">
                     <a:s>onOrBefore(</a:s>
                     <a:s r="242">
                        <a:s>Today</a:s>
                     </a:s>
                     <a:s>)</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="243" locator="29:3-29:67" name="onOrBefore" libraryName="Common" xsi:type="FunctionRef">
            <operand localId="241" locator="29:3-29:49" name="BCG Doses Administered to Patient" libraryName="BCGElements" xsi:type="ExpressionRef"/>
            <operand localId="242" locator="29:62-29:66" name="Today" xsi:type="ParameterRef"/>
         </expression>
      </def>
      <def localId="246" locator="34:1-35:82" name="BCG Primary Series Doses Administered to Patient" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="internal" value="BCG containing Doses Administered to Patient that are in the Primary series"/>
            <a:s r="246">
               <a:s>/*
@internal: BCG containing Doses Administered to Patient that are in the Primary series
*/
define &quot;BCG Primary Series Doses Administered to Patient&quot;:
  </a:s>
               <a:s r="250">
                  <a:s r="248">
                     <a:s r="247">
                        <a:s>BCGElements</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="248">
                        <a:s>&quot;BCG Primary Series Doses Administered to Patient&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="250">
                     <a:s>onOrBefore(</a:s>
                     <a:s r="249">
                        <a:s>Today</a:s>
                     </a:s>
                     <a:s>)</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="250" locator="35:3-35:82" name="onOrBefore" libraryName="Common" xsi:type="FunctionRef">
            <operand localId="248" locator="35:3-35:64" name="BCG Primary Series Doses Administered to Patient" libraryName="BCGElements" xsi:type="ExpressionRef"/>
            <operand localId="249" locator="35:77-35:81" name="Today" xsi:type="ParameterRef"/>
         </expression>
      </def>
      <def localId="253" locator="40:1-41:59" name="Number of BCG Primary Series Doses Administered" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="internal" value="Number of BCG Primary Series doses"/>
            <a:s r="253">
               <a:s>/*
@internal: Number of BCG Primary Series doses
*/
define &quot;Number of BCG Primary Series Doses Administered&quot;:
  </a:s>
               <a:s r="257">
                  <a:s>Count(</a:s>
                  <a:s r="254">
                     <a:s>&quot;BCG Primary Series Doses Administered to Patient&quot;</a:s>
                  </a:s>
                  <a:s>)</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="257" locator="41:3-41:59" xsi:type="Count">
            <source localId="254" locator="41:9-41:58" name="BCG Primary Series Doses Administered to Patient" xsi:type="ExpressionRef"/>
         </expression>
      </def>
      <def localId="260" locator="49:1-50:55" name="No BCG primary series dose was administered" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="No BCG primary series dose was administered"/>
            <a:t name="pseudocode" value="&quot;Vaccine type&quot; = &quot;BCG vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 0"/>
            <a:t name="code" value="No BCG primary series dose was administered-112"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="260">
               <a:s>/*
@input: No BCG primary series dose was administered
@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;BCG vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 0
@code: No BCG primary series dose was administered-112
@decision: IMMZ.D2.DT.BCG
*/
define &quot;No BCG primary series dose was administered&quot;:
  </a:s>
               <a:s r="261">
                  <a:s r="262">
                     <a:s>&quot;Number of BCG Primary Series Doses Administered&quot;</a:s>
                  </a:s>
                  <a:s r="263"> = 0</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="261" locator="50:3-50:55" xsi:type="Equal">
            <signature localId="264" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="265" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="262" locator="50:3-50:51" name="Number of BCG Primary Series Doses Administered" xsi:type="ExpressionRef"/>
            <operand localId="263" locator="50:55" valueType="t:Integer" value="0" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="268" locator="58:1-59:47" name="Client's age is less than or equal to 28 days" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's age is less than or equal to 28 days"/>
            <a:t name="pseudocode" value="&quot;Date of birth&quot; ≤ 28 days"/>
            <a:t name="code" value="Client's age is less than or equal to 28 days-40"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="268">
               <a:s>/*
@input: Client's age is less than or equal to 28 days
@pseudocode: Today's date − &quot;Date of birth&quot; ≤ 28 days
@code: Client's age is less than or equal to 28 days-40
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client's age is less than or equal to 28 days&quot;:
  </a:s>
               <a:s r="269">
                  <a:s r="271">
                     <a:s r="270">
                        <a:s>Encounter</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="271">
                        <a:s>&quot;Current Patient Age In Days&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="272"> &lt;= 28</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="269" locator="59:3-59:47" xsi:type="LessOrEqual">
            <signature localId="273" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="274" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="271" locator="59:3-59:41" name="Current Patient Age In Days" libraryName="Encounter" xsi:type="ExpressionRef"/>
            <operand localId="272" locator="59:46-59:47" valueType="t:Integer" value="28" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="277" locator="67:1-68:56" name="Client's HIV status is negative or unknown" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's HIV status is negative or unknown"/>
            <a:t name="pseudocode" value="&quot;HIV status&quot; ≠ &quot;HIV-positive&quot;"/>
            <a:t name="code" value="Client's HIV status is negative or unknown-29"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="277">
               <a:s>/*
@input: Client's HIV status is negative or unknown
@pseudocode: &quot;HIV status&quot; ≠ &quot;HIV-positive&quot;
@code: Client's HIV status is negative or unknown-29
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client's HIV status is negative or unknown&quot;:
  </a:s>
               <a:s r="279">
                  <a:s r="278">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="279">
                     <a:s>&quot;Client's HIV status is negative or unknown&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="279" locator="68:3-68:56" name="Client's HIV status is negative or unknown" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="282" locator="76:1-77:46" name="No live vaccine was administered" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="No live vaccine was administered"/>
            <a:t name="pseudocode" value="&quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE) IS NULL"/>
            <a:t name="code" value="No live vaccine was administered-90"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="282">
               <a:s>/*
@input: No live vaccine was administered
@pseudocode: Today's date − latest &quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE) IS NULL
@code: No live vaccine was administered-90
@decision: IMMZ.D2.DT.BCG
*/
define &quot;No live vaccine was administered&quot;:
  </a:s>
               <a:s r="284">
                  <a:s r="283">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="284">
                     <a:s>&quot;No live vaccine was administered&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="284" locator="77:3-77:46" name="No live vaccine was administered" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="287" locator="85:1-86:63" name="Live vaccine was administered in the last four weeks" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Live vaccine was administered in the last four weeks"/>
            <a:t name="pseudocode" value="&quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE) &lt; 4 weeks"/>
            <a:t name="code" value="Live vaccine was administered in the last four weeks-92"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="287">
               <a:s>/*
@input: Live vaccine was administered in the last four weeks
@pseudocode: Today's date − latest &quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE) &lt; 4 weeks
@code: Live vaccine was administered in the last four weeks-92
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Live vaccine was administered in the last four weeks&quot;:
  </a:s>
               <a:s r="289">
                  <a:s r="288">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="289">
                     <a:s>&quot;Live vaccine was administered in the last 4 weeks&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="289" locator="86:3-86:63" name="Live vaccine was administered in the last 4 weeks" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="292" locator="94:1-95:45" name="Client's HIV status is positive" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's HIV status is positive"/>
            <a:t name="pseudocode" value="&quot;HIV status&quot; = &quot;HIV-positive&quot;"/>
            <a:t name="code" value="Client's HIV status is positive-29"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="292">
               <a:s>/*
@input: Client's HIV status is positive
@pseudocode: &quot;HIV status&quot; = &quot;HIV-positive&quot;
@code: Client's HIV status is positive-29
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client's HIV status is positive&quot;:
  </a:s>
               <a:s r="294">
                  <a:s r="293">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="294">
                     <a:s>&quot;Client's HIV status is positive&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="294" locator="95:3-95:45" name="Client's HIV status is positive" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="297" locator="103:1-104:66" name="Client is currently receiving antiretroviral therapy" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client is currently receiving antiretroviral therapy"/>
            <a:t name="pseudocode" value="&quot;Currently on ART&quot; = TRUE"/>
            <a:t name="code" value="Client is currently receiving antiretroviral therapy-25"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="297">
               <a:s>/*
@input: Client is currently receiving antiretroviral therapy
@pseudocode: &quot;Currently on ART&quot; = TRUE
@code: Client is currently receiving antiretroviral therapy-25
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client is currently receiving antiretroviral therapy&quot;:
  </a:s>
               <a:s r="299">
                  <a:s r="298">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="299">
                     <a:s>&quot;Client is currently receiving antiretroviral therapy&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="299" locator="104:3-104:66" name="Client is currently receiving antiretroviral therapy" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="302" locator="112:1-113:46" name="Client is immunologically stable" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client is immunologically stable"/>
            <a:t name="pseudocode" value="&quot;Immunologically stable&quot; = TRUE"/>
            <a:t name="code" value="Client is immunologically stable-31"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="302">
               <a:s>/*
@input: Client is immunologically stable
@pseudocode: &quot;Immunologically stable&quot; = TRUE
@code: Client is immunologically stable-31
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client is immunologically stable&quot;:
  </a:s>
               <a:s r="304">
                  <a:s r="303">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="304">
                     <a:s>&quot;Client is immunologically stable&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="304" locator="113:3-113:46" name="Client is immunologically stable" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="307" locator="121:1-122:50" name="Client is not immunologically stable" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client is not immunologically stable"/>
            <a:t name="pseudocode" value="&quot;Immunologically stable&quot; = FALSE"/>
            <a:t name="code" value="Client is not immunologically stable-32"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="307">
               <a:s>/*
@input: Client is not immunologically stable
@pseudocode: &quot;Immunologically stable&quot; = FALSE
@code: Client is not immunologically stable-32
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client is not immunologically stable&quot;:
  </a:s>
               <a:s r="309">
                  <a:s r="308">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="309">
                     <a:s>&quot;Client is not immunologically stable&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="309" locator="122:3-122:50" name="Client is not immunologically stable" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="312" locator="130:1-131:70" name="Client is currently not receiving antiretroviral therapy" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client is currently not receiving antiretroviral therapy"/>
            <a:t name="pseudocode" value="&quot;Currently on ART&quot; = FALSE"/>
            <a:t name="code" value="Client is currently not receiving antiretroviral therapy-26"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="312">
               <a:s>/*
@input: Client is currently not receiving antiretroviral therapy
@pseudocode: &quot;Currently on ART&quot; = FALSE
@code: Client is currently not receiving antiretroviral therapy-26
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client is currently not receiving antiretroviral therapy&quot;:
  </a:s>
               <a:s r="314">
                  <a:s r="313">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="314">
                     <a:s>&quot;Client is currently not receiving antiretroviral therapy&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="314" locator="131:3-131:70" name="Client is currently not receiving antiretroviral therapy" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="317" locator="139:1-141:50" name="Client's age is between 28 days and 5 years" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's age is between 28 days and 5 years"/>
            <a:t name="pseudocode" value="&quot;Date of birth&quot; &lt; 5 years"/>
            <a:t name="code" value="Client's age is between 28 days and 5 years-50"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="317">
               <a:s>/*
@input: Client's age is between 28 days and 5 years
@pseudocode: 28 days &lt; Today's date − &quot;Date of birth&quot; &lt; 5 years
@code: Client's age is between 28 days and 5 years-50
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client's age is between 28 days and 5 years&quot;:
  </a:s>
               <a:s r="318">
                  <a:s r="319">
                     <a:s r="320">28 &lt; </a:s>
                     <a:s r="322">
                        <a:s r="321">
                           <a:s>Encounter</a:s>
                        </a:s>
                        <a:s>.</a:s>
                        <a:s r="322">
                           <a:s>&quot;Current Patient Age In Days&quot;</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
                  <a:s>
  and </a:s>
                  <a:s r="325">
                     <a:s r="327">
                        <a:s r="326">
                           <a:s>Encounter</a:s>
                        </a:s>
                        <a:s>.</a:s>
                        <a:s r="327">
                           <a:s>&quot;Current Patient Age In Years&quot;</a:s>
                        </a:s>
                     </a:s>
                     <a:s r="328"> &lt; 5</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="318" locator="140:3-141:50" xsi:type="And">
            <operand localId="319" locator="140:3-140:46" xsi:type="Less">
               <signature localId="323" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <signature localId="324" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <operand localId="320" locator="140:3-140:4" valueType="t:Integer" value="28" xsi:type="Literal"/>
               <operand localId="322" locator="140:8-140:46" name="Current Patient Age In Days" libraryName="Encounter" xsi:type="ExpressionRef"/>
            </operand>
            <operand localId="325" locator="141:7-141:50" xsi:type="Less">
               <signature localId="329" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <signature localId="330" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
               <operand localId="327" locator="141:7-141:46" name="Current Patient Age In Years" libraryName="Encounter" xsi:type="ExpressionRef"/>
               <operand localId="328" locator="141:50" valueType="t:Integer" value="5" xsi:type="Literal"/>
            </operand>
         </expression>
      </def>
      <def localId="333" locator="149:1-150:59" name="Client's TB infection test result is negative" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's TB infection test result is negative"/>
            <a:t name="pseudocode" value="&quot;TB infection test result&quot; = &quot;Negative&quot;"/>
            <a:t name="code" value="Client's TB infection test result is negative-39"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="333">
               <a:s>/*
@input: Client's TB infection test result is negative
@pseudocode: &quot;TB infection test result&quot; = &quot;Negative&quot;
@code: Client's TB infection test result is negative-39
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client's TB infection test result is negative&quot;:
  </a:s>
               <a:s r="335">
                  <a:s r="334">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="335">
                     <a:s>&quot;Client's TB infection test result is negative&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="335" locator="150:3-150:59" name="Client's TB infection test result is negative" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="338" locator="158:1-159:66" name="No live vaccine was administered in the last four weeks" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="No live vaccine was administered in the last four weeks"/>
            <a:t name="pseudocode" value="&quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE) ≥ 4 weeks"/>
            <a:t name="code" value="No live vaccine was administered in the last four weeks-92"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="338">
               <a:s>/*
@input: No live vaccine was administered in the last four weeks
@pseudocode: Today's date − latest &quot;Date and time of vaccination&quot; (where &quot;Live vaccine&quot; = TRUE) ≥ 4 weeks
@code: No live vaccine was administered in the last four weeks-92
@decision: IMMZ.D2.DT.BCG
*/
define &quot;No live vaccine was administered in the last four weeks&quot;:
  </a:s>
               <a:s r="340">
                  <a:s r="339">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="340">
                     <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="340" locator="159:3-159:66" name="No live vaccine was administered in the last 4 weeks" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="343" locator="167:1-168:91" name="Client's TB infection test result is unknown (test not done or no result yet)" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's TB infection test result is unknown (test not done or no result yet)"/>
            <a:t name="pseudocode" value="&quot;TB infection test result&quot; IS NULL"/>
            <a:t name="code" value="Client's TB infection test result is unknown (test not done or no result yet)-34"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="343">
               <a:s>/*
@input: Client's TB infection test result is unknown (test not done or no result yet)
@pseudocode: &quot;TB infection test result&quot; IS NULL
@code: Client's TB infection test result is unknown (test not done or no result yet)-34
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client's TB infection test result is unknown (test not done or no result yet)&quot;:
  </a:s>
               <a:s r="345">
                  <a:s r="344">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="345">
                     <a:s>&quot;Client's TB infection test result is unknown (test not done or no result yet)&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="345" locator="168:3-168:91" name="Client's TB infection test result is unknown (test not done or no result yet)" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="348" locator="176:1-177:59" name="Client's TB infection test result is positive" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's TB infection test result is positive"/>
            <a:t name="pseudocode" value="&quot;TB infection test result&quot; = &quot;Positive&quot;"/>
            <a:t name="code" value="Client's TB infection test result is positive-39"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="348">
               <a:s>/*
@input: Client's TB infection test result is positive
@pseudocode: &quot;TB infection test result&quot; = &quot;Positive&quot;
@code: Client's TB infection test result is positive-39
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client's TB infection test result is positive&quot;:
  </a:s>
               <a:s r="350">
                  <a:s r="349">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="350">
                     <a:s>&quot;Client's TB infection test result is positive&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="350" locator="177:3-177:59" name="Client's TB infection test result is positive" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="353" locator="185:1-186:43" name="Client is not clinically well" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client is not clinically well"/>
            <a:t name="pseudocode" value="&quot;Clinically well&quot; = FALSE"/>
            <a:t name="code" value="Client is not clinically well-25"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="353">
               <a:s>/*
@input: Client is not clinically well
@pseudocode: &quot;Clinically well&quot; = FALSE
@code: Client is not clinically well-25
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client is not clinically well&quot;:
  </a:s>
               <a:s r="355">
                  <a:s r="354">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="355">
                     <a:s>&quot;Client is not clinically well&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="355" locator="186:3-186:43" name="Client is not clinically well" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="358" locator="194:1-195:39" name="Client is clinically well" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client is clinically well"/>
            <a:t name="pseudocode" value="&quot;Clinically well&quot; = TRUE"/>
            <a:t name="code" value="Client is clinically well-24"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="358">
               <a:s>/*
@input: Client is clinically well
@pseudocode: &quot;Clinically well&quot; = TRUE
@code: Client is clinically well-24
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client is clinically well&quot;:
  </a:s>
               <a:s r="360">
                  <a:s r="359">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="360">
                     <a:s>&quot;Client is clinically well&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="360" locator="195:3-195:39" name="Client is clinically well" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="363" locator="203:1-204:47" name="Client's age is more than 5 years" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="Client's age is more than 5 years"/>
            <a:t name="pseudocode" value="&quot;Date of birth&quot; ≥ 5 years"/>
            <a:t name="code" value="Client's age is more than 5 years-40"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="363">
               <a:s>/*
@input: Client's age is more than 5 years
@pseudocode: Today's date − &quot;Date of birth&quot; ≥ 5 years
@code: Client's age is more than 5 years-40
@decision: IMMZ.D2.DT.BCG
*/
define &quot;Client's age is more than 5 years&quot;:
  </a:s>
               <a:s r="364">
                  <a:s r="366">
                     <a:s r="365">
                        <a:s>Encounter</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="366">
                        <a:s>&quot;Current Patient Age In Years&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="367"> >= 5</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="364" locator="204:3-204:47" xsi:type="GreaterOrEqual">
            <signature localId="368" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="369" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="366" locator="204:3-204:42" name="Current Patient Age In Years" libraryName="Encounter" xsi:type="ExpressionRef"/>
            <operand localId="367" locator="204:47" valueType="t:Integer" value="5" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="372" locator="212:1-213:55" name="One BCG primary series dose was administered" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="One BCG primary series dose was administered"/>
            <a:t name="pseudocode" value="&quot;Vaccine type&quot; = &quot;BCG vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 1"/>
            <a:t name="code" value="One BCG primary series dose was administered-112"/>
            <a:t name="decision" value="IMMZ.D2.DT.BCG"/>
            <a:s r="372">
               <a:s>/*
@input: One BCG primary series dose was administered
@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;BCG vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) = 1
@code: One BCG primary series dose was administered-112
@decision: IMMZ.D2.DT.BCG
*/
define &quot;One BCG primary series dose was administered&quot;:
  </a:s>
               <a:s r="373">
                  <a:s r="374">
                     <a:s>&quot;Number of BCG Primary Series Doses Administered&quot;</a:s>
                  </a:s>
                  <a:s r="375"> = 1</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="373" locator="213:3-213:55" xsi:type="Equal">
            <signature localId="376" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <signature localId="377" name="t:Integer" xsi:type="NamedTypeSpecifier"/>
            <operand localId="374" locator="213:3-213:51" name="Number of BCG Primary Series Doses Administered" xsi:type="ExpressionRef"/>
            <operand localId="375" locator="213:55" valueType="t:Integer" value="1" xsi:type="Literal"/>
         </expression>
      </def>
   </statements>
</library>
