AgeStratificationExample
type: Library
node role: treeRoot
id:
  v: AgeStratificationExample
language:
  v: en
text:
  status:
    v: extensions
  div:
    v: 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 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 illustration of using the Time Period Ranges code system to construct computable age ranges as a stratification for measures. 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 Dependency Description: Code System Time Period Ranges Resource: Time Period Ranges Canonical URL: http://terminology.hl7.org/CodeSystem/time-period-ranges Data Requirement Type: Encounter Profile(s): Encounter Parameters Name Use Card. Type Documentation Measurement Period In 0..1 Period Patient Out 0..1 Patient Initial Population Out 0..1 boolean By Age Out 0..1 Coding 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 "Time Period Ranges": 'http://terminology.hl7.org/CodeSystem/time-period-ranges' // { 'P0Y--P1Y', 'P1Y--P5Y', ... } // Age Groups code "P10Y--P15Y": 'P10Y--P15Y' from "Time Period Ranges" display '10-14 years' code "P15Y--P20Y": 'P15Y--P20Y' from "Time Period Ranges" display '15-19 years' code "P20Y--P9999Y": 'P20Y--P9999Y' from "Time Period Ranges" 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 Inter…
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-wg
    l: structuredefinition-wg
  value: Code
    v: cqi
url:
  v: http://hl7.org/fhir/uv/cqm/Library/AgeStratificationExample
  l: AgeStratificationExample
identifier:
  system:
    v: urn:ietf:rfc:3986
    l: 3986
  value:
    v: urn:oid:2.16.840.1.113883.4.642.40.61.28.3
version:
  v: 1.0.0
name:
  v: AgeStratificationExample
title:
  v: Age Stratification Example
status:
  v: active
experimental:
  v: true
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/library-type
      l: library-type
    code:
      v: logic-library
date:
  v: 2026-04-07T02:06:45+10:00
publisher:
  v: HL7 International / Clinical Quality Information
contact:
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/cqi
description:
  v: This library provides an illustration of using the Time Period Ranges code system to construct computable age ranges as a stratification for measures.
jurisdiction:
  coding:
    system:
      v: http://unstats.un.org/unsd/methods/m49/m49.htm
      l: m49.htm
    code:
      v: 001
topic:
  text:
    v: FHIR
topic:
  text:
    v: CQL
related artifact:
  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
related artifact:
  type:
    v: depends-on
  display:
    v: Code System Time Period Ranges
  resource:
    v: http://terminology.hl7.org/CodeSystem/time-period-ranges
    l: time-period-ranges
parameter:
  name:
    v: Measurement Period
  use:
    v: in
  min:
    v: 0
  max:
    v: 1
  type:
    v: Period
parameter:
  name:
    v: Patient
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: Patient
parameter:
  name:
    v: Initial Population
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: boolean
parameter:
  name:
    v: By Age
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: Coding
data requirement:
  type:
    v: Encounter
  profile:
    v: http://hl7.org/fhir/StructureDefinition/Encounter
    l: Encounter
content:
  content type:
    v: text/cql
content:
  content type:
    v: application/elm+xml
content:
  content type:
    v: application/elm+json