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

## : E-T-Rezept Structure Map for MedicationRequest - JSON Representation

Draft as of 2026-05-26

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "ERPTPrescriptionStructureMapMedicationRequest",
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap ERPTPrescriptionStructureMapMedicationRequest</b></p><a name=\"ERPTPrescriptionStructureMapMedicationRequest\"> </a><a name=\"hcERPTPrescriptionStructureMapMedicationRequest\"> </a><pre class=\"fml\">\r\n<b>map</b><span style=\"color: navy\"> &quot;</span>https://gematik.de/fhir/erp-t-prescription/StructureMap/ERPTPrescriptionStructureMapMedicationRequest<span style=\"color: navy\">&quot; = &quot;</span>ERPTPrescriptionStructureMapMedicationRequest<span style=\"color: navy\">&quot;\r\n\r\n</span><span style=\"color: navy\">// </span><span style=\"color: green\">Mapping-Anweisungen zur Transformation von KBV MedicationRequest zu BfArM T-Prescription MedicationRequest</span>\r\n\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R4/medicationrequest.html\" title=\"MedicationRequest\">http://hl7.org/fhir/StructureDefinition/MedicationRequest</a><span style=\"color: navy\">&quot; </span><b>alias </b>kbvMedicationRequest <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R4/medicationrequest.html\" title=\"MedicationRequest\">http://hl7.org/fhir/StructureDefinition/MedicationRequest</a><span style=\"color: navy\">&quot; </span><b>alias </b>bfarmMedicationRequest <b>as </b><b>target</b>\r\n\r\n<span style=\"color: navy\">// </span><span style=\"color: green\">Mapping-Anweisungen zur Transformation von KBV MedicationRequest zu BfArM T-Prescription MedicationRequest</span>\r\n<b>group </b>ERPTPrescriptionStructureMapMedicationRequest<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">kbvMedicationRequest</span><span style=\"color: navy\"> : </span>kbvMedicationRequest, <b>target</b> <span style=\"color: maroon\">bfarmMedicationRequest</span><span style=\"color: navy\"> : </span>bfarmMedicationRequest<span style=\"color: navy\">)</span><span style=\"color: navy\"> {\r\n</span>  kbvMedicationRequest.status<b> as </b><span style=\"color: maroon\">srcStatus</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.status = <span style=\"color: blue\">'completed'</span> <i>&quot;medicationRequestStatus&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Setzt den Status auf 'completed' für den digitalen Durchschlag (Verschreibung ist bereits abgeschlossen)</span>\r\n  kbvMedicationRequest.intent<span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.intent = <span style=\"color: blue\">'order'</span> <i>&quot;medicationRequestIntent&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Setzt den Intent auf 'order' entsprechend der BfArM-Spezifikation für T-Prescription</span>\r\n  kbvMedicationRequest.extension<b> as </b><span style=\"color: maroon\">extVar</span><b> where </b>url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Teratogenic'<span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.extension<b> as </b><span style=\"color: maroon\">tgtExtVar</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    extVar<b> as </b><span style=\"color: maroon\">extMatchVar</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtExtVar.url = <span style=\"color: blue\">'https://gematik.de/fhir/epa-medication/StructureDefinition/teratogenic-extension'</span> <i>&quot;copyTPrescriptionExtensionUrl&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert teratogene Extensions für T-Rezept Kennzeichnung</span>\r\n    extVar.extension<b> as </b><span style=\"color: maroon\">offLabelVar</span><b> where </b>url='Off-Label'<span style=\"color: navy\"><b> -&gt; </b></span> tgtExtVar.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtOffLabelExt</span><span style=\"color: navy\">, </span> tgtOffLabelExt.url = <span style=\"color: blue\">'off-label'</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      offLabelVar.value<b> as </b><span style=\"color: maroon\">offLabelValue</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtOffLabelExt.value = <span style=\"color: maroon\">offLabelValue</span> <i>&quot;mapOffLabelValue&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt den Off-Label Booleschen Wert</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;mapOffLabelExtension&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt Off-Label Extension</span>\r\n    extVar.extension<b> as </b><span style=\"color: maroon\">gebaerfaehigeFrauVar</span><b> where </b>url='GebaerfaehigeFrau'<span style=\"color: navy\"><b> -&gt; </b></span> tgtExtVar.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtGebaerfaehigeFrauExt</span><span style=\"color: navy\">, </span> tgtGebaerfaehigeFrauExt.url = <span style=\"color: blue\">'childbearing-potential'</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      gebaerfaehigeFrauVar.value<b> as </b><span style=\"color: maroon\">gebaerfaehigeFrauValue</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtGebaerfaehigeFrauExt.value = <span style=\"color: maroon\">gebaerfaehigeFrauValue</span> <i>&quot;mapGebaerfaehigeFrauValue&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt den Booleschen Wert für childbearing-potential</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;mapGebaerfaehigeFrauExtension&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt GebaerfaehigeFrau Extension zu childbearing-potential</span>\r\n    extVar.extension<b> as </b><span style=\"color: maroon\">sicherheitsVar</span><b> where </b>url='EinhaltungSicherheitsmassnahmen'<span style=\"color: navy\"><b> -&gt; </b></span> tgtExtVar.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtSicherheitsExt</span><span style=\"color: navy\">, </span> tgtSicherheitsExt.url = <span style=\"color: blue\">'security-compliance'</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      sicherheitsVar.value<b> as </b><span style=\"color: maroon\">sicherheitsValue</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtSicherheitsExt.value = <span style=\"color: maroon\">sicherheitsValue</span> <i>&quot;mapEinhaltungSicherheitsmassnahmenValue&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt den Booleschen Wert für security-compliance</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;mapEinhaltungSicherheitsmassnahmenExtension&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt EinhaltungSicherheitsmassnahmen Extension zu security-compliance</span>\r\n    extVar.extension<b> as </b><span style=\"color: maroon\">infoMatVar</span><b> where </b>url='AushaendigungInformationsmaterialien'<span style=\"color: navy\"><b> -&gt; </b></span> tgtExtVar.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtInfoMatExt</span><span style=\"color: navy\">, </span> tgtInfoMatExt.url = <span style=\"color: blue\">'hand-out-information-material'</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      infoMatVar.value<b> as </b><span style=\"color: maroon\">infoMatValue</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtInfoMatExt.value = <span style=\"color: maroon\">infoMatValue</span> <i>&quot;mapAushaendigungInformationsmaterialienValue&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt den Booleschen Wert für hand-out-information-material</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;mapAushaendigungInformationsmaterialienExtension&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt AushaendigungInformationsmaterialien Extension zu hand-out-information-material</span>\r\n    extVar.extension<b> as </b><span style=\"color: maroon\">sachkenntnisVar</span><b> where </b>url='ErklaerungSachkenntnis'<span style=\"color: navy\"><b> -&gt; </b></span> tgtExtVar.extension = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Extension'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtSachkenntnisExt</span><span style=\"color: navy\">, </span> tgtSachkenntnisExt.url = <span style=\"color: blue\">'declaration-of-expertise'</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      sachkenntnisVar.value<b> as </b><span style=\"color: maroon\">sachkenntnisValue</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtSachkenntnisExt.value = <span style=\"color: maroon\">sachkenntnisValue</span> <i>&quot;mapErklaerungSachkenntnisValue&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt den Booleschen Wert für declaration-of-expertise</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;mapErklaerungSachkenntnisExtension&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt ErklaerungSachkenntnis Extension zu declaration-of-expertise</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;medicationRequestExt&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Mappt T-Rezept spezifische Extensions vom KBV- zum BfArM-Format</span>\r\n  kbvMedicationRequest.extension<b> as </b><span style=\"color: maroon\">extDosageMetaVar</span><b> where </b>url='http://ig.fhir.de/igs/medication/StructureDefinition/GeneratedDosageInstructionsMeta'<span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.extension = <span style=\"color: maroon\">extDosageMetaVar</span> <i>&quot;medicationRequestExt&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert Dosage Metadata Extension</span>\r\n  kbvMedicationRequest.extension<b> as </b><span style=\"color: maroon\">extDosageRenderedVar</span><b> where </b>url='http://hl7.org/fhir/5.0/StructureDefinition/extension-MedicationRequest.renderedDosageInstruction'<span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.extension = <span style=\"color: maroon\">extDosageRenderedVar</span> <i>&quot;medicationRequestExt&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert RenderedDosageText</span>\r\n  kbvMedicationRequest.subject<b> as </b><span style=\"color: maroon\">srcSubject</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.subject<b> as </b><span style=\"color: maroon\">tgtSubject</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    kbvMedicationRequest.subject<b> as </b><span style=\"color: maroon\">srcSubject</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtSubject.identifier<b> as </b><span style=\"color: maroon\">tgtSubjectIdentifier</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      kbvMedicationRequest.subject<b> as </b><span style=\"color: maroon\">srcSubject</span><span style=\"color: navy\"><b> -&gt; </b></span> tgtSubjectIdentifier.system<b> as </b><span style=\"color: maroon\">tgtSubjectIdentifierSystem</span><span style=\"color: navy\">, </span> tgtSubjectIdentifier.value<b> as </b><span style=\"color: maroon\">tgtSubjectIdentifierValue</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        kbvMedicationRequest.subject<b> as </b><span style=\"color: maroon\">srcSubject</span><span style=\"color: navy\"><b> -&gt; </b></span> tgtSubjectIdentifierSystem.extension<b> as </b><span style=\"color: maroon\">tgtSubjectIdentifierSystemEx</span><span style=\"color: navy\">, </span> tgtSubjectIdentifierValue.extension<b> as </b><span style=\"color: maroon\">tgtSubjectIdentifierValueEx</span><b> then</b><span style=\"color: navy\"> {\r\n</span>          kbvMedicationRequest.subject<b> as </b><span style=\"color: maroon\">srcSubject</span><span style=\"color: navy\"><b> -&gt; </b></span> tgtSubjectIdentifierSystemEx.url = <span style=\"color: blue\">'http://hl7.org/fhir/StructureDefinition/data-absent-reason'</span><span style=\"color: navy\">, </span> tgtSubjectIdentifierSystemEx.value = <b>cast</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'not-permitted'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'code'</span><span style=\"color: navy\">)</span> <i>&quot;medicationRequestsubjectIdentifierSystemExtension&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Setzt data-absent-reason auf 'not-permitted' um Patientendaten zu anonymisieren</span>\r\n          kbvMedicationRequest.subject<b> as </b><span style=\"color: maroon\">srcSubject</span><span style=\"color: navy\"><b> -&gt; </b></span> tgtSubjectIdentifierValueEx.url = <span style=\"color: blue\">'http://hl7.org/fhir/StructureDefinition/data-absent-reason'</span><span style=\"color: navy\">, </span> tgtSubjectIdentifierValueEx.value = <b>cast</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'not-permitted'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'code'</span><span style=\"color: navy\">)</span> <i>&quot;medicationRequestsubjectIdentifierValueExtension&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Setzt data-absent-reason auf 'not-permitted' um Patientendaten zu anonymisieren</span>\r\n        <span style=\"color: navy\">}</span> <i>&quot;medicationRequestsubjectIdentifierSystem&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Erstellt data-absent-reason Extension für Subject Identifier</span>\r\n      <span style=\"color: navy\">}</span> <i>&quot;medicationRequestsubjectIdentifierExtension&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Erstellt data-absent-reason Extension für Subject Identifier</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;medicationRequestsubjectIdentifier&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;medicationRequestsubject&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Entfernt Patientenbezug durch data-absent-reason Extension für Datenschutz im digitalen Durchschlag</span>\r\n  kbvMedicationRequest.authoredOn<b> as </b><span style=\"color: maroon\">srcAuthoredOnVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.authoredOn = <span style=\"color: maroon\">srcAuthoredOnVar</span> <i>&quot;medicationRequestAuthoredOn&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt das Verschreibungsdatum unverändert vom KBV MedicationRequest</span>\r\n  kbvMedicationRequest.dosageInstruction<b> as </b><span style=\"color: maroon\">srcDosageInstructionVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.dosageInstruction = <span style=\"color: maroon\">srcDosageInstructionVar</span> <i>&quot;medicationRequestDosageInstruction&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Kopiert die Dosierungsanweisungen vollständig für den digitalen Durchschlag</span>\r\n  kbvMedicationRequest.dispenseRequest<b> as </b><span style=\"color: maroon\">srcDispenseRequestVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.dispenseRequest = <span style=\"color: maroon\">srcDispenseRequestVar</span> <i>&quot;medicationRequestDispenseRequest&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Übernimmt Abgabeanweisungen (Menge, Wiederholungen) aus der ursprünglichen Verschreibung</span>\r\n  kbvMedicationRequest.medication<b> as </b><span style=\"color: maroon\">medicationVar</span><span style=\"color: navy\"><b> -&gt; </b></span>bfarmMedicationRequest.medication = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Reference'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgtMedicationReference</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    medicationVar.reference<b> as </b><span style=\"color: maroon\">medicationReferenceValue</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      medicationReferenceValue<b> as </b><span style=\"color: maroon\">currentMedicationReferenceValue</span><span style=\"color: navy\"><b> -&gt; </b></span>tgtMedicationReference.reference = <span style=\"color: navy\">(</span>iif(%currentMedicationReferenceValue.startsWith('urn:uuid:'), %currentMedicationReferenceValue, 'urn:uuid:' &amp; %currentMedicationReferenceValue.replaceMatches('.*[:/]', ''))<span style=\"color: navy\">)</span> <i>&quot;normalizeMedicationReferenceTransformation&quot;</i><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;normalizeMedicationReference&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;medicationReference&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Transformiert die Medication-Referenz zu urn:uuid Format</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
      },
      "url" : "https://gematik.de/fhir/erp-t-prescription/StructureMap/ERPTPrescriptionStructureMapMedicationRequest",
      "version" : "2.0.0-ballot.1",
      "name" : "ERPTPrescriptionStructureMapMedicationRequest",
      "title" : "E-T-Rezept Structure Map for MedicationRequest",
      "status" : "draft",
      "experimental" : false,
      "date" : "2026-05-26",
      "publisher" : "gematik GmbH",
      "contact" : [
        {
          "name" : "gematik GmbH",
          "telecom" : [
            {
              "system" : "url",
              "value" : "https://gematik.de"
            },
            {
              "system" : "email",
              "value" : "erp-umsetzung@gematik.de"
            }
          ]
        }
      ],
      "description" : "Mapping-Anweisungen zur Transformation von KBV MedicationRequest zu BfArM T-Prescription MedicationRequest",
      "jurisdiction" : [
        {
          "coding" : [
            {
              "system" : "urn:iso:std:iso:3166",
              "code" : "DE",
              "display" : "Germany"
            }
          ]
        }
      ],
      "structure" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/MedicationRequest",
          "mode" : "source",
          "alias" : "kbvMedicationRequest"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/MedicationRequest",
          "mode" : "target",
          "alias" : "bfarmMedicationRequest"
        }
      ],
      "group" : [
        {
          "name" : "ERPTPrescriptionStructureMapMedicationRequest",
          "typeMode" : "none",
          "documentation" : "Mapping-Anweisungen zur Transformation von KBV MedicationRequest zu BfArM T-Prescription MedicationRequest",
          "input" : [
            {
              "name" : "kbvMedicationRequest",
              "type" : "kbvMedicationRequest",
              "mode" : "source"
            },
            {
              "name" : "bfarmMedicationRequest",
              "type" : "bfarmMedicationRequest",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "medicationRequestStatus",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "status",
                  "variable" : "srcStatus"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "completed"
                    }
                  ]
                }
              ],
              "documentation" : "Setzt den Status auf 'completed' für den digitalen Durchschlag (Verschreibung ist bereits abgeschlossen)"
            },
            {
              "name" : "medicationRequestIntent",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "intent"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "intent",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "order"
                    }
                  ]
                }
              ],
              "documentation" : "Setzt den Intent auf 'order' entsprechend der BfArM-Spezifikation für T-Prescription"
            },
            {
              "name" : "medicationRequestExt",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "extension",
                  "variable" : "extVar",
                  "condition" : "url='https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Teratogenic'"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "extension",
                  "variable" : "tgtExtVar"
                }
              ],
              "rule" : [
                {
                  "name" : "copyTPrescriptionExtensionUrl",
                  "source" : [
                    {
                      "context" : "extVar",
                      "variable" : "extMatchVar"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgtExtVar",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "https://gematik.de/fhir/epa-medication/StructureDefinition/teratogenic-extension"
                        }
                      ]
                    }
                  ],
                  "documentation" : "Kopiert teratogene Extensions für T-Rezept Kennzeichnung"
                },
                {
                  "name" : "mapOffLabelExtension",
                  "source" : [
                    {
                      "context" : "extVar",
                      "element" : "extension",
                      "variable" : "offLabelVar",
                      "condition" : "url='Off-Label'"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgtExtVar",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "tgtOffLabelExt",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Extension"
                        }
                      ]
                    },
                    {
                      "context" : "tgtOffLabelExt",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "off-label"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "mapOffLabelValue",
                      "source" : [
                        {
                          "context" : "offLabelVar",
                          "element" : "value",
                          "variable" : "offLabelValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgtOffLabelExt",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "offLabelValue"
                            }
                          ]
                        }
                      ],
                      "documentation" : "Übernimmt den Off-Label Booleschen Wert"
                    }
                  ],
                  "documentation" : "Mappt Off-Label Extension"
                },
                {
                  "name" : "mapGebaerfaehigeFrauExtension",
                  "source" : [
                    {
                      "context" : "extVar",
                      "element" : "extension",
                      "variable" : "gebaerfaehigeFrauVar",
                      "condition" : "url='GebaerfaehigeFrau'"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgtExtVar",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "tgtGebaerfaehigeFrauExt",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Extension"
                        }
                      ]
                    },
                    {
                      "context" : "tgtGebaerfaehigeFrauExt",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "childbearing-potential"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "mapGebaerfaehigeFrauValue",
                      "source" : [
                        {
                          "context" : "gebaerfaehigeFrauVar",
                          "element" : "value",
                          "variable" : "gebaerfaehigeFrauValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgtGebaerfaehigeFrauExt",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "gebaerfaehigeFrauValue"
                            }
                          ]
                        }
                      ],
                      "documentation" : "Übernimmt den Booleschen Wert für childbearing-potential"
                    }
                  ],
                  "documentation" : "Mappt GebaerfaehigeFrau Extension zu childbearing-potential"
                },
                {
                  "name" : "mapEinhaltungSicherheitsmassnahmenExtension",
                  "source" : [
                    {
                      "context" : "extVar",
                      "element" : "extension",
                      "variable" : "sicherheitsVar",
                      "condition" : "url='EinhaltungSicherheitsmassnahmen'"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgtExtVar",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "tgtSicherheitsExt",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Extension"
                        }
                      ]
                    },
                    {
                      "context" : "tgtSicherheitsExt",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "security-compliance"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "mapEinhaltungSicherheitsmassnahmenValue",
                      "source" : [
                        {
                          "context" : "sicherheitsVar",
                          "element" : "value",
                          "variable" : "sicherheitsValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgtSicherheitsExt",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "sicherheitsValue"
                            }
                          ]
                        }
                      ],
                      "documentation" : "Übernimmt den Booleschen Wert für security-compliance"
                    }
                  ],
                  "documentation" : "Mappt EinhaltungSicherheitsmassnahmen Extension zu security-compliance"
                },
                {
                  "name" : "mapAushaendigungInformationsmaterialienExtension",
                  "source" : [
                    {
                      "context" : "extVar",
                      "element" : "extension",
                      "variable" : "infoMatVar",
                      "condition" : "url='AushaendigungInformationsmaterialien'"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgtExtVar",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "tgtInfoMatExt",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Extension"
                        }
                      ]
                    },
                    {
                      "context" : "tgtInfoMatExt",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "hand-out-information-material"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "mapAushaendigungInformationsmaterialienValue",
                      "source" : [
                        {
                          "context" : "infoMatVar",
                          "element" : "value",
                          "variable" : "infoMatValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgtInfoMatExt",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "infoMatValue"
                            }
                          ]
                        }
                      ],
                      "documentation" : "Übernimmt den Booleschen Wert für hand-out-information-material"
                    }
                  ],
                  "documentation" : "Mappt AushaendigungInformationsmaterialien Extension zu hand-out-information-material"
                },
                {
                  "name" : "mapErklaerungSachkenntnisExtension",
                  "source" : [
                    {
                      "context" : "extVar",
                      "element" : "extension",
                      "variable" : "sachkenntnisVar",
                      "condition" : "url='ErklaerungSachkenntnis'"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgtExtVar",
                      "contextType" : "variable",
                      "element" : "extension",
                      "variable" : "tgtSachkenntnisExt",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Extension"
                        }
                      ]
                    },
                    {
                      "context" : "tgtSachkenntnisExt",
                      "contextType" : "variable",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "declaration-of-expertise"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "mapErklaerungSachkenntnisValue",
                      "source" : [
                        {
                          "context" : "sachkenntnisVar",
                          "element" : "value",
                          "variable" : "sachkenntnisValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgtSachkenntnisExt",
                          "contextType" : "variable",
                          "element" : "value",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueId" : "sachkenntnisValue"
                            }
                          ]
                        }
                      ],
                      "documentation" : "Übernimmt den Booleschen Wert für declaration-of-expertise"
                    }
                  ],
                  "documentation" : "Mappt ErklaerungSachkenntnis Extension zu declaration-of-expertise"
                }
              ],
              "documentation" : "Mappt T-Rezept spezifische Extensions vom KBV- zum BfArM-Format"
            },
            {
              "name" : "medicationRequestExt",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "extension",
                  "variable" : "extDosageMetaVar",
                  "condition" : "url='http://ig.fhir.de/igs/medication/StructureDefinition/GeneratedDosageInstructionsMeta'"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "extension",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "extDosageMetaVar"
                    }
                  ]
                }
              ],
              "documentation" : "Kopiert Dosage Metadata Extension"
            },
            {
              "name" : "medicationRequestExt",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "extension",
                  "variable" : "extDosageRenderedVar",
                  "condition" : "url='http://hl7.org/fhir/5.0/StructureDefinition/extension-MedicationRequest.renderedDosageInstruction'"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "extension",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "extDosageRenderedVar"
                    }
                  ]
                }
              ],
              "documentation" : "Kopiert RenderedDosageText"
            },
            {
              "name" : "medicationRequestsubject",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "subject",
                  "variable" : "srcSubject"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "subject",
                  "variable" : "tgtSubject"
                }
              ],
              "rule" : [
                {
                  "name" : "medicationRequestsubjectIdentifier",
                  "source" : [
                    {
                      "context" : "kbvMedicationRequest",
                      "element" : "subject",
                      "variable" : "srcSubject"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgtSubject",
                      "contextType" : "variable",
                      "element" : "identifier",
                      "variable" : "tgtSubjectIdentifier"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "medicationRequestsubjectIdentifierExtension",
                      "source" : [
                        {
                          "context" : "kbvMedicationRequest",
                          "element" : "subject",
                          "variable" : "srcSubject"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgtSubjectIdentifier",
                          "contextType" : "variable",
                          "element" : "system",
                          "variable" : "tgtSubjectIdentifierSystem"
                        },
                        {
                          "context" : "tgtSubjectIdentifier",
                          "contextType" : "variable",
                          "element" : "value",
                          "variable" : "tgtSubjectIdentifierValue"
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "medicationRequestsubjectIdentifierSystem",
                          "source" : [
                            {
                              "context" : "kbvMedicationRequest",
                              "element" : "subject",
                              "variable" : "srcSubject"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "tgtSubjectIdentifierSystem",
                              "contextType" : "variable",
                              "element" : "extension",
                              "variable" : "tgtSubjectIdentifierSystemEx"
                            },
                            {
                              "context" : "tgtSubjectIdentifierValue",
                              "contextType" : "variable",
                              "element" : "extension",
                              "variable" : "tgtSubjectIdentifierValueEx"
                            }
                          ],
                          "rule" : [
                            {
                              "name" : "medicationRequestsubjectIdentifierSystemExtension",
                              "source" : [
                                {
                                  "context" : "kbvMedicationRequest",
                                  "element" : "subject",
                                  "variable" : "srcSubject"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgtSubjectIdentifierSystemEx",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "http://hl7.org/fhir/StructureDefinition/data-absent-reason"
                                    }
                                  ]
                                },
                                {
                                  "context" : "tgtSubjectIdentifierSystemEx",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueString" : "not-permitted"
                                    },
                                    {
                                      "valueString" : "code"
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "Setzt data-absent-reason auf 'not-permitted' um Patientendaten zu anonymisieren"
                            },
                            {
                              "name" : "medicationRequestsubjectIdentifierValueExtension",
                              "source" : [
                                {
                                  "context" : "kbvMedicationRequest",
                                  "element" : "subject",
                                  "variable" : "srcSubject"
                                }
                              ],
                              "target" : [
                                {
                                  "context" : "tgtSubjectIdentifierValueEx",
                                  "contextType" : "variable",
                                  "element" : "url",
                                  "transform" : "copy",
                                  "parameter" : [
                                    {
                                      "valueString" : "http://hl7.org/fhir/StructureDefinition/data-absent-reason"
                                    }
                                  ]
                                },
                                {
                                  "context" : "tgtSubjectIdentifierValueEx",
                                  "contextType" : "variable",
                                  "element" : "value",
                                  "transform" : "cast",
                                  "parameter" : [
                                    {
                                      "valueString" : "not-permitted"
                                    },
                                    {
                                      "valueString" : "code"
                                    }
                                  ]
                                }
                              ],
                              "documentation" : "Setzt data-absent-reason auf 'not-permitted' um Patientendaten zu anonymisieren"
                            }
                          ],
                          "documentation" : "Erstellt data-absent-reason Extension für Subject Identifier"
                        }
                      ],
                      "documentation" : "Erstellt data-absent-reason Extension für Subject Identifier"
                    }
                  ]
                }
              ],
              "documentation" : "Entfernt Patientenbezug durch data-absent-reason Extension für Datenschutz im digitalen Durchschlag"
            },
            {
              "name" : "medicationRequestAuthoredOn",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "authoredOn",
                  "variable" : "srcAuthoredOnVar"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "authoredOn",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "srcAuthoredOnVar"
                    }
                  ]
                }
              ],
              "documentation" : "Übernimmt das Verschreibungsdatum unverändert vom KBV MedicationRequest"
            },
            {
              "name" : "medicationRequestDosageInstruction",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "dosageInstruction",
                  "variable" : "srcDosageInstructionVar"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "dosageInstruction",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "srcDosageInstructionVar"
                    }
                  ]
                }
              ],
              "documentation" : "Kopiert die Dosierungsanweisungen vollständig für den digitalen Durchschlag"
            },
            {
              "name" : "medicationRequestDispenseRequest",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "dispenseRequest",
                  "variable" : "srcDispenseRequestVar"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "dispenseRequest",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "srcDispenseRequestVar"
                    }
                  ]
                }
              ],
              "documentation" : "Übernimmt Abgabeanweisungen (Menge, Wiederholungen) aus der ursprünglichen Verschreibung"
            },
            {
              "name" : "medicationReference",
              "source" : [
                {
                  "context" : "kbvMedicationRequest",
                  "element" : "medication",
                  "variable" : "medicationVar"
                }
              ],
              "target" : [
                {
                  "context" : "bfarmMedicationRequest",
                  "contextType" : "variable",
                  "element" : "medication",
                  "variable" : "tgtMedicationReference",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "normalizeMedicationReference",
                  "source" : [
                    {
                      "context" : "medicationVar",
                      "element" : "reference",
                      "variable" : "medicationReferenceValue"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "normalizeMedicationReferenceTransformation",
                      "source" : [
                        {
                          "context" : "medicationReferenceValue",
                          "variable" : "currentMedicationReferenceValue"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tgtMedicationReference",
                          "contextType" : "variable",
                          "element" : "reference",
                          "transform" : "evaluate",
                          "parameter" : [
                            {
                              "valueString" : "iif(%currentMedicationReferenceValue.startsWith('urn:uuid:'), %currentMedicationReferenceValue, 'urn:uuid:' & %currentMedicationReferenceValue.replaceMatches('.*[:/]', ''))"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ],
              "documentation" : "Transformiert die Medication-Referenz zu urn:uuid Format"
            }
          ]
        }
      ]
    }