<?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="274">
         <a:s>/*
 * Library: IMMZ.IND.04 Logic
 * Immunization coverage for pentavalent vaccine, 3rd dose
 * The percentage in the target population who have received a 3rd dose of pentavalent vaccine during the reporting period
 * 
 * Numerator: Number of pentavalent doses (3rd dose) administered through routine services during the reporting period
 * Numerator Computation: COUNT of immunization events WHERE &quot;Vaccine type&quot; = &quot;Pentavalent vaccines&quot; for the 3rd dose in the primary series AND &quot;Date and time of vaccination&quot; is during the reporting period
 * Denominator: Number in target group
 * Denominator Computation: As defined by the Member States
 * 
 * Disaggregation
 *  - Administrative area
 *  - Sex
 *  - Age in years
 *  - Age group (depending on schedule)
 *
 * References: WHO Immunization facility analysis guide (5)
 *   WHO Handbook on immunization data (6)
 * 
 * Annotations: –
 */
library IMMZIND04Logic</a:s>
      </a:s>
   </annotation>
   <identifier id="IMMZIND04Logic" 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="24:1-24: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="26:1-26: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="28:1-28:27" localIdentifier="WC" path="http://smart.who.int/immunizations/WHOCommon">
         <annotation xsi:type="a:Annotation">
            <a:s r="210">
               <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="212" locator="30:1-30:32" localIdentifier="Common" path="http://smart.who.int/immunizations/IMMZCommon">
         <annotation xsi:type="a:Annotation">
            <a:s r="212">
               <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="214" locator="31:1-31:36" localIdentifier="Concepts" path="http://smart.who.int/immunizations/IMMZConcepts">
         <annotation xsi:type="a:Annotation">
            <a:s r="214">
               <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="216" locator="32:1-32:45" localIdentifier="Elements" path="http://smart.who.int/immunizations/IMMZIndicatorElements">
         <annotation xsi:type="a:Annotation">
            <a:s r="216">
               <a:s>include </a:s>
               <a:s>
                  <a:s>IMMZIndicatorElements</a:s>
               </a:s>
               <a:s> called Elements</a:s>
            </a:s>
         </annotation>
      </def>
   </includes>
   <parameters>
      <def localId="218" locator="35:1-35:88" name="Measurement Period" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="218">
               <a:s>parameter &quot;Measurement Period&quot; </a:s>
               <a:s r="230">
                  <a:s>Interval&lt;</a:s>
                  <a:s r="231">
                     <a:s>Date</a:s>
                  </a:s>
                  <a:s>></a:s>
               </a:s>
               <a:s> default </a:s>
               <a:s r="229">
                  <a:s r="223">Interval[@2025-01-01, @2025-12-31]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <default localId="229" locator="35:55-35:88" lowClosed="true" highClosed="true" xsi:type="Interval">
            <low localId="223" locator="35:64-35:74" xsi:type="Date">
               <year localId="220" valueType="t:Integer" value="2025" xsi:type="Literal"/>
               <month localId="221" valueType="t:Integer" value="1" xsi:type="Literal"/>
               <day localId="222" valueType="t:Integer" value="1" xsi:type="Literal"/>
            </low>
            <high localId="228" locator="35:77-35:87" xsi:type="Date">
               <year localId="225" valueType="t:Integer" value="2025" xsi:type="Literal"/>
               <month localId="226" valueType="t:Integer" value="12" xsi:type="Literal"/>
               <day localId="227" valueType="t:Integer" value="31" xsi:type="Literal"/>
            </high>
         </default>
         <parameterTypeSpecifier localId="230" locator="35:32-35:45" xsi:type="IntervalTypeSpecifier">
            <pointType localId="231" locator="35:41-35:44" name="t:Date" xsi:type="NamedTypeSpecifier"/>
         </parameterTypeSpecifier>
      </def>
   </parameters>
   <contexts>
      <def localId="236" locator="37:1-37:15" name="Patient"/>
   </contexts>
   <statements>
      <def localId="234" locator="37:1-37:15" name="Patient" context="Patient">
         <expression localId="235" xsi:type="SingletonFrom">
            <operand localId="233" locator="37:1-37:15" dataType="fhir:Patient" templateId="http://hl7.org/fhir/StructureDefinition/Patient" xsi:type="Retrieve"/>
         </expression>
      </def>
      <def localId="239" locator="42:1-43:6" name="Initial Population" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="239">
               <a:s r="240">/*
 * As defined by Member State
 */
define &quot;Initial Population&quot;:
  true</a:s>
            </a:s>
         </annotation>
         <expression localId="240" locator="43:3-43:6" valueType="t:Boolean" value="true" xsi:type="Literal"/>
      </def>
      <def localId="243" locator="49:1-50:6" name="Denominator" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="denominator" value="Number in target group"/>
            <a:t name="pseudocode" value="As defined by the Member States"/>
            <a:s r="243">
               <a:s r="244">/*
@denominator: Number in target group
@pseudocode: As defined by the Member States
*/
define &quot;Denominator&quot;:
  true</a:s>
            </a:s>
         </annotation>
         <expression localId="244" locator="50:3-50:6" valueType="t:Boolean" value="true" xsi:type="Literal"/>
      </def>
      <def localId="247" locator="56:1-57:103" name="Numerator" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="numerator" value="Number of pentavalent doses (3rd dose) administered through routine services during the reporting period"/>
            <a:t name="pseudocode" value="&quot;Vaccine type&quot; = &quot;Pentavalent vaccines&quot; for the 3rd dose in the primary series AND &quot;Date and time of vaccination&quot; is during the reporting period"/>
            <a:s r="247">
               <a:s>/*
@numerator: Number of pentavalent doses (3rd dose) administered through routine services during the reporting period
@pseudocode: COUNT of immunization events WHERE &quot;Vaccine type&quot; = &quot;Pentavalent vaccines&quot; for the 3rd dose in the primary series AND &quot;Date and time of vaccination&quot; is during the reporting period
*/
define &quot;Numerator&quot;:
  </a:s>
               <a:s r="248">
                  <a:s>exists</a:s>
                  <a:s r="253">
                     <a:s>( </a:s>
                     <a:s r="253">
                        <a:s r="250">
                           <a:s r="249">
                              <a:s>Elements</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="250">
                              <a:s>&quot;Pentavalent Doses Administered to Patient During Measurement Period&quot;</a:s>
                           </a:s>
                        </a:s>
                        <a:s>.</a:s>
                        <a:s r="253">
                           <a:s>getDose(</a:s>
                           <a:s r="251">
                              <a:s>'3'</a:s>
                           </a:s>
                           <a:s>)</a:s>
                        </a:s>
                     </a:s>
                     <a:s> )</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="248" locator="57:3-57:103" xsi:type="Exists">
            <operand localId="253" locator="57:9-57:103" name="getDose" libraryName="Common" xsi:type="FunctionRef">
               <signature localId="254" xsi:type="ListTypeSpecifier">
                  <elementType localId="255" name="fhir:Immunization" xsi:type="NamedTypeSpecifier"/>
               </signature>
               <signature localId="256" name="t:String" xsi:type="NamedTypeSpecifier"/>
               <operand localId="250" locator="57:11-57:88" name="Pentavalent Doses Administered to Patient During Measurement Period" libraryName="Elements" xsi:type="ExpressionRef"/>
               <operand localId="251" locator="57:98-57:100" valueType="t:String" value="3" xsi:type="Literal"/>
            </operand>
         </expression>
      </def>
      <def localId="259" locator="65:1-66:43" name="Stratification 1" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="disaggregation" value="Administrative area&#xa;                 Sex&#xa;                 Age in years&#xa;                 Age group (depending on schedule)"/>
            <a:s r="259">
               <a:s>/*
@disaggregation: Administrative area
                 Sex
                 Age in years
                 Age group (depending on schedule)
*/
define &quot;Stratification 1&quot;:
	</a:s>
               <a:s r="261">
                  <a:s r="260">
                     <a:s>Elements</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="261">
                     <a:s>&quot;By Geographic Region Stratifier&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="261" locator="66:2-66:43" name="By Geographic Region Stratifier" libraryName="Elements" xsi:type="ExpressionRef"/>
      </def>
      <def localId="264" locator="68:1-69:47" name="Stratification 2" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="264">
               <a:s>define &quot;Stratification 2&quot;:
	</a:s>
               <a:s r="266">
                  <a:s r="265">
                     <a:s>Elements</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="266">
                     <a:s>&quot;By Administrative Gender Stratifier&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="266" locator="69:2-69:47" name="By Administrative Gender Stratifier" libraryName="Elements" xsi:type="ExpressionRef"/>
      </def>
      <def localId="269" locator="71:1-72:26" name="Stratification 3" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="269">
               <a:s>define &quot;Stratification 3&quot;:
	</a:s>
               <a:s r="271">
                  <a:s r="270">
                     <a:s>Elements</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="271">
                     <a:s>&quot;Age Stratifier&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="271" locator="72:2-72:26" name="Age Stratifier" libraryName="Elements" xsi:type="ExpressionRef"/>
      </def>
      <def localId="274" locator="74:1-75:36" name="Stratification 4" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="274">
               <a:s>define &quot;Stratification 4&quot;:
	</a:s>
               <a:s r="276">
                  <a:s r="275">
                     <a:s>Elements</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="276">
                     <a:s>&quot;Infant By Age Stratifier&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="276" locator="75:2-75:36" name="Infant By Age Stratifier" libraryName="Elements" xsi:type="ExpressionRef"/>
      </def>
   </statements>
</library>
