{
  "resourceType": "StructureDefinition",
  "id": "89794f87-4e25-435c-8462-2cca6068bc65",
  "meta": {
    "versionId": "4",
    "lastUpdated": "2022-05-04T19:13:01.749966+00:00"
  },
  "url": "http://ehealth.bc.ca/fhir/StructureDefinition/MessageHeader",
  "name": "MessageHeader",
  "status": "draft",
  "date": "2022-03-11T20:48:18.8117151+00:00",
  "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",
        "comment": "Apply same GUID of resourceBundle.id",
        "min": 1
      },
      {
        "id": "MessageHeader.meta",
        "path": "MessageHeader.meta",
        "comment": "Manatory for eForm, CznSub, PNet"
      },
      {
        "id": "MessageHeader.meta.versionId",
        "path": "MessageHeader.meta.versionId",
        "fixedId": "2022.01"
      },
      {
        "id": "MessageHeader.meta.profile",
        "path": "MessageHeader.meta.profile",
        "comment": "Apply \"http://ehealth.bc.ca/fhir/StructureDefinition/MessageHeader\"",
        "min": 1,
        "max": "1"
      },
      {
        "id": "MessageHeader.implicitRules",
        "path": "MessageHeader.implicitRules",
        "max": "0"
      },
      {
        "id": "MessageHeader.language",
        "path": "MessageHeader.language",
        "max": "0"
      },
      {
        "id": "MessageHeader.text",
        "path": "MessageHeader.text",
        "max": "0"
      },
      {
        "id": "MessageHeader.contained",
        "path": "MessageHeader.contained",
        "max": "0"
      },
      {
        "id": "MessageHeader.event[x]",
        "path": "MessageHeader.event[x]",
        "type": [
          {
            "code": "Coding"
          }
        ]
      },
      {
        "id": "MessageHeader.event[x].id",
        "path": "MessageHeader.event[x].id",
        "max": "0"
      },
      {
        "id": "MessageHeader.event[x].system",
        "path": "MessageHeader.event[x].system",
        "comment": "Apply \"https://ehealth.bc.ca/NamingSystem/fhir/message-events\"",
        "min": 1
      },
      {
        "id": "MessageHeader.event[x].version",
        "path": "MessageHeader.event[x].version",
        "max": "0"
      },
      {
        "id": "MessageHeader.event[x].code",
        "path": "MessageHeader.event[x].code",
        "comment": "Apply \"MedicationAdministration-Recording\"",
        "min": 1
      },
      {
        "id": "MessageHeader.event[x].display",
        "path": "MessageHeader.event[x].display",
        "max": "0"
      },
      {
        "id": "MessageHeader.event[x].userSelected",
        "path": "MessageHeader.event[x].userSelected",
        "max": "0"
      },
      {
        "id": "MessageHeader.destination.id",
        "path": "MessageHeader.destination.id",
        "max": "0"
      },
      {
        "id": "MessageHeader.destination.name",
        "path": "MessageHeader.destination.name",
        "comment": "Apply \"DHIR\""
      },
      {
        "id": "MessageHeader.destination.target",
        "path": "MessageHeader.destination.target",
        "max": "0"
      },
      {
        "id": "MessageHeader.destination.endpoint",
        "path": "MessageHeader.destination.endpoint",
        "comment": "Apply \"[id-system-local-base]/ca-bc-panorama-immunization\""
      },
      {
        "id": "MessageHeader.destination.receiver",
        "path": "MessageHeader.destination.receiver",
        "max": "0"
      },
      {
        "id": "MessageHeader.sender.id",
        "path": "MessageHeader.sender.id",
        "max": "0"
      },
      {
        "id": "MessageHeader.sender.reference",
        "path": "MessageHeader.sender.reference",
        "max": "0"
      },
      {
        "id": "MessageHeader.sender.type",
        "path": "MessageHeader.sender.type",
        "max": "0"
      },
      {
        "id": "MessageHeader.sender.identifier",
        "path": "MessageHeader.sender.identifier",
        "max": "0"
      },
      {
        "id": "MessageHeader.sender.display",
        "path": "MessageHeader.sender.display",
        "comment": "See Mappings",
        "min": 1,
        "mapping": [
          {
            "identity": "source-HA",
            "map": "\"BCY_CIS\""
          },
          {
            "identity": "source-EMR",
            "map": "\"BCY_EMR\""
          },
          {
            "identity": "source-PNet",
            "map": "\"BCY_PharmaNet\""
          },
          {
            "identity": "source-eForm",
            "map": "\"BCY_eForm\""
          },
          {
            "identity": "source-CznSub",
            "map": "\"BCY_CZNSUB\""
          }
        ]
      },
      {
        "id": "MessageHeader.enterer",
        "path": "MessageHeader.enterer",
        "max": "0"
      },
      {
        "id": "MessageHeader.author.id",
        "path": "MessageHeader.author.id",
        "max": "0"
      },
      {
        "id": "MessageHeader.author.reference",
        "path": "MessageHeader.author.reference",
        "comment": "See Mappings",
        "min": 1,
        "mapping": [
          {
            "identity": "source-HA",
            "map": "\"Practitioner/Submitter1\""
          },
          {
            "identity": "source-PNet",
            "map": "fullURL+\"PractitionerSubmitter/1\"",
            "comment": "http://ehealth.bc.ca/pharmaNet/fhir/"
          },
          {
            "identity": "source-eForm",
            "map": "fullURL+\"PractitionerSubmitter/1\"",
            "comment": "http://ehealth.bc.ca/eForm/fhir/"
          },
          {
            "identity": "source-CznSub",
            "map": "fullURL+\"PractitionerSubmitter/\"+(Submitter ID)",
            "comment": "http://ehealth.bc.ca/cznSub/fhir/"
          }
        ]
      },
      {
        "id": "MessageHeader.author.type",
        "path": "MessageHeader.author.type",
        "max": "0"
      },
      {
        "id": "MessageHeader.author.identifier",
        "path": "MessageHeader.author.identifier",
        "max": "0"
      },
      {
        "id": "MessageHeader.author.display",
        "path": "MessageHeader.author.display",
        "max": "0"
      },
      {
        "id": "MessageHeader.source.id",
        "path": "MessageHeader.source.id",
        "max": "0"
      },
      {
        "id": "MessageHeader.source.name",
        "path": "MessageHeader.source.name",
        "comment": "See Mappings",
        "min": 1,
        "mapping": [
          {
            "identity": "source-HA",
            "map": "\"BCY_CIS\""
          },
          {
            "identity": "source-EMR",
            "map": "\"BCY_EMR\""
          },
          {
            "identity": "source-PNet",
            "map": "\"BCY_PharmaNet\""
          },
          {
            "identity": "source-eForm",
            "map": "\"BCY_eForm\""
          },
          {
            "identity": "source-CznSub",
            "map": "\"BCY_CznSub\""
          }
        ]
      },
      {
        "id": "MessageHeader.source.contact",
        "path": "MessageHeader.source.contact",
        "max": "0"
      },
      {
        "id": "MessageHeader.source.endpoint",
        "path": "MessageHeader.source.endpoint",
        "comment": "See Mappings",
        "mapping": [
          {
            "identity": "source-nha",
            "map": "\"https://fhir.infoway-inforoute.ca/NamingSystem/ca-bc-nha\""
          },
          {
            "identity": "source-fha",
            "map": "\"https://fhir.infoway-inforoute.ca/NamingSystem/ca-bc-fha\""
          },
          {
            "identity": "source-vcha",
            "map": "\"https://fhir.infoway-inforoute.ca/NamingSystem/ca-bc-vcha\""
          },
          {
            "identity": "source-eForm",
            "map": "\"https://fhir.infoway-inforoute.ca/NamingSystem/ca-bc-eForm\""
          },
          {
            "identity": "source-PNet",
            "map": "\"https://fhir.infoway-inforoute.ca/NamingSystem/ca-bc-pharmanet\""
          },
          {
            "identity": "source-CznSub",
            "map": "\"https://www.d21coesdogm9kt.cloudfront.net\""
          }
        ]
      },
      {
        "id": "MessageHeader.responsible.id",
        "path": "MessageHeader.responsible.id",
        "max": "0"
      },
      {
        "id": "MessageHeader.responsible.reference",
        "path": "MessageHeader.responsible.reference",
        "comment": "See Mappings",
        "min": 1,
        "mapping": [
          {
            "identity": "source-HA",
            "map": "\"Organization/Org1\""
          },
          {
            "identity": "source-eForm-sdl-dropdownlist",
            "map": "fullURL ends with \"Organization/\"(BRANCH_ID)",
            "comment": "http://ehealth.bc.ca/eForm/fhir/"
          },
          {
            "identity": "source-PNet",
            "map": "fullURL ends with \"Organization/\"+(PANORAMA_UNIT_ID)",
            "comment": "http://ehealth.bc.ca/pharmaNet/fhir/"
          },
          {
            "identity": "source-CznSub",
            "map": "fullURL ends with \"Organization/\"(BRANCH_ID\"",
            "comment": "http://ehealth.bc.ca/cznSub/fhir/StructureDefinition/"
          }
        ]
      },
      {
        "id": "MessageHeader.responsible.type",
        "path": "MessageHeader.responsible.type",
        "max": "0"
      },
      {
        "id": "MessageHeader.responsible.identifier",
        "path": "MessageHeader.responsible.identifier",
        "max": "0"
      },
      {
        "id": "MessageHeader.responsible.display",
        "path": "MessageHeader.responsible.display",
        "max": "0"
      },
      {
        "id": "MessageHeader.reason",
        "path": "MessageHeader.reason",
        "max": "0"
      },
      {
        "id": "MessageHeader.response",
        "path": "MessageHeader.response",
        "max": "0"
      },
      {
        "id": "MessageHeader.focus.id",
        "path": "MessageHeader.focus.id",
        "max": "0"
      },
      {
        "id": "MessageHeader.focus.reference",
        "path": "MessageHeader.focus.reference",
        "comment": "See Mappings",
        "min": 1,
        "mapping": [
          {
            "identity": "source-HA",
            "map": "\"Patient/Patient1\""
          },
          {
            "identity": "source-eForm",
            "map": "fullURL ends with \"Patient/\"+(Patient ID)\"",
            "comment": "http://ehealth.bc.ca/eForm/fhir/"
          },
          {
            "identity": "source-PNet",
            "map": "fullURL ends with \"Patient/\"+(Patient ID)",
            "comment": "http://ehealth.bc.ca/pharmaNet/fhir/"
          },
          {
            "identity": "source-CznSub",
            "map": "fullURL ends with \"Patient/\"+(Patient ID)",
            "comment": "http://ehealth.bc.ca/cznSub/fhir/"
          },
          {
            "identity": "source-HA-2022",
            "map": "fullURL + \"Patient/\" + (Patient ID)"
          }
        ]
      },
      {
        "id": "MessageHeader.focus.type",
        "path": "MessageHeader.focus.type",
        "max": "0"
      },
      {
        "id": "MessageHeader.focus.identifier",
        "path": "MessageHeader.focus.identifier",
        "max": "0"
      },
      {
        "id": "MessageHeader.focus.display",
        "path": "MessageHeader.focus.display",
        "max": "0"
      },
      {
        "id": "MessageHeader.definition",
        "path": "MessageHeader.definition",
        "max": "0"
      }
    ]
  }
}