> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corti.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AllergyIntolerance resource group

> Learn how allergies and intolerances become FHIR R4 AllergyIntolerance resources, and which fields the Corti API fills

An AllergyIntolerance resource records a patient's risk of a harmful reaction to a substance: a drug, a food, something in the environment, or a biologic product. The endpoint codes each allergy with [SNOMED CT](https://www.snomed.org/). The resource follows the [FHIR R4 AllergyIntolerance](https://hl7.org/fhir/R4/allergyintolerance.html) specification, and each field name below links to its R4 definition.

Allergies get their own resource instead of a Condition, because decision support needs to know the category, the criticality, and the reaction. A prescribing system can then warn before it orders penicillin.

> [!WARNING]
>
> If your EHR already keeps a structured allergy list, treat it as the source of truth. Use extracted allergies to suggest additions for a clinician to review, or turn the group off. See [Reduce extraction errors](https://docs.corti.ai/fhir/reduce-errors.md#skip-data-you-already-have-in-structured-form).

## What becomes an AllergyIntolerance

| Note says | `code` | `type` | `category` |
| - | - | - | - |
| "Penicillin causes hives" | `91936005` Allergy to penicillin | `allergy` | `medication` |
| "Peanut allergy, carries an EpiPen" | `91935009` Allergy to peanut | `allergy` | `food` |
| "Lactose intolerant" | `782415009` Intolerance to lactose | `intolerance` | `food` |
| "Hay fever from grass pollen" | `418689008` Allergy to grass pollen | `allergy` | `environment` |

## No known allergies

The `code` names the allergy in positive form. "NKDA" (no known drug allergies) does not become `409137002` No known drug allergy. It becomes an AllergyIntolerance with `code` `416098002` Allergy to drug and `verificationStatus: refuted`.

| Note says | `code` | `verificationStatus` |
| - | - | - |
| "Penicillin allergy" | `91936005` Allergy to penicillin | `confirmed` |
| "NKDA" | `416098002` Allergy to drug | `refuted` |
| "Not allergic to penicillin after all, tolerated amoxicillin" | `91936005` Allergy to penicillin | `refuted` |

A refuted AllergyIntolerance tells you that someone checked, and found no allergy. That is different from no AllergyIntolerance at all, which only means the note did not mention allergies.

## Fields

| Field | Type | What it holds | Example from a note |
| - | - | - | - |
| [`code`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.code) | [CodeableConcept](https://docs.corti.ai/fhir/datatypes.md#codeableconcept) | The allergy or intolerance, in SNOMED CT | "penicillin allergy" → `91936005` |
| [`clinicalStatus`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.clinicalStatus) | [CodeableConcept](https://docs.corti.ai/fhir/datatypes.md#codeableconcept) | `active`, `inactive`, or `resolved`. Defaults to `active`. Left out when `verificationStatus` is `entered-in-error`, as R4 requires. See the [R4 value set](https://hl7.org/fhir/R4/valueset-allergyintolerance-clinical.html). | "outgrew egg allergy" → `resolved` |
| [`verificationStatus`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.verificationStatus) | [CodeableConcept](https://docs.corti.ai/fhir/datatypes.md#codeableconcept) | `unconfirmed`, `confirmed`, `refuted`, or `entered-in-error`. See the [R4 value set](https://hl7.org/fhir/R4/valueset-allergyintolerance-verification.html). | "possible sulfa allergy" → `unconfirmed` |
| [`type`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.type) | [code](https://docs.corti.ai/fhir/datatypes.md#primitive-types) | `allergy` or `intolerance`. See the [R4 value set](https://hl7.org/fhir/R4/valueset-allergy-intolerance-type.html). | |
| [`category`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.category) | list of [code](https://docs.corti.ai/fhir/datatypes.md#primitive-types) | `food`, `medication`, `environment`, or `biologic`. See the [R4 value set](https://hl7.org/fhir/R4/valueset-allergy-intolerance-category.html). | |
| [`criticality`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.criticality) | [code](https://docs.corti.ai/fhir/datatypes.md#primitive-types) | `low`, `high`, or `unable-to-assess`. See the [R4 value set](https://hl7.org/fhir/R4/valueset-allergy-intolerance-criticality.html). | "anaphylaxis" → `high` |
| [`onsetDateTime`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.onset_x_) or [`onsetString`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.onset_x_) | [dateTime](https://docs.corti.ai/fhir/datatypes.md#primitive-types) or [string](https://docs.corti.ai/fhir/datatypes.md#primitive-types) | When it started | "since childhood" → `onsetString: "childhood"` |
| [`patient`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.patient) | [Reference](https://docs.corti.ai/fhir/datatypes.md#reference) | The Patient of the Bundle | Always set |
| [`lastOccurrence`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.lastOccurrence) | [dateTime](https://docs.corti.ai/fhir/datatypes.md#primitive-types) | The last known reaction. Free text such as "last month" is left out, because the field only accepts dates. | "last reaction in 2024" → `2024` |
| [`reaction`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.reaction) | list | The reaction, with `manifestation`, `substance`, and `exposureRoute` as text, `description` as a string, `onset` as a [dateTime](https://docs.corti.ai/fhir/datatypes.md#primitive-types) when the note states a date, and `severity` as `mild`, `moderate`, or `severe`. R4 requires `manifestation`: when the note names no manifestation, it is marked unknown with the [data-absent-reason](https://hl7.org/fhir/R4/extension-data-absent-reason.html) extension. | "hives" → `manifestation[0].text: "hives"` |
| [`note`](https://hl7.org/fhir/R4/allergyintolerance-definitions.html#AllergyIntolerance.note) | list of [Annotation](https://docs.corti.ai/fhir/datatypes.md#annotation) | Extra context | |
| [`extension`](https://hl7.org/fhir/R4/extensibility.html#Extension) | list of [Extension](https://docs.corti.ai/fhir/datatypes.md#extension) | [Mentions and alternatives](https://docs.corti.ai/fhir/how-it-works.md#every-value-points-back-to-the-note) | |

The endpoint does not fill the optional R4 `encounter` reference, because an allergy outlasts the visit where someone wrote it down. If you want to record the visit where the allergy was asserted, add the reference yourself. AllergyIntolerance also has no `bodySite`, because FHIR R4 does not define one.

### Category is a plain code

FHIR R4 defines `category` as a list of plain codes, so each category is a string: `food`, `medication`, `environment`, or `biologic`. It carries no SNOMED CT equivalent, because a plain code has room for only one value.

## Codes the endpoint can assign

The endpoint only searches a fixed part of each coding system for each field. A code outside that part never appears, and a [filter](https://docs.corti.ai/fhir/filter-reference.md#how-filters-combine) can only narrow the part further, never widen it. [Codes come from a fixed scope](https://docs.corti.ai/fhir/how-it-works.md#codes-come-from-a-fixed-scope) explains why.

| Field | Coding system | Allowed codes | Example |
| - | - | - | - |
| `code` | SNOMED CT | Semantic tag `finding` | `91936005` Allergy to penicillin |
| `category` | FHIR value set | A fixed list, shown in [Category is a plain code](#category-is-a-plain-code) | |
| `clinicalStatus`, `verificationStatus` | HL7 code systems | The FHIR value sets listed under [Fields](#fields) | |

The `code` is the allergy finding, such as "Allergy to penicillin", not the substance "Penicillin". Substances have the semantic tag `substance`, which is outside the allowed set. The reaction fields hold text, so the endpoint assigns no codes there.

## Example

```text theme={null}
Penicillin causes hives and throat swelling. Confirmed by allergist.
```

> [tab] Simplified
>
> | Field | Value |
> | - | - |
> | `code` | `91936005` Allergy to penicillin |
> | `clinicalStatus` | `active` |
> | `verificationStatus` | `confirmed` |
> | `type` | `allergy` |
> | `category` | `medication` |
> | `criticality` | `high` |
> | `reaction` | "hives and throat swelling", severity `severe` |

> [tab] JSON
>
> ```json theme={null}
> {
>   "resourceType": "AllergyIntolerance",
>   "id": "e1153f83-e4c1-5aed-8237-5bbe5c0f4ed8",
>   "clinicalStatus": {
>     "coding": [
>       {
>         "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
>         "code": "active",
>         "display": "Active"
>       }
>     ],
>     "text": "Active"
>   },
>   "verificationStatus": {
>     "coding": [
>       {
>         "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
>         "code": "confirmed",
>         "display": "Confirmed"
>       }
>     ],
>     "text": "Confirmed"
>   },
>   "type": "allergy",
>   "category": ["medication"],
>   "criticality": "high",
>   "code": {
>     "coding": [
>       {
>         "system": "http://snomed.info/sct",
>         "code": "91936005",
>         "display": "Allergy to penicillin"
>       }
>     ],
>     "text": "Allergy to penicillin"
>   },
>   "patient": { "reference": "urn:uuid:b49ecda5-92db-5325-a7a9-f82c71500bad", "type": "Patient" },
>   "reaction": [
>     {
>       "manifestation": [{ "text": "hives and throat swelling" }],
>       "severity": "severe"
>     }
>   ]
> }
> ```

## Next steps

> [card] [FamilyMemberHistory resource group](https://docs.corti.ai/fhir/resource-groups/family-member-history.md)
>
> Learn how conditions in relatives look in FHIR.

> [card] [Condition resource group](https://docs.corti.ai/fhir/resource-groups/condition.md)
>
> Learn how diagnoses, problems, symptoms, and signs look in FHIR.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.