CMS FHIR Quality Measure Development IG
1.0.0-cibuild - CI Build
CMS FHIR Quality Measure Development IG, published by Centers for Medicare & Medicaid Services (CMS). This guide is not an authorized publication; it is the continuous build for version 1.0.0-cibuild built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/cms-qmd/ and changes regularly. See the Directory of published versions
Reviewed 2024-06-18 - Updates to be made and reviewed again with group based on discussions
QI-Core defines an Encounter profile to model any encounter between a patient and any number of providers in any setting, including virtual.
NOTE: For background information on accessing clinical information with CQL, see the Retrieve topic in the CQL specification.
By default, encounters in QI-Core are characterized by the type element, which is typically associated with a value set to limit the set of encounters returned to those that a code in the given value set. For example:
define "Office Visit Encounters":
[Encounter: "Office Visit"]
The type element of Encounters is plural meaning that a given Encounter may have multiple types associated with it. When using value sets such as the “Office Visit” example above, the retrieve resolves using the List
This issue is being reviewed and may result in a specification or tooling change to support this use case (see Translator Issue 1181). However, at this time there are two possible workarounds:
define "Office Visit Encounters By Code":
[Encounter] E
where exists ((E.type) T where T ~ "Office Visit Code")
Note that this latter workaround will typically result in an unrestricted data requirement for Encounters. For this reason, best-practice is to use the first workaround.
The QI-Core profile also supports characterizing encounters by the class element, which is used to categorize encounters more broadly than the type element, using the ActEncounterCode value set. For example:
define "Virtual Encounters":
[Encounter: class ~ QICoreCommon."virtual"]
Note that although QDM-based eCQMs have typically used a type-based approach to filtering encounters, because
classis a required element in USCore, we propose using class to filter encounters first, unless measure intent needs to search for encounters by type across classes. Additional filtering may be required beyond the class to limit encounters based on specialty, for example:
define "Ophthalmology Encounter Codes":
[Encounter: class in "Inpatient Encounter Classes"] InpatientEncounter
where InpatientEncounter.type in "Ophthalmology Encounter Codes"
Encounters often need to be filtered based on status and period, for example:
define "Completed Encounters During the Measurement Period":
[Encounter: "Office Visit"] OfficeVisit
where OfficeVisit.status = 'finished'
and OfficeVisit.period during "Measurement Period"
The CQMCommon library defines a lengthInDays() function that calculates the difference in days between the start and end of a period. For example, to filter encounters by the duration of stay:
define "Non-Elective Inpatient Encounter Less Than 120 Days":
["Encounter": "Non-Elective Inpatient Encounter"] NonElectiveEncounter
where NonElectiveEncounter.period.lengthInDays() <= 120
Other durations can also be calculated, for example:
define "Non-Elective Inpatient Encounter Over 24 Hours":
["Encounter": "Non-Elective Inpatient Encounter"] NonElectiveEncounter
where duration in hours of NonElectiveEncounter.period >= 24
NOTE: For ongoing encounters, the end of the period is often not specified, which will typically be interpreted in CQL as an ongoing period, resulting in large duration values.
For inpatient encounters, measures and rules often need to consider total hospitalization period, including any immediately prior emergency department and/or observation status encounters. To facilitate this, the CQMCommon library defines a hospitalizationWithObservation() function that returns the total duration from admission to the emergency department or observation to the end of the inpatient encounter. For example:
define "Comfort Measures Performed":
["Procedure": "Comfort Measures"] InterventionPerformed
where InterventionPerformed.status in { 'completed', 'in-progress' }
define "Encounter with Comfort Measures Performed during Hospitalization":
"Non-Elective Inpatient Encounter Less Than 120 Days" Encounter
with "Comfort Measures Performed" ComfortMeasure
such that start of ComfortMeasure.performed.toInterval() during Encounter.hospitalizationWithObservation()