Quality Measure Implementation Guide
2.0.0-ballot - STU 2 Ballot

Quality Measure Implementation Guide - Downloaded Version null 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 | Highlight text changes?
Standards status: Informative Active as of 2026-04-07 | 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