{
  "resourceType": "StructureDefinition",
  "id": "matrixconversation-profile",
  "url": "http://fhir.xt.dev/StructureDefinition/MatrixConversation",
  "version": "1.0.1",
  "name": "MatrixConversation",
  "status": "draft",
  "date": "2024-10-10T07:29:31.6535318+00:00",
  "publisher": "x-tention Informationstechnologie GmbH",
  "contact": [
    {
      "telecom": [
        {
          "system": "email",
          "value": "fhir.profiling@x-tention.com",
          "use": "work"
        }
      ]
    }
  ],
  "description": "A record of a chat conversation using the Matrix protocol between two or more participants.",
  "copyright": "x-tention Informationstechnologie GmbH",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Communication",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Communication",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Communication.identifier",
        "path": "Communication.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type.coding.system"
            },
            {
              "type": "value",
              "path": "type.coding.code"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Communication.identifier:roomId",
        "path": "Communication.identifier",
        "sliceName": "roomId",
        "short": "Matrix Chat Room Identifier",
        "max": "1"
      },
      {
        "id": "Communication.identifier:roomId.type",
        "path": "Communication.identifier.type",
        "min": 1
      },
      {
        "id": "Communication.identifier:roomId.type.coding",
        "path": "Communication.identifier.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Communication.identifier:roomId.type.coding.system",
        "path": "Communication.identifier.type.coding.system",
        "min": 1,
        "fixedUri": "http://fhir.xt.dev/CodeSystem/IdentifierType"
      },
      {
        "id": "Communication.identifier:roomId.type.coding.code",
        "path": "Communication.identifier.type.coding.code",
        "min": 1,
        "fixedCode": "MXRM"
      },
      {
        "id": "Communication.identifier:roomId.system",
        "path": "Communication.identifier.system",
        "min": 1,
        "fixedUri": "urn:ietf:rfc:3986"
      },
      {
        "id": "Communication.identifier:roomId.value",
        "path": "Communication.identifier.value",
        "short": "roomID as a matrix URI",
        "definition": "The roomId in the matrix URI format, starting with \"matrix:roomid/\" followed by the roomID, then a colon and then the server name. A room with roomID 12345 at server \"matrix.example.org\" would result in \"matrix:roomid/12345:matrix.example.org\".",
        "min": 1
      },
      {
        "id": "Communication.basedOn",
        "path": "Communication.basedOn",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Task"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Communication.basedOn.reference",
        "path": "Communication.basedOn.reference",
        "min": 1
      },
      {
        "id": "Communication.category.coding",
        "path": "Communication.category.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            },
            {
              "type": "value",
              "path": "code"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Communication.category.coding:systemCommunicationCategory",
        "path": "Communication.category.coding",
        "sliceName": "systemCommunicationCategory",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Communication.category.coding:systemCommunicationCategory.system",
        "path": "Communication.category.coding.system",
        "min": 1,
        "fixedUri": "http://fhir.xt.dev/CodeSystem/SystemCommunicationCategories"
      },
      {
        "id": "Communication.category.coding:systemCommunicationCategory.code",
        "path": "Communication.category.coding.code",
        "min": 1,
        "fixedCode": "facilitated-matrix"
      },
      {
        "id": "Communication.medium",
        "path": "Communication.medium",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Communication.medium.coding",
        "path": "Communication.medium.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Communication.medium.coding.system",
        "path": "Communication.medium.coding.system",
        "min": 1,
        "fixedUri": "http://fhir.xt.dev/CodeSystem/ConnectionTypes"
      },
      {
        "id": "Communication.medium.coding.code",
        "path": "Communication.medium.coding.code",
        "min": 1,
        "fixedCode": "matrix"
      },
      {
        "id": "Communication.subject",
        "path": "Communication.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Communication.subject.reference",
        "path": "Communication.subject.reference",
        "min": 1
      },
      {
        "id": "Communication.topic",
        "path": "Communication.topic",
        "min": 1
      },
      {
        "id": "Communication.topic.text",
        "path": "Communication.topic.text",
        "min": 1
      },
      {
        "id": "Communication.about",
        "path": "Communication.about",
        "short": "Focus of the conversation",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Appointment"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Communication.about.reference",
        "path": "Communication.about.reference",
        "min": 1
      },
      {
        "id": "Communication.recipient",
        "path": "Communication.recipient",
        "short": "Chat Room Participants",
        "min": 1
      }
    ]
  }
}