<?xml version="1.0" encoding="UTF-8"?>

<Parameters xmlns="http://hl7.org/fhir">
  <id value="example-epa-op-unlink-emp-entry-output-parameters-1"/>
  <meta>
    <profile value="https://gematik.de/fhir/epa-medication/StructureDefinition/epa-op-link-emp-entry-output-parameters"/>
  </meta>
  <parameter>
    <name value="medicationStatement"/>
    <resource>
      <MedicationStatement>
        <id value="3afe43bc-8b57-417f-9e84-a70ea5062a6c"/>
        <meta>
          <versionId value="3"/>
          <lastUpdated value="2026-11-25T14:00:00.000Z"/>
          <profile value="https://gematik.de/fhir/epa-medication/StructureDefinition/epa-medication-statement"/>
        </meta>
        <extension url="https://gematik.de/fhir/epa-medication/StructureDefinition/context-extension">
          <valueCode value="MANUAL"/>
        </extension>
        <status value="unknown"/>
        <medicationReference>
          <reference value="Medication/b43cb3c2-552a-4da1-9eaa-605ac532a83d"/>
        </medicationReference>
        <subject>
          <identifier>
            <system value="http://fhir.de/sid/gkv/kvid-10"/>
            <value value="X110411319"/>
          </identifier>
        </subject>
        <effectivePeriod>
          <start value="2026-11-01"/>
        </effectivePeriod>
        <dateAsserted value="2026-11-01"/>
        <dosage>
          <extension url="http://ig.fhir.de/igs/medication/StructureDefinition/GeneratedDosageInstructions">
            <extension url="algorithm">
              <valueCoding>
                <system value="http://ig.fhir.de/igs/medication/CodeSystem/DosageTextAlgorithm"/>
                <version value="1.0.0"/>
                <code value="GematikDosageTextGenerator"/>
              </valueCoding>
            </extension>
            <extension url="algorithmVersion">
              <valueString value="1.0.0"/>
            </extension>
            <extension url="language">
              <valueCode value="de-DE"/>
            </extension>
            <extension url="text">
              <valueString value="täglich: morgens — je 1 Stück"/>
            </extension>
          </extension>
          <timing>
            <repeat>
              <frequency value="1"/>
              <period value="1"/>
              <periodUnit value="d"/>
              <when value="MORN"/>
            </repeat>
          </timing>
          <doseAndRate>
            <doseQuantity>
              <value value="1"/>
              <unit value="Stück"/>
              <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_BMP_DOSIEREINHEIT"/>
              <code value="1"/>
            </doseQuantity>
          </doseAndRate>
        </dosage>
      </MedicationStatement>
    </resource>
  </parameter>
  <parameter>
    <name value="eMPEntry"/>
    <resource>
      <MedicationRequest>
        <id value="266620a9-2c26-41c1-b0cb-a10947b867f5"/>
        <meta>
          <versionId value="3"/>
          <lastUpdated value="2026-11-25T14:00:00.000Z"/>
          <profile value="https://gematik.de/fhir/epa-medication/StructureDefinition/emp-medication-request"/>
        </meta>
        <extension url="https://gematik.de/fhir/epa-medication/StructureDefinition/context-extension">
          <valueCode value="EMP"/>
        </extension>
        <extension url="https://gematik.de/fhir/epa-medication/StructureDefinition/reason-patient-instruction-extension">
          <valueString value="Kopfschmerzen"/>
        </extension>
        <extension url="https://gematik.de/fhir/epa-medication/StructureDefinition/patient-note-extension">
          <valueAnnotation>
            <text value="Alkohol: das Risiko für Magen-Darm-Geschwüre und -Blutungen ist erhöht."/>
          </valueAnnotation>
        </extension>
        <extension url="http://hl7.org/fhir/5.0/StructureDefinition/extension-MedicationRequest.effectiveDosePeriod">
          <valuePeriod>
            <start value="2026-11-02"/>
          </valuePeriod>
        </extension>
        <identifier>
          <system value="https://gematik.de/fhir/sid/emp-identifier"/>
          <value value="266620a9-2c26-41c1-b0cb-a10947b867f5"/>
        </identifier>
        <status value="active"/>
        <intent value="plan"/>
        <medicationReference>
          <reference value="Medication/d6508f13-9314-4e54-a0c3-3eafe1f356ff"/>
        </medicationReference>
        <subject>
          <identifier>
            <system value="http://fhir.de/sid/gkv/kvid-10"/>
            <value value="X110411319"/>
          </identifier>
        </subject>
        <authoredOn value="2026-11-01"/>
        <note>
          <text value="Hinweis für den LE"/>
        </note>
        <dosageInstruction>
          <extension url="http://ig.fhir.de/igs/medication/StructureDefinition/GeneratedDosageInstructions">
            <extension url="algorithm">
              <valueCoding>
                <system value="http://ig.fhir.de/igs/medication/CodeSystem/DosageTextAlgorithm"/>
                <version value="1.0.0"/>
                <code value="GematikDosageTextGenerator"/>
              </valueCoding>
            </extension>
            <extension url="algorithmVersion">
              <valueString value="1.0.0"/>
            </extension>
            <extension url="language">
              <valueCode value="de-DE"/>
            </extension>
            <extension url="text">
              <valueString value="täglich: morgens — je 1 Stück"/>
            </extension>
          </extension>
          <timing>
            <repeat>
              <frequency value="1"/>
              <period value="1"/>
              <periodUnit value="d"/>
              <when value="MORN"/>
            </repeat>
          </timing>
          <doseAndRate>
            <doseQuantity>
              <value value="1"/>
              <unit value="Stück"/>
              <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_BMP_DOSIEREINHEIT"/>
              <code value="1"/>
            </doseQuantity>
          </doseAndRate>
        </dosageInstruction>
      </MedicationRequest>
    </resource>
  </parameter>
  <parameter>
    <name value="relatedActivity"/>
    <resource>
      <Provenance>
        <id value="6fbf6cb7-6425-49c5-a005-50aac83fd8cd"/>
        <meta>
          <profile value="https://gematik.de/fhir/epa/StructureDefinition/epa-activity-provenance"/>
        </meta>
        <target>
          <reference value="MedicationStatement/3afe43bc-8b57-417f-9e84-a70ea5062a6c/_history/3"/>
        </target>
        <target>
          <reference value="MedicationRequest/266620a9-2c26-41c1-b0cb-a10947b867f5/_history/3"/>
        </target>
        <recorded value="2026-11-25T14:00:00.000Z"/>
        <activity>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/v3-DataOperation"/>
            <code value="UPDATE"/>
          </coding>
        </activity>
        <agent>
          <type>
            <coding>
              <system value="http://terminology.hl7.org/CodeSystem/provenance-participant-type"/>
              <code value="author"/>
            </coding>
          </type>
          <who>
            <reference value="Organization/450a9511-53e5-4af7-be36-a18444bb8dd2"/>
            <identifier>
              <type>
                <coding>
                  <system value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
                  <code value="PRN"/>
                </coding>
              </type>
              <system value="https://gematik.de/fhir/sid/telematik-id"/>
              <value value="9-2.58.00000089"/>
            </identifier>
            <display value="Die Hausarztpraxis"/>
          </who>
        </agent>
      </Provenance>
    </resource>
  </parameter>
  <parameter>
    <name value="relatedChronology"/>
    <resource>
      <Provenance>
        <id value="005c1662-8f1c-49cb-a08c-dfdf08080032"/>
        <meta>
          <profile value="https://gematik.de/fhir/epa-medication/StructureDefinition/emp-chronology-provenance"/>
        </meta>
        <extension url="https://gematik.de/fhir/epa-medication/StructureDefinition/is-emp-chronology-extension">
          <valueBoolean value="true"/>
        </extension>
        <target>
          <reference value="MedicationRequest/266620a9-2c26-41c1-b0cb-a10947b867f5/_history/3"/>
        </target>
        <occurredDateTime value="2026-11-25T14:00:00.000Z"/>
        <recorded value="2026-11-25T14:00:00.000Z"/>
        <activity>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/v3-DataOperation"/>
            <code value="UPDATE"/>
          </coding>
        </activity>
        <agent>
          <type>
            <coding>
              <system value="http://terminology.hl7.org/CodeSystem/provenance-participant-type"/>
              <code value="author"/>
            </coding>
          </type>
          <who>
            <reference value="Organization/450a9511-53e5-4af7-be36-a18444bb8dd2"/>
            <identifier>
              <type>
                <coding>
                  <system value="http://terminology.hl7.org/CodeSystem/v2-0203"/>
                  <code value="PRN"/>
                </coding>
              </type>
              <system value="https://gematik.de/fhir/sid/telematik-id"/>
              <value value="9-2.58.00000089"/>
            </identifier>
            <display value="Die Hausarztpraxis"/>
          </who>
        </agent>
      </Provenance>
    </resource>
  </parameter>
</Parameters>