AllergyIntolerance
— maps to 1 OMOP table| OMOP Table | Status | Mapped | |
|---|---|---|---|
|
observation
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.
|
implemented | 21 fields | detail → |
AllergyIntolerance → OMOP Mapping
FHIR AllergyIntolerance records patient allergies and intolerances. OMOP has no dedicated allergy table — allergies are stored as observations with allergy-specific SNOMED concepts.
Target OMOP Tables
| OMOP Table | Purpose | Required? |
|---|---|---|
observation | One row per allergy/intolerance | Yes |
Mapping Strategy
-
Target table. All implementations agree: AllergyIntolerance → OMOP
observation. The allergy substance code maps toobservation_concept_id(SNOMED allergy concepts) orvalue_as_concept_id(substance concept, with a category concept inobservation_concept_id). Reaction manifestations can map tovalue_as_stringor create separate observation rows. -
observation_concept_id strategy. Two approaches exist. omoponfhir uses category-based concept selection:
foodallergy → 4188027 ("Allergy to food"),medication→ 439224 ("Allergy to drug"), default → 40772948 ("Allergy"). This approach places the substance invalue_as_concept_id. Other implementations (FhirToCdm, HL7 IG FML) look up the substance code directly in the OMOP vocabulary and place it inobservation_concept_id. This project currently uses 0 as a placeholder — vocabulary lookup is required. -
Date handling.
AllergyIntolerance.onsetDateTime→observation_date. Fallback chain:onsetPeriod.start→recordedDate. If none exist, the allergy is skipped (this project) or the encounter date is used (FhirToCdm). -
Status filtering.
clinicalStatus=activeshould be mapped.inactiveandresolvedrepresent historical state and are skipped.verificationStatus=entered-in-errororrefutedshould always be skipped. WhenclinicalStatusis absent, map permissively. -
Allergy type.
AllergyIntolerance.type(allergyvsintolerance) andcategory(food,medication,environment,biologic) inform the observation_concept_id selection in omoponfhir. This project storestypeinqualifier_source_value. No standard OMOP concept exists for type/criticality. -
Reactions.
AllergyIntolerance.reaction[].manifestationmaps tovalue_as_string(concatenated display names). The first manifestation could also map tovalue_as_concept_idwith vocabulary lookup. The HL7 IG FML maps reaction manifestation code directly tovalue_as_concept_id. -
Provider resolution.
recorder(who documented it) andasserter(who states it's true) are both candidates forprovider_id. This project prefersasserter, falling back torecorder. omoponfhir usesrecorderonly.
Reference Implementations
- fhir-omop-ig (HL7) — FML at
refs/refs/fhir-omop-ig/input/maps/Allergy.fml(51 lines). Mapscode→observation_concept_id,onset→observation_date,reaction.manifestation→value_as_concept_id. Patient/encounter/provider references are commented out (TODO). Status: draft. - omoponfhir (Georgia Tech, Java) —
refs/refs/omoponfhir-omopv5-r4-mapping/src/main/java/edu/gatech/chai/omoponfhir/omopv5/r4/mapping/OmopAllergyIntolerance.java(449 lines). Bidirectional. Category-driven concept selection (food→4188027, medication→439224, default→40772948). Substance →value_as_concept_id. Type concept = 38000280 ("Observation recorded from EHR"). Status: maintained. - omoponfhir-v54 (Georgia Tech, Java, v5.4) —
refs/refs/omoponfhir-v54-r4/omoponfhir-omopv5-r4-mapping/src/main/java/edu/gatech/chai/omoponfhir/omopv5/r4/mapping/OmopAllergyIntolerance.java(450 lines). Identical logic to omoponfhir. Status: maintained. - FhirToCdm (OHDSI, C#) —
refs/refs/FhirToCdm/FhirToCdmMappings.cslines 453-480CreateObservation(). Maps AllergyIntolerance → observation via vocabulary lookup oncode. UsesrecordedDatefor date. No status filtering. Minimal field coverage. - fhir-to-omop-demo (jq) —
refs/refs/fhir-to-omop-demo/demo/translate/map/AllergyIntolerance.jq(48 lines). Maps to condition_occurrence (not observation) — divergent approach. UsesrecordedDatefor start date. Type concept = 32817. - ETL-German-FHIR-Core — No dedicated AllergyIntolerance mapper.
- NACHC-fhir-to-omop — No dedicated AllergyIntolerance mapper (handles via generic observation).
Status in This Project
Implemented: src/mapper/allergy-intolerance.ts (103 lines). Tests: tests/allergy-intolerance.test.ts (312 lines). Maps substance code, onset date with fallback chain, recorder/asserter, reaction manifestations, type, criticality. Status filtering implemented. Vocabulary lookup is placeholder (concept_id = 0).