| Official URL: https://gematik.de/fhir/tiflow-bfarm/StructureMap/ERPTPrescriptionStructureMapCarbonCopy | Version: 2.0.0 | |||
| Active as of 2026-10-02 | Computable Name: ERPTPrescriptionStructureMapCarbonCopy | |||
Diese Ressource beschreibt das Mapping und führt die Mappings aller Teilressourcen zusammen. Weitere Informationen und Beschreibungen zum Mapping können auf der Seite Mapping des digitalen Durchschlag E-T-Rezept eingesehen werden.
map "https://gematik.de/fhir/tiflow-bfarm/StructureMap/ERPTPrescriptionStructureMapCarbonCopy" = "ERPTPrescriptionStructureMapCarbonCopy" // Diese Ressource beschreibt das Mapping und führt die Mappings aller Teilressourcen zusammen. Weitere Informationen und Beschreibungen zum Mapping können auf der Seite [Mapping des digitalen Durchschlag E-T-Rezept](./menu-technische-umsetzung-mapping.html#mapping-des-digitalen-durchschlags-e-t-rezept) eingesehen werden. uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias bundle as source uses "https://gematik.de/fhir/tiflow-bfarm/StructureDefinition/erp-tprescription-carbon-copy" alias erpTCarbonCopy as target imports "https://gematik.de/fhir/tiflow-bfarm/StructureMap/ERPTPrescriptionStructureMapMedicationDispense" imports "https://gematik.de/fhir/tiflow-bfarm/StructureMap/ERPTPrescriptionStructureMapMedicationRequest" imports "https://gematik.de/fhir/tiflow-bfarm/StructureMap/ERPTPrescriptionStructureMapOrganization" imports "https://gematik.de/fhir/tiflow-bfarm/StructureMap/ERPTPrescriptionStructureMapTask" imports "https://gematik.de/fhir/tiflow-bfarm/StructureMap/ERPTPrescriptionStructureMapMedication" // Mapping des digitalen Durchschlags T-Rezept aus einem E-Rezept Bundle in das BfArM CarbonCopy Format group erpTPrescriptionCarbonCopy(source bundle : bundle, target erpTCarbonCopy : erpTCarbonCopy) { // Setzt die Metadaten für den digitalen Durchschlag bundle -> erpTCarbonCopy.meta as erpTCarbonCopyMeta then { // Setzt das meta.profile des digitalen Durchschlags T-Rezept bundle -> erpTCarbonCopyMeta.profile = 'https://gematik.de/fhir/tiflow/bfarm/StructureDefinition/erp-tprescription-carbon-copy|1.1' "tgtMetaProfile"; } "tgtMeta"; // Erstellt den rxPrescription Parameter mit allen Verschreibungsinformationen bundle -> erpTCarbonCopy.parameter as tgtRxPrescription, tgtRxPrescription.part as tgtRxPrescriptionPartId, tgtRxPrescription.part as tgtRxPrescriptionPartMR, tgtRxPrescription.part as tgtRxPrescriptionPartMed, tgtRxPrescription.name = 'rxPrescription' then { // Verarbeitet alle Einträge des Quell-Bundles für Verschreibungsinformationen bundle.entry as srcEntryVar then { // Extrahiert relevante Ressourcen für die Verschreibung srcEntryVar.resource as srcEntryResourceVar then { // Extrahiert die E-Rezept-ID aus dem Task und erstellt den prescriptionId Parameter srcEntryVar.resource : Task as srcEntryTaskVar where (ofType(Task)) -> tgtRxPrescriptionPartId.name = 'prescriptionId', tgtRxPrescriptionPartId.value = create('Identifier') as newIdentifier then { // Mappt Task-Informationen auf Identifier für die Rezept-ID srcEntryTaskVar then ERPTPrescriptionStructureMapTask(srcEntryTaskVar, newIdentifier) "parameterrXPrescriptionPartIdentifier"; } "parameterrXPrescriptionPart"; // Erstellt den medicationRequest Parameter für Verschreibungsdetails srcEntryVar.resource : MedicationRequest as srcEntryBundleMRVar where (ofType(MedicationRequest)) -> tgtRxPrescriptionPartMR.name = 'medicationRequest' then { // Transformiert KBV-MedicationRequest in BfArM MedicationRequest Format srcEntryBundleMRVar -> tgtRxPrescriptionPartMR.resource = create('MedicationRequest') as newMedicationRequest then { // Führt die detaillierte MedicationRequest-Transformation durch srcEntryBundleMRVar then ERPTPrescriptionStructureMapMedicationRequest(srcEntryBundleMRVar, newMedicationRequest) "entryMedicationRequestPartResourceSet"; } "entryMedicationRequestPart"; } "entryMedicationRequest"; // Erstellt den medication Parameter für das verschriebene Arzneimittel srcEntryVar as srcMedicationRequestId where (resource.ofType(MedicationRequest)) -> tgtRxPrescriptionPartMed.name = 'medication' then { // Bereitet die Suche nach der referenzierten Medication vor bundle.entry as srcEntryVar2 then { // Findet die vom MedicationRequest referenzierte Medication und transformiert sie in BfArM Format srcEntryVar2 as srcEntryBundleMRMedIdVar where (resource.ofType(Medication).where(id=%srcMedicationRequestId.resource.medication.reference.replace('urn:uuid:', '').split('/').last())) -> tgtRxPrescriptionPartMed.resource = create('Medication') as newMedicationPrescriptionMedication then { // Führt die detaillierte Medication-Transformation für das verschriebene Arzneimittel durch srcEntryBundleMRMedIdVar.resource : Medication as srcEntryBundleMRMedIdVarRes then ERPTPrescriptionStructureMapMedication(srcEntryBundleMRMedIdVarRes, newMedicationPrescriptionMedication) "entryMedicationPrescriptionMedicationPartResourceSet"; } "entryMedicationPrescriptionMedicationPart"; } "prepMedication"; } "entryMedicationRequestMedication"; } "rxPrescriptionParameter"; } "bundleEntries"; } "rxPrescriptionRule"; // Erstellt den rxDispensation Parameter mit allen Abgabeinformationen bundle -> erpTCarbonCopy.parameter as tgtRxDispensation, tgtRxDispensation.part as tgtRxDispensationPartOrg, tgtRxDispensation.name = 'rxDispensation' then { // Verarbeitet alle Einträge des Quell-Bundles für Abgabeinformationen bundle.entry as srcEntryVar then { // Extrahiert relevante Ressourcen für die Abgabe srcEntryVar.resource as srcEntryResourceVar then { // Identifiziert VZD SearchSet Bundle für Apothekeninformationen srcEntryVar.resource : Bundle as srcEntryBundleOrgVar where (ofType(Bundle).where(entry.first().fullUrl.contains('fhir-directory'))) -> tgtRxDispensationPartOrg.name = 'dispenseOrganization' then { // Transformiert VZD SearchSet in BfArM Organization Format für die abgebende Apotheke srcEntryBundleOrgVar -> tgtRxDispensationPartOrg.resource = create('Organization') as newOrganization then { // Führt die detaillierte Organization-Transformation durch srcEntryBundleOrgVar then ERPTPrescriptionStructureMapOrganization(srcEntryBundleOrgVar, newOrganization) "entryOrganizationPartResourceSet"; } "entryOrganizationPart"; } "entryVZDSearchSet"; // Erstellt eine dispenseInformation Part pro abgegebener MedicationDispense srcEntryVar.resource : MedicationDispense as srcEntryBundleMDVar where (ofType(MedicationDispense)) -> tgtRxDispensation.part as tgtDispenseInformationPart then { // Bündelt MedicationDispense und zugehörige Medication unter dispenseInformation srcEntryBundleMDVar -> tgtDispenseInformationPart.name = 'dispenseInformation', tgtDispenseInformationPart.part as tgtDispenseInformationMedDispPart, tgtDispenseInformationPart.part as tgtDispenseInformationMedicationPart then { // Transformiert gematik MedicationDispense in BfArM MedicationDispense Format srcEntryBundleMDVar -> tgtDispenseInformationMedDispPart.name = 'medicationDispense', tgtDispenseInformationMedDispPart.resource = create('MedicationDispense') as newMedicationDispense then { // Führt die detaillierte MedicationDispense-Transformation durch srcEntryBundleMDVar then ERPTPrescriptionStructureMapMedicationDispense(srcEntryBundleMDVar, newMedicationDispense) "entryMedicationDispensePartResourceSet"; } "entryDispenseInformationMedicationDispense"; // Findet die vom MedicationDispense referenzierte Medication und transformiert sie in BfArM Format srcEntryBundleMDVar -> tgtDispenseInformationMedicationPart.name = 'medication' then { // Bereitet die Suche nach der referenzierten Medication im Bundle vor bundle.entry as srcEntryVarDisp then { srcEntryVarDisp as srcEntryBundleMDMedIdVar where (resource.ofType(Medication).where(id=%srcEntryBundleMDVar.medicationReference.reference.replace('urn:uuid:', '').split('/').last())) -> tgtDispenseInformationMedicationPart.resource = create('Medication') as newMedicationDispensationMedication then { // Führt die detaillierte Medication-Transformation für das abgegebene Arzneimittel durch srcEntryBundleMDMedIdVar.resource : Medication as srcEntryBundleMDMedIdVarRes then ERPTPrescriptionStructureMapMedication(srcEntryBundleMDMedIdVarRes, newMedicationDispensationMedication) "entryMedicationDispensationMedicationPartResourceSet"; } "entryDispenseMedicationPart"; } "prepDispenseMedication"; } "entryDispenseInformationMedication"; } "entryDispenseInformation"; } "entryMedicationDispense"; } "rxDispensationParameter"; } "bundleEntries"; } "MedicationDispenseFromBundle"; }