<?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="300">
         <a:s>/*
  * Library: IMMZD5DTRotavirusEncounterElements
  */
library IMMZD5DTRotavirusEncounterElements</a:s>
      </a:s>
   </annotation>
   <identifier id="IMMZD5DTRotavirusEncounterElements" 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="7:1-7: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="8:1-8: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="10:1-10:19" localIdentifier="WHOConcepts" path="http://smart.who.int/immunizations/WHOConcepts">
         <annotation xsi:type="a:Annotation">
            <a:s r="210">
               <a:s>include </a:s>
               <a:s>
                  <a:s>WHOConcepts</a:s>
               </a:s>
            </a:s>
         </annotation>
      </def>
      <def localId="212" locator="11:1-11:27" localIdentifier="WC" path="http://smart.who.int/immunizations/WHOCommon">
         <annotation xsi:type="a:Annotation">
            <a:s r="212">
               <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="214" locator="12:1-12:29" localIdentifier="WE" path="http://smart.who.int/immunizations/WHOElements">
         <annotation xsi:type="a:Annotation">
            <a:s r="214">
               <a:s>include </a:s>
               <a:s>
                  <a:s>WHOElements</a:s>
               </a:s>
               <a:s> called WE</a:s>
            </a:s>
         </annotation>
      </def>
      <def localId="216" locator="14:1-14:32" localIdentifier="Common" path="http://smart.who.int/immunizations/IMMZCommon">
         <annotation xsi:type="a:Annotation">
            <a:s r="216">
               <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="218" locator="15:1-15:36" localIdentifier="Concepts" path="http://smart.who.int/immunizations/IMMZConcepts">
         <annotation xsi:type="a:Annotation">
            <a:s r="218">
               <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="220" locator="16:1-16:46" localIdentifier="Encounter" path="http://smart.who.int/immunizations/IMMZEncounterElements">
         <annotation xsi:type="a:Annotation">
            <a:s r="220">
               <a:s>include </a:s>
               <a:s>
                  <a:s>IMMZEncounterElements</a:s>
               </a:s>
               <a:s> called Encounter</a:s>
            </a:s>
         </annotation>
      </def>
      <def localId="222" locator="18:1-18:58" localIdentifier="RotavirusElements" path="http://smart.who.int/immunizations/IMMZD5DTRotavirusElements">
         <annotation xsi:type="a:Annotation">
            <a:s r="222">
               <a:s>include </a:s>
               <a:s>
                  <a:s>IMMZD5DTRotavirusElements</a:s>
               </a:s>
               <a:s> called RotavirusElements</a:s>
            </a:s>
         </annotation>
      </def>
   </includes>
   <parameters>
      <def localId="224" locator="20:1-20:36" name="Today" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="224">
               <a:s>parameter Today </a:s>
               <a:s r="228">
                  <a:s>Date</a:s>
               </a:s>
               <a:s> default </a:s>
               <a:s r="227">
                  <a:s>Today()</a:s>
               </a:s>
            </a:s>
         </annotation>
         <default localId="227" locator="20:30-20:36" xsi:type="Today"/>
         <parameterTypeSpecifier localId="228" locator="20:17-20:20" name="t:Date" xsi:type="NamedTypeSpecifier"/>
      </def>
      <def localId="230" locator="21:1-21:28" name="EncounterId" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="230">
               <a:s>parameter EncounterId </a:s>
               <a:s r="231">
                  <a:s>String</a:s>
               </a:s>
            </a:s>
         </annotation>
         <parameterTypeSpecifier localId="231" locator="21:23-21:28" name="t:String" xsi:type="NamedTypeSpecifier"/>
      </def>
   </parameters>
   <contexts>
      <def localId="236" locator="23:1-23:15" name="Patient"/>
   </contexts>
   <statements>
      <def localId="234" locator="23:1-23:15" name="Patient" context="Patient">
         <expression localId="235" xsi:type="SingletonFrom">
            <operand localId="233" locator="23:1-23:15" dataType="fhir:Patient" templateId="http://hl7.org/fhir/StructureDefinition/Patient" xsi:type="Retrieve"/>
         </expression>
      </def>
      <def localId="239" locator="28:1-30:56" name="Draft Medication Request for Rotavirus dose" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="internal" value="Draft Medication Request for Rotavirus dose"/>
            <a:s r="239">
               <a:s>/*
@internal: Draft Medication Request for Rotavirus dose
*/
define &quot;Draft Medication Request for Rotavirus dose&quot;:
  </a:s>
               <a:s r="252">
                  <a:s>
                     <a:s r="240">
                        <a:s r="242">
                           <a:s>
                              <a:s>Encounter.&quot;Draft Medication Request for Patient&quot;</a:s>
                           </a:s>
                        </a:s>
                        <a:s> MR</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="248">
                     <a:s>where </a:s>
                     <a:s r="248">
                        <a:s r="245">
                           <a:s r="244">
                              <a:s>MR</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="245">
                              <a:s>medication</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="247">
                           <a:s r="246">
                              <a:s>Concepts</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="247">
                              <a:s>&quot;Rotavirus vaccines&quot;</a:s>
                           </a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="252" locator="29:3-30:56" xsi:type="Query">
            <source localId="240" locator="29:3-29:53" alias="MR">
               <expression localId="242" locator="29:3-29:50" name="Draft Medication Request for Patient" libraryName="Encounter" xsi:type="ExpressionRef"/>
            </source>
            <where localId="248" locator="30:5-30:56" xsi:type="InValueSet">
               <signature localId="251" name="t:Concept" xsi:type="NamedTypeSpecifier"/>
               <code localId="250" name="ToConcept" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="249" asType="fhir:CodeableConcept" xsi:type="As">
                     <operand localId="245" locator="30:11-30:23" path="medication" scope="MR" xsi:type="Property"/>
                  </operand>
               </code>
               <valueset localId="247" locator="30:28-30:56" name="Rotavirus vaccines" libraryName="Concepts" preserve="true"/>
            </where>
         </expression>
      </def>
      <def localId="255" locator="38:1-39:61" name="The client has prior history of intussusception" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has prior history of intussusception"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;Prior history of intussusception&quot;"/>
            <a:t name="code" value="The client has prior history of intussusception-66"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="255">
               <a:s>/*
@input: The client has prior history of intussusception
@pseudocode: &quot;Potential contraindications&quot; = &quot;Prior history of intussusception&quot;
@code: The client has prior history of intussusception-66
@decision: IMMZ.D5.DT.Rotavirus contraindications
*/
define &quot;The client has prior history of intussusception&quot;:
  </a:s>
               <a:s r="257">
                  <a:s r="256">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="257">
                     <a:s>&quot;The client has prior history of intussusception&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="257" locator="39:3-39:61" name="The client has prior history of intussusception" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="260" locator="47:1-48:55" name="The client has severe immunodeficiency" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has severe immunodeficiency"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;Immunodeficiency syndromes&quot;"/>
            <a:t name="code" value="The client has severe immunodeficiency-61"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="260">
               <a:s>/*
@input: The client has severe immunodeficiency
@pseudocode: '&quot;Potential contraindications&quot; = &quot;Immunodeficiency syndromes&quot;
@code: The client has severe immunodeficiency-61
@decision: IMMZ.D5.DT.Rotavirus contraindications
*/
define &quot;The client has severe immunodeficiency&quot;:
  </a:s>
               <a:s r="262">
                  <a:s r="261">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="262">
                     <a:s>&quot;The client has immunodeficiency syndromes&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="262" locator="48:3-48:55" name="The client has immunodeficiency syndromes" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="265" locator="56:1-57:65" name="The client has a history of severe allergic reactions" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has a history of severe allergic reactions"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;Severe allergic reactions&quot;"/>
            <a:t name="code" value="The client has a history of severe allergic reactions-59"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="265">
               <a:s>/*
@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.Rotavirus contraindications
*/
define &quot;The client has a history of severe allergic reactions&quot;:
  </a:s>
               <a:s r="267">
                  <a:s r="266">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="267">
                     <a:s>&quot;The client has history of severe allergic reactions&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="267" locator="57:3-57:65" name="The client has history of severe allergic reactions" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="270" locator="65:1-66:62" name="The client has history of anaphylactic reactions" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has history of anaphylactic reactions"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;History of anaphylactic reactions&quot;"/>
            <a:t name="code" value="The client has history of anaphylactic reactions-67"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="270">
               <a:s>/*
@input: The client has history of anaphylactic reactions
@pseudocode: &quot;Potential contraindications&quot; = &quot;History of anaphylactic reactions&quot;
@code: The client has history of anaphylactic reactions-67
@decision: IMMZ.D5.DT.Rotavirus contraindications
*/
define &quot;The client has history of anaphylactic reactions&quot;:
  </a:s>
               <a:s r="272">
                  <a:s r="271">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="272">
                     <a:s>&quot;The client has history of anaphylactic reactions&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="272" locator="66:3-66:62" name="The client has history of anaphylactic reactions" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="275" locator="74:1-75:53" name="The client has altered immunocompetence" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has altered immunocompetence"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;Altered immunocompetence&quot;"/>
            <a:t name="code" value="The client has altered immunocompetence-58"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="275">
               <a:s>/*
@input: The client has altered immunocompetence
@pseudocode: &quot;Potential contraindications&quot; = &quot;Altered immunocompetence&quot;
@code: The client has altered immunocompetence-58
@decision: IMMZ.D5.DT.Rotavirus contraindications
*/
define &quot;The client has altered immunocompetence&quot;:
  </a:s>
               <a:s r="277">
                  <a:s r="276">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="277">
                     <a:s>&quot;The client has altered immunocompetence&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="277" locator="75:3-75:53" name="The client has altered immunocompetence" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="280" locator="83:1-84:41" name="The client has spina bifida" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has spina bifida"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;Spina bifida&quot;"/>
            <a:t name="code" value="The client has spina bifida-46"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="280">
               <a:s>/*
@input: The client has spina bifida
@pseudocode: &quot;Potential contraindications&quot; = &quot;Spina bifida&quot;
@code: The client has spina bifida-46
@decision: IMMZ.D5.DT.Rotavirus contraindications
*/
define &quot;The client has spina bifida&quot;:
  </a:s>
               <a:s r="282">
                  <a:s r="281">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="282">
                     <a:s>&quot;The client has spina bifida&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="282" locator="84:3-84:41" name="The client has spina bifida" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="285" locator="92:1-93:46" name="The client has bladder exstrophy" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has bladder exstrophy"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;Bladder exstrophy&quot;"/>
            <a:t name="code" value="The client has bladder exstrophy-51"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="285">
               <a:s>/*
@input: The client has bladder exstrophy
@pseudocode: &quot;Potential contraindications&quot; = &quot;Bladder exstrophy&quot;
@code: The client has bladder exstrophy-51
@decision: IMMZ.D5.DT.Rotavirus contraindications
*/
define &quot;The client has bladder exstrophy&quot;:
  </a:s>
               <a:s r="287">
                  <a:s r="286">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="287">
                     <a:s>&quot;The client has bladder exstrophy&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="287" locator="93:3-93:46" name="The client has bladder exstrophy" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="290" locator="101:1-102:61" name="The client has chronic gastrointestinal disease" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has chronic gastrointestinal disease"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;Chronic gastrointestinal disease&quot;"/>
            <a:t name="code" value="The client has chronic gastrointestinal disease-66"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="290">
               <a:s>/*
@input: The client has chronic gastrointestinal disease
@pseudocode: &quot;Potential contraindications&quot; = &quot;Chronic gastrointestinal disease&quot;
@code: The client has chronic gastrointestinal disease-66
@decision: IMMZ.D5.DT.Rotavirus contraindications
*/
define &quot;The client has chronic gastrointestinal disease&quot;:
  </a:s>
               <a:s r="292">
                  <a:s r="291">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="292">
                     <a:s>&quot;The client has chronic gastrointestinal disease&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="292" locator="102:3-102:61" name="The client has chronic gastrointestinal disease" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="295" locator="110:1-111:50" name="The client has acute gastroenteritis" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has acute gastroenteritis"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;Acute gastroenteritis&quot;"/>
            <a:t name="code" value="The client has acute gastroenteritis-55"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="295">
               <a:s>/*
@input: The client has acute gastroenteritis
@pseudocode: &quot;Potential contraindications&quot; = &quot;Acute gastroenteritis&quot;
@code: The client has acute gastroenteritis-55
@decision: IMMZ.D5.DT.Rotavirus contraindications
*/
define &quot;The client has acute gastroenteritis&quot;:
  </a:s>
               <a:s r="297">
                  <a:s r="296">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="297">
                     <a:s>&quot;The client has acute gastroenteritis&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="297" locator="111:3-111:50" name="The client has acute gastroenteritis" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="300" locator="119:1-120:53" name="The client has moderate to severe fever" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="input" value="The client has moderate to severe fever"/>
            <a:t name="pseudocode" value="&quot;Potential contraindications&quot; = &quot;Moderate to severe fever&quot;"/>
            <a:t name="code" value="The client has moderate to severe fever-58"/>
            <a:t name="decision" value="IMMZ.D5.DT.Rotavirus contraindications"/>
            <a:s r="300">
               <a:s>/*
@input: The client has moderate to severe fever
@pseudocode: &quot;Potential contraindications&quot; = &quot;Moderate to severe fever&quot;
@code: The client has moderate to severe fever-58
@decision: IMMZ.D5.DT.Rotavirus contraindications
*/
define &quot;The client has moderate to severe fever&quot;:
  </a:s>
               <a:s r="302">
                  <a:s r="301">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="302">
                     <a:s>&quot;The client has moderate to severe fever&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="302" locator="120:3-120:53" name="The client has moderate to severe fever" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
   </statements>
</library>
