FHIR R4 AllergyIntolerance example
AllergyIntolerance records the risk of a harmful reaction to a substance. The reaction that was observed goes in reaction; criticality is the estimated risk of the next one.
The AllergyIntolerance in JSON
{
"resourceType": "AllergyIntolerance",
"id": "penicillin",
"clinicalStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
"code": "active"
}
]
},
"verificationStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
"code": "confirmed"
}
]
},
"type": "allergy",
"category": [
"medication"
],
"criticality": "high",
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "764146007",
"display": "Penicillin"
}
],
"text": "Penicillin"
},
"patient": {
"reference": "Patient/example",
"display": "Jane Doe"
},
"recordedDate": "2019-05-02",
"reaction": [
{
"manifestation": [
{
"coding": [
{
"system": "http://snomed.info/sct",
"code": "271807003",
"display": "Eruption of skin"
}
],
"text": "Skin rash"
}
],
"severity": "moderate"
}
]
}
Validator result: raw JSON ยท open the validator
- informationNo errors: this AllergyIntolerance matches the FHIR R4 structure checked here.
The elements that matter
| Element | Cardinality | Notes |
|---|---|---|
patient | 1..1 | Here the element is patient, not subject. |
type | 0..1 | allergy or intolerance. |
category | 0..* | food, medication, environment, biologic. |
criticality | 0..1 | low, high or unable-to-assess. |
reaction | 0..* | Each with at least one manifestation. |
The full definition is in the FHIR R4 AllergyIntolerance specification.
Common mistakes and the errors they cause
Subject instead of patient
AllergyIntolerance uses patient.
- error
AllergyIntolerance.patientRequired element is missing. - error
AllergyIntolerance.subjectUnknown element: it is not part of this resource in FHIR R4. Check the spelling and case, the FHIR version (R4, not STU3 or R5) and put custom data in an extension.
Criticality outside the value set
severe is a reaction severity, not a criticality.
- error
AllergyIntolerance.criticalityAllergyIntolerance.criticality 'severe' is not in the required value set (high, low, unable-to-assess).
Category as a string
category repeats, so it is an array even with one value.
- error
AllergyIntolerance.categoryExpected an array (this element repeats: cardinality 0..* or 1..*).
Store it in a real FHIR R4 serverA free sandbox key gives you 30 synthetic patients and the full API, including
Get a free API keyPOST /fhir/R4/AllergyIntolerance and $validate.More examples
- Patient resource example
- Observation example: blood pressure
- Observation example: laboratory result
- DiagnosticReport example: lab panel
- Condition resource example
- MedicationStatement example
- Immunization resource example
- Encounter resource example
Related guides
- How to store medical records using FHIR R4Tutorial: create a Patient, a blood-pressure Observation and a Condition, use a transaction, search, update with history and read provenance โ every request with curl and the real response, on the free sandbox.
- FHIR code systemsWhich code systems each FHIR resource type uses: LOINC for measurements and lab results, ICD-10 for conditions, ATC for medications, UCUM units, and SNOMED CT behind a licence flag.