Implementation Guide
E-T-Rezept Datenaustausch
Version 1.1.0-ballot-1 - ballot

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

Draft as of 2025-07-07

Raw ttl | Download

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

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

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