{
  "resourceType": "StructureDefinition",
  "id": "FTCommunication-1d466f50-d185-4d0e-9206-c12a5a789d28",
  "url": "https://www.esante.lu/fhir-spec/StructureDefinition/FTCommunication",
  "version": "0.0.1",
  "name": "FTCommunication",
  "status": "draft",
  "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",
        "short": "Sending the lab result as XML and/or PDF to a heealth professional"
      },
      {
        "id": "Communication.meta",
        "path": "Communication.meta",
        "min": 1
      },
      {
        "id": "Communication.meta.id",
        "path": "Communication.meta.id",
        "max": "0"
      },
      {
        "id": "Communication.meta.versionId",
        "path": "Communication.meta.versionId",
        "max": "0"
      },
      {
        "id": "Communication.meta.lastUpdated",
        "path": "Communication.meta.lastUpdated",
        "max": "0"
      },
      {
        "id": "Communication.meta.source",
        "path": "Communication.meta.source",
        "max": "0"
      },
      {
        "id": "Communication.meta.profile",
        "path": "Communication.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://www.esante.lu/fhir-spec/StructureDefinition/FTCommunication"
      },
      {
        "id": "Communication.meta.security",
        "path": "Communication.meta.security",
        "max": "0"
      },
      {
        "id": "Communication.meta.tag",
        "path": "Communication.meta.tag",
        "max": "0"
      },
      {
        "id": "Communication.implicitRules",
        "path": "Communication.implicitRules",
        "max": "0"
      },
      {
        "id": "Communication.language",
        "path": "Communication.language",
        "max": "0"
      },
      {
        "id": "Communication.text",
        "path": "Communication.text",
        "max": "0"
      },
      {
        "id": "Communication.contained",
        "path": "Communication.contained",
        "max": "0"
      },
      {
        "id": "Communication.extension",
        "path": "Communication.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "closed"
        },
        "short": "The link to the CDA sent on the DSP"
      },
      {
        "id": "Communication.extension:CDAReference",
        "path": "Communication.extension",
        "sliceName": "CDAReference",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/CDAReferenceExt"
            ]
          }
        ]
      },
      {
        "id": "Communication.identifier",
        "path": "Communication.identifier",
        "short": "An identifier for the Communication",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPSimpleIdentifier"
            ]
          }
        ]
      },
      {
        "id": "Communication.instantiatesCanonical",
        "path": "Communication.instantiatesCanonical",
        "max": "0"
      },
      {
        "id": "Communication.instantiatesUri",
        "path": "Communication.instantiatesUri",
        "max": "0"
      },
      {
        "id": "Communication.basedOn",
        "path": "Communication.basedOn",
        "short": "The prescription",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPLabPrescription"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Communication.basedOn.id",
        "path": "Communication.basedOn.id",
        "max": "0"
      },
      {
        "id": "Communication.basedOn.reference",
        "path": "Communication.basedOn.reference",
        "short": "Reference to the prescription by its identifier",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "CarePlan?identifier=urn:ietf:rfc:3986|urn:uuid:cb207203-5809-4fc7-8265-775b936ee511"
          }
        ],
        "condition": [
          "val-2"
        ],
        "constraint": [
          {
            "key": "val-2",
            "severity": "error",
            "human": "SHALL reference a CarePlan by its identifier",
            "expression": "startsWith('CarePlan?identifier=urn:ietf:rfc:3986|urn:uuid:') and length()=83",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/FTCommunication"
          }
        ]
      },
      {
        "id": "Communication.basedOn.type",
        "path": "Communication.basedOn.type",
        "max": "0"
      },
      {
        "id": "Communication.basedOn.identifier",
        "path": "Communication.basedOn.identifier",
        "max": "0"
      },
      {
        "id": "Communication.basedOn.display",
        "path": "Communication.basedOn.display",
        "max": "0"
      },
      {
        "id": "Communication.partOf",
        "path": "Communication.partOf",
        "max": "0"
      },
      {
        "id": "Communication.inResponseTo",
        "path": "Communication.inResponseTo",
        "max": "0"
      },
      {
        "id": "Communication.status",
        "path": "Communication.status",
        "condition": [
          "val-commStatus"
        ],
        "constraint": [
          {
            "key": "val-commStatus",
            "severity": "error",
            "human": "Only the statuses in-progress, completed, stopped and  entered-in-error are used",
            "expression": "($this = 'in-progress') or ($this = 'completed') or ($this = 'entered-in-error')  or ($this = 'stopped')",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/FTCommunication"
          }
        ]
      },
      {
        "id": "Communication.statusReason",
        "path": "Communication.statusReason",
        "max": "0"
      },
      {
        "id": "Communication.category",
        "path": "Communication.category",
        "definition": "Constant",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Communication.category.id",
        "path": "Communication.category.id",
        "max": "0"
      },
      {
        "id": "Communication.category.coding",
        "path": "Communication.category.coding",
        "min": 1,
        "max": "1",
        "fixedCoding": {
          "code": "FT_DOCS",
          "system": "https://www.esante.lu/fhir-spec/CodeSystem/EPrescCategories"
        }
      },
      {
        "id": "Communication.category.coding.id",
        "path": "Communication.category.coding.id",
        "max": "0"
      },
      {
        "id": "Communication.category.coding.system",
        "path": "Communication.category.coding.system",
        "min": 1
      },
      {
        "id": "Communication.category.coding.version",
        "path": "Communication.category.coding.version",
        "max": "0"
      },
      {
        "id": "Communication.category.coding.code",
        "path": "Communication.category.coding.code",
        "min": 1
      },
      {
        "id": "Communication.category.coding.display",
        "path": "Communication.category.coding.display",
        "max": "0"
      },
      {
        "id": "Communication.category.coding.userSelected",
        "path": "Communication.category.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Communication.category.text",
        "path": "Communication.category.text",
        "max": "0"
      },
      {
        "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.topic",
        "path": "Communication.topic",
        "max": "0"
      },
      {
        "id": "Communication.about",
        "path": "Communication.about",
        "max": "0"
      },
      {
        "id": "Communication.encounter",
        "path": "Communication.encounter",
        "max": "0"
      },
      {
        "id": "Communication.sent",
        "path": "Communication.sent",
        "min": 1
      },
      {
        "id": "Communication.recipient",
        "path": "Communication.recipient",
        "short": "The health professionals to send to, included in the Bundle",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/FTPractitioner"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Communication.recipient.reference",
        "path": "Communication.recipient.reference",
        "min": 1,
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:43b25517-9ab1-4a3b-96b0-809e7f118c41"
          }
        ]
      },
      {
        "id": "Communication.recipient.type",
        "path": "Communication.recipient.type",
        "max": "0"
      },
      {
        "id": "Communication.recipient.identifier",
        "path": "Communication.recipient.identifier",
        "max": "0"
      },
      {
        "id": "Communication.recipient.display",
        "path": "Communication.recipient.display",
        "max": "0"
      },
      {
        "id": "Communication.reasonCode",
        "path": "Communication.reasonCode",
        "max": "0"
      },
      {
        "id": "Communication.reasonReference",
        "path": "Communication.reasonReference",
        "short": "Result transmitted by this Communication",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/FTDiagReport"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ],
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:43b25517-9ab1-4a3b-96b0-809e7f118c41"
          }
        ]
      },
      {
        "id": "Communication.payload",
        "path": "Communication.payload",
        "slicing": {
          "discriminator": [
            {
              "type": "profile",
              "path": "content.ofType(Reference).resolve()"
            }
          ],
          "rules": "closed"
        },
        "max": "1"
      },
      {
        "id": "Communication.payload:pdf",
        "path": "Communication.payload",
        "sliceName": "pdf",
        "short": "Reference to a PDF Document",
        "definition": "This payload must only be used if the PDF Document is different for the targeted requester (Communication) - If the document is common, it must be supplied in the DiagnosticReport",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Communication.payload:pdf.content[x]",
        "path": "Communication.payload.content[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Resource"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Communication.payload:pdf.contentReference",
        "path": "Communication.payload.contentReference",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/FTResPDF"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ],
        "example": [
          {
            "label": "Example",
            "valueString": "urn:uuid:43b25517-9ab1-4a3b-96b0-809e7f118c41"
          }
        ]
      },
      {
        "id": "Communication.payload:pdf.contentReference.reference",
        "path": "Communication.payload.contentReference.reference",
        "min": 1
      },
      {
        "id": "Communication.payload:pdf.contentReference.type",
        "path": "Communication.payload.contentReference.type",
        "max": "0"
      },
      {
        "id": "Communication.payload:pdf.contentReference.identifier",
        "path": "Communication.payload.contentReference.identifier",
        "max": "0"
      },
      {
        "id": "Communication.payload:pdf.contentReference.display",
        "path": "Communication.payload.contentReference.display",
        "max": "0"
      },
      {
        "id": "Communication.note",
        "path": "Communication.note",
        "max": "0"
      }
    ]
  }
}