<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="DataStandardsWales-MessageHeader" />
  <url value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-MessageHeader" />
  <version value="0.0.1" />
  <name value="DataStandardsWalesMessageHeader" />
  <title value="Data Standards Wales Message Header" />
  <status value="draft" />
  <experimental value="false" />
  <date value="2025-12-12" />
  <publisher value="NHS Wales" />
  <contact>
    <name value="FHIR Service" />
    <telecom>
      <system value="email" />
      <value value="fhir.standards@wales.nhs.uk" />
      <use value="work" />
      <rank value="1" />
    </telecom>
  </contact>
  <copyright value="2025 NHS Wales" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="MessageHeader" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MessageHeader" />
  <derivation value="constraint" />
  <differential>
    <element id="MessageHeader.event[x]">
      <path value="MessageHeader.event[x]" />
      <type>
        <code value="Coding" />
      </type>
      <binding>
        <strength value="preferred" />
        <description value="NHS Wales Message Events" />
        <valueSet value="https://fhir.nhs.wales/ValueSet/DataStandardsWales-MessageEvent" />
      </binding>
    </element>
    <element id="MessageHeader.destination.target">
      <path value="MessageHeader.destination.target" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Device" />
      </type>
    </element>
    <element id="MessageHeader.destination.target.identifier.assigner">
      <path value="MessageHeader.destination.target.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.destination.receiver">
      <path value="MessageHeader.destination.receiver" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Practitioner" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-PractitionerRole" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.destination.receiver.identifier.assigner">
      <path value="MessageHeader.destination.receiver.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.sender">
      <path value="MessageHeader.sender" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Practitioner" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-PractitionerRole" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.sender.identifier.assigner">
      <path value="MessageHeader.sender.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.enterer">
      <path value="MessageHeader.enterer" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Practitioner" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-PractitionerRole" />
      </type>
    </element>
    <element id="MessageHeader.enterer.identifier.assigner">
      <path value="MessageHeader.enterer.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.author">
      <path value="MessageHeader.author" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Practitioner" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-PractitionerRole" />
      </type>
    </element>
    <element id="MessageHeader.author.identifier.assigner">
      <path value="MessageHeader.author.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.responsible">
      <path value="MessageHeader.responsible" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Practitioner" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-PractitionerRole" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.responsible.identifier.assigner">
      <path value="MessageHeader.responsible.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.response.details.identifier.assigner">
      <path value="MessageHeader.response.details.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
    <element id="MessageHeader.focus.identifier.assigner">
      <path value="MessageHeader.focus.identifier.assigner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.nhs.wales/StructureDefinition/DataStandardsWales-Organization" />
      </type>
    </element>
  </differential>
</StructureDefinition>