Common CQL Artifacts for FHIR (US-Based)
2.0.0 - Informative 2
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 2.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 US Core Allergy Intolerance profile is used to capture allergies and adverse reactions associated with a patient.
By default, the primary terminology filter for AllergyIntolerance is code. The codes for this element are expected to come from a set of common codes designating substances for allergy documentation in SNOMED and RXNORM.
The AllergyIntolerance resource defines the following modifier elements:
Note that neither of these elements are required, but both are must support, and have a required binding. As such the FHIRCommon library defines functions such as isActive() for assessing these statuses. Further examples are provided in the "Common Elements" section below.
USCore requires searching by:
In addition, servers may support searching by:
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.
There are no significant differences between the 3.1.1, 6.1.0, and 7.0.0 versions of this profile.
To facilitate checking allergy intolerance status, the following functions are defined in the FHIRCommon library. The is... functions operate on a single AllergyIntolerance (and so are typically used within a where clause), while the other functions operate on a list of AllergyIntolerance resources, and so are typically used when dealing with an entire set of resources as a single expression:
NOTE: These functions make use of the
clinicalStatuselement of theAllergyIntolerance, which is the current status of theAllergyIntolerancerecord. For retrospective cases (such as quality reporting), the logic may be evaluated on data that exists at the time of evaluation. This means that while a given allergy/intolerance may have been active during the measurement period, it might no longer be active when the measure is run. As such, theisActive()function should not be used in retrospective contexts. Instead, the most reliable way to determine whether an allergy/intolerance was active at some point in time is to use the Onset, Abatement, and Prevalence Interval elements as discussed below.
The AllergyIntolerance resource also has a verificationStatus element to represent information such as whether the allergy has been confirmed. The element is not required, but if it is present, it is a modifier element, and has the potential to negate the information the resource is conveying (e.g., the refuted status). For most usage, when application intent is looking for positive evidence of an allergy, the verification statuses of refuted and entered-in-error should be excluded if verificationStatus is present:
define "Verified Allergies":
[USCore."AllergyIntolerance"] VerifiedAllergyIntolerance
where VerifiedAllergyIntolerance.verificationStatus is not null implies
(VerifiedAllergyIntolerance.verificationStatus ~ "confirmed"
or VerifiedAllergyIntolerance.verificationStatus ~ "unconfirmed"
)
To support re-use of this pattern, the FHIRCommon library defines the isVerified and verified functions, along with other functions for testing verification status. As with the clinical status functions there are two sets, one using an is prefix, that are used with single AllergyIntolerance instances, and one set without, used with sets of AllergyIntolerance resources.
.isVerified().verified().isConfirmed().confirmed().isUnconfirmed().unconfirmed().isRefuted().refuted()The AllergyIntolerance resource defines an onset element that specifies the start of the prevalence period of the allergy/intolerance. In addition, abatement for an AllergyIntolerance can be represented in multiple ways:
.abatement(): Returns the abatement of the given AllergyIntolerance, if present.resolutionAge(): Returns the resolutionAge of the given AllergyIntolerance, if presentThese elements can be specified as choices of various types to allow systems flexibility in the way that information is represented. The US Core profile for AllergyIntolerance constrains those choices to only those that support actual computation of a prevalence period. Using these options, an abatement, as well as a prevalence interval, can be calculated:
.abatementInterval(): Returns an interval representing the normalized abatement of the given AllergyIntolerance resource..prevalenceInterval(): Returns an interval representing the normalized prevalence period of the given AllergyIntolerance resourceThe prevalenceInterval function takes an AllergyIntolerance resource and returns the interval from the start of the onset to the end of the abatement. If the AllergyIntolerance is active (i.e., has a clinicalStatus of active), then the ending boundary of the interval is inclusive (i.e., closed). Otherwise, the ending boundary of the interval is exclusive (i.e., open). When looking for whether an allergy/intolerance was active at some point, use the prevalenceInterval function rather than looking at the status element only.
Note also that systems may not have prevalence information, but only an assertedDate, which can be accessed with the assertedDate fluent function:
.assertedDate()To get all confirmed active allergies, UCE."Active Confirmed Allergies and Intolerances" can be used.
Current allergies to specific substances can make use of the terminology filter as part of the retrieve:
define "Statin Allergy Intolerance":
[USCore."AllergyIntolerance": "Statin Allergen"] StatinAllergyIntolerance
where StatinAllergyIntolerance.isActive()
NOTE: Because the AllergyIntolerance profile does not constrain the values of the
clinicalStatusorverificationStatuselements, authors must consider the possible values of these elements to ensure the expression matches intent.
In retrospective cases, the logic will be evaluated on data that exists at the time of evaluation. This means that while a given allergy/intolerance may have been active during the retrospective period, it might no longer be active when the logic is evaluated.
"All Allergies and Intolerances""Active Confirmed Allergies and Intolerances""Common Allergies and Intolerances""Active Confirmed Common Allergies and Intolerances"To check if a patient has confirmed they have no known allergies, use UCE."No Known Allergies (Confirmed)". This will check for SNOMED 716186003 (No known allergy (situation)) as advised in US Core.
US Core also supports documenting UCE."No Known Allergies (Not Asked)", which also uses the No known allergy (situation) SNOMED code, but the instance uses the unconfirmed verification status.
The following examples are illustrations of how these patterns could be used for specific clinical scenarios, making use of the general pattern for testing the type of allergy with a code:
define "AllergicToDrugX":
UCE."Active Confirmed Allergies and Intolerances" A
where A.code ~ "DrugX"
Ordering HeadMRI vs HeadCT because patient has allergy to CT dye
ICD-10-CM Code for Radiographic dye allergy status Z91.041
ICD-10-CM (International Classification of Diseases, 10th Revision, Clinical Modification)
Z91.012 – Allergy to eggs
T78.1XXA – Other adverse food reactions, not elsewhere classified, initial encounter
T78.1XXD – Other adverse food reactions, not elsewhere classified, subsequent encounter
T78.1XXS – Other adverse food reactions, not elsewhere classified, sequela
Z91.018 – Allergy to other foods
SNOMED CT (Systematized Nomenclature of Medicine – Clinical Terms)
91934008 – Egg allergy
281784008 – Egg intolerance
293982008 – Anaphylaxis due to egg
LOINC (Logical Observation Identifiers Names and Codes)
6096-8 – Egg IgE [Mass/volume] in Serum
6241-0 – Egg white IgE [Mass/volume] in Serum
7286-1 – Egg yolk IgE [Mass/volume] in Serum
ICD-10-CM Codes for Nut Allergies
ICD-10-CM classifies food allergies, including nut allergies, under T78.0–T78.1 and Z91.01 series:
T78.01XA – Anaphylactic reaction due to peanuts, initial encounter
T78.01XD – Anaphylactic reaction due to peanuts, subsequent encounter
T78.01XS – Anaphylactic reaction due to peanuts, sequela
T78.02XA – Anaphylactic reaction due to other nuts and seeds, initial encounter
T78.02XD – Anaphylactic reaction due to other nuts and seeds, subsequent encounter
T78.02XS – Anaphylactic reaction due to other nuts and seeds, sequela
Z91.010 – Allergy to peanuts
Z91.018 – Allergy to other nuts
Z91.019 – Allergy to unspecified nuts
NOTE: Content for this page was adapted from the QICore Authoring Patterns - Allergies topic.