{
  "resourceType": "StructureDefinition",
  "id": "CA-eReC-MessageHeader",
  "url": "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-MessageHeader",
  "name": "MessageHeader",
  "title": "MessageHeader",
  "status": "draft",
  "description": "The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MessageHeader",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MessageHeader",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MessageHeader.id",
        "path": "MessageHeader.id",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension",
        "path": "MessageHeader.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "MessageHeader.extension:RoutingOptions",
        "path": "MessageHeader.extension",
        "sliceName": "RoutingOptions",
        "short": "USE CASE SUPPORT: Systems deployed in Ontario SHALL support",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/Routing-Options-EXT"
            ]
          }
        ]
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier",
        "path": "MessageHeader.extension",
        "sliceName": "ReferralIdentifier",
        "short": "USE CASE SUPPORT: Systems deployed in Ontario SHALL support",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/Referral-Identifier-EXT"
            ]
          }
        ]
      },
      {
        "id": "MessageHeader.event[x]",
        "path": "MessageHeader.event[x]",
        "mustSupport": true,
        "type": [
          {
            "code": "Coding"
          }
        ],
        "binding": {
          "strength": "extensible",
          "valueSet": "http://fhir.infoway-inforoute.ca/io/CA-eReC/ValueSet/message-event-code"
        }
      },
      {
        "id": "MessageHeader.destination",
        "path": "MessageHeader.destination",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.endpoint",
        "path": "MessageHeader.destination.endpoint",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.receiver",
        "path": "MessageHeader.destination.receiver",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Practitioner",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-PractitionerRole",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Organization"
            ]
          }
        ]
      },
      {
        "id": "MessageHeader.destination.receiver.reference",
        "path": "MessageHeader.destination.receiver.reference",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.receiver.identifier",
        "path": "MessageHeader.destination.receiver.identifier",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.receiver.identifier.system",
        "path": "MessageHeader.destination.receiver.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.receiver.identifier.value",
        "path": "MessageHeader.destination.receiver.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.sender",
        "path": "MessageHeader.sender",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Practitioner",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-PractitionerRole",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Organization"
            ]
          }
        ]
      },
      {
        "id": "MessageHeader.sender.reference",
        "path": "MessageHeader.sender.reference",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.sender.identifier",
        "path": "MessageHeader.sender.identifier",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.sender.identifier.system",
        "path": "MessageHeader.sender.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.sender.identifier.value",
        "path": "MessageHeader.sender.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.enterer",
        "path": "MessageHeader.enterer",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-PractitionerRole",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Practitioner"
            ]
          }
        ]
      },
      {
        "id": "MessageHeader.enterer.reference",
        "path": "MessageHeader.enterer.reference",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.enterer.identifier",
        "path": "MessageHeader.enterer.identifier",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.enterer.identifier.system",
        "path": "MessageHeader.enterer.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.enterer.identifier.value",
        "path": "MessageHeader.enterer.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.author",
        "path": "MessageHeader.author",
        "min": 0,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-PractitionerRole"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MessageHeader.author.reference",
        "path": "MessageHeader.author.reference",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.author.identifier",
        "path": "MessageHeader.author.identifier",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.author.identifier.system",
        "path": "MessageHeader.author.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.author.identifier.value",
        "path": "MessageHeader.author.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source",
        "path": "MessageHeader.source",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.endpoint",
        "path": "MessageHeader.source.endpoint",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason",
        "path": "MessageHeader.reason",
        "binding": {
          "strength": "extensible",
          "valueSet": "http://fhir.infoway-inforoute.ca/io/CA-eReC/ValueSet/message-change-reason"
        }
      },
      {
        "id": "MessageHeader.response",
        "path": "MessageHeader.response",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.response.identifier",
        "path": "MessageHeader.response.identifier",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.response.code",
        "path": "MessageHeader.response.code",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.response.details",
        "path": "MessageHeader.response.details",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus",
        "path": "MessageHeader.focus",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-ServiceRequest",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Task",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Appointment",
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Communication"
            ]
          }
        ],
        "mustSupport": true
      }
    ]
  }
}