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

## StructureMap: KBVPrErpMedicationCompoundingMap

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

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

### Feld-Mappings

Quelle (Eingangsdaten) | Ziel (Ausgabedaten) | Aktion | Transformation & Beschreibung
--- | --- | --- | ---
`KBVPRERPMedicationCompounding` | `EPAMedication.extension` | Manuell | Fester Wert: 781405001, Medicinal product package (product) | Quelle: Medication.extension:type

### Extensions

#### Extension: KBV_EX_Base_Medication_Type

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

Quelle (Eingangsdaten) | Ziel (Ausgabedaten) | Aktion | Transformation & Beschreibung
--- | --- | --- | ---
`KBVPRERPMedicationCompounding.extension` `[Bedingung: url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_Base_Medication_Type']` | `EPAMedication.extension` | Nicht Übertragen | Feld wird nicht gemappt | Quelle: Medication.extension:Kategorie

#### 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
--- | --- | --- | ---
`KBVPRERPMedicationCompounding.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`
`KBVPRERPMedicationCompounding.extension.value` `[Bedingung: url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category']` | `EPAMedication.extension.value.system` | Fester Wert | setzt festen Wert: `https://gematik.de/fhir/epa-medication/CodeSystem/epa-drug-category-cs`

#### 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
--- | --- | --- | ---
`KBVPRERPMedicationCompounding.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`

#### Extension: KBV_EX_ERP_Medication_CompoundingInstruction

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

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

#### Extension: normgroesse

Bedingung: url = `http://fhir.de/StructureDefinition/normgroesse`

Quelle (Eingangsdaten) | Ziel (Ausgabedaten) | Aktion | Transformation & Beschreibung
--- | --- | --- | ---
`KBVPRERPMedicationCompounding.extension` `[Bedingung: url = 'http://fhir.de/StructureDefinition/normgroesse']` | `EPAMedication.extension.url` | Fester Wert | setzt festen Wert: `http://fhir.de/StructureDefinition/normgroesse`

#### Extension: KBV_EX_ERP_Medication_Packaging

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

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

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

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

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

    // Mapping generated for KBV_PR_ERP_Medication_Compounding|1.4.0 -> EPAMedication|1.3.0
    group KBVPrErpMedicationCompoundingMap(source KBVPRERPMedicationCompounding : KBVPRERPMedicationCompounding, target EPAMedication : EPAMedication) <<types>> {
      KBVPRERPMedicationCompounding.amount as srcKBVPRERPMedicationCompoundingAmount143a90a8 -> EPAMedication.amount = srcKBVPRERPMedicationCompoundingAmount143a90a8 as tgtEPAMedicationAmount30d45c22 "MedicationAmountac45bfbc"; // Automatic copy
      KBVPRERPMedicationCompounding.batch as srcKBVPRERPMedicationCompoundingBatch76856f17 -> EPAMedication.batch = srcKBVPRERPMedicationCompoundingBatch76856f17 as tgtEPAMedicationBatch90ce2ac1 "MedicationBatch235a7d75"; // Copied to 'Medication.batch'
      KBVPRERPMedicationCompounding.code as srcKBVPRERPMedicationCompoundingCode19fc48cb -> EPAMedication.code = srcKBVPRERPMedicationCompoundingCode19fc48cb as tgtEPAMedicationCodea6251800 "MedicationCoded98e85bf"; // Automatic copy
      KBVPRERPMedicationCompounding.extension as srcKBVPRERPMedicationCompoundingExtension3e44d0a1 where url != 'valueString' and url != 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_CompoundingInstruction' and url != 'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-manufacturing-instructions-extension' and 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://gematik.de/fhir/epa-medication/StructureDefinition/medication-formulation-packaging-extension' and url != 'https://fhir.kbv.de/StructureDefinition/KBV_EX_Base_Medication_Type' and url != 'valueBoolean' and url != 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Packaging' and url != 'valueCodeableConcept' and url != 'packaging' and url != 'valueCoding' and url != 'Herstellungsanweisung' and url != 'type' and url != 'Verpackung' 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 = srcKBVPRERPMedicationCompoundingExtension3e44d0a1 as tgtEPAMedicationExtension59cd7688 "MedicationExtension9f8d5121"; // Automatic copy
      KBVPRERPMedicationCompounding.extension where url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_Base_Medication_Type' -> EPAMedication.extension "MedicationExtensionKategorie86255b0b"; // Feld wird nicht gemappt | Quelle: Medication.extension:Kategorie
      KBVPRERPMedicationCompounding.extension as srcKBVPRERPMedicationCompoundingExtensionArzneimittelkatego82a24 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 {
        srcKBVPRERPMedicationCompoundingExtensionArzneimittelkatego82a24.value as srcMedicationExtensionDrugcategoryValueXbd04993e -> tgtEPAMedicationExtensionDrugcategory059b5c6b.value = create('Coding') as tgtMedicationExtensionDrugcategoryValueXbd04993e then {
          srcMedicationExtensionDrugcategoryValueXbd04993e as srcMedicationExtensionDrugcategoryValueXSystem2cf01aef -> tgtMedicationExtensionDrugcategoryValueXbd04993e.system = 'https://gematik.de/fhir/epa-medication/CodeSystem/epa-drug-category-cs' as tgtMedicationExtensionDrugcategoryValueXSystem2cf01aef "MedicationExtensionDrugcategoryValueXSystem2cf01aef"; // Fixed value 'https://gematik.de/fhir/epa-medication/StructureDefinition/drug-category-extension'
          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'
      KBVPRERPMedicationCompounding.extension as srcKBVPRERPMedicationCompoundingExtensionImpfstoffb07a0850 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 {
        srcKBVPRERPMedicationCompoundingExtensionImpfstoffb07a0850.value as srcMedicationExtensionIsvaccineValueXac9b8b1e -> tgtEPAMedicationExtensionIsvaccinea7742b5a.value = srcMedicationExtensionIsvaccineValueXac9b8b1e as tgtMedicationExtensionIsvaccineValueXac9b8b1e "MedicationExtensionIsvaccineValueXac9b8b1e"; // Copied from 'Medication.extension:Impfstoff.value[x]'
      } "MedicationExtensionIsvaccine98c25b06"; // Copied from 'Medication.extension:Impfstoff'
      KBVPRERPMedicationCompounding.extension as srcKBVPRERPMedicationCompoundingExtensionHerstellungsanweisa314d where url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_CompoundingInstruction' and url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_CompoundingInstruction' ->  EPAMedication.extension = create('Extension') as tgtEPAMedicationExtensionManufacturinginstructionsb88614b8,  tgtEPAMedicationExtensionManufacturinginstructionsb88614b8.url = 'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-manufacturing-instructions-extension' then {
        srcKBVPRERPMedicationCompoundingExtensionHerstellungsanweisa314d.value as srcMedicationExtensionManufacturinginstructionsValueXb1e426a8 -> tgtEPAMedicationExtensionManufacturinginstructionsb88614b8.value = srcMedicationExtensionManufacturinginstructionsValueXb1e426a8 as tgtMedicationExtensionManufacturinginstructionsValueXb1e426a8 "MedicationExtensionManufacturinginstructionsValueXb1e426a8"; // Copied from 'Medication.extension:Herstellungsanweisung.value[x]'
      } "MedicationExtensionManufacturinginstructionsa59676ae"; // Copied from 'Medication.extension:Herstellungsanweisung'
      KBVPRERPMedicationCompounding.extension as srcKBVPRERPMedicationCompoundingExtensionNormgroesse892c3ca8 where url = 'http://fhir.de/StructureDefinition/normgroesse' and url = 'http://fhir.de/StructureDefinition/normgroesse' ->  EPAMedication.extension = create('Extension') as tgtEPAMedicationExtensionNormsizecode7bd0a39d,  tgtEPAMedicationExtensionNormsizecode7bd0a39d.url = 'http://fhir.de/StructureDefinition/normgroesse' "MedicationExtensionNormsizecode34ece564"; // Copied from 'Medication.extension:Normgroesse'
      KBVPRERPMedicationCompounding.extension as srcKBVPRERPMedicationCompoundingExtensionVerpackung0c3db7a5 where url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Packaging' and url = 'https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Packaging' ->  EPAMedication.extension = create('Extension') as tgtEPAMedicationExtensionPackaging63847a7e,  tgtEPAMedicationExtensionPackaging63847a7e.url = 'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-formulation-packaging-extension' then {
        srcKBVPRERPMedicationCompoundingExtensionVerpackung0c3db7a5.value as srcMedicationExtensionPackagingValueX38da2ad0 -> tgtEPAMedicationExtensionPackaging63847a7e.value = srcMedicationExtensionPackagingValueX38da2ad0 as tgtMedicationExtensionPackagingValueX38da2ad0 "MedicationExtensionPackagingValueX38da2ad0"; // Copied from 'Medication.extension:Verpackung.value[x]'
      } "MedicationExtensionPackaging2ff6a765"; // Copied from 'Medication.extension:Verpackung'
      KBVPRERPMedicationCompounding as manualsrcMedicationExtensionType61374588 -> EPAMedication.extension as tgtEPAMedicationExtensionType1a2ef415 "MedicationExtensionType61374588"; // Manual action required | Fester Wert: 781405001, Medicinal product package (product) | Quelle: Medication.extension:type
      KBVPRERPMedicationCompounding.form as srcKBVPRERPMedicationCompoundingFormc5146e0b -> EPAMedication.form = srcKBVPRERPMedicationCompoundingFormc5146e0b as tgtEPAMedicationForm691ed321 "MedicationForm5a0bbd5f"; // Automatic copy
      KBVPRERPMedicationCompounding.ingredient as srcKBVPRERPMedicationCompoundingIngredient3e616846 -> EPAMedication.ingredient = create('BackboneElement') as tgtEPAMedicationIngredient78db398c "MedicationIngredient801affef"; // Automatic copy
    }