{
  "resourceType": "StructureDefinition",
  "id": "ca-on-eReferral-profile-MessageHeader",
  "url": "http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-MessageHeader",
  "version": "1.2.0",
  "name": "EReferralMessageHeader",
  "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.\r\nTo enable sending system insert its own identifiers into API submitted eReferral, and have that returned with subsequent messages, an extension is created on the MessageHeader.identifier element for referral id.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MessageHeader",
  "baseDefinition": "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-MessageHeader",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MessageHeader.meta",
        "path": "MessageHeader.meta",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.meta.profile",
        "path": "MessageHeader.meta.profile",
        "comment": "#### **_` FOR eREFERRAL USAGE: The meta.profile = http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-MessageHeader|1.2.0 `_**\r\n\r\nIt is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set.",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:routingOptions",
        "path": "MessageHeader.extension",
        "sliceName": "routingOptions",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/Routing-Options-EXT"
            ]
          }
        ],
        "mustSupport": true,
        "isModifier": false
      },
      {
        "id": "MessageHeader.extension:routingOptions.url",
        "path": "MessageHeader.extension.url",
        "fixedUri": "http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/Routing-Options-EXT"
      },
      {
        "id": "MessageHeader.extension:contentType",
        "path": "MessageHeader.extension",
        "sliceName": "contentType",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ehealthontario.ca/fhir/StructureDefinition/ext-content-type"
            ]
          }
        ],
        "mustSupport": true,
        "isModifier": false
      },
      {
        "id": "MessageHeader.extension:contentType.url",
        "path": "MessageHeader.extension.url",
        "fixedUri": "http://ehealthontario.ca/fhir/StructureDefinition/ext-content-type"
      },
      {
        "id": "MessageHeader.event[x]",
        "path": "MessageHeader.event[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "closed"
        }
      },
      {
        "id": "MessageHeader.event[x]:eventCoding",
        "path": "MessageHeader.event[x]",
        "sliceName": "eventCoding",
        "binding": {
          "strength": "extensible",
          "valueSet": "http://ehealthontario.ca/fhir/ValueSet/message-event-code"
        }
      },
      {
        "id": "MessageHeader.event[x]:eventCoding.system",
        "path": "MessageHeader.event[x].system",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.event[x]:eventCoding.code",
        "path": "MessageHeader.event[x].code",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.event[x]:eventCoding.display",
        "path": "MessageHeader.event[x].display",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination",
        "path": "MessageHeader.destination",
        "min": 1
      },
      {
        "id": "MessageHeader.destination.name",
        "path": "MessageHeader.destination.name",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.destination.target",
        "path": "MessageHeader.destination.target",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.destination.endpoint.extension:HTTPHeaderDestination",
        "path": "MessageHeader.destination.endpoint.extension",
        "sliceName": "HTTPHeaderDestination",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ehealthontario.ca/fhir/StructureDefinition/ext-http-header-destination"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "MessageHeader.destination.receiver",
        "path": "MessageHeader.destination.receiver",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-PractitionerRole"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ],
        "mustSupport": false
      },
      {
        "id": "MessageHeader.author",
        "path": "MessageHeader.author",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-PractitionerRole"
            ]
          }
        ]
      },
      {
        "id": "MessageHeader.source.name",
        "path": "MessageHeader.source.name",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.source.software",
        "path": "MessageHeader.source.software",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.source.version",
        "path": "MessageHeader.source.version",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.source.contact",
        "path": "MessageHeader.source.contact",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.source.contact.system",
        "path": "MessageHeader.source.contact.system",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.source.contact.value",
        "path": "MessageHeader.source.contact.value",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.source.contact.use",
        "path": "MessageHeader.source.contact.use",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.source.contact.rank",
        "path": "MessageHeader.source.contact.rank",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.source.endpoint.extension:HTTPHeaderSource",
        "path": "MessageHeader.source.endpoint.extension",
        "sliceName": "HTTPHeaderSource",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ehealthontario.ca/fhir/StructureDefinition/ext-http-header-source"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "MessageHeader.reason.coding",
        "path": "MessageHeader.reason.coding",
        "mustSupport": false
      },
      {
        "id": "MessageHeader.reason.coding.system",
        "path": "MessageHeader.reason.coding.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason.coding.code",
        "path": "MessageHeader.reason.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason.coding.display",
        "path": "MessageHeader.reason.coding.display",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason.text",
        "path": "MessageHeader.reason.text",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus",
        "path": "MessageHeader.focus",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-ServiceRequest",
              "http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Task",
              "http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Appointment",
              "http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-Communication"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      }
    ]
  }
}