WHO Immunization Implementation Guide
1.0.0 - release

WHO Immunization Implementation Guide, published by WHO. This guide is not an authorized publication; it is the continuous build for version 1.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/WorldHealthOrganization/smart-immunizations/tree/132/merge and changes regularly. See the Directory of published versions

: IMMZD18SMeaslesSupplementaryDoseLogic - XML Representation

Draft as of 2026-03-31

Raw xml | Download


<Library xmlns="http://hl7.org/fhir">
  <id value="IMMZD18SMeaslesSupplementaryDoseLogic"/>
  <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"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
<div>
    <table class="grid dict">
        
        
        <tr>
            <th scope="row"><b>Title: </b></th>
            <td style="padding-left: 4px;">IMMZD18SMeaslesSupplementaryDoseLogic</td>
        </tr>
        

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

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

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

        

        

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

        

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

        

        
        <tr>
            <th scope="row"><b>Date: </b></th>
            <td style="padding-left: 4px;">2026-03-31 13:54:17+0000</td>
        </tr>
        

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

        
        <tr>
            <th scope="row"><b>Description: </b></th>
            <td style="padding-left: 4px;"><div><p>This library defines decision support logic for the IMMZ.D18.S.Measles.Supplementary dose schedule table in the Immunization CPG</p>
</div></td>
        </tr>
        

        

        

        

        

        

        

        

        

        

        

        
        <tr>
            <th scope="row"><b>Related Artifacts: </b></th>
            <td style="padding-left: 4px;">
                
                
                
                <p><b>Dependencies</b></p>
                <ul>
                  
                    <li><a href="Library-WHOCommon.html">WHOCommon</a></li>
                  
                    <li><a href="Library-IMMZCommon.html">IMMZCommon</a></li>
                  
                    <li><a href="Library-IMMZConcepts.html">IMMZConcepts</a></li>
                  
                    <li><a href="Library-IMMZEncounterElements.html">IMMZEncounterElements</a></li>
                  
                    <li><a href="Library-IMMZD2DTMeaslesEncounterElements.html">IMMZD2DTMeaslesEncounterElements</a></li>
                  
                </ul>
                
                
                
                
                
            </td>
        </tr>
        

        
        <tr>
          <th scope="row"><b>Parameters: </b></th>
          <td style="padding-left: 4px;">
            <table class="grid-dict">
              <tr><th><b>Name</b></th><th><b>Type</b></th><th><b>Min</b></th><th><b>Max</b></th><th><b>In/Out</b></th></tr>
              
                <tr><th>Today</th><th>date</th><th>0</th><th>1</th><th>In</th></tr>
              
                <tr><th>Patient</th><th>Patient</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>MCV supplementary dose was administered</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>Measles-containing vaccine (MCV) supplementary dose</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>Measles-containing vaccine (MCV) supplementary dose Due Date</th><th>date</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>Measles-containing vaccine (MCV) supplementary dose Create</th><th>string</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>Measles-containing vaccine (MCV) supplementary dose Overdue</th><th>Resource</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>Measles-containing vaccine (MCV) supplementary dose Expiration</th><th>Resource</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>Test Validation</th><th>Resource</th><th>0</th><th>1</th><th>Out</th></tr>
              
            </table>
          </td>
        </tr>
        

        

        
        
        <tr>
          <td colspan="2">
            <table>
              <tr><th><a id="cql-content"><b>Content: </b></a> text/cql</th></tr>
              <tr><td><pre><code class="language-cql">/*
 * Library: IMMZD18SMeaslesSupplementaryDoseLogic (IMMZ.D18.S.Measles.Supplementary dose schedule)
 * Schedule Table: Measles supplementary dose schedule
 */
library IMMZD18SMeaslesSupplementaryDoseLogic

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 IMMZEncounterElements called IE
include IMMZD2DTMeaslesEncounterElements called Encounter

parameter Today Date default Today()


context Patient


/*
@output: Measles-containing vaccine (MCV) supplementary dose
@description: Provision of a MCV supplementary dose
@trigger: Routine measles immunization schedule is complete
@pseudo: &quot;Completed the primary vaccination series&quot; = TRUE (where &quot;Vaccine type&quot; = &quot;Measles-containing vaccines&quot;) AND Member States defined logic for supplementary dose applied
@triggerDate: &quot;Date when the primary vaccination series was completed&quot;
*/
define &quot;Measles-containing vaccine (MCV) supplementary dose&quot;:
  not &quot;MCV supplementary dose was administered&quot; and Encounter.&quot;Measles routine immunization schedule is complete&quot;


/*
@output: Measles-containing vaccine (MCV) supplementary dose Create
@create: Child is due for a MCV supplementary dose if child is HIV-positive, on antiretroviral therapy (ART) and immune reconstitution has been achieved.
*/
define &quot;Measles-containing vaccine (MCV) supplementary dose Create&quot;:
  if &quot;Measles-containing vaccine (MCV) supplementary dose&quot;
  then 'Child is due for a MCV supplementary dose if child is HIV-positive, on antiretroviral therapy (ART) and immune reconstitution has been achieved.' + '
Due Date: ' + ToString(&quot;Measles-containing vaccine (MCV) supplementary dose Due Date&quot;)
  else ''


/*
@dynamicValue: Measles-containing vaccine (MCV) supplementary dose Due Date
@pseudocode: &quot;Date when the primary vaccination series completed&quot; + 4 weeks
*/
define &quot;Measles-containing vaccine (MCV) supplementary dose Due Date&quot;:
  if &quot;Measles-containing vaccine (MCV) supplementary dose&quot; then Encounter.&quot;Date when the primary vaccination series completed&quot; + 4 weeks
  else null


/*
@dynamicValue: Measles-containing vaccine (MCV) supplementary dose Overdue
@pseudocode: To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated.
*/
define &quot;Measles-containing vaccine (MCV) supplementary dose Overdue&quot;:
  null


/*
@dynamicValue: Measles-containing vaccine (MCV) supplementary dose Expiration
@pseudocode: To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated.
*/
define &quot;Measles-containing vaccine (MCV) supplementary dose Expiration&quot;:
  null

  
/*
@complete: MCV supplementary dose was administered
@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Measles-containing vaccines&quot; and &quot;Type of dose&quot; = &quot;Supplementary dose&quot;) = 1
*/
define &quot;MCV supplementary dose was administered&quot;:
  Encounter.&quot;Measles supplementary dose was administered&quot;



/*
@test: Test expected results based on example patients
*/
define &quot;Test Validation&quot;:
  case
    when Patient.id = 'Measles48.3' then &quot;Measles-containing vaccine (MCV) supplementary dose&quot; 
    when Patient.id = 'Measles49.3' then &quot;Measles-containing vaccine (MCV) supplementary dose&quot; 
    when Patient.id = 'Measles50.1' then &quot;MCV supplementary dose was administered&quot; 
    else 'No test case set'
  end
</code></pre></td></tr>
            </table>
          </td>
        </tr>
        
        
        
    </table>
</div>
</div>
  </text>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-knowledgeCapability">
    <valueCode value="computable"/>
  </extension>
  <url
       value="http://smart.who.int/immunizations/Library/IMMZD18SMeaslesSupplementaryDoseLogic"/>
  <version value="1.0.0"/>
  <name value="IMMZD18SMeaslesSupplementaryDoseLogic"/>
  <title value="IMMZD18SMeaslesSupplementaryDoseLogic"/>
  <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-31T13:54:17+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 decision support logic for the IMMZ.D18.S.Measles.Supplementary dose schedule table 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 IE"/>
    <resource
              value="http://smart.who.int/immunizations/Library/IMMZEncounterElements"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on"/>
    <display value="Library Encounter"/>
    <resource
              value="http://smart.who.int/immunizations/Library/IMMZD2DTMeaslesEncounterElements"/>
  </relatedArtifact>
  <parameter>
    <name value="Today"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <type value="date"/>
  </parameter>
  <parameter>
    <name value="Patient"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="Patient"/>
  </parameter>
  <parameter>
    <name value="MCV supplementary dose was administered"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="Measles-containing vaccine (MCV) supplementary dose"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name
          value="Measles-containing vaccine (MCV) supplementary dose Due Date"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="date"/>
  </parameter>
  <parameter>
    <name value="Measles-containing vaccine (MCV) supplementary dose Create"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name
          value="Measles-containing vaccine (MCV) supplementary dose Overdue"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="Resource"/>
  </parameter>
  <parameter>
    <name
          value="Measles-containing vaccine (MCV) supplementary dose Expiration"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="Resource"/>
  </parameter>
  <parameter>
    <name value="Test Validation"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="Resource"/>
  </parameter>
  <content>
    <contentType value="text/cql"/>
    <data
          value="LyoKICogTGlicmFyeTogSU1NWkQxOFNNZWFzbGVzU3VwcGxlbWVudGFyeURvc2VMb2dpYyAoSU1NWi5EMTguUy5NZWFzbGVzLlN1cHBsZW1lbnRhcnkgZG9zZSBzY2hlZHVsZSkKICogU2NoZWR1bGUgVGFibGU6IE1lYXNsZXMgc3VwcGxlbWVudGFyeSBkb3NlIHNjaGVkdWxlCiAqLwpsaWJyYXJ5IElNTVpEMThTTWVhc2xlc1N1cHBsZW1lbnRhcnlEb3NlTG9naWMKCnVzaW5nIEZISVIgdmVyc2lvbiAnNC4wLjEnCmluY2x1ZGUgRkhJUkhlbHBlcnMgdmVyc2lvbiAnNC4wLjEnCgppbmNsdWRlIFdIT0NvbW1vbiBjYWxsZWQgV0MKCmluY2x1ZGUgSU1NWkNvbW1vbiBjYWxsZ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