Implementation Guide
E-T-Rezept Datenaustausch
Version 1.1.0-ballot-1 - ballot

StructureMap: E-T-Rezept Structure Map for Organization

Official URL: https://gematik.de/fhir/erp-t-prescription/StructureMap/ERPTPrescriptionStructureMapOrganization Version: 1.1.0-ballot-1
Draft as of 2025-07-07 Computable Name: ERPTPrescriptionStructureMapOrganization

Mapping-Anweisungen zur Erstellung einer BfArM Organization aus dem VZD SearchSet

map "https://gematik.de/fhir/erp-t-prescription/StructureMap/ERPTPrescriptionStructureMapOrganization" = "ERPTPrescriptionStructureMapOrganization"

// Mapping-Anweisungen zur Erstellung einer BfArM Organization aus dem VZD SearchSet

uses "https://gematik.de/fhir/erp-t-prescription/StructureDefinition/erp-tprescription-vzd-searchset" alias vzdSearchSet as source
uses "https://gematik.de/fhir/erp-t-prescription/StructureDefinition/erp-tprescription-organization" alias bfarmOrganization as target

// Mapping-Anweisungen zur Erstellung einer BfArM Organization aus dem VZD SearchSet
group ERPTPrescriptionStructureMapOrganization(source vzdSearchSet : vzdSearchSet, target bfarmOrganization : bfarmOrganization) {
  vzdSearchSet.entry as srcEntryOrgVar then {
    srcEntryOrgVar.resource as srcEntryOrganizationVar where ofType(Organization) then {
      srcEntryOrganizationVar.name as srcOrgNameVar -> bfarmOrganization.name = srcOrgNameVar; // Übernimmt den Namen der Organisation aus dem VZD in die BfArM Organization
      srcEntryOrganizationVar.identifier as srcOrgIdentifierVar where $this.system='https://gematik.de/fhir/sid/telematik-id' -> bfarmOrganization.identifier as bfarmOrganizationIdentifierVar then {
        srcOrgIdentifierVar.value as srcOrgIdentifierValueVar log tgtTidIdentifier ->  bfarmOrganizationIdentifierVar.system = 'https://gematik.de/fhir/sid/telematik-id',  bfarmOrganizationIdentifierVar.value = srcOrgIdentifierValueVar "tidValue"; // Kopiert die Telematik-ID mit korrektem System-Identifier in die Ziel-Organisation
      } "tid"; // Mappt die Telematik-ID der Organisation
    } "entry"; // Verarbeitet jeden Eintrag im SearchSet
  } "mapOrganization"; // Mappt Organization-Einträge aus dem VZD SearchSet
  vzdSearchSet.entry as srcEntryHCSVar then {
    srcEntryHCSVar.resource as srcEntryHealthcareServiceVar where ofType(HealthcareService) then {
      srcEntryHealthcareServiceVar.telecom as srcHcsTelecomVar -> bfarmOrganization.telecom = srcHcsTelecomVar; // Übernimmt Kontaktinformationen (Telefon, E-Mail) aus dem HealthcareService in die Organisation
    } "entry"; // Verarbeitet HealthcareService-Einträge aus dem SearchSet
  } "mapHealthcareService"; // Mappt HealthcareService-Informationen für Kontaktdaten
  vzdSearchSet.entry as srcEntryHCSVar then {
    srcEntryHCSVar.resource as srcEntryLocationVar where ofType(Location) then {
      srcEntryLocationVar.address as srcLocationAddressVar -> bfarmOrganization.address = srcLocationAddressVar; // Übernimmt die Adressinformationen aus der Location in die Organisation
    } "entry"; // Verarbeitet Location-Einträge aus dem SearchSet
  } "mapLocation"; // Mappt Location-Informationen für Adressdaten
}