<?xml version='1.0' encoding='UTF-8'?>
<Library xmlns="http://hl7.org/fhir" xmlns:html="http://www.w3.org/1999/xhtml">
  <id value="IMMZIND44Logic" />
  <meta>
    <profile value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary" />
    <profile value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary" />
    <profile value="http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library" />
    <profile value="http://hl7.org/fhir/uv/cql/StructureDefinition/cql-module" />
  </meta>
  <text>
    <status value="extensions" /><html:div>
<html:div>
    <html:table class="grid dict">
        
        
        <html:tr>
            <html:th scope="row"><html:b>Title: </html:b></html:th>
            <html:td style="padding-left: 4px;">IMMZIND44Logic</html:td>
        </html:tr>
        

        
        
        <html:tr>
            <html:th scope="row"><html:b>Id: </html:b></html:th>
            <html:td style="padding-left: 4px;">IMMZIND44Logic</html:td>
        </html:tr>
        

        
        
        <html:tr>
            <html:th scope="row"><html:b>Version: </html:b></html:th>
            <html:td style="padding-left: 4px;">0.2.0</html:td>
        </html:tr>
        

        
        <html:tr>
            <html:th scope="row"><html:b>Url: </html:b></html:th>
            <html:td style="padding-left: 4px;"><html:a href="Library-IMMZIND44Logic.html">IMMZIND44Logic</html:a></html:td>
        </html:tr>
        

        

        

        
        <html:tr>
            <html:th scope="row"><html:b>Status: </html:b></html:th>
            <html:td style="padding-left: 4px;">draft</html:td>
        </html:tr>
        

        

        
        <html:tr>
            <html:th scope="row"><html:b>Type: </html:b></html:th>
            <html:td style="padding-left: 4px;">
                
                    
                        
                        <html:p style="margin-bottom: 5px;">
                            <html:b>system: </html:b> <html:span><html:a href="http://terminology.hl7.org/7.1.0/CodeSystem-library-type.html">http://terminology.hl7.org/CodeSystem/library-type</html:a></html:span>
                        </html:p>
                        
                        
                        <html:p style="margin-bottom: 5px;">
                            <html:b>code: </html:b> <html:span>logic-library</html:span>
                        </html:p>
                        
                        
                    
                
                
            </html:td>
        </html:tr>
        

        

        
        <html:tr>
            <html:th scope="row"><html:b>Date: </html:b></html:th>
            <html:td style="padding-left: 4px;">2026-03-29 17:23:09+0000</html:td>
        </html:tr>
        

        
        <html:tr>
            <html:th scope="row"><html:b>Publisher: </html:b></html:th>
            <html:td style="padding-left: 4px;">WHO</html:td>
        </html:tr>
        

        
        <html:tr>
            <html:th scope="row"><html:b>Description: </html:b></html:th>
            <html:td style="padding-left: 4px;"><html:div><html:p>This library defines population criteria logic for the IMMZ.IND.44 indicator in the Immunization CPG</html:p>
</html:div></html:td>
        </html:tr>
        

        

        

        

        

        

        

        

        

        

        

        
        <html:tr>
            <html:th scope="row"><html:b>Related Artifacts: </html:b></html:th>
            <html:td style="padding-left: 4px;">
                
                
                
                <html:p><html:b>Dependencies</html:b></html:p>
                <html:ul>
                  
                    <html:li><html:a href="Library-WHOCommon.html">WHOCommon</html:a></html:li>
                  
                    <html:li><html:a href="Library-IMMZCommon.html">IMMZCommon</html:a></html:li>
                  
                    <html:li><html:a href="Library-IMMZConcepts.html">IMMZConcepts</html:a></html:li>
                  
                    <html:li><html:code>http://smart.who.int/immunizations/Library/IMMZIndicatorElements</html:code></html:li>
                  
                </html:ul>
                
                
                
                
                
            </html:td>
        </html:tr>
        

        
        <html:tr>
          <html:th scope="row"><html:b>Parameters: </html:b></html:th>
          <html:td style="padding-left: 4px;">
            <html:table class="grid-dict">
              <html:tr><html:th><html:b>Name</html:b></html:th><html:th><html:b>Type</html:b></html:th><html:th><html:b>Min</html:b></html:th><html:th><html:b>Max</html:b></html:th><html:th><html:b>In/Out</html:b></html:th></html:tr>
              
                <html:tr><html:th>Measurement Period</html:th><html:th>Period</html:th><html:th>0</html:th><html:th>1</html:th><html:th>In</html:th></html:tr>
              
                <html:tr><html:th>Immunization</html:th><html:th>Immunization</html:th><html:th>0</html:th><html:th>1</html:th><html:th>Out</html:th></html:tr>
              
                <html:tr><html:th>Initial Population</html:th><html:th>boolean</html:th><html:th>0</html:th><html:th>1</html:th><html:th>Out</html:th></html:tr>
              
                <html:tr><html:th>Denominator</html:th><html:th>boolean</html:th><html:th>0</html:th><html:th>1</html:th><html:th>Out</html:th></html:tr>
              
                <html:tr><html:th>Numerator</html:th><html:th>boolean</html:th><html:th>0</html:th><html:th>1</html:th><html:th>Out</html:th></html:tr>
              
                <html:tr><html:th>Stratification 1</html:th><html:th>Coding</html:th><html:th>0</html:th><html:th>1</html:th><html:th>Out</html:th></html:tr>
              
                <html:tr><html:th>Stratification 2</html:th><html:th>Reference</html:th><html:th>0</html:th><html:th>1</html:th><html:th>Out</html:th></html:tr>
              
                <html:tr><html:th>Stratification 3</html:th><html:th>Coding</html:th><html:th>0</html:th><html:th>1</html:th><html:th>Out</html:th></html:tr>
              
                <html:tr><html:th>Stratification 4</html:th><html:th>string</html:th><html:th>0</html:th><html:th>1</html:th><html:th>Out</html:th></html:tr>
              
                <html:tr><html:th>Stratification 5</html:th><html:th>Coding</html:th><html:th>0</html:th><html:th>1</html:th><html:th>Out</html:th></html:tr>
              
            </html:table>
          </html:td>
        </html:tr>
        

        

        
        
        <html:tr>
          <html:td colspan="2">
            <html:table>
              <html:tr><html:th><html:a id="cql-content"><html:b>Content: </html:b></html:a> text/cql</html:th></html:tr>
              <html:tr><html:td><html:pre><html:code class="language-cql">/*
 * Library: IMMZ.IND.44 Logic
 * Adverse event following immunization (AEFI) cases
 * The total number of adverse events following the administration of vaccines during the reporting period
 * 
 * Numerator: Number of AEFI cases during the reporting period
 * Numerator Computation: COUNT of immunization events WHERE "Reaction reported" is "Yes" AND "Date and time of vaccination" is during the reporting period
 * Denominator: Not applicable
 * Denominator Computation: Not applicable
 * 
 * Disaggregation
 *  - Vaccine type: BCG, OPV, etc.
 *  - Vaccine manufacturer
 *  - Type of reaction: non-serious, disability, etc.
 *  - Administrative area
 *  - Reaction manifestation: rash, vomiting, etc.
 *
 * References: WHO Immunization facility analysis guide (5)
 * 
 * Annotations: –
 */
library IMMZIND44Logic

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'

include WHOCommon called WC

include IMMZCommon called Common
include IMMZConcepts called Concepts
include IMMZIndicatorElements called Elements


parameter "Measurement Period" Interval&lt;Date&gt; default Interval[@2025-01-01, @2025-12-31]

context Immunization

/*
 * As defined by Member State
 */
define "Initial Population":
  true

/*
@denominator: Not applicable
@pseudocode: Not applicable
*/
define "Denominator":
  true

/*
@numerator: Number of AEFI cases during the reporting period
@pseudocode: COUNT of immunization events WHERE "Reaction reported" is "Yes" AND "Date and time of vaccination" is during the reporting period
*/
define "Numerator":
  exists Elements."Adverse Events for Immunization"

/*
@disaggregation: Vaccine type: BCG, OPV, etc.
                 Vaccine manufacturer
                 Type of reaction: non-serious, disability, etc.
                 Administrative area
                 Reaction manifestation: rash, vomiting, etc.
*/
define "Stratification 1":
  First( Immunization.vaccineCode.coding )

define "Stratification 2":
  Immunization.manufacturer

define "Stratification 3":
  First( First (Elements."Adverse Events for Immunization" ).seriousness.coding )

define "Stratification 4":
  Elements.GetGeographicRegionForImmunization( Immunization )

define "Stratification 5":
  First( First (Elements."Adverse Events for Immunization" ).event.coding )  
/*
define "Stratification 1":
	Elements."By Geographic Region Stratifier"

define "Stratification 2":
	Elements."By Administrative Gender Stratifier"

define "Stratification 3":
	Elements."Age Stratifier"

define "Stratification 4":
	Elements."By Age Group Stratifier"
*/</html:code></html:pre></html:td></html:tr>
            </html:table>
          </html:td>
        </html:tr>
        
        
        
        
        
        <html:tr>
          <html:td colspan="2">
            <html:table>
              <html:tr><html:th><html:b>Content: </html:b> application/elm+xml</html:th></html:tr>
              <html:tr><html:td><html:pre><html:code>Encoded data (24356 characters)</html:code></html:pre></html:td></html:tr>
            </html:table>
          </html:td>
        </html:tr>
        
        
    </html:table>
</html:div>
</html:div>
  </text>
  <extension url="http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability">
    <valueCode value="computable" />
  </extension>
  <url value="http://smart.who.int/immunizations/Library/IMMZIND44Logic" />
  <version value="0.2.0" />
  <name value="IMMZIND44Logic" />
  <title value="IMMZIND44Logic" />
  <status value="draft" />
  <experimental value="false" />
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/library-type" />
      <code value="logic-library" />
    </coding>
  </type>
  <date value="2026-03-29T17:23:09+00:00" />
  <publisher value="WHO" />
  <contact>
    <name value="WHO" />
    <telecom>
      <system value="url" />
      <value value="http://who.int" />
    </telecom>
  </contact>
  <description value="This library defines population criteria logic for the IMMZ.IND.44 indicator in the Immunization CPG" />
  <relatedArtifact>
    <type value="depends-on" />
    <display value="Library WC" />
    <resource value="http://smart.who.int/immunizations/Library/WHOCommon" />
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on" />
    <display value="Library Common" />
    <resource value="http://smart.who.int/immunizations/Library/IMMZCommon" />
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on" />
    <display value="Library Concepts" />
    <resource value="http://smart.who.int/immunizations/Library/IMMZConcepts" />
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on" />
    <display value="Library Elements" />
    <resource value="http://smart.who.int/immunizations/Library/IMMZIndicatorElements" />
  </relatedArtifact>
  <parameter>
    <name value="Measurement Period" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <type value="Period" />
  </parameter>
  <parameter>
    <name value="Immunization" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <type value="Immunization" />
  </parameter>
  <parameter>
    <name value="Initial Population" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <type value="boolean" />
  </parameter>
  <parameter>
    <name value="Denominator" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <type value="boolean" />
  </parameter>
  <parameter>
    <name value="Numerator" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <type value="boolean" />
  </parameter>
  <parameter>
    <name value="Stratification 1" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <type value="Coding" />
  </parameter>
  <parameter>
    <name value="Stratification 2" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <type value="Reference" />
  </parameter>
  <parameter>
    <name value="Stratification 3" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <type value="Coding" />
  </parameter>
  <parameter>
    <name value="Stratification 4" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <type value="string" />
  </parameter>
  <parameter>
    <name value="Stratification 5" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <type value="Coding" />
  </parameter>
  <content>
    <contentType value="text/cql" />
    <url value="Library-IMMZIND44Logic.cql" /></content>
  <content>
    <contentType value="application/elm+xml" />
    <url value="Library-IMMZIND44Logic.elm.xml" /></content>
</Library>