Skip to content

AllergyIntolerance Profile

Canonical../StructureDefinition/nexus-emr-core-allergyintolerance
Statusdraft · 1.26.0
BaseAllergyIntolerance (constraint)
SourceFSH · JSON

Defines the Nexus EMR standard for AllergyIntolerance resources, based on CA-Core+. Includes instance-specific Nexus EMR identifiers, references via identifier (CII E01).

TypedFhir API / Pydantic schema

The typed accessor surface AllergyIntolerance exposes for AllergyIntolerance — generated from this IG's compiled profile; each typed accessor has a validating raw-FHIR twin (xRaw) where marked. The three ports are parity-enforced.

The AI-facing shape: from typed_fhir.facade.generated.schemas import AllergyIntoleranceSchemamodel_json_schema() is a structured-output / tool definition; instantiating validates an extraction. Generated source.

class AllergyIntoleranceSchema(BaseModel):
    """AI-facing shape of the AllergyIntolerance profile: the facade's typed accessor
    surface (curated + salient fields) as a pydantic model. `model_json_schema()` is a
    structured-output / tool schema; instantiating validates an extraction."""

    model_config = ConfigDict(extra="forbid")

    clinical_status: Concept | None = Field(
        None,
        description=(
            "Whether the allergy is still current. The clinical status of the allergy or "
            "intolerance. Used to distinguish active allergies from historical or resolved ones. "
            "Present on every allergy except a retracted one: R4's ait-1 requires it unless "
            "`verificationStatus` is `entered-in-error`, and ait-2 forbids it when that is the "
            "status. Note: This is a modifier element - absence of an active status means the "
            "allergy should not trigger alerts. Absence because the entry is `entered-in-error` "
            "means the allergy was never true and must not be surfaced at all, which is a "
            "different statement from `inactive` or `resolved`. AllergyIntolerance.clinicalStatus "
            "— 0..1. codes (required): active | inactive | resolved"
        ),
    )
    verification_status: Concept | None = Field(
        None,
        description=(
            "unconfirmed | confirmed | refuted | entered-in-error. Assertion about certainty "
            "associated with the propensity, or potential risk, of a reaction to the identified "
            "substance (including pharmaceutical product). Note: The data type is CodeableConcept "
            "because verificationStatus has some clinical judgment involved, such that there "
            "might need to be more specificity than the required FHIR value set allows. For "
            "example, a SNOMED coding might allow for additional specificity. "
            "AllergyIntolerance.verificationStatus — 0..1. codes (required): confirmed | "
            "entered-in-error | refuted | unconfirmed"
        ),
    )
    type: Literal["allergy", "intolerance"] | None = Field(
        None,
        description=(
            "Whether the reaction is immune-mediated (allergy) or not (intolerance). "
            "Identification of the underlying physiological mechanism for the reaction risk. "
            "Note: Allergic (typically immune-mediated) reactions have been traditionally "
            "regarded as an indicator for potential escalation to significant future risk. "
            "Contemporary knowledge suggests that some reactions previously thought to be "
            "immune-mediated are, in fact, non-immune, but in some cases can still pose a life "
            "threatening risk. It is acknowledged that many clinicians might not be in a position "
            "to distinguish the mechanism of a particular reaction. Often the term \"allergy\" is "
            "used rather generically and may overlap with the use of \"intolerance\" - in practice "
            "the boundaries between these two concepts might not be well-defined or understood. "
            "This data element is included nevertheless, because many legacy systems have "
            "captured this attribute. Immunologic testing may provide supporting evidence for the "
            "basis of the reaction and the causative substance, but no tests are 100% sensitive "
            "or specific for sensitivity to a particular substance. If, as is commonly the case, "
            "it is unclear whether the reaction is due to an allergy or an intolerance, then the "
            "type element should be omitted from the resource. AllergyIntolerance.type — 0..1"
        ),
    )
    criticality: Literal["high", "low", "unable-to-assess"] | None = Field(
        None,
        description=(
            "The risk that a future exposure causes serious harm. Estimate of the potential "
            "clinical harm, or seriousness, of the reaction to the identified substance. Note: "
            "The default criticality value for any propensity to an adverse reaction should be "
            "'Low Risk', indicating at the very least a relative contraindication to deliberate "
            "or voluntary exposure to the substance. 'High Risk' is flagged if the clinician has "
            "identified a propensity for a more serious or potentially life-threatening reaction, "
            "such as anaphylaxis, and implies an absolute contraindication to deliberate or "
            "voluntary exposure to the substance. If this element is missing, the criticality is "
            "unknown (though it may be known elsewhere). Systems that capture a severity at the "
            "condition level are actually representing the concept of criticality whereas the "
            "severity documented at the reaction level is representing the true reaction "
            "severity. Existing systems that are capturing both condition criticality and "
            "reaction severity may use the term \"severity\" to represent both. Criticality is the "
            "worst it could be in the future (i.e. situation-agnostic) whereas severity is "
            "situation-dependent. AllergyIntolerance.criticality — 0..1"
        ),
    )
    code: Concept | None = Field(
        None,
        description=(
            "Allergen/substance with raw code support. The substance or class of substances that "
            "the patient has an allergy or intolerance to. REQUIRED: text element for human "
            "readability RECOMMENDED, for a DRUG allergen: an ingredient-level code in the slices "
            "below. CCDD is preferred; where the source has no CCDD -- in practice most legacy "
            "EMR allergy lists -- the Health Canada DPD active-ingredient group number is the one "
            "to carry, with ATC for class-level records. That code is the only thing making an "
            "allergen joinable to a medication record; without it an allergy and a prescription "
            "share nothing but free text. OPTIONAL: SNOMED CT for non-drug allergens (foods, "
            "environmental substances) and for substance classes OPTIONAL: Raw EMR allergen codes "
            "for source system preservation Nexus EMR does not mandate a specific coding system "
            "for allergens. The text element ensures human readability even when coded values are "
            "not recognized. Where this code was mapped from a source system's own vocabulary, "
            "carry the raw coding alongside the mapped one, flagged `userSelected = true`. See "
            "[Carrying the raw code](../guide/patterns/raw-codes.md). "
            "Note: It is strongly recommended that this element be populated using a terminology, "
            "where possible. For example, some terminologies used include RxNorm, SNOMED CT, "
            "DM+D, NDFRT, ICD-9, IDC-10, UNII, and ATC. Plain text should only be used if there "
            "is no appropriate terminology available. Additional details can be specified in the "
            "text. When a substance or product code is specified for the 'code' element, the "
            "\"default\" semantic context is that this is a positive statement of an allergy or "
            "intolerance (depending on the value of the 'type' element, if present) condition to "
            "the specified substance/product. In the corresponding SNOMED CT allergy model, the "
            "specified substance/product is the target (destination) of the \"Causative agent\" "
            "relationship. The 'substanceExposureRisk' extension is available as a structured and "
            "more flexible alternative to the 'code' element for making positive or negative "
            "allergy or intolerance statements. This extension provides the capability to make "
            "\"no known allergy\" (or \"no risk of adverse reaction\") statements regarding any coded "
            "substance/product (including cases when a pre-coordinated \"no allergy to x\" concept "
            "for that substance/product does not exist). If the 'substanceExposureRisk' extension "
            "is present, the AllergyIntolerance.code element SHALL be omitted. "
            "AllergyIntolerance.code — 1..1"
        ),
    )
    patient: Reference | None = Field(
        None,
        description=(
            "Who the allergy or intolerance is for. The patient who has the allergy or "
            "intolerance. Must reference using Nexus EMR patient identifier. Note: References "
            "should use identifier-based references following Nexus EMR patterns. "
            "AllergyIntolerance.patient — 1..1"
        ),
    )
    encounter: Reference | None = Field(
        None,
        description=(
            "Encounter when allergy was recorded. The encounter during which this allergy or "
            "intolerance was recorded. Optional but helpful for clinical context. Note: Linking "
            "to encounter provides clinical context about when and where the allergy was "
            "documented. AllergyIntolerance.encounter — 0..1"
        ),
    )
    recorded_date: FuzzyDate | None = Field(
        None,
        description=(
            "Date allergy was first recorded. The date on which the allergy or intolerance was "
            "first recorded in this system. This may differ from when the allergy first occurred. "
            "Note: This represents when the allergy was documented, not necessarily when it was "
            "first experienced by the patient. AllergyIntolerance.recordedDate — 1..1"
        ),
    )
    note: dict | None = Field(
        None,
        description=(
            "Clinical comments on the allergy or intolerance -- one whole comment per repeat. "
            "Free-text clinical comment about an allergy or intolerance: what a person wanted to "
            "say about it that no other element carries. **One whole comment per repeat.** "
            "`note.text` is the comment in full, and a consumer renders it verbatim. "
            "**`note.text` is not a carrier for other fields.** A consumer MUST NOT parse it for "
            "prefixes, markers, keys or any other in-band convention, and a producer MUST NOT "
            "encode in it a value that belongs to an element or an extension of its own. Anything "
            "with its own editing lifecycle -- one box, edited and cleared on its own -- gets its "
            "own address, as an element of this resource or as an extension declared by this "
            "guide. Note: Attribution is OPTIONAL here, unlike on a task. `author[x]` and `time` "
            "keep their base R4 cardinality: a producer that has them SHOULD write them, a "
            "consumer displays them when present, and no consumer may require them -- comments "
            "reaching this element from a source system routinely carry neither. This is why the "
            "element is a plain `Annotation` rather than the [Task "
            "Note](../fhir/StructureDefinition-nexus-emr-task-note.md) "
            "profile, which requires both because a task's turns must each say who said it. Where "
            "both are absent, the comment is attributable only to the resource's own provenance. "
            "AllergyIntolerance.note — 0..*"
        ),
    )
    reaction: str | None = Field(
        None,
        description=(
            "Clinical symptoms/signs associated with the Event. Clinical symptoms and/or signs "
            "that are observed or associated with the adverse reaction event. Note: Manifestation "
            "can be expressed as a single word, phrase or brief description. For example: nausea, "
            "rash or no reaction. It is preferable that manifestation should be coded with a "
            "terminology, where possible. The values entered here may be used to display on an "
            "application screen as part of a list of adverse reactions, as recommended in the UK "
            "NHS CUI guidelines. Terminologies commonly used include, but are not limited to, "
            "SNOMED CT or ICD10. Salient field — reaction.first().manifestation.first().text | "
            "reaction.first().manifestation.first().coding.first().display"
        ),
    )