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: EXM Aggregate (Experimental)

Official URL: http://hl7.org/fhir/uv/cqm/Library/EXMAggregate Version: 2.0.0-ballot
Standards status: Informative Active as of 2026-04-03 Computable Name: EXMAggregate
Other Identifiers: OID:2.16.840.1.113883.4.642.40.61.28.14

This library provides an example of logic for computing aggregates based on the results of measure calculations (i.e. aggregate calculation using MeasureReport resources).

Metadata
Title EXM Aggregate
Version 2.0.0-ballot
Identifier urn:oid:2.16.840.1.113883.4.642.40.61.28.14
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 provides an example of logic for computing aggregates based on the results of measure calculations (i.e. aggregate calculation using MeasureReport resources).

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
Data Requirement Type: MeasureReport
Profile(s): MeasureReport
Parameters
Name Use Card. Type Documentation
Measurement Period In 0..1 Period
Location Out 0..1 Location
Initial Population Out 0..* MeasureReport
Measure Population Out 0..* MeasureReport
Library Content
CQL Content
library EXMAggregate

using FHIR version '4.0.1'

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

parameter "Measurement Period" Interval<DateTime>

context Location

define "Initial Population":
  [MeasureReport] MR
    where MR.measure.value = 'http://example.org/fhir/Measure/malnutrition-assessment'
      and MR.status.value = 'complete'
      and MR.date.value during "Measurement Period"

define "Measure Population":
  "Initial Population"

/* Continuous variable measure with Sum as the aggregate method */
define function "Measure Observation"(measureReport MeasureReport):
  measureReport.group[0].measureScore.value.value
ELM XML Content
Encoded data 
ELM JSON Content
Encoded data 
Generated using version 0.5.4 of the sample-content-ig Liquid templates