<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="GEM-ERP-PR-Communication-DispReq" />
  <url value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_Communication_DispReq" />
  <version value="1.6.2" />
  <name value="GEM_ERP_PR_Communication_DispReq" />
  <title value="Anfrage zur Einlösung des E-Rezepts" />
  <status value="active" />
  <date value="2026-04-14" />
  <description value="Ressource, die für die Kommunikation einer Einlöseanfrage zwischen Patient und Leistungserbringer auf Basis des E-Rezepts verwendet wird." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Communication" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Communication" />
  <derivation value="constraint" />
  <differential>
    <element id="Communication">
      <path value="Communication" />
      <constraint>
        <key value="workflow-communication-payload-1" />
        <severity value="error" />
        <human value="Payload muss angegeben werden, wenn eine Zuweisung für ein Arzneimittel vorgenommen wird" />
        <expression value="(extension.where(url = 'https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_EX_PrescriptionType').value.code = '162' implies payload.exists().not()) and (extension.where(url = 'https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_EX_PrescriptionType').value.code != '162' implies payload.exists() and payload.empty().not())" />
        <source value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_Communication_DispReq" />
      </constraint>
    </element>
    <element id="Communication.meta">
      <path value="Communication.meta" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.meta.profile">
      <path value="Communication.meta.profile" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <description value="Slicing für meta profile" />
        <ordered value="false" />
        <rules value="closed" />
      </slicing>
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.meta.profile:workflowProfile">
      <path value="Communication.meta.profile" />
      <sliceName value="workflowProfile" />
      <min value="1" />
      <max value="1" />
      <fixedCanonical value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_Communication_DispReq|1.6" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.extension">
      <path value="Communication.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Communication.extension:flowType">
      <path value="Communication.extension" />
      <sliceName value="flowType" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_EX_PrescriptionType" />
      </type>
    </element>
    <element id="Communication.recipient">
      <path value="Communication.recipient" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.recipient.identifier">
      <path value="Communication.recipient.identifier" />
      <min value="1" />
      <type>
        <code value="Identifier" />
        <profile value="http://fhir.de/StructureDefinition/identifier-telematik-id" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Communication.sender.identifier">
      <path value="Communication.sender.identifier" />
      <min value="1" />
      <type>
        <code value="Identifier" />
        <profile value="http://fhir.de/StructureDefinition/identifier-kvid-10" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Communication.payload">
      <path value="Communication.payload" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Communication.payload.content[x]">
      <path value="Communication.payload.content[x]" />
      <type>
        <code value="string" />
      </type>
    </element>
  </differential>
</StructureDefinition>