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 · id
    PKrequired
    Surrogate key. Each unique address should be assigned a unique key. fhir-to-omop-demo uses Location.id directly.
    3 sources ▾
  • address_1 Location.address.line[0] varchar(50) · string
    First line of street address.
  • address_2 Location.address.line[1] varchar(50) · string
    Second line of street address. If more than 2 address lines, concatenate third+ into address_2 or drop them.
  • city Location.address.city varchar(50) · string
    City.
  • state Location.address.state varchar(2) · string
    State. May need normalization (e.g., 'California' -> 'CA'). varchar(2) may force lossy mapping for international locations.
  • zip Location.address.postalCode varchar(9) · string
    3-, 5-, or 9-digit US zip; international codes also allowed. Truncate if >9 chars.
  • county Location.address.district varchar(20) · string
    FHIR district is the closest analog to OMOP county.
  • location_source_value Location.id varchar(50) · string
    Verbatim source identifier or full address text (Location.address.text) for traceability.
    2 sources ▾
  • country_concept_id Location.address.country integer · string
    FK→CONCEPT
    transform:map(Location.address.country, Geography domain)
    Mapped to OMOP Geography domain concept. 0 if unmapped.
    1 source ▾
  • country_source_value Location.address.country varchar(80) · string
    Country name verbatim.
  • latitude Location.position.latitude float · decimal
    Must be between -90 and 90.
  • longitude Location.position.longitude float · decimal
    Must 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