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

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

        
        
        <tr>
            <th scope="row"><b>Id: </b></th>
            <td style="padding-left: 4px;">IMMZD5DTPneumococcalEncounterElements</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-IMMZD5DTPneumococcalEncounterElements.html">IMMZD5DTPneumococcalEncounterElements</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 Pneumococcal 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-IMMZD5DTPneumococcalElements.html">IMMZD5DTPneumococcalElements</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 Pneumococcal dose</th><th>MedicationRequest</th><th>0</th><th>*</th><th>Out</th></tr>
              
                <tr><th>The client has a history of anaphylactic reactions</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>
              
            </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: IMMZD5DTPneumococcalEncounterElements
  */
library IMMZD5DTPneumococcalEncounterElements

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 IMMZD5DTPneumococcalElements called PneumococcalElements

parameter Today Date default Today()
parameter EncounterId String

context Patient

/*
@internal: Draft Medication Request for Pneumococcal dose
*/
define &quot;Draft Medication Request for Pneumococcal dose&quot;:

  Encounter.&quot;Draft Medication Request for Patient&quot; MR 
    where MR.medication in Concepts.&quot;Pneumococcal vaccines&quot;

/*
@input: The client has a history of anaphylactic reactions
@pseudocode: &quot;Potential contraindications&quot; = &quot;History of anaphylactic reactions&quot;
@code: The client has a history of anaphylactic reactions-67
@decision: IMMZ.D5.DT.Pneumococcal contraindications
*/
define &quot;The client has a history of anaphylactic reactions&quot;:
  Encounter.&quot;The client has history of anaphylactic reactions&quot;

/*
@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.Pneumococcal contraindications
*/
define &quot;The client has a history of severe allergic reactions&quot;:
  Encounter.&quot;The client has history of severe allergic reactions&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/IMMZD5DTPneumococcalEncounterElements"/>
  <version value="1.0.0"/>
  <name value="IMMZD5DTPneumococcalEncounterElements"/>
  <title value="IMMZD5DTPneumococcalEncounterElements"/>
  <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 Pneumococcal 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 PneumococcalElements"/>
    <resource value="http://smart.who.int/immunizations/Library/IMMZD5DTPneumococcalElements"/>
  </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 Pneumococcal dose"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="MedicationRequest"/>
  </parameter>
  <parameter>
    <name value="The client has a history of anaphylactic reactions"/>
    <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>
  <content>
    <contentType value="text/cql"/>
    <data value="Ci8qCiAgKiBMaWJyYXJ5OiBJTU1aRDVEVFBuZXVtb2NvY2NhbEVuY291bnRlckVsZW1lbnRzCiAgKi8KbGlicmFyeSBJTU1aRDVEVFBuZXVtb2NvY2NhbEVuY291bnRlckVsZW1lbnRzCgp1c2luZyBGSElSIHZlcnNpb24gJzQuMC4xJwppbmNsdWRlIEZISVJIZWxwZXJzIHZlcnNpb24gJzQuMC4xJwoKaW5jbHVkZSBXSE9Db25jZXB0cwppbmNsdWRlIFdIT0NvbW1vbiBjYWxsZWQgV0MKaW5jbHVkZSBXSE9FbGVtZW50cyBjYWxsZWQgV0UKCmluY2x1ZGUgSU1NWkNvbW1vbiBjYWxsZWQgQ29tbW9uCmluY2x1ZGUgSU1NWkNvbmNlcHRzIGNhbGxlZCBDb25jZXB0cwppbmNsdWRlIElNTVpFbmNvdW50ZXJFbGVtZW50cyBjYWxsZWQgRW5jb3VudGVyCgppbmNsdWRlIElNTVpENURUUG5ldW1vY29jY2FsRWxlbWVudHMgY2FsbGVkIFBuZXVtb2NvY2NhbEVsZW1lbnRzCgpwYXJhbWV0ZXIgVG9kYXkgRGF0ZSBkZWZhdWx0IFRvZGF5KCkKcGFyYW1ldGVyIEVuY291bnRlcklkIFN0cmluZwoKY29udGV4dCBQYXRpZW50CgovKgpAaW50ZXJuYWw6IERyYWZ0IE1lZGljYXRpb24gUmVxdWVzdCBmb3IgUG5ldW1vY29jY2FsIGRvc2UKKi8KZGVmaW5lICJEcmFmdCBNZWRpY2F0aW9uIFJlcXVlc3QgZm9yIFBuZXVtb2NvY2Nhb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