Guide d'implémentation du GT Standards et Interopérabilité pour les EDS
0.1.0 - ci-build France flag

Guide d'implémentation du GT Standards et Interopérabilité pour les EDS - 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.esante.gouv.fr/ig/fhir/eds/StructureMap/Location Version: 0.1.0
Draft as of 2024-10-08 Computable Name: Location

Mapping Patient resource to Location OMOP Domain

Generated Narrative: StructureMap Location

map "https://interop.esante.gouv.fr/ig/fhir/eds/StructureMap/Location" = "Location"

// Mapping Patient resource to Location OMOP Domain

uses "http://hl7.org/fhir/StructureDefinition/Address" alias Address as source
uses "https://interop.esante.gouv.fr/ig/fhir/eds/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";
}