Quality Measure STU2 for FHIR R4 Implementation Guide

This page is part of the Quality Measure STU2 for FHIR R4 Implementation Guide (v2.0.0: STU 2) based on FHIR R4. The current version which supercedes this version is 3.0.0. For a full list of available versions, see the Directory of published versions

Library-VTEICU

Formats: XML, JSON, Turtle

Id: VTEICU
Url: http://hl7.org/fhir/us/cqfmeasures/Library/VTEICU
Version: 5.0.000
Identifier:

value: VTEICU

Name: VTEICU
Title: VTE ICU
Status: active
Experimental: true
Type:

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

code: logic-library

Date: 2019-09-03
Publisher: Health Level 7 International - Clinical Quality Information Work Group
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
Related Artifacts:
TypeResource
depends-onhttp://hl7.org/fhir/Library/FHIR-ModelInfo|4.0.1
depends-onhttp://hl7.org/fhir/Library/FHIRHelpers|4.0.1
depends-onhttp://hl7.org/fhir/us/cqfmeasures/Library/MATGlobalCommonFunctions|5.0.000
depends-onhttp://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.23
Parameters:
NameTypeMinMaxIn/Out
Measurement PeriodPeriod01in
PatientPatient01out
Content: text/cql
library VTEICU version '5.0.000'

/*
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.
*/

/*
@update: @@BTR 2020-03-31 ->
Incremented version to 5.0.000
Updated FHIR version to 4.0.1
@@
*/

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1' called FHIRHelpers
// NOTE: BTR 2019-07-30: Updated dependencies
include MATGlobalCommonFunctions version '5.0.000' called Global

valueset "Intensive Care Unit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.23'

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

context Patient

define function "FromDayOfStartOfHospitalizationToDayAfterAdmission"(Encounter FHIR.Encounter ):
	Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(start of Encounter.period + 2 days))

define function "StartOfFirstICU"(Encounter FHIR.Encounter ):
	start of "FirstICULocationPeriod"(Encounter)

define function "FromDayOfStartOfHospitalizationToDayAfterFirstICU"(Encounter FHIR.Encounter ):
	Interval[Global."ToDate"(start of Global."HospitalizationWithObservation"(Encounter)), Global."ToDate"(StartOfFirstICU(Encounter)+ 2 days))

define function "FirstICULocationPeriod"(Encounter FHIR.Encounter ):
	"FirstInpatientIntensiveCareUnit"(Encounter).period

define function "FirstInpatientIntensiveCareUnit"(Encounter FHIR.Encounter ):
	First((Encounter.location)HospitalLocation
			where Global.GetLocation(HospitalLocation.location).type in "Intensive Care Unit"
				and HospitalLocation.period during Encounter.period
			sort by start of period
	)
Content: application/elm+xml
Encoded data (14836 characters)
Content: application/elm+json
Encoded data (26544 characters)