Quality Measure Implementation Guide
2.0.0 - STU 2 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 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

Measure: EXM55 - Median Emergency Department Visit Duration (Experimental)

Official URL: http://hl7.org/fhir/uv/cqm/Measure/EXM55-FHIR Version: 2.0.0
Standards status: Informative Computable Name: EXM55
Other Identifiers: http://example.org/fhir/cqi/ecqm/Measure/Identifier/exm#55 (use: official, ), OID:2.16.840.1.113883.4.642.40.61.29.8

Usage: Clinical Venue: EH

This example illustrates a continuous variable measure represented as a FHIR eCQM

Metadata
Title EXM55 - Median Emergency Department Visit Duration
Version 2.0.0
Identifier 55
Identifier urn:oid:2.16.840.1.113883.4.642.40.61.29.8
Effective Period 2018-01-01 through 2018-12-31
Approval Date 2019-03-08
Last Review Date 2019-03-08
Experimental true
Use Context Clinical Venue = EH
Jurisdiction http://unstats.un.org/unsd/methods/m49/m49.htm#001
Topic Health Quality Measure Document
Steward (Publisher) HL7 International / Clinical Quality Information
Description

This example illustrates a continuous variable measure represented as a FHIR eCQM

Measure Basis Encounter
Measure Scoring Continuous Variable
Improvement Notation Decreased score indicates improvement
Measure Type http://terminology.hl7.org/CodeSystem/measure-type#process
Contents Metadata
Contents
Measure Rates (Groups)
Supplemental Data
Measure Logic
Population Criteria
Logic Definitions
Terminology
Dependencies
Data Requirements
Measure Rates (Groups)
Measure Rate (Group) (ID: primary)
Initial Population ID: primary-exm55-initial-population
Criteria: Initial Population
Measure Population ID: primary-exm55-measure-population
Criteria: Measure Population
Measure Population Exclusion ID: primary-exm55-measure-population-exclusion
Criteria: Measure Population Exclusion
Measure Observation ID: primary-exm55-measure-population-identifier
Criteria: Measure Observation
Input population: measure-population-identifier Aggregate method: median
Stratifier Code: Stratification 1
Applies to: Initial Population
Stratifier Code: Stratification 2
Applies to: Initial Population
Stratifier Code: Stratification 3
Applies to: Initial Population
Supplemental Data Elements
Measure Logic
Primary Library EXM55 - Median Emergency Department Visit Duration Library (Example Continuous Variable Measure Library)
Population Criteria
Measure Rate (Group) (ID: primary)
Initial Population
define "Initial Population" :
  "Inpatient Encounter" Encounter
    with ["Encounter" : "Emergency Department Visit"] ED
     such that ED.status = 'finished'
       and ED.period ends 1 hour or less before start of Encounter.period
Definition
Measure Population
define "Measure Population" :
  "Initial Population"
Definition
Measure Population Exclusion
define "Measure Population Exclusion" :
  "Inpatient Encounter" Encounter
    with ["Encounter" : "Emergency Department Visit"] ED
      such that ED.period ends 1 hour or less before start of Encounter.period
        and ED.status = 'finished'
        and ED.hospitalization.admitSource in "Hospital Settings"
Definition
Measure Observation
define function "Measure Observation"(Encounter "Encounter") :
  duration in minutes of "Related ED Visit"(Encounter).period
Definition
Stratifier
define "Stratification 1" :
  "Inpatient Encounter" Encounter
    where not (Encounter.principalDiagnosis().diagnosis in "Psychiatric/Mental Health Patient")
Definition
Stratifier
define "Stratification 2" :
  "Inpatient Encounter" Encounter
    where Encounter.principalDiagnosis().diagnosis in "Psychiatric/Mental Health Patient"
Definition
Stratifier
define "Stratification 3" :
  "Inpatient Encounter" Encounter
    where Encounter.principalDiagnosis().diagnosis is null
Definition
Logic Definitions
Logic Definition Library Name: EXMCommon
define fluent function lengthInDays(Value Interval<DateTime> ):
  difference in days between start of Value and end of Value
Logic Definition Library Name: EXMCommon
define fluent function principalDiagnosis(encounter Encounter):
  singleton from (
    (encounter.claimDiagnosis()) CD
      where CD.type.includesCode("Principal Diagnosis")
  )
Logic Definition Library Name: EXMCommon
define fluent function claimDiagnosis(encounter Encounter):
  encounter E
    let 
      claim: ([Claim] C where C.status = 'active' and C.use = 'claim' and exists (C.item I where I.encounter.references(E))),
      claimItem: (claim.item I where I.encounter.references(E))
    return claim.diagnosis D where D.sequence in claimItem.diagnosisSequence
Logic Definition Library Name: FHIRCommon
/*
@description: Returns true if any of the given references are to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(references List<FHIR.Reference>, resource FHIR.Resource):
  exists (references R where R.references(resource))
Logic Definition Library Name: FHIRCommon
/*
@description: Returns true if the given reference is to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference FHIR.Reference, resource FHIR.Resource):
  resource.id = Last(Split(reference.reference, '/'))
Logic Definition Library Name: FHIRCommon
/*
@description: Returns true if the given code is in the given codeList
@comment: Returns true if the `code` is equivalent to any of the codes in the given `codeList`, false otherwise.
*/
define fluent function includesCode(codeList List<CodeableConcept>, code Concept):
  exists (codeList C where C ~ code)
Logic Definition Library Name: FHIRHelpers
/*
@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."start" is null then
            Interval(period."start".value, period."end".value]
        else
            Interval[period."start".value, period."end".value]
Logic Definition Library Name: FHIRHelpers
define function ToString(value ClaimStatus): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value Use): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value string): value.value
Logic Definition Library Name: FHIRHelpers
/*
@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
        }
Logic Definition Library Name: FHIRHelpers
/*
@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
        }
Logic Definition Library Name: FHIRHelpers
define function ToString(value EncounterStatus): value.value
Logic Definition Library Name: EXM55
define "Inpatient Encounter" :
  ["Encounter"] Encounter
    where Encounter.period.lengthInDays() <= 120
      and Encounter.period ends during "Measurement Period"
Logic Definition Library Name: EXM55
define "Stratification 3" :
  "Inpatient Encounter" Encounter
    where Encounter.principalDiagnosis().diagnosis is null
Logic Definition Library Name: EXM55
define "Stratification 2" :
  "Inpatient Encounter" Encounter
    where Encounter.principalDiagnosis().diagnosis in "Psychiatric/Mental Health Patient"
Logic Definition Library Name: EXM55
define "Measure Population Exclusion" :
  "Inpatient Encounter" Encounter
    with ["Encounter" : "Emergency Department Visit"] ED
      such that ED.period ends 1 hour or less before start of Encounter.period
        and ED.status = 'finished'
        and ED.hospitalization.admitSource in "Hospital Settings"
Logic Definition Library Name: EXM55
define "Stratification 1" :
  "Inpatient Encounter" Encounter
    where not (Encounter.principalDiagnosis().diagnosis in "Psychiatric/Mental Health Patient")
Logic Definition Library Name: EXM55
define "Initial Population" :
  "Inpatient Encounter" Encounter
    with ["Encounter" : "Emergency Department Visit"] ED
     such that ED.status = 'finished'
       and ED.period ends 1 hour or less before start of Encounter.period
Logic Definition Library Name: EXM55
define "Measure Population" :
  "Initial Population"
Logic Definition Library Name: EXM55
define function "Measure Observation"(Encounter "Encounter") :
  duration in minutes of "Related ED Visit"(Encounter).period
Logic Definition Library Name: EXM55
//Measure Observation
define function "Related ED Visit"(Encounter "Encounter") :
  Last(["Encounter" : "Emergency Department Visit"] ED
    where ED.status = 'finished'
      and ED.period ends 1 hour or less before start of Encounter.period
    sort by start of period )
Terminology
Code System Description: Code system Diagnosis Type
Resource: Example Diagnosis Type Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/ex-diagnosistype
Value Set Description: Value set Psychiatric/Mental Health Patient
Resource: Psychiatric/Mental Health Diagnosis
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299
Value Set Description: Value set Emergency Department Visit
Resource: Emergency Department Visit
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
Value Set Description: Value set Hospital Settings
Resource: Hospital Settings
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126
Direct Reference Code Display: Principal Diagnosis
Code: principal
System: http://terminology.hl7.org/CodeSystem/ex-diagnosistype
Dependencies
Dependency Description: FHIR model information
Resource: http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1
Dependency Description: Library EXMCommon
Resource: EXMCommon
Canonical URL: http://hl7.org/fhir/uv/cqm/Library/EXMCommon
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 FHIRCommon
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Data Requirements
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: period, type
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, period, status, hospitalization, hospitalization.admitSource
Code Filter(s):
Path: type
ValueSet: Emergency Department Visit
Data Requirement Type: Claim
Profile(s): Claim
Must Support Elements: status, use, item
Generated using version 0.5.6 of the sample-content-ig Liquid templates