dQM QICore Content Implementation Guide
2026.0.0 - CI Build

dQM QICore Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2026.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/dqm-content-qicore-2026/ and changes regularly. See the Directory of published versions

: null - XML Representation

Draft as of 2026-01-20

Raw xml | Download


<Measure xmlns="http://hl7.org/fhir">
  <id value="StratificationEncounterExample"/>
  <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">Version</th>



<td class="content-container">2026.0.0</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">Measure Scoring</th>



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


</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">Basis</th>



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


</tr>













  
  
    
    
    <tr>
      
        

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


      
      <td class="content-container">
        
        <em>ID</em>: initial-population
        <br/>
        
        
          
          <em>Description</em>: No description provided
          
        
        
          
            
              
              <em>Criteria</em>: <a href="#group-1-initial-population">Initial Population</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

  
    
    
    <tr>
      
        

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


      
      <td class="content-container">
        
        <em>ID</em>: denominator
        <br/>
        
        
          
          <em>Description</em>: No description provided
          
        
        
          
            
              
              <em>Criteria</em>: <a href="#group-1-denominator">Denominator</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

  
    
    
    <tr>
      
        

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


      
      <td class="content-container">
        
        <em>ID</em>: numerator
        <br/>
        
        
          
          <em>Description</em>: No description provided
          
        
        
          
            
              
              <em>Criteria</em>: <a href="#group-1-numerator">Numerator</a> 
            
          
          
        
        
        
      </td>
    </tr>
  

  
<tr>
  

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


  <td class="content-container">
    
    
      
        <em>Code</em>: <span title="Codes:">Criteria-based Age Range Stratifier, 0 to 20 years</span>
      
      
    
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
    
      
        <em>Code</em>: <span title="Codes:">Criteria-based Age Range Stratifier, 21 to 40 years</span>
      
      
    
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
    
      
        <em>Code</em>: <span title="Codes:">Criteria-based Age Range Stratifier, 41+ years</span>
      
      
    
    
  </td>
</tr>

<tr>
  

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


  <td class="content-container">
    
    
      
        <em>Code</em>: <span title="Codes:">Value-based Gender and Age Range Stratifier</span>
      
      
    
    
  </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-StratificationEncounterExample.html">Stratification Encounter Example</a></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/>
  </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 scope="row" rowspan="2" class="row-header">
    
    Initial Population
    
  </th>
</tr>
<tr>

  <td>
    
    
    
    
      
      <a name="group-1-initial-population"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;Well-Visit Encounter&quot;</code></pre>
    
      
      <a href="#stratificationencounterexample-initial-population"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

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

  <td>
    
    
    
    
      
      <a name="group-1-denominator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Well-Visit Encounter&quot;</code></pre>
    
      
      <a href="#stratificationencounterexample-denominator"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

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

  <td>
    
    
    
    
      
      <a name="group-1-numerator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  &quot;Well-Visit Encounter&quot; E
    with &quot;Blood Pressure Observation&quot; O
      such that O.issued during E.period</code></pre>
    
      
      <a href="#stratificationencounterexample-numerator"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
      
    
  

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

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/* Criteria-based Stratification */

define &quot;Stratifier P0Y--P21Y&quot;:
  &quot;Well-Visit Encounter&quot; E
    where Patient.ageInYearsAt(end of E.period) between 0 and 20</code></pre>
    
      
      <a href="#stratificationencounterexample-stratifier-p0y--p21y"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

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

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratifier P21Y--P41Y&quot;:
  &quot;Well-Visit Encounter&quot; E
    where Patient.ageInYearsAt(end of E.period) between 21 and 40</code></pre>
    
      
      <a href="#stratificationencounterexample-stratifier-p21y--p41y"><em>Definition</em></a>
    
  </td>

</tr>

          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
    
  

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

  <td>
    
    
    
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratifier P41Y--P9999Y&quot;:
  &quot;Well-Visit Encounter&quot; E
    where Patient.ageInYearsAt(end of E.period) &gt;= 41</code></pre>
    
      
      <a href="#stratificationencounterexample-stratifier-p41y--p9999y"><em>Definition</em></a>
    
  </td>

</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> StratificationEncounterExample</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="stratificationencounterexample-well-visit-encounter"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Well-Visit Encounter&quot;:
  [Encounter] E
    where E.status = 'finished'
      and E.period ends 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> StratificationEncounterExample</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="stratificationencounterexample-blood-pressure-observation"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Blood Pressure Observation&quot;:
  [Observation] O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.issued 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> StratificationEncounterExample</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="stratificationencounterexample-numerator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Numerator&quot;:
  &quot;Well-Visit Encounter&quot; E
    with &quot;Blood Pressure Observation&quot; O
      such that O.issued during E.period</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="stratificationencounterexample-stratifier-p21y--p41y"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratifier P21Y--P41Y&quot;:
  &quot;Well-Visit Encounter&quot; E
    where Patient.ageInYearsAt(end of E.period) between 21 and 40</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="stratificationencounterexample-denominator"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Denominator&quot;:
  &quot;Well-Visit Encounter&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> StratificationEncounterExample</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="stratificationencounterexample-stratifier-p0y--p21y"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/* Criteria-based Stratification */

define &quot;Stratifier P0Y--P21Y&quot;:
  &quot;Well-Visit Encounter&quot; E
    where Patient.ageInYearsAt(end of E.period) between 0 and 20</code></pre>
  </td>

</tr>



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="stratificationencounterexample-initial-population"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:
  &quot;Well-Visit Encounter&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> StratificationEncounterExample</td>

</tr>
<tr>

  <td>
    
    
    
    
      <a name="stratificationencounterexample-stratifier-p41y--p9999y"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Stratifier P41Y--P9999Y&quot;:
  &quot;Well-Visit Encounter&quot; E
    where Patient.ageInYearsAt(end of E.period) &gt;= 41</code></pre>
  </td>

</tr>



        



        



        



        



        



        




        
        



        



        



        



        



        



        



        



        



        



        



        



        


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

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

</tr>
<tr>

  <td>
    
    
    
    
      <a name="patientcommon-ageinyearsat"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
@description: Returns the age in years of the patient, as of the given date
@comment: This function returns the number of whole calendar years between the patient birth 
date and the given date. Regardless of whether the patient has a birthTime, the calculation is
performed using only the birth date. If the given date has a time component, it is ignored, on 
the grounds that birth time is almost universally not considered when determining age in years.
*/
define fluent function ageInYearsAt(patient Patient, asOf DateTime):
  CalculateAgeInYearsAt(Patient.birthDate, date from asOf)</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 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-todatetime"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value instant): 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-todate"> </a>
    
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDate(value date): value.value</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">Terminology</th>



<td class="content-container">None</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">None</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>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: status, issued
    <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>
    <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>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: status, period
    <br/>
   
   
  </td>
</tr>

  
  

<tr>
  <th colspan="2" scope="row" class="row-header">Generated using version 0.5.0 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-logicDefinition">
        <extension url="libraryName">
          <valueString value="StratificationEncounterExample"/>
        </extension>
        <extension url="name">
          <valueString value="Well-Visit Encounter"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Well-Visit Encounter&quot;:
  [Encounter] E
    where E.status = 'finished'
      and E.period ends during 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="StratificationEncounterExample"/>
        </extension>
        <extension url="name">
          <valueString value="Blood Pressure Observation"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Blood Pressure Observation&quot;:
  [Observation] O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.issued during day of &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="StratificationEncounterExample"/>
        </extension>
        <extension url="name">
          <valueString value="Numerator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Numerator&quot;:
  &quot;Well-Visit Encounter&quot; E
    with &quot;Blood Pressure Observation&quot; O
      such that O.issued during E.period"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="StratificationEncounterExample"/>
        </extension>
        <extension url="name">
          <valueString value="Stratifier P21Y--P41Y"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Stratifier P21Y--P41Y&quot;:
  &quot;Well-Visit Encounter&quot; E
    where Patient.ageInYearsAt(end of E.period) between 21 and 40"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="StratificationEncounterExample"/>
        </extension>
        <extension url="name">
          <valueString value="Denominator"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Denominator&quot;:
  &quot;Well-Visit Encounter&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="StratificationEncounterExample"/>
        </extension>
        <extension url="name">
          <valueString value="Stratifier P0Y--P21Y"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/* Criteria-based Stratification */

define &quot;Stratifier P0Y--P21Y&quot;:
  &quot;Well-Visit Encounter&quot; E
    where Patient.ageInYearsAt(end of E.period) between 0 and 20"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="StratificationEncounterExample"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Initial Population&quot;:
  &quot;Well-Visit Encounter&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="6"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="StratificationEncounterExample"/>
        </extension>
        <extension url="name">
          <valueString value="Stratifier P41Y--P9999Y"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Stratifier P41Y--P9999Y&quot;:
  &quot;Well-Visit Encounter&quot; E
    where Patient.ageInYearsAt(end of E.period) &gt;= 41"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </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="8"/>
        </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="/*
@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]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="9"/>
        </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="10"/>
        </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 instant): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="11"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="PatientCommon"/>
        </extension>
        <extension url="name">
          <valueString value="ageInYearsAt"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/*
@description: Returns the age in years of the patient, as of the given date
@comment: This function returns the number of whole calendar years between the patient birth 
date and the given date. Regardless of whether the patient has a birthTime, the calculation is
performed using only the birth date. If the given date has a time component, it is ignored, on 
the grounds that birth time is almost universally not considered when determining age in years.
*/
define fluent function ageInYearsAt(patient Patient, asOf DateTime):
  CalculateAgeInYearsAt(Patient.birthDate, date from asOf)"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="12"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDate"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToDate(value date): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="13"/>
        </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="FHIR model information"/>
        <resource
                  value="http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource
                  value="http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library PatientCommon"/>
        <resource value="https://madie.cms.gov/Library/PatientCommon"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource
                  value="http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </parameter>
      <parameter>
        <name value="Numerator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Stratifier P21Y--P41Y"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Denominator"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Stratifier P0Y--P21Y"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Stratifier P41Y--P9999Y"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="status"/>
        <mustSupport value="issued"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="status"/>
        <mustSupport value="issued"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Patient"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Patient"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
      </dataRequirement>
    </Library>
  </contained>
  <extension
             url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements">
    <valueCanonical value="#effective-data-requirements"/>
  </extension>
  <url value="https://madie.cms.gov/Measure/StratificationEncounterExample"/>
  <version value="2026.0.0"/>
  <status value="draft"/>
  <date value="2026-01-20T14:56:48+00:00"/>
  <library
           value="https://madie.cms.gov/Library/StratificationEncounterExample"/>
  <scoring>
    <coding>
      <system value="http://hl7.org/fhir/measure-scoring"/>
      <code value="proportion"/>
    </coding>
  </scoring>
  <group id="group-1">
    <extension
               url="http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-populationBasis">
      <valueCode value="Encounter"/>
    </extension>
    <population id="initial-population">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="initial-population"/>
          <display 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"/>
          <display value="Denominator"/>
        </coding>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Denominator"/>
      </criteria>
    </population>
    <population id="numerator">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="numerator"/>
          <display value="Numerator"/>
        </coding>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Numerator"/>
      </criteria>
    </population>
    <stratifier>
      <code>
        <text value="Criteria-based Age Range Stratifier, 0 to 20 years"/>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Stratifier P0Y--P21Y"/>
      </criteria>
    </stratifier>
    <stratifier>
      <code>
        <text value="Criteria-based Age Range Stratifier, 21 to 40 years"/>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Stratifier P21Y--P41Y"/>
      </criteria>
    </stratifier>
    <stratifier>
      <code>
        <text value="Criteria-based Age Range Stratifier, 41+ years"/>
      </code>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Stratifier P41Y--P9999Y"/>
      </criteria>
    </stratifier>
    <stratifier>
      <code>
        <text value="Value-based Gender and Age Range Stratifier"/>
      </code>
      <component>
        <code>
          <text value="Value-based Gender Component Stratifier"/>
        </code>
        <criteria>
          <language value="text/cql-identifier"/>
          <expression value="Gender Stratifier"/>
        </criteria>
      </component>
      <component>
        <code>
          <text value="Value-based Age Range Component Stratifier"/>
        </code>
        <criteria>
          <language value="text/cql-identifier"/>
          <expression value="Age Range Stratifier"/>
        </criteria>
      </component>
    </stratifier>
  </group>
</Measure>