{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://hl7.org/fhir/json-schema/Communication",
  "$ref": "#/definitions/Communication",
  "description": "see http://hl7.org/fhir/json.html#schema for information about the FHIR Json Schemas",
  "definitions": {
    "Communication": {
      "allOf": [
        {
          "$ref": "DomainResource#/definitions/DomainResource"
        },
        {
          "description": "An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.",
          "properties": {
            "resourceType": {
              "description": "This is a Communication resource",
              "type": "string",
              "enum": [
                "Communication"
              ]
            },
            "identifier": {
              "description": "Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).",
              "type": "array",
              "items": {
                "$ref": "Identifier.schema.json#/definitions/Identifier"
              }
            },
            "definition": {
              "description": "A protocol, guideline, or other definition that was adhered to in whole or in part by this communication event.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "basedOn": {
              "description": "An order, proposal or plan fulfilled in whole or in part by this Communication.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "partOf": {
              "description": "Part of this action.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "status": {
              "description": "The status of the transmission.",
              "type": "string",
              "pattern": "[^\\s]+([\\s]?[^\\s]+)*"
            },
            "_status": {
              "description": "Extensions for status",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "notDone": {
              "description": "If true, indicates that the described communication event did not actually occur.",
              "type": "boolean"
            },
            "_notDone": {
              "description": "Extensions for notDone",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "notDoneReason": {
              "description": "Describes why the communication event did not occur in coded and/or textual form.",
              "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
            },
            "category": {
              "description": "The type of message conveyed such as alert, notification, reminder, instruction, etc.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
              }
            },
            "medium": {
              "description": "A channel that was used for this communication (e.g. email, fax).",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
              }
            },
            "subject": {
              "description": "The patient or group that was the focus of this communication.",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "recipient": {
              "description": "The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "topic": {
              "description": "The resources which were responsible for or related to producing this communication.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "context": {
              "description": "The encounter within which the communication was sent.",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "sent": {
              "description": "The time when this communication was sent.",
              "type": "string",
              "pattern": "-?([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
            },
            "_sent": {
              "description": "Extensions for sent",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "received": {
              "description": "The time when this communication arrived at the destination.",
              "type": "string",
              "pattern": "-?([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
            },
            "_received": {
              "description": "Extensions for received",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "sender": {
              "description": "The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.",
              "$ref": "Reference.schema.json#/definitions/Reference"
            },
            "reasonCode": {
              "description": "The reason or justification for the communication.",
              "type": "array",
              "items": {
                "$ref": "CodeableConcept.schema.json#/definitions/CodeableConcept"
              }
            },
            "reasonReference": {
              "description": "Indicates another resource whose existence justifies this communication.",
              "type": "array",
              "items": {
                "$ref": "Reference.schema.json#/definitions/Reference"
              }
            },
            "payload": {
              "description": "Text, attachment(s), or resource(s) that was communicated to the recipient.",
              "type": "array",
              "items": {
                "$ref": "#/definitions/Communication_Payload"
              }
            },
            "note": {
              "description": "Additional notes or commentary about the communication by the sender, receiver or other interested parties.",
              "type": "array",
              "items": {
                "$ref": "Annotation.schema.json#/definitions/Annotation"
              }
            }
          },
          "required": [
            "resourceType"
          ]
        }
      ]
    },
    "Communication_Payload": {
      "allOf": [
        {
          "$ref": "BackboneElement#/definitions/BackboneElement"
        },
        {
          "description": "An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.",
          "properties": {
            "contentString": {
              "description": "A communicated content (or for multi-part communications, one portion of the communication).",
              "type": "string"
            },
            "_contentString": {
              "description": "Extensions for contentString",
              "$ref": "Element.schema.json#/definitions/Element"
            },
            "contentAttachment": {
              "description": "A communicated content (or for multi-part communications, one portion of the communication).",
              "$ref": "Attachment.schema.json#/definitions/Attachment"
            },
            "contentReference": {
              "description": "A communicated content (or for multi-part communications, one portion of the communication).",
              "$ref": "Reference.schema.json#/definitions/Reference"
            }
          }
        }
      ]
    }
  }
}