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

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

Draft as of 2026-05-26

Raw xml | Download

    <StructureMap xmlns="http://hl7.org/fhir">
      <id value="ERPTPrescriptionStructureMapMedicationRequest"/>
      <text>
        <status value="generated"/>
        <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">
    <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;

    </span><span style="color: navy">// </span><span style="color: green">Mapping-Anweisungen zur Transformation von KBV MedicationRequest zu BfArM T-Prescription MedicationRequest</span>

    <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>
    <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>

    <span style="color: navy">// </span><span style="color: green">Mapping-Anweisungen zur Transformation von KBV MedicationRequest zu BfArM T-Prescription MedicationRequest</span>
    <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"> {
    </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>
      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>
      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"> {
    </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>
        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"> {
    </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>
        <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>
        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"> {
    </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>
        <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>
        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"> {
    </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>
        <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>
        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"> {
    </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>
        <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>
        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"> {
    </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>
        <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>
      <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>
      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>
      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>
      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"> {
    </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"> {
    </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"> {
    </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"> {
    </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>
              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>
            <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>
          <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>
        <span style="color: navy">}</span> <i>&quot;medicationRequestsubjectIdentifier&quot;</i><span style="color: navy">;</span>
      <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>
      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>
      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>
      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>
      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"> {
    </span>    medicationVar.reference<b> as </b><span style="color: maroon">medicationReferenceValue</span><b> then</b><span style="color: navy"> {
    </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>
        <span style="color: navy">}</span> <i>&quot;normalizeMedicationReference&quot;</i><span style="color: navy">;</span>
      <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>
    <span style="color: navy">}

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