Common CQL Artifacts for FHIR (US-Based)
1.0.0 - Informative 1
Common CQL Artifacts for FHIR (US-Based), published by HL7 International / Clinical Decision Support. This guide is not an authorized publication; it is the continuous build for version 1.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/us-cql-ig/ and changes regularly. See the Directory of published versions
| Page standards status: Informative |
The FHIR Observation resource supports capturing a variety of information in a medical record, including simple name/value pair assertions, as well as multi-component observations, and logical groupings of observations. US Core defines several observation profiles to support a variety of use cases, including:
US Core defines US Core Laboratory Result Observation to record laboratory observations.
Observation codes will be LOINC. Result values will generally be represented in different ways, according to the type of lab result. The LOINC code itself will often describe the expected representation of possible values for a given observation or test result.
Regardless of which profile is used, the Observation resource defines the following modifier elements:
In addition to being a modifier, this element is required with a required binding. The USCoreCommon library defines several functions for determining the status of an observation, as discussed in the Status section below.
USCore defines the following mandatory search parameters:
In addition, the following optional search parameters are described:
NOTE: For discussion on how to manage search parameters with terminology, see the Terminology Considerations discussion in the Architectural Guidance topic.
NOTE: For discussion on how to manage optional search parameters, see the Performant Data Access discussion in the Architectural Guidance topic.
Generally, new versions of USCore since 3.1.1 have introduced additional profiles, but have not impacted representation of existing profiles. As of 7.0.0, there are generally:
The USCoreCommon library defines functions and terminology declarations to support determining status of an observation:
isResulted(): returns true if the status is final, amended, or correctedisFinal(): Returns true if the status is finalisAmended(): Returns true if the status is amendedisCorrected(): Returns true if the status is correctedAs well as for filtering lists of observations with a given status:
resulted(): returns Observations in the given list with a status is final, amended, or correctedfinal(): Returns Observations in the given list with a status is finalamended(): Returns Observations in the given list with a status is amendedcorrected(): Returns Observations in the given list with a status is corrected.hasCategory(Code): Returns true if the given observation has the given category.isSocialHistory(): Returns true if the given observation has a category of social history.isVitalSign(): Returns true if the given observation has a category of vital sign.isImaging(): Returns true if the given observation has a category of imaging.isLaboratory(): Returns true if the given observation has a category of laboratory.isProcedure(): Returns true if the given observation has a category of procedure.isSurvey(): Returns true if the given observation has a category of survey.isExam(): Returns true if the given observation has a category of exam.isActivity(): Returns true if the given observation has a category of activityNote that the interpretation element of an observation may not be present, and may not be coded as expected. Care must be taken in the use of this element to ensure that data conforms with the expectations of the logic.
.positive(): Returns Observations in the given list that have an interpretation of positive.negative(): Returns Observations in the given list that have an interpretation of negative.during(Encounter): Returns Observations in the given list that were issued during the given Encounter.within(Quantity): Returns Observations in the given list that were issued within the given time duration before now.consecutively(): Returns Observations consecutively by when they were issued.consecutivelyFrom(Observation): Returns Observations consecutively by when they were issued, on or after when the given Observation was issuedIn addition, the USCoreElements library defines expressions for accessing the various USCore profiles, such as:
"All Laboratory Results""Resulted Laboratory Results""Pediatric BMI for Age"In general, the expressions to retrieve observations for a particular profile include the .resulted() function to ensure only final, amended, or corrected observations are returned.
This example illustrates logic for identifying three concurrent negative "stick tests":
define StickTest:
[Observation: "Stick Test Codes"] O
where O.status in { 'final', 'amended', 'corrected' }
define "Three Consecutive Negative Stick Tests":
exists (
StickTest.during(Encounter).consecutively().take(3).negative().count() = 3
)
In addition, this expression can be parameterized with current context (for example from a trigger context) with:
StickTest.consecutivelyFrom(%context).take(3).negative().count() = 3
NOTE: Content for this page was adapted from the QICore Authoring Patterns - Laboratory Result topic.