Clinical Quality Framework Common FHIR Assets (US-Based)
0.1.0 - CI Build
United States of America (USA)
Clinical Quality Framework Common FHIR Assets (US-Based), published by Clinical Quality Framework. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/cqf-us/ and changes regularly. See the Directory of published versions
USCore defines the USCore Patient
The USCore 6.1 Coverage Profile defines a slice on identifier called memberid
that can be used to access the patient’s member id
define "Covered Member ID":
Coverage.memberId()
Updated 2024-07-28
Patient information includes the birth date, and CQL provides a built-in function to calculate the age of a patient, either current age (i.e. as of now), or as of a particular date. In quality improvement artifacts, age is typically calculated as of a particular date. In the context of a Questionnaire, this is typically just today’s date, and can be accessed using the ageInYears()
function:
define "Patient Age Between 50 and 75":
Patient.ageInYears() between 50 and 75
NOTE: The AgeInYearsAt function in CQL uses the data model (QICore in this case) to understand how to access the patient’s birth date information.
NOTE: CQL supports age calculation functions using both
Date
andDateTime
values. In both cases the function is shorthand for a date/datetime duration calculation. If theDateTime
overloads are used, note that the timezone offset is considered and there may be edge cases that result in unexpected results, depending on how large the timezone offset is from the execution timestamp. To avoid these edge cases, best practice is to use thedate from
extractor as shown in the above pattern to ensure theDate
calculation is used.
Updated 2024-07-28
Patient gender in FHIR is represented using codes from the AdministrativeGender code system:
define "Patient Is Male":
Patient.gender = 'male'
NOTE: Terminology-valued elements in FHIR resources are bound to value sets. The gender element is an example of a required binding, which means that only the codes in the bound value set are allowed to be used. This allows the logic in this example to compare using the actual string
'male'
. In general, terminology-valued elements should be compared using terminology operators. For more information, see the Using Terminology topic in the Quality Measure IG.
Updated 2024-07-28
US Core defines extensions for representing the race and ethnicity of a patient using the CDC’s race and ethnicity codes. When authoring using USCore, these extensions can be accessed directly on the patient using the “slice name” of the extension:
define "Patient Race Includes Alaska Native":
Patient P
where exists (P.race.ombCategory C where C ~ "American Indian or Alaska Native")
and exists (P.race.detailed C where C ~ "Alaska Native")
NOTE: CQL uses the data model (USCore in this case) to understand how to access patient information using the
Patient
definition. This definition is available inPatient
contexts.
Updated 2024-07-28
Some elements in USCore profiles allow for values to be represented in different ways. For example, the deceased
element allows values of Boolean
and DateTime
. This means that the value of the deceased
element for any particular patient may be either a Boolean (true
or false
) or a DateTime. In FHIR and CQL, these types of elements are called choice types.
NOTE: Because the USCore model is using CQL system-defined types (see the FHIR Type Mapping topic), the spelling of the types uses the CQL type names (e.g.
Boolean
rather thanboolean
).
When accessing choice types in CQL expressions, authors can typically just treat the element as the type they are interested in accessing. For example:
define "Patient Is Deceased":
Patient.deceased is true
define "Patient Deceased During Measurement Period":
Patient.deceased during day of "Measurement Period"
In the first expression, the deceased
element is treated as a Boolean, whereas in the second expression, the deceased
element is treated as a DateTime.
NOTE: No value conversions take place when accessing choice types, when using the “Patient Is Deceased” expression above, for example, if the Patient record has a DateTime value for the deceased element, the result of that expression will be
false
.
NOTE: Content for this page was adapted from the QICore Authoring Patterns - Patient topic.