Quality Measure Implementation Guide
2.0.0-ballot - STU 2 Ballot International flag

Quality Measure Implementation Guide, published by HL7 International / Clinical Quality Information. This guide is not an authorized publication; it is the continuous build for version 2.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cqm/ and changes regularly. See the Directory of published versions

Library: EXMRatio - Example Ratio Measure Library (Experimental)

Official URL: http://hl7.org/fhir/uv/cqm/Library/EXMRatio Version: 4.0.0
Standards status: Informative Active as of 2019-09-03 Computable Name: EXMRatio
Other Identifiers: http://example.org/fhir/cqi/ecqm/Library/Identifier#EXMRatio (use: official, ), OID:2.16.840.1.113883.4.642.40.61.28.22

This library is used as an example in the FHIR Quality Measure Implementation Guide

Metadata
Title EXMRatio - Example Ratio Measure Library
Version 4.0.0
Identifier EXMRatio
Identifier urn:oid:2.16.840.1.113883.4.642.40.61.28.22
Approval Date 2019-08-03
Last Review Date 2019-08-03
Experimental true
Jurisdiction 001 from http://unstats.un.org/unsd/methods/m49/m49.htm
Topic FHIR
Topic CQL
Steward (Publisher) HL7 International / Clinical Quality Information
Description

This library is used as an example in the FHIR Quality Measure Implementation Guide

Type logic-library from http://terminology.hl7.org/CodeSystem/library-type
Dependency Description: Library FHIRHelpers
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Dependency Description: Library Global
Resource: MAT Global Common Functions FHIR Libraryversion: null5.0.000)
Canonical URL: http://hl7.org/fhir/uv/cqm/Library/MATGlobalCommonFunctions|5.0.000
Dependency Description: Value Set Inpatient
Resource: http://example.org/fhir/ValueSet/inpatient
Canonical URL: http://example.org/fhir/ValueSet/inpatient
Dependency Description: Value Set Fall
Resource: http://example.org/fhir/ValueSet/fall
Canonical URL: http://example.org/fhir/ValueSet/fall
Data Requirement Type: Encounter
Profile(s): Encounter
Code Filter(s):
Path: type
ValueSet: http://example.org/fhir/ValueSet/inpatient
Data Requirement Type: Observation
Profile(s): Observation
Code Filter(s):
Path: code
ValueSet: http://example.org/fhir/ValueSet/fall
Parameters
Name Use Card. Type Documentation
Patient Out 0..1 Patient
Qualifying Encounters Out 0..* Encounter
Initial Population Out 0..* Encounter
Denominator Out 0..* Encounter
Numerator Out 0..* Encounter
Falls with Major Injury Out 0..* Observation
Library Content
CQL Content
/*
Measures the number of inpatient falls with major injury per 1000 patient days.

“Patient days” are to be calculated such that:
  Sum actual hours for all patients, whether in-patient, ED or observation, and divide by 24.

The approach we envision is starting from an encounter-based eCQM with numerator
and denominator observations to arrive at the following:

Patient A has a 10 day inpatient encounter. On day 1 she fell 9 times. No more falls in that stay.

Patient B has a 2 day inpatient encounter. On day 2 he fell 1 time. No other falls in that stay

Result: 10 falls/12 days = 833/1000 patient days

Answer: There are multiple considerations involved in the representation of falls with major injury,
this example does not address those considerations, focusing only on the overall structure
of the measure and the final calculation.

This measure can be represented as an encounter-based ratio measure, with:

Numerator Observation: Count(Falls with Major Injury)
Denominator Observation: Sum(Encounter Days)

This does result in a ratio, but there isn't mechanism in the current FHIR measure
to specify that the ratio should be converted to "per 1000 days".

To support that aspect, we are proposing a scoringUnit extension of the Quality Measure IG
to state the expected units of a ratio measure.

This is submitted as a tracker to the quality measure IG here:
https://jira.hl7.org/browse/FHIR-30506

The included EXMRatioFHIRv603-Artifacts.zip is an export of this measure expressed
in the MAT which includes everything but the proprosed scoringUnit extension. That
extension is proposed for inclusion in the May 2021 ballot of the quality measure ig
and is not supported by the MAT at this time.
*/
library EXMRatio

using FHIR version '4.0.1'

include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1' called FHIRHelpers

include MATGlobalCommonFunctions version '5.0.000' called Global

valueset "Inpatient": 'http://example.org/fhir/ValueSet/inpatient'
valueset "Fall": 'http://example.org/fhir/ValueSet/fall'

context Patient

define "Initial Population":
  "Qualifying Encounters"

define "Denominator":
  "Initial Population"

define "Numerator":
  "Initial Population"

define "Qualifying Encounters":
  ["Encounter": "Inpatient"]

define "Falls with Major Injury":
  ["Observation": "Fall"]

define function "Denominator Observation"(Encounter "Encounter"):
  duration in hours of Global.Hospitalization(Encounter) / 24

define function "Numerator Observation"(Encounter "Encounter"):
  Count(
    "Falls with Major Injury" Falls
      where Global."Normalize Interval"(Falls.effective) during Encounter.period
  )
ELM XML Content
Encoded data 
ELM JSON Content
Encoded data 
Generated using version 0.5.4 of the sample-content-ig Liquid templates