TIFlow - Datenaustausch BfArM Webdienst
Version 2.0.0-ballot.1 - ci-build

## StructureMap: E-T-Rezept Structure Map for KBV FreeText Medication

Official URL: https://gematik.de/fhir/erp-t-prescription/StructureMap/ERPTPrescriptionStructureMapKBVFreeTextMedication | Version: 2.0.0-ballot.1
Draft as of 2026-05-26 | Computable Name: ERPTPrescriptionStructureMapKBVFreeTextMedication

Maps KBV FreeText Medication to BfArM T-Prescription Medication format

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

    // Maps KBV FreeText Medication to BfArM T-Prescription Medication format

    uses "http://hl7.org/fhir/StructureDefinition/Medication" alias kbvMedicationFreeText as source
    uses "http://hl7.org/fhir/StructureDefinition/Medication" alias bfarmMedication as target

    // Mapping-Anweisungen zur Transformation von KBV Freitext-Medikamenten zu BfArM T-Prescription Format
    group ERPTPrescriptionStructureMapKBVFreeTextMedication(source kbvMedicationFreeText : kbvMedicationFreeText, target bfarmMedication : bfarmMedication) {
      kbvMedicationFreeText.id as IdVar -> bfarmMedication.id = IdVar "medicationId"; // Übernimmt die eindeutige Medication-ID unverändert
      kbvMedicationFreeText.code as srcCodeVar -> bfarmMedication.code as tgtCodeVar then {
        srcCodeVar.text as srcCodeTextVar -> tgtCodeVar.text = srcCodeTextVar "medicationCodeText"; // Kopiert die Freitext-Bezeichnung des Medikaments (z.B. 'Aspirin 500mg Tabletten')
      } "medicationCode"; // Mappt den Medikamentencode mit Freitext-Beschreibung
      kbvMedicationFreeText.form as srcFormVar -> bfarmMedication.form as tgtFormVar then {
        srcFormVar.text as srcformTextVar -> tgtFormVar.text = srcformTextVar "medicationFormText"; // Übernimmt die Freitext-Darreichungsform (z.B. 'Tabletten', 'Tropfen zum Einnehmen')
      } "medicationForm"; // Mappt die Darreichungsform als Freitext
    }