AgeStratificationExample
type: Library
node role: treeRoot
id:
  v: AgeStratificationExample
text:
  status:
    v: extensions
  div: 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'#xD; #xD; using FHIR version '4.0.1'#xD; #xD; include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1' called FHIRHelpers#xD; #xD; codesystem "ISO-8601-Derived Periods": 'http://terminology.hl7.org/CodeSystem/iso-8601-derived-periods' // { 'P0Y--P1Y', 'P1Y--P5Y', ... }#xD; #xD; // Age Groups#xD; code "P10Y--P15Y": 'P10Y--P15Y' from "ISO-8601-Derived Periods" display '10-14 years'#xD; code "P15Y--P20Y": 'P15Y--P20Y' from "ISO-8601-Derived Periods" display '15-19 years'#xD; code "P20Y--P9999Y": 'P20Y--P9999Y' from "ISO-8601-Derived Periods" display '20+ years'#xD; #xD; parameter "Measurement Period" Interval<Date> default Interval[@2020-01-01, @2020-12-31]#xD; #xD; context Patient#xD; #xD; define "Initial Population":#xD; exists (#xD; [Encounter] E#xD; where E.period during "Measurement Period"#xD; )#xD; #xD; /*#xD; By Patient Age as of the start of the Measurement Period#xD; Age (10-14, 15-19, 20+)#xD; */#xD; define "By Age":#xD; case#xD; when AgeInYearsAt(start of "Measurement Period") in Interval[10,…
contained: Parameters
  id:
    v: options
  parameter:
    name:
      v: translatorVersion
    value: string
      v: 3.25.0
  parameter:
    name:
      v: option
    value: string
      v: EnableAnnotations
  parameter:
    name:
      v: option
    value: string
      v: EnableLocators
  parameter:
    name:
      v: format
    value: string
      v: JSON
  parameter:
    name:
      v: format
    value: string
      v: XML
  parameter:
    name:
      v: analyzeDataRequirements
    value: boolean
      v: false
  parameter:
    name:
      v: collapseDataRequirements
    value: boolean
      v: true
  parameter:
    name:
      v: compatibilityLevel
    value: string
      v: 1.5
  parameter:
    name:
      v: enableCqlOnly
    value: boolean
      v: false
  parameter:
    name:
      v: errorLevel
    value: string
      v: Info
  parameter:
    name:
      v: signatureLevel
    value: string
      v: None
  parameter:
    name:
      v: validateUnits
    value: boolean
      v: true
  parameter:
    name:
      v: verifyOnly
    value: boolean
      v: false
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions
  value: Reference
    reference:
      v: #options
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-wg
  value: code
    v: cqi
url:
  v: http://hl7.org/fhir/uv/cqm/Library/AgeStratificationExample
identifier:
  system:
    v: urn:ietf:rfc: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
    code:
      v: logic-library
date:
  v: 2025-09-11T18:58:45+00: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 ISO-8601-Dervied Periods 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
    code:
      v: 001
related artifact:
  type:
    v: depends-on
  display:
    v: FHIR model information
  resource:
    v: http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1
    link: 4.0
    link: .1
related artifact:
  type:
    v: depends-on
  display:
    v: Library FHIRHelpers
  resource:
    v: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
    link: 4.0
    link: .1
related artifact:
  type:
    v: depends-on
  display:
    v: Code system ISO-8601-Derived Periods
  resource:
    v: http://terminology.hl7.org/CodeSystem/iso-8601-derived-periods
    link: http://terminology.hl7.org/CodeSystem/iso-8601-derived-periods
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: Patient

type:
  v: Encounter
profile:
  v: http://hl7.org/fhir/StructureDefinition/Encounter
  link: http://hl7.org/fhir/StructureDefinition/Encounter
must support:
  v: period

content type:
  v: text/cql

content type:
  v: application/elm+xml

content type:
  v: application/elm+json