Location
→
care_site
documented
Secondary pattern: some implementations (notably fhir-to-omop-demo) create a care_site row from each FHIR Location resource, in addition to the primary care_site row from Organization. The Location-derived care_site row carries the location_id (linking to the location row from the same Location resource) while the Organization-derived row carries the name and place_of_service. The two rows share the same care_site_id and must be merged downstream. This pattern is NOT used by omoponfhir-v54, ETL-German, or NACHC.
Conversion profile
omop-location-care-site
A FHIR instance converts to care_site iff it validates against this profile.
| Path | Card | Type | Binding / Fixed | Comment |
|---|---|---|---|---|
| Location.identifier | 1..*MS | At least one identifier — used as care_site.care_site_source_value when this row is the primary care_site source. | ||
| Location.physicalType | 1..1MS | fhir/location-physical-typerequired | ||
| Location.managingOrganization | 1..1MS | Reference | Resolves to the Organization-derived care_site_id; the Location-derived care_site row shares this ID. |
ViewDefinition (Stage 1 flattener)
omop-location-care-site
2 columns · resource Location
| column name | FHIRPath | type |
|---|---|---|
| id | Location.id | id |
| address_id | Location.id | id |
Condition: Location.managingOrganization is present
Fields (6)
-
care_site_id←Location.managingOrganization.referenceinteger · Reference(Organization)PKrequiredResolves to the Organization's care_site_id. Same care_site_id as the row produced by Organization -> care_site. The two rows describe the same care site.1 source ▾
-
Derives care_site_id from managingOrganization reference; same ID as Organization-derived row — only fhir-to-omop-demo uses this dual-row pattern
- fhir-to-omop-demo(jq) refs/refs/fhir-to-omop-demo/demo/translate/map/Location.jq:10-33 — care_site_id from managingOrganization reference
-
-
care_site_name← — varchar(255) · stringTypically null on this row. Set by the Organization-derived care_site row, not this one. -
place_of_service_concept_id← — integer · CodeableConceptFK→CONCEPTTypically null on this row. Set by the Organization-derived care_site row, not this one. -
location_id←Location.idinteger · idFK→LOCATIONPoints to the location row produced from this same Location resource (see Location__location edge).1 source ▾
-
Sets location_id = Location.id on the second care_site row, linking back to the location row from the same resource — unique to fhir-to-omop-demo dual-row pattern
- fhir-to-omop-demo(jq) refs/refs/fhir-to-omop-demo/demo/translate/map/Location.jq:31-39 — Second care_site row; location_id = .id (line 36)
-
-
care_site_source_value← — varchar(50) · stringTypically null on this row. Set by the Organization-derived care_site row. -
place_of_service_source_value← — varchar(50) · stringTypically null on this row. Set by the Organization-derived care_site row.
Edge Cases
Location.managingOrganization absent
No care_site_id available -- skip the care_site row. The location row is still emitted via the Location__location edge.
Location.managingOrganization references Organization not in bundle
Deferred resolution. Stub care_site_id; resolve when Organization arrives.
Multiple Locations under the same managingOrganization
Each Location emits a care_site row with the same care_site_id. Without merge, this produces duplicates -- a single Organization with N Locations yields 1 + N care_site rows.
Location with no address but with managingOrganization
care_site row emitted but location_id points at a sparse location row (lat/lng only or empty).
Location with address but no managingOrganization
location row only -- no care_site row from this edge.
Duplicate care_site rows from Organization and Location
Merge before insert: group rows by care_site_id and coalesce non-null fields (name from Organization row, location_id from Location row). Or pick Organization row authoritatively and lose location_id linkage.
Reference Implementations
- fhir-to-omop-demo(jq) refs/refs/fhir-to-omop-demo/demo/translate/map/Location.jq — Second care_site row from Location resource: lines 31-39. care_site_id from managingOrganization (line 10, 33), location_id = .id (line 36).
- fhir-to-omop-demo(jq) refs/refs/fhir-to-omop-demo/demo/translate/map/Organization.jq — Organization-derived care_site row (no location_id): lines 11-22. location_id null in this row (line 17).