Quality Measure Implementation Guide
1.0.0 - STU 1 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 1.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

Library: Age Stratification Example (Experimental)

Official URL: http://hl7.org/fhir/uv/cqm/Library/AgeStratificationExample Version: 1.0.0
Standards status: Informative Computable Name: AgeStratificationExample
Other Identifiers: OID:2.16.840.1.113883.4.642.40.61.28.3

This library provides an illustration of using the ISO-8601-Dervied Periods code system to construct computable age ranges as a stratification for measures.

Metadata
Title Age Stratification Example
Version 1.0.0
Identifier urn:oid:2.16.840.1.113883.4.642.40.61.28.3
Experimental true
Jurisdiction Global (Whole world)
Steward (Publisher) HL7 International / Clinical Quality Information
Description

This library provides an illustration of using the ISO-8601-Dervied Periods code system to construct computable age ranges as a stratification for measures.

Type Logic Library
Parameter Name: Measurement Period
Use: In
Min Cardinality: 0
Max Cardinality: 1
Type: Period
Parameter Name: Patient
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Patient
Parameter Name: Initial Population
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: By Age
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Coding
Data Requirement Type: Patient
Profile(s): Patient
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: period
Library Content
CQL Content
library AgeStratificationExample version '1.0.0'

using FHIR version '4.0.1'

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

codesystem "ISO-8601-Derived Periods": 'http://terminology.hl7.org/CodeSystem/iso-8601-derived-periods' // { 'P0Y--P1Y', 'P1Y--P5Y', ... }

// Age Groups
code "P10Y--P15Y": 'P10Y--P15Y' from "ISO-8601-Derived Periods" display '10-14 years'
code "P15Y--P20Y": 'P15Y--P20Y' from "ISO-8601-Derived Periods" display '15-19 years'
code "P20Y--P9999Y": 'P20Y--P9999Y' from "ISO-8601-Derived Periods" display '20+ years'

parameter "Measurement Period" Interval<Date> default Interval[@2020-01-01, @2020-12-31]

context Patient

define "Initial Population":
  exists (
    [Encounter] E
      where E.period during "Measurement Period"
  )
  
/*
By Patient Age as of the start of the Measurement Period
Age (10-14, 15-19, 20+)
*/
define "By Age":
  case
    when AgeInYearsAt(start of "Measurement Period") in Interval[10, 14] then "P10Y--P15Y"
    when AgeInYearsAt(start of "Measurement Period") in Interval[15, 19] then "P15Y--P20Y"
    when AgeInYearsAt(start of "Measurement Period") >= 20 then "P20Y--P9999Y"
    else null
  end

ELM XML Content
Encoded data (24156 characters)
ELM JSON Content
Encoded data (44964 characters)
Generated using version 0.4.9 of the sample-content-ig Liquid templates