Quality Measure STU1 for FHIR STU3 Implementation Guide

This page is part of the Quality Measure STU2 for FHIR R4 Implementation Guide (v1.0.0: STU 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-common-fhir

Formats: XML, JSON, Turtle

Id: common-fhir
Type:
system: http://hl7.org/fhir/library-type
code: logic-library
Version: 2.0.0
Status: active
Related:

type: depends-on

Resource:
reference: Library/fhirhelpers

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