Quality Measure Implementation Guide (STU5)
5.0.0-ballot2 - ballot United States of America flag

This page is part of the Quality Measure STU2 for FHIR R4 Implementation Guide (v5.0.0-ballot2: STU5 (v5.0.0) Ballot 2) based on FHIR (HL7® FHIR® Standard) R4. The current version which supersedes this version is 4.0.0. For a full list of available versions, see the Directory of published versions

: Module Definition Library - EXM Logic - XML Representation

Active as of 2024-04-09

Raw xml | Download



<Library xmlns="http://hl7.org/fhir">
  <id value="effective-data-requirements-exmlogic"/>
  <meta>
    <profile
             value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-moduledefinitionlibrary"/>
  </meta>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
    <table class="grid dict">
        
        
        <tr>
            <th scope="row"><b>Title: </b></th>
            <td style="padding-left: 4px;">Module Definition Library - EXM Logic</td>
        </tr>
        

        
        
        <tr>
            <th scope="row"><b>Id: </b></th>
            <td style="padding-left: 4px;">effective-data-requirements-exmlogic</td>
        </tr>
        

        
        
        <tr>
            <th scope="row"><b>Version: </b></th>
            <td style="padding-left: 4px;">1.0.0</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Url: </b></th>
            <td style="padding-left: 4px;"><a href="Library-effective-data-requirements-exmlogic.html">Module Definition Library - EXM Logic</a></td>
        </tr>
        

        

        

        

        

        
        <tr>
            <th scope="row"><b>Type: </b></th>
            <td style="padding-left: 4px;">
                
                    
                        
                        <p style="margin-bottom: 5px;">
                            <b>system: </b> <span><a href="http://terminology.hl7.org/5.5.0/CodeSystem-library-type.html">LibraryType</a></span>
                        </p>
                        
                        
                        <p style="margin-bottom: 5px;">
                            <b>code: </b> <span>module-definition</span>
                        </p>
                        
                        
                    
                
                
            </td>
        </tr>
        

        

        
        <tr>
            <th scope="row"><b>Date: </b></th>
            <td style="padding-left: 4px;">2024-04-09 13:20:21+0000</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Publisher: </b></th>
            <td style="padding-left: 4px;">HL7 International / Clinical Quality Information</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Description: </b></th>
            <td style="padding-left: 4px;"><div><p>This library is used as an example module definition in the FHIR Quality Measure Implementation Guide</p>
</div></td>
        </tr>
        

        

        

        

        
        <tr>
            <th scope="row"><b>Jurisdiction: </b></th>
            <td style="padding-left: 4px;">US</td>
        </tr>
        

        

        

        

        

        

        

        

        
        <tr>
            <th scope="row"><b>Related Artifacts: </b></th>
            <td style="padding-left: 4px;">
                
                
                
                <p><b>Dependencies</b></p>
                <ul>
                  
                    <li><a href="http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1">http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1</a></li>
                  
                    <li><a href="http://terminology.hl7.org/5.5.0/CodeSystem-diagnosis-role.html">Diagnosis Role</a></li>
                  
                    <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion">Payer</a></li>
                  
                    <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.299/expansion">Psychiatric/Mental Health Diagnosis</a></li>
                  
                </ul>
                
                
                
                
                
            </td>
        </tr>
        

        
        <tr>
          <th scope="row"><b>Parameters: </b></th>
          <td style="padding-left: 4px;">
            <table class="grid-dict">
              <tr><th><b>Name</b></th><th><b>Type</b></th><th><b>Min</b></th><th><b>Max</b></th><th><b>In/Out</b></th></tr>
              
                <tr><th>Measurement Period</th><th>Period</th><th>0</th><th>1</th><th>in</th></tr>
              
                <tr><th>SDE Sex</th><th>Coding</th><th>0</th><th>1</th><th>out</th></tr>
              
                <tr><th>Stratifier 3</th><th>Encounter</th><th>0</th><th>*</th><th>out</th></tr>
              
                <tr><th>Stratifier 4</th><th>Encounter</th><th>0</th><th>*</th><th>out</th></tr>
              
                <tr><th>SDE Payer</th><th>Resource</th><th>0</th><th>*</th><th>out</th></tr>
              
                <tr><th>Initial Population</th><th>Encounter</th><th>0</th><th>*</th><th>out</th></tr>
              
                <tr><th>SDE Ethnicity</th><th>Coding</th><th>0</th><th>*</th><th>out</th></tr>
              
                <tr><th>SDE Race</th><th>Coding</th><th>0</th><th>*</th><th>out</th></tr>
              
                <tr><th>Stratifier 1</th><th>Encounter</th><th>0</th><th>*</th><th>out</th></tr>
              
                <tr><th>Stratifier 2</th><th>Encounter</th><th>0</th><th>*</th><th>out</th></tr>
              
            </table>
          </td>
        </tr>
        

        
        <tr>
          <th scope="row"><b>Data Requirements:</b></th>
          <td style="padding-left: 4px;">
            <table class="grid-dict">
              <tr><th><b>Type</b></th><th><b>Profile</b></th><th><b>MS</b></th><th><b>Code Filter</b></th></tr>
              
                <tr>
                  <th>Patient</th>
                  <th>http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient</th>
                  <th/>
                  <th>
                    
                  </th>
                </tr>
              
                <tr>
                  <th>Patient</th>
                  <th>http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient</th>
                  <th>;;;</th>
                  <th>
                    
                  </th>
                </tr>
              
                <tr>
                  <th>Patient</th>
                  <th>http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient</th>
                  <th>;;;</th>
                  <th>
                    
                      <b>code filter: </b>
                      
                      <br/>
                      
                      
                      <span style="padding-left: 4px;">
                          <b>path: </b><span>url</span>
                      </span>
                      
                      <br/>
                      
                      
                      
                      
                          
                          <p style="margin-bottom: 5px;">
                              <b>system: </b> <span>urn:ietf:rfc:3986</span>
                          </p>
                          
                          
                          <p style="margin-bottom: 5px;">
                              <b>code: </b> <span>http://hl7.org/fhir/us/core/StructureDefinition/us-core-race</span>
                          </p>
                          
                          
                      
                    
                  </th>
                </tr>
              
                <tr>
                  <th>Encounter</th>
                  <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>
                  <th>;</th>
                  <th>
                    
                  </th>
                </tr>
              
                <tr>
                  <th>Coverage</th>
                  <th>http://hl7.org/fhir/StructureDefinition/Coverage</th>
                  <th>;;</th>
                  <th>
                    
                      <b>code filter: </b>
                      
                      <br/>
                      
                      
                      <span style="padding-left: 4px;">
                          <b>path: </b><span>type</span>
                      </span>
                      
                      <br/>
                      
                      
                      
                      <span style="padding-left: 4px;">
                          <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</span>
                      </span>
                      
                      
                    
                  </th>
                </tr>
              
            </table>
          </td>
        </tr>
        

        
    </table>
</div>
  </text>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
    <valueCoding>
      <system value="http://terminology.hl7.org/CodeSystem/diagnosis-role"/>
      <code value="billing"/>
      <display value="Billing"/>
    </valueCoding>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="EXMLogic-FHIR"/>
    </extension>
    <extension url="name">
      <valueString value="SDE Sex"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;SDE Sex&quot;:
  case
    when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }
    when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }
    else null
  end"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="0"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="EXMLogic-FHIR"/>
    </extension>
    <extension url="name">
      <valueString value="Inpatient Encounter"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Inpatient Encounter&quot; :
  [&quot;Encounter&quot;] Encounter
    where LengthInDays(Encounter.period) &lt;= 120
      and Encounter.period ends during &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="EXMLogic-FHIR"/>
    </extension>
    <extension url="name">
      <valueString value="Stratifier 3"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Stratifier 3&quot; :
  &quot;Inpatient Encounter&quot; Encounter
    where PrincipalDiagnosis(Encounter) is null"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="2"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="EXMLogic"/>
    </extension>
    <extension url="name">
      <valueString value="Stratifier 4"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Stratifier 4&quot; :
  &quot;Inpatient Encounter&quot; Encounter
    where PrincipalDiagnosis(Encounter) is null"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="3"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="EXMLogic-FHIR"/>
    </extension>
    <extension url="name">
      <valueString value="SDE Payer"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;SDE Payer&quot;:
    [Coverage: type in &quot;Payer&quot;] Payer
      return {
        code: Payer.type,
        period: Payer.period
      }"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="4"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="EXMLogic"/>
    </extension>
    <extension url="name">
      <valueString value="Initial Population"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Initial Population&quot; :
  &quot;Inpatient Encounter&quot; Encounter"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="5"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="EXMLogic-FHIR"/>
    </extension>
    <extension url="name">
      <valueString value="SDE Ethnicity"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;SDE Ethnicity&quot;:
  (flatten (
    Patient.extension Extension
      where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'
        return Extension.extension
  )) E
    where E.url = 'ombCategory'
      or E.url = 'detailed'
    return E.value as Coding"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="6"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="EXMLogic"/>
    </extension>
    <extension url="name">
      <valueString value="SDE Race"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;SDE Race&quot;:
  (flatten (
    Patient.extension Extension
      where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'
        return Extension.extension
  )) E
    where E.url = 'ombCategory'
      or E.url = 'detailed'
    return E.value as Coding"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="7"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="EXMLogic-FHIR"/>
    </extension>
    <extension url="name">
      <valueString value="Stratifier 1"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Stratifier 1&quot; :
  &quot;Inpatient Encounter&quot; Encounter
    where not (PrincipalDiagnosis(Encounter).code in &quot;Psychiatric/Mental Health Patient&quot;)"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="8"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
    <extension url="libraryName">
      <valueString value="EXMLogic-FHIR"/>
    </extension>
    <extension url="name">
      <valueString value="Stratifier 2"/>
    </extension>
    <extension url="statement">
      <valueString
                   value="define &quot;Stratifier 2&quot; :
  &quot;Inpatient Encounter&quot; Encounter
    where PrincipalDiagnosis(Encounter).code in &quot;Psychiatric/Mental Health Patient&quot;"/>
    </extension>
    <extension url="displaySequence">
      <valueInteger value="9"/>
    </extension>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="cqi"/>
  </extension>
  <url
       value="http://hl7.org/fhir/us/cqfmeasures/Library/effective-data-requirements-exmlogic"/>
  <version value="1.0.0"/>
  <name value="EffectiveDataRequirements"/>
  <title value="Module Definition Library - EXM Logic"/>
  <status value="active"/>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
      <code value="module-definition"/>
    </coding>
  </type>
  <date value="2024-04-09T13:20:21+00:00"/>
  <publisher value="HL7 International / Clinical Quality Information"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="http://www.hl7.org/Special/committees/cqi"/>
    </telecom>
  </contact>
  <description
               value="This library is used as an example module definition in the FHIR Quality Measure Implementation Guide"/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="US"/>
    </coding>
  </jurisdiction>
  <relatedArtifact>
    <type value="depends-on"/>
    <display value="Library FHIRHelpers"/>
    <resource
              value="http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on"/>
    <display value="Code system Diagnosis Role"/>
    <resource value="http://terminology.hl7.org/CodeSystem/diagnosis-role"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on"/>
    <display value="Value set Payer"/>
    <resource
              value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
  </relatedArtifact>
  <relatedArtifact>
    <type value="depends-on"/>
    <display value="Value set Psychiatric/Mental Health Patient"/>
    <resource
              value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299"/>
  </relatedArtifact>
  <parameter>
    <name value="Measurement Period"/>
    <use value="in"/>
    <min value="0"/>
    <max value="1"/>
    <type value="Period"/>
  </parameter>
  <parameter>
    <name value="SDE Sex"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="Stratifier 3"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="Encounter"/>
  </parameter>
  <parameter>
    <name value="Stratifier 4"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="Encounter"/>
  </parameter>
  <parameter>
    <name value="SDE Payer"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="Resource"/>
  </parameter>
  <parameter>
    <name value="Initial Population"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="Encounter"/>
  </parameter>
  <parameter>
    <name value="SDE Ethnicity"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="SDE Race"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="Coding"/>
  </parameter>
  <parameter>
    <name value="Stratifier 1"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="Encounter"/>
  </parameter>
  <parameter>
    <name value="Stratifier 2"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <type value="Encounter"/>
  </parameter>
  <dataRequirement>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern">
      <valueString value="Patient?_id={{context.patientId}}"/>
    </extension>
    <type value="Patient"/>
    <profile
             value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"/>
  </dataRequirement>
  <dataRequirement>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern">
      <valueString value="Patient?_id={{context.patientId}}"/>
    </extension>
    <extension url="http://hl7.org/fhir/StructureDefinition/cqf-valueFilter">
      <extension url="path">
        <valueString value="url"/>
      </extension>
      <extension url="comparator">
        <valueCode value="eq"/>
      </extension>
      <extension url="value">
        <valueString
                     value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"/>
      </extension>
    </extension>
    <type value="Patient"/>
    <profile
             value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"/>
    <mustSupport value="url"/>
    <mustSupport value="extension"/>
    <mustSupport value="value"/>
  </dataRequirement>
  <dataRequirement>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern">
      <valueString value="Patient?_id={{context.patientId}}"/>
    </extension>
    <type value="Patient"/>
    <profile
             value="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient"/>
    <mustSupport value="url"/>
    <mustSupport value="extension"/>
    <mustSupport value="value"/>
    <codeFilter>
      <path value="url"/>
      <code>
        <system value="urn:ietf:rfc:3986"/>
        <code
              value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"/>
      </code>
    </codeFilter>
  </dataRequirement>
  <dataRequirement>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern">
      <valueString value="Encounter?subject=Patient/{{context.patientId}}"/>
    </extension>
    <extension url="http://hl7.org/fhir/StructureDefinition/cqf-isSelective">
      <valueBoolean value="true"/>
    </extension>
    <type value="Encounter"/>
    <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
    <mustSupport value="period"/>
    <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>
    <extension
               url="http://hl7.org/fhir/StructureDefinition/cqf-fhirQueryPattern">
      <valueString
                   value="Coverage?policy-holder=Patient/{{context.patientId}}&amp;type:in=http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
    </extension>
    <type value="Coverage"/>
    <profile value="http://hl7.org/fhir/StructureDefinition/Coverage"/>
    <mustSupport value="type"/>
    <mustSupport value="period"/>
    <codeFilter>
      <path value="type"/>
      <valueSet
                value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"/>
    </codeFilter>
  </dataRequirement>
</Library>