Implementation Guide
TIFlow - Verordnungen für Arzneimittel
Version 2.0.0-ballot.2 - ballot

## StructureMap: KBVPrErpMedicationFreetextMap

Official URL: https://gematik.de/fhir/structure-comparer/StructureMap/KBVPrErpMedicationFreetextMap | Version: 2.0.0-ballot.2
Active as of 2026-02-02 | Computable Name: KBVPrErpMedicationFreetextMap

Auto-generated StructureMap for KBV_PR_ERP_Medication_FreeText | 1.4.0 -> EPAMedication | 1.3.0

### Feld-Mappings

Quelle (Eingangsdaten) | Ziel (Ausgabedaten) | Aktion | Transformation & Beschreibung
--- | --- | --- | ---
`KBVPRERPMedicationFreeText` | `EPAMedication.extension` | Manuell | Fester Wert: 781405001, Medicinal product package (product) | Quelle: Medication.extension:type
`KBVPRERPMedicationFreeText.meta` | `EPAMedication.meta.profile` | Fester Wert | setzt festen Wert: `https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication`

### Extensions

#### Extension: KBV_EX_ERP_Medication_Category

Bedingung: url = `https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category`

Quelle (Eingangsdaten) | Ziel (Ausgabedaten) | Aktion | Transformation & Beschreibung
--- | --- | --- | ---
`KBVPRERPMedicationFreeText.extension` `[Bedingung: url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category']` | `EPAMedication.extension.url` | Fester Wert | setzt festen Wert: `https://gematik.de/fhir/epa-medication/StructureDefinition/drug-category-extension`

#### Extension: KBV_EX_ERP_Medication_Vaccine

Bedingung: url = `https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Vaccine`

Quelle (Eingangsdaten) | Ziel (Ausgabedaten) | Aktion | Transformation & Beschreibung
--- | --- | --- | ---
`KBVPRERPMedicationFreeText.extension` `[Bedingung: url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Vaccine']` | `EPAMedication.extension.url` | Fester Wert | setzt festen Wert: `https://gematik.de/fhir/epa-medication/StructureDefinition/medication-id-vaccine-extension`

    map "https://gematik.de/fhir/structure-comparer/StructureMap/KBVPrErpMedicationFreetextMap" = "KBVPrErpMedicationFreetextMap"

    // Auto-generated StructureMap for KBV_PR_ERP_Medication_FreeText|1.4.0 -> EPAMedication|1.3.0

    uses "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_FreeText" alias KBVPRERPMedicationFreeText as source
    uses "https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication" alias EPAMedication as target

    // Mapping generated for KBV_PR_ERP_Medication_FreeText|1.4.0 -> EPAMedication|1.3.0
    group KBVPrErpMedicationFreetextMap(source KBVPRERPMedicationFreeText : KBVPRERPMedicationFreeText, target EPAMedication : EPAMedication) <<types>> {
      KBVPRERPMedicationFreeText.batch as srcKBVPRERPMedicationFreeTextBatchb0aceee1 -> EPAMedication.batch = srcKBVPRERPMedicationFreeTextBatchb0aceee1 as tgtEPAMedicationBatch90ce2ac1 "MedicationBatch235a7d75"; // Copied to 'Medication.batch'
      KBVPRERPMedicationFreeText.code as srcKBVPRERPMedicationFreeTextCode4b0e0f30 -> EPAMedication.code = srcKBVPRERPMedicationFreeTextCode4b0e0f30 as tgtEPAMedicationCodea6251800 "MedicationCoded98e85bf"; // Automatic copy
      KBVPRERPMedicationFreeText.extension as srcKBVPRERPMedicationFreeTextExtensionb00bf49a where url != 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category' and url != 'normSizeCode' and url != 'http://fhir.de/StructureDefinition/normgroesse' and url != 'Impfstoff' and url != 'https://fhir.kbv.de/StructureDefinition/KBV_EX_Base_Medication_Type' and url != 'valueBoolean' and url != 'packaging' and url != 'valueCoding' and url != 'type' and url != 'Normgroesse' and url != 'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-id-vaccine-extension' and url != 'manufacturingInstructions' and url != 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Vaccine' and url != 'Kategorie' and url != 'https://gematik.de/fhir/epa-medication/StructureDefinition/drug-category-extension' and url != 'drugCategory' and url != 'rxPrescriptionProcessIdentifier' and url != 'Arzneimittelkategorie' and url != 'isVaccine' -> EPAMedication.extension = srcKBVPRERPMedicationFreeTextExtensionb00bf49a as tgtEPAMedicationExtension59cd7688 "MedicationExtension9f8d5121"; // Automatic copy
      KBVPRERPMedicationFreeText.extension as srcKBVPRERPMedicationFreeTextExtensionArzneimittelkategoriefdd08 where url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category' and url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category' ->  EPAMedication.extension = create('Extension') as tgtEPAMedicationExtensionDrugcategory059b5c6b,  tgtEPAMedicationExtensionDrugcategory059b5c6b.url = 'https://gematik.de/fhir/epa-medication/StructureDefinition/drug-category-extension' then {
        srcKBVPRERPMedicationFreeTextExtensionArzneimittelkategoriefdd08.value as srcMedicationExtensionDrugcategoryValueXbd04993e -> tgtEPAMedicationExtensionDrugcategory059b5c6b.value = create('Coding') as tgtMedicationExtensionDrugcategoryValueXbd04993e then {
          srcMedicationExtensionDrugcategoryValueXbd04993e.code as srcMedicationExtensionDrugcategoryValueXCodec72163f2 -> tgtMedicationExtensionDrugcategoryValueXbd04993e.code = srcMedicationExtensionDrugcategoryValueXCodec72163f2 as tgtMedicationExtensionDrugcategoryValueXCodec72163f2 "MedicationExtensionDrugcategoryValueXCodec72163f2"; // Copied drugCategory code
        } "MedicationExtensionDrugcategoryValueXbd04993e"; // Copied from 'Medication.extension:Arzneimittelkategorie.value[x]'
      } "MedicationExtensionDrugcategorye963e601"; // Copied from 'Medication.extension:Arzneimittelkategorie'
      KBVPRERPMedicationFreeText.extension as srcKBVPRERPMedicationFreeTextExtensionImpfstoff0967a597 where url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Vaccine' and url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Vaccine' ->  EPAMedication.extension = create('Extension') as tgtEPAMedicationExtensionIsvaccinea7742b5a,  tgtEPAMedicationExtensionIsvaccinea7742b5a.url = 'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-id-vaccine-extension' then {
        srcKBVPRERPMedicationFreeTextExtensionImpfstoff0967a597.value as srcMedicationExtensionIsvaccineValueXac9b8b1e -> tgtEPAMedicationExtensionIsvaccinea7742b5a.value = srcMedicationExtensionIsvaccineValueXac9b8b1e as tgtMedicationExtensionIsvaccineValueXac9b8b1e "MedicationExtensionIsvaccineValueXac9b8b1e"; // Copied from 'Medication.extension:Impfstoff.value[x]'
      } "MedicationExtensionIsvaccine98c25b06"; // Copied from 'Medication.extension:Impfstoff'
      KBVPRERPMedicationFreeText as manualsrcMedicationExtensionType61374588 -> EPAMedication.extension as tgtEPAMedicationExtensionType1a2ef415 "MedicationExtensionType61374588"; // Manual action required | Fester Wert: 781405001, Medicinal product package (product) | Quelle: Medication.extension:type
      KBVPRERPMedicationFreeText.form as srcKBVPRERPMedicationFreeTextForm27d26e2d -> EPAMedication.form = srcKBVPRERPMedicationFreeTextForm27d26e2d as tgtEPAMedicationForm691ed321 "MedicationForm5a0bbd5f"; // Automatic copy
      KBVPRERPMedicationFreeText.meta as srcKBVPRERPMedicationFreeTextMeta8de074d5 -> EPAMedication.meta = create('Meta') as tgtEPAMedicationMeta8591b307 then {
        srcKBVPRERPMedicationFreeTextMeta8de074d5 as srcMedicationMetaProfile399adfc6 -> tgtEPAMedicationMeta8591b307.profile = 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication' as tgtMedicationMetaProfile399adfc6 "MedicationMetaProfile399adfc6"; // Fixed value 'https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication'
      } "MedicationMetaf9f176bc"; // Automatic copy
    }