Quality Measure Implementation Guide

This page is part of the Quality Measure STU2 for FHIR R4 Implementation Guide (v0.1.0: STU 1 Ballot 1) based on FHIR R3. 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-library-common-FHIR

Formats: XML, JSON, Turtle

Id: Library/library-common-FHIR
Type: system: http://hl7.org/fhir/library-type
code: logic-library
Identifier: system: http://example.org/fhir/cqi/ecqm/Library/Identifier
value: Common_FHIR
Version: 2.0.0
Title: Common Library
Status: active
Description: This library is used as an example in the FHIR Quality Measure Implementation Guide
Related:

type: depends-on

Resource:
reference: Library/library-fhir-helpers

Content: type: text/cql
library Common_FHIR version '2.0.0'

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

using FHIR version '3.0.0'

include FHIRHelpers version '3.0.0' called FHIRHelpers

context Patient

define function "Includes Or Starts During"(Condition Condition, Encounter Encounter):
  Interval[Condition.onset, Condition.abatement]includes Encounter.period
    or Condition.onset during Encounter.period