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

<Measure xmlns="http://hl7.org/fhir">
  <id value="AtriusCMS131DiabetesEyeExam"/>
  <meta>
    <profile value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablemeasure|2.0.0"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm|4.0.0"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/publishable-measure-cqfm|4.0.0"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/executable-measure-cqfm|4.0.0"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cql-measure-cqfm|4.0.0"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/elm-measure-cqfm|4.0.0"/>
    <profile value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm|4.0.0"/>
  </meta>
  <language value="en"/>
  <text>
    <status value="extensions"/><div xmlns="http://www.w3.org/1999/xhtml">
  <table class="narrative-table">
    <tbody>
<tr>


<th colspan="2" scope="row" class="row-header">Metadata</th>


</tr>

<tr>


<th scope="row" class="row-header">Title</th>



<td class="content-container">Diabetes: Eye Exam (Atrius CMS131)</td>


</tr>



<tr>


<th scope="row" class="row-header">Version</th>



<td class="content-container">0.1.0</td>


</tr>


  
<tr>


<th scope="row" class="row-header">Short Name</th>



<td class="content-container">CMS131</td>


</tr>



  
<tr>


<th scope="row" class="row-header">GUID (Version Independent)</th>



<td class="content-container">urn:uuid:97af11c3-97fc-4600-b66b-4202728b6257</td>


</tr>



  
<tr>


<th scope="row" class="row-header">GUID (Version Specific)</th>



<td class="content-container">urn:uuid:3a269f10-2b17-42d3-9ba3-48ecbc3c63c2</td>


</tr>





  
<tr>


<th scope="row" class="row-header">Identifier</th>



<td class="content-container">AtriusCMS131DiabetesEyeExam</td>


</tr>


  
<tr>


<th scope="row" class="row-header">Identifier</th>



<td class="content-container">urn:oid:1.3.6.1.4.1.66219.1.29.4</td>


</tr>







<tr>


<th scope="row" class="row-header">Status</th>



<td class="content-container">Draft</td>


</tr>




<tr>


<th scope="row" class="row-header">Experimental</th>



<td class="content-container">true</td>


</tr>












<tr>


<th scope="row" class="row-header">Steward (Publisher)</th>



<td class="content-container">Atrius</td>


</tr>



<tr>


<th scope="row" class="row-header">Steward Contact</th>



<td class="content-container">Atrius</td>


</tr>







<tr>


<th scope="row" class="row-header">Description</th>



<td class="content-container"><div><p>Proportion measure: adults 18–75 with diabetes and a qualifying outpatient encounter who have a retinal or autonomous eye exam in the required lookback. Process measure; improvement is increase.</p>
</div></td>


</tr>






  
<tr>


<th scope="row" class="row-header">Measure Basis</th>



<td class="content-container">boolean</td>


</tr>



<tr>


<th scope="row" class="row-header">Measure Scoring</th>



<td class="content-container">
    proportion from <a href="http://terminology.hl7.org/7.2.0/CodeSystem-measure-scoring.html">http://terminology.hl7.org/CodeSystem/measure-scoring</a> 


</td>


</tr>




<tr>


<th scope="row" class="row-header">Improvement Notation</th>



<td class="content-container">
    increase from <a href="http://terminology.hl7.org/7.2.0/CodeSystem-measure-improvement-notation.html">http://terminology.hl7.org/CodeSystem/measure-improvement-notation</a> 


</td>


</tr>




<tr>


<th scope="row" class="row-header">Measure Type</th>



<td class="content-container">
    process from <a href="http://terminology.hl7.org/7.2.0/CodeSystem-measure-type.html">http://terminology.hl7.org/CodeSystem/measure-type</a> 


</td>


</tr>







<tr>
  
  
  
  
  

<th scope="row" class="row-header">Dependency</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Atrius CMS131 CQL Library
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="Library-AtriusCMS131DiabetesEyeExam.html">Atrius CMS131 Diabetes Eye Exam CQL</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/Library/AtriusCMS131DiabetesEyeExam|0.1.0</tt>
    
    
    
  </td>
</tr>









  
  
  
    
    <tr>


<th colspan="2" scope="row" class="row-header">Measure Group (Rate) (ID: group-1)</th>


</tr>
  
  
  











  

  







  
    
    
    
    
    
<tr>


<th scope="row" class="row-header"/>



<td class="content-container"><div><p>SDE Sex uses Patient.gender mapped to the same SNOMED Male/Female findings as CMS. SDE Payer uses AtriusIn coverage payer type (PM-JAY, ESIS, private, public, self-pay). SDE Residence (state/district) and SDE Urban Rural replace US Core race and ethnicity and are not US-comparable. Anophthalmos uses International 7183006 (HTS preferred display Anophthalmos); CMS US 15665641000119103 is not used. Eye-exam Observation retrieve stays base Observation until modelinfo includes ObservationClinicalResult.</p>
</div></td>


</tr>

  






<tr>


<th colspan="2" scope="row" class="row-header">Measure Logic</th>


</tr>

<tr>


<th scope="row" class="row-header">Primary Library</th>



<td class="content-container"><a href="Library-AtriusCMS131DiabetesEyeExam.html">Atrius CMS131 Diabetes Eye Exam CQL</a> version: 0.1.0</td>


</tr>




<tr>
  <th scope="row" class="row-header">Contents</th>
  <td class="content-container">
    <em><a href="#population-criteria">Population Criteria</a></em>
    <br/>
    <em><a href="#definitions">Logic Definitions</a></em>
    <br/>
    <em><a href="#terminology">Terminology</a></em>
    <br/>
    <em><a href="#dependencies">Dependencies</a></em>
    <br/>
    <em><a href="#data-requirements">Data Requirements</a></em>
    <br/>
    <em><a href="#parameters">Parameters</a></em>
    <br/>
  </td>
</tr>


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="population-criteria"> </a>Population Criteria</th>


</tr>
  
  
  

  
  
  
    
    <tr>


<th colspan="2" scope="row" class="row-header">Measure Group (Rate) (ID: group-1)</th>


</tr>
  
  
  

  


  

  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="definitions"> </a>Logic Definitions</th>


</tr>
  
  
          
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusHospice</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriushospice-has-hospice-services"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Hospice Services&quot;:
  exists ( ( ( [Encounter: &quot;Encounter Inpatient&quot;] ).isEncounterPerformed() ) InpatientEncounter
      where FHIRHelpers.ToConcept(InpatientEncounter.hospitalization.dischargeDisposition) ~ &quot;Hospice (HL7 discharge)&quot;
        and FHIRHelpers.ToInterval(InpatientEncounter.period as FHIR.Period) ends during day of &quot;Measurement Period&quot;
  )
    or exists ( ( ( [Encounter: &quot;Hospice Encounter&quot;] ).isEncounterPerformed() ) HospiceEncounter
        where FHIRHelpers.ToInterval(HospiceEncounter.period as FHIR.Period) overlaps day of &quot;Measurement Period&quot;
    )
    or exists ( ( ( [ObservationGeneralAssessment: &quot;Hospice care [Minimum Data Set]&quot;] ).isAssessmentPerformed() ) HospiceAssessment
        where FHIRHelpers.ToConcept(HospiceAssessment.value as FHIR.CodeableConcept) ~ &quot;Yes (qualifier value)&quot;
          and HospiceAssessment.effective.toObservationEffectiveInterval() overlaps day of &quot;Measurement Period&quot;
    )
    or exists ( ( ( [ServiceRequest: &quot;Hospice Care Ambulatory&quot;] ).isInterventionOrder() ) HospiceOrder
        where FHIRHelpers.ToDateTime(HospiceOrder.authoredOn) during day of &quot;Measurement Period&quot;
    )
    or exists ( ( ( [Procedure: &quot;Hospice Care Ambulatory&quot;] ).isInterventionPerformed() ) HospicePerformed
        where HospicePerformed.performed.toPerformedInterval() overlaps day of &quot;Measurement Period&quot;
    )
    or exists ( ( (
        [ConditionProblemsHealthConcerns: &quot;Hospice Diagnosis&quot;]
          union [ConditionEncounterDiagnosis: &quot;Hospice Diagnosis&quot;]
    ).verified() ) HospiceCareDiagnosis
        where HospiceCareDiagnosis.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;
    )</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-has-frailty-device-order"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Frailty Device Order&quot;:
  exists (
    [DeviceRequest: &quot;Frailty Device&quot;] FrailtyDeviceOrder
      where FrailtyDeviceOrder.status in { 'active', 'completed' }
        and FrailtyDeviceOrder.intent in {
          'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'
        }
        and Interval[
          FHIRHelpers.ToDateTime(FrailtyDeviceOrder.authoredOn),
          FHIRHelpers.ToDateTime(FrailtyDeviceOrder.authoredOn)
        ] during day of &quot;Measurement Period&quot;
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-has-frailty-equipment-observation"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Frailty Equipment Observation&quot;:
  exists (
    [Observation: &quot;Medical equipment used&quot;] EquipmentUsed
      where EquipmentUsed.status in { 'final', 'amended', 'corrected' }
        and EquipmentUsed.value is FHIR.CodeableConcept
        and FHIRHelpers.ToConcept(EquipmentUsed.value as FHIR.CodeableConcept) in &quot;Frailty Device&quot;
        and end of EquipmentUsed.observationEffectiveInterval() during day of &quot;Measurement Period&quot;
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-has-frailty-diagnosis"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Frailty Diagnosis&quot;:
  exists (
    [ConditionProblemsHealthConcerns: &quot;Frailty Diagnosis&quot;] FrailtyProblem
      where (
        FrailtyProblem.verificationStatus is null
          or FHIRHelpers.ToConcept(FrailtyProblem.verificationStatus) ~ &quot;confirmed&quot;
          or FHIRHelpers.ToConcept(FrailtyProblem.verificationStatus) ~ &quot;unconfirmed&quot;
          or FHIRHelpers.ToConcept(FrailtyProblem.verificationStatus) ~ &quot;provisional&quot;
          or FHIRHelpers.ToConcept(FrailtyProblem.verificationStatus) ~ &quot;differential&quot;
      )
        and FrailtyProblem.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;
  )
    or exists (
      [ConditionEncounterDiagnosis: &quot;Frailty Diagnosis&quot;] FrailtyEncounterDiagnosis
        where (
          FrailtyEncounterDiagnosis.verificationStatus is null
            or FHIRHelpers.ToConcept(FrailtyEncounterDiagnosis.verificationStatus) ~ &quot;confirmed&quot;
            or FHIRHelpers.ToConcept(FrailtyEncounterDiagnosis.verificationStatus) ~ &quot;unconfirmed&quot;
            or FHIRHelpers.ToConcept(FrailtyEncounterDiagnosis.verificationStatus) ~ &quot;provisional&quot;
            or FHIRHelpers.ToConcept(FrailtyEncounterDiagnosis.verificationStatus) ~ &quot;differential&quot;
        )
          and FrailtyEncounterDiagnosis.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;
    )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-has-frailty-encounter"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Frailty Encounter&quot;:
  exists (
    [Encounter: &quot;Frailty Encounter&quot;] FrailtyEncounter
      where FrailtyEncounter.status = 'finished'
        and FHIRHelpers.ToInterval(FrailtyEncounter.period as FHIR.Period) overlaps day of &quot;Measurement Period&quot;
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-has-frailty-symptom-observation"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Frailty Symptom Observation&quot;:
  exists (
    [Observation: &quot;Frailty Symptom&quot;] FrailtySymptom
      where FrailtySymptom.status in { 'preliminary', 'final', 'amended', 'corrected' }
        and FrailtySymptom.observationEffectiveInterval() overlaps day of &quot;Measurement Period&quot;
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-has-criteria-indicating-frailty"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Criteria Indicating Frailty&quot;:
  &quot;Has Frailty Device Order&quot;
    or &quot;Has Frailty Equipment Observation&quot;
    or &quot;Has Frailty Diagnosis&quot;
    or &quot;Has Frailty Encounter&quot;
    or &quot;Has Frailty Symptom Observation&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-has-advanced-illness-in-year-before-or-during-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Advanced Illness in Year Before or During Measurement Period&quot;:
  exists (
    [ConditionProblemsHealthConcerns: &quot;Advanced Illness&quot;] AdvancedIllnessProblem
      where (
        AdvancedIllnessProblem.verificationStatus is null
          or FHIRHelpers.ToConcept(AdvancedIllnessProblem.verificationStatus) ~ &quot;confirmed&quot;
          or FHIRHelpers.ToConcept(AdvancedIllnessProblem.verificationStatus) ~ &quot;unconfirmed&quot;
          or FHIRHelpers.ToConcept(AdvancedIllnessProblem.verificationStatus) ~ &quot;provisional&quot;
          or FHIRHelpers.ToConcept(AdvancedIllnessProblem.verificationStatus) ~ &quot;differential&quot;
      )
        and start of AdvancedIllnessProblem.prevalenceInterval() during day of Interval[
          start of &quot;Measurement Period&quot; - 1 year,
          end of &quot;Measurement Period&quot;
        ]
  )
    or exists (
      [ConditionEncounterDiagnosis: &quot;Advanced Illness&quot;] AdvancedIllnessEncounterDiagnosis
        where (
          AdvancedIllnessEncounterDiagnosis.verificationStatus is null
            or FHIRHelpers.ToConcept(AdvancedIllnessEncounterDiagnosis.verificationStatus) ~ &quot;confirmed&quot;
            or FHIRHelpers.ToConcept(AdvancedIllnessEncounterDiagnosis.verificationStatus) ~ &quot;unconfirmed&quot;
            or FHIRHelpers.ToConcept(AdvancedIllnessEncounterDiagnosis.verificationStatus) ~ &quot;provisional&quot;
            or FHIRHelpers.ToConcept(AdvancedIllnessEncounterDiagnosis.verificationStatus) ~ &quot;differential&quot;
        )
          and start of AdvancedIllnessEncounterDiagnosis.prevalenceInterval() during day of Interval[
            start of &quot;Measurement Period&quot; - 1 year,
            end of &quot;Measurement Period&quot;
          ]
    )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-has-dementia-medications-in-year-before-or-during-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Dementia Medications in Year Before or During Measurement Period&quot;:
  exists (
    [MedicationRequest: &quot;Dementia Medications&quot;] DementiaMedication
      where DementiaMedication.status = 'active'
        and DementiaMedication.intent in {
          'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'
        }
        and DementiaMedication.medicationRequestPeriod() overlaps day of Interval[
          start of &quot;Measurement Period&quot; - 1 year,
          end of &quot;Measurement Period&quot;
        ]
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-is-age-66-or-older-with-advanced-illness-and-frailty"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Is Age 66 or Older with Advanced Illness and Frailty&quot;:
  AgeInYearsAt(date from end of &quot;Measurement Period&quot;) &gt;= 66
    and &quot;Has Criteria Indicating Frailty&quot;
    and (
      &quot;Has Advanced Illness in Year Before or During Measurement Period&quot;
        or &quot;Has Dementia Medications in Year Before or During Measurement Period&quot;
    )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusAdvancedIllnessAndFrailty</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusadvancedillnessandfrailty-is-age-66-or-older-living-long-term-in-a-nursing-home"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Is Age 66 or Older Living Long Term in a Nursing Home&quot;:
  AgeInYearsAt(date from end of &quot;Measurement Period&quot;) &gt;= 66
    and (
      (
        Last(
          [Observation: &quot;Housing status&quot;] HousingStatus
            where HousingStatus.status in { 'final', 'amended', 'corrected' }
              and end of HousingStatus.observationEffectiveInterval() on or before day of end of &quot;Measurement Period&quot;
               sort by end of observationEffectiveInterval() asc
        )
      ) LastHousingStatus
        where LastHousingStatus.value is FHIR.CodeableConcept
          and FHIRHelpers.ToConcept(LastHousingStatus.value as FHIR.CodeableConcept) ~ &quot;Lives in nursing home (finding)&quot;
    ) is not null</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusPalliativeCare</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuspalliativecare-has-palliative-care-in-the-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Palliative Care in the Measurement Period&quot;:
  exists (
    [ObservationGeneralAssessment: &quot;Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)&quot;] PalliativeAssessment
      where PalliativeAssessment.status in { 'final', 'amended', 'corrected' }
        and PalliativeAssessment.effective.toObservationEffectiveInterval() overlaps day of &quot;Measurement Period&quot;
  )
    or exists (
      [ConditionProblemsHealthConcerns: &quot;Palliative Care Diagnosis&quot;] PalliativeProblem
        where (
          PalliativeProblem.verificationStatus is null
            or FHIRHelpers.ToConcept(PalliativeProblem.verificationStatus) ~ &quot;confirmed&quot;
            or FHIRHelpers.ToConcept(PalliativeProblem.verificationStatus) ~ &quot;unconfirmed&quot;
            or FHIRHelpers.ToConcept(PalliativeProblem.verificationStatus) ~ &quot;provisional&quot;
            or FHIRHelpers.ToConcept(PalliativeProblem.verificationStatus) ~ &quot;differential&quot;
        )
          and PalliativeProblem.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;
    )
    or exists (
      [ConditionEncounterDiagnosis: &quot;Palliative Care Diagnosis&quot;] PalliativeEncounterDiagnosis
        where (
          PalliativeEncounterDiagnosis.verificationStatus is null
            or FHIRHelpers.ToConcept(PalliativeEncounterDiagnosis.verificationStatus) ~ &quot;confirmed&quot;
            or FHIRHelpers.ToConcept(PalliativeEncounterDiagnosis.verificationStatus) ~ &quot;unconfirmed&quot;
            or FHIRHelpers.ToConcept(PalliativeEncounterDiagnosis.verificationStatus) ~ &quot;provisional&quot;
            or FHIRHelpers.ToConcept(PalliativeEncounterDiagnosis.verificationStatus) ~ &quot;differential&quot;
        )
          and PalliativeEncounterDiagnosis.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;
    )
    or exists (
      [Encounter: &quot;Palliative Care Encounter&quot;] PalliativeEncounter
        where PalliativeEncounter.status = 'finished'
          and FHIRHelpers.ToInterval(PalliativeEncounter.period as FHIR.Period) overlaps day of &quot;Measurement Period&quot;
    )
    or exists (
      [Procedure: &quot;Palliative Care Intervention&quot;] PalliativeIntervention
        where PalliativeIntervention.status = 'completed'
          and PalliativeIntervention.performed.toPerformedInterval() overlaps day of &quot;Measurement Period&quot;
    )</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-diabetic-retinopathy-overlapping-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Diabetic Retinopathy Overlapping Measurement Period&quot;:
  exists ( ( [ConditionProblemsHealthConcerns: &quot;Diabetic Retinopathy&quot;]
      union [ConditionEncounterDiagnosis: &quot;Diabetic Retinopathy&quot;]
  ).verified ( ) ) Retinopathy
    where Retinopathy.prevalenceInterval ( ) overlaps day of &quot;Measurement Period&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-retinal-exam-in-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Retinal Exam in Measurement Period&quot;:
  exists ( [Observation: &quot;Retinal or Dilated Eye Exam&quot;] RetinalExam
      where RetinalExam.status in { 'final', 'amended', 'corrected' }
        and exists ( RetinalExam.category ObservationCategory
            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;
        )
        and RetinalExam.effective.toObservationEffectiveInterval() during day of &quot;Measurement Period&quot;
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-retinal-exam-in-measurement-period-or-year-prior"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Retinal Exam in Measurement Period or Year Prior&quot;:
  exists ( [Observation: &quot;Retinal or Dilated Eye Exam&quot;] RetinalExam
      where RetinalExam.status in { 'final', 'amended', 'corrected' }
        and exists ( RetinalExam.category ObservationCategory
            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;
        )
        and RetinalExam.effective.toObservationEffectiveInterval() during day of Interval[start of &quot;Measurement Period&quot; - 1 year, end of &quot;Measurement Period&quot;]
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-autonomous-eye-exam-in-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Autonomous Eye Exam in Measurement Period&quot;:
  exists ( [Observation: &quot;Eye Diabetic retinopathy screening Autonomous artificial intelligence&quot;] AutonomousEyeExam
      where AutonomousEyeExam.status in { 'final', 'amended', 'corrected' }
        and exists ( AutonomousEyeExam.category ObservationCategory
            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;
        )
        and (
          FHIRHelpers.ToConcept(AutonomousEyeExam.value as FHIR.CodeableConcept) ~ &quot;ETDRS Level 20 or lower, without macular edema&quot;
            or FHIRHelpers.ToConcept(AutonomousEyeExam.value as FHIR.CodeableConcept) ~ &quot;ETDRS Level 35 or higher, with or without macular edema&quot;
        )
        and AutonomousEyeExam.effective.toObservationEffectiveInterval() during day of &quot;Measurement Period&quot;
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-has-left-eye-retinopathy"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Left Eye Retinopathy&quot;:
  exists ( [Observation: &quot;Left eye Diabetic retinopathy severity level by Ophthalmoscopy&quot;] LeftEyeRetinopathy
      where LeftEyeRetinopathy.status in { 'final', 'amended', 'corrected' }
        and exists ( LeftEyeRetinopathy.category ObservationCategory
            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;
        )
        and FHIRHelpers.ToConcept(LeftEyeRetinopathy.value as FHIR.CodeableConcept) in &quot;Diabetic Retinopathy Severity Level&quot;
        and LeftEyeRetinopathy.effective.toObservationEffectiveInterval() during day of &quot;Measurement Period&quot;
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-has-right-eye-retinopathy"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Right Eye Retinopathy&quot;:
  exists ( [Observation: &quot;Right eye Diabetic retinopathy severity level by Ophthalmoscopy&quot;] RightEyeRetinopathy
      where RightEyeRetinopathy.status in { 'final', 'amended', 'corrected' }
        and exists ( RightEyeRetinopathy.category ObservationCategory
            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;
        )
        and FHIRHelpers.ToConcept(RightEyeRetinopathy.value as FHIR.CodeableConcept) in &quot;Diabetic Retinopathy Severity Level&quot;
        and RightEyeRetinopathy.effective.toObservationEffectiveInterval() during day of &quot;Measurement Period&quot;
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-has-right-eye-no-retinopathy-in-year-prior"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Right Eye No Retinopathy in Year Prior&quot;:
  exists ( [Observation: &quot;Right eye Diabetic retinopathy severity level by Ophthalmoscopy&quot;] RightEyeNoRetinopathy
      where RightEyeNoRetinopathy.status in { 'final', 'amended', 'corrected' }
        and exists ( RightEyeNoRetinopathy.category ObservationCategory
            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;
        )
        and FHIRHelpers.ToConcept(RightEyeNoRetinopathy.value as FHIR.CodeableConcept) ~ &quot;No apparent retinopathy&quot;
        and RightEyeNoRetinopathy.effective.toObservationEffectiveInterval() during day of Interval[start of &quot;Measurement Period&quot; - 1 year, end of &quot;Measurement Period&quot; - 1 year]
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-has-left-eye-no-retinopathy-in-year-prior"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Has Left Eye No Retinopathy in Year Prior&quot;:
  exists ( [Observation: &quot;Left eye Diabetic retinopathy severity level by Ophthalmoscopy&quot;] LeftEyeNoRetinopathy
      where LeftEyeNoRetinopathy.status in { 'final', 'amended', 'corrected' }
        and exists ( LeftEyeNoRetinopathy.category ObservationCategory
            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;
        )
        and FHIRHelpers.ToConcept(LeftEyeNoRetinopathy.value as FHIR.CodeableConcept) ~ &quot;No apparent retinopathy&quot;
        and LeftEyeNoRetinopathy.effective.toObservationEffectiveInterval() during day of Interval[start of &quot;Measurement Period&quot; - 1 year, end of &quot;Measurement Period&quot; - 1 year]
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-retinal-exam-finding-with-retinopathy-severity-level-in-measurement-period"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Retinal Exam Finding with Retinopathy Severity Level in Measurement Period&quot;:
  ( &quot;Has Left Eye Retinopathy&quot;
      and &quot;Has Right Eye Retinopathy&quot;
  )
    or ( &quot;Has Left Eye Retinopathy&quot;
        and &quot;Has Right Eye No Retinopathy in Year Prior&quot;
    )
    or ( &quot;Has Right Eye Retinopathy&quot;
        and &quot;Has Left Eye No Retinopathy in Year Prior&quot;
    )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-retinal-exam-finding-with-no-retinopathy-severity-level-in-year-prior"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Retinal Exam Finding with No Retinopathy Severity Level in Year Prior&quot;:
  ( &quot;Has Left Eye No Retinopathy in Year Prior&quot;
      and &quot;Has Right Eye No Retinopathy in Year Prior&quot;
  )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-numerator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  ( &quot;Diabetic Retinopathy Overlapping Measurement Period&quot;
      and ( &quot;Retinal Exam in Measurement Period&quot; )
  )
    or ( not ( &quot;Diabetic Retinopathy Overlapping Measurement Period&quot; )
        and ( &quot;Retinal Exam in Measurement Period or Year Prior&quot; )
    )
    or &quot;Autonomous Eye Exam in Measurement Period&quot;
    or &quot;Retinal Exam Finding with Retinopathy Severity Level in Measurement Period&quot;
    or &quot;Retinal Exam Finding with No Retinopathy Severity Level in Year Prior&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-qualifying-encounters"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Qualifying Encounters&quot;:
  ( ( [Encounter: &quot;Office Visit&quot;]
      union [Encounter: &quot;Annual Wellness Visit&quot;]
      union [Encounter: &quot;Preventive Care Services Established Office Visit, 18 and Up&quot;]
      union [Encounter: &quot;Preventive Care Services Initial Office Visit, 18 and Up&quot;]
      union [Encounter: &quot;Home Healthcare Services&quot;]
      union [Encounter: &quot;Ophthalmological Services&quot;]
      union [Encounter: &quot;Telephone Visits&quot;]
  ).isEncounterPerformed ( ) ) ValidEncounters
    where ValidEncounters.period during day of &quot;Measurement Period&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-initial-population"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  AgeInYearsAt(date from
    end of &quot;Measurement Period&quot;
  ) in Interval[18, 75]
    and exists ( &quot;Qualifying Encounters&quot; )
    and exists ( ( ( [ConditionEncounterDiagnosis: &quot;Diabetes&quot;] ).verified ( ) ) DiabetesDx
        where DiabetesDx.prevalenceInterval ( ) overlaps day of &quot;Measurement Period&quot;
    )</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-denominator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Initial Population&quot;</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-bilateral-absence-of-eyes"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Bilateral Absence of Eyes&quot;:
  exists ( ( [ConditionProblemsHealthConcerns: &quot;Anophthalmos of bilateral eyes (disorder)&quot;]
      union [ConditionEncounterDiagnosis: &quot;Anophthalmos of bilateral eyes (disorder)&quot;]
  ).verified ( ) ) BilateralAbsenceEyes
    where BilateralAbsenceEyes.prevalenceInterval ( ) starts on or before day of end of &quot;Measurement Period&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCMS131DiabetesEyeExam</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscms131diabeteseyeexam-denominator-exclusions"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator Exclusions&quot;:
  Hospice.&quot;Has Hospice Services&quot;
    or AIFrailLTCF.&quot;Is Age 66 or Older with Advanced Illness and Frailty&quot;
    or AIFrailLTCF.&quot;Is Age 66 or Older Living Long Term in a Nursing Home&quot;
    or PalliativeCare.&quot;Has Palliative Care in the Measurement Period&quot;
    or &quot;Bilateral Absence of Eyes&quot;</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusStatus</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusstatus-verified"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function verified(
  conditions List&lt;Choice&lt;ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns&gt;&gt;
):
  conditions C
    where C.verificationStatus is not null implies (
      FHIRHelpers.ToConcept(C.verificationStatus) ~ &quot;confirmed&quot;
        or FHIRHelpers.ToConcept(C.verificationStatus) ~ &quot;unconfirmed&quot;
        or FHIRHelpers.ToConcept(C.verificationStatus) ~ &quot;provisional&quot;
        or FHIRHelpers.ToConcept(C.verificationStatus) ~ &quot;differential&quot;
    )</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusStatus</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusstatus-isencounterperformed"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function isEncounterPerformed(Enc List&lt;Encounter&gt;):
  Enc E
    where E.status = 'finished'</code></pre>
  </td>

</tr>



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusStatus</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusstatus-isassessmentperformed"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function isAssessmentPerformed(Obs List&lt;Observation&gt;):
  Obs O
    where O.status in { 'final', 'amended', 'corrected' }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusStatus</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusstatus-isinterventionorder"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function isInterventionOrder(ServiceRequest List&lt;ServiceRequest&gt;):
  ServiceRequest S
    where S.status in { 'active', 'completed' }
      and S.intent in {
        'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'
      }</code></pre>
  </td>

</tr>



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusStatus</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriusstatus-isinterventionperformed"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function isInterventionPerformed(Proc List&lt;Procedure&gt;):
  Proc P
    where P.status = 'completed'</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-toconcept"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.
*/
define function ToConcept(concept FHIR.CodeableConcept):
    if concept is null then
        null
    else
        System.Concept {
            codes: concept.coding C return ToCode(C),
            display: concept.text.value
        }</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tocode"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
    if coding is null then
        null
    else
        System.Code {
          code: coding.code.value,
          system: coding.system.value,
          version: coding.version.value,
          display: coding.display.value
        }</code></pre>
  </td>

</tr>



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ObservationStatus): value.value</code></pre>
  </td>

</tr>



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value EncounterStatus): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tointerval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)
value to a CQL DateTime Interval
@comment: If the start value of the given period is unspecified, the starting
boundary of the resulting interval will be open (meaning the start of the interval
is unknown, as opposed to interpreted as the beginning of time).
*/
define function ToInterval(period FHIR.Period):
    if period is null then
        null
    else
        if period.&quot;start&quot; is null then
            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]
        else
            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]</code></pre>
  </td>

</tr>



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ServiceRequestStatus): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ServiceRequestIntent): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-todatetime"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value dateTime): value.value</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value ProcedureStatus): value.value</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value DeviceRequestStatus): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value RequestIntent): value.value</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value string): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value MedicationRequestStatus): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value MedicationRequestIntent): value.value</code></pre>
  </td>

</tr>



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tostring"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value UnitsOfTime): value.value</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-toquantity"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) 
value to a CQL Quantity
@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity
has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)
an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.
@seealso: ToCalendarUnit
*/
define function ToQuantity(quantity FHIR.Quantity):
    case
        when quantity is null then null
        when quantity.value is null then null
        when quantity.comparator is not null then
            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
        else
            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')
    end</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="fhirhelpers-tocalendarunit"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Converts a UCUM definite duration unit to a CQL calendar duration
unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) 
topic of the CQL specification.
@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate
*/
define function ToCalendarUnit(unit System.String):
    case unit
        when 'ms' then 'millisecond'
        when 's' then 'second'
        when 'min' then 'minute'
        when 'h' then 'hour'
        when 'd' then 'day'
        when 'wk' then 'week'
        when 'mo' then 'month'
        when 'a' then 'year'
        else unit
    end</code></pre>
  </td>

</tr>



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCumulativeMedicationDuration</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscumulativemedicationduration-medicationrequestperiod"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
Now that we have a ToDaily function, we can approach calculation of the
duration of medication for an order. First, consider the definitions
for each element:
* 1 and only 1 dosageInstruction
* 1 and only 1 doseAndRate
* 1 timing with 1 repeat
* frequency, frequencyMax, defaulting to 1
* period, periodUnit, defaulting to 1 'd'
* doseQuantity or doseRange
* timeOfDay
* authoredOn: The date the prescription was written
* dispenseRequest.validityPeriod: Time period supply is authorized for
* dispenseRequest.quantity: amount of medication supplied per dispense
* dispenseRequest.numberOfRepeatsAllowed: number of refills authorized
* dispenseRequest.expectedSupplyDuration: number of days supply per dispense
* dosageInstruction.timing.repeat.boundsDuration: total duration of the repeat
* dosageInstruction.timing.repeat.boundsRange: range of durations of the repeat
* dosageInstruction.timing.repeat.boundsPeriod: period bounds of the repeat
* dosageInstruction.timing.repeat.count: number of times to repeat
* dosageInstruction.timing.repeat.countMax: maximum number of times to repeat
* dosageInstruction.timing.repeat.frequency: event occurs frequency times per period
* dosageInstruction.timing.repeat.frequencyMax: event occurs up to frequencyMax times per period
* dosageInstruction.timing.repeat.period: event occurs frequency times per period
* dosageInstruction.timing.repeat.periodMax: upper limit of period
* dosageInstruction.timing.repeat.periodUnit: period duration (s | min | h | d | wk | mo | a)
* dosageInstruction.timing.repeat.timeOfDay: time of day for the event (0..*)
* dosageInstruction.timing.repeat.when: event timing (HS | WAKE | C | CM | CD | CV | AC | ACM...)
* dosageInstruction.timing.code: BID | TID | QID | AM | PM | QD | QOD...
* dosageInstruction.asNeeded
* dosageInstruction.doseAndRate.doseQuantity
* dosageInstruction.doseAndRate.doseRange
If expectedSupplyDuration is present, then the duration is
    expectedSupplyDuration * (1 + numberOfRepeatsAllowed)
If expectedSupplyDuration is not present, then it must be calculated based on the quantity, dosage, and frequency:
    (quantity / (dosage * frequency)) * (1 + numberOfRepeatsAllowed)
    dosage: Coalesce(end of doseAndRate.doseRange, doseAndRate.doseQuantity)
    frequency: Coalesce(frequencyMax, frequency)
    period: Quantity(period, periodUnit)
If expectedSupplyDuration is not present and cannot be calculated, and the boundsPeriod is present (and completely specified), we can use that directly
    dosage.timing.repeat.boundsPeriod
This calculation results in a number of days, which can then be turned into a period by anchoring that to the
start of the validityPeriod or the authoredOn:
    Interval[earliestDispensable, earliestDispensable + expectedSupplyDuration - 1]
    earliestDispensable: Coalesce(start of validityPeriod, authoredOn)
The following function illustrates this completely:
*/

/*
Calculates the Medication Period for a single MedicationRequest.
MedicationRequest instances provided to this function are expected
to conform to the [MMEMedicationRequest](http://build.fhir.org/ig/cqframework/opioid-mme-r4/StructureDefinition-mmemedicationrequest.html)
profile, which expects:
* 1 and only 1 dosageInstruction, multiple dosageInstruction elements will result in an error
* 1 and only 1 doseAndRate, multiple doseAndRate elements will result in an error
* 1 timing with 1 repeat, missing timing or repeat elements will result in a null
* frequency, frequencyMax, defaulting to 1
* period, periodUnit, defaulting to 1 'd'
* timeOfDay
* doseQuantity or doseRange, missing doseQuantity and doseRange will result in a null
Note that MedicationRequest status is not considered by this calculation, as the
list of MedicationRequest instances provided to this function should already have
considered appropriate statuses, depending on the use case, typically `completed`.
*/

define fluent function medicationRequestPeriod(sourceRequest &quot;MedicationRequest&quot;):
  sourceRequest R
    let
      dosage: singleton from R.dosageInstruction,
      doseAndRate: singleton from dosage.doseAndRate,
      timing: dosage.timing,
      frequency: Coalesce(timing.repeat.frequencyMax.value, timing.repeat.frequency.value, 1),
      period: Quantity(
        Coalesce(timing.repeat.period.value, 1.0),
        Coalesce(timing.repeat.periodUnit, 'd')
      ),
      doseChoice: doseAndRate.dose,
      dose:
        case
          when doseChoice is FHIR.Range then FHIRHelpers.ToQuantity((doseChoice as FHIR.Range).high)
          when doseChoice is FHIR.SimpleQuantity then FHIRHelpers.ToQuantity(doseChoice as FHIR.SimpleQuantity)
          else null
        end,
      dosesPerDay: Coalesce(ToDaily(frequency, period), Count(timing.repeat.timeOfDay), 1.0),
      boundsPeriod: timingBoundsToInterval(timing.repeat.bounds),
      daysSupply:
        (convert FHIRHelpers.ToQuantity(R.dispenseRequest.expectedSupplyDuration as FHIR.Duration) to days).value,
      quantity: FHIRHelpers.ToQuantity(R.dispenseRequest.quantity as FHIR.Quantity),
      refills: Coalesce(R.dispenseRequest.numberOfRepeatsAllowed.value, 0),
      startDate:
        Coalesce(
          date from start of boundsPeriod,
          date from FHIRHelpers.ToDateTime(R.authoredOn as FHIR.dateTime),
          date from start of FHIRHelpers.ToInterval(R.dispenseRequest.validityPeriod as FHIR.Period)
        ),
      totalDaysSupplied: Coalesce(daysSupply, quantity.value / (dose.value * dosesPerDay)) * (1 + refills)
    return
      if startDate is not null and totalDaysSupplied is not null then
        Interval[startDate, startDate + Quantity(totalDaysSupplied - 1, 'day') ]
      else if startDate is not null and boundsPeriod.&quot;high&quot; is not null then
        Interval[startDate, date from end of boundsPeriod]
      else
        null</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCumulativeMedicationDuration</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscumulativemedicationduration-quantity"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/**********************************************************************/
/* Functions in this region are copied from opioid-mme-r4             */
/**********************************************************************/

define function Quantity(value Decimal, unit String):
  if value is not null then
    System.Quantity { value: value, unit: unit }
  else
    null</code></pre>
  </td>

</tr>



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCumulativeMedicationDuration</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscumulativemedicationduration-todaily"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
 Goal is to get to number of days
 Two broad approaches to the calculation:
  1) Based on supply and frequency, calculate the number of expected days the medication will cover/has covered
  2) Based on relevant period, determine a covered interval and calculate the length of that interval in days
This topic covers several use cases and illustrates how to calculate Cumulative
Medication Duration for each type of medication resource using the supply and
frequency approach.
*/

/*
  For the first approach, we need to get from frequency to a frequency/day
  So we define ToDaily
*/

/*
  Calculates daily frequency given frequency within a period
*/
define function ToDaily(frequency System.Integer, period System.Quantity):
  case period.unit
    when 'h' then frequency * (24.0 / period.value)
    when 'min' then frequency * (24.0 / period.value) * 60
    when 's' then frequency * (24.0 / period.value) * 60 * 60
    when 'd' then frequency * (24.0 / period.value) / 24
    when 'wk' then frequency * (24.0 / period.value) / (24 * 7)
    when 'mo' then frequency * (24.0 / period.value) / (24 * 30) /* assuming 30 days in month */
    when 'a' then frequency * (24.0 / period.value) / (24 * 365) /* assuming 365 days in year */
    when 'hour' then frequency * (24.0 / period.value)
    when 'minute' then frequency * (24.0 / period.value) * 60
    when 'second' then frequency * (24.0 / period.value) * 60 * 60
    when 'day' then frequency * (24.0 / period.value) / 24
    when 'week' then frequency * (24.0 / period.value) / (24 * 7)
    when 'month' then frequency * (24.0 / period.value) / (24 * 30) /* assuming 30 days in month */
    when 'year' then frequency * (24.0 / period.value) / (24 * 365) /* assuming 365 days in year */
    when 'hours' then frequency * (24.0 / period.value)
    when 'minutes' then frequency * (24.0 / period.value) * 60
    when 'seconds' then frequency * (24.0 / period.value) * 60 * 60
    when 'days' then frequency * (24.0 / period.value) / 24
    when 'weeks' then frequency * (24.0 / period.value) / (24 * 7)
    when 'months' then frequency * (24.0 / period.value) / (24 * 30) /* assuming 30 days in month */
    when 'years' then frequency * (24.0 / period.value) / (24 * 365) /* assuming 365 days in year */
    else Message(null, true, 'CMDLogic.ToDaily.UnknownUnit', ErrorLevel, 'Unknown unit ' &amp; period.unit)
  end</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCumulativeMedicationDuration</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscumulativemedicationduration-timingboundstointerval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Normalizes Timing.repeat.bounds (Duration | Range | Period) to Interval&lt;DateTime&gt;.
@deprecated: Use AtriusCommon.toTimingBoundsInterval(); retained for include compatibility.
*/
define function timingBoundsToInterval(bounds Choice&lt;FHIR.Duration, FHIR.Range, FHIR.Period&gt;):
  bounds.toTimingBoundsInterval()</code></pre>
  </td>

</tr>



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscommon-prevalenceinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns an interval representing the normalized prevalence period of a given Condition.
*/
define fluent function prevalenceInterval(condition Choice&lt;ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns&gt;):
  if condition.isActive() then
    Interval[start of condition.onset.toConditionTimingInterval(), end of condition.abatementInterval()]
  else
    (end of condition.abatementInterval()) abatementDate
      return if abatementDate is null then
        Interval[start of condition.onset.toConditionTimingInterval(), abatementDate)
      else
        Interval[start of condition.onset.toConditionTimingInterval(), abatementDate]</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscommon-isactive"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns true if the given condition has a clinical status of active, recurrence, or relapse
*/
define fluent function isActive(condition Choice&lt;ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns&gt;):
  FHIRHelpers.ToConcept(condition.clinicalStatus) ~ &quot;active&quot;
    or FHIRHelpers.ToConcept(condition.clinicalStatus) ~ &quot;recurrence&quot;
    or FHIRHelpers.ToConcept(condition.clinicalStatus) ~ &quot;relapse&quot;</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscommon-toconditiontiminginterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function toConditionTimingInterval(choice Choice&lt;FHIR.dateTime, FHIR.Age, FHIR.Period, FHIR.Range, FHIR.string&gt;):
  choice.toInterval()</code></pre>
  </td>

</tr>



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscommon-abatementinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns an interval representing the normalized abatement of a given Condition.
*/
define fluent function abatementInterval(condition Choice&lt;ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns&gt;):
  condition.abatement.toConditionTimingInterval()</code></pre>
  </td>

</tr>



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscommon-toobservationeffectiveinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function toObservationEffectiveInterval(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant&gt;):
  choice.toInterval()</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscommon-toperformedinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function toPerformedInterval(performed Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.string, FHIR.Age, FHIR.Range&gt;):
  performed.toInterval()</code></pre>
  </td>

</tr>



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscommon-observationeffectiveinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Normalizes Observation.effective[x] for any Observation retrieve.
*/
define fluent function observationEffectiveInterval(observation Observation):
  observation.effective.toObservationEffectiveInterval()</code></pre>
  </td>

</tr>



        



        



        



        



        



        



        



        



        



        



        


<tr>
  <th scope="row" rowspan="2" class="row-header">
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> AtriusCommon</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="atriuscommon-totimingboundsinterval"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define fluent function toTimingBoundsInterval(bounds Choice&lt;FHIR.Duration, FHIR.Range, FHIR.Period&gt;):
  bounds.toInterval()</code></pre>
  </td>

</tr>





  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="terminology"> </a>Terminology</th>


</tr>
  
  
  

 

 

 

 

 

 

 

 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system ConditionVerificationStatusCodes
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/7.2.0/CodeSystem-condition-ver-status.html">ConditionVerificationStatus</a> version: 2.0.1
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status|2.0.1</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system ConditionClinicalStatusCodes
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/7.2.0/CodeSystem-condition-clinical.html">Condition Clinical Status Codes</a> version: 3.0.0
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical|3.0.0</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system ObservationCategoryCodes
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/7.2.0/CodeSystem-observation-category.html">Observation Category Codes</a> version: 2.0.0
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/observation-category|2.0.0</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system LOINC
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/6.0.2/CodeSystem-v3-loinc.html">Logical Observation Identifiers, Names and Codes (LOINC)</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://loinc.org</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system AtriusLoincAnswers
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="CodeSystem-atrius-in-loinc-answers.html">Atrius stand-in for LOINC answers missing from HTS 2.82</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-loinc-answers|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system DischargeDisposition
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/7.2.0/CodeSystem-discharge-disposition.html">Discharge disposition</a> version: 1.0.1
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/discharge-disposition|1.0.1</tt>
    
  </td>
</tr>
 


<tr>
  
  
  

<th scope="row" class="row-header">Code System</th>


  
  <td class="content-container">
    
    <em>Description</em>: Code system SNOMEDCT
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://hl7.org/fhir/R4/codesystem-snomedct.html">SNOMED CT (all versions)</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://snomed.info/sct</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Diabetic Retinopathy
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-diabetic-retinopathy.html">Atrius Diabetic Retinopathy</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetic-retinopathy|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Retinal or Dilated Eye Exam
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-retinal-or-dilated-eye-exam.html">Atrius Retinal or Dilated Eye Exam</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-retinal-or-dilated-eye-exam|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Diabetic Retinopathy Severity Level
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-diabetic-retinopathy-severity.html">Atrius Diabetic Retinopathy Severity Level</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetic-retinopathy-severity|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Office Visit
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-office-visit.html">Atrius Office Visit</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-office-visit|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Annual Wellness Visit
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-annual-wellness-visit.html">Atrius Annual Wellness Visit</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-annual-wellness-visit|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Preventive Care Services Established Office Visit, 18 and Up
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-preventive-established-18up.html">Atrius Preventive Care Services Established Office Visit, 18 and Up</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-preventive-established-18up|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Preventive Care Services Initial Office Visit, 18 and Up
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-preventive-initial-18up.html">Atrius Preventive Care Services Initial Office Visit, 18 and Up</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-preventive-initial-18up|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Home Healthcare Services
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-home-healthcare.html">Atrius Home Healthcare Services</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-home-healthcare|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Ophthalmological Services
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-ophthalmological-services.html">Atrius Ophthalmological Services</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-ophthalmological-services|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Telephone Visits
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-telephone-visits.html">Atrius Telephone Visits</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-telephone-visits|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Diabetes
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-diabetes.html">Atrius Diabetes</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetes|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Encounter Inpatient
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-encounter-inpatient.html">Atrius Encounter Inpatient</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-encounter-inpatient|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Hospice Encounter
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-hospice-encounter.html">Atrius Hospice Encounter</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-encounter|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Hospice Care Ambulatory
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-hospice-care-ambulatory.html">Atrius Hospice Care Ambulatory</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-care-ambulatory|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Hospice Diagnosis
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-hospice-diagnosis.html">Atrius Hospice Diagnosis</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-diagnosis|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Frailty Device
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-frailty-device.html">Atrius Frailty Device</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-device|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Frailty Diagnosis
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-frailty-diagnosis.html">Atrius Frailty Diagnosis</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-diagnosis|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Frailty Encounter
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-frailty-encounter.html">Atrius Frailty Encounter</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-encounter|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Frailty Symptom
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-frailty-symptom.html">Atrius Frailty Symptom</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-symptom|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Advanced Illness
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-advanced-illness.html">Atrius Advanced Illness</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-advanced-illness|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Dementia Medications
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-dementia-medications.html">Atrius Dementia Medications</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-dementia-medications|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Palliative Care Diagnosis
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-palliative-care-diagnosis.html">Atrius Palliative Care Diagnosis</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-diagnosis|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Palliative Care Encounter
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-palliative-care-encounter.html">Atrius Palliative Care Encounter</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-encounter|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  
  

<th scope="row" class="row-header">Value Set</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Value set Palliative Care Intervention
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="ValueSet-atrius-vs-palliative-care-intervention.html">Atrius Palliative Care Intervention</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-intervention|0.1.0</tt>
    
  </td>
</tr>
 


  
  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Confirmed
        <br/>
      
      <em>Code</em>: confirmed
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Unconfirmed
        <br/>
      
      <em>Code</em>: unconfirmed
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Provisional
        <br/>
      
      <em>Code</em>: provisional
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Differential
        <br/>
      
      <em>Code</em>: differential
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Active
        <br/>
      
      <em>Code</em>: active
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Recurrence
        <br/>
      
      <em>Code</em>: recurrence
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Relapse
        <br/>
      
      <em>Code</em>: relapse
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: exam
        <br/>
      
      <em>Code</em>: exam
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/observation-category</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Eye Diabetic retinopathy screening Autonomous artificial intelligence
        <br/>
      
      <em>Code</em>: 105914-6
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: ETDRS Level 20 or lower, without macular edema
        <br/>
      
      <em>Code</em>: LA34398-0
      <br/>
      <em>System</em>: <tt>https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-loinc-answers</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: ETDRS Level 35 or higher, with or without macular edema
        <br/>
      
      <em>Code</em>: LA34399-8
      <br/>
      <em>System</em>: <tt>https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-loinc-answers</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Left eye Diabetic retinopathy severity level by Ophthalmoscopy
        <br/>
      
      <em>Code</em>: 71490-7
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Right eye Diabetic retinopathy severity level by Ophthalmoscopy
        <br/>
      
      <em>Code</em>: 71491-5
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: No apparent retinopathy
        <br/>
      
      <em>Code</em>: LA18643-9
      <br/>
      <em>System</em>: <tt>https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-loinc-answers</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Hospice
        <br/>
      
      <em>Code</em>: hosp
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/discharge-disposition</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Yes
        <br/>
      
      <em>Code</em>: 373066001
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Hospice care [Minimum Data Set]
        <br/>
      
      <em>Code</em>: 45755-6
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Medical equipment used
        <br/>
      
      <em>Code</em>: 98181-1
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Housing status
        <br/>
      
      <em>Code</em>: 71802-3
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Lives in a nursing home
        <br/>
      
      <em>Code</em>: 160734000
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)
        <br/>
      
      <em>Code</em>: 71007-9
      <br/>
      <em>System</em>: <tt>http://loinc.org</tt>
    </td>
  </tr>

  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Anophthalmos
        <br/>
      
      <em>Code</em>: 7183006
      <br/>
      <em>System</em>: <tt>http://snomed.info/sct</tt>
    </td>
  </tr>

  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="dependencies"> </a>Dependencies</th>


</tr>
  
  
  


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: AtriusIn model information
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="Library-AtriusIn-ModelInfo.html">Atrius India Core Model Definition</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/Library/AtriusIn-ModelInfo|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library Status
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>https://atrius.in/fhir/r4/atrius-in/Library/AtriusStatus|1.15.000</code>
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/Library/AtriusStatus|1.15.000</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library FHIRHelpers
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>https://atrius.in/fhir/r4/atrius-in/Library/FHIRHelpers|4.4.000</code>
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/Library/FHIRHelpers|4.4.000</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library QICoreCommon
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="Library-AtriusCommon.html">Atrius Common CQL</a> version: 0.1.0
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/Library/AtriusCommon|0.1.0</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library Hospice
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>https://atrius.in/fhir/r4/atrius-in/Library/AtriusHospice|6.18.000</code>
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/Library/AtriusHospice|6.18.000</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library AIFrailLTCF
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>https://atrius.in/fhir/r4/atrius-in/Library/AtriusAdvancedIllnessAndFrailty|1.27.000</code>
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/Library/AtriusAdvancedIllnessAndFrailty|1.27.000</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library AtriusCumulativeMedicationDuration
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>https://atrius.in/fhir/r4/atrius-in/Library/AtriusCumulativeMedicationDuration|6.0.000</code>
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/Library/AtriusCumulativeMedicationDuration|6.0.000</tt>
    
  </td>
</tr>
 


<tr>
  

<th scope="row" class="row-header">Dependency</th>


  <td class="content-container">
    
    <em>Description</em>: Library PalliativeCare
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>https://atrius.in/fhir/r4/atrius-in/Library/AtriusPalliativeCare|1.18.000</code>
    <br/>
    <em>Canonical URL</em>: <tt>https://atrius.in/fhir/r4/atrius-in/Library/AtriusPalliativeCare|1.18.000</tt>
    
  </td>
</tr>
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


  
  






  <tr>


<th colspan="2" scope="row" class="row-header"><a name="data-requirements"> </a>Data Requirements</th>


</tr>
  
  
  
<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-problems-health-concerns.html">Atrius India Core Condition Problems Health Concerns</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-diabetic-retinopathy.html">Atrius Diabetic Retinopathy</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-problems-health-concerns.html">Atrius India Core Condition Problems Health Concerns</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-hospice-diagnosis.html">Atrius Hospice Diagnosis</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-problems-health-concerns.html">Atrius India Core Condition Problems Health Concerns</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, verificationStatus
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-frailty-diagnosis.html">Atrius Frailty Diagnosis</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-problems-health-concerns.html">Atrius India Core Condition Problems Health Concerns</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, verificationStatus
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-advanced-illness.html">Atrius Advanced Illness</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-problems-health-concerns.html">Atrius India Core Condition Problems Health Concerns</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, verificationStatus
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-palliative-care-diagnosis.html">Atrius Palliative Care Diagnosis</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-problems-health-concerns.html">Atrius India Core Condition Problems Health Concerns</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="http://snomed.info/id/7183006">SNOMED CT: 7183006</a> (Anophthalmos)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-encounter-diagnosis.html">Atrius India Core Condition Encounter Diagnosis</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-diabetic-retinopathy.html">Atrius Diabetic Retinopathy</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-encounter-diagnosis.html">Atrius India Core Condition Encounter Diagnosis</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-diabetes.html">Atrius Diabetes</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-encounter-diagnosis.html">Atrius India Core Condition Encounter Diagnosis</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-hospice-diagnosis.html">Atrius Hospice Diagnosis</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-encounter-diagnosis.html">Atrius India Core Condition Encounter Diagnosis</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, verificationStatus
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-frailty-diagnosis.html">Atrius Frailty Diagnosis</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-encounter-diagnosis.html">Atrius India Core Condition Encounter Diagnosis</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, verificationStatus
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-advanced-illness.html">Atrius Advanced Illness</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-encounter-diagnosis.html">Atrius India Core Condition Encounter Diagnosis</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, verificationStatus
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-palliative-care-diagnosis.html">Atrius Palliative Care Diagnosis</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Condition
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-condition-encounter-diagnosis.html">Atrius India Core Condition Encounter Diagnosis</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="http://snomed.info/id/7183006">SNOMED CT: 7183006</a> (Anophthalmos)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, category, effective
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-retinal-or-dilated-eye-exam.html">Atrius Retinal or Dilated Eye Exam</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, category, value, effective
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="https://loinc.org/105914-6">LOINC: 105914-6</a> (Eye Diabetic retinopathy screening Autonomous artificial intelligence)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, category, value, effective
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="https://loinc.org/71491-5">LOINC: 71491-5</a> (Right eye Diabetic retinopathy severity level by Ophthalmoscopy)
      
    
    </span>
    <br/>
  
  
  
    <span class="tab-one"><em>Path</em>: value</span>
    <br/>
  
  
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, category, value, effective
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="https://loinc.org/71490-7">LOINC: 71490-7</a> (Left eye Diabetic retinopathy severity level by Ophthalmoscopy)
      
    
    </span>
    <br/>
  
  
  
    <span class="tab-one"><em>Path</em>: value</span>
    <br/>
  
  
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, value
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="https://loinc.org/98181-1">LOINC: 98181-1</a> (Medical equipment used)
      
    
    </span>
    <br/>
  
  
  
    <span class="tab-one"><em>Path</em>: value</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-frailty-device.html">Atrius Frailty Device</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-frailty-symptom.html">Atrius Frailty Symptom</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="https://loinc.org/71802-3">LOINC: 71802-3</a> (Housing status)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, value
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="https://loinc.org/71802-3">LOINC: 71802-3</a> (Housing status)
      
    
    </span>
    <br/>
  
  
  
    <span class="tab-one"><em>Path</em>: value</span>
    <br/>
  
  
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Patient
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/patient.html">Patient</a> version: 4.0.1
    <br/>        
  
   
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-office-visit.html">Atrius Office Visit</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-annual-wellness-visit.html">Atrius Annual Wellness Visit</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-preventive-established-18up.html">Atrius Preventive Care Services Established Office Visit, 18 and Up</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-preventive-initial-18up.html">Atrius Preventive Care Services Initial Office Visit, 18 and Up</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-home-healthcare.html">Atrius Home Healthcare Services</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-ophthalmological-services.html">Atrius Ophthalmological Services</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-telephone-visits.html">Atrius Telephone Visits</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, hospitalization, hospitalization.dischargeDisposition, period, status
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-encounter-inpatient.html">Atrius Encounter Inpatient</a> version: 0.1.0
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: hospitalization.dischargeDisposition</span>
    <br/>
  
  
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, period, status
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-hospice-encounter.html">Atrius Hospice Encounter</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-frailty-encounter.html">Atrius Frailty Encounter</a> version: 0.1.0
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: status</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: finished (finished)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: type, status, period
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: type</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-palliative-care-encounter.html">Atrius Palliative Care Encounter</a> version: 0.1.0
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: status</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: finished (finished)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-observation-general-assessment.html">Atrius India Core Observation General Assessment</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, value, effective
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="https://loinc.org/45755-6">LOINC: 45755-6</a> (Hospice care [Minimum Data Set])
      
    
    </span>
    <br/>
  
  
  
    <span class="tab-one"><em>Path</em>: value</span>
    <br/>
  
  
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="StructureDefinition-atrius-in-observation-general-assessment.html">Atrius India Core Observation General Assessment</a> version: 0.1.0
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, effective
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      <a href="https://loinc.org/71007-9">LOINC: 71007-9</a> (Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal))
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: ServiceRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, authoredOn, status, intent
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-hospice-care-ambulatory.html">Atrius Hospice Care Ambulatory</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/procedure.html">Procedure</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, performed, status
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-hospice-care-ambulatory.html">Atrius Hospice Care Ambulatory</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Procedure
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/procedure.html">Procedure</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, performed
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-palliative-care-intervention.html">Atrius Palliative Care Intervention</a> version: 0.1.0
    <br/> 
  
  
  
  
    <span class="tab-one"><em>Path</em>: status</span>
    <br/>
  
  
  
  
    <span class="tab-one"><em>Code(s)</em>: 
    
      
      [not stated]: completed (completed)
      
    
    </span>
    <br/>
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: DeviceRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/devicerequest.html">DeviceRequest</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: code, status, intent, authoredOn
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-frailty-device.html">Atrius Frailty Device</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Medication
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medication.html">Medication</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: id, code
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: code</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-dementia-medications.html">Atrius Dementia Medications</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: MedicationRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: medication.reference, dosageInstruction, dispenseRequest, dispenseRequest.expectedSupplyDuration, dispenseRequest.quantity, dispenseRequest.numberOfRepeatsAllowed, dispenseRequest.numberOfRepeatsAllowed.value, authoredOn, dispenseRequest.validityPeriod, status, intent
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: MedicationRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a> version: 4.0.1
    <br/>        
  
   
   
    <em>Must Support Elements</em>: medication, dosageInstruction, dispenseRequest, dispenseRequest.expectedSupplyDuration, dispenseRequest.quantity, dispenseRequest.numberOfRepeatsAllowed, dispenseRequest.numberOfRepeatsAllowed.value, authoredOn, dispenseRequest.validityPeriod, status, intent
    <br/>
   
  
    <em>Code Filter(s)</em>: 
    <br/>
  
  
    <span class="tab-one"><em>Path</em>: medication</span>
    <br/>
  
  
  
    <span class="tab-one"><em>ValueSet</em>:</span> <a href="ValueSet-atrius-vs-dementia-medications.html">Atrius Dementia Medications</a> version: 0.1.0
    <br/> 
  
  
  
   
  </td>
</tr>

  
  


  <tr>


<th colspan="2" scope="row" class="row-header"><a name="parameters"> </a>Parameters</th>


</tr>
  
  
  <tr>
  

<th scope="row" class="row-header"/>


  <td class="content-container">
    <table>
      <thead>
        <tr>
          <td><em>Name</em></td>
          <td><em>Use</em></td>
          <td><em>Card.</em></td>
          <td><em>Type</em></td>
          <td><em>Documentation</em></td>
        </tr>
      </thead>
      <tbody>
      
        <tr>
          <td>Measurement Period</td>
          <td>In</td>
          <td>0..1</td>
          <td>Period</td>
          <td/>
        </tr>
      
        <tr>
          <td>ErrorLevel</td>
          <td>In</td>
          <td>0..1</td>
          <td>string</td>
          <td/>
        </tr>
      
        <tr>
          <td>Numerator</td>
          <td>Out</td>
          <td>0..1</td>
          <td>boolean</td>
          <td/>
        </tr>
      
        <tr>
          <td>Denominator</td>
          <td>Out</td>
          <td>0..1</td>
          <td>boolean</td>
          <td/>
        </tr>
      
        <tr>
          <td>Initial Population</td>
          <td>Out</td>
          <td>0..1</td>
          <td>boolean</td>
          <td/>
        </tr>
      
        <tr>
          <td>Denominator Exclusions</td>
          <td>Out</td>
          <td>0..1</td>
          <td>boolean</td>
          <td/>
        </tr>
      
      </tbody>
    </table>
  </td>
</tr>

  
  

<tr>
  <th colspan="2" scope="row" class="row-header">Generated using version 0.5.4 of the sample-content-ig Liquid templates</th>
</tr>

    </tbody>
  </table>
</div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/condition-ver-status"/>
          <code value="confirmed"/>
          <display value="Confirmed"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/condition-ver-status"/>
          <code value="unconfirmed"/>
          <display value="Unconfirmed"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/condition-ver-status"/>
          <code value="provisional"/>
          <display value="Provisional"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/condition-ver-status"/>
          <code value="differential"/>
          <display value="Differential"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
          <code value="active"/>
          <display value="Active"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
          <code value="recurrence"/>
          <display value="Recurrence"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/condition-clinical"/>
          <code value="relapse"/>
          <display value="Relapse"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/observation-category"/>
          <code value="exam"/>
          <display value="exam"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="105914-6"/>
          <display value="Eye Diabetic retinopathy screening Autonomous artificial intelligence"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-loinc-answers"/>
          <code value="LA34398-0"/>
          <display value="ETDRS Level 20 or lower, without macular edema"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-loinc-answers"/>
          <code value="LA34399-8"/>
          <display value="ETDRS Level 35 or higher, with or without macular edema"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="71490-7"/>
          <display value="Left eye Diabetic retinopathy severity level by Ophthalmoscopy"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="71491-5"/>
          <display value="Right eye Diabetic retinopathy severity level by Ophthalmoscopy"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-loinc-answers"/>
          <code value="LA18643-9"/>
          <display value="No apparent retinopathy"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://terminology.hl7.org/CodeSystem/discharge-disposition"/>
          <code value="hosp"/>
          <display value="Hospice"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="373066001"/>
          <display value="Yes"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="45755-6"/>
          <display value="Hospice care [Minimum Data Set]"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="98181-1"/>
          <display value="Medical equipment used"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="71802-3"/>
          <display value="Housing status"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="160734000"/>
          <display value="Lives in a nursing home"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://loinc.org"/>
          <code value="71007-9"/>
          <display value="Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system value="http://snomed.info/sct"/>
          <code value="7183006"/>
          <display value="Anophthalmos"/>
        </valueCoding>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Diabetic Retinopathy Overlapping Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Diabetic Retinopathy Overlapping Measurement Period&quot;:&#xA;  exists ( ( [ConditionProblemsHealthConcerns: &quot;Diabetic Retinopathy&quot;]&#xA;      union [ConditionEncounterDiagnosis: &quot;Diabetic Retinopathy&quot;]&#xA;  ).verified ( ) ) Retinopathy&#xA;    where Retinopathy.prevalenceInterval ( ) overlaps day of &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="0"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Retinal Exam in Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Retinal Exam in Measurement Period&quot;:&#xA;  exists ( [Observation: &quot;Retinal or Dilated Eye Exam&quot;] RetinalExam&#xA;      where RetinalExam.status in { 'final', 'amended', 'corrected' }&#xA;        and exists ( RetinalExam.category ObservationCategory&#xA;            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;&#xA;        )&#xA;        and RetinalExam.effective.toObservationEffectiveInterval() during day of &quot;Measurement Period&quot;&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Retinal Exam in Measurement Period or Year Prior"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Retinal Exam in Measurement Period or Year Prior&quot;:&#xA;  exists ( [Observation: &quot;Retinal or Dilated Eye Exam&quot;] RetinalExam&#xA;      where RetinalExam.status in { 'final', 'amended', 'corrected' }&#xA;        and exists ( RetinalExam.category ObservationCategory&#xA;            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;&#xA;        )&#xA;        and RetinalExam.effective.toObservationEffectiveInterval() during day of Interval[start of &quot;Measurement Period&quot; - 1 year, end of &quot;Measurement Period&quot;]&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Autonomous Eye Exam in Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Autonomous Eye Exam in Measurement Period&quot;:&#xA;  exists ( [Observation: &quot;Eye Diabetic retinopathy screening Autonomous artificial intelligence&quot;] AutonomousEyeExam&#xA;      where AutonomousEyeExam.status in { 'final', 'amended', 'corrected' }&#xA;        and exists ( AutonomousEyeExam.category ObservationCategory&#xA;            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;&#xA;        )&#xA;        and (&#xA;          FHIRHelpers.ToConcept(AutonomousEyeExam.value as FHIR.CodeableConcept) ~ &quot;ETDRS Level 20 or lower, without macular edema&quot;&#xA;            or FHIRHelpers.ToConcept(AutonomousEyeExam.value as FHIR.CodeableConcept) ~ &quot;ETDRS Level 35 or higher, with or without macular edema&quot;&#xA;        )&#xA;        and AutonomousEyeExam.effective.toObservationEffectiveInterval() during day of &quot;Measurement Period&quot;&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Has Left Eye Retinopathy"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Left Eye Retinopathy&quot;:&#xA;  exists ( [Observation: &quot;Left eye Diabetic retinopathy severity level by Ophthalmoscopy&quot;] LeftEyeRetinopathy&#xA;      where LeftEyeRetinopathy.status in { 'final', 'amended', 'corrected' }&#xA;        and exists ( LeftEyeRetinopathy.category ObservationCategory&#xA;            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;&#xA;        )&#xA;        and FHIRHelpers.ToConcept(LeftEyeRetinopathy.value as FHIR.CodeableConcept) in &quot;Diabetic Retinopathy Severity Level&quot;&#xA;        and LeftEyeRetinopathy.effective.toObservationEffectiveInterval() during day of &quot;Measurement Period&quot;&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Has Right Eye Retinopathy"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Right Eye Retinopathy&quot;:&#xA;  exists ( [Observation: &quot;Right eye Diabetic retinopathy severity level by Ophthalmoscopy&quot;] RightEyeRetinopathy&#xA;      where RightEyeRetinopathy.status in { 'final', 'amended', 'corrected' }&#xA;        and exists ( RightEyeRetinopathy.category ObservationCategory&#xA;            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;&#xA;        )&#xA;        and FHIRHelpers.ToConcept(RightEyeRetinopathy.value as FHIR.CodeableConcept) in &quot;Diabetic Retinopathy Severity Level&quot;&#xA;        and RightEyeRetinopathy.effective.toObservationEffectiveInterval() during day of &quot;Measurement Period&quot;&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Has Right Eye No Retinopathy in Year Prior"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Right Eye No Retinopathy in Year Prior&quot;:&#xA;  exists ( [Observation: &quot;Right eye Diabetic retinopathy severity level by Ophthalmoscopy&quot;] RightEyeNoRetinopathy&#xA;      where RightEyeNoRetinopathy.status in { 'final', 'amended', 'corrected' }&#xA;        and exists ( RightEyeNoRetinopathy.category ObservationCategory&#xA;            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;&#xA;        )&#xA;        and FHIRHelpers.ToConcept(RightEyeNoRetinopathy.value as FHIR.CodeableConcept) ~ &quot;No apparent retinopathy&quot;&#xA;        and RightEyeNoRetinopathy.effective.toObservationEffectiveInterval() during day of Interval[start of &quot;Measurement Period&quot; - 1 year, end of &quot;Measurement Period&quot; - 1 year]&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="6"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Has Left Eye No Retinopathy in Year Prior"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Left Eye No Retinopathy in Year Prior&quot;:&#xA;  exists ( [Observation: &quot;Left eye Diabetic retinopathy severity level by Ophthalmoscopy&quot;] LeftEyeNoRetinopathy&#xA;      where LeftEyeNoRetinopathy.status in { 'final', 'amended', 'corrected' }&#xA;        and exists ( LeftEyeNoRetinopathy.category ObservationCategory&#xA;            where FHIRHelpers.ToConcept(ObservationCategory) ~ &quot;exam&quot;&#xA;        )&#xA;        and FHIRHelpers.ToConcept(LeftEyeNoRetinopathy.value as FHIR.CodeableConcept) ~ &quot;No apparent retinopathy&quot;&#xA;        and LeftEyeNoRetinopathy.effective.toObservationEffectiveInterval() during day of Interval[start of &quot;Measurement Period&quot; - 1 year, end of &quot;Measurement Period&quot; - 1 year]&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Retinal Exam Finding with Retinopathy Severity Level in Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Retinal Exam Finding with Retinopathy Severity Level in Measurement Period&quot;:&#xA;  ( &quot;Has Left Eye Retinopathy&quot;&#xA;      and &quot;Has Right Eye Retinopathy&quot;&#xA;  )&#xA;    or ( &quot;Has Left Eye Retinopathy&quot;&#xA;        and &quot;Has Right Eye No Retinopathy in Year Prior&quot;&#xA;    )&#xA;    or ( &quot;Has Right Eye Retinopathy&quot;&#xA;        and &quot;Has Left Eye No Retinopathy in Year Prior&quot;&#xA;    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="8"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Retinal Exam Finding with No Retinopathy Severity Level in Year Prior"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Retinal Exam Finding with No Retinopathy Severity Level in Year Prior&quot;:&#xA;  ( &quot;Has Left Eye No Retinopathy in Year Prior&quot;&#xA;      and &quot;Has Right Eye No Retinopathy in Year Prior&quot;&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="9"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Numerator"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Numerator&quot;:&#xA;  ( &quot;Diabetic Retinopathy Overlapping Measurement Period&quot;&#xA;      and ( &quot;Retinal Exam in Measurement Period&quot; )&#xA;  )&#xA;    or ( not ( &quot;Diabetic Retinopathy Overlapping Measurement Period&quot; )&#xA;        and ( &quot;Retinal Exam in Measurement Period or Year Prior&quot; )&#xA;    )&#xA;    or &quot;Autonomous Eye Exam in Measurement Period&quot;&#xA;    or &quot;Retinal Exam Finding with Retinopathy Severity Level in Measurement Period&quot;&#xA;    or &quot;Retinal Exam Finding with No Retinopathy Severity Level in Year Prior&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="10"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Qualifying Encounters"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Qualifying Encounters&quot;:&#xA;  ( ( [Encounter: &quot;Office Visit&quot;]&#xA;      union [Encounter: &quot;Annual Wellness Visit&quot;]&#xA;      union [Encounter: &quot;Preventive Care Services Established Office Visit, 18 and Up&quot;]&#xA;      union [Encounter: &quot;Preventive Care Services Initial Office Visit, 18 and Up&quot;]&#xA;      union [Encounter: &quot;Home Healthcare Services&quot;]&#xA;      union [Encounter: &quot;Ophthalmological Services&quot;]&#xA;      union [Encounter: &quot;Telephone Visits&quot;]&#xA;  ).isEncounterPerformed ( ) ) ValidEncounters&#xA;    where ValidEncounters.period during day of &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="11"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Initial Population&quot;:&#xA;  AgeInYearsAt(date from&#xA;    end of &quot;Measurement Period&quot;&#xA;  ) in Interval[18, 75]&#xA;    and exists ( &quot;Qualifying Encounters&quot; )&#xA;    and exists ( ( ( [ConditionEncounterDiagnosis: &quot;Diabetes&quot;] ).verified ( ) ) DiabetesDx&#xA;        where DiabetesDx.prevalenceInterval ( ) overlaps day of &quot;Measurement Period&quot;&#xA;    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="12"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Denominator&quot;:&#xA;  &quot;Initial Population&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="13"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusHospice"/>
        </extension>
        <extension url="name">
          <valueString value="Has Hospice Services"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Hospice Services&quot;:&#xA;  exists ( ( ( [Encounter: &quot;Encounter Inpatient&quot;] ).isEncounterPerformed() ) InpatientEncounter&#xA;      where FHIRHelpers.ToConcept(InpatientEncounter.hospitalization.dischargeDisposition) ~ &quot;Hospice (HL7 discharge)&quot;&#xA;        and FHIRHelpers.ToInterval(InpatientEncounter.period as FHIR.Period) ends during day of &quot;Measurement Period&quot;&#xA;  )&#xA;    or exists ( ( ( [Encounter: &quot;Hospice Encounter&quot;] ).isEncounterPerformed() ) HospiceEncounter&#xA;        where FHIRHelpers.ToInterval(HospiceEncounter.period as FHIR.Period) overlaps day of &quot;Measurement Period&quot;&#xA;    )&#xA;    or exists ( ( ( [ObservationGeneralAssessment: &quot;Hospice care [Minimum Data Set]&quot;] ).isAssessmentPerformed() ) HospiceAssessment&#xA;        where FHIRHelpers.ToConcept(HospiceAssessment.value as FHIR.CodeableConcept) ~ &quot;Yes (qualifier value)&quot;&#xA;          and HospiceAssessment.effective.toObservationEffectiveInterval() overlaps day of &quot;Measurement Period&quot;&#xA;    )&#xA;    or exists ( ( ( [ServiceRequest: &quot;Hospice Care Ambulatory&quot;] ).isInterventionOrder() ) HospiceOrder&#xA;        where FHIRHelpers.ToDateTime(HospiceOrder.authoredOn) during day of &quot;Measurement Period&quot;&#xA;    )&#xA;    or exists ( ( ( [Procedure: &quot;Hospice Care Ambulatory&quot;] ).isInterventionPerformed() ) HospicePerformed&#xA;        where HospicePerformed.performed.toPerformedInterval() overlaps day of &quot;Measurement Period&quot;&#xA;    )&#xA;    or exists ( ( (&#xA;        [ConditionProblemsHealthConcerns: &quot;Hospice Diagnosis&quot;]&#xA;          union [ConditionEncounterDiagnosis: &quot;Hospice Diagnosis&quot;]&#xA;    ).verified() ) HospiceCareDiagnosis&#xA;        where HospiceCareDiagnosis.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;&#xA;    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="14"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Has Frailty Device Order"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Frailty Device Order&quot;:&#xA;  exists (&#xA;    [DeviceRequest: &quot;Frailty Device&quot;] FrailtyDeviceOrder&#xA;      where FrailtyDeviceOrder.status in { 'active', 'completed' }&#xA;        and FrailtyDeviceOrder.intent in {&#xA;          'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'&#xA;        }&#xA;        and Interval[&#xA;          FHIRHelpers.ToDateTime(FrailtyDeviceOrder.authoredOn),&#xA;          FHIRHelpers.ToDateTime(FrailtyDeviceOrder.authoredOn)&#xA;        ] during day of &quot;Measurement Period&quot;&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="15"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Has Frailty Equipment Observation"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Frailty Equipment Observation&quot;:&#xA;  exists (&#xA;    [Observation: &quot;Medical equipment used&quot;] EquipmentUsed&#xA;      where EquipmentUsed.status in { 'final', 'amended', 'corrected' }&#xA;        and EquipmentUsed.value is FHIR.CodeableConcept&#xA;        and FHIRHelpers.ToConcept(EquipmentUsed.value as FHIR.CodeableConcept) in &quot;Frailty Device&quot;&#xA;        and end of EquipmentUsed.observationEffectiveInterval() during day of &quot;Measurement Period&quot;&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="16"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Has Frailty Diagnosis"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Frailty Diagnosis&quot;:&#xA;  exists (&#xA;    [ConditionProblemsHealthConcerns: &quot;Frailty Diagnosis&quot;] FrailtyProblem&#xA;      where (&#xA;        FrailtyProblem.verificationStatus is null&#xA;          or FHIRHelpers.ToConcept(FrailtyProblem.verificationStatus) ~ &quot;confirmed&quot;&#xA;          or FHIRHelpers.ToConcept(FrailtyProblem.verificationStatus) ~ &quot;unconfirmed&quot;&#xA;          or FHIRHelpers.ToConcept(FrailtyProblem.verificationStatus) ~ &quot;provisional&quot;&#xA;          or FHIRHelpers.ToConcept(FrailtyProblem.verificationStatus) ~ &quot;differential&quot;&#xA;      )&#xA;        and FrailtyProblem.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;&#xA;  )&#xA;    or exists (&#xA;      [ConditionEncounterDiagnosis: &quot;Frailty Diagnosis&quot;] FrailtyEncounterDiagnosis&#xA;        where (&#xA;          FrailtyEncounterDiagnosis.verificationStatus is null&#xA;            or FHIRHelpers.ToConcept(FrailtyEncounterDiagnosis.verificationStatus) ~ &quot;confirmed&quot;&#xA;            or FHIRHelpers.ToConcept(FrailtyEncounterDiagnosis.verificationStatus) ~ &quot;unconfirmed&quot;&#xA;            or FHIRHelpers.ToConcept(FrailtyEncounterDiagnosis.verificationStatus) ~ &quot;provisional&quot;&#xA;            or FHIRHelpers.ToConcept(FrailtyEncounterDiagnosis.verificationStatus) ~ &quot;differential&quot;&#xA;        )&#xA;          and FrailtyEncounterDiagnosis.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;&#xA;    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="17"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Has Frailty Encounter"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Frailty Encounter&quot;:&#xA;  exists (&#xA;    [Encounter: &quot;Frailty Encounter&quot;] FrailtyEncounter&#xA;      where FrailtyEncounter.status = 'finished'&#xA;        and FHIRHelpers.ToInterval(FrailtyEncounter.period as FHIR.Period) overlaps day of &quot;Measurement Period&quot;&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="18"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Has Frailty Symptom Observation"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Frailty Symptom Observation&quot;:&#xA;  exists (&#xA;    [Observation: &quot;Frailty Symptom&quot;] FrailtySymptom&#xA;      where FrailtySymptom.status in { 'preliminary', 'final', 'amended', 'corrected' }&#xA;        and FrailtySymptom.observationEffectiveInterval() overlaps day of &quot;Measurement Period&quot;&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="19"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Has Criteria Indicating Frailty"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Criteria Indicating Frailty&quot;:&#xA;  &quot;Has Frailty Device Order&quot;&#xA;    or &quot;Has Frailty Equipment Observation&quot;&#xA;    or &quot;Has Frailty Diagnosis&quot;&#xA;    or &quot;Has Frailty Encounter&quot;&#xA;    or &quot;Has Frailty Symptom Observation&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="20"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Has Advanced Illness in Year Before or During Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Advanced Illness in Year Before or During Measurement Period&quot;:&#xA;  exists (&#xA;    [ConditionProblemsHealthConcerns: &quot;Advanced Illness&quot;] AdvancedIllnessProblem&#xA;      where (&#xA;        AdvancedIllnessProblem.verificationStatus is null&#xA;          or FHIRHelpers.ToConcept(AdvancedIllnessProblem.verificationStatus) ~ &quot;confirmed&quot;&#xA;          or FHIRHelpers.ToConcept(AdvancedIllnessProblem.verificationStatus) ~ &quot;unconfirmed&quot;&#xA;          or FHIRHelpers.ToConcept(AdvancedIllnessProblem.verificationStatus) ~ &quot;provisional&quot;&#xA;          or FHIRHelpers.ToConcept(AdvancedIllnessProblem.verificationStatus) ~ &quot;differential&quot;&#xA;      )&#xA;        and start of AdvancedIllnessProblem.prevalenceInterval() during day of Interval[&#xA;          start of &quot;Measurement Period&quot; - 1 year,&#xA;          end of &quot;Measurement Period&quot;&#xA;        ]&#xA;  )&#xA;    or exists (&#xA;      [ConditionEncounterDiagnosis: &quot;Advanced Illness&quot;] AdvancedIllnessEncounterDiagnosis&#xA;        where (&#xA;          AdvancedIllnessEncounterDiagnosis.verificationStatus is null&#xA;            or FHIRHelpers.ToConcept(AdvancedIllnessEncounterDiagnosis.verificationStatus) ~ &quot;confirmed&quot;&#xA;            or FHIRHelpers.ToConcept(AdvancedIllnessEncounterDiagnosis.verificationStatus) ~ &quot;unconfirmed&quot;&#xA;            or FHIRHelpers.ToConcept(AdvancedIllnessEncounterDiagnosis.verificationStatus) ~ &quot;provisional&quot;&#xA;            or FHIRHelpers.ToConcept(AdvancedIllnessEncounterDiagnosis.verificationStatus) ~ &quot;differential&quot;&#xA;        )&#xA;          and start of AdvancedIllnessEncounterDiagnosis.prevalenceInterval() during day of Interval[&#xA;            start of &quot;Measurement Period&quot; - 1 year,&#xA;            end of &quot;Measurement Period&quot;&#xA;          ]&#xA;    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="21"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Has Dementia Medications in Year Before or During Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Dementia Medications in Year Before or During Measurement Period&quot;:&#xA;  exists (&#xA;    [MedicationRequest: &quot;Dementia Medications&quot;] DementiaMedication&#xA;      where DementiaMedication.status = 'active'&#xA;        and DementiaMedication.intent in {&#xA;          'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'&#xA;        }&#xA;        and DementiaMedication.medicationRequestPeriod() overlaps day of Interval[&#xA;          start of &quot;Measurement Period&quot; - 1 year,&#xA;          end of &quot;Measurement Period&quot;&#xA;        ]&#xA;  )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="22"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Is Age 66 or Older with Advanced Illness and Frailty"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Is Age 66 or Older with Advanced Illness and Frailty&quot;:&#xA;  AgeInYearsAt(date from end of &quot;Measurement Period&quot;) &gt;= 66&#xA;    and &quot;Has Criteria Indicating Frailty&quot;&#xA;    and (&#xA;      &quot;Has Advanced Illness in Year Before or During Measurement Period&quot;&#xA;        or &quot;Has Dementia Medications in Year Before or During Measurement Period&quot;&#xA;    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="23"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusAdvancedIllnessAndFrailty"/>
        </extension>
        <extension url="name">
          <valueString value="Is Age 66 or Older Living Long Term in a Nursing Home"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Is Age 66 or Older Living Long Term in a Nursing Home&quot;:&#xA;  AgeInYearsAt(date from end of &quot;Measurement Period&quot;) &gt;= 66&#xA;    and (&#xA;      (&#xA;        Last(&#xA;          [Observation: &quot;Housing status&quot;] HousingStatus&#xA;            where HousingStatus.status in { 'final', 'amended', 'corrected' }&#xA;              and end of HousingStatus.observationEffectiveInterval() on or before day of end of &quot;Measurement Period&quot;&#xA;               sort by end of observationEffectiveInterval() asc&#xA;        )&#xA;      ) LastHousingStatus&#xA;        where LastHousingStatus.value is FHIR.CodeableConcept&#xA;          and FHIRHelpers.ToConcept(LastHousingStatus.value as FHIR.CodeableConcept) ~ &quot;Lives in nursing home (finding)&quot;&#xA;    ) is not null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="24"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusPalliativeCare"/>
        </extension>
        <extension url="name">
          <valueString value="Has Palliative Care in the Measurement Period"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Has Palliative Care in the Measurement Period&quot;:&#xA;  exists (&#xA;    [ObservationGeneralAssessment: &quot;Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)&quot;] PalliativeAssessment&#xA;      where PalliativeAssessment.status in { 'final', 'amended', 'corrected' }&#xA;        and PalliativeAssessment.effective.toObservationEffectiveInterval() overlaps day of &quot;Measurement Period&quot;&#xA;  )&#xA;    or exists (&#xA;      [ConditionProblemsHealthConcerns: &quot;Palliative Care Diagnosis&quot;] PalliativeProblem&#xA;        where (&#xA;          PalliativeProblem.verificationStatus is null&#xA;            or FHIRHelpers.ToConcept(PalliativeProblem.verificationStatus) ~ &quot;confirmed&quot;&#xA;            or FHIRHelpers.ToConcept(PalliativeProblem.verificationStatus) ~ &quot;unconfirmed&quot;&#xA;            or FHIRHelpers.ToConcept(PalliativeProblem.verificationStatus) ~ &quot;provisional&quot;&#xA;            or FHIRHelpers.ToConcept(PalliativeProblem.verificationStatus) ~ &quot;differential&quot;&#xA;        )&#xA;          and PalliativeProblem.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;&#xA;    )&#xA;    or exists (&#xA;      [ConditionEncounterDiagnosis: &quot;Palliative Care Diagnosis&quot;] PalliativeEncounterDiagnosis&#xA;        where (&#xA;          PalliativeEncounterDiagnosis.verificationStatus is null&#xA;            or FHIRHelpers.ToConcept(PalliativeEncounterDiagnosis.verificationStatus) ~ &quot;confirmed&quot;&#xA;            or FHIRHelpers.ToConcept(PalliativeEncounterDiagnosis.verificationStatus) ~ &quot;unconfirmed&quot;&#xA;            or FHIRHelpers.ToConcept(PalliativeEncounterDiagnosis.verificationStatus) ~ &quot;provisional&quot;&#xA;            or FHIRHelpers.ToConcept(PalliativeEncounterDiagnosis.verificationStatus) ~ &quot;differential&quot;&#xA;        )&#xA;          and PalliativeEncounterDiagnosis.prevalenceInterval() overlaps day of &quot;Measurement Period&quot;&#xA;    )&#xA;    or exists (&#xA;      [Encounter: &quot;Palliative Care Encounter&quot;] PalliativeEncounter&#xA;        where PalliativeEncounter.status = 'finished'&#xA;          and FHIRHelpers.ToInterval(PalliativeEncounter.period as FHIR.Period) overlaps day of &quot;Measurement Period&quot;&#xA;    )&#xA;    or exists (&#xA;      [Procedure: &quot;Palliative Care Intervention&quot;] PalliativeIntervention&#xA;        where PalliativeIntervention.status = 'completed'&#xA;          and PalliativeIntervention.performed.toPerformedInterval() overlaps day of &quot;Measurement Period&quot;&#xA;    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="25"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Bilateral Absence of Eyes"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Bilateral Absence of Eyes&quot;:&#xA;  exists ( ( [ConditionProblemsHealthConcerns: &quot;Anophthalmos of bilateral eyes (disorder)&quot;]&#xA;      union [ConditionEncounterDiagnosis: &quot;Anophthalmos of bilateral eyes (disorder)&quot;]&#xA;  ).verified ( ) ) BilateralAbsenceEyes&#xA;    where BilateralAbsenceEyes.prevalenceInterval ( ) starts on or before day of end of &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="26"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCMS131DiabetesEyeExam"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator Exclusions"/>
        </extension>
        <extension url="statement">
          <valueString value="define &quot;Denominator Exclusions&quot;:&#xA;  Hospice.&quot;Has Hospice Services&quot;&#xA;    or AIFrailLTCF.&quot;Is Age 66 or Older with Advanced Illness and Frailty&quot;&#xA;    or AIFrailLTCF.&quot;Is Age 66 or Older Living Long Term in a Nursing Home&quot;&#xA;    or PalliativeCare.&quot;Has Palliative Care in the Measurement Period&quot;&#xA;    or &quot;Bilateral Absence of Eyes&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="27"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusStatus"/>
        </extension>
        <extension url="name">
          <valueString value="verified"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function verified(&#xA;  conditions List&lt;Choice&lt;ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns&gt;&gt;&#xA;):&#xA;  conditions C&#xA;    where C.verificationStatus is not null implies (&#xA;      FHIRHelpers.ToConcept(C.verificationStatus) ~ &quot;confirmed&quot;&#xA;        or FHIRHelpers.ToConcept(C.verificationStatus) ~ &quot;unconfirmed&quot;&#xA;        or FHIRHelpers.ToConcept(C.verificationStatus) ~ &quot;provisional&quot;&#xA;        or FHIRHelpers.ToConcept(C.verificationStatus) ~ &quot;differential&quot;&#xA;    )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="28"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToConcept"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.&#xA;*/&#xA;define function ToConcept(concept FHIR.CodeableConcept):&#xA;    if concept is null then&#xA;        null&#xA;    else&#xA;        System.Concept {&#xA;            codes: concept.coding C return ToCode(C),&#xA;            display: concept.text.value&#xA;        }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="29"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCode"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.&#xA;*/&#xA;define function ToCode(coding FHIR.Coding):&#xA;    if coding is null then&#xA;        null&#xA;    else&#xA;        System.Code {&#xA;          code: coding.code.value,&#xA;          system: coding.system.value,&#xA;          version: coding.version.value,&#xA;          display: coding.display.value&#xA;        }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="30"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCommon"/>
        </extension>
        <extension url="name">
          <valueString value="prevalenceInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns an interval representing the normalized prevalence period of a given Condition.&#xA;*/&#xA;define fluent function prevalenceInterval(condition Choice&lt;ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns&gt;):&#xA;  if condition.isActive() then&#xA;    Interval[start of condition.onset.toConditionTimingInterval(), end of condition.abatementInterval()]&#xA;  else&#xA;    (end of condition.abatementInterval()) abatementDate&#xA;      return if abatementDate is null then&#xA;        Interval[start of condition.onset.toConditionTimingInterval(), abatementDate)&#xA;      else&#xA;        Interval[start of condition.onset.toConditionTimingInterval(), abatementDate]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="31"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCommon"/>
        </extension>
        <extension url="name">
          <valueString value="isActive"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns true if the given condition has a clinical status of active, recurrence, or relapse&#xA;*/&#xA;define fluent function isActive(condition Choice&lt;ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns&gt;):&#xA;  FHIRHelpers.ToConcept(condition.clinicalStatus) ~ &quot;active&quot;&#xA;    or FHIRHelpers.ToConcept(condition.clinicalStatus) ~ &quot;recurrence&quot;&#xA;    or FHIRHelpers.ToConcept(condition.clinicalStatus) ~ &quot;relapse&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="32"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCommon"/>
        </extension>
        <extension url="name">
          <valueString value="toConditionTimingInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function toConditionTimingInterval(choice Choice&lt;FHIR.dateTime, FHIR.Age, FHIR.Period, FHIR.Range, FHIR.string&gt;):&#xA;  choice.toInterval()"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="33"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCommon"/>
        </extension>
        <extension url="name">
          <valueString value="abatementInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Returns an interval representing the normalized abatement of a given Condition.&#xA;*/&#xA;define fluent function abatementInterval(condition Choice&lt;ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns&gt;):&#xA;  condition.abatement.toConditionTimingInterval()"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="34"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value ObservationStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="35"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCommon"/>
        </extension>
        <extension url="name">
          <valueString value="toObservationEffectiveInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function toObservationEffectiveInterval(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant&gt;):&#xA;  choice.toInterval()"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="36"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusStatus"/>
        </extension>
        <extension url="name">
          <valueString value="isEncounterPerformed"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function isEncounterPerformed(Enc List&lt;Encounter&gt;):&#xA;  Enc E&#xA;    where E.status = 'finished'"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="37"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value EncounterStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="38"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)&#xA;value to a CQL DateTime Interval&#xA;@comment: If the start value of the given period is unspecified, the starting&#xA;boundary of the resulting interval will be open (meaning the start of the interval&#xA;is unknown, as opposed to interpreted as the beginning of time).&#xA;*/&#xA;define function ToInterval(period FHIR.Period):&#xA;    if period is null then&#xA;        null&#xA;    else&#xA;        if period.&quot;start&quot; is null then&#xA;            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]&#xA;        else&#xA;            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="39"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusStatus"/>
        </extension>
        <extension url="name">
          <valueString value="isAssessmentPerformed"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function isAssessmentPerformed(Obs List&lt;Observation&gt;):&#xA;  Obs O&#xA;    where O.status in { 'final', 'amended', 'corrected' }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="40"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusStatus"/>
        </extension>
        <extension url="name">
          <valueString value="isInterventionOrder"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function isInterventionOrder(ServiceRequest List&lt;ServiceRequest&gt;):&#xA;  ServiceRequest S&#xA;    where S.status in { 'active', 'completed' }&#xA;      and S.intent in {&#xA;        'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order'&#xA;      }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="41"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value ServiceRequestStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="42"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value ServiceRequestIntent): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="43"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDateTime"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToDateTime(value dateTime): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="44"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusStatus"/>
        </extension>
        <extension url="name">
          <valueString value="isInterventionPerformed"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function isInterventionPerformed(Proc List&lt;Procedure&gt;):&#xA;  Proc P&#xA;    where P.status = 'completed'"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="45"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value ProcedureStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="46"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCommon"/>
        </extension>
        <extension url="name">
          <valueString value="toPerformedInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function toPerformedInterval(performed Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.string, FHIR.Age, FHIR.Range&gt;):&#xA;  performed.toInterval()"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="47"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value DeviceRequestStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="48"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value RequestIntent): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="49"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCommon"/>
        </extension>
        <extension url="name">
          <valueString value="observationEffectiveInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Normalizes Observation.effective[x] for any Observation retrieve.&#xA;*/&#xA;define fluent function observationEffectiveInterval(observation Observation):&#xA;  observation.effective.toObservationEffectiveInterval()"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="50"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value string): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="51"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value MedicationRequestStatus): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="52"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value MedicationRequestIntent): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="53"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCumulativeMedicationDuration"/>
        </extension>
        <extension url="name">
          <valueString value="medicationRequestPeriod"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;Now that we have a ToDaily function, we can approach calculation of the&#xA;duration of medication for an order. First, consider the definitions&#xA;for each element:&#xA;* 1 and only 1 dosageInstruction&#xA;* 1 and only 1 doseAndRate&#xA;* 1 timing with 1 repeat&#xA;* frequency, frequencyMax, defaulting to 1&#xA;* period, periodUnit, defaulting to 1 'd'&#xA;* doseQuantity or doseRange&#xA;* timeOfDay&#xA;* authoredOn: The date the prescription was written&#xA;* dispenseRequest.validityPeriod: Time period supply is authorized for&#xA;* dispenseRequest.quantity: amount of medication supplied per dispense&#xA;* dispenseRequest.numberOfRepeatsAllowed: number of refills authorized&#xA;* dispenseRequest.expectedSupplyDuration: number of days supply per dispense&#xA;* dosageInstruction.timing.repeat.boundsDuration: total duration of the repeat&#xA;* dosageInstruction.timing.repeat.boundsRange: range of durations of the repeat&#xA;* dosageInstruction.timing.repeat.boundsPeriod: period bounds of the repeat&#xA;* dosageInstruction.timing.repeat.count: number of times to repeat&#xA;* dosageInstruction.timing.repeat.countMax: maximum number of times to repeat&#xA;* dosageInstruction.timing.repeat.frequency: event occurs frequency times per period&#xA;* dosageInstruction.timing.repeat.frequencyMax: event occurs up to frequencyMax times per period&#xA;* dosageInstruction.timing.repeat.period: event occurs frequency times per period&#xA;* dosageInstruction.timing.repeat.periodMax: upper limit of period&#xA;* dosageInstruction.timing.repeat.periodUnit: period duration (s | min | h | d | wk | mo | a)&#xA;* dosageInstruction.timing.repeat.timeOfDay: time of day for the event (0..*)&#xA;* dosageInstruction.timing.repeat.when: event timing (HS | WAKE | C | CM | CD | CV | AC | ACM...)&#xA;* dosageInstruction.timing.code: BID | TID | QID | AM | PM | QD | QOD...&#xA;* dosageInstruction.asNeeded&#xA;* dosageInstruction.doseAndRate.doseQuantity&#xA;* dosageInstruction.doseAndRate.doseRange&#xA;If expectedSupplyDuration is present, then the duration is&#xA;    expectedSupplyDuration * (1 + numberOfRepeatsAllowed)&#xA;If expectedSupplyDuration is not present, then it must be calculated based on the quantity, dosage, and frequency:&#xA;    (quantity / (dosage * frequency)) * (1 + numberOfRepeatsAllowed)&#xA;    dosage: Coalesce(end of doseAndRate.doseRange, doseAndRate.doseQuantity)&#xA;    frequency: Coalesce(frequencyMax, frequency)&#xA;    period: Quantity(period, periodUnit)&#xA;If expectedSupplyDuration is not present and cannot be calculated, and the boundsPeriod is present (and completely specified), we can use that directly&#xA;    dosage.timing.repeat.boundsPeriod&#xA;This calculation results in a number of days, which can then be turned into a period by anchoring that to the&#xA;start of the validityPeriod or the authoredOn:&#xA;    Interval[earliestDispensable, earliestDispensable + expectedSupplyDuration - 1]&#xA;    earliestDispensable: Coalesce(start of validityPeriod, authoredOn)&#xA;The following function illustrates this completely:&#xA;*/&#xA;&#xA;/*&#xA;Calculates the Medication Period for a single MedicationRequest.&#xA;MedicationRequest instances provided to this function are expected&#xA;to conform to the [MMEMedicationRequest](http://build.fhir.org/ig/cqframework/opioid-mme-r4/StructureDefinition-mmemedicationrequest.html)&#xA;profile, which expects:&#xA;* 1 and only 1 dosageInstruction, multiple dosageInstruction elements will result in an error&#xA;* 1 and only 1 doseAndRate, multiple doseAndRate elements will result in an error&#xA;* 1 timing with 1 repeat, missing timing or repeat elements will result in a null&#xA;* frequency, frequencyMax, defaulting to 1&#xA;* period, periodUnit, defaulting to 1 'd'&#xA;* timeOfDay&#xA;* doseQuantity or doseRange, missing doseQuantity and doseRange will result in a null&#xA;Note that MedicationRequest status is not considered by this calculation, as the&#xA;list of MedicationRequest instances provided to this function should already have&#xA;considered appropriate statuses, depending on the use case, typically `completed`.&#xA;*/&#xA;&#xA;define fluent function medicationRequestPeriod(sourceRequest &quot;MedicationRequest&quot;):&#xA;  sourceRequest R&#xA;    let&#xA;      dosage: singleton from R.dosageInstruction,&#xA;      doseAndRate: singleton from dosage.doseAndRate,&#xA;      timing: dosage.timing,&#xA;      frequency: Coalesce(timing.repeat.frequencyMax.value, timing.repeat.frequency.value, 1),&#xA;      period: Quantity(&#xA;        Coalesce(timing.repeat.period.value, 1.0),&#xA;        Coalesce(timing.repeat.periodUnit, 'd')&#xA;      ),&#xA;      doseChoice: doseAndRate.dose,&#xA;      dose:&#xA;        case&#xA;          when doseChoice is FHIR.Range then FHIRHelpers.ToQuantity((doseChoice as FHIR.Range).high)&#xA;          when doseChoice is FHIR.SimpleQuantity then FHIRHelpers.ToQuantity(doseChoice as FHIR.SimpleQuantity)&#xA;          else null&#xA;        end,&#xA;      dosesPerDay: Coalesce(ToDaily(frequency, period), Count(timing.repeat.timeOfDay), 1.0),&#xA;      boundsPeriod: timingBoundsToInterval(timing.repeat.bounds),&#xA;      daysSupply:&#xA;        (convert FHIRHelpers.ToQuantity(R.dispenseRequest.expectedSupplyDuration as FHIR.Duration) to days).value,&#xA;      quantity: FHIRHelpers.ToQuantity(R.dispenseRequest.quantity as FHIR.Quantity),&#xA;      refills: Coalesce(R.dispenseRequest.numberOfRepeatsAllowed.value, 0),&#xA;      startDate:&#xA;        Coalesce(&#xA;          date from start of boundsPeriod,&#xA;          date from FHIRHelpers.ToDateTime(R.authoredOn as FHIR.dateTime),&#xA;          date from start of FHIRHelpers.ToInterval(R.dispenseRequest.validityPeriod as FHIR.Period)&#xA;        ),&#xA;      totalDaysSupplied: Coalesce(daysSupply, quantity.value / (dose.value * dosesPerDay)) * (1 + refills)&#xA;    return&#xA;      if startDate is not null and totalDaysSupplied is not null then&#xA;        Interval[startDate, startDate + Quantity(totalDaysSupplied - 1, 'day') ]&#xA;      else if startDate is not null and boundsPeriod.&quot;high&quot; is not null then&#xA;        Interval[startDate, date from end of boundsPeriod]&#xA;      else&#xA;        null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="54"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCumulativeMedicationDuration"/>
        </extension>
        <extension url="name">
          <valueString value="Quantity"/>
        </extension>
        <extension url="statement">
          <valueString value="/**********************************************************************/&#xA;/* Functions in this region are copied from opioid-mme-r4             */&#xA;/**********************************************************************/&#xA;&#xA;define function Quantity(value Decimal, unit String):&#xA;  if value is not null then&#xA;    System.Quantity { value: value, unit: unit }&#xA;  else&#xA;    null"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="55"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString value="define function ToString(value UnitsOfTime): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="56"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToQuantity"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) &#xA;value to a CQL Quantity&#xA;@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity&#xA;has a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)&#xA;an error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.&#xA;@seealso: ToCalendarUnit&#xA;*/&#xA;define function ToQuantity(quantity FHIR.Quantity):&#xA;    case&#xA;        when quantity is null then null&#xA;        when quantity.value is null then null&#xA;        when quantity.comparator is not null then&#xA;            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')&#xA;        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'&#xA;              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then&#xA;            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }&#xA;        else&#xA;            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')&#xA;    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="57"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCalendarUnit"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Converts a UCUM definite duration unit to a CQL calendar duration&#xA;unit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) &#xA;topic of the CQL specification.&#xA;@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate&#xA;*/&#xA;define function ToCalendarUnit(unit System.String):&#xA;    case unit&#xA;        when 'ms' then 'millisecond'&#xA;        when 's' then 'second'&#xA;        when 'min' then 'minute'&#xA;        when 'h' then 'hour'&#xA;        when 'd' then 'day'&#xA;        when 'wk' then 'week'&#xA;        when 'mo' then 'month'&#xA;        when 'a' then 'year'&#xA;        else unit&#xA;    end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="58"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCumulativeMedicationDuration"/>
        </extension>
        <extension url="name">
          <valueString value="ToDaily"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA; Goal is to get to number of days&#xA; Two broad approaches to the calculation:&#xA;  1) Based on supply and frequency, calculate the number of expected days the medication will cover/has covered&#xA;  2) Based on relevant period, determine a covered interval and calculate the length of that interval in days&#xA;This topic covers several use cases and illustrates how to calculate Cumulative&#xA;Medication Duration for each type of medication resource using the supply and&#xA;frequency approach.&#xA;*/&#xA;&#xA;/*&#xA;  For the first approach, we need to get from frequency to a frequency/day&#xA;  So we define ToDaily&#xA;*/&#xA;&#xA;/*&#xA;  Calculates daily frequency given frequency within a period&#xA;*/&#xA;define function ToDaily(frequency System.Integer, period System.Quantity):&#xA;  case period.unit&#xA;    when 'h' then frequency * (24.0 / period.value)&#xA;    when 'min' then frequency * (24.0 / period.value) * 60&#xA;    when 's' then frequency * (24.0 / period.value) * 60 * 60&#xA;    when 'd' then frequency * (24.0 / period.value) / 24&#xA;    when 'wk' then frequency * (24.0 / period.value) / (24 * 7)&#xA;    when 'mo' then frequency * (24.0 / period.value) / (24 * 30) /* assuming 30 days in month */&#xA;    when 'a' then frequency * (24.0 / period.value) / (24 * 365) /* assuming 365 days in year */&#xA;    when 'hour' then frequency * (24.0 / period.value)&#xA;    when 'minute' then frequency * (24.0 / period.value) * 60&#xA;    when 'second' then frequency * (24.0 / period.value) * 60 * 60&#xA;    when 'day' then frequency * (24.0 / period.value) / 24&#xA;    when 'week' then frequency * (24.0 / period.value) / (24 * 7)&#xA;    when 'month' then frequency * (24.0 / period.value) / (24 * 30) /* assuming 30 days in month */&#xA;    when 'year' then frequency * (24.0 / period.value) / (24 * 365) /* assuming 365 days in year */&#xA;    when 'hours' then frequency * (24.0 / period.value)&#xA;    when 'minutes' then frequency * (24.0 / period.value) * 60&#xA;    when 'seconds' then frequency * (24.0 / period.value) * 60 * 60&#xA;    when 'days' then frequency * (24.0 / period.value) / 24&#xA;    when 'weeks' then frequency * (24.0 / period.value) / (24 * 7)&#xA;    when 'months' then frequency * (24.0 / period.value) / (24 * 30) /* assuming 30 days in month */&#xA;    when 'years' then frequency * (24.0 / period.value) / (24 * 365) /* assuming 365 days in year */&#xA;    else Message(null, true, 'CMDLogic.ToDaily.UnknownUnit', ErrorLevel, 'Unknown unit ' &amp; period.unit)&#xA;  end"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="59"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCumulativeMedicationDuration"/>
        </extension>
        <extension url="name">
          <valueString value="timingBoundsToInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="/*&#xA;@description: Normalizes Timing.repeat.bounds (Duration | Range | Period) to Interval&lt;DateTime&gt;.&#xA;@deprecated: Use AtriusCommon.toTimingBoundsInterval(); retained for include compatibility.&#xA;*/&#xA;define function timingBoundsToInterval(bounds Choice&lt;FHIR.Duration, FHIR.Range, FHIR.Period&gt;):&#xA;  bounds.toTimingBoundsInterval()"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="60"/>
        </extension>
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="AtriusCommon"/>
        </extension>
        <extension url="name">
          <valueString value="toTimingBoundsInterval"/>
        </extension>
        <extension url="statement">
          <valueString value="define fluent function toTimingBoundsInterval(bounds Choice&lt;FHIR.Duration, FHIR.Range, FHIR.Period&gt;):&#xA;  bounds.toInterval()"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="61"/>
        </extension>
      </extension>
      <name value="EffectiveDataRequirements"/>
      <status value="active"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="module-definition"/>
        </coding>
      </type>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="AtriusIn model information"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/Library/AtriusIn-ModelInfo|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library Status"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/Library/AtriusStatus|1.15.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/Library/FHIRHelpers|4.4.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library QICoreCommon"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/Library/AtriusCommon|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library Hospice"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/Library/AtriusHospice|6.18.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library AIFrailLTCF"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/Library/AtriusAdvancedIllnessAndFrailty|1.27.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library AtriusCumulativeMedicationDuration"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/Library/AtriusCumulativeMedicationDuration|6.0.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library PalliativeCare"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/Library/AtriusPalliativeCare|1.18.000"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system ConditionVerificationStatusCodes"/>
        <resource value="http://terminology.hl7.org/CodeSystem/condition-ver-status|2.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system ConditionClinicalStatusCodes"/>
        <resource value="http://terminology.hl7.org/CodeSystem/condition-clinical|3.0.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system ObservationCategoryCodes"/>
        <resource value="http://terminology.hl7.org/CodeSystem/observation-category|2.0.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system LOINC"/>
        <resource value="http://loinc.org"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system AtriusLoincAnswers"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/CodeSystem/atrius-in-loinc-answers|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system DischargeDisposition"/>
        <resource value="http://terminology.hl7.org/CodeSystem/discharge-disposition|1.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system SNOMEDCT"/>
        <resource value="http://snomed.info/sct"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Diabetic Retinopathy"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetic-retinopathy|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Retinal or Dilated Eye Exam"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-retinal-or-dilated-eye-exam|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Diabetic Retinopathy Severity Level"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetic-retinopathy-severity|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Office Visit"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-office-visit|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Annual Wellness Visit"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-annual-wellness-visit|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Preventive Care Services Established Office Visit, 18 and Up"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-preventive-established-18up|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Preventive Care Services Initial Office Visit, 18 and Up"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-preventive-initial-18up|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Home Healthcare Services"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-home-healthcare|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Ophthalmological Services"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-ophthalmological-services|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Telephone Visits"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-telephone-visits|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Diabetes"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetes|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Encounter Inpatient"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-encounter-inpatient|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Hospice Encounter"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-encounter|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Hospice Care Ambulatory"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-care-ambulatory|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Hospice Diagnosis"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-diagnosis|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Frailty Device"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-device|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Frailty Diagnosis"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-diagnosis|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Frailty Encounter"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-encounter|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Frailty Symptom"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-symptom|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Advanced Illness"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-advanced-illness|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Dementia Medications"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-dementia-medications|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Palliative Care Diagnosis"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-diagnosis|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Palliative Care Encounter"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-encounter|0.1.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Palliative Care Intervention"/>
        <resource value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-intervention|0.1.0"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </parameter>
      <parameter>
        <name value="ErrorLevel"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="string"/>
      </parameter>
      <parameter>
        <name value="Numerator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="Denominator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <parameter>
        <name value="Denominator Exclusions"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="boolean"/>
      </parameter>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-problems-health-concerns|0.1.0"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetic-retinopathy|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-problems-health-concerns|0.1.0"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-diagnosis|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-problems-health-concerns|0.1.0"/>
        <mustSupport value="code"/>
        <mustSupport value="verificationStatus"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-diagnosis|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-problems-health-concerns|0.1.0"/>
        <mustSupport value="code"/>
        <mustSupport value="verificationStatus"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-advanced-illness|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-problems-health-concerns|0.1.0"/>
        <mustSupport value="code"/>
        <mustSupport value="verificationStatus"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-diagnosis|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-problems-health-concerns|0.1.0"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://snomed.info/sct"/>
            <code value="7183006"/>
            <display value="Anophthalmos"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-encounter-diagnosis|0.1.0"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetic-retinopathy|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-encounter-diagnosis|0.1.0"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetes|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-encounter-diagnosis|0.1.0"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-diagnosis|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-encounter-diagnosis|0.1.0"/>
        <mustSupport value="code"/>
        <mustSupport value="verificationStatus"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-diagnosis|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-encounter-diagnosis|0.1.0"/>
        <mustSupport value="code"/>
        <mustSupport value="verificationStatus"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-advanced-illness|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-encounter-diagnosis|0.1.0"/>
        <mustSupport value="code"/>
        <mustSupport value="verificationStatus"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-diagnosis|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-condition-encounter-diagnosis|0.1.0"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://snomed.info/sct"/>
            <code value="7183006"/>
            <display value="Anophthalmos"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="category"/>
        <mustSupport value="effective"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-retinal-or-dilated-eye-exam|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="category"/>
        <mustSupport value="value"/>
        <mustSupport value="effective"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="105914-6"/>
            <display value="Eye Diabetic retinopathy screening Autonomous artificial intelligence"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="category"/>
        <mustSupport value="value"/>
        <mustSupport value="effective"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="71490-7"/>
            <display value="Left eye Diabetic retinopathy severity level by Ophthalmoscopy"/>
          </code>
        </codeFilter>
        <codeFilter>
          <path value="value"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetic-retinopathy-severity|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="category"/>
        <mustSupport value="value"/>
        <mustSupport value="effective"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="71491-5"/>
            <display value="Right eye Diabetic retinopathy severity level by Ophthalmoscopy"/>
          </code>
        </codeFilter>
        <codeFilter>
          <path value="value"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-diabetic-retinopathy-severity|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="category"/>
        <mustSupport value="value"/>
        <mustSupport value="effective"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="71491-5"/>
            <display value="Right eye Diabetic retinopathy severity level by Ophthalmoscopy"/>
          </code>
        </codeFilter>
        <codeFilter>
          <path value="value"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="category"/>
        <mustSupport value="value"/>
        <mustSupport value="effective"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="71490-7"/>
            <display value="Left eye Diabetic retinopathy severity level by Ophthalmoscopy"/>
          </code>
        </codeFilter>
        <codeFilter>
          <path value="value"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="98181-1"/>
            <display value="Medical equipment used"/>
          </code>
        </codeFilter>
        <codeFilter>
          <path value="value"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-device|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-symptom|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="71802-3"/>
            <display value="Housing status"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="value"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="71802-3"/>
            <display value="Housing status"/>
          </code>
        </codeFilter>
        <codeFilter>
          <path value="value"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Patient"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient|4.0.1"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-office-visit|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-annual-wellness-visit|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-preventive-established-18up|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-preventive-initial-18up|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-home-healthcare|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-ophthalmological-services|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-telephone-visits|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="hospitalization.dischargeDisposition"/>
        <mustSupport value="period"/>
        <mustSupport value="status"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-encounter-inpatient|0.1.0"/>
        </codeFilter>
        <codeFilter>
          <path value="hospitalization.dischargeDisposition"/>
        </codeFilter>
        <dateFilter>
          <path value="period"/>
          <valuePeriod>
            <extension url="http://hl7.org/fhir/StructureDefinition/cqf-expression">
              <valueExpression>
                <language value="text/cql-identifier"/>
                <expression value="Measurement Period"/>
              </valueExpression>
            </extension>
          </valuePeriod>
        </dateFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="period"/>
        <mustSupport value="status"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-encounter|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-encounter|0.1.0"/>
        </codeFilter>
        <codeFilter>
          <path value="status"/>
          <code>
            <code value="finished"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter|4.0.1"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <codeFilter>
          <path value="type"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-encounter|0.1.0"/>
        </codeFilter>
        <codeFilter>
          <path value="status"/>
          <code>
            <code value="finished"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-observation-general-assessment|0.1.0"/>
        <mustSupport value="code"/>
        <mustSupport value="value"/>
        <mustSupport value="effective"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="45755-6"/>
            <display value="Hospice care [Minimum Data Set]"/>
          </code>
        </codeFilter>
        <codeFilter>
          <path value="value"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="https://atrius.in/fhir/r4/atrius-in/StructureDefinition/atrius-in-observation-general-assessment|0.1.0"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="effective"/>
        <codeFilter>
          <path value="code"/>
          <code>
            <system value="http://loinc.org"/>
            <code value="71007-9"/>
            <display value="Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="authoredOn"/>
        <mustSupport value="status"/>
        <mustSupport value="intent"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-care-ambulatory|0.1.0"/>
        </codeFilter>
        <dateFilter>
          <path value="authoredOn"/>
          <valuePeriod>
            <extension url="http://hl7.org/fhir/StructureDefinition/cqf-expression">
              <valueExpression>
                <language value="text/cql-identifier"/>
                <expression value="Measurement Period"/>
              </valueExpression>
            </extension>
          </valuePeriod>
        </dateFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Procedure|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="performed"/>
        <mustSupport value="status"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-hospice-care-ambulatory|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Procedure|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="performed"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-palliative-care-intervention|0.1.0"/>
        </codeFilter>
        <codeFilter>
          <path value="status"/>
          <code>
            <code value="completed"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="DeviceRequest"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/DeviceRequest|4.0.1"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="intent"/>
        <mustSupport value="authoredOn"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-frailty-device|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <extension url="http://hl7.org/fhir/StructureDefinition/cqf-relatedRequirement">
          <extension url="targetId">
            <valueString value="831"/>
          </extension>
          <extension url="targetProperty">
            <valueString value="medication"/>
          </extension>
        </extension>
        <type value="Medication"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Medication|4.0.1"/>
        <mustSupport value="id"/>
        <mustSupport value="code"/>
        <codeFilter>
          <path value="code"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-dementia-medications|0.1.0"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement id="831">
        <type value="MedicationRequest"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/MedicationRequest|4.0.1"/>
        <mustSupport value="medication.reference"/>
        <mustSupport value="dosageInstruction"/>
        <mustSupport value="dispenseRequest"/>
        <mustSupport value="dispenseRequest.expectedSupplyDuration"/>
        <mustSupport value="dispenseRequest.quantity"/>
        <mustSupport value="dispenseRequest.numberOfRepeatsAllowed"/>
        <mustSupport value="dispenseRequest.numberOfRepeatsAllowed.value"/>
        <mustSupport value="authoredOn"/>
        <mustSupport value="dispenseRequest.validityPeriod"/>
        <mustSupport value="status"/>
        <mustSupport value="intent"/>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationRequest"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/MedicationRequest|4.0.1"/>
        <mustSupport value="medication"/>
        <mustSupport value="dosageInstruction"/>
        <mustSupport value="dispenseRequest"/>
        <mustSupport value="dispenseRequest.expectedSupplyDuration"/>
        <mustSupport value="dispenseRequest.quantity"/>
        <mustSupport value="dispenseRequest.numberOfRepeatsAllowed"/>
        <mustSupport value="dispenseRequest.numberOfRepeatsAllowed.value"/>
        <mustSupport value="authoredOn"/>
        <mustSupport value="dispenseRequest.validityPeriod"/>
        <mustSupport value="status"/>
        <mustSupport value="intent"/>
        <codeFilter>
          <path value="medication"/>
          <valueSet value="https://atrius.in/fhir/r4/atrius-in/ValueSet/atrius-vs-dementia-medications|0.1.0"/>
        </codeFilter>
      </dataRequirement>
    </Library>
  </contained>
  <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis">
    <valueCode value="boolean"/>
  </extension>
  <extension url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance">
    <extension url="usage">
      <valueCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
          <code value="supplemental-data"/>
        </coding>
      </valueCodeableConcept>
    </extension>
    <extension url="guidance">
      <valueMarkdown value="SDE Sex uses Patient.gender mapped to the same SNOMED Male/Female findings as CMS. SDE Payer uses AtriusIn coverage payer type (PM-JAY, ESIS, private, public, self-pay). SDE Residence (state/district) and SDE Urban Rural replace US Core race and ethnicity and are not US-comparable. Anophthalmos uses International 7183006 (HTS preferred display Anophthalmos); CMS US 15665641000119103 is not used. Eye-exam Observation retrieve stays base Observation until modelinfo includes ObservationClinicalResult."/>
    </extension>
  </extension>
  <extension url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements">
    <valueCanonical value="#effective-data-requirements"/>
  </extension>
  <url value="https://atrius.in/fhir/r4/atrius-in/Measure/AtriusCMS131DiabetesEyeExam"/>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
        <code value="version-independent"/>
      </coding>
    </type>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:uuid:97af11c3-97fc-4600-b66b-4202728b6257"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
        <code value="version-specific"/>
      </coding>
    </type>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:uuid:3a269f10-2b17-42d3-9ba3-48ecbc3c63c2"/>
  </identifier>
  <identifier>
    <use value="usual"/>
    <type>
      <coding>
        <system value="http://terminology.hl7.org/CodeSystem/artifact-identifier-type"/>
        <code value="short-name"/>
      </coding>
    </type>
    <value value="CMS131"/>
  </identifier>
  <identifier>
    <use value="official"/>
    <system value="https://atrius.in/fhir/r4/atrius-in"/>
    <value value="AtriusCMS131DiabetesEyeExam"/>
  </identifier>
  <identifier>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:oid:1.3.6.1.4.1.66219.1.29.4"/>
  </identifier>
  <version value="0.1.0"/>
  <name value="AtriusCMS131DiabetesEyeExam"/>
  <title value="Diabetes: Eye Exam (Atrius CMS131)"/>
  <status value="draft"/>
  <experimental value="true"/>
  <date value="2026-09-21"/>
  <publisher value="Atrius"/>
  <contact>
    <name value="Atrius"/>
    <telecom>
      <system value="url"/>
      <value value="https://atrius.in"/>
    </telecom>
  </contact>
  <description value="Proportion measure: adults 18–75 with diabetes and a qualifying outpatient encounter who have a retinal or autonomous eye exam in the required lookback. Process measure; improvement is increase."/>
  <relatedArtifact>
    <type value="depends-on"/>
    <display value="Atrius CMS131 CQL Library"/>
    <resource value="https://atrius.in/fhir/r4/atrius-in/Library/AtriusCMS131DiabetesEyeExam|0.1.0"/>
  </relatedArtifact>
  <library value="https://atrius.in/fhir/r4/atrius-in/Library/AtriusCMS131DiabetesEyeExam|0.1.0"/>
  <scoring>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-scoring"/>
      <code value="proportion"/>
    </coding>
  </scoring>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-type"/>
      <code value="process"/>
    </coding>
  </type>
  <improvementNotation>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-improvement-notation"/>
      <code value="increase"/>
    </coding>
  </improvementNotation>
  <group id="group-1">
    <population id="initial-population">
      <code>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="initial-population"/>
        </coding>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Initial Population"/>
      </criteria>
    </population>
    <population id="denominator">
      <code>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator"/>
        </coding>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator"/>
      </criteria>
    </population>
    <population id="denominator-exclusion">
      <code>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="denominator-exclusion"/>
        </coding>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator Exclusions"/>
      </criteria>
    </population>
    <population id="numerator">
      <code>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="numerator"/>
        </coding>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Numerator"/>
      </criteria>
    </population>
  </group>
</Measure>