<?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="376">
         <a:s>/*
 * Library: IMMZD18SVaricella2DosesLogic (IMMZ.D18.S.Varicella.2-dose schedule)
 * Schedule Table: 2-dose schedule
 */
library IMMZD18SVaricella2DosesLogic</a:s>
      </a:s>
   </annotation>
   <identifier id="IMMZD18SVaricella2DosesLogic" 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:27" localIdentifier="WC" path="http://smart.who.int/immunizations/WHOCommon">
         <annotation xsi:type="a:Annotation">
            <a:s r="210">
               <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="212" locator="12:1-12:32" localIdentifier="Common" path="http://smart.who.int/immunizations/IMMZCommon">
         <annotation xsi:type="a:Annotation">
            <a:s r="212">
               <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="214" locator="13:1-13:36" localIdentifier="Concepts" path="http://smart.who.int/immunizations/IMMZConcepts">
         <annotation xsi:type="a:Annotation">
            <a:s r="214">
               <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="216" locator="15:1-15:39" localIdentifier="IE" path="http://smart.who.int/immunizations/IMMZEncounterElements">
         <annotation xsi:type="a:Annotation">
            <a:s r="216">
               <a:s>include </a:s>
               <a:s>
                  <a:s>IMMZEncounterElements</a:s>
               </a:s>
               <a:s> called IE</a:s>
            </a:s>
         </annotation>
      </def>
      <def localId="218" locator="16:1-16:59" localIdentifier="Encounter" path="http://smart.who.int/immunizations/IMMZD2DTVaricellaEncounterElements">
         <annotation xsi:type="a:Annotation">
            <a:s r="218">
               <a:s>include </a:s>
               <a:s>
                  <a:s>IMMZD2DTVaricellaEncounterElements</a:s>
               </a:s>
               <a:s> called Encounter</a:s>
            </a:s>
         </annotation>
      </def>
   </includes>
   <parameters>
      <def localId="220" locator="18:1-18:36" name="Today" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="220">
               <a:s>parameter Today </a:s>
               <a:s r="224">
                  <a:s>Date</a:s>
               </a:s>
               <a:s> default </a:s>
               <a:s r="223">
                  <a:s>Today()</a:s>
               </a:s>
            </a:s>
         </annotation>
         <default localId="223" locator="18:30-18:36" xsi:type="Today"/>
         <parameterTypeSpecifier localId="224" locator="18:17-18:20" name="t:Date" xsi:type="NamedTypeSpecifier"/>
      </def>
   </parameters>
   <contexts>
      <def localId="229" locator="21:1-21:15" name="Patient"/>
   </contexts>
   <statements>
      <def localId="227" locator="21:1-21:15" name="Patient" context="Patient">
         <expression localId="228" xsi:type="SingletonFrom">
            <operand localId="226" locator="21:1-21:15" dataType="fhir:Patient" templateId="http://hl7.org/fhir/StructureDefinition/Patient" xsi:type="Retrieve"/>
         </expression>
      </def>
      <def localId="239" locator="78:1-79:64" name="First varicella dose from the primary series was administered" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="complete" value="First varicella dose from the primary series was administered"/>
            <a:t name="pseudocode" value="&quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) =1"/>
            <a:s r="239">
               <a:s>/*
@complete: First varicella dose from the primary series was administered
@pseudocode: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) =1
*/
define &quot;First varicella dose from the primary series was administered&quot;:
  </a:s>
               <a:s r="241">
                  <a:s r="240">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="241">
                     <a:s>&quot;One varicella primary series dose was administered&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="241" locator="79:3-79:64" name="One varicella primary series dose was administered" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="232" locator="31:1-33:73" name="Varicella dose 1" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="output" value="Varicella dose 1"/>
            <a:t name="description" value="Provision of the varicella dose 1"/>
            <a:t name="trigger" value="Child's birth"/>
            <a:t name="pseudo"/>
            <a:t name="triggerDate" value="&quot;Date of birth&quot;"/>
            <a:s r="232">
               <a:s>/*
@output: Varicella dose 1
@description: Provision of the varicella dose 1
@trigger: Child's birth
@pseudo: 
@triggerDate: &quot;Date of birth&quot;
*/
define &quot;Varicella dose 1&quot;:
  </a:s>
               <a:s r="233">
                  <a:s r="235">
                     <a:s r="234">
                        <a:s>Encounter</a:s>
                     </a:s>
                     <a:s>.</a:s>
                     <a:s r="235">
                        <a:s>&quot;No varicella primary series doses were administered&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
  and </a:s>
                  <a:s r="236">
                     <a:s>not </a:s>
                     <a:s r="242">
                        <a:s>&quot;First varicella dose from the primary series was administered&quot;</a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="233" locator="32:3-33:73" xsi:type="And">
            <operand localId="235" locator="32:3-32:65" name="No varicella primary series doses were administered" libraryName="Encounter" xsi:type="ExpressionRef"/>
            <operand localId="236" locator="33:7-33:73" xsi:type="Not">
               <operand localId="242" locator="33:11-33:73" name="First varicella dose from the primary series was administered" xsi:type="ExpressionRef"/>
            </operand>
         </expression>
      </def>
      <def localId="261" locator="52:1-54:11" name="Varicella dose 1 Due Date" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="dynamicValue" value="Varicella dose 1 Due Date"/>
            <a:t name="pseudocode" value="&quot;Date of birth&quot; + 12 months"/>
            <a:s r="261">
               <a:s>/*
@dynamicValue: Varicella dose 1 Due Date
@pseudocode: &quot;Date of birth&quot; + 12 months
*/
define &quot;Varicella dose 1 Due Date&quot;:
  </a:s>
               <a:s r="262">
                  <a:s>if </a:s>
                  <a:s r="263">
                     <a:s>&quot;Varicella dose 1&quot;</a:s>
                  </a:s>
                  <a:s> then </a:s>
                  <a:s r="264">
                     <a:s r="266">
                        <a:s r="265">
                           <a:s>Patient</a:s>
                        </a:s>
                        <a:s>.</a:s>
                        <a:s r="266">
                           <a:s>birthDate</a:s>
                        </a:s>
                     </a:s>
                     <a:s> + </a:s>
                     <a:s r="267">
                        <a:s>12 months</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="271">
  else null</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="262" locator="53:3-54:11" xsi:type="If">
            <condition localId="263" locator="53:6-53:23" name="Varicella dose 1" xsi:type="ExpressionRef"/>
            <then localId="264" locator="53:30-53:58" xsi:type="Add">
               <signature localId="269" name="t:Date" xsi:type="NamedTypeSpecifier"/>
               <signature localId="270" name="t:Quantity" xsi:type="NamedTypeSpecifier"/>
               <operand localId="268" name="ToDate" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="266" locator="53:30-53:46" path="birthDate" xsi:type="Property">
                     <source localId="265" locator="53:30-53:36" name="Patient" xsi:type="ExpressionRef"/>
                  </operand>
               </operand>
               <operand localId="267" locator="53:50-53:58" value="12" unit="months" xsi:type="Quantity"/>
            </then>
            <else localId="272" asType="t:Date" xsi:type="As">
               <operand localId="271" locator="54:8-54:11" xsi:type="Null"/>
            </else>
         </expression>
      </def>
      <def localId="289" locator="61:1-63:11" name="Varicella dose 1 Overdue" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="dynamicValue" value="Varicella dose 1 Overdue"/>
            <a:t name="pseudocode" value="&quot;Date of birth&quot; + 18 months"/>
            <a:s r="289">
               <a:s>/*
@dynamicValue: Varicella dose 1 Overdue
@pseudocode: &quot;Date of birth&quot; + 18 months
*/
define &quot;Varicella dose 1 Overdue&quot;:
  </a:s>
               <a:s r="290">
                  <a:s>if </a:s>
                  <a:s r="291">
                     <a:s>&quot;Varicella dose 1&quot;</a:s>
                  </a:s>
                  <a:s> then </a:s>
                  <a:s r="292">
                     <a:s r="294">
                        <a:s r="293">
                           <a:s>Patient</a:s>
                        </a:s>
                        <a:s>.</a:s>
                        <a:s r="294">
                           <a:s>birthDate</a:s>
                        </a:s>
                     </a:s>
                     <a:s> + </a:s>
                     <a:s r="295">
                        <a:s>18 months</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="299">
  else null</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="290" locator="62:3-63:11" xsi:type="If">
            <condition localId="291" locator="62:6-62:23" name="Varicella dose 1" xsi:type="ExpressionRef"/>
            <then localId="292" locator="62:30-62:58" xsi:type="Add">
               <signature localId="297" name="t:Date" xsi:type="NamedTypeSpecifier"/>
               <signature localId="298" name="t:Quantity" xsi:type="NamedTypeSpecifier"/>
               <operand localId="296" name="ToDate" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="294" locator="62:30-62:46" path="birthDate" xsi:type="Property">
                     <source localId="293" locator="62:30-62:36" name="Patient" xsi:type="ExpressionRef"/>
                  </operand>
               </operand>
               <operand localId="295" locator="62:50-62:58" value="18" unit="months" xsi:type="Quantity"/>
            </then>
            <else localId="300" asType="t:Date" xsi:type="As">
               <operand localId="299" locator="63:8-63:11" xsi:type="Null"/>
            </else>
         </expression>
      </def>
      <def localId="245" locator="40:1-45:9" name="Varicella dose 1 Create" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="output" value="Varicella dose 1 Create"/>
            <a:t name="create" value="Depending on the goal of the vaccination programme, 1–2 doses should be given with the first dose administered at 12–18 months of age."/>
            <a:s r="245">
               <a:s>/*
@output: Varicella dose 1 Create
@create: Depending on the goal of the vaccination programme, 1–2 doses should be given with the first dose administered at 12–18 months of age.
*/
define &quot;Varicella dose 1 Create&quot;:
  </a:s>
               <a:s r="246">
                  <a:s>if </a:s>
                  <a:s r="247">
                     <a:s>&quot;Varicella dose 1&quot;</a:s>
                  </a:s>
                  <a:s>
  then </a:s>
                  <a:s r="309">
                     <a:s r="286">
                        <a:s r="281">
                           <a:s r="258">
                              <a:s r="252">
                                 <a:s>'Depending on the goal of the vaccination programme, 1–2 doses should be given with the first dose administered at 12–18 months of age.'</a:s>
                              </a:s>
                              <a:s> + </a:s>
                              <a:s r="254">
                                 <a:s>'
Due Date: '</a:s>
                              </a:s>
                           </a:s>
                           <a:s> + </a:s>
                           <a:s r="277">
                              <a:s>ToString(</a:s>
                              <a:s r="273">
                                 <a:s>&quot;Varicella dose 1 Due Date&quot;</a:s>
                              </a:s>
                              <a:s>)</a:s>
                           </a:s>
                        </a:s>
                        <a:s> + </a:s>
                        <a:s r="282">
                           <a:s>'
Overdue: '</a:s>
                        </a:s>
                     </a:s>
                     <a:s> + </a:s>
                     <a:s r="305">
                        <a:s>ToString(</a:s>
                        <a:s r="301">
                           <a:s>&quot;Varicella dose 1 Overdue&quot;</a:s>
                        </a:s>
                        <a:s>)</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
  else </a:s>
                  <a:s r="310">
                     <a:s>''</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="246" locator="41:3-45:9" xsi:type="If">
            <condition localId="247" locator="41:6-41:23" name="Varicella dose 1" xsi:type="ExpressionRef"/>
            <then localId="309" locator="42:8-44:49" xsi:type="Concatenate">
               <operand localId="286" locator="42:8-43:66" xsi:type="Concatenate">
                  <operand localId="281" locator="42:8-43:51" xsi:type="Concatenate">
                     <operand localId="258" locator="42:8-42:159" xsi:type="Concatenate">
                        <operand localId="252" locator="42:8-42:143" valueType="t:String" value="Depending on the goal of the vaccination programme, 1–2 doses should be given with the first dose administered at 12–18 months of age." xsi:type="Literal"/>
                        <operand localId="254" locator="42:147-42:159" valueType="t:String" value="&#xa;Due Date: " xsi:type="Literal"/>
                     </operand>
                     <operand localId="277" locator="43:15-43:51" xsi:type="ToString">
                        <signature localId="278" name="t:Date" xsi:type="NamedTypeSpecifier"/>
                        <operand localId="273" locator="43:24-43:50" name="Varicella dose 1 Due Date" xsi:type="ExpressionRef"/>
                     </operand>
                  </operand>
                  <operand localId="282" locator="43:55-43:66" valueType="t:String" value="&#xa;Overdue: " xsi:type="Literal"/>
               </operand>
               <operand localId="305" locator="44:14-44:49" xsi:type="ToString">
                  <signature localId="306" name="t:Date" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="301" locator="44:23-44:48" name="Varicella dose 1 Overdue" xsi:type="ExpressionRef"/>
               </operand>
            </then>
            <else localId="310" locator="45:8-45:9" valueType="t:String" value="" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="314" locator="70:1-71:6" name="Varicella dose 1 Expiration" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="dynamicValue" value="Varicella dose 1 Expiration"/>
            <a:t name="pseudocode" value="To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated."/>
            <a:s r="314">
               <a:s r="315">/*
@dynamicValue: Varicella dose 1 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;Varicella dose 1 Expiration&quot;:
  null</a:s>
            </a:s>
         </annotation>
         <expression localId="315" locator="71:3-71:6" xsi:type="Null"/>
      </def>
      <def localId="324" locator="135:1-136:66" name="Second varicella dose from the primary series was administered. The primary series has been completed" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="complete" value="Second varicella dose from the primary series was administered. The primary series has been completed"/>
            <a:t name="pseudocode" value="&quot;Completed the primary vaccination series&quot; = TRUE (where &quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot;)&quot;"/>
            <a:s r="324">
               <a:s>/*
@complete: Second varicella dose from the primary series was administered. The primary series has been completed
@pseudocode: &quot;Completed the primary vaccination series&quot; = TRUE (where &quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot;)&quot;
*/
define &quot;Second varicella dose from the primary series was administered. The primary series has been completed&quot;:
  </a:s>
               <a:s r="326">
                  <a:s r="325">
                     <a:s>Encounter</a:s>
                  </a:s>
                  <a:s>.</a:s>
                  <a:s r="326">
                     <a:s>&quot;Two varicella primary series doses were administered&quot;</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="326" locator="136:3-136:66" name="Two varicella primary series doses were administered" libraryName="Encounter" xsi:type="ExpressionRef"/>
      </def>
      <def localId="318" locator="90:1-92:113" name="Varicella dose 2" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="output" value="Varicella dose 2"/>
            <a:t name="description" value="Provision of the varicella dose 2"/>
            <a:t name="trigger" value="First varicella dose from the primary series was administered"/>
            <a:t name="pseudo" value="&quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) =1"/>
            <a:t name="triggerDate" value="&quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot;)"/>
            <a:s r="318">
               <a:s>/*
@output: Varicella dose 2
@description: Provision of the varicella dose 2
@trigger: First varicella dose from the primary series was administered
@pseudo: Count of vaccines administered (where &quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot; and &quot;Type of dose&quot; = &quot;Primary series&quot;) =1
@triggerDate: &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot;)
*/
define &quot;Varicella dose 2&quot;:
  </a:s>
               <a:s r="319">
                  <a:s r="320">
                     <a:s>&quot;First varicella dose from the primary series was administered&quot;</a:s>
                  </a:s>
                  <a:s>
  and </a:s>
                  <a:s r="321">
                     <a:s>not </a:s>
                     <a:s r="327">
                        <a:s>&quot;Second varicella dose from the primary series was administered. The primary series has been completed&quot;</a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="319" locator="91:3-92:113" xsi:type="And">
            <operand localId="320" locator="91:3-91:65" name="First varicella dose from the primary series was administered" xsi:type="ExpressionRef"/>
            <operand localId="321" locator="92:7-92:113" xsi:type="Not">
               <operand localId="327" locator="92:11-92:113" name="Second varicella dose from the primary series was administered. The primary series has been completed" xsi:type="ExpressionRef"/>
            </operand>
         </expression>
      </def>
      <def localId="344" locator="110:1-112:11" name="Varicella dose 2 Due Date" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="dynamicValue" value="Varicella dose 2 Due Date"/>
            <a:t name="pseudocode" value="&quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot;) + 4 weeks"/>
            <a:s r="344">
               <a:s>/*
@dynamicValue: Varicella dose 2 Due Date
@pseudocode: &quot;Date and time of vaccination&quot; (where &quot;Vaccine type&quot; = &quot;Varicella-containing vaccines&quot;) + 4 weeks
*/
define &quot;Varicella dose 2 Due Date&quot;:
  </a:s>
               <a:s r="345">
                  <a:s>if </a:s>
                  <a:s r="346">
                     <a:s>&quot;Varicella dose 2&quot;</a:s>
                  </a:s>
                  <a:s> then </a:s>
                  <a:s r="347">
                     <a:s r="349">
                        <a:s r="348">
                           <a:s>Encounter</a:s>
                        </a:s>
                        <a:s>.</a:s>
                        <a:s r="349">
                           <a:s>&quot;Date of Latest Varicella Dose&quot;</a:s>
                        </a:s>
                     </a:s>
                     <a:s> + </a:s>
                     <a:s r="350">
                        <a:s>4 weeks</a:s>
                     </a:s>
                  </a:s>
                  <a:s r="353">
  else null</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="345" locator="111:3-112:11" xsi:type="If">
            <condition localId="346" locator="111:6-111:23" name="Varicella dose 2" xsi:type="ExpressionRef"/>
            <then localId="347" locator="111:30-111:80" xsi:type="Add">
               <signature localId="351" name="t:Date" xsi:type="NamedTypeSpecifier"/>
               <signature localId="352" name="t:Quantity" xsi:type="NamedTypeSpecifier"/>
               <operand localId="349" locator="111:30-111:70" name="Date of Latest Varicella Dose" libraryName="Encounter" xsi:type="ExpressionRef"/>
               <operand localId="350" locator="111:74-111:80" value="4" unit="weeks" xsi:type="Quantity"/>
            </then>
            <else localId="354" asType="t:Date" xsi:type="As">
               <operand localId="353" locator="112:8-112:11" xsi:type="Null"/>
            </else>
         </expression>
      </def>
      <def localId="330" locator="99:1-103:9" name="Varicella dose 2 Create" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="output" value="Varicella dose 2 Create"/>
            <a:t name="create" value="The minimum interval between doses should be as recommended by the manufacturer, ranging from 4 weeks to 3 months."/>
            <a:s r="330">
               <a:s>/*
@output: Varicella dose 2 Create
@create: The minimum interval between doses should be as recommended by the manufacturer, ranging from 4 weeks to 3 months.
*/
define &quot;Varicella dose 2 Create&quot;:
  </a:s>
               <a:s r="331">
                  <a:s>if </a:s>
                  <a:s r="332">
                     <a:s>&quot;Varicella dose 2&quot;</a:s>
                  </a:s>
                  <a:s>
  then </a:s>
                  <a:s r="363">
                     <a:s r="341">
                        <a:s r="335">
                           <a:s>'The minimum interval between doses should be as recommended by the manufacturer, ranging from 4 weeks to 3 months.'</a:s>
                        </a:s>
                        <a:s> + </a:s>
                        <a:s r="337">
                           <a:s>'
Due Date: '</a:s>
                        </a:s>
                     </a:s>
                     <a:s> + </a:s>
                     <a:s r="359">
                        <a:s>ToString(</a:s>
                        <a:s r="355">
                           <a:s>&quot;Varicella dose 2 Due Date&quot;</a:s>
                        </a:s>
                        <a:s>)</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
  else </a:s>
                  <a:s r="364">
                     <a:s>''</a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="331" locator="100:3-103:9" xsi:type="If">
            <condition localId="332" locator="100:6-100:23" name="Varicella dose 2" xsi:type="ExpressionRef"/>
            <then localId="363" locator="101:8-102:51" xsi:type="Concatenate">
               <operand localId="341" locator="101:8-101:139" xsi:type="Concatenate">
                  <operand localId="335" locator="101:8-101:123" valueType="t:String" value="The minimum interval between doses should be as recommended by the manufacturer, ranging from 4 weeks to 3 months." xsi:type="Literal"/>
                  <operand localId="337" locator="101:127-101:139" valueType="t:String" value="&#xa;Due Date: " xsi:type="Literal"/>
               </operand>
               <operand localId="359" locator="102:15-102:51" xsi:type="ToString">
                  <signature localId="360" name="t:Date" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="355" locator="102:24-102:50" name="Varicella dose 2 Due Date" xsi:type="ExpressionRef"/>
               </operand>
            </then>
            <else localId="364" locator="103:8-103:9" valueType="t:String" value="" xsi:type="Literal"/>
         </expression>
      </def>
      <def localId="368" locator="119:1-120:6" name="Varicella dose 2 Overdue" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="dynamicValue" value="Varicella dose 2 Overdue"/>
            <a:t name="pseudocode" value="To be determined by Member States; however, there is no recommended overdue date and individuals are always eligible to be vaccinated."/>
            <a:s r="368">
               <a:s r="369">/*
@dynamicValue: Varicella dose 2 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;Varicella dose 2 Overdue&quot;:
  null</a:s>
            </a:s>
         </annotation>
         <expression localId="369" locator="120:3-120:6" xsi:type="Null"/>
      </def>
      <def localId="372" locator="127:1-128:6" name="Varicella dose 2 Expiration" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="dynamicValue" value="Varicella dose 2 Expiration"/>
            <a:t name="pseudocode" value="To be determined by Member States; however, there is no recommended expiration date and individuals are always eligible to be vaccinated."/>
            <a:s r="372">
               <a:s r="373">/*
@dynamicValue: Varicella dose 2 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;Varicella dose 2 Expiration&quot;:
  null</a:s>
            </a:s>
         </annotation>
         <expression localId="373" locator="128:3-128:6" xsi:type="Null"/>
      </def>
      <def localId="376" locator="143:1-153:5" name="Test Validation" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="test" value="Test expected results based on example patients"/>
            <a:s r="376">
               <a:s>/*
@test: Test expected results based on example patients
*/
define &quot;Test Validation&quot;:
  </a:s>
               <a:s r="377">
                  <a:s>case
    </a:s>
                  <a:s r="378">
                     <a:s>when </a:s>
                     <a:s r="379">
                        <a:s r="381">
                           <a:s r="380">
                              <a:s>Patient</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="381">
                              <a:s>id</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="382">
                           <a:s>'Varicella21.1'</a:s>
                        </a:s>
                     </a:s>
                     <a:s> then </a:s>
                     <a:s r="388">
                        <a:s>&quot;Varicella dose 1&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="389">
                     <a:s>when </a:s>
                     <a:s r="390">
                        <a:s r="392">
                           <a:s r="391">
                              <a:s>Patient</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="392">
                              <a:s>id</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="393">
                           <a:s>'Varicella22.3'</a:s>
                        </a:s>
                     </a:s>
                     <a:s> then </a:s>
                     <a:s r="399">
                        <a:s>&quot;Varicella dose 1&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="400">
                     <a:s>when </a:s>
                     <a:s r="401">
                        <a:s r="403">
                           <a:s r="402">
                              <a:s>Patient</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="403">
                              <a:s>id</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="404">
                           <a:s>'Varicella23.3'</a:s>
                        </a:s>
                     </a:s>
                     <a:s> then </a:s>
                     <a:s r="410">
                        <a:s>&quot;Varicella dose 1&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="411">
                     <a:s>when </a:s>
                     <a:s r="412">
                        <a:s r="414">
                           <a:s r="413">
                              <a:s>Patient</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="414">
                              <a:s>id</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="415">
                           <a:s>'Varicella24.2'</a:s>
                        </a:s>
                     </a:s>
                     <a:s> then </a:s>
                     <a:s r="421">
                        <a:s>&quot;Varicella dose 2&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="422">
                     <a:s>when </a:s>
                     <a:s r="423">
                        <a:s r="425">
                           <a:s r="424">
                              <a:s>Patient</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="425">
                              <a:s>id</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="426">
                           <a:s>'Varicella25.3'</a:s>
                        </a:s>
                     </a:s>
                     <a:s> then </a:s>
                     <a:s r="432">
                        <a:s>&quot;Varicella dose 2&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="433">
                     <a:s>when </a:s>
                     <a:s r="434">
                        <a:s r="436">
                           <a:s r="435">
                              <a:s>Patient</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="436">
                              <a:s>id</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="437">
                           <a:s>'Varicella26.3'</a:s>
                        </a:s>
                     </a:s>
                     <a:s> then </a:s>
                     <a:s r="443">
                        <a:s>&quot;Varicella dose 2&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="444">
                     <a:s>when </a:s>
                     <a:s r="445">
                        <a:s r="447">
                           <a:s r="446">
                              <a:s>Patient</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="447">
                              <a:s>id</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="448">
                           <a:s>'Varicella27.1'</a:s>
                        </a:s>
                     </a:s>
                     <a:s> then </a:s>
                     <a:s r="454">
                        <a:s>&quot;Second varicella dose from the primary series was administered. The primary series has been completed&quot;</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    else </a:s>
                  <a:s r="455">
                     <a:s>'No test case set'</a:s>
                  </a:s>
                  <a:s>
  end</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="377" locator="144:3-153:5" xsi:type="Case">
            <caseItem localId="378" locator="145:5-145:61">
               <when localId="379" locator="145:10-145:37" xsi:type="Equal">
                  <signature localId="386" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <signature localId="387" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="384" name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <signature localId="385" name="fhir:string" xsi:type="NamedTypeSpecifier"/>
                     <operand localId="381" locator="145:10-145:19" path="id" xsi:type="Property">
                        <source localId="380" locator="145:10-145:16" name="Patient" xsi:type="ExpressionRef"/>
                     </operand>
                  </operand>
                  <operand localId="382" locator="145:23-145:37" valueType="t:String" value="Varicella21.1" xsi:type="Literal"/>
               </when>
               <then localId="457" xsi:type="As">
                  <operand localId="388" locator="145:44-145:61" name="Varicella dose 1" xsi:type="ExpressionRef"/>
                  <asTypeSpecifier localId="458" xsi:type="ChoiceTypeSpecifier">
                     <choice localId="459" name="t:Boolean" xsi:type="NamedTypeSpecifier"/>
                     <choice localId="460" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  </asTypeSpecifier>
               </then>
            </caseItem>
            <caseItem localId="389" locator="146:5-146:61">
               <when localId="390" locator="146:10-146:37" xsi:type="Equal">
                  <signature localId="397" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <signature localId="398" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="395" name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <signature localId="396" name="fhir:string" xsi:type="NamedTypeSpecifier"/>
                     <operand localId="392" locator="146:10-146:19" path="id" xsi:type="Property">
                        <source localId="391" locator="146:10-146:16" name="Patient" xsi:type="ExpressionRef"/>
                     </operand>
                  </operand>
                  <operand localId="393" locator="146:23-146:37" valueType="t:String" value="Varicella22.3" xsi:type="Literal"/>
               </when>
               <then localId="461" xsi:type="As">
                  <operand localId="399" locator="146:44-146:61" name="Varicella dose 1" xsi:type="ExpressionRef"/>
                  <asTypeSpecifier localId="462" xsi:type="ChoiceTypeSpecifier">
                     <choice localId="463" name="t:Boolean" xsi:type="NamedTypeSpecifier"/>
                     <choice localId="464" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  </asTypeSpecifier>
               </then>
            </caseItem>
            <caseItem localId="400" locator="147:5-147:61">
               <when localId="401" locator="147:10-147:37" xsi:type="Equal">
                  <signature localId="408" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <signature localId="409" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="406" name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <signature localId="407" name="fhir:string" xsi:type="NamedTypeSpecifier"/>
                     <operand localId="403" locator="147:10-147:19" path="id" xsi:type="Property">
                        <source localId="402" locator="147:10-147:16" name="Patient" xsi:type="ExpressionRef"/>
                     </operand>
                  </operand>
                  <operand localId="404" locator="147:23-147:37" valueType="t:String" value="Varicella23.3" xsi:type="Literal"/>
               </when>
               <then localId="465" xsi:type="As">
                  <operand localId="410" locator="147:44-147:61" name="Varicella dose 1" xsi:type="ExpressionRef"/>
                  <asTypeSpecifier localId="466" xsi:type="ChoiceTypeSpecifier">
                     <choice localId="467" name="t:Boolean" xsi:type="NamedTypeSpecifier"/>
                     <choice localId="468" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  </asTypeSpecifier>
               </then>
            </caseItem>
            <caseItem localId="411" locator="148:5-148:61">
               <when localId="412" locator="148:10-148:37" xsi:type="Equal">
                  <signature localId="419" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <signature localId="420" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="417" name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <signature localId="418" name="fhir:string" xsi:type="NamedTypeSpecifier"/>
                     <operand localId="414" locator="148:10-148:19" path="id" xsi:type="Property">
                        <source localId="413" locator="148:10-148:16" name="Patient" xsi:type="ExpressionRef"/>
                     </operand>
                  </operand>
                  <operand localId="415" locator="148:23-148:37" valueType="t:String" value="Varicella24.2" xsi:type="Literal"/>
               </when>
               <then localId="469" xsi:type="As">
                  <operand localId="421" locator="148:44-148:61" name="Varicella dose 2" xsi:type="ExpressionRef"/>
                  <asTypeSpecifier localId="470" xsi:type="ChoiceTypeSpecifier">
                     <choice localId="471" name="t:Boolean" xsi:type="NamedTypeSpecifier"/>
                     <choice localId="472" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  </asTypeSpecifier>
               </then>
            </caseItem>
            <caseItem localId="422" locator="149:5-149:61">
               <when localId="423" locator="149:10-149:37" xsi:type="Equal">
                  <signature localId="430" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <signature localId="431" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="428" name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <signature localId="429" name="fhir:string" xsi:type="NamedTypeSpecifier"/>
                     <operand localId="425" locator="149:10-149:19" path="id" xsi:type="Property">
                        <source localId="424" locator="149:10-149:16" name="Patient" xsi:type="ExpressionRef"/>
                     </operand>
                  </operand>
                  <operand localId="426" locator="149:23-149:37" valueType="t:String" value="Varicella25.3" xsi:type="Literal"/>
               </when>
               <then localId="473" xsi:type="As">
                  <operand localId="432" locator="149:44-149:61" name="Varicella dose 2" xsi:type="ExpressionRef"/>
                  <asTypeSpecifier localId="474" xsi:type="ChoiceTypeSpecifier">
                     <choice localId="475" name="t:Boolean" xsi:type="NamedTypeSpecifier"/>
                     <choice localId="476" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  </asTypeSpecifier>
               </then>
            </caseItem>
            <caseItem localId="433" locator="150:5-150:61">
               <when localId="434" locator="150:10-150:37" xsi:type="Equal">
                  <signature localId="441" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <signature localId="442" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="439" name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <signature localId="440" name="fhir:string" xsi:type="NamedTypeSpecifier"/>
                     <operand localId="436" locator="150:10-150:19" path="id" xsi:type="Property">
                        <source localId="435" locator="150:10-150:16" name="Patient" xsi:type="ExpressionRef"/>
                     </operand>
                  </operand>
                  <operand localId="437" locator="150:23-150:37" valueType="t:String" value="Varicella26.3" xsi:type="Literal"/>
               </when>
               <then localId="477" xsi:type="As">
                  <operand localId="443" locator="150:44-150:61" name="Varicella dose 2" xsi:type="ExpressionRef"/>
                  <asTypeSpecifier localId="478" xsi:type="ChoiceTypeSpecifier">
                     <choice localId="479" name="t:Boolean" xsi:type="NamedTypeSpecifier"/>
                     <choice localId="480" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  </asTypeSpecifier>
               </then>
            </caseItem>
            <caseItem localId="444" locator="151:5-151:146">
               <when localId="445" locator="151:10-151:37" xsi:type="Equal">
                  <signature localId="452" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <signature localId="453" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  <operand localId="450" name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <signature localId="451" name="fhir:string" xsi:type="NamedTypeSpecifier"/>
                     <operand localId="447" locator="151:10-151:19" path="id" xsi:type="Property">
                        <source localId="446" locator="151:10-151:16" name="Patient" xsi:type="ExpressionRef"/>
                     </operand>
                  </operand>
                  <operand localId="448" locator="151:23-151:37" valueType="t:String" value="Varicella27.1" xsi:type="Literal"/>
               </when>
               <then localId="481" xsi:type="As">
                  <operand localId="454" locator="151:44-151:146" name="Second varicella dose from the primary series was administered. The primary series has been completed" xsi:type="ExpressionRef"/>
                  <asTypeSpecifier localId="482" xsi:type="ChoiceTypeSpecifier">
                     <choice localId="483" name="t:Boolean" xsi:type="NamedTypeSpecifier"/>
                     <choice localId="484" name="t:String" xsi:type="NamedTypeSpecifier"/>
                  </asTypeSpecifier>
               </then>
            </caseItem>
            <else localId="485" xsi:type="As">
               <operand localId="455" locator="152:10-152:27" valueType="t:String" value="No test case set" xsi:type="Literal"/>
               <asTypeSpecifier localId="486" xsi:type="ChoiceTypeSpecifier">
                  <choice localId="487" name="t:Boolean" xsi:type="NamedTypeSpecifier"/>
                  <choice localId="488" name="t:String" xsi:type="NamedTypeSpecifier"/>
               </asTypeSpecifier>
            </else>
         </expression>
      </def>
   </statements>
</library>
