Implementation Guide
TIFlow - Datenaustausch BfArM Webdienst
Version 2.0.0 - release

: E-T-Rezept Structure Map for KBV Compounding Medication - TTL Representation

Active as of 2026-10-02

Raw ttl | Download

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://hl7.org/fhir/StructureMap/ERPTPrescriptionStructureMapKBVCompoundingMedication> a fhir:StructureMap ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:Resource.id [ fhir:value "ERPTPrescriptionStructureMapKBVCompoundingMedication"] ;
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ] ;
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap ERPTPrescriptionStructureMapKBVCompoundingMedication</b></p><a name=\"ERPTPrescriptionStructureMapKBVCompoundingMedication\"> </a><a name=\"hcERPTPrescriptionStructureMapKBVCompoundingMedication\"> </a><pre class=\"fml\">#xD;\n<b>map</b><span style=\"color: navy\"> \"</span>https://gematik.de/fhir/tiflow-bfarm/StructureMap/ERPTPrescriptionStructureMapKBVCompoundingMedication<span style=\"color: navy\">\" = \"</span>ERPTPrescriptionStructureMapKBVCompoundingMedication<span style=\"color: navy\">\"#xD;\n#xD;\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Mapping-Anweisungen zur Transformation von KBV Rezeptur-Medikamenten zu BfArM T-Prescription Format</span>#xD;\n#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/medication.html\" title=\"Medication\">http://hl7.org/fhir/StructureDefinition/Medication</a><span style=\"color: navy\">\" </span><b>alias </b>kbvMedicationCompounding <b>as </b><b>source</b>#xD;\n<b>uses</b><span style=\"color: navy\"> \"</span><a href=\"http://hl7.org/fhir/R4/medication.html\" title=\"Medication\">http://hl7.org/fhir/StructureDefinition/Medication</a><span style=\"color: navy\">\" </span><b>alias </b>bfarmMedication <b>as </b><b>target</b>#xD;\n#xD;\n<span style=\"color: navy\">// </span><span style=\"color: green\">Mapping-Anweisungen zur Transformation von KBV Rezeptur-Medikamenten zu BfArM T-Prescription Format</span>#xD;\n<b>group </b>ERPTPrescriptionStructureMapKBVCompoundingMedication<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">kbvMedicationCompounding</span><span style=\"color: navy\"> : </span>kbvMedicationCompounding, <b>target</b> <span style=\"color: maroon\">bfarmMedication</span><span style=\"color: navy\"> : </span>bfarmMedication<span style=\"color: navy\">)</span><span style=\"color: navy\"> {#xD;\n</span>  <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt Rezeptur-spezifische Extensions von KBV- zu BfArM-Format</span>#xD;\n  kbvMedicationCompounding.extension<b> as </b><span style=\"color: maroon\">extVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedication.extension<b> as </b><span style=\"color: maroon\">tgtExtVar</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Transformiert KBV-Verpackungs-Extension in gematik-Formulierungs-Verpackungs-Extension</span>#xD;\n    extVar<b> as </b><span style=\"color: maroon\">extMatchVar</span><b> where </b><span style=\"color: navy\">(</span>url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Packaging'<span style=\"color: navy\">)</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtExtVar.url = <span style=\"color: blue\">'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-formulation-packaging-extension'</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt den Verpackungswert für die Rezeptur</span>#xD;\n      extMatchVar.value<b> as </b><span style=\"color: maroon\">extValVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtExtVar.value = <span style=\"color: maroon\">extValVar</span> <i>\"copyExtensionValue\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"copyFormulaPackagingExtensionUrl\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Transformiert KBV-Herstellungsanweisung-Extension in gematik-Formulierungs-Herstellungsanweisung-Extension</span>#xD;\n    extVar<b> as </b><span style=\"color: maroon\">extMatchVar</span><b> where </b><span style=\"color: navy\">(</span>url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_CompoundingInstruction'<span style=\"color: navy\">)</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtExtVar.url = <span style=\"color: blue\">'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-manufacturing-instructions-extension'</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt den Herstellungsanweisung für die Rezeptur</span>#xD;\n      extMatchVar.value<b> as </b><span style=\"color: maroon\">extValVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtExtVar.value = <span style=\"color: maroon\">extValVar</span> <i>\"copyExtensionValue\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"copyFormulaInstructionExtensionUrl\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"medicationExt\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt die eindeutige Medication-ID unverändert</span>#xD;\n  kbvMedicationCompounding.id<b> as </b><span style=\"color: maroon\">IdVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedication.id = <span style=\"color: maroon\">IdVar</span> <i>\"medicationId\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt den Rezeptur-Code mit Bezeichnung</span>#xD;\n  kbvMedicationCompounding.code<b> as </b><span style=\"color: maroon\">srcCodeVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedication.code<b> as </b><span style=\"color: maroon\">tgtCodeVar</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert die Bezeichnung der Rezeptur (z.B. 'Hydrocortison-Salbe 1%')</span>#xD;\n    srcCodeVar.text<b> as </b><span style=\"color: maroon\">srcCodeTextVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtCodeVar.text = <span style=\"color: maroon\">srcCodeTextVar</span> <i>\"medicationCodeText\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"medicationCode\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt die Darreichungsform der Rezeptur (Salbe, Creme, Kapseln, etc.)</span>#xD;\n  kbvMedicationCompounding.form<b> as </b><span style=\"color: maroon\">formVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedication.form = <span style=\"color: maroon\">formVar</span> <i>\"medicationForm\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt die Gesamtmenge der herzustellenden Rezeptur</span>#xD;\n  kbvMedicationCompounding.amount<b> as </b><span style=\"color: maroon\">amountVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedication.amount<b> as </b><span style=\"color: maroon\">tgtAmountVar</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert den Nenner der Mengenangabe (z.B. '1' für 'pro Rezeptur')</span>#xD;\n    amountVar.denominator<b> as </b><span style=\"color: maroon\">amountDenominatorVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtAmountVar.denominator = <span style=\"color: maroon\">amountDenominatorVar</span> <i>\"medicationAmountDenominator\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt die detaillierte Mengenangabe der Rezeptur</span>#xD;\n    amountVar.numerator<b> as </b><span style=\"color: maroon\">amountNumeratorVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtAmountVar.numerator<b> as </b><span style=\"color: maroon\">tgtAmountNumeratorVar</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Transformiert Packungsgrößen-Extensions für Rezepturen</span>#xD;\n      amountNumeratorVar.extension<b> as </b><span style=\"color: maroon\">amountNumExtVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtAmountNumeratorVar.extension<b> as </b><span style=\"color: maroon\">tgtAmountNumExtVar</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        <span style=\"color: navy\">// </span><span style=\"color: green\">Wandelt KBV-Packungsgrößen-Extension in gematik EPA-Medication Extension um</span>#xD;\n        amountNumExtVar<b> where </b><span style=\"color: navy\">(</span>url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_PackagingSize'<span style=\"color: navy\">)</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtAmountNumExtVar.url = <span style=\"color: blue\">'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-packaging-size-extension'</span> <i>\"copyPackagingSizeExtensionUrl\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt den Packungsgrößenwert für die Rezeptur</span>#xD;\n        amountNumExtVar.value<b> as </b><span style=\"color: maroon\">extValVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtAmountNumExtVar.value = <span style=\"color: maroon\">extValVar</span> <i>\"copyExtensionValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"medicationAmountExt\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert den numerischen Wert der Gesamtmenge (z.B. '50' für 50g Salbe)</span>#xD;\n      amountNumeratorVar.value<b> as </b><span style=\"color: maroon\">amountNumeratorValueVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtAmountNumeratorVar.value = <span style=\"color: maroon\">amountNumeratorValueVar</span> <i>\"medicationAmountNumeratorValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt die Mengeneinheit für die Rezeptur (g, ml, Stück, etc.)</span>#xD;\n      amountNumeratorVar.unit<b> as </b><span style=\"color: maroon\">amountNumeratorUnitVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtAmountNumeratorVar.unit = <span style=\"color: maroon\">amountNumeratorUnitVar</span> <i>\"medicationAmountNumeratorUnit\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert das Codesystem für die Mengeneinheit (meist UCUM)</span>#xD;\n      amountNumeratorVar.system<b> as </b><span style=\"color: maroon\">amountNumeratorSystemVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtAmountNumeratorVar.system = <span style=\"color: maroon\">amountNumeratorSystemVar</span> <i>\"medicationAmountNumeratorSystem\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt den standardisierten Code für die Mengeneinheit</span>#xD;\n      amountNumeratorVar.code<b> as </b><span style=\"color: maroon\">amountNumeratorCodeVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtAmountNumeratorVar.code = <span style=\"color: maroon\">amountNumeratorCodeVar</span> <i>\"medicationAmountNumeratorCode\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"medicationAmountNumerator\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"medicationAmount\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt die Bestandteile der Rezeptur mit detaillierten Mengen- und Stärkeangaben</span>#xD;\n  kbvMedicationCompounding.ingredient<b> as </b><span style=\"color: maroon\">ingredientVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedication.ingredient<b> as </b><span style=\"color: maroon\">tgtIngredientVar</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>    <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert die Referenz oder den Code des Rezeptur-Bestandteils</span>#xD;\n    ingredientVar.item<b> as </b><span style=\"color: maroon\">IngredientItemValueVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtIngredientVar.item = <span style=\"color: maroon\">IngredientItemValueVar</span> <i>\"medicationIngredientItemValue\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Transformiert Bestandteil-spezifische Extensions</span>#xD;\n    ingredientVar.extension<b> as </b><span style=\"color: maroon\">IngredientExtVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtIngredientVar.extension<b> as </b><span style=\"color: maroon\">tgtIngredientExtVar</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Wandelt KBV-Bestandteil-Darreichungsform-Extension in gematik-Format um</span>#xD;\n      IngredientExtVar<b> where </b><span style=\"color: navy\">(</span>url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Ingredient_Form'<span style=\"color: navy\">)</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtIngredientExtVar.url = <span style=\"color: blue\">'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-ingredient-darreichungsform-extension'</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt die Darreichungsform des Bestandteils</span>#xD;\n        IngredientExtVar.value<b> as </b><span style=\"color: maroon\">extValVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtIngredientExtVar.value = <span style=\"color: maroon\">extValVar</span> <i>\"copyExtensionValue\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"copyIngredientFormExtensionUrl\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"medicationIngredientExt\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt die Stärke/Konzentration des Bestandteils in der Rezeptur</span>#xD;\n    ingredientVar.strength<b> as </b><span style=\"color: maroon\">IngredientStrengthValueVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtIngredientVar.strength<b> as </b><span style=\"color: maroon\">IngredientStrengthValueVar</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>      <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert den Nenner für die Stärkeangabe (Bezugsmenge)</span>#xD;\n      IngredientStrengthValueVar.denominator<b> as </b><span style=\"color: maroon\">ingredientDenominatorVar</span><span style=\"color: navy\"><b> -&gt; </b></span>IngredientStrengthValueVar.denominator = <span style=\"color: maroon\">ingredientDenominatorVar</span> <i>\"medicationIngredientDenominator\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert den Zähler für die Stärkeangabe (Wirkstoffmenge)</span>#xD;\n      IngredientStrengthValueVar.numerator<b> as </b><span style=\"color: maroon\">ingredientNumeratorVar</span><span style=\"color: navy\"><b> -&gt; </b></span>IngredientStrengthValueVar.numerator = <span style=\"color: maroon\">ingredientNumeratorVar</span> <i>\"medicationIngredientNumerator\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">// </span><span style=\"color: green\">Transformiert Bestandteil-Mengen-Extensions</span>#xD;\n      IngredientStrengthValueVar.extension<b> as </b><span style=\"color: maroon\">IngredientStrExtVar</span><span style=\"color: navy\"><b> -&gt; </b></span>IngredientStrengthValueVar.extension<b> as </b><span style=\"color: maroon\">tgtIngredientStrExtVar</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>        <span style=\"color: navy\">// </span><span style=\"color: green\">Wandelt KBV-Bestandteil-Mengen-Extension in gematik-Format um</span>#xD;\n        IngredientStrExtVar<b> where </b><span style=\"color: navy\">(</span>url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Ingredient_Amount'<span style=\"color: navy\">)</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtIngredientStrExtVar.url = <span style=\"color: blue\">'https://gematik.de/fhir/epa-medication/StructureDefinition/medication-ingredient-amount-extension'</span><b> then</b><span style=\"color: navy\"> {#xD;\n</span>          <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt die Mengenangabe des Bestandteils</span>#xD;\n          IngredientStrExtVar.value<b> as </b><span style=\"color: maroon\">extValVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtIngredientStrExtVar.value = <span style=\"color: maroon\">extValVar</span> <i>\"copyExtensionValue\"</i><span style=\"color: navy\">;</span>#xD;\n        <span style=\"color: navy\">}</span> <i>\"copyIngredientAmountExtensionUrl\"</i><span style=\"color: navy\">;</span>#xD;\n      <span style=\"color: navy\">}</span> <i>\"medicationIngredientStrengthExt\"</i><span style=\"color: navy\">;</span>#xD;\n    <span style=\"color: navy\">}</span> <i>\"medicationIngredientStrength\"</i><span style=\"color: navy\">;</span>#xD;\n  <span style=\"color: navy\">}</span> <i>\"medicationIngredient\"</i><span style=\"color: navy\">;</span>#xD;\n<span style=\"color: navy\">}#xD;\n#xD;\n</span></pre></div>"
  ] ;
  fhir:StructureMap.url [ fhir:value "https://gematik.de/fhir/tiflow-bfarm/StructureMap/ERPTPrescriptionStructureMapKBVCompoundingMedication"] ;
  fhir:StructureMap.version [ fhir:value "2.0.0"] ;
  fhir:StructureMap.name [ fhir:value "ERPTPrescriptionStructureMapKBVCompoundingMedication"] ;
  fhir:StructureMap.title [ fhir:value "E-T-Rezept Structure Map for KBV Compounding Medication"] ;
  fhir:StructureMap.status [ fhir:value "active"] ;
  fhir:StructureMap.experimental [ fhir:value "false"^^xsd:boolean] ;
  fhir:StructureMap.date [ fhir:value "2026-10-02"^^xsd:date] ;
  fhir:StructureMap.publisher [ fhir:value "gematik GmbH"] ;
  fhir:StructureMap.contact [
     fhir:index 0 ;
     fhir:ContactDetail.name [ fhir:value "gematik GmbH" ] ;
     fhir:ContactDetail.telecom [
       fhir:index 0 ;
       fhir:ContactPoint.system [ fhir:value "url" ] ;
       fhir:ContactPoint.value [ fhir:value "https://gematik.de" ]
     ], [
       fhir:index 1 ;
       fhir:ContactPoint.system [ fhir:value "email" ] ;
       fhir:ContactPoint.value [ fhir:value "erp-umsetzung@gematik.de" ]
     ]
  ] ;
  fhir:StructureMap.description [ fhir:value "Mapping-Anweisungen zur Transformation von KBV Rezeptur-Medikamenten zu BfArM T-Prescription Format"] ;
  fhir:StructureMap.jurisdiction [
     fhir:index 0 ;
     fhir:CodeableConcept.coding [
       fhir:index 0 ;
       fhir:Coding.system [ fhir:value "urn:iso:std:iso:3166" ] ;
       fhir:Coding.code [ fhir:value "DE" ] ;
       fhir:Coding.display [ fhir:value "Germany" ]
     ]
  ] ;
  fhir:StructureMap.structure [
     fhir:index 0 ;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Medication" ;
       fhir:link <http://hl7.org/fhir/StructureDefinition/Medication>
     ] ;
     fhir:StructureMap.structure.mode [ fhir:value "source" ] ;
     fhir:StructureMap.structure.alias [ fhir:value "kbvMedicationCompounding" ]
  ], [
     fhir:index 1 ;
     fhir:StructureMap.structure.url [
       fhir:value "http://hl7.org/fhir/StructureDefinition/Medication" ;
       fhir:link <http://hl7.org/fhir/StructureDefinition/Medication>
     ] ;
     fhir:StructureMap.structure.mode [ fhir:value "target" ] ;
     fhir:StructureMap.structure.alias [ fhir:value "bfarmMedication" ]
  ] ;
  fhir:StructureMap.group [
     fhir:index 0 ;
     fhir:StructureMap.group.name [ fhir:value "ERPTPrescriptionStructureMapKBVCompoundingMedication" ] ;
     fhir:StructureMap.group.typeMode [ fhir:value "none" ] ;
     fhir:StructureMap.group.documentation [ fhir:value "Mapping-Anweisungen zur Transformation von KBV Rezeptur-Medikamenten zu BfArM T-Prescription Format" ] ;
     fhir:StructureMap.group.input [
       fhir:index 0 ;
       fhir:StructureMap.group.input.name [ fhir:value "kbvMedicationCompounding" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "kbvMedicationCompounding" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "source" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.input.name [ fhir:value "bfarmMedication" ] ;
       fhir:StructureMap.group.input.type [ fhir:value "bfarmMedication" ] ;
       fhir:StructureMap.group.input.mode [ fhir:value "target" ]
     ] ;
     fhir:StructureMap.group.rule [
       fhir:index 0 ;
       fhir:StructureMap.group.rule.name [ fhir:value "medicationExt" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "kbvMedicationCompounding" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "extVar" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bfarmMedication" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtExtVar" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "copyFormulaPackagingExtensionUrl" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "extVar" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extMatchVar" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Packaging'" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "tgtExtVar" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://gematik.de/fhir/epa-medication/StructureDefinition/medication-formulation-packaging-extension" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "copyExtensionValue" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extMatchVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "extValVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtExtVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "extValVar" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Übernimmt den Verpackungswert für die Rezeptur" ]
         ] ;
         fhir:StructureMap.group.rule.documentation [ fhir:value "Transformiert KBV-Verpackungs-Extension in gematik-Formulierungs-Verpackungs-Extension" ]
       ], [
         fhir:index 1 ;
         fhir:StructureMap.group.rule.name [ fhir:value "copyFormulaInstructionExtensionUrl" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "extVar" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "extMatchVar" ] ;
           fhir:StructureMap.group.rule.source.condition [ fhir:value "url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_CompoundingInstruction'" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "tgtExtVar" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://gematik.de/fhir/epa-medication/StructureDefinition/medication-manufacturing-instructions-extension" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "copyExtensionValue" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "extMatchVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "extValVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtExtVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "extValVar" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Übernimmt den Herstellungsanweisung für die Rezeptur" ]
         ] ;
         fhir:StructureMap.group.rule.documentation [ fhir:value "Transformiert KBV-Herstellungsanweisung-Extension in gematik-Formulierungs-Herstellungsanweisung-Extension" ]
       ] ;
       fhir:StructureMap.group.rule.documentation [ fhir:value "Mappt Rezeptur-spezifische Extensions von KBV- zu BfArM-Format" ]
     ], [
       fhir:index 1 ;
       fhir:StructureMap.group.rule.name [ fhir:value "medicationId" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "kbvMedicationCompounding" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "id" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "IdVar" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bfarmMedication" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "id" ] ;
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "IdVar" ]
         ]
       ] ;
       fhir:StructureMap.group.rule.documentation [ fhir:value "Übernimmt die eindeutige Medication-ID unverändert" ]
     ], [
       fhir:index 2 ;
       fhir:StructureMap.group.rule.name [ fhir:value "medicationCode" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "kbvMedicationCompounding" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "code" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "srcCodeVar" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bfarmMedication" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtCodeVar" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "medicationCodeText" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "srcCodeVar" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "text" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "srcCodeTextVar" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "tgtCodeVar" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "text" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "srcCodeTextVar" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.documentation [ fhir:value "Kopiert die Bezeichnung der Rezeptur (z.B. 'Hydrocortison-Salbe 1%')" ]
       ] ;
       fhir:StructureMap.group.rule.documentation [ fhir:value "Mappt den Rezeptur-Code mit Bezeichnung" ]
     ], [
       fhir:index 3 ;
       fhir:StructureMap.group.rule.name [ fhir:value "medicationForm" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "kbvMedicationCompounding" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "form" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "formVar" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bfarmMedication" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "form" ] ;
         fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
         fhir:StructureMap.group.rule.target.parameter [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "formVar" ]
         ]
       ] ;
       fhir:StructureMap.group.rule.documentation [ fhir:value "Übernimmt die Darreichungsform der Rezeptur (Salbe, Creme, Kapseln, etc.)" ]
     ], [
       fhir:index 4 ;
       fhir:StructureMap.group.rule.name [ fhir:value "medicationAmount" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "kbvMedicationCompounding" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "amount" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "amountVar" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bfarmMedication" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "amount" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtAmountVar" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "medicationAmountDenominator" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "amountVar" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "denominator" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "amountDenominatorVar" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "tgtAmountVar" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "denominator" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "amountDenominatorVar" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.documentation [ fhir:value "Kopiert den Nenner der Mengenangabe (z.B. '1' für 'pro Rezeptur')" ]
       ], [
         fhir:index 1 ;
         fhir:StructureMap.group.rule.name [ fhir:value "medicationAmountNumerator" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "amountVar" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "numerator" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "amountNumeratorVar" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "tgtAmountVar" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "numerator" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtAmountNumeratorVar" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "medicationAmountExt" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "amountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "amountNumExtVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtAmountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtAmountNumExtVar" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "copyPackagingSizeExtensionUrl" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "amountNumExtVar" ] ;
               fhir:StructureMap.group.rule.source.condition [ fhir:value "url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_PackagingSize'" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "tgtAmountNumExtVar" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://gematik.de/fhir/epa-medication/StructureDefinition/medication-packaging-size-extension" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.documentation [ fhir:value "Wandelt KBV-Packungsgrößen-Extension in gematik EPA-Medication Extension um" ]
           ], [
             fhir:index 1 ;
             fhir:StructureMap.group.rule.name [ fhir:value "copyExtensionValue" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "amountNumExtVar" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "extValVar" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "tgtAmountNumExtVar" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "extValVar" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.documentation [ fhir:value "Übernimmt den Packungsgrößenwert für die Rezeptur" ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Transformiert Packungsgrößen-Extensions für Rezepturen" ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "medicationAmountNumeratorValue" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "amountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "amountNumeratorValueVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtAmountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "amountNumeratorValueVar" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Kopiert den numerischen Wert der Gesamtmenge (z.B. '50' für 50g Salbe)" ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "medicationAmountNumeratorUnit" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "amountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "unit" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "amountNumeratorUnitVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtAmountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "unit" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "amountNumeratorUnitVar" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Übernimmt die Mengeneinheit für die Rezeptur (g, ml, Stück, etc.)" ]
         ], [
           fhir:index 3 ;
           fhir:StructureMap.group.rule.name [ fhir:value "medicationAmountNumeratorSystem" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "amountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "system" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "amountNumeratorSystemVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtAmountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "system" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "amountNumeratorSystemVar" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Kopiert das Codesystem für die Mengeneinheit (meist UCUM)" ]
         ], [
           fhir:index 4 ;
           fhir:StructureMap.group.rule.name [ fhir:value "medicationAmountNumeratorCode" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "amountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "code" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "amountNumeratorCodeVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtAmountNumeratorVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "code" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "amountNumeratorCodeVar" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Übernimmt den standardisierten Code für die Mengeneinheit" ]
         ] ;
         fhir:StructureMap.group.rule.documentation [ fhir:value "Mappt die detaillierte Mengenangabe der Rezeptur" ]
       ] ;
       fhir:StructureMap.group.rule.documentation [ fhir:value "Mappt die Gesamtmenge der herzustellenden Rezeptur" ]
     ], [
       fhir:index 5 ;
       fhir:StructureMap.group.rule.name [ fhir:value "medicationIngredient" ] ;
       fhir:StructureMap.group.rule.source [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.source.context [ fhir:value "kbvMedicationCompounding" ] ;
         fhir:StructureMap.group.rule.source.element [ fhir:value "ingredient" ] ;
         fhir:StructureMap.group.rule.source.variable [ fhir:value "ingredientVar" ]
       ] ;
       fhir:StructureMap.group.rule.target [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.target.context [ fhir:value "bfarmMedication" ] ;
         fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
         fhir:StructureMap.group.rule.target.element [ fhir:value "ingredient" ] ;
         fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtIngredientVar" ]
       ] ;
       fhir:StructureMap.group.rule.rule [
         fhir:index 0 ;
         fhir:StructureMap.group.rule.name [ fhir:value "medicationIngredientItemValue" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ingredientVar" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "IngredientItemValueVar" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "tgtIngredientVar" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "item" ] ;
           fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
           fhir:StructureMap.group.rule.target.parameter [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "IngredientItemValueVar" ]
           ]
         ] ;
         fhir:StructureMap.group.rule.documentation [ fhir:value "Kopiert die Referenz oder den Code des Rezeptur-Bestandteils" ]
       ], [
         fhir:index 1 ;
         fhir:StructureMap.group.rule.name [ fhir:value "medicationIngredientExt" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ingredientVar" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "IngredientExtVar" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "tgtIngredientVar" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtIngredientExtVar" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "copyIngredientFormExtensionUrl" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "IngredientExtVar" ] ;
             fhir:StructureMap.group.rule.source.condition [ fhir:value "url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Ingredient_Form'" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "tgtIngredientExtVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://gematik.de/fhir/epa-medication/StructureDefinition/medication-ingredient-darreichungsform-extension" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "copyExtensionValue" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "IngredientExtVar" ] ;
               fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
               fhir:StructureMap.group.rule.source.variable [ fhir:value "extValVar" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "tgtIngredientExtVar" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "extValVar" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.documentation [ fhir:value "Übernimmt die Darreichungsform des Bestandteils" ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Wandelt KBV-Bestandteil-Darreichungsform-Extension in gematik-Format um" ]
         ] ;
         fhir:StructureMap.group.rule.documentation [ fhir:value "Transformiert Bestandteil-spezifische Extensions" ]
       ], [
         fhir:index 2 ;
         fhir:StructureMap.group.rule.name [ fhir:value "medicationIngredientStrength" ] ;
         fhir:StructureMap.group.rule.source [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.source.context [ fhir:value "ingredientVar" ] ;
           fhir:StructureMap.group.rule.source.element [ fhir:value "strength" ] ;
           fhir:StructureMap.group.rule.source.variable [ fhir:value "IngredientStrengthValueVar" ]
         ] ;
         fhir:StructureMap.group.rule.target [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.target.context [ fhir:value "tgtIngredientVar" ] ;
           fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
           fhir:StructureMap.group.rule.target.element [ fhir:value "strength" ] ;
           fhir:StructureMap.group.rule.target.variable [ fhir:value "IngredientStrengthValueVar" ]
         ] ;
         fhir:StructureMap.group.rule.rule [
           fhir:index 0 ;
           fhir:StructureMap.group.rule.name [ fhir:value "medicationIngredientDenominator" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "IngredientStrengthValueVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "denominator" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "ingredientDenominatorVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "IngredientStrengthValueVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "denominator" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "ingredientDenominatorVar" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Kopiert den Nenner für die Stärkeangabe (Bezugsmenge)" ]
         ], [
           fhir:index 1 ;
           fhir:StructureMap.group.rule.name [ fhir:value "medicationIngredientNumerator" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "IngredientStrengthValueVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "numerator" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "ingredientNumeratorVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "IngredientStrengthValueVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "numerator" ] ;
             fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
             fhir:StructureMap.group.rule.target.parameter [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "ingredientNumeratorVar" ]
             ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Kopiert den Zähler für die Stärkeangabe (Wirkstoffmenge)" ]
         ], [
           fhir:index 2 ;
           fhir:StructureMap.group.rule.name [ fhir:value "medicationIngredientStrengthExt" ] ;
           fhir:StructureMap.group.rule.source [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.source.context [ fhir:value "IngredientStrengthValueVar" ] ;
             fhir:StructureMap.group.rule.source.element [ fhir:value "extension" ] ;
             fhir:StructureMap.group.rule.source.variable [ fhir:value "IngredientStrExtVar" ]
           ] ;
           fhir:StructureMap.group.rule.target [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.target.context [ fhir:value "IngredientStrengthValueVar" ] ;
             fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
             fhir:StructureMap.group.rule.target.element [ fhir:value "extension" ] ;
             fhir:StructureMap.group.rule.target.variable [ fhir:value "tgtIngredientStrExtVar" ]
           ] ;
           fhir:StructureMap.group.rule.rule [
             fhir:index 0 ;
             fhir:StructureMap.group.rule.name [ fhir:value "copyIngredientAmountExtensionUrl" ] ;
             fhir:StructureMap.group.rule.source [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.source.context [ fhir:value "IngredientStrExtVar" ] ;
               fhir:StructureMap.group.rule.source.condition [ fhir:value "url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Ingredient_Amount'" ]
             ] ;
             fhir:StructureMap.group.rule.target [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.target.context [ fhir:value "tgtIngredientStrExtVar" ] ;
               fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
               fhir:StructureMap.group.rule.target.element [ fhir:value "url" ] ;
               fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
               fhir:StructureMap.group.rule.target.parameter [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.parameter.valueString [ fhir:value "https://gematik.de/fhir/epa-medication/StructureDefinition/medication-ingredient-amount-extension" ]
               ]
             ] ;
             fhir:StructureMap.group.rule.rule [
               fhir:index 0 ;
               fhir:StructureMap.group.rule.name [ fhir:value "copyExtensionValue" ] ;
               fhir:StructureMap.group.rule.source [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.source.context [ fhir:value "IngredientStrExtVar" ] ;
                 fhir:StructureMap.group.rule.source.element [ fhir:value "value" ] ;
                 fhir:StructureMap.group.rule.source.variable [ fhir:value "extValVar" ]
               ] ;
               fhir:StructureMap.group.rule.target [
                 fhir:index 0 ;
                 fhir:StructureMap.group.rule.target.context [ fhir:value "tgtIngredientStrExtVar" ] ;
                 fhir:StructureMap.group.rule.target.contextType [ fhir:value "variable" ] ;
                 fhir:StructureMap.group.rule.target.element [ fhir:value "value" ] ;
                 fhir:StructureMap.group.rule.target.transform [ fhir:value "copy" ] ;
                 fhir:StructureMap.group.rule.target.parameter [
                   fhir:index 0 ;
                   fhir:StructureMap.group.rule.target.parameter.valueId [ fhir:value "extValVar" ]
                 ]
               ] ;
               fhir:StructureMap.group.rule.documentation [ fhir:value "Übernimmt die Mengenangabe des Bestandteils" ]
             ] ;
             fhir:StructureMap.group.rule.documentation [ fhir:value "Wandelt KBV-Bestandteil-Mengen-Extension in gematik-Format um" ]
           ] ;
           fhir:StructureMap.group.rule.documentation [ fhir:value "Transformiert Bestandteil-Mengen-Extensions" ]
         ] ;
         fhir:StructureMap.group.rule.documentation [ fhir:value "Mappt die Stärke/Konzentration des Bestandteils in der Rezeptur" ]
       ] ;
       fhir:StructureMap.group.rule.documentation [ fhir:value "Mappt die Bestandteile der Rezeptur mit detaillierten Mengen- und Stärkeangaben" ]
     ]
  ] .

# - ontology header ------------------------------------------------------------

<http://hl7.org/fhir/StructureMap/ERPTPrescriptionStructureMapKBVCompoundingMedication.ttl> a owl:Ontology ;
  owl:imports fhir:fhir.ttl ;
  owl:versionIRI <http://build.fhir.org/StructureMap/ERPTPrescriptionStructureMapKBVCompoundingMedication.ttl> .