Location
→
location
documented
primary
Each FHIR Location maps to one OMOP location row representing a physical address. Location.address fields map to address_1, address_2, city, state, zip, county, and country. Location.position maps to latitude/longitude. The location table is shared with Patient.address -- both populate the same table and rows should be deduplicated by address components to avoid duplicates.
Conversion profile
omop-location-location
A FHIR instance converts to location iff it validates against this profile.
| Path | Card | Type | Binding / Fixed | Comment |
|---|---|---|---|---|
| Location.name | 1..1MS | Required for downstream display; not stored directly in `location` but used for source_value composition. | ||
| Location.address | 1..1MS | Required. Provides address_1/2, city, state, zip, county, country_source_value. | ||
| Location.address.line | MS | |||
| Location.address.city | MS | |||
| Location.address.state | MS | |||
| Location.address.postalCode | MS | |||
| Location.position | MS | Optional. Latitude/longitude pass through to location.latitude / location.longitude. |
ViewDefinition (Stage 1 flattener)
omop-location-location
12 columns · resource Location
| column name | FHIRPath | type |
|---|---|---|
| id | Location.id | id |
| address_1 | Location.address.line[0] | string |
| address_2 | Location.address.line[1] | string |
| city | Location.address.city | string |
| state | Location.address.state | string |
| zip | Location.address.postalCode | string |
| county | Location.address.district | string |
| location_text | Location.id | string |
| country | Location.address.country | string |
| country_text | Location.address.country | string |
| latitude | Location.position.latitude | decimal |
| longitude | Location.position.longitude | decimal |
Fields (12)
-
location_id←(generated)integer · idPKrequiredSurrogate key. Each unique address should be assigned a unique key. fhir-to-omop-demo uses Location.id directly.3 sources ▾
-
Uses Location.id verbatim as the location_id integer
- fhir-to-omop-demo(jq) refs/refs/fhir-to-omop-demo/demo/translate/map/Location.jq — location_id = .id from Location resource
-
Address-based lookup-or-create via AddressUtil.searchAndUpdate(); returns existing location_id if address already present
- omoponfhir-v54(java) refs/refs/omoponfhir-v54-r4/omoponfhir-omopv5-r4-mapping/src/main/java/edu/gatech/chai/omoponfhir/omopv5/r4/mapping/OmopOrganization.java:240-275 — AddressUtil.searchAndUpdate() on Organization.address — no standalone Location resource handling
-
Single dummy location (id=1) for all unresolved references — no real address mapping
- NACHC-fhir-to-omop(sql) refs/refs/NACHC-fhir-to-omop/src/main/resources/sqlserver/omop/5.4/location/create-location-and-caresite-dummy-records.sql — Creates single dummy location row id=1
-
-
address_1←Location.address.line[0]varchar(50) · stringFirst line of street address. -
address_2←Location.address.line[1]varchar(50) · stringSecond line of street address. If more than 2 address lines, concatenate third+ into address_2 or drop them. -
city←Location.address.cityvarchar(50) · stringCity. -
state←Location.address.statevarchar(2) · stringState. May need normalization (e.g., 'California' -> 'CA'). varchar(2) may force lossy mapping for international locations. -
zip←Location.address.postalCodevarchar(9) · string3-, 5-, or 9-digit US zip; international codes also allowed. Truncate if >9 chars. -
county←Location.address.districtvarchar(20) · stringFHIR district is the closest analog to OMOP county. -
location_source_value←Location.idvarchar(50) · stringVerbatim source identifier or full address text (Location.address.text) for traceability.2 sources ▾
-
Uses Location.id as the source value for traceability
- fhir-to-omop-demo(jq) refs/refs/fhir-to-omop-demo/demo/translate/map/Location.jq — location_source_value = Location.id
-
Uses full address text (Location.address.text) as source value alternative
- omoponfhir-v54(java) refs/refs/omoponfhir-v54-r4/omoponfhir-omopv5-r4-mapping/src/main/java/edu/gatech/chai/omoponfhir/omopv5/r4/mapping/OmopOrganization.java:240-275 — AddressUtil handles source value from address components
-
-
country_concept_id←Location.address.countryinteger · stringFK→CONCEPTtransform:map(Location.address.country, Geography domain)Mapped to OMOP Geography domain concept. 0 if unmapped.1 source ▾
-
Maps country string to Geography domain concept_id; defaults to 0 when no mapping found
- fhir-to-omop-demo(jq) refs/refs/fhir-to-omop-demo/demo/translate/map/Location.jq — country_concept_id from Location.address.country
-
-
country_source_value←Location.address.countryvarchar(80) · stringCountry name verbatim. -
latitude←Location.position.latitudefloat · decimalMust be between -90 and 90. -
longitude←Location.position.longitudefloat · decimalMust be between -180 and 180.
Edge Cases
Multiple Location.address.line[] entries beyond 2
OMOP location has only address_1 and address_2. Concatenate the third+ lines into address_2 or drop them.
Location.address absent but Location.position present
Create a location row with only latitude/longitude populated; address fields null.
Location.position absent
latitude and longitude null. OMOP allows nulls.
State name not 2-letter abbreviation
Normalize (e.g., 'California' -> 'CA'). The OMOP state field is varchar(2). For international locations, the 2-char limit may force lossy mapping.
zip > 9 chars (international postal codes)
Truncate to 9 characters or store in location_source_value.
Country present but no concept mapping
country_source_value = country name verbatim; country_concept_id = 0.
Latitude/longitude out of valid range (-90..90 / -180..180)
Reject or null. OMOP DDL constraints in some dialects enforce this.
Same address appearing in both Patient.address and Location
Deduplicate by (address_1, city, state, zip). Re-use existing location_id.
Multiple Locations with identical addresses but different Location.id
Choose one canonical location row; map both Location.id values to it via the ID-mapping table.
Location with managingOrganization
Used to derive a care_site row in the dual-source pattern. See Location__care_site edge.
Reference Implementations
- fhir-to-omop-demo(jq) refs/refs/fhir-to-omop-demo/demo/translate/map/Location.jq — Creates both a location row and a care_site row from Location resource. Location row: address fields + lat/lng.
- omoponfhir-v54(java) refs/refs/omoponfhir-v54-r4/omoponfhir-omopv5-r4-mapping/src/main/java/edu/gatech/chai/omoponfhir/omopv5/r4/mapping/OmopOrganization.java:240-275 — AddressUtil.searchAndUpdate() resolves addresses from Organization.address into location rows. No standalone Location resource handling.
- NACHC-fhir-to-omop(sql) refs/refs/NACHC-fhir-to-omop/src/main/resources/sqlserver/omop/5.4/location/create-location-and-caresite-dummy-records.sql — Creates single dummy location (id=1) for all unresolved references.