<?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">
   <annotation translatorOptions="EnableAnnotations,EnableLocators,DisableListDemotion,DisableListPromotion" xsi:type="a:CqlToElmInfo"/>
   <annotation xsi:type="a:Annotation">
      <a:s r="453">
         <a:s>library QICoreCommonTests</a:s>
      </a:s>
   </annotation>
   <identifier id="QICoreCommonTests" system="http://hl7.org/fhir/us/qicore"/>
   <schemaIdentifier id="urn:hl7-org:elm" version="r1"/>
   <usings>
      <def localIdentifier="System" uri="urn:hl7-org:elm-types:r1"/>
      <def localId="1" locator="3:1-3:26" localIdentifier="FHIR" uri="http://hl7.org/fhir" version="4.0.1">
         <annotation xsi:type="a:Annotation">
            <a:s r="1">
               <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="2" locator="5:1-5:35" localIdentifier="FHIRHelpers" path="http://hl7.org/fhir/us/qicore/FHIRHelpers" version="4.0.1">
         <annotation xsi:type="a:Annotation">
            <a:s r="2">
               <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="3" locator="7:1-7:34" localIdentifier="Common" path="http://hl7.org/fhir/us/qicore/QICoreCommon">
         <annotation xsi:type="a:Annotation">
            <a:s r="3">
               <a:s>include </a:s>
               <a:s>
                  <a:s>QICoreCommon</a:s>
               </a:s>
               <a:s> called Common</a:s>
            </a:s>
         </annotation>
      </def>
   </includes>
   <codeSystems>
      <def localId="4" locator="9:1-9:91" name="Marital Status Codes" id="http://terminology.hl7.org/CodeSystem/v3-MaritalStatus" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="4">
               <a:s>codesystem &quot;Marital Status Codes&quot;: 'http://terminology.hl7.org/CodeSystem/v3-MaritalStatus'</a:s>
            </a:s>
         </annotation>
      </def>
      <def localId="5" locator="10:1-10:76" name="CDC Race and Ethnicity Codes" id="urn:oid:2.16.840.1.113883.6.238" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="5">
               <a:s>codesystem &quot;CDC Race and Ethnicity Codes&quot;: 'urn:oid:2.16.840.1.113883.6.238'</a:s>
            </a:s>
         </annotation>
      </def>
   </codeSystems>
   <valueSets>
      <def localId="6" locator="12:1-12:72" name="Marital Status" id="http://hl7.org/fhir/ValueSet/marital-status" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="6">
               <a:s>valueset &quot;Marital Status&quot;: 'http://hl7.org/fhir/ValueSet/marital-status'</a:s>
            </a:s>
         </annotation>
      </def>
   </valueSets>
   <codes>
      <def localId="8" locator="14:1-14:64" name="Marital Status - Married" id="M" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="8">
               <a:s>code &quot;Marital Status - Married&quot;: 'M' from </a:s>
               <a:s r="7">
                  <a:s>&quot;Marital Status Codes&quot;</a:s>
               </a:s>
            </a:s>
         </annotation>
         <codeSystem localId="7" locator="14:43-14:64" name="Marital Status Codes"/>
      </def>
      <def localId="10" locator="15:1-15:85" name="American Indian or Alaska Native" id="1002-5" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="10">
               <a:s>code &quot;American Indian or Alaska Native&quot;: '1002-5' from </a:s>
               <a:s r="9">
                  <a:s>&quot;CDC Race and Ethnicity Codes&quot;</a:s>
               </a:s>
            </a:s>
         </annotation>
         <codeSystem localId="9" locator="15:56-15:85" name="CDC Race and Ethnicity Codes"/>
      </def>
      <def localId="12" locator="16:1-16:66" name="Alaska Native" id="1735-0" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="12">
               <a:s>code &quot;Alaska Native&quot;: '1735-0' from </a:s>
               <a:s r="11">
                  <a:s>&quot;CDC Race and Ethnicity Codes&quot;</a:s>
               </a:s>
            </a:s>
         </annotation>
         <codeSystem localId="11" locator="16:37-16:66" name="CDC Race and Ethnicity Codes"/>
      </def>
      <def localId="14" locator="17:1-17:110" name="Blood pressure" id="85354-9" display="Blood pressure panel with all children optional" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="14">
               <a:s>code &quot;Blood pressure&quot;: '85354-9' from </a:s>
               <a:s r="13">
                  <a:s>Common.&quot;LOINC&quot;</a:s>
               </a:s>
               <a:s> display 'Blood pressure panel with all children optional'</a:s>
            </a:s>
         </annotation>
         <codeSystem localId="13" locator="17:39-17:52" name="LOINC" libraryName="Common"/>
      </def>
      <def localId="16" locator="18:1-18:96" name="Diastolic blood pressure" id="8462-4" display="Diastolic blood pressure" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="16">
               <a:s>code &quot;Diastolic blood pressure&quot;: '8462-4' from </a:s>
               <a:s r="15">
                  <a:s>Common.&quot;LOINC&quot;</a:s>
               </a:s>
               <a:s> display 'Diastolic blood pressure'</a:s>
            </a:s>
         </annotation>
         <codeSystem localId="15" locator="18:48-18:61" name="LOINC" libraryName="Common"/>
      </def>
      <def localId="18" locator="19:1-19:94" name="Systolic blood pressure" id="8480-6" display="Systolic blood pressure" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="18">
               <a:s>code &quot;Systolic blood pressure&quot;: '8480-6' from </a:s>
               <a:s r="17">
                  <a:s>Common.&quot;LOINC&quot;</a:s>
               </a:s>
               <a:s> display 'Systolic blood pressure'</a:s>
            </a:s>
         </annotation>
         <codeSystem localId="17" locator="19:47-19:60" name="LOINC" libraryName="Common"/>
      </def>
   </codes>
   <contexts>
      <def locator="21:1-21:15" name="Patient"/>
   </contexts>
   <statements>
      <def locator="21:1-21:15" name="Patient" context="Patient">
         <expression xsi:type="SingletonFrom">
            <operand locator="21:1-21:15" dataType="fhir:Patient" templateId="http://hl7.org/fhir/StructureDefinition/Patient" xsi:type="Retrieve"/>
         </expression>
      </def>
      <def localId="20" locator="25:1-26:16" name="AdverseEvent" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-adverseevent"/>
            <a:s r="20">
               <a:s>// QICoreAdverseEvent
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-adverseevent
define AdverseEvent:
  </a:s>
               <a:s r="19">
                  <a:s>[AdverseEvent]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="19" locator="26:3-26:16" dataType="fhir:AdverseEvent" templateId="http://hl7.org/fhir/StructureDefinition/AdverseEvent" xsi:type="Retrieve"/>
      </def>
      <def localId="22" locator="30:1-31:22" name="AllergyIntolerance" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-allergyintolerance"/>
            <a:s r="22">
               <a:s>// QICoreAllergyIntolerance
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-allergyintolerance
define AllergyIntolerance:
  </a:s>
               <a:s r="21">
                  <a:s>[AllergyIntolerance]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="21" locator="31:3-31:22" dataType="fhir:AllergyIntolerance" templateId="http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" xsi:type="Retrieve"/>
      </def>
      <def localId="24" locator="35:1-36:17" name="BodyStructure" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-bodystructure"/>
            <a:s r="24">
               <a:s>// QICoreBodyStructure
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-bodystructure
define BodyStructure:
  </a:s>
               <a:s r="23">
                  <a:s>[BodyStructure]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="23" locator="36:3-36:17" dataType="fhir:BodyStructure" templateId="http://hl7.org/fhir/StructureDefinition/BodyStructure" xsi:type="Retrieve"/>
      </def>
      <def localId="26" locator="40:1-41:12" name="CarePlan" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-careplan"/>
            <a:s r="26">
               <a:s>// QICoreCarePlan
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-careplan
define CarePlan:
  </a:s>
               <a:s r="25">
                  <a:s>[CarePlan]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="25" locator="41:3-41:12" dataType="fhir:CarePlan" templateId="http://hl7.org/fhir/StructureDefinition/CarePlan" xsi:type="Retrieve"/>
      </def>
      <def localId="28" locator="45:1-46:12" name="CareTeam" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-careteam"/>
            <a:s r="28">
               <a:s>// QICoreCareTeam
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-careteam
define CareTeam:
  </a:s>
               <a:s r="27">
                  <a:s>[CareTeam]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="27" locator="46:3-46:12" dataType="fhir:CareTeam" templateId="http://hl7.org/fhir/StructureDefinition/CareTeam" xsi:type="Retrieve"/>
      </def>
      <def localId="30" locator="50:1-51:9" name="Claim" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim"/>
            <a:s r="30">
               <a:s>// QICoreClaim
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-claim
define Claim:
  </a:s>
               <a:s r="29">
                  <a:s>[Claim]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="29" locator="51:3-51:9" dataType="fhir:Claim" templateId="http://hl7.org/fhir/StructureDefinition/Claim" xsi:type="Retrieve"/>
      </def>
      <def localId="42" locator="55:1-57:78" name="Communication" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-communication"/>
            <a:s r="42">
               <a:s>// QICoreCommunication
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-communication
define Communication:
  </a:s>
               <a:s r="41">
                  <a:s>
                     <a:s r="32">
                        <a:s r="31">
                           <a:s r="31">
                              <a:s>[Communication]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> C</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="40">
                     <a:s>where </a:s>
                     <a:s r="40">
                        <a:s r="34">
                           <a:s r="33">
                              <a:s>C</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="34">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="39">
                           <a:s>{ </a:s>
                           <a:s r="35">
                              <a:s>'preparation'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="36">
                              <a:s>'in-progress'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="37">
                              <a:s>'on-hold'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="38">
                              <a:s>'completed'</a:s>
                           </a:s>
                           <a:s> }</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="41" locator="56:3-57:78" xsi:type="Query">
            <source localId="32" locator="56:3-56:19" alias="C">
               <expression localId="31" locator="56:3-56:17" dataType="fhir:Communication" templateId="http://hl7.org/fhir/StructureDefinition/Communication" xsi:type="Retrieve"/>
            </source>
            <where localId="40" locator="57:5-57:78" xsi:type="In">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="34" locator="57:11-57:18" path="status" scope="C" xsi:type="Property"/>
               </operand>
               <operand localId="39" locator="57:23-57:78" xsi:type="List">
                  <element localId="35" locator="57:25-57:37" valueType="t:String" value="preparation" xsi:type="Literal"/>
                  <element localId="36" locator="57:40-57:52" valueType="t:String" value="in-progress" xsi:type="Literal"/>
                  <element localId="37" locator="57:55-57:63" valueType="t:String" value="on-hold" xsi:type="Literal"/>
                  <element localId="38" locator="57:66-57:76" valueType="t:String" value="completed" xsi:type="Literal"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="50" locator="61:1-63:31" name="CommunicationNotDone" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-communicationnotdone"/>
            <a:s r="50">
               <a:s>// QICoreCommunicationNotDone
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-communicationnotdone
define CommunicationNotDone:
  </a:s>
               <a:s r="49">
                  <a:s>
                     <a:s r="44">
                        <a:s r="43">
                           <a:s r="43">
                              <a:s>[Communication]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> C</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="48">
                     <a:s>where </a:s>
                     <a:s r="48">
                        <a:s r="46">
                           <a:s r="45">
                              <a:s>C</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="46">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="47">
                           <a:s>'not-done'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="49" locator="62:3-63:31" xsi:type="Query">
            <source localId="44" locator="62:3-62:19" alias="C">
               <expression localId="43" locator="62:3-62:17" dataType="fhir:Communication" templateId="http://hl7.org/fhir/StructureDefinition/Communication" xsi:type="Retrieve"/>
            </source>
            <where localId="48" locator="63:5-63:31" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="46" locator="63:11-63:18" path="status" scope="C" xsi:type="Property"/>
               </operand>
               <operand localId="47" locator="63:22-63:31" valueType="t:String" value="not-done" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="52" locator="67:1-68:24" name="CommunicationRequest" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-communicationrequest"/>
            <a:s r="52">
               <a:s>// QICoreCommunicationRequest
// @profile: 	http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-communicationrequest
define CommunicationRequest:
  </a:s>
               <a:s r="51">
                  <a:s>[CommunicationRequest]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="51" locator="68:3-68:24" dataType="fhir:CommunicationRequest" templateId="http://hl7.org/fhir/StructureDefinition/CommunicationRequest" xsi:type="Retrieve"/>
      </def>
      <def localId="54" locator="72:1-73:13" name="Condition" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition"/>
            <a:s r="54">
               <a:s>// QICoreCondition
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition
define Condition:
  </a:s>
               <a:s r="53">
                  <a:s>[Condition]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="53" locator="73:3-73:13" dataType="fhir:Condition" templateId="http://hl7.org/fhir/StructureDefinition/Condition" xsi:type="Retrieve"/>
      </def>
      <def localId="56" locator="77:1-78:12" name="Coverage" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage"/>
            <a:s r="56">
               <a:s>// QICoreCoverage
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage
define Coverage:
  </a:s>
               <a:s r="55">
                  <a:s>[Coverage]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="55" locator="78:3-78:12" dataType="fhir:Coverage" templateId="http://hl7.org/fhir/StructureDefinition/Coverage" xsi:type="Retrieve"/>
      </def>
      <def localId="58" locator="82:1-83:10" name="Device" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-device"/>
            <a:s r="58">
               <a:s>// QICoreDevice
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-device
define Device:
  </a:s>
               <a:s r="57">
                  <a:s>[Device]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="57" locator="83:3-83:10" dataType="fhir:Device" templateId="http://hl7.org/fhir/StructureDefinition/Device" xsi:type="Retrieve"/>
      </def>
      <def localId="70" locator="87:1-90:34" name="DeviceNotRequested" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-devicenotrequested"/>
            <a:s r="70">
               <a:s>// QICoreDeviceNotRequested
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-devicenotrequested
define DeviceNotRequested:
  </a:s>
               <a:s r="69">
                  <a:s>
                     <a:s r="60">
                        <a:s r="59">
                           <a:s r="59">
                              <a:s>[DeviceRequest]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> D</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="68">
                     <a:s>where </a:s>
                     <a:s r="68">
                        <a:s r="64">
                           <a:s r="62">
                              <a:s r="61">
                                 <a:s>D</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="62">
                                 <a:s>status</a:s>
                              </a:s>
                           </a:s>
                           <a:s> = </a:s>
                           <a:s r="63">
                              <a:s>'completed'</a:s>
                           </a:s>
                        </a:s>
                        <a:s>
      and </a:s>
                        <a:s r="67">
                           <a:s r="66">
                              <a:s r="65">
                                 <a:s>D</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="66">
                                 <a:s>doNotPerform()</a:s>
                              </a:s>
                           </a:s>
                           <a:s> is true</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="69" locator="88:3-90:34" xsi:type="Query">
            <source localId="60" locator="88:3-88:19" alias="D">
               <expression localId="59" locator="88:3-88:17" dataType="fhir:DeviceRequest" templateId="http://hl7.org/fhir/StructureDefinition/DeviceRequest" xsi:type="Retrieve"/>
            </source>
            <where localId="68" locator="89:5-90:34" xsi:type="And">
               <operand localId="64" locator="89:11-89:32" xsi:type="Equal">
                  <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand localId="62" locator="89:11-89:18" path="status" scope="D" xsi:type="Property"/>
                  </operand>
                  <operand localId="63" locator="89:22-89:32" valueType="t:String" value="completed" xsi:type="Literal"/>
               </operand>
               <operand localId="67" locator="90:11-90:34" xsi:type="IsTrue">
                  <operand name="ToBoolean" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand localId="66" locator="90:11-90:26" name="doNotPerform" libraryName="Common" xsi:type="FunctionRef">
                        <operand localId="65" locator="90:11" name="D" xsi:type="AliasRef"/>
                     </operand>
                  </operand>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="87" locator="94:1-97:38" name="DeviceRequest" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-devicerequest"/>
            <a:s r="87">
               <a:s>// QICoreDeviceRequest
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-devicerequest
define DeviceRequest:
  </a:s>
               <a:s r="86">
                  <a:s>
                     <a:s r="72">
                        <a:s r="71">
                           <a:s r="71">
                              <a:s>[DeviceRequest]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> D</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="85">
                     <a:s>where </a:s>
                     <a:s r="85">
                        <a:s r="81">
                           <a:s r="74">
                              <a:s r="73">
                                 <a:s>D</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="74">
                                 <a:s>status</a:s>
                              </a:s>
                           </a:s>
                           <a:s> in </a:s>
                           <a:s r="80">
                              <a:s>{ </a:s>
                              <a:s r="75">
                                 <a:s>'draft'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="76">
                                 <a:s>'active'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="77">
                                 <a:s>'on-hold'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="78">
                                 <a:s>'revoked'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="79">
                                 <a:s>'completed'</a:s>
                              </a:s>
                              <a:s> }</a:s>
                           </a:s>
                        </a:s>
                        <a:s>
      and </a:s>
                        <a:s r="84">
                           <a:s r="83">
                              <a:s r="82">
                                 <a:s>D</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="83">
                                 <a:s>doNotPerform()</a:s>
                              </a:s>
                           </a:s>
                           <a:s> is not true</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="86" locator="95:3-97:38" xsi:type="Query">
            <source localId="72" locator="95:3-95:19" alias="D">
               <expression localId="71" locator="95:3-95:17" dataType="fhir:DeviceRequest" templateId="http://hl7.org/fhir/StructureDefinition/DeviceRequest" xsi:type="Retrieve"/>
            </source>
            <where localId="85" locator="96:5-97:38" xsi:type="And">
               <operand localId="81" locator="96:11-96:78" xsi:type="In">
                  <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand localId="74" locator="96:11-96:18" path="status" scope="D" xsi:type="Property"/>
                  </operand>
                  <operand localId="80" locator="96:23-96:78" xsi:type="List">
                     <element localId="75" locator="96:25-96:31" valueType="t:String" value="draft" xsi:type="Literal"/>
                     <element localId="76" locator="96:34-96:41" valueType="t:String" value="active" xsi:type="Literal"/>
                     <element localId="77" locator="96:44-96:52" valueType="t:String" value="on-hold" xsi:type="Literal"/>
                     <element localId="78" locator="96:55-96:63" valueType="t:String" value="revoked" xsi:type="Literal"/>
                     <element localId="79" locator="96:66-96:76" valueType="t:String" value="completed" xsi:type="Literal"/>
                  </operand>
               </operand>
               <operand localId="84" locator="97:11-97:38" xsi:type="Not">
                  <operand locator="97:11-97:38" xsi:type="IsTrue">
                     <operand name="ToBoolean" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                        <operand localId="83" locator="97:11-97:26" name="doNotPerform" libraryName="Common" xsi:type="FunctionRef">
                           <operand localId="82" locator="97:11" name="D" xsi:type="AliasRef"/>
                        </operand>
                     </operand>
                  </operand>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="89" locator="101:1-102:22" name="DeviceUseStatement" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-deviceusestatement"/>
            <a:s r="89">
               <a:s>// QICoreDeviceUseStatement
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-deviceusestatement
define DeviceUseStatement:
  </a:s>
               <a:s r="88">
                  <a:s>[DeviceUseStatement]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="88" locator="102:3-102:22" dataType="fhir:DeviceUseStatement" templateId="http://hl7.org/fhir/StructureDefinition/DeviceUseStatement" xsi:type="Retrieve"/>
      </def>
      <def localId="93" locator="106:1-107:22" name="DiagnosticReportLab" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-diagnosticreport-lab"/>
            <a:s r="93">
               <a:s>// QICoreDiagnosticReportLab
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-diagnosticreport-lab
define DiagnosticReportLab:
  </a:s>
               <a:s r="92">
                  <a:s>
                     <a:s r="91">
                        <a:s r="90">
                           <a:s r="90">
                              <a:s>[DiagnosticReport]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> D</a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="92" locator="107:3-107:22" xsi:type="Query">
            <source localId="91" locator="107:3-107:22" alias="D">
               <expression localId="90" locator="107:3-107:20" dataType="fhir:DiagnosticReport" templateId="http://hl7.org/fhir/StructureDefinition/DiagnosticReport" xsi:type="Retrieve"/>
            </source>
         </expression>
      </def>
      <def localId="97" locator="112:1-113:22" name="DiagnosticReportNote" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-diagnosticreport-note"/>
            <a:s r="97">
               <a:s>//where D.category ~ &quot;http://terminology.hl7.org/CodeSystem/v2-0074#LAB&quot;

// QICoreDiagnosticReportNote
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-diagnosticreport-note
define DiagnosticReportNote:
  </a:s>
               <a:s r="96">
                  <a:s>
                     <a:s r="95">
                        <a:s r="94">
                           <a:s r="94">
                              <a:s>[DiagnosticReport]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> D</a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="96" locator="113:3-113:22" xsi:type="Query">
            <source localId="95" locator="113:3-113:22" alias="D">
               <expression localId="94" locator="113:3-113:20" dataType="fhir:DiagnosticReport" templateId="http://hl7.org/fhir/StructureDefinition/DiagnosticReport" xsi:type="Retrieve"/>
            </source>
         </expression>
      </def>
      <def localId="99" locator="117:1-118:13" name="Encounter" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter"/>
            <a:s r="99">
               <a:s>// QICoreEncounter
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter
define Encounter:
  </a:s>
               <a:s r="98">
                  <a:s>[Encounter]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="98" locator="118:3-118:13" dataType="fhir:Encounter" templateId="http://hl7.org/fhir/StructureDefinition/Encounter" xsi:type="Retrieve"/>
      </def>
      <def localId="107" locator="120:1-122:31" name="EncounterPerformed" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="107">
               <a:s>define EncounterPerformed:
  </a:s>
               <a:s r="106">
                  <a:s>
                     <a:s r="101">
                        <a:s r="100">
                           <a:s>
                              <a:s>Encounter</a:s>
                           </a:s>
                        </a:s>
                        <a:s> E</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="105">
                     <a:s>where </a:s>
                     <a:s r="105">
                        <a:s r="103">
                           <a:s r="102">
                              <a:s>E</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="103">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="104">
                           <a:s>'finished'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="106" locator="121:3-122:31" xsi:type="Query">
            <source localId="101" locator="121:3-121:13" alias="E">
               <expression localId="100" locator="121:3-121:11" name="Encounter" xsi:type="ExpressionRef"/>
            </source>
            <where localId="105" locator="122:5-122:31" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="103" locator="122:11-122:18" path="status" scope="E" xsi:type="Property"/>
               </operand>
               <operand localId="104" locator="122:22-122:31" valueType="t:String" value="finished" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="109" locator="126:1-127:23" name="FamilyMemberHistory" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-familymemberhistory"/>
            <a:s r="109">
               <a:s>// QICoreFamilyMemberHistory
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-familymemberhistory
define FamilyMemberHistory:
  </a:s>
               <a:s r="108">
                  <a:s>[FamilyMemberHistory]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="108" locator="127:3-127:23" dataType="fhir:FamilyMemberHistory" templateId="http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory" xsi:type="Retrieve"/>
      </def>
      <def localId="111" locator="131:1-132:8" name="Flag" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-flag"/>
            <a:s r="111">
               <a:s>// QICoreFlag
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-flag
define Flag:
  </a:s>
               <a:s r="110">
                  <a:s>[Flag]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="110" locator="132:3-132:8" dataType="fhir:Flag" templateId="http://hl7.org/fhir/StructureDefinition/Flag" xsi:type="Retrieve"/>
      </def>
      <def localId="113" locator="136:1-137:8" name="Goal" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-goal"/>
            <a:s r="113">
               <a:s>// QICoreGoal
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-goal
define Goal:
  </a:s>
               <a:s r="112">
                  <a:s>[Goal]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="112" locator="137:3-137:8" dataType="fhir:Goal" templateId="http://hl7.org/fhir/StructureDefinition/Goal" xsi:type="Retrieve"/>
      </def>
      <def localId="115" locator="141:1-142:16" name="ImagingStudy" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-imagingstudy"/>
            <a:s r="115">
               <a:s>// QICoreImagingStudy
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-imagingstudy
define ImagingStudy:
  </a:s>
               <a:s r="114">
                  <a:s>[ImagingStudy]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="114" locator="142:3-142:16" dataType="fhir:ImagingStudy" templateId="http://hl7.org/fhir/StructureDefinition/ImagingStudy" xsi:type="Retrieve"/>
      </def>
      <def localId="123" locator="146:1-148:32" name="Immunization" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunization"/>
            <a:s r="123">
               <a:s>// QICoreImmunization
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunization
define Immunization:
  </a:s>
               <a:s r="122">
                  <a:s>
                     <a:s r="117">
                        <a:s r="116">
                           <a:s r="116">
                              <a:s>[Immunization]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> I</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="121">
                     <a:s>where </a:s>
                     <a:s r="121">
                        <a:s r="119">
                           <a:s r="118">
                              <a:s>I</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="119">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="120">
                           <a:s>'completed'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="122" locator="147:3-148:32" xsi:type="Query">
            <source localId="117" locator="147:3-147:18" alias="I">
               <expression localId="116" locator="147:3-147:16" dataType="fhir:Immunization" templateId="http://hl7.org/fhir/StructureDefinition/Immunization" xsi:type="Retrieve"/>
            </source>
            <where localId="121" locator="148:5-148:32" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="119" locator="148:11-148:18" path="status" scope="I" xsi:type="Property"/>
               </operand>
               <operand localId="120" locator="148:22-148:32" valueType="t:String" value="completed" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="125" locator="152:1-153:26" name="ImmunizationEvaluation" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunizationevaluation"/>
            <a:s r="125">
               <a:s>// QICoreImmunizationEvaluation
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunizationevaluation
define ImmunizationEvaluation:
  </a:s>
               <a:s r="124">
                  <a:s>[ImmunizationEvaluation]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="124" locator="153:3-153:26" dataType="fhir:ImmunizationEvaluation" templateId="http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation" xsi:type="Retrieve"/>
      </def>
      <def localId="133" locator="157:1-159:31" name="ImmunizationNotDone" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunizationnotdone"/>
            <a:s r="133">
               <a:s>// QICoreImmunizationNotDone
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunizationnotdone
define ImmunizationNotDone:
  </a:s>
               <a:s r="132">
                  <a:s>
                     <a:s r="127">
                        <a:s r="126">
                           <a:s r="126">
                              <a:s>[Immunization]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> I</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="131">
                     <a:s>where </a:s>
                     <a:s r="131">
                        <a:s r="129">
                           <a:s r="128">
                              <a:s>I</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="129">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="130">
                           <a:s>'not-done'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="132" locator="158:3-159:31" xsi:type="Query">
            <source localId="127" locator="158:3-158:18" alias="I">
               <expression localId="126" locator="158:3-158:16" dataType="fhir:Immunization" templateId="http://hl7.org/fhir/StructureDefinition/Immunization" xsi:type="Retrieve"/>
            </source>
            <where localId="131" locator="159:5-159:31" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="129" locator="159:11-159:18" path="status" scope="I" xsi:type="Property"/>
               </operand>
               <operand localId="130" locator="159:22-159:31" valueType="t:String" value="not-done" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="135" locator="163:1-164:30" name="ImmunizationRecommendation" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunizationrec"/>
            <a:s r="135">
               <a:s>// QICoreImmunizationRecommendation
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-immunizationrec
define ImmunizationRecommendation:
  </a:s>
               <a:s r="134">
                  <a:s>[ImmunizationRecommendation]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="134" locator="164:3-164:30" dataType="fhir:ImmunizationRecommendation" templateId="http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation" xsi:type="Retrieve"/>
      </def>
      <def localId="137" locator="168:1-169:10" name="ImplantableDevice" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device"/>
            <a:s r="137">
               <a:s>// USCoreImplantableDevice
// @profile: http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device
define ImplantableDevice:
  </a:s>
               <a:s r="136">
                  <a:s>[Device]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="136" locator="169:3-169:10" dataType="fhir:Device" templateId="http://hl7.org/fhir/StructureDefinition/Device" xsi:type="Retrieve"/>
      </def>
      <def localId="139" locator="173:1-174:12" name="Location" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-location"/>
            <a:s r="139">
               <a:s>// QICoreLocation
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-location
define Location:
  </a:s>
               <a:s r="138">
                  <a:s>[Location]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="138" locator="174:3-174:12" dataType="fhir:Location" templateId="http://hl7.org/fhir/StructureDefinition/Location" xsi:type="Retrieve"/>
      </def>
      <def localId="141" locator="178:1-179:14" name="Medication" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medication"/>
            <a:s r="141">
               <a:s>// QICoreMedication
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medication
define Medication:
  </a:s>
               <a:s r="140">
                  <a:s>[Medication]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="140" locator="179:3-179:14" dataType="fhir:Medication" templateId="http://hl7.org/fhir/StructureDefinition/Medication" xsi:type="Retrieve"/>
      </def>
      <def localId="152" locator="183:1-185:63" name="MedicationAdministration" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationadministration"/>
            <a:s r="152">
               <a:s>// QICoreMedicationAdministration
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationadministration
define MedicationAdministration:
  </a:s>
               <a:s r="151">
                  <a:s>
                     <a:s r="143">
                        <a:s r="142">
                           <a:s r="142">
                              <a:s>[MedicationAdministration]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> M</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="150">
                     <a:s>where </a:s>
                     <a:s r="150">
                        <a:s r="145">
                           <a:s r="144">
                              <a:s>M</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="145">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="149">
                           <a:s>{ </a:s>
                           <a:s r="146">
                              <a:s>'in-progress'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="147">
                              <a:s>'on-hold'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="148">
                              <a:s>'completed'</a:s>
                           </a:s>
                           <a:s> }</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="151" locator="184:3-185:63" xsi:type="Query">
            <source localId="143" locator="184:3-184:30" alias="M">
               <expression localId="142" locator="184:3-184:28" dataType="fhir:MedicationAdministration" templateId="http://hl7.org/fhir/StructureDefinition/MedicationAdministration" xsi:type="Retrieve"/>
            </source>
            <where localId="150" locator="185:5-185:63" xsi:type="In">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="145" locator="185:11-185:18" path="status" scope="M" xsi:type="Property"/>
               </operand>
               <operand localId="149" locator="185:23-185:63" xsi:type="List">
                  <element localId="146" locator="185:25-185:37" valueType="t:String" value="in-progress" xsi:type="Literal"/>
                  <element localId="147" locator="185:40-185:48" valueType="t:String" value="on-hold" xsi:type="Literal"/>
                  <element localId="148" locator="185:51-185:61" valueType="t:String" value="completed" xsi:type="Literal"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="160" locator="189:1-191:31" name="MedicationAdministrationNotDone" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotadministered"/>
            <a:s r="160">
               <a:s>// QICoreMedicationAdministrationNotDone
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotadministered
define MedicationAdministrationNotDone:
  </a:s>
               <a:s r="159">
                  <a:s>
                     <a:s r="154">
                        <a:s r="153">
                           <a:s r="153">
                              <a:s>[MedicationAdministration]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> M</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="158">
                     <a:s>where </a:s>
                     <a:s r="158">
                        <a:s r="156">
                           <a:s r="155">
                              <a:s>M</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="156">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="157">
                           <a:s>'not-done'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="159" locator="190:3-191:31" xsi:type="Query">
            <source localId="154" locator="190:3-190:30" alias="M">
               <expression localId="153" locator="190:3-190:28" dataType="fhir:MedicationAdministration" templateId="http://hl7.org/fhir/StructureDefinition/MedicationAdministration" xsi:type="Retrieve"/>
            </source>
            <where localId="158" locator="191:5-191:31" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="156" locator="191:11-191:18" path="status" scope="M" xsi:type="Property"/>
               </operand>
               <operand localId="157" locator="191:22-191:31" valueType="t:String" value="not-done" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="172" locator="195:1-197:78" name="MedicationDispense" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationdispense"/>
            <a:s r="172">
               <a:s>// QICoreMedicationDispense
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationdispense
define MedicationDispense:
  </a:s>
               <a:s r="171">
                  <a:s>
                     <a:s r="162">
                        <a:s r="161">
                           <a:s r="161">
                              <a:s>[MedicationDispense]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> D</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="170">
                     <a:s>where </a:s>
                     <a:s r="170">
                        <a:s r="164">
                           <a:s r="163">
                              <a:s>D</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="164">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="169">
                           <a:s>{ </a:s>
                           <a:s r="165">
                              <a:s>'preparation'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="166">
                              <a:s>'in-progress'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="167">
                              <a:s>'on-hold'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="168">
                              <a:s>'completed'</a:s>
                           </a:s>
                           <a:s> }</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="171" locator="196:3-197:78" xsi:type="Query">
            <source localId="162" locator="196:3-196:24" alias="D">
               <expression localId="161" locator="196:3-196:22" dataType="fhir:MedicationDispense" templateId="http://hl7.org/fhir/StructureDefinition/MedicationDispense" xsi:type="Retrieve"/>
            </source>
            <where localId="170" locator="197:5-197:78" xsi:type="In">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="164" locator="197:11-197:18" path="status" scope="D" xsi:type="Property"/>
               </operand>
               <operand localId="169" locator="197:23-197:78" xsi:type="List">
                  <element localId="165" locator="197:25-197:37" valueType="t:String" value="preparation" xsi:type="Literal"/>
                  <element localId="166" locator="197:40-197:52" valueType="t:String" value="in-progress" xsi:type="Literal"/>
                  <element localId="167" locator="197:55-197:63" valueType="t:String" value="on-hold" xsi:type="Literal"/>
                  <element localId="168" locator="197:66-197:76" valueType="t:String" value="completed" xsi:type="Literal"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="182" locator="201:1-203:49" name="MedicationDispenseNotDone" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotdispensed"/>
            <a:s r="182">
               <a:s>// QICoreMedicationDispenseNotDone
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotdispensed
define MedicationDispenseNotDone:
  </a:s>
               <a:s r="181">
                  <a:s>
                     <a:s r="174">
                        <a:s r="173">
                           <a:s r="173">
                              <a:s>[MedicationDispense]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> D</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="180">
                     <a:s>where </a:s>
                     <a:s r="180">
                        <a:s r="176">
                           <a:s r="175">
                              <a:s>D</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="176">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="179">
                           <a:s>{ </a:s>
                           <a:s r="177">
                              <a:s>'cancelled'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="178">
                              <a:s>'declined'</a:s>
                           </a:s>
                           <a:s> }</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="181" locator="202:3-203:49" xsi:type="Query">
            <source localId="174" locator="202:3-202:24" alias="D">
               <expression localId="173" locator="202:3-202:22" dataType="fhir:MedicationDispense" templateId="http://hl7.org/fhir/StructureDefinition/MedicationDispense" xsi:type="Retrieve"/>
            </source>
            <where localId="180" locator="203:5-203:49" xsi:type="In">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="176" locator="203:11-203:18" path="status" scope="D" xsi:type="Property"/>
               </operand>
               <operand localId="179" locator="203:23-203:49" xsi:type="List">
                  <element localId="177" locator="203:25-203:35" valueType="t:String" value="cancelled" xsi:type="Literal"/>
                  <element localId="178" locator="203:38-203:47" valueType="t:String" value="declined" xsi:type="Literal"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="194" locator="207:1-210:32" name="MedicationNotRequested" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotrequested"/>
            <a:s r="194">
               <a:s>// QICoreMedicationNotRequested
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotrequested
define MedicationNotRequested:
  </a:s>
               <a:s r="193">
                  <a:s>
                     <a:s r="184">
                        <a:s r="183">
                           <a:s r="183">
                              <a:s>[MedicationRequest]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> R</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="192">
                     <a:s>where </a:s>
                     <a:s r="192">
                        <a:s r="188">
                           <a:s r="186">
                              <a:s r="185">
                                 <a:s>R</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="186">
                                 <a:s>status</a:s>
                              </a:s>
                           </a:s>
                           <a:s> = </a:s>
                           <a:s r="187">
                              <a:s>'completed'</a:s>
                           </a:s>
                        </a:s>
                        <a:s>
      and </a:s>
                        <a:s r="191">
                           <a:s r="190">
                              <a:s r="189">
                                 <a:s>R</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="190">
                                 <a:s>doNotPerform</a:s>
                              </a:s>
                           </a:s>
                           <a:s> is true</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="193" locator="208:3-210:32" xsi:type="Query">
            <source localId="184" locator="208:3-208:23" alias="R">
               <expression localId="183" locator="208:3-208:21" dataType="fhir:MedicationRequest" templateId="http://hl7.org/fhir/StructureDefinition/MedicationRequest" xsi:type="Retrieve"/>
            </source>
            <where localId="192" locator="209:5-210:32" xsi:type="And">
               <operand localId="188" locator="209:11-209:32" xsi:type="Equal">
                  <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand localId="186" locator="209:11-209:18" path="status" scope="R" xsi:type="Property"/>
                  </operand>
                  <operand localId="187" locator="209:22-209:32" valueType="t:String" value="completed" xsi:type="Literal"/>
               </operand>
               <operand localId="191" locator="210:11-210:32" xsi:type="IsTrue">
                  <operand name="ToBoolean" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand localId="190" locator="210:11-210:24" path="doNotPerform" scope="R" xsi:type="Property"/>
                  </operand>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="210" locator="240:1-243:36" name="MedicationRequest" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest"/>
            <a:s r="210">
               <a:s>/*
define &quot;Antithrombotic Not Given at Discharge&quot;:
  [&quot;MedicationRequest&quot;: medication in &quot;Antithrombotic Therapy&quot;] NoAntithromboticDischarge
    where NoAntithromboticDischarge.doNotPerform is true
			and (NoAntithromboticDischarge.reasonCode in &quot;Medical Reason&quot;
				or NoAntithromboticDischarge.reasonCode in &quot;Patient Refusal&quot;)
      and exists (NoAntithromboticDischarge.category C where FHIRHelpers.ToConcept(C) ~ FC.&quot;Community&quot; or FHIRHelpers.ToConcept(C) ~ FC.&quot;Discharge&quot;)
      and NoAntithromboticDischarge.status = 'completed'
      and NoAntithromboticDischarge.intent = 'order'

define &quot;Antithrombotic Not Given at Discharge&quot;:
  QICore.MedicationNotRequested NoAntithromboticDischarge
    where NoAntithromboticDischarge.medication in &quot;Antithrombotic Therapy&quot;
      and (NoAntithromboticDischarge.reasonCode in &quot;Medical Reason&quot;
        or NoAntithromboticDischarge.reasonCode in &quot;Patient Refusal&quot;)
      and (NoAntithromboticDischarge.isCommunity() or NoAntithromboticDischarge.isDischarge())
      and NoAntithromboticDischarge.intent = 'order'

define &quot;Antithrombotic Not Given at Discharge&quot;:
  [&quot;MedicationNotRequested&quot;: medication in &quot;Antithrombotic Therapy&quot;] NoAntithromboticDischarge
    where (NoAntithromboticDischarge.reasonCode in &quot;Medical Reason&quot;
        or NoAntithromboticDischarge.reasonCode in &quot;Patient Refusal&quot;)
      and (NoAntithromboticDischarge.isCommunity() or NoAntithromboticDischarge.isDischarge())
      and NoAntithromboticDischarge.intent = 'order'
*/

// QICoreMedicationRequest
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequestdefine MedicationRequest:
  </a:s>
               <a:s r="209">
                  <a:s>
                     <a:s r="196">
                        <a:s r="195">
                           <a:s r="195">
                              <a:s>[MedicationRequest]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> R</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="208">
                     <a:s>where </a:s>
                     <a:s r="208">
                        <a:s r="204">
                           <a:s r="198">
                              <a:s r="197">
                                 <a:s>R</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="198">
                                 <a:s>status</a:s>
                              </a:s>
                           </a:s>
                           <a:s> in </a:s>
                           <a:s r="203">
                              <a:s>{ </a:s>
                              <a:s r="199">
                                 <a:s>'active'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="200">
                                 <a:s>'on-hold'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="201">
                                 <a:s>'completed'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="202">
                                 <a:s>'draft'</a:s>
                              </a:s>
                              <a:s> }</a:s>
                           </a:s>
                        </a:s>
                        <a:s>
      and </a:s>
                        <a:s r="207">
                           <a:s r="206">
                              <a:s r="205">
                                 <a:s>R</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="206">
                                 <a:s>doNotPerform</a:s>
                              </a:s>
                           </a:s>
                           <a:s> is not true</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="209" locator="241:3-243:36" xsi:type="Query">
            <source localId="196" locator="241:3-241:23" alias="R">
               <expression localId="195" locator="241:3-241:21" dataType="fhir:MedicationRequest" templateId="http://hl7.org/fhir/StructureDefinition/MedicationRequest" xsi:type="Retrieve"/>
            </source>
            <where localId="208" locator="242:5-243:36" xsi:type="And">
               <operand localId="204" locator="242:11-242:67" xsi:type="In">
                  <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand localId="198" locator="242:11-242:18" path="status" scope="R" xsi:type="Property"/>
                  </operand>
                  <operand localId="203" locator="242:23-242:67" xsi:type="List">
                     <element localId="199" locator="242:25-242:32" valueType="t:String" value="active" xsi:type="Literal"/>
                     <element localId="200" locator="242:35-242:43" valueType="t:String" value="on-hold" xsi:type="Literal"/>
                     <element localId="201" locator="242:46-242:56" valueType="t:String" value="completed" xsi:type="Literal"/>
                     <element localId="202" locator="242:59-242:65" valueType="t:String" value="draft" xsi:type="Literal"/>
                  </operand>
               </operand>
               <operand localId="207" locator="243:11-243:36" xsi:type="Not">
                  <operand locator="243:11-243:36" xsi:type="IsTrue">
                     <operand name="ToBoolean" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                        <operand localId="206" locator="243:11-243:24" path="doNotPerform" scope="R" xsi:type="Property"/>
                     </operand>
                  </operand>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="212" locator="268:1-269:23" name="MedicationStatement" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationstatement"/>
            <a:s r="212">
               <a:s>/*
define &quot;Antithrombotic Therapy at Discharge&quot;:
  [&quot;MedicationRequest&quot;: medication in &quot;Antithrombotic Therapy&quot;] Antithrombotic
    where exists (Antithrombotic.category C where FHIRHelpers.ToConcept(C) in { Global.&quot;Community&quot;, Global.&quot;Discharge&quot; })
      and Antithrombotic.status in { 'active', 'completed' }
      and Antithrombotic.intent.value = 'order'

define &quot;Antithrombotic Therapy at Discharge&quot;:
  QICore.MedicationRequest Antithrombotic
    where Antithrombotic.medication in &quot;Antithrombotic Therapy&quot;
      and (Antithrombotic.isCommunity() or Antithrombotic.isDischarge())
      and Antithrombotic.status in { 'active', 'completed' }
      and Antithrombotic.intent = 'order'

define &quot;Antithrombotic Therapy at Discharge&quot;:
  [MedicationRequest: medication in &quot;Antithrombotic Therapy&quot;] Antithrombotic
    where (Antithrombotic.isCommunity() or Antithrombotic.isDischarge())
      and Antithrombotic.status in { 'active', 'completed' }
      and Antithrombotic.intent = 'order'
*/

// QICoreMedicationStatement
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationstatementdefine MedicationStatement:
  </a:s>
               <a:s r="211">
                  <a:s>[MedicationStatement]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="211" locator="269:3-269:23" dataType="fhir:MedicationStatement" templateId="http://hl7.org/fhir/StructureDefinition/MedicationStatement" xsi:type="Retrieve"/>
      </def>
      <def localId="214" locator="273:1-274:18" name="NutritionOrder" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-nutritionorder"/>
            <a:s r="214">
               <a:s>// QICoreNutritionOrder
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-nutritionorder
define NutritionOrder:
  </a:s>
               <a:s r="213">
                  <a:s>[NutritionOrder]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="213" locator="274:3-274:18" dataType="fhir:NutritionOrder" templateId="http://hl7.org/fhir/StructureDefinition/NutritionOrder" xsi:type="Retrieve"/>
      </def>
      <def localId="227" locator="278:1-280:86" name="Observation" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation"/>
            <a:s r="227">
               <a:s>// QICoreObservation
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation
define Observation:
  </a:s>
               <a:s r="226">
                  <a:s>
                     <a:s r="216">
                        <a:s r="215">
                           <a:s r="215">
                              <a:s>[Observation]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> O</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="225">
                     <a:s>where </a:s>
                     <a:s r="225">
                        <a:s r="218">
                           <a:s r="217">
                              <a:s>O</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="218">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="224">
                           <a:s>{ </a:s>
                           <a:s r="219">
                              <a:s>'registered'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="220">
                              <a:s>'preliminary'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="221">
                              <a:s>'final'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="222">
                              <a:s>'amended'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="223">
                              <a:s>'corrected'</a:s>
                           </a:s>
                           <a:s> }</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="226" locator="279:3-280:86" xsi:type="Query">
            <source localId="216" locator="279:3-279:17" alias="O">
               <expression localId="215" locator="279:3-279:15" dataType="fhir:Observation" templateId="http://hl7.org/fhir/StructureDefinition/Observation" xsi:type="Retrieve"/>
            </source>
            <where localId="225" locator="280:5-280:86" xsi:type="In">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="218" locator="280:11-280:18" path="status" scope="O" xsi:type="Property"/>
               </operand>
               <operand localId="224" locator="280:23-280:86" xsi:type="List">
                  <element localId="219" locator="280:25-280:36" valueType="t:String" value="registered" xsi:type="Literal"/>
                  <element localId="220" locator="280:39-280:51" valueType="t:String" value="preliminary" xsi:type="Literal"/>
                  <element localId="221" locator="280:54-280:60" valueType="t:String" value="final" xsi:type="Literal"/>
                  <element localId="222" locator="280:63-280:71" valueType="t:String" value="amended" xsi:type="Literal"/>
                  <element localId="223" locator="280:74-280:84" valueType="t:String" value="corrected" xsi:type="Literal"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="235" locator="284:1-286:32" name="ObservationNotDone" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observationnotdone"/>
            <a:s r="235">
               <a:s>// QICoreObservationNotDone
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observationnotdone
define ObservationNotDone:
  </a:s>
               <a:s r="234">
                  <a:s>
                     <a:s r="229">
                        <a:s r="228">
                           <a:s r="228">
                              <a:s>[Observation]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> O</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="233">
                     <a:s>where </a:s>
                     <a:s r="233">
                        <a:s r="231">
                           <a:s r="230">
                              <a:s>O</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="231">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="232">
                           <a:s>'cancelled'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="234" locator="285:3-286:32" xsi:type="Query">
            <source localId="229" locator="285:3-285:17" alias="O">
               <expression localId="228" locator="285:3-285:15" dataType="fhir:Observation" templateId="http://hl7.org/fhir/StructureDefinition/Observation" xsi:type="Retrieve"/>
            </source>
            <where localId="233" locator="286:5-286:32" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="231" locator="286:11-286:18" path="status" scope="O" xsi:type="Property"/>
               </operand>
               <operand localId="232" locator="286:22-286:32" valueType="t:String" value="cancelled" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="237" locator="302:1-303:16" name="Organization" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-organization"/>
            <a:s r="237">
               <a:s>// FHIR Vital Signs

// USCore Smoking Status

// USCore Laboratory Result

// USCore Pediatric BMI for Age

// USCore Pediatric Weight for Height

// USCore Pulse Oximetry

// QICoreOrganization
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-organization
define Organization:
  </a:s>
               <a:s r="236">
                  <a:s>[Organization]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="236" locator="303:3-303:16" dataType="fhir:Organization" templateId="http://hl7.org/fhir/StructureDefinition/Organization" xsi:type="Retrieve"/>
      </def>
      <def localId="239" locator="312:1-313:16" name="Practitioner" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient&#xa;define Patient:&#xa;  [Patient]&#xa; QICorePractitioner"/>
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-practitioner"/>
            <a:s r="239">
               <a:s>// QICorePatient
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient
//define Patient:
//  [Patient]

// QICorePractitioner
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-practitioner
define Practitioner:
  </a:s>
               <a:s r="238">
                  <a:s>[Practitioner]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="238" locator="313:3-313:16" dataType="fhir:Practitioner" templateId="http://hl7.org/fhir/StructureDefinition/Practitioner" xsi:type="Retrieve"/>
      </def>
      <def localId="241" locator="317:1-318:20" name="PractitionerRole" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-practitionerrole"/>
            <a:s r="241">
               <a:s>// QICorePractitionerRole
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-practitionerrole
define PractitionerRole:
  </a:s>
               <a:s r="240">
                  <a:s>[PractitionerRole]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="240" locator="318:3-318:20" dataType="fhir:PractitionerRole" templateId="http://hl7.org/fhir/StructureDefinition/PractitionerRole" xsi:type="Retrieve"/>
      </def>
      <def localId="253" locator="322:1-324:78" name="Procedure" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure"/>
            <a:s r="253">
               <a:s>// QICoreProcedure
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure
define Procedure:
  </a:s>
               <a:s r="252">
                  <a:s>
                     <a:s r="243">
                        <a:s r="242">
                           <a:s r="242">
                              <a:s>[Procedure]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="251">
                     <a:s>where </a:s>
                     <a:s r="251">
                        <a:s r="245">
                           <a:s r="244">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="245">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="250">
                           <a:s>{ </a:s>
                           <a:s r="246">
                              <a:s>'preparation'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="247">
                              <a:s>'in-progress'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="248">
                              <a:s>'on-hold'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="249">
                              <a:s>'completed'</a:s>
                           </a:s>
                           <a:s> }</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="252" locator="323:3-324:78" xsi:type="Query">
            <source localId="243" locator="323:3-323:15" alias="P">
               <expression localId="242" locator="323:3-323:13" dataType="fhir:Procedure" templateId="http://hl7.org/fhir/StructureDefinition/Procedure" xsi:type="Retrieve"/>
            </source>
            <where localId="251" locator="324:5-324:78" xsi:type="In">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="245" locator="324:11-324:18" path="status" scope="P" xsi:type="Property"/>
               </operand>
               <operand localId="250" locator="324:23-324:78" xsi:type="List">
                  <element localId="246" locator="324:25-324:37" valueType="t:String" value="preparation" xsi:type="Literal"/>
                  <element localId="247" locator="324:40-324:52" valueType="t:String" value="in-progress" xsi:type="Literal"/>
                  <element localId="248" locator="324:55-324:63" valueType="t:String" value="on-hold" xsi:type="Literal"/>
                  <element localId="249" locator="324:66-324:76" valueType="t:String" value="completed" xsi:type="Literal"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="261" locator="326:1-328:32" name="ProcedurePerformed" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="261">
               <a:s>define ProcedurePerformed:
  </a:s>
               <a:s r="260">
                  <a:s>
                     <a:s r="255">
                        <a:s r="254">
                           <a:s>
                              <a:s>Procedure</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="259">
                     <a:s>where </a:s>
                     <a:s r="259">
                        <a:s r="257">
                           <a:s r="256">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="257">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="258">
                           <a:s>'completed'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="260" locator="327:3-328:32" xsi:type="Query">
            <source localId="255" locator="327:3-327:13" alias="P">
               <expression localId="254" locator="327:3-327:11" name="Procedure" xsi:type="ExpressionRef"/>
            </source>
            <where localId="259" locator="328:5-328:32" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="257" locator="328:11-328:18" path="status" scope="P" xsi:type="Property"/>
               </operand>
               <operand localId="258" locator="328:22-328:32" valueType="t:String" value="completed" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="269" locator="344:1-346:31" name="ProcedureNotDone" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedurenotdone"/>
            <a:s r="269">
               <a:s>/*
define &quot;Flexible Sigmoidoscopy Performed&quot;:
 [Procedure: &quot;Flexible Sigmoidoscopy&quot;] FlexibleSigmoidoscopy
	 where FlexibleSigmoidoscopy.status = 'completed'
		 and Global.&quot;Normalize Interval&quot;(FlexibleSigmoidoscopy.performed) ends 5 years or less on or before end of &quot;Measurement Period&quot;

define &quot;Flexible Sigmoidoscopy Performed&quot;:
  QICore.ProcedurePerformed FlexibleSigmoidoscopy
    where FlexibleSigmoidoscopy.code in &quot;Flexible Sigmoidoscopy&quot;
      and FlexibleSigmoidoscopy.performed.toInterval() ends 5 years or less on or before end of &quot;Measurement Period&quot;
*/

// QICoreProcedureNotDone
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedurenotdonedefine ProcedureNotDone:
  </a:s>
               <a:s r="268">
                  <a:s>
                     <a:s r="263">
                        <a:s r="262">
                           <a:s r="262">
                              <a:s>[Procedure]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="267">
                     <a:s>where </a:s>
                     <a:s r="267">
                        <a:s r="265">
                           <a:s r="264">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="265">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="266">
                           <a:s>'not-done'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="268" locator="345:3-346:31" xsi:type="Query">
            <source localId="263" locator="345:3-345:15" alias="P">
               <expression localId="262" locator="345:3-345:13" dataType="fhir:Procedure" templateId="http://hl7.org/fhir/StructureDefinition/Procedure" xsi:type="Retrieve"/>
            </source>
            <where localId="267" locator="346:5-346:31" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="265" locator="346:11-346:18" path="status" scope="P" xsi:type="Property"/>
               </operand>
               <operand localId="266" locator="346:22-346:31" valueType="t:String" value="not-done" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="271" locator="375:1-376:17" name="RelatedPerson" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-relatedperson"/>
            <a:s r="271">
               <a:s>/*
define &quot;No VTE Prophylaxis Device Applied&quot;:
  [&quot;Procedure&quot;: &quot;Device Application&quot;] DeviceApplied
    let DeviceNotDoneTiming: Global.GetExtension(DeviceApplied, 'qicore-recorded').value
    where (DeviceApplied.usedCode in &quot;Intermittent pneumatic compression devices (IPC)&quot;
      or DeviceApplied.usedCode in &quot;Venous foot pumps (VFP)&quot;
      or DeviceApplied.usedCode in &quot;Graduated compression stockings (GCS)&quot;
    )
      and  DeviceApplied.status = 'not-done'
    return {id: DeviceApplied.id, requestStatusReason: DeviceApplied.statusReason, authoredOn: DeviceNotDoneTiming}

define &quot;No VTE Prophylaxis Device Applied&quot;:
  QICore.ProcedureNotDone DeviceApplied
    where DeviceApplied.code in &quot;Device Application&quot;
      and (DeviceApplied.usedCode in &quot;Intermittent pneumatic compression devices (IPC)&quot;
        or DeviceApplied.usedCode in &quot;Venous foot pumps (VFP)&quot;
        or DeviceApplied.usedCode in &quot;Graduated compression stockings (GCS)&quot;)
    return {
      id: DeviceApplied.id,
      requestStatusReason: DeviceApplied.statusReason,
      authoredOn: DeviceApplied.recorded()
    }

*/

// QICoreRelatedPerson
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-relatedpersondefine RelatedPerson:
  </a:s>
               <a:s r="270">
                  <a:s>[RelatedPerson]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="270" locator="376:3-376:17" dataType="fhir:RelatedPerson" templateId="http://hl7.org/fhir/StructureDefinition/RelatedPerson" xsi:type="Retrieve"/>
      </def>
      <def localId="283" locator="380:1-383:33" name="ServiceNotRequested" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicenotrequested"/>
            <a:s r="283">
               <a:s>// QICoreServiceNotRequested
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicenotrequested
define ServiceNotRequested:
  </a:s>
               <a:s r="282">
                  <a:s>
                     <a:s r="273">
                        <a:s r="272">
                           <a:s r="272">
                              <a:s>[ServiceRequest]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> SR</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="281">
                     <a:s>where </a:s>
                     <a:s r="281">
                        <a:s r="277">
                           <a:s r="275">
                              <a:s r="274">
                                 <a:s>SR</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="275">
                                 <a:s>status</a:s>
                              </a:s>
                           </a:s>
                           <a:s> = </a:s>
                           <a:s r="276">
                              <a:s>'completed'</a:s>
                           </a:s>
                        </a:s>
                        <a:s>
      and </a:s>
                        <a:s r="280">
                           <a:s r="279">
                              <a:s r="278">
                                 <a:s>SR</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="279">
                                 <a:s>doNotPerform</a:s>
                              </a:s>
                           </a:s>
                           <a:s> is true</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="282" locator="381:3-383:33" xsi:type="Query">
            <source localId="273" locator="381:3-381:21" alias="SR">
               <expression localId="272" locator="381:3-381:18" dataType="fhir:ServiceRequest" templateId="http://hl7.org/fhir/StructureDefinition/ServiceRequest" xsi:type="Retrieve"/>
            </source>
            <where localId="281" locator="382:5-383:33" xsi:type="And">
               <operand localId="277" locator="382:11-382:33" xsi:type="Equal">
                  <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand localId="275" locator="382:11-382:19" path="status" scope="SR" xsi:type="Property"/>
                  </operand>
                  <operand localId="276" locator="382:23-382:33" valueType="t:String" value="completed" xsi:type="Literal"/>
               </operand>
               <operand localId="280" locator="383:11-383:33" xsi:type="IsTrue">
                  <operand name="ToBoolean" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand localId="279" locator="383:11-383:25" path="doNotPerform" scope="SR" xsi:type="Property"/>
                  </operand>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="299" locator="403:1-406:37" name="ServiceRequest" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest"/>
            <a:s r="299">
               <a:s>/*
define &quot;No VTE Prophylaxis Device Order&quot;:
  ([&quot;ServiceRequest&quot;: &quot;Venous foot pumps (VFP)&quot;]
    union [&quot;ServiceRequest&quot;: &quot;Intermittent pneumatic compression devices (IPC)&quot;]
    union [&quot;ServiceRequest&quot;: &quot;Graduated compression stockings (GCS)&quot;]
  ) DeviceOrder
    where DeviceOrder.status = 'completed'
      and DeviceOrder.doNotPerform is true

define &quot;No VTE Prophylaxis Device Order&quot;:
  QICore.ServiceNotRequested DeviceOrder
    where DeviceOrder.code in &quot;Venous foot pumps (VFP)&quot;
      or DeviceOrder.code in &quot;Intermittent pneumatic compression devices (IPC)&quot;
      or DeviceOrder.code in &quot;Graduated compression stockings (GCS)&quot;
*/

// QICoreServiceRequest
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequestdefine ServiceRequest:
  </a:s>
               <a:s r="298">
                  <a:s>
                     <a:s r="285">
                        <a:s r="284">
                           <a:s r="284">
                              <a:s>[ServiceRequest]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> SR</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="297">
                     <a:s>where </a:s>
                     <a:s r="297">
                        <a:s r="293">
                           <a:s r="287">
                              <a:s r="286">
                                 <a:s>SR</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="287">
                                 <a:s>status</a:s>
                              </a:s>
                           </a:s>
                           <a:s> in </a:s>
                           <a:s r="292">
                              <a:s>{ </a:s>
                              <a:s r="288">
                                 <a:s>'draft'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="289">
                                 <a:s>'active'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="290">
                                 <a:s>'on-hold'</a:s>
                              </a:s>
                              <a:s>, </a:s>
                              <a:s r="291">
                                 <a:s>'completed'</a:s>
                              </a:s>
                              <a:s> }</a:s>
                           </a:s>
                        </a:s>
                        <a:s>
      and </a:s>
                        <a:s r="296">
                           <a:s r="295">
                              <a:s r="294">
                                 <a:s>SR</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="295">
                                 <a:s>doNotPerform</a:s>
                              </a:s>
                           </a:s>
                           <a:s> is not true</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="298" locator="404:3-406:37" xsi:type="Query">
            <source localId="285" locator="404:3-404:21" alias="SR">
               <expression localId="284" locator="404:3-404:18" dataType="fhir:ServiceRequest" templateId="http://hl7.org/fhir/StructureDefinition/ServiceRequest" xsi:type="Retrieve"/>
            </source>
            <where localId="297" locator="405:5-406:37" xsi:type="And">
               <operand localId="293" locator="405:11-405:68" xsi:type="In">
                  <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand localId="287" locator="405:11-405:19" path="status" scope="SR" xsi:type="Property"/>
                  </operand>
                  <operand localId="292" locator="405:24-405:68" xsi:type="List">
                     <element localId="288" locator="405:26-405:32" valueType="t:String" value="draft" xsi:type="Literal"/>
                     <element localId="289" locator="405:35-405:42" valueType="t:String" value="active" xsi:type="Literal"/>
                     <element localId="290" locator="405:45-405:53" valueType="t:String" value="on-hold" xsi:type="Literal"/>
                     <element localId="291" locator="405:56-405:66" valueType="t:String" value="completed" xsi:type="Literal"/>
                  </operand>
               </operand>
               <operand localId="296" locator="406:11-406:37" xsi:type="Not">
                  <operand locator="406:11-406:37" xsi:type="IsTrue">
                     <operand name="ToBoolean" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                        <operand localId="295" locator="406:11-406:25" path="doNotPerform" scope="SR" xsi:type="Property"/>
                     </operand>
                  </operand>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="301" locator="431:1-432:12" name="Specimen" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-specimen"/>
            <a:s r="301">
               <a:s>/*
define &quot;Intervention Comfort Measures&quot;:
  ([&quot;ServiceRequest&quot;: &quot;Comfort Measures&quot;] P
    where P.intent = 'order'
  )
    union ([&quot;Procedure&quot;: &quot;Comfort Measures&quot;] InterventionPerformed
      where InterventionPerformed.status in {'completed', 'in-progress'}
    )

define &quot;Intervention Comfort Measures&quot;:
  (QICore.ServiceRequest SR
    where SR.code in &quot;Comfort Measures&quot;
      and SR.intent = 'order'
  )
    union (
      QICore.Procedure InterventionPerformed
        where InterventionPerformed.code in &quot;Comfort Measures&quot;
          and InterventionPerformed.status in { 'completed', 'in-progress' }
    )
*/

// QICoreSpecimen
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-specimendefine Specimen:
  </a:s>
               <a:s r="300">
                  <a:s>[Specimen]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="300" locator="432:3-432:12" dataType="fhir:Specimen" templateId="http://hl7.org/fhir/StructureDefinition/Specimen" xsi:type="Retrieve"/>
      </def>
      <def localId="303" locator="436:1-437:13" name="Substance" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-substance"/>
            <a:s r="303">
               <a:s>// QICoreSubstance
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-substance
define Substance:
  </a:s>
               <a:s r="302">
                  <a:s>[Substance]</a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="302" locator="437:3-437:13" dataType="fhir:Substance" templateId="http://hl7.org/fhir/StructureDefinition/Substance" xsi:type="Retrieve"/>
      </def>
      <def localId="319" locator="441:1-443:118" name="Task" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-task"/>
            <a:s r="319">
               <a:s>// QICoreTask
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-task
define Task:
  </a:s>
               <a:s r="318">
                  <a:s>
                     <a:s r="305">
                        <a:s r="304">
                           <a:s r="304">
                              <a:s>[Task]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> T</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="317">
                     <a:s>where </a:s>
                     <a:s r="317">
                        <a:s r="307">
                           <a:s r="306">
                              <a:s>T</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="307">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="316">
                           <a:s>{ </a:s>
                           <a:s r="308">
                              <a:s>'draft'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="309">
                              <a:s>'requested'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="310">
                              <a:s>'received'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="311">
                              <a:s>'accepted'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="312">
                              <a:s>'ready'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="313">
                              <a:s>'in-progress'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="314">
                              <a:s>'on-hold'</a:s>
                           </a:s>
                           <a:s>, </a:s>
                           <a:s r="315">
                              <a:s>'completed'</a:s>
                           </a:s>
                           <a:s> }</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="318" locator="442:3-443:118" xsi:type="Query">
            <source localId="305" locator="442:3-442:10" alias="T">
               <expression localId="304" locator="442:3-442:8" dataType="fhir:Task" templateId="http://hl7.org/fhir/StructureDefinition/Task" xsi:type="Retrieve"/>
            </source>
            <where localId="317" locator="443:5-443:118" xsi:type="In">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="307" locator="443:11-443:18" path="status" scope="T" xsi:type="Property"/>
               </operand>
               <operand localId="316" locator="443:23-443:118" xsi:type="List">
                  <element localId="308" locator="443:25-443:31" valueType="t:String" value="draft" xsi:type="Literal"/>
                  <element localId="309" locator="443:34-443:44" valueType="t:String" value="requested" xsi:type="Literal"/>
                  <element localId="310" locator="443:47-443:56" valueType="t:String" value="received" xsi:type="Literal"/>
                  <element localId="311" locator="443:59-443:68" valueType="t:String" value="accepted" xsi:type="Literal"/>
                  <element localId="312" locator="443:71-443:77" valueType="t:String" value="ready" xsi:type="Literal"/>
                  <element localId="313" locator="443:80-443:92" valueType="t:String" value="in-progress" xsi:type="Literal"/>
                  <element localId="314" locator="443:95-443:103" valueType="t:String" value="on-hold" xsi:type="Literal"/>
                  <element localId="315" locator="443:106-443:116" valueType="t:String" value="completed" xsi:type="Literal"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="327" locator="448:1-450:31" name="TaskNotDone" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:t name="profile" value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-tasknotdone&#xa; TODO: What about cancelled and failed?"/>
            <a:s r="327">
               <a:s>// QICoreTaskNotDone
// @profile: http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-tasknotdone
// TODO: What about cancelled and failed?
define TaskNotDone:
  </a:s>
               <a:s r="326">
                  <a:s>
                     <a:s r="321">
                        <a:s r="320">
                           <a:s r="320">
                              <a:s>[Task]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> T</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="325">
                     <a:s>where </a:s>
                     <a:s r="325">
                        <a:s r="323">
                           <a:s r="322">
                              <a:s>T</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="323">
                              <a:s>status</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="324">
                           <a:s>'rejected'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="326" locator="449:3-450:31" xsi:type="Query">
            <source localId="321" locator="449:3-449:10" alias="T">
               <expression localId="320" locator="449:3-449:8" dataType="fhir:Task" templateId="http://hl7.org/fhir/StructureDefinition/Task" xsi:type="Retrieve"/>
            </source>
            <where localId="325" locator="450:5-450:31" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="323" locator="450:11-450:18" path="status" scope="T" xsi:type="Property"/>
               </operand>
               <operand localId="324" locator="450:22-450:31" valueType="t:String" value="rejected" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="335" locator="452:1-454:27" name="TestPatientGender" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="335">
               <a:s>define TestPatientGender:
  </a:s>
               <a:s r="334">
                  <a:s>
                     <a:s r="329">
                        <a:s r="328">
                           <a:s>
                              <a:s>Patient</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="333">
                     <a:s>where </a:s>
                     <a:s r="333">
                        <a:s r="331">
                           <a:s r="330">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="331">
                              <a:s>gender</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="332">
                           <a:s>'male'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="334" locator="453:3-454:27" xsi:type="Query">
            <source localId="329" locator="453:3-453:11" alias="P">
               <expression localId="328" locator="453:3-453:9" name="Patient" xsi:type="ExpressionRef"/>
            </source>
            <where localId="333" locator="454:5-454:27" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="331" locator="454:11-454:18" path="gender" scope="P" xsi:type="Property"/>
               </operand>
               <operand localId="332" locator="454:22-454:27" valueType="t:String" value="male" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="342" locator="456:1-458:26" name="TestPatientActive" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="342">
               <a:s>define TestPatientActive:
  </a:s>
               <a:s r="341">
                  <a:s>
                     <a:s r="337">
                        <a:s r="336">
                           <a:s>
                              <a:s>Patient</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="340">
                     <a:s>where </a:s>
                     <a:s r="340">
                        <a:s r="339">
                           <a:s r="338">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="339">
                              <a:s>active</a:s>
                           </a:s>
                        </a:s>
                        <a:s> is true</a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="341" locator="457:3-458:26" xsi:type="Query">
            <source localId="337" locator="457:3-457:11" alias="P">
               <expression localId="336" locator="457:3-457:9" name="Patient" xsi:type="ExpressionRef"/>
            </source>
            <where localId="340" locator="458:5-458:26" xsi:type="IsTrue">
               <operand name="ToBoolean" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="339" locator="458:11-458:18" path="active" scope="P" xsi:type="Property"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="350" locator="460:1-462:36" name="TestPatientBirthDate" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="350">
               <a:s>define TestPatientBirthDate:
  </a:s>
               <a:s r="349">
                  <a:s>
                     <a:s r="344">
                        <a:s r="343">
                           <a:s>
                              <a:s>Patient</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="348">
                     <a:s>where </a:s>
                     <a:s r="348">
                        <a:s r="346">
                           <a:s r="345">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="346">
                              <a:s>birthDate</a:s>
                           </a:s>
                        </a:s>
                        <a:s r="348"> before </a:s>
                        <a:s r="347">
                           <a:s>Today()</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="349" locator="461:3-462:36" xsi:type="Query">
            <source localId="344" locator="461:3-461:11" alias="P">
               <expression localId="343" locator="461:3-461:9" name="Patient" xsi:type="ExpressionRef"/>
            </source>
            <where localId="348" locator="462:5-462:36" xsi:type="Before">
               <operand name="ToDate" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="346" locator="462:11-462:21" path="birthDate" scope="P" xsi:type="Property"/>
               </operand>
               <operand localId="347" locator="462:30-462:36" xsi:type="Today"/>
            </where>
         </expression>
      </def>
      <def localId="358" locator="464:1-466:45" name="TestPatientMaritalStatusMembership" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="358">
               <a:s>define TestPatientMaritalStatusMembership:
  </a:s>
               <a:s r="357">
                  <a:s>
                     <a:s r="352">
                        <a:s r="351">
                           <a:s>
                              <a:s>Patient</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="356">
                     <a:s>where </a:s>
                     <a:s r="356">
                        <a:s r="354">
                           <a:s r="353">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="354">
                              <a:s>maritalStatus</a:s>
                           </a:s>
                        </a:s>
                        <a:s> in </a:s>
                        <a:s r="355">
                           <a:s>&quot;Marital Status&quot;</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="357" locator="465:3-466:45" xsi:type="Query">
            <source localId="352" locator="465:3-465:11" alias="P">
               <expression localId="351" locator="465:3-465:9" name="Patient" xsi:type="ExpressionRef"/>
            </source>
            <where localId="356" locator="466:5-466:45" xsi:type="InValueSet">
               <code name="ToConcept" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="354" locator="466:11-466:25" path="maritalStatus" scope="P" xsi:type="Property"/>
               </code>
               <valueset localId="355" locator="466:30-466:45" name="Marital Status"/>
            </where>
         </expression>
      </def>
      <def localId="366" locator="468:1-470:54" name="TestPatientMartialStatusComparison" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="366">
               <a:s>define TestPatientMartialStatusComparison:
  </a:s>
               <a:s r="365">
                  <a:s>
                     <a:s r="360">
                        <a:s r="359">
                           <a:s>
                              <a:s>Patient</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="364">
                     <a:s>where </a:s>
                     <a:s r="364">
                        <a:s r="362">
                           <a:s r="361">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="362">
                              <a:s>maritalStatus</a:s>
                           </a:s>
                        </a:s>
                        <a:s> ~ </a:s>
                        <a:s r="363">
                           <a:s>&quot;Marital Status - Married&quot;</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="365" locator="469:3-470:54" xsi:type="Query">
            <source localId="360" locator="469:3-469:11" alias="P">
               <expression localId="359" locator="469:3-469:9" name="Patient" xsi:type="ExpressionRef"/>
            </source>
            <where localId="364" locator="470:5-470:54" xsi:type="Equivalent">
               <operand name="ToConcept" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="362" locator="470:11-470:25" path="maritalStatus" scope="P" xsi:type="Property"/>
               </operand>
               <operand xsi:type="ToConcept">
                  <operand localId="363" locator="470:29-470:54" name="Marital Status - Married" xsi:type="CodeRef"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="373" locator="472:1-474:29" name="TestPatientDeceasedAsBoolean" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="373">
               <a:s>define TestPatientDeceasedAsBoolean:
  </a:s>
               <a:s r="372">
                  <a:s>
                     <a:s r="368">
                        <a:s r="367">
                           <a:s>
                              <a:s>Patient</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="371">
                     <a:s>where </a:s>
                     <a:s r="371">
                        <a:s r="370">
                           <a:s r="369">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="370">
                              <a:s>deceased</a:s>
                           </a:s>
                        </a:s>
                        <a:s> is false</a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="372" locator="473:3-474:29" xsi:type="Query">
            <source localId="368" locator="473:3-473:11" alias="P">
               <expression localId="367" locator="473:3-473:9" name="Patient" xsi:type="ExpressionRef"/>
            </source>
            <where localId="371" locator="474:5-474:29" xsi:type="IsFalse">
               <operand name="ToBoolean" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand asType="fhir:boolean" xsi:type="As">
                     <operand localId="370" locator="474:11-474:20" path="deceased" scope="P" xsi:type="Property"/>
                  </operand>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="381" locator="476:1-478:35" name="TestPatientDeceasedAsDateTime" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="381">
               <a:s>define TestPatientDeceasedAsDateTime:
  </a:s>
               <a:s r="380">
                  <a:s>
                     <a:s r="375">
                        <a:s r="374">
                           <a:s>
                              <a:s>Patient</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="379">
                     <a:s>where </a:s>
                     <a:s r="379">
                        <a:s r="377">
                           <a:s r="376">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="377">
                              <a:s>deceased</a:s>
                           </a:s>
                        </a:s>
                        <a:s r="379"> before </a:s>
                        <a:s r="378">
                           <a:s>Today()</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="380" locator="477:3-478:35" xsi:type="Query">
            <source localId="375" locator="477:3-477:11" alias="P">
               <expression localId="374" locator="477:3-477:9" name="Patient" xsi:type="ExpressionRef"/>
            </source>
            <where localId="379" locator="478:5-478:35" xsi:type="Before">
               <operand name="ToDateTime" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand asType="fhir:dateTime" xsi:type="As">
                     <operand localId="377" locator="478:11-478:20" path="deceased" scope="P" xsi:type="Property"/>
                  </operand>
               </operand>
               <operand xsi:type="ToDateTime">
                  <operand localId="378" locator="478:29-478:35" xsi:type="Today"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="422" locator="480:1-487:41" name="TestSlices" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="422">
               <a:s>define TestSlices:
  </a:s>
               <a:s r="421">
                  <a:s>
                     <a:s r="383">
                        <a:s r="382">
                           <a:s r="382">
                              <a:s>[Observation: </a:s>
                              <a:s>
                                 <a:s>&quot;Blood pressure&quot;</a:s>
                              </a:s>
                              <a:s>]</a:s>
                           </a:s>
                        </a:s>
                        <a:s> O</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s>
                     <a:s>let
      </a:s>
                     <a:s r="392">
                        <a:s>systolicBP: </a:s>
                        <a:s r="391">
                           <a:s>singleton from </a:s>
                           <a:s r="390">
                              <a:s>(</a:s>
                              <a:s r="390">
                                 <a:s>
                                    <a:s r="385">
                                       <a:s r="384">
                                          <a:s>
                                             <a:s>O.component</a:s>
                                          </a:s>
                                       </a:s>
                                       <a:s> SBP</a:s>
                                    </a:s>
                                 </a:s>
                                 <a:s> </a:s>
                                 <a:s r="389">
                                    <a:s>where </a:s>
                                    <a:s r="389">
                                       <a:s r="387">
                                          <a:s r="386">
                                             <a:s>SBP</a:s>
                                          </a:s>
                                          <a:s>.</a:s>
                                          <a:s r="387">
                                             <a:s>code</a:s>
                                          </a:s>
                                       </a:s>
                                       <a:s> ~ </a:s>
                                       <a:s r="388">
                                          <a:s>&quot;Systolic blood pressure&quot;</a:s>
                                       </a:s>
                                    </a:s>
                                 </a:s>
                              </a:s>
                              <a:s>)</a:s>
                           </a:s>
                        </a:s>
                     </a:s>
                     <a:s>,
      </a:s>
                     <a:s r="401">
                        <a:s>diastolicBP: </a:s>
                        <a:s r="400">
                           <a:s>singleton from </a:s>
                           <a:s r="399">
                              <a:s>(</a:s>
                              <a:s r="399">
                                 <a:s>
                                    <a:s r="394">
                                       <a:s r="393">
                                          <a:s>
                                             <a:s>O.component</a:s>
                                          </a:s>
                                       </a:s>
                                       <a:s> DBP</a:s>
                                    </a:s>
                                 </a:s>
                                 <a:s> </a:s>
                                 <a:s r="398">
                                    <a:s>where </a:s>
                                    <a:s r="398">
                                       <a:s r="396">
                                          <a:s r="395">
                                             <a:s>DBP</a:s>
                                          </a:s>
                                          <a:s>.</a:s>
                                          <a:s r="396">
                                             <a:s>code</a:s>
                                          </a:s>
                                       </a:s>
                                       <a:s> ~ </a:s>
                                       <a:s r="397">
                                          <a:s>&quot;Diastolic blood pressure&quot;</a:s>
                                       </a:s>
                                    </a:s>
                                 </a:s>
                              </a:s>
                              <a:s>)</a:s>
                           </a:s>
                        </a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="420">
                     <a:s>where </a:s>
                     <a:s r="420">
                        <a:s r="415">
                           <a:s r="410">
                              <a:s r="403">
                                 <a:s r="402">
                                    <a:s>O</a:s>
                                 </a:s>
                                 <a:s>.</a:s>
                                 <a:s r="403">
                                    <a:s>status</a:s>
                                 </a:s>
                              </a:s>
                              <a:s> in </a:s>
                              <a:s r="409">
                                 <a:s>{ </a:s>
                                 <a:s r="404">
                                    <a:s>'registered'</a:s>
                                 </a:s>
                                 <a:s>, </a:s>
                                 <a:s r="405">
                                    <a:s>'preliminary'</a:s>
                                 </a:s>
                                 <a:s>, </a:s>
                                 <a:s r="406">
                                    <a:s>'final'</a:s>
                                 </a:s>
                                 <a:s>, </a:s>
                                 <a:s r="407">
                                    <a:s>'amended'</a:s>
                                 </a:s>
                                 <a:s>, </a:s>
                                 <a:s r="408">
                                    <a:s>'corrected'</a:s>
                                 </a:s>
                                 <a:s> }</a:s>
                              </a:s>
                           </a:s>
                           <a:s>
      and </a:s>
                           <a:s r="414">
                              <a:s r="412">
                                 <a:s r="411">
                                    <a:s>systolicBP</a:s>
                                 </a:s>
                                 <a:s>.</a:s>
                                 <a:s r="412">
                                    <a:s>value</a:s>
                                 </a:s>
                              </a:s>
                              <a:s> &lt; </a:s>
                              <a:s r="413">
                                 <a:s>140 'mm[Hg]'</a:s>
                              </a:s>
                           </a:s>
                        </a:s>
                        <a:s>
      and </a:s>
                        <a:s r="419">
                           <a:s r="417">
                              <a:s r="416">
                                 <a:s>diastolicBP</a:s>
                              </a:s>
                              <a:s>.</a:s>
                              <a:s r="417">
                                 <a:s>value</a:s>
                              </a:s>
                           </a:s>
                           <a:s> &lt; </a:s>
                           <a:s r="418">
                              <a:s>90 'mm[Hg]'</a:s>
                           </a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="421" locator="481:3-487:41" xsi:type="Query">
            <source localId="383" locator="481:3-481:35" alias="O">
               <expression localId="382" locator="481:3-481:33" dataType="fhir:Observation" templateId="http://hl7.org/fhir/StructureDefinition/Observation" codeProperty="code" codeComparator="~" xsi:type="Retrieve">
                  <codes xsi:type="ToList">
                     <operand locator="481:17-481:32" name="Blood pressure" xsi:type="CodeRef"/>
                  </codes>
               </expression>
            </source>
            <let localId="392" locator="483:7-483:93" identifier="systolicBP">
               <expression localId="391" locator="483:19-483:93" xsi:type="SingletonFrom">
                  <operand localId="390" locator="483:34-483:93" xsi:type="Query">
                     <source localId="385" locator="483:35-483:49" alias="SBP">
                        <expression localId="384" locator="483:35-483:45" path="component" scope="O" xsi:type="Property"/>
                     </source>
                     <where localId="389" locator="483:51-483:92" xsi:type="Equivalent">
                        <operand name="ToConcept" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                           <operand localId="387" locator="483:57-483:64" path="code" scope="SBP" xsi:type="Property"/>
                        </operand>
                        <operand xsi:type="ToConcept">
                           <operand localId="388" locator="483:68-483:92" name="Systolic blood pressure" xsi:type="CodeRef"/>
                        </operand>
                     </where>
                  </operand>
               </expression>
            </let>
            <let localId="401" locator="484:7-484:95" identifier="diastolicBP">
               <expression localId="400" locator="484:20-484:95" xsi:type="SingletonFrom">
                  <operand localId="399" locator="484:35-484:95" xsi:type="Query">
                     <source localId="394" locator="484:36-484:50" alias="DBP">
                        <expression localId="393" locator="484:36-484:46" path="component" scope="O" xsi:type="Property"/>
                     </source>
                     <where localId="398" locator="484:52-484:94" xsi:type="Equivalent">
                        <operand name="ToConcept" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                           <operand localId="396" locator="484:58-484:65" path="code" scope="DBP" xsi:type="Property"/>
                        </operand>
                        <operand xsi:type="ToConcept">
                           <operand localId="397" locator="484:69-484:94" name="Diastolic blood pressure" xsi:type="CodeRef"/>
                        </operand>
                     </where>
                  </operand>
               </expression>
            </let>
            <where localId="420" locator="485:5-487:41" xsi:type="And">
               <operand localId="415" locator="485:11-486:41" xsi:type="And">
                  <operand localId="410" locator="485:11-485:86" xsi:type="In">
                     <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                        <operand localId="403" locator="485:11-485:18" path="status" scope="O" xsi:type="Property"/>
                     </operand>
                     <operand localId="409" locator="485:23-485:86" xsi:type="List">
                        <element localId="404" locator="485:25-485:36" valueType="t:String" value="registered" xsi:type="Literal"/>
                        <element localId="405" locator="485:39-485:51" valueType="t:String" value="preliminary" xsi:type="Literal"/>
                        <element localId="406" locator="485:54-485:60" valueType="t:String" value="final" xsi:type="Literal"/>
                        <element localId="407" locator="485:63-485:71" valueType="t:String" value="amended" xsi:type="Literal"/>
                        <element localId="408" locator="485:74-485:84" valueType="t:String" value="corrected" xsi:type="Literal"/>
                     </operand>
                  </operand>
                  <operand localId="414" locator="486:11-486:41" xsi:type="Less">
                     <operand name="ToQuantity" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                        <operand asType="fhir:Quantity" xsi:type="As">
                           <operand localId="412" locator="486:11-486:26" path="value" xsi:type="Property">
                              <source localId="411" locator="486:11-486:20" name="systolicBP" xsi:type="QueryLetRef"/>
                           </operand>
                        </operand>
                     </operand>
                     <operand localId="413" locator="486:30-486:41" value="140" unit="mm[Hg]" xsi:type="Quantity"/>
                  </operand>
               </operand>
               <operand localId="419" locator="487:11-487:41" xsi:type="Less">
                  <operand name="ToQuantity" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                     <operand asType="fhir:Quantity" xsi:type="As">
                        <operand localId="417" locator="487:11-487:27" path="value" xsi:type="Property">
                           <source localId="416" locator="487:11-487:21" name="diastolicBP" xsi:type="QueryLetRef"/>
                        </operand>
                     </operand>
                  </operand>
                  <operand localId="418" locator="487:31-487:41" value="90" unit="mm[Hg]" xsi:type="Quantity"/>
               </operand>
            </where>
         </expression>
      </def>
      <def localId="430" locator="489:1-491:28" name="TestSimpleExtensions" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="430">
               <a:s>define TestSimpleExtensions:
  </a:s>
               <a:s r="429">
                  <a:s>
                     <a:s r="424">
                        <a:s r="423">
                           <a:s>
                              <a:s>Patient</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="428">
                     <a:s>where </a:s>
                     <a:s r="428">
                        <a:s r="426">
                           <a:s r="425">
                              <a:s>P</a:s>
                           </a:s>
                           <a:s>.</a:s>
                           <a:s r="426">
                              <a:s>birthsex()</a:s>
                           </a:s>
                        </a:s>
                        <a:s> = </a:s>
                        <a:s r="427">
                           <a:s>'M'</a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="429" locator="490:3-491:28" xsi:type="Query">
            <source localId="424" locator="490:3-490:11" alias="P">
               <expression localId="423" locator="490:3-490:9" name="Patient" xsi:type="ExpressionRef"/>
            </source>
            <where localId="428" locator="491:5-491:28" xsi:type="Equal">
               <operand name="ToString" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                  <operand localId="426" locator="491:11-491:22" name="birthsex" libraryName="Common" xsi:type="FunctionRef">
                     <operand localId="425" locator="491:11" name="P" xsi:type="AliasRef"/>
                  </operand>
               </operand>
               <operand localId="427" locator="491:26-491:28" valueType="t:String" value="M" xsi:type="Literal"/>
            </where>
         </expression>
      </def>
      <def localId="453" locator="493:1-496:66" name="TestComplexExtensions" context="Patient" accessLevel="Public">
         <annotation xsi:type="a:Annotation">
            <a:s r="453">
               <a:s>define TestComplexExtensions:
  </a:s>
               <a:s r="452">
                  <a:s>
                     <a:s r="432">
                        <a:s r="431">
                           <a:s>
                              <a:s>Patient</a:s>
                           </a:s>
                        </a:s>
                        <a:s> P</a:s>
                     </a:s>
                  </a:s>
                  <a:s>
    </a:s>
                  <a:s r="451">
                     <a:s>where </a:s>
                     <a:s r="451">
                        <a:s r="441">
                           <a:s>exists </a:s>
                           <a:s r="440">
                              <a:s>(</a:s>
                              <a:s r="440">
                                 <a:s>
                                    <a:s r="436">
                                       <a:s r="435">
                                          <a:s>(</a:s>
                                          <a:s r="435">
                                             <a:s r="434">
                                                <a:s r="433">
                                                   <a:s>P</a:s>
                                                </a:s>
                                                <a:s>.</a:s>
                                                <a:s r="434">
                                                   <a:s>race()</a:s>
                                                </a:s>
                                             </a:s>
                                             <a:s>.</a:s>
                                             <a:s r="435">
                                                <a:s>ombCategory</a:s>
                                             </a:s>
                                          </a:s>
                                          <a:s>)</a:s>
                                       </a:s>
                                       <a:s> C</a:s>
                                    </a:s>
                                 </a:s>
                                 <a:s> </a:s>
                                 <a:s r="439">
                                    <a:s>where </a:s>
                                    <a:s r="439">
                                       <a:s r="437">
                                          <a:s>C</a:s>
                                       </a:s>
                                       <a:s> ~ </a:s>
                                       <a:s r="438">
                                          <a:s>&quot;American Indian or Alaska Native&quot;</a:s>
                                       </a:s>
                                    </a:s>
                                 </a:s>
                              </a:s>
                              <a:s>)</a:s>
                           </a:s>
                        </a:s>
                        <a:s>
      and </a:s>
                        <a:s r="450">
                           <a:s>exists </a:s>
                           <a:s r="449">
                              <a:s>(</a:s>
                              <a:s r="449">
                                 <a:s>
                                    <a:s r="445">
                                       <a:s r="444">
                                          <a:s>(</a:s>
                                          <a:s r="444">
                                             <a:s r="443">
                                                <a:s r="442">
                                                   <a:s>P</a:s>
                                                </a:s>
                                                <a:s>.</a:s>
                                                <a:s r="443">
                                                   <a:s>race()</a:s>
                                                </a:s>
                                             </a:s>
                                             <a:s>.</a:s>
                                             <a:s r="444">
                                                <a:s>detailed</a:s>
                                             </a:s>
                                          </a:s>
                                          <a:s>)</a:s>
                                       </a:s>
                                       <a:s> C</a:s>
                                    </a:s>
                                 </a:s>
                                 <a:s> </a:s>
                                 <a:s r="448">
                                    <a:s>where </a:s>
                                    <a:s r="448">
                                       <a:s r="446">
                                          <a:s>C</a:s>
                                       </a:s>
                                       <a:s> ~ </a:s>
                                       <a:s r="447">
                                          <a:s>&quot;Alaska Native&quot;</a:s>
                                       </a:s>
                                    </a:s>
                                 </a:s>
                              </a:s>
                              <a:s>)</a:s>
                           </a:s>
                        </a:s>
                     </a:s>
                  </a:s>
               </a:s>
            </a:s>
         </annotation>
         <expression localId="452" locator="494:3-496:66" xsi:type="Query">
            <source localId="432" locator="494:3-494:11" alias="P">
               <expression localId="431" locator="494:3-494:9" name="Patient" xsi:type="ExpressionRef"/>
            </source>
            <where localId="451" locator="495:5-496:66" xsi:type="And">
               <operand localId="441" locator="495:11-495:88" xsi:type="Exists">
                  <operand localId="440" locator="495:18-495:88" xsi:type="Query">
                     <source localId="436" locator="495:19-495:42" alias="C">
                        <expression localId="435" locator="495:19-495:40" path="ombCategory" xsi:type="Property">
                           <source localId="434" locator="495:20-495:27" name="race" libraryName="Common" xsi:type="FunctionRef">
                              <operand localId="433" locator="495:20" name="P" xsi:type="AliasRef"/>
                           </source>
                        </expression>
                     </source>
                     <where localId="439" locator="495:44-495:87" xsi:type="Equivalent">
                        <operand name="ToCode" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                           <operand localId="437" locator="495:50" name="C" xsi:type="AliasRef"/>
                        </operand>
                        <operand localId="438" locator="495:54-495:87" name="American Indian or Alaska Native" xsi:type="CodeRef"/>
                     </where>
                  </operand>
               </operand>
               <operand localId="450" locator="496:11-496:66" xsi:type="Exists">
                  <operand localId="449" locator="496:18-496:66" xsi:type="Query">
                     <source localId="445" locator="496:19-496:39" alias="C">
                        <expression localId="444" locator="496:19-496:37" path="detailed" xsi:type="Property">
                           <source localId="443" locator="496:20-496:27" name="race" libraryName="Common" xsi:type="FunctionRef">
                              <operand localId="442" locator="496:20" name="P" xsi:type="AliasRef"/>
                           </source>
                        </expression>
                     </source>
                     <where localId="448" locator="496:41-496:65" xsi:type="Equivalent">
                        <operand name="ToCode" libraryName="FHIRHelpers" xsi:type="FunctionRef">
                           <operand localId="446" locator="496:47" name="C" xsi:type="AliasRef"/>
                        </operand>
                        <operand localId="447" locator="496:51-496:65" name="Alaska Native" xsi:type="CodeRef"/>
                     </where>
                  </operand>
               </operand>
            </where>
         </expression>
      </def>
   </statements>
</library>
