{
  "resourceType": "StructureDefinition",
  "text": {
    "status": "empty",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\" />"
  },
  "url": "http://ehealthontario.ca/fhir/StructureDefinition/ca-on-eReferral-profile-MessageHeader",
  "version": "v0.10.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.0",
  "kind": "resource",
  "abstract": false,
  "type": "MessageHeader",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MessageHeader",
  "derivation": "constraint",
  "snapshot": {},
  "differential": {
    "element": [
      {
        "id": "MessageHeader.id",
        "path": "MessageHeader.id",
        "min": 1
      },
      {
        "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.0.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",
        "path": "MessageHeader.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "MessageHeader.extension:RoutingOptions",
        "path": "MessageHeader.extension",
        "sliceName": "RoutingOptions",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ehealthontario.on.ca/fhir/StructureDefinition/ext-routing-options"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:RoutingOptions.value[x]",
        "path": "MessageHeader.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:RoutingOptions.value[x].coding",
        "path": "MessageHeader.extension.value[x].coding",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://ehealthontario.ca/fhir/ValueSet/ereferral-source-types"
        }
      },
      {
        "id": "MessageHeader.extension:RoutingOptions.value[x].coding.system",
        "path": "MessageHeader.extension.value[x].coding.system",
        "fixedUri": "http://ehealthontario.ca/fhir/CodeSystem/ereferral-source-types",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:RoutingOptions.value[x].coding.code",
        "path": "MessageHeader.extension.value[x].coding.code",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:RoutingOptions.value[x].coding.display",
        "path": "MessageHeader.extension.value[x].coding.display",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier",
        "path": "MessageHeader.extension",
        "sliceName": "ReferralIdentifier",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ehealthontario.on.ca/fhir/StructureDefinition/ext-referral-identifier"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier.value[x]",
        "path": "MessageHeader.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier.value[x].type",
        "path": "MessageHeader.extension.value[x].type",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier.value[x].type.coding",
        "path": "MessageHeader.extension.value[x].type.coding",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://ehealthontario.ca/fhir/ValueSet/ereferral-source-types"
        }
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier.value[x].type.coding.system",
        "path": "MessageHeader.extension.value[x].type.coding.system",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier.value[x].type.coding.code",
        "path": "MessageHeader.extension.value[x].type.coding.code",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier.value[x].type.coding.display",
        "path": "MessageHeader.extension.value[x].type.coding.display",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier.value[x].system",
        "path": "MessageHeader.extension.value[x].system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.extension:ReferralIdentifier.value[x].value",
        "path": "MessageHeader.extension.value[x].value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.event[x]:eventCoding",
        "path": "MessageHeader.event[x]",
        "sliceName": "eventCoding",
        "type": [
          {
            "code": "Coding"
          }
        ],
        "mustSupport": true,
        "binding": {
          "strength": "example",
          "valueSet": "https://ehealthontario.ca/fhir/ValueSet/message-event-code"
        }
      },
      {
        "id": "MessageHeader.event[x]:eventCoding.system",
        "path": "MessageHeader.event[x].system",
        "fixedUri": "https://ehealthontario.ca/fhir/CodeSystem/message-event-code",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.event[x]:eventCoding.code",
        "path": "MessageHeader.event[x].code",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://ehealthontario.ca/fhir/ValueSet/message-event-code"
        }
      },
      {
        "id": "MessageHeader.event[x]:eventCoding.display",
        "path": "MessageHeader.event[x].display",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination",
        "path": "MessageHeader.destination",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.name",
        "path": "MessageHeader.destination.name",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.target",
        "path": "MessageHeader.destination.target",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.endpoint",
        "path": "MessageHeader.destination.endpoint",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.destination.receiver",
        "path": "MessageHeader.destination.receiver",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://simplifier.net/ereferral-ontario/ereferralpractitionerrole"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MessageHeader.author",
        "path": "MessageHeader.author",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://simplifier.net/ereferral-ontario/ereferralpractitionerrole",
              "https://simplifier.net/ereferral-ontario/ereferralpatient"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source",
        "path": "MessageHeader.source",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.name",
        "path": "MessageHeader.source.name",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.software",
        "path": "MessageHeader.source.software",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.version",
        "path": "MessageHeader.source.version",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.contact",
        "path": "MessageHeader.source.contact",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.contact.system",
        "path": "MessageHeader.source.contact.system",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.contact.value",
        "path": "MessageHeader.source.contact.value",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.contact.use",
        "path": "MessageHeader.source.contact.use",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.contact.rank",
        "path": "MessageHeader.source.contact.rank",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.source.endpoint",
        "path": "MessageHeader.source.endpoint",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason",
        "path": "MessageHeader.reason",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason.coding",
        "path": "MessageHeader.reason.coding",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason.coding.system",
        "path": "MessageHeader.reason.coding.system",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason.coding.code",
        "path": "MessageHeader.reason.coding.code",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason.coding.display",
        "path": "MessageHeader.reason.coding.display",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.reason.text",
        "path": "MessageHeader.reason.text",
        "mustSupport": true
      },
      {
        "id": "MessageHeader.focus",
        "path": "MessageHeader.focus",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://simplifier.net/ereferral-ontario/ereferralservicerequest"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ],
        "mustSupport": true
      }
    ]
  }
}