{
  "resourceType": "StructureDefinition",
  "id": "Profile-Communication-External",
  "url": "https://health.gov.on.ca/idms/fhir/StructureDefinition/Communication-External",
  "version": "1.0.0",
  "name": "ClientCommunication",
  "title": "Communication External",
  "status": "active",
  "description": "Communications between the IDMS system and the External Companies.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Communication",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Communication",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Communication",
        "path": "Communication",
        "definition": "#### **_`IDMS:  This is used to record data exchanges between IDMS and Client Systems.  This includes sending submission data and the client sending status updates and files`_**\n\n\nAn occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition."
      },
      {
        "id": "Communication.extension",
        "path": "Communication.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Communication.extension:externalIndicator",
        "path": "Communication.extension",
        "sliceName": "externalIndicator",
        "definition": "#### **_`IDMS: Indicates this is was created by external user.`_**",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://health.gov.on.ca/idms/fhir/StructureDefinition/Extension-External-Indicator"
            ]
          }
        ]
      },
      {
        "id": "Communication.identifier",
        "path": "Communication.identifier",
        "max": "0"
      },
      {
        "id": "Communication.instantiatesCanonical",
        "path": "Communication.instantiatesCanonical",
        "max": "0"
      },
      {
        "id": "Communication.instantiatesUri",
        "path": "Communication.instantiatesUri",
        "max": "0"
      },
      {
        "id": "Communication.basedOn",
        "path": "Communication.basedOn",
        "definition": "#### **_`IDMS:  This is a reference to the Request.`_**\n\nAn order, proposal or plan fulfilled in whole or in part by this Communication.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://health.gov.on.ca/idms/fhir/StructureDefinition/IDMS-ServiceRequest-New"
            ]
          }
        ]
      },
      {
        "id": "Communication.partOf",
        "path": "Communication.partOf",
        "definition": "#### **_`IDMS:  If this is an Additional Information Submission communication this is a reference to that Child Request.`_**",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://health.gov.on.ca/idms/fhir/StructureDefinition/IDMS-ServiceRequest-Child-Submission"
            ]
          }
        ]
      },
      {
        "id": "Communication.inResponseTo",
        "path": "Communication.inResponseTo",
        "max": "0"
      },
      {
        "id": "Communication.status",
        "path": "Communication.status",
        "definition": "#### **_`IDMS: Use 'completed' if it was sucessful and 'entered-in-error' for errors.`_**\n\nThe status of the transmission."
      },
      {
        "id": "Communication.statusReason",
        "path": "Communication.statusReason",
        "definition": "#### **_`IDMS: This is the code for the IDMS error message.`_**\n\nThe status of the transmission.",
        "binding": {
          "strength": "required",
          "valueSet": "http://health.gov.on.ca/sadie/fhir/ValueSet/FlexForms-ClientCommunication-Errors"
        },
        "max": "0"
      },
      {
        "id": "Communication.category",
        "path": "Communication.category",
        "definition": "#### **_`SUBMISSION`_**\n #### **_`code:COMMUNICATION-TYPE-SUBMISSION  ; system:https://health.gov.on.ca/idms/fhir/CodeSystem/IDMS-Internal ; display:Request Submitted  `_**\n\n #### **_`ADDITIONAL INFORMATION`_**\n #### **_`code:  COMMUNICATION-TYPE-ADDITIONAL-INFO; system:https://health.gov.on.ca/idms/fhir/CodeSystem/IDMS-Internal ; display:Additional Information Submitted `_**",
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "http://health.gov.on.ca/sadie/fhir/ValueSet/FlexForms-CommunicationTypes"
        }
      },
      {
        "id": "Communication.priority",
        "path": "Communication.priority",
        "max": "0"
      },
      {
        "id": "Communication.medium",
        "path": "Communication.medium",
        "max": "0"
      },
      {
        "id": "Communication.subject",
        "path": "Communication.subject",
        "max": "0"
      },
      {
        "id": "Communication.subject.reference",
        "path": "Communication.subject.reference",
        "max": "0"
      },
      {
        "id": "Communication.subject.type",
        "path": "Communication.subject.type",
        "max": "0"
      },
      {
        "id": "Communication.subject.identifier",
        "path": "Communication.subject.identifier",
        "max": "0"
      },
      {
        "id": "Communication.subject.display",
        "path": "Communication.subject.display",
        "max": "0"
      },
      {
        "id": "Communication.topic",
        "path": "Communication.topic",
        "max": "0"
      },
      {
        "id": "Communication.about",
        "path": "Communication.about",
        "max": "0"
      },
      {
        "id": "Communication.about.reference",
        "path": "Communication.about.reference",
        "max": "0"
      },
      {
        "id": "Communication.about.type",
        "path": "Communication.about.type",
        "max": "0"
      },
      {
        "id": "Communication.about.identifier",
        "path": "Communication.about.identifier",
        "max": "0"
      },
      {
        "id": "Communication.about.display",
        "path": "Communication.about.display",
        "max": "0"
      },
      {
        "id": "Communication.encounter",
        "path": "Communication.encounter",
        "max": "0"
      },
      {
        "id": "Communication.sent",
        "path": "Communication.sent",
        "definition": "#### **_`IDMS:  If DIRECT is doing the sending then this is populated otherwise it is null`_**\n\nThe time when this communication was sent."
      },
      {
        "id": "Communication.received",
        "path": "Communication.received",
        "definition": "#### **_`IDMS:  If DIRECT is doing the receiving then this is populated otherwise it is null`_**\n\nThe time when this communication arrived at the destination."
      },
      {
        "id": "Communication.recipient",
        "path": "Communication.recipient",
        "definition": "#### **_`IDMS:  If DIRECT is doing the sending then the reference will be populated with a reference to the Organization and display will be populated with the Organization Name.   If DIRECT is receiving then the reference is null and the display = DIRECT`_**\n\n\n.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ]
      },
      {
        "id": "Communication.recipient.type",
        "path": "Communication.recipient.type",
        "max": "0"
      },
      {
        "id": "Communication.recipient.identifier",
        "path": "Communication.recipient.identifier",
        "max": "0"
      },
      {
        "id": "Communication.sender",
        "path": "Communication.sender",
        "definition": "#### **_`IDMS:  If DIRECT is doing the receiving then the reference will be populated with a reference to the Organization and display will be populated with the Organization Namee.   If DIRECT is sending then the reference is null and the display = DIRECT`_**\n\n",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ]
      },
      {
        "id": "Communication.sender.type",
        "path": "Communication.sender.type",
        "max": "0"
      },
      {
        "id": "Communication.sender.identifier",
        "path": "Communication.sender.identifier",
        "max": "0"
      },
      {
        "id": "Communication.reason",
        "path": "Communication.reason",
        "max": "0"
      },
      {
        "id": "Communication.reasonCode",
        "path": "Communication.reasonCode",
        "max": "0"
      },
      {
        "id": "Communication.reasonReference",
        "path": "Communication.reasonReference",
        "max": "0"
      },
      {
        "id": "Communication.payload",
        "path": "Communication.payload",
        "definition": "#### **_`IDMS:  There are two types of payloads, the attachment stored in the BINARY and the attachment stored in SHAREPOINT.`_**\n\n"
      },
      {
        "id": "Communication.payload.contentCodeableConcept",
        "path": "Communication.payload.contentCodeableConcept",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment",
        "path": "Communication.payload.contentAttachment",
        "min": 1
      },
      {
        "id": "Communication.payload.contentAttachment.extension",
        "path": "Communication.payload.contentAttachment.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Communication.payload.contentAttachment.extension:documentManagmentLocation",
        "path": "Communication.payload.contentAttachment.extension",
        "sliceName": "documentManagmentLocation",
        "definition": "#### **_`SHAREPOINT: 'SharePoint'. BINARY: It is not populated.`_**",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://health.gov.on.ca/idms/fhir/StructureDefinition/DocumentManagmentLocation"
            ]
          }
        ]
      },
      {
        "id": "Communication.payload.contentAttachment.contentType",
        "path": "Communication.payload.contentAttachment.contentType",
        "definition": "#### **_`SHAREPOINT and BINARY: 'application/pdf'`_**\n\n",
        "min": 1
      },
      {
        "id": "Communication.payload.contentAttachment.language",
        "path": "Communication.payload.contentAttachment.language",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment.data",
        "path": "Communication.payload.contentAttachment.data",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment.url",
        "path": "Communication.payload.contentAttachment.url",
        "definition": "#### **_`SHAREPOINT: The name of the file. BINARY: The Binary resource id.`_**\n\n",
        "min": 1
      },
      {
        "id": "Communication.payload.contentAttachment.size",
        "path": "Communication.payload.contentAttachment.size",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment.hash",
        "path": "Communication.payload.contentAttachment.hash",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment.title",
        "path": "Communication.payload.contentAttachment.title",
        "definition": "#### **_`SHAREPOINT and BINARY: 'Submission Summary'`_**\n\n",
        "min": 1
      },
      {
        "id": "Communication.payload.contentAttachment.creation",
        "path": "Communication.payload.contentAttachment.creation",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment.height",
        "path": "Communication.payload.contentAttachment.height",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment.width",
        "path": "Communication.payload.contentAttachment.width",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment.frames",
        "path": "Communication.payload.contentAttachment.frames",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment.duration",
        "path": "Communication.payload.contentAttachment.duration",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentAttachment.pages",
        "path": "Communication.payload.contentAttachment.pages",
        "max": "0"
      },
      {
        "id": "Communication.payload.contentReference",
        "path": "Communication.payload.contentReference",
        "max": "0"
      },
      {
        "id": "Communication.note",
        "path": "Communication.note",
        "definition": "#### **_`IDMS:  This is a description of what the client asked to be changed. Example: (Custom Status = 'Processed',   Request Status = 'Completed')  This will appear on the UI under Communication History`_**\n\nAdditional notes or commentary about the communication by the sender, receiver or other interested parties.",
        "max": "0"
      }
    ]
  }
}