<?xml version="1.0" encoding="UTF-8"?>

<Library xmlns="http://hl7.org/fhir">
  <id value="IMMZD5DTYellowfeverEncounterElements"/>
  <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;">IMMZD5DTYellowfeverEncounterElements</td>
        </tr>
        

        
        
        <tr>
            <th scope="row"><b>Id: </b></th>
            <td style="padding-left: 4px;">IMMZD5DTYellowfeverEncounterElements</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-IMMZD5DTYellowfeverEncounterElements.html">IMMZD5DTYellowfeverEncounterElements</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 encounter-based elements for Yellow fever used throughout 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-WHOConcepts.html">WHOConcepts</a></li>
                  
                    <li><a href="Library-WHOCommon.html">WHOCommon</a></li>
                  
                    <li><a href="Library-WHOElements.html">WHOElements</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-IMMZD5DTYellowfeverElements.html">IMMZD5DTYellowfeverElements</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>EncounterId</th><th>string</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>Draft Medication Request for Yellow fever dose</th><th>MedicationRequest</th><th>0</th><th>*</th><th>Out</th></tr>
              
                <tr><th>Client's age is less than 6 months</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>Client's age is 6–9 months</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>Client's age is more than or equal to 60 years</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>The client has a history of severe allergic reactions</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>The client is severely immunocompromised</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>The client is currently pregnant</th><th>boolean</th><th>0</th><th>1</th><th>Out</th></tr>
              
                <tr><th>The client is lactating</th><th>boolean</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: IMMZD5DTYellowfeverEncounterElements
  */
library IMMZD5DTYellowfeverEncounterElements

using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'

include WHOConcepts
include WHOCommon called WC
include WHOElements called WE

include IMMZCommon called Common
include IMMZConcepts called Concepts
include IMMZEncounterElements called Encounter

include IMMZD5DTYellowfeverElements called YellowfeverElements

parameter Today Date default Today()
parameter EncounterId String

context Patient

/*
@internal: Draft Medication Request for Yellow fever dose
*/
define &quot;Draft Medication Request for Yellow fever dose&quot;:
  Encounter.&quot;Draft Medication Request for Patient&quot; MR
    where MR.medication in Concepts.&quot;Yellow fever vaccines&quot;

/*
@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.D5.DT.Yellow fever contraindications
*/
define &quot;Client's age is less than 6 months&quot;:
  Encounter.&quot;Current Patient Age In Months&quot; &lt; 6

/*
@input: Client's age is 6–9 months
@pseudocode: 6 months ≤ Today's date − &quot;Date of birth&quot; &lt; 9 months
@code: Client's age is 6–9 months-52
@decision: IMMZ.D5.DT.Yellow fever contraindications
*/
define &quot;Client's age is 6–9 months&quot;:
  6 &lt;= Encounter.&quot;Current Patient Age In Months&quot;
  and Encounter.&quot;Current Patient Age In Months&quot; &lt; 9

/*
@input: Client's age is more than or equal to 60 years
@pseudocode: Today's date − &quot;Date of birth&quot; ≥ 60 years
@code: Client's age is more than or equal to 60 years-41
@decision: IMMZ.D5.DT.Yellow fever contraindications
*/
define &quot;Client's age is more than or equal to 60 years&quot;:
  Encounter.&quot;Current Patient Age In Years&quot; &gt;= 60

/*
@input: The client has a history of severe allergic reactions
@pseudocode: &quot;Potential contraindications&quot; = &quot;Severe allergic reactions&quot;
@code: The client has a history of severe allergic reactions-59
@decision: IMMZ.D5.DT.Yellow fever contraindications
*/
define &quot;The client has a history of severe allergic reactions&quot;:
  Encounter.&quot;The client has history of severe allergic reactions&quot;

/*
@input: The client is severely immunocompromised
@pseudocode: &quot;Potential contraindications&quot; = &quot;Severely immunocompromised&quot;
@code: The client is severely immunocompromised-60
@decision: IMMZ.D5.DT.Yellow fever contraindications
*/
define &quot;The client is severely immunocompromised&quot;:
  Encounter.&quot;The client is severely immunocompromised&quot;

/*
@input: The client is currently pregnant
@pseudocode: &quot;Potential contraindications&quot; = &quot;Currently pregnant&quot;
@code: The client is currently pregnant-52
@decision: IMMZ.D5.DT.Yellow fever contraindications
*/
define &quot;The client is currently pregnant&quot;:
  Encounter.&quot;The client is pregnant&quot;

/*
@input: The client is lactating
@pseudocode: &quot;Potential contraindications&quot; = &quot;Breastfeeding&quot;
@code: The client is lactating-47
@decision: IMMZ.D5.DT.Yellow fever contraindications
*/
define &quot;The client is lactating&quot;:
  Encounter.&quot;The client is lactating&quot;
</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/IMMZD5DTYellowfeverEncounterElements"/>
  <version value="1.0.0"/>
  <name value="IMMZD5DTYellowfeverEncounterElements"/>
  <title value="IMMZD5DTYellowfeverEncounterElements"/>
  <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 encounter-based elements for Yellow fever used throughout the Immunization CPG"/>
  <relatedArtifact>
    <type value="depends-on"/>
    <display value="Library WHOConcepts"/>
    <resource value="http://smart.who.int/immunizations/Library/WHOConcepts"/>
  </relatedArtifact>
  <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 WE"/>
    <resource value="http://smart.who.int/immunizations/Library/WHOElements"/>
  </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 Encounter"/>
    <resource value="http://smart.who.int/immunizations/Library/IMMZEncounterElements"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on"/>
    <display value="Library YellowfeverElements"/>
    <resource value="http://smart.who.int/immunizations/Library/IMMZD5DTYellowfeverElements"/>
  </relatedArtifact>
  <parameter>
    <name value="Today"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <type value="date"/>
  </parameter>
  <parameter>
    <name value="EncounterId"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="Patient"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="Patient"/>
  </parameter>
  <parameter>
    <name value="Draft Medication Request for Yellow fever dose"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="MedicationRequest"/>
  </parameter>
  <parameter>
    <name value="Client's age is less than 6 months"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="Client's age is 6–9 months"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="Client's age is more than or equal to 60 years"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="The client has a history of severe allergic reactions"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="The client is severely immunocompromised"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="The client is currently pregnant"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="boolean"/>
  </parameter>
  <parameter>
    <name value="The client is lactating"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="boolean"/>
  </parameter>
  <content>
    <contentType value="text/cql"/>
    <data value="Ci8qCiAgKiBMaWJyYXJ5OiBJTU1aRDVEVFllbGxvd2ZldmVyRW5jb3VudGVyRWxlbWVudHMKICAqLwpsaWJyYXJ5IElNTVpENURUWWVsbG93ZmV2ZXJFbmNvdW50ZXJFbGVtZW50cwoKdXNpbmcgRkhJUiB2ZXJzaW9uICc0LjAuMScKaW5jbHVkZSBGSElSSGVscGVycyB2ZXJzaW9uICc0LjAuMScKCmluY2x1ZGUgV0hPQ29uY2VwdHMKaW5jbHVkZSBXSE9Db21tb24gY2FsbGVkIFdDCmluY2x1ZGUgV0hPRWxlbWVudHMgY2FsbGVkIFdFCgppbmNsdWRlIElNTVpDb21tb24gY2FsbGVkIENvbW1vbgppbmNsdWRlIElNTVpDb25jZXB0cyBjYWxsZWQgQ29uY2VwdHMKaW5jbHVkZSBJTU1aRW5jb3VudGVyRWxlbW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