Quality Measure Implementation Guide
5.0.0 - STU5 United States of America flag

This page is part of the Quality Measure STU2 for FHIR R4 Implementation Guide (v5.0.0: STU5 (v5.0.0)) based on FHIR (HL7® FHIR® Standard) R4. This is the current published version. For a full list of available versions, see the Directory of published versions

Library: Multi Rate Example Logic Library (Experimental)

Official URL: http://hl7.org/fhir/us/cqfmeasures/Library/MultiRateExample-FHIR Version: 2.0.0
Active as of 2019-09-03 Computable Name: MultiRateExample
Other Identifiers: http://example.org/fhir/cqi/ecqm/Library/Identifier#MultiRateExample (use: official, )

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

Title: Multi Rate Example Logic Library
Id: MultiRateExample-FHIR
Version: 2.0.0
Url: http://hl7.org/fhir/us/cqfmeasures/Library/MultiRateExample-FHIR
Official

MultiRateExample

Experimental: true
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2019-09-03
Publisher: HL7 International / Clinical Quality Information
Description:

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

Jurisdiction: US
Approval Date: 2019-08-03
Content: text/cql
library MultiRateExample

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'

valueset "Bed Device Types": 'http://example.org/fhir/ValueSet/TBD'
valueset "Screening Procedure Types": 'http://example.org/fhir/ValueSet/TBD'

context Location

// Number of patients
define "Patients":
  [Patient]

// Number of practitioners
define "Practitioners":
  [PractitionerRole]

// Number of beds
define "Beds":
  [Device: "Bed Device Types"]

// Number of screening procedures
define "Screening Procedures":
  [Procedure: "Screening Procedure Types"]

// Percentage of patients who received screening
define "Initial Population":
  "Patients"

define "Denominator":
  "Patients" P
    where P.gender = 'female'

define "Numerator":
  "Patients" P
    with "Screening Procedures" SP
      such that P.id = Last(Split(SP.subject.reference, '/'))

define function ToNumber(patient Patient):
  if patient is not null then 1 else 0

define function ToNumber(practitionerRole PractitionerRole):
  if practitionerRole is not null then 1 else 0

define function ToNumber(device Device):
  if device is not null then 1 else 0