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: EXM146 - Example Proportion Measure Library (Experimental)

Official URL: http://hl7.org/fhir/uv/cqm/Library/EXM146 | Version: 4.0.0 | Highlight text changes?
Standards status: Informative Active as of 2019-09-03 | Computable Name: EXM146
Other Identifiers: http://example.org/fhir/cqi/ecqm/Library/Identifier#EXM146 (use: official, ), OID:2.16.840.1.113883.4.642.40.61.28.12

This library is used as an example in the FHIR Quality Measure Implementation Guide

Metadata
Title | EXM146 - Example Proportion Measure Library
Version | 4.0.0
Identifier | EXM146
Identifier | urn:oid:2.16.840.1.113883.4.642.40.61.28.12
Approval Date | 2019-08-03
Last Review Date | 2019-08-03
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 is used as an example in the FHIR Quality Measure Implementation Guide
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: Library Common Resource: Common Libraryversion: null2.0.0) Canonical URL: `http://hl7.org/fhir/uv/cqm/Library/Common|2.0.0`
Dependency | Description: Library Global Resource: MAT Global Common Functions FHIR Libraryversion: null5.0.000) Canonical URL: `http://hl7.org/fhir/uv/cqm/Library/MATGlobalCommonFunctions|5.0.000`
Dependency | Description: Value Set Acute Pharyngitis Resource: Acute Pharyngitis Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.102.12.1011`
Dependency | Description: Value Set Acute Tonsillitis Resource: Acute Tonsillitis Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.102.12.1012`
Dependency | Description: Value Set Ambulatory/ED Visit Resource: Ambulatory/ED Visit Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1061`
Dependency | Description: Value Set Antibiotic Medications Resource: Antibiotic Medications for Pharyngitis Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1001`
Dependency | Description: Value Set Group A Streptococcus Test Resource: Group A Streptococcus Test Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1012`
Data Requirement | Type: MedicationRequest Profile(s): MedicationRequest Code Filter(s): Path: medication ValueSet: Antibiotic Medications for Pharyngitis
Data Requirement | Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: Acute Pharyngitis
Data Requirement | Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: Acute Tonsillitis
Data Requirement | Type: Encounter Profile(s): Encounter Code Filter(s): Path: type ValueSet: Ambulatory/ED Visit
Data Requirement | Type: Observation Profile(s): Observation Code Filter(s): Path: code ValueSet: Group A Streptococcus Test
Parameters
Name | Use | Card. | Type | Documentation
Measurement Period | In | 0..1 | Period |
Patient | Out | 0..1 | Patient |
Is Between 2 and 17 Years of Age at Start of Measurement Period | Out | 0..1 | boolean |
Antibiotics | Out | 0..* | MedicationRequest |
Pharyngitis | Out | 0..* | Condition |
Measurement Period Encounters | Out | 0..* | Encounter |
Pharyngitis Encounters With Antibiotics | Out | 0..* | Encounter |
Initial Population | Out | 0..* | Encounter |
Denominator | Out | 0..* | Encounter |
Pharyngitis With Prior Antibiotics | Out | 0..* | Condition |
Excluded Encounters | Out | 0..* | Encounter |
Denominator Exclusions | Out | 0..* | Encounter |
Strep Test Encounters | Out | 0..* | Encounter |
Numerator | Out | 0..* | Encounter |
Library Content
CQL Content |
    /*
    This example is a work in progress and should not be considered a final specification
    or recommendation for guidance. This example will help guide and direct the process
    of finding conventions and usage patterns that meet the needs of the various stakeholders
    in the measure development community.
    */
    library EXM146 version '4.0.0'

    using FHIR version '4.0.1'

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

    include Common version '2.0.0' called Common
    include MATGlobalCommonFunctions version '5.0.000' called Global

    valueset "Acute Pharyngitis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.102.12.1011'
    valueset "Acute Tonsillitis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.102.12.1012'
    valueset "Ambulatory/ED Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1061'
    valueset "Antibiotic Medications": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1001'
    valueset "Group A Streptococcus Test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1012'

    parameter "Measurement Period" Interval<DateTime>

    context Patient

    define "Is Between 2 and 17 Years of Age at Start of Measurement Period":
       AgeInYearsAt(start of "Measurement Period") >= 2
          and AgeInYearsAt(start of "Measurement Period") <= 17

    define "Antibiotics":
       [MedicationRequest: medication in "Antibiotic Medications"] Prescription
         where Prescription.status = 'active'
           and Prescription.intent = 'order'

    define "Pharyngitis":
       ([Condition: code in "Acute Pharyngitis"]
         union [Condition: code in "Acute Tonsillitis"]) Pharyngitis
         where Pharyngitis.clinicalStatus ~ Global.active
           and Pharyngitis.verificationStatus ~ Global.confirmed

    define "Measurement Period Encounters":
       [Encounter: "Ambulatory/ED Visit"] Encounter
          where Encounter.period during "Measurement Period"
            and Encounter.status = 'finished'
            and "Is Between 2 and 17 Years of Age at Start of Measurement Period"

    define "Pharyngitis Encounters With Antibiotics":
       "Measurement Period Encounters" Encounters
          with "Pharyngitis" Pharyngitis such that
             Common."Includes Or Starts During"(Pharyngitis, Encounters)
          with "Antibiotics" Antibiotics such that Antibiotics.authoredOn
             3 days or less after FHIRHelpers.ToInterval(Encounters.period)

    define "Initial Population":
       "Pharyngitis Encounters With Antibiotics"

    define "Denominator":
       "Initial Population"

    define "Pharyngitis With Prior Antibiotics":
       "Pharyngitis" Pharyngitis
          with "Antibiotics" Antibiotics such that
             Antibiotics.authoredOn 30 days or less before Pharyngitis.onset

    define "Excluded Encounters":
       "Pharyngitis Encounters With Antibiotics" Encounters
          with "Pharyngitis With Prior Antibiotics" Pharyngitis such that
             Common."Includes Or Starts During"(Pharyngitis, Encounters)

    define "Denominator Exclusions":
      "Excluded Encounters"

    define "Strep Test Encounters":
       "Pharyngitis Encounters With Antibiotics" Encounters
          with [Observation: code in "Group A Streptococcus Test"] Tests
             such that Tests.value is not null
                and Tests.effective starts during
                   Interval[start of FHIRHelpers.ToInterval(Encounters.period) - 3 days,
                     end of FHIRHelpers.ToInterval(Encounters.period) + 3 days]

    define "Numerator":
       "Strep Test Encounters"
ELM XML Content |
    Encoded data
ELM JSON Content |
    Encoded data
Generated using version 0.5.4 of the sample-content-ig Liquid templates