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

This page is part of the Quality Measure STU2 for FHIR R4 Implementation Guide (v5.0.0-ballot: STU5 (v5.0.0) Ballot 1) based on FHIR (HL7® FHIR® Standard) R4. The current version which supersedes this version is 4.0.0. 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: 5.0.0-ballot
Active as of 2019-09-03 Computable Name: MultiRateExample
Other Identifiers: id: MultiRateExample (use: OFFICIAL)

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

Id: Multi-Rate Example Measure
Url: Multi Rate Example Logic Library
Version: 5.0.0-ballot
Identifier:

value: MultiRateExample

Name: MultiRateExample
Title: Multi Rate Example Logic Library
Status: active
Experimental: true
Type:

system: LibraryType

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
Last Review 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