Quality Measure Implementation Guide
2.0.0-ballot - STU 2 Ballot International flag

Quality Measure Implementation Guide, published by HL7 International / Clinical Quality Information. This guide is not an authorized publication; it is the continuous build for version 2.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cqm/ and changes regularly. See the Directory of published versions

Library: TJC Overall Library (Experimental)

Official URL: http://hl7.org/fhir/uv/cqm/Library/TJCOverall Version: 4.0.000
Standards status: Informative Active as of 2019-09-03 Computable Name: TJCOverall
Other Identifiers: http://example.org/fhir/cqi/ecqm/Library/Identifier#TJCOverall (use: official, ), OID:2.16.840.1.113883.4.642.40.61.28.33

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

Metadata
Title TJC Overall Library
Version 4.0.000
Identifier TJCOverall
Identifier urn:oid:2.16.840.1.113883.4.642.40.61.28.33
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 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: Library SDE
Resource: Supplemental Data Elementsversion: null2.0.000)
Canonical URL: http://hl7.org/fhir/uv/cqm/Library/SupplementalDataElements|2.0.000
Dependency Description: Code System SNOMEDCT
Resource: SNOMED CT (all versions)
Canonical URL: http://snomed.info/sct
Dependency Description: Code System LOINC
Resource: Logical Observation Identifiers, Names and Codes (LOINC)
Canonical URL: http://loinc.org
Dependency Description: Value Set Comfort Measures
Resource: Comfort Measures
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45
Dependency Description: Value Set Discharge To Acute Care Facility
Resource: Discharge To Acute Care Facility
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87
Dependency Description: Value Set Discharged to Health Care Facility for Hospice Care
Resource: Discharged to Health Care Facility for Hospice Care
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207
Dependency Description: Value Set Discharged to Home for Hospice Care
Resource: Discharged to Home for Hospice Care
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209
Dependency Description: Value Set Emergency Department Visit
Resource: Emergency Department Visit
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
Dependency Description: Value Set Encounter Inpatient
Resource: Encounter Inpatient
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307
Dependency Description: Value Set Hemorrhagic Stroke
Resource: Hemorrhagic Stroke
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212
Dependency Description: Value Set Ischemic Stroke
Resource: Ischemic Stroke
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247
Dependency Description: Value Set Left Against Medical Advice
Resource: Left Against Medical Advice
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308
Dependency Description: Value Set Non-Elective Inpatient Encounter
Resource: Nonelective Inpatient Encounter
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424
Dependency Description: Value Set Patient Expired
Resource: Patient Expired
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309
Dependency Description: Value Set Ticagrelor Therapy
Resource: Ticagrelor Therapy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.39
Dependency Description: Value Set Observation Services
Resource: Observation Services
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143
Data Requirement Type: ServiceRequest
Profile(s): ServiceRequest
Code Filter(s):
Path: code
ValueSet: Comfort Measures
Data Requirement Type: Procedure
Profile(s): Procedure
Code Filter(s):
Path: code
ValueSet: Comfort Measures
Data Requirement Type: Encounter
Profile(s): Encounter
Code Filter(s):
Path: type
ValueSet: Nonelective Inpatient Encounter
Data Requirement Type: Patient
Profile(s): Patient
Parameters
Name Use Card. Type Documentation
Measurement Period In 0..1 Period
Patient Out 0..1 Patient
Intervention Comfort Measures Out 0..* Resource
Non Elective Inpatient Encounter Out 0..* Encounter
All Stroke Encounter Out 0..* Encounter
Encounter with Principal Diagnosis and Age Out 0..* Encounter
Ischemic Stroke Encounter Out 0..* Encounter
Ischemic Stroke Encounters with Discharge Disposition Out 0..* Encounter
Comfort Measures during Hospitalization 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 TJCOverall version '4.0.000'

using FHIR version '4.0.1'

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

include MATGlobalCommonFunctions version '5.0.000' called Global
include SupplementalDataElements version '2.0.000' called SDE

codesystem "SNOMEDCT": 'http://snomed.info/sct'
codesystem "LOINC": 'http://loinc.org'

valueset "Comfort Measures": 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45'
valueset "Discharge To Acute Care Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87'
valueset "Discharged to Health Care Facility for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207'
valueset "Discharged to Home for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209'
valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'
valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
valueset "Hemorrhagic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212'
valueset "Ischemic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247'
valueset "Left Against Medical Advice": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308'
valueset "Non-Elective Inpatient Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424'
valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309'
valueset "Ticagrelor Therapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.39'
valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'

code "Birth date": '21112-8' from "LOINC" display 'Birth date'

parameter "Measurement Period" Interval<DateTime>
  default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0)

context Patient

define "Intervention Comfort Measures":
	(["ServiceRequest": "Comfort Measures"] P
		where P.intent = 'order')
		union
		(["Procedure": "Comfort Measures"] InterventionPerformed
		where InterventionPerformed.status = 'completed')

define "All Stroke Encounter":
	"Non Elective Inpatient Encounter" NonElectiveEncounter
    where Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Hemorrhagic Stroke"
      or Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Ischemic Stroke"

define "Ischemic Stroke Encounter":
	"Encounter with Principal Diagnosis and Age" EncounterWithAge
		where Global.PrincipalDiagnosis(EncounterWithAge).code in "Ischemic Stroke"

define "Non Elective Inpatient Encounter":
	["Encounter": "Non-Elective Inpatient Encounter"] NonElectiveEncounter
		where Global."LengthInDays"(NonElectiveEncounter.period) <= 120
			and NonElectiveEncounter.period ends during "Measurement Period"

define "Ischemic Stroke Encounters with Discharge Disposition":
	"Ischemic Stroke Encounter" IschemicStrokeEncounter
		where IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharge To Acute Care Facility"
			or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Left Against Medical Advice"
			or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Patient Expired"
			or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Home for Hospice Care"
			or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Health Care Facility for Hospice Care"

define "Comfort Measures during Hospitalization":
	"Ischemic Stroke Encounter" IschemicStrokeEncounter
   	with "Intervention Comfort Measures" ComfortMeasure
    	such that FHIRHelpers.ToDateTime(Coalesce(ComfortMeasure.performed as dateTime,ComfortMeasure.authoredOn)) during Global."HospitalizationWithObservation"(IschemicStrokeEncounter)

define "Encounter with Principal Diagnosis and Age":
	"All Stroke Encounter" AllStrokeEncounter
		with ["Patient"] BirthDate
			such that Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of FHIRHelpers.ToInterval(AllStrokeEncounter.period)) >= 18

define function "CalendarDayOfOrDayAfter"(StartValue DateTime ):
	Interval(Global."ToDate"(StartValue), Global."ToDate"(StartValue + 2 days))
ELM XML Content
Encoded data 
ELM JSON Content
Encoded data 
Generated using version 0.5.4 of the sample-content-ig Liquid templates