AllergyIntolerance observation implemented primary

FHIR AllergyIntolerance records patient allergies and intolerances. OMOP has no dedicated allergy table, so allergies are stored in the observation table with allergy-specific SNOMED concepts. One AllergyIntolerance maps to one observation row. Status filtering excludes inactive/resolved allergies and entered-in-error/refuted records.

A FHIR instance converts to observation iff it validates against this profile.
Routing key AllergyIntolerance.code ∈ omop-observation-codes (OMOP domain Observation)
Path Card Type Binding / Fixed Comment
AllergyIntolerance.clinicalStatus fhir/allergyintolerance-clinicalrequired
AllergyIntolerance.verificationStatus fhir/allergyintolerance-verificationrequired
AllergyIntolerance.code 1..*MS omop-observation-codesrequired
AllergyIntolerance.patient 1..* Reference Required for observation.person_id.
ViewDefinition (Stage 1 flattener) omop-allergyintolerance-observation
15 columns · resource AllergyIntolerance
column name FHIRPath type
id AllergyIntolerance.id id
code_snomed AllergyIntolerance.code.coding.where(system='http://snomed.info/sct').first().code code
code_rxnorm AllergyIntolerance.code.coding.where(system='http://www.nlm.nih.gov/research/umls/rxnorm').first().code code
code_text AllergyIntolerance.code.text string
value_code_snomed AllergyIntolerance.code.coding.where(system='http://snomed.info/sct').first().code code
value_code_rxnorm AllergyIntolerance.code.coding.where(system='http://www.nlm.nih.gov/research/umls/rxnorm').first().code code
value_code_text AllergyIntolerance.code.text string
subject_id AllergyIntolerance.patient Reference(Patient)
observation_date AllergyIntolerance.onsetDateTime dateTime
observation_datetime AllergyIntolerance.onsetDateTime dateTime
value_as_string AllergyIntolerance.reaction[*].manifestation[*].text string
qualifier_text AllergyIntolerance.type code
performer_id AllergyIntolerance.asserter Reference(Practitioner | PractitionerRole)
encounter_id AllergyIntolerance.encounter Reference(Encounter)
value_text AllergyIntolerance.criticality code
Condition: clinicalStatus is active or absent; verificationStatus is not entered-in-error or refuted
Implementation: src/mapper/allergy-intolerance.ts

Fields (21)

Vocabularies

observation_concept_id_category_based

Source Display Concept ID Concept Name
food Food allergy category 4188027 Allergy to food
medication Medication allergy category 439224 Allergy to drug
environment Environmental allergy category 40772948 Allergy
biologic Biologic allergy category 40772948 Allergy
(absent) No category, substance domain = Drug 439224 Allergy to drug
(absent, other) No category, other domain 40772948 Allergy

observation_type_concept_id

Source Display Concept ID Concept Name
32817 EHR 32817 EHR
38000280 Observation recorded from EHR 38000280 Observation recorded from EHR

clinicalStatus_filtering

Source Display Concept ID Concept Name
active Active -
inactive Inactive -
resolved Resolved -
(absent) Not provided -

verificationStatus_filtering

Source Display Concept ID Concept Name
confirmed Confirmed -
unconfirmed Unconfirmed -
provisional Provisional -
differential Differential -
entered-in-error Entered in Error -
refuted Refuted -
(absent) Not provided -

allergy_type

Source Display Concept ID Concept Name
allergy Allergy -
intolerance Intolerance -

criticality

Source Display Concept ID Concept Name
low Low Risk -
high High Risk -
unable-to-assess Unable to Assess -

Edge Cases

No onsetDateTime, no onsetPeriod, no recordedDate
Skip the record -- observation_date is NOT NULL. This project returns null.
onsetPeriod.start only (no onsetDateTime)
Use onsetPeriod.start as observation_date.
recordedDate only (no onset fields)
Use as last-resort date.
No code or empty code.coding[]
Skip the record -- cannot identify the substance.
code with text only (no coding)
Skip -- no structured code to map.
Multiple reaction entries
Concatenate all manifestation display names into value_as_string, semicolon-separated.
Multiple manifestation per reaction
Include all in value_as_string concatenation.
category = medication
Code might overlap with drug concepts. Still maps to observation, not drug_exposure.
category = food
omoponfhir sets observation_concept_id = 4188027 (Allergy to food). This project: not yet implemented.
criticality present
Stored in value_source_value.
type = intolerance
Stored in qualifier_source_value. No separate OMOP handling.
verificationStatus = entered-in-error
Skip the record.
verificationStatus = refuted
Skip the record.
clinicalStatus = inactive or resolved
Skip the record.
clinicalStatus absent
Map permissively (not required in FHIR).
asserter is a Patient (self-reported)
Cannot map to OMOP provider_id -- set null. resolveRef will produce an ID but it won't correspond to a provider row.
recorder is a RelatedPerson
Cannot map to OMOP provider_id -- set null.
reaction[].severity present
Lost -- no OMOP field for severity. Could store in qualifier_source_value but this project uses it for type.
reaction[].substance differs from code
The per-reaction substance is lost. Only code (top-level) is mapped.
note[] present
Lost -- no standard OMOP target. Could append to value_as_string but would mix with manifestation text.
Multiple coding in code
Best coding selected by system priority (SNOMED preferred).
onsetAge or onsetRange
Not handled -- only onsetDateTime and onsetPeriod supported. Would require birth date to compute absolute date.
onsetString
Not handled -- free-text onset cannot produce a date. Skip or store in a separate field.

Reference Implementations