<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="erp-service-request-request-header" />
  <url value="https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-request-header" />
  <version value="1.2.0" />
  <name value="ERPServiceRequestRequestHeader" />
  <title value="ERP Service Request Nachrichten-Header" />
  <status value="active" />
  <experimental value="false" />
  <date value="2025-07-31" />
  <publisher value="gematik GmbH" />
  <description value="Header mit Informationen über Absender und Empfänger" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="MessageHeader" />
  <baseDefinition value="https://gematik.de/fhir/atf/StructureDefinition/atf-message-header" />
  <derivation value="constraint" />
  <differential>
    <element id="MessageHeader.event[x]">
      <path value="MessageHeader.event[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="MessageHeader.event[x]:eventCoding">
      <path value="MessageHeader.event[x]" />
      <sliceName value="eventCoding" />
      <short value="The event code that indicates in which application and which transmission path the communication is currently taking place" />
      <comment value="For more information see [ATF ImplementationGuide](https://simplifier.net/app-transport-framework/~guides)" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="https://gematik.de/fhir/erp-servicerequest/ValueSet/service-identifier-vs" />
      </binding>
    </element>
    <element id="MessageHeader.destination.receiver.identifier">
      <path value="MessageHeader.destination.receiver.identifier" />
      <type>
        <code value="Identifier" />
        <profile value="http://fhir.de/StructureDefinition/identifier-telematik-id" />
      </type>
    </element>
    <element id="MessageHeader.sender.identifier">
      <path value="MessageHeader.sender.identifier" />
      <type>
        <code value="Identifier" />
        <profile value="http://fhir.de/StructureDefinition/identifier-telematik-id" />
      </type>
    </element>
    <element id="MessageHeader.responsible">
      <path value="MessageHeader.responsible" />
      <short value="The organization that is responsible for the request." />
      <comment value="This organization will be stated in the message header as the sender of the message." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-organization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MessageHeader.focus">
      <path value="MessageHeader.focus" />
      <short value="Specification of the ServiceRequest that contains the essential information for a given use case." />
      <comment value="One Message can contain multiple ServiceRequests which each are identified with an ID." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-prescription-request" />
        <targetProfile value="https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-dispense-request" />
        <targetProfile value="https://gematik.de/fhir/erp-servicerequest/StructureDefinition/erp-service-request-message-container" />
      </type>
    </element>
  </differential>
</StructureDefinition>