EXM55-FHIR
type: Measure
node role: treeRoot
id:
  v: EXM55-FHIR
meta:
  profile:
    v: http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-cvmeasure
    l: cqm-cvmeasure
  profile:
    v: http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-computablemeasure
    l: cqm-computablemeasure
  profile:
    v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablemeasure
    l: crmi-shareablemeasure
language:
  v: en
text:
  status:
    v: extensions
  div:
    v: Metadata Title EXM55 - Median Emergency Department Visit Duration Version 5.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 Global (Whole world) 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 Measure Type Process Improvement Notation Decreased score indicates improvement Measure Group (Rate) (ID: primary) Initial Population ID: primary-exm55-initial-population Description: No description provided Criteria: Initial Population Measure Population ID: primary-exm55-measure-population Description: No description provided Criteria: Measure Population Measure Population Exclusion ID: primary-exm55-measure-population-exclusion Description: No description provided Criteria: Measure Population Exclusion Measure Observation ID: primary-exm55-measure-population-identifier Description: No description provided Criteria: Measure Observation Input Population: measure-population-identifier AggregateMethod: median Stratifier Code: Stratification 1 Stratifier Code: Stratification 2 Stratifier Code: Stratification 3 Measure Logic Primary Library EXM55 - Median Emergency Department Visit Duration Library (Example Continuous Variable Measure Library) Contents Population Criteria Logic Definitions Terminology Dependencies Data Requirements Population Criteria Measure Group (Rate) (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 Popu…
contained: Library
  id:
    v: effective-data-requirements
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode
      l: cqf-directReferenceCode
    value: Coding
      system:
        v: http://terminology.hl7.org/CodeSystem/diagnosis-role
        l: diagnosis-role
      code:
        v: billing
      display:
        v: Billing
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: EXM55
    extension:
      url:
        v: name
        l: name
      value: String
        v: Inpatient Encounter
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: define "Inpatient Encounter" : ["Encounter"] Encounter where LengthInDays(Encounter.period) <= 120 and Encounter.period ends during "Measurement Period"
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 0
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: EXM55
    extension:
      url:
        v: name
        l: name
      value: String
        v: Stratification 3
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: define "Stratification 3" : "Inpatient Encounter" Encounter where PrincipalDiagnosis(Encounter) is null
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 1
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: EXM55
    extension:
      url:
        v: name
        l: name
      value: String
        v: Stratification 2
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: define "Stratification 2" : "Inpatient Encounter" Encounter where PrincipalDiagnosis(Encounter).code in "Psychiatric/Mental Health Patient"
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 2
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: EXM55
    extension:
      url:
        v: name
        l: name
      value: String
        v: Measure Population Exclusion
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: 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"
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 3
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: EXM55
    extension:
      url:
        v: name
        l: name
      value: String
        v: Stratification 1
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: define "Stratification 1" : "Inpatient Encounter" Encounter where not (PrincipalDiagnosis(Encounter).code in "Psychiatric/Mental Health Patient")
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 4
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition
  extension:
    extension:
      url:
        v: libraryName
        l: libraryName
      value: String
        v: EXM55
    extension:
      url:
        v: name
        l: name
      value: String
        v: Initial Population
    extension:
      url:
        v: statement
        l: statement
      value: String
        v: 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
    extension:
      url:
        v: displaySequence
        l: displaySequence
      value: Integer
        v: 5
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
      l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: EXM55
extension:
  url:
    v: name
    l: name
  value: String
    v: Measure Population
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define "Measure Population" : "Initial Population"
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 6
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: EXM55
extension:
  url:
    v: name
    l: name
  value: String
    v: LengthInDays
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function "LengthInDays"(Value Interval<DateTime>): difference in days between start of Value and end of Value
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 7
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToInterval
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @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]
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 8
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: EXM55
extension:
  url:
    v: name
    l: name
  value: String
    v: PrincipalDiagnosis
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function "PrincipalDiagnosis"(Encounter Encounter): (singleton from (Encounter.diagnosis D where D.use ~ ToConcept("Billing") and D.rank.value = 1)) PD return singleton from ([Condition: id in "GetId"(PD.condition.reference)])
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 9
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToConcept
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @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 }
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 10
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToCode
extension:
  url:
    v: statement
    l: statement
  value: String
    v: /* @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 }
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 11
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: EXM55
extension:
  url:
    v: name
    l: name
  value: String
    v: GetId
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function "GetId"(uri String): Last(Split(uri, '/'))
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 12
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToString
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToString(value string): value.value
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 13
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: FHIRHelpers
extension:
  url:
    v: name
    l: name
  value: String
    v: ToString
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function ToString(value EncounterStatus): value.value
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 14
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: EXM55
extension:
  url:
    v: name
    l: name
  value: String
    v: Measure Observation
extension:
  url:
    v: statement
    l: statement
  value: String
    v: define function "Measure Observation" (Encounter "Encounter" ) : duration in minutes of "Related ED Visit"(Encounter).period
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 15
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

extension:
  url:
    v: libraryName
    l: libraryName
  value: String
    v: EXM55
extension:
  url:
    v: name
    l: name
  value: String
    v: Related ED Visit
extension:
  url:
    v: statement
    l: statement
  value: String
    v: //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 )
extension:
  url:
    v: displaySequence
    l: displaySequence
  value: Integer
    v: 16
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition
  l: cqf-logicDefinition

v: EffectiveDataRequirements

v: active

coding:
  system:
    v: http://terminology.hl7.org/CodeSystem/library-type
    l: library-type
  code:
    v: module-definition

type:
  v: depends-on
display:
  v: Library FHIRHelpers
resource:
  v: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
  l: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers

type:
  v: depends-on
display:
  v: Code system Diagnosis Role
resource:
  v: http://terminology.hl7.org/CodeSystem/diagnosis-role
  l: diagnosis-role

type:
  v: depends-on
display:
  v: Value set Psychiatric/Mental Health Patient
resource:
  v: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299
  l: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.299

type:
  v: depends-on
display:
  v: Value set Emergency Department Visit
resource:
  v: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
  l: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292

type:
  v: depends-on
display:
  v: Value set Hospital Settings
resource:
  v: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126
  l: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.126

name:
  v: Measurement Period
use:
  v: in
min:
  v: 0
max:
  v: 1
type:
  v: Period

name:
  v: Stratification 3
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Encounter

name:
  v: Stratification 2
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Encounter

name:
  v: Measure Population Exclusion
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Encounter

name:
  v: Stratification 1
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Encounter

name:
  v: Initial Population
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Encounter

name:
  v: Measure Population
use:
  v: out
min:
  v: 0
max:
  v: *
type:
  v: Encounter

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  l: Encounter
must support:
  v: period
must support:
  v: use
must support:
  v: rank
must support:
  v: rank.value
must support:
  v: condition
must support:
  v: condition.reference

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  l: Encounter
must support:
  v: type
must support:
  v: period
must support:
  v: status
must support:
  v: hospitalization
must support:
  v: hospitalization.admitSource
must support:
  v: use
must support:
  v: rank
must support:
  v: rank.value
must support:
  v: condition
must support:
  v: condition.reference
code filter:
  path:
    v: type
  value set:
    v: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
    l: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292

type:
  v: Condition
profile:
  v: http://hl7.org/fhir/StructureDefinition/Condition
  l: Condition
must support:
  v: id
code filter:
  path:
    v: id

url:
  v: http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-populationBasis
  l: cqm-populationBasis
value: Code
  v: Encounter

url:
  v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem
  l: crmi-softwaresystem
value: Reference
  l: software-system-example
  reference:
    v: Device/software-system-example

id:
  v: effective-data-requirements
url:
  v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements
  l: crmi-effectiveDataRequirements
value: Canonical
  v: #effective-data-requirements
  l: effective-data-requirements

use:
  v: official
system:
  v: http://example.org/fhir/cqi/ecqm/Measure/Identifier/exm
  l: exm
value:
  v: 55

system:
  v: urn:ietf:rfc:3986
  l: 3986
value:
  v: urn:oid:2.16.840.1.113883.4.642.40.61.29.8

v: 5.0.0

v: EXM55

v: EXM55 - Median Emergency Department Visit Duration

v: active

v: true

v: 2025-08-13

v: HL7 International / Clinical Quality Information

telecom:
  system:
    v: url
  value:
    v: http://www.hl7.org/Special/committees/cqi

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

code:
  system:
    v: http://terminology.hl7.org/CodeSystem/usage-context-type
    l: usage-context-type
  code:
    v: venue
  display:
    v: Clinical Venue
value: CodeableConcept
  coding:
    system:
      v: http://hl7.org/fhir/uv/cqm/CodeSystem/intended-venue-codes
      l: intended-venue-codes
    code:
      v: eh
    display:
      v: EH

coding:
  system:
    v: http://unstats.un.org/unsd/methods/m49/m49.htm
    l: m49.htm
  code:
    v: 001

v: 2019-03-08

v: 2019-03-08

start:
  v: 2018-01-01
end:
  v: 2018-12-31

coding: https://loinc.org/rdf/57024-2
  system:
    v: http://loinc.org
    l: loinc.org
  code:
    v: 57024-2
  display:
    v: Health Quality Measure Document

coding:
  system:
    v: http://terminology.hl7.org/CodeSystem/measure-scoring
    l: measure-scoring
  code:
    v: continuous-variable
  display:
    v: Continuous Variable

coding:
  system:
    v: http://terminology.hl7.org/CodeSystem/measure-type
    l: measure-type
  code:
    v: process

coding:
  system:
    v: http://terminology.hl7.org/CodeSystem/measure-improvement-notation
    l: measure-improvement-notation
  code:
    v: decrease
  display:
    v: Decreased score indicates improvement

id:
  v: group-1
extension:
  url:
    v: http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.linkId
    l: extension-Measure.group.linkId
  value: String
    v: primary
population:
  extension:
    url:
      v: http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId
      l: extension-Measure.group.population.linkId
    value: String
      v: primary-exm55-initial-population
  code:
    coding:
      system:
        v: http://terminology.hl7.org/CodeSystem/measure-population
        l: measure-population
      code:
        v: initial-population
      display:
        v: Initial Population
  criteria:
    language:
      v: text/cql-identifier
    expression:
      v: Initial Population
population:
  extension:
    url:
      v: http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId
      l: extension-Measure.group.population.linkId
    value: String
      v: primary-exm55-measure-population
  code:
    coding:
      system:
        v: http://terminology.hl7.org/CodeSystem/measure-population
        l: measure-population
      code:
        v: measure-population
      display:
        v: Measure Population
  criteria:
    language:
      v: text/cql-identifier
    expression:
      v: Measure Population
population:
  extension:
    url:
      v: http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId
      l: extension-Measure.group.population.linkId
    value: String
      v: primary-exm55-measure-population-exclusion
  code:
    coding:
      system:
        v: http://terminology.hl7.org/CodeSystem/measure-population
        l: measure-population
      code:
        v: measure-population-exclusion
      display:
        v: Measure Population Exclusion
  criteria:
    language:
      v: text/cql-identifier
    expression:
      v: Measure Population Exclusion
population:
  extension:
    url:
      v: http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId
      l: extension-Measure.group.population.linkId
    value: String
      v: primary-exm55-measure-population-identifier
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/cqf-criteriaReference
      l: cqf-criteriaReference
    value: String
      v: measure-population-identifier
  extension:
    url:
      v: http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-aggregateMethod
      l: cqm-aggregateMethod
    value: Code
      v: median
  code:
    coding:
      system:
        v: http://terminology.hl7.org/CodeSystem/measure-population
        l: measure-population
      code:
        v: measure-observation
      display:
        v: Measure Observation
  criteria:
    language:
      v: text/cql-identifier
    expression:
      v: Measure Observation
stratifier:
  extension:
    url:
      v: http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.stratifier.linkId
      l: extension-Measure.group.stratifier.linkId
    value: String
      v: primary-exm55-stratification-1
  extension:
    url:
      v: http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-appliesTo
      l: cqm-appliesTo
    value: CodeableConcept
  code:
    coding:
      system:
        v: http://example.org/stratification
        l: stratification
      code:
        v: Stratification 1
      display:
        v: Stratification 1
  criteria:
    language:
      v: text/cql-identifier
    expression:
      v: Stratification 1
stratifier:
  extension:
    url:
      v: http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.stratifier.linkId
      l: extension-Measure.group.stratifier.linkId
    value: String
      v: primary-exm55-stratificatio-2
  extension:
    url:
      v: http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-appliesTo
      l: cqm-appliesTo
    value: CodeableConcept
  code:
    coding:
      system:
        v: http://example.org/stratification
        l: stratification
      code:
        v: Stratification 2
      display:
        v: Stratification 2
  criteria:
    language:
      v: text/cql-identifier
    expression:
      v: Stratification 2
stratifier:
  extension:
    url:
      v: http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.stratifier.linkId
      l: extension-Measure.group.stratifier.linkId
    value: String
      v: primary-exm55-stratification-3
  extension:
    url:
      v: http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-appliesTo
      l: cqm-appliesTo
    value: CodeableConcept
  code:
    coding:
      system:
        v: http://example.org/stratification
        l: stratification
      code:
        v: Stratification 3
      display:
        v: Stratification 3
  criteria:
    language:
      v: text/cql-identifier
    expression:
      v: Stratification 3

v: initial-population

v: Initial Population

v: initial-population

v: Initial Population

v: initial-population

v: Initial Population