Data Management with FHIR
0.1.0 - ci-build

Data Management with FHIR - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

## StructureMap: Mapping Patient resource to Location OMOP Domain

Official URL: https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPLocation | Version: 0.1.0
Draft as of 2025-10-23 | Computable Name: CoreFHIR2OMOPLocation

Mapping Patient resource to Location OMOP Domain

    map "https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPLocation" = "CoreFHIR2OMOPLocation"

    // Mapping Patient resource to Location OMOP Domain

    uses "http://hl7.org/fhir/StructureDefinition/Address" alias Address as source
    uses "https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/OMOPLocation" alias LocationTable as target

    group Location(source src : Address, target tgt : LocationTable) {
      src.line first as srcLine1 -> tgt.address_1 = srcLine1 "setLineOne";
      src.line not_first as srcLine2 -> tgt.address_2 = srcLine2 "setLineTwo";
      src.city as srcCity -> tgt.city = srcCity "setCity";
      src.postalCode as srcZip -> tgt.zip = srcZip "setZip";
      src.country as srcCountry -> tgt.country_source_value = srcCountry "setCountry";
      src.text as srcText -> tgt.location_source_value = truncate(srcText, 50) "setVerbatim";
      src.extension as geolocation where (url = 'http://hl7.org/fhir/StructureDefinition/geolocation') then {
        geolocation.extension as latitude where (url = 'latitude') -> tgt.latitude = (%latitude.value) "setLatitude";
        geolocation.extension as longitude where (url = 'longitude') -> tgt.longitude = (%longitude.value) "setLongitude";
      } "setGeolocation";
    }