{
  "resourceType": "StructureDefinition",
  "id": "taskforpatient-profile",
  "url": "http://fhir.xt.dev/StructureDefinition/TaskForPatient",
  "version": "2.1.0",
  "name": "TaskForPatient",
  "status": "active",
  "date": "2026-07-29T20:13:37.6670843+00:00",
  "publisher": "x-tention Informationstechnologie GmbH",
  "contact": [
    {
      "telecom": [
        {
          "system": "email",
          "value": "fhir.profiling@x-tention.com",
          "use": "work"
        }
      ]
    }
  ],
  "description": "A Task that is meant to be fulfilled by a Patient or their RelatedPersons (in case of representatives).",
  "copyright": "x-tention Informationstechnologie GmbH",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Task",
  "baseDefinition": "http://fhir.xt.dev/StructureDefinition/BaseTask",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Task.extension:performer",
        "path": "Task.extension",
        "sliceName": "performer"
      },
      {
        "id": "Task.extension:performer.value[x]:valueCodeableConcept",
        "path": "Task.extension.value[x]",
        "sliceName": "valueCodeableConcept"
      },
      {
        "id": "Task.extension:performer.value[x]:valueCodeableConcept.coding",
        "path": "Task.extension.value[x].coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Task.extension:performer.value[x]:valueCodeableConcept.coding.system",
        "path": "Task.extension.value[x].coding.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
      },
      {
        "id": "Task.extension:performer.value[x]:valueCodeableConcept.coding.code",
        "path": "Task.extension.value[x].coding.code",
        "min": 1,
        "fixedCode": "PPRF"
      },
      {
        "id": "Task.extension:performer.value[x]:valueCodeableConcept.coding.userSelected",
        "path": "Task.extension.value[x].coding.userSelected",
        "max": "0"
      },
      {
        "id": "Task.extension:performer.value[x]:valueCodeableConcept.text",
        "path": "Task.extension.value[x].text",
        "max": "0"
      },
      {
        "id": "Task.extension:performer.value[x]:valueReference",
        "path": "Task.extension.value[x]",
        "sliceName": "valueReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Task.extension:performer.value[x]:valueReference.reference",
        "path": "Task.extension.value[x].reference",
        "short": "Literal reference",
        "min": 1
      },
      {
        "id": "Task.extension:performer.value[x]:valueReference.identifier",
        "path": "Task.extension.value[x].identifier",
        "max": "0"
      },
      {
        "id": "Task.extension:requestedPerformer",
        "path": "Task.extension",
        "sliceName": "requestedPerformer",
        "max": "0"
      },
      {
        "id": "Task.identifier",
        "path": "Task.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type.coding.system"
            },
            {
              "type": "value",
              "path": "type.coding.code"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Task.identifier:ormTaskIdentifier",
        "path": "Task.identifier",
        "sliceName": "ormTaskIdentifier",
        "short": "Task Identifier based on ORC.2",
        "max": "1"
      },
      {
        "id": "Task.identifier:ormTaskIdentifier.type",
        "path": "Task.identifier.type",
        "min": 1
      },
      {
        "id": "Task.identifier:ormTaskIdentifier.type.coding",
        "path": "Task.identifier.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Task.identifier:ormTaskIdentifier.type.coding.system",
        "path": "Task.identifier.type.coding.system",
        "min": 1,
        "fixedUri": "http://fhir.xt.dev/CodeSystem/IdentifierType"
      },
      {
        "id": "Task.identifier:ormTaskIdentifier.type.coding.version",
        "path": "Task.identifier.type.coding.version",
        "max": "0"
      },
      {
        "id": "Task.identifier:ormTaskIdentifier.type.coding.code",
        "path": "Task.identifier.type.coding.code",
        "min": 1,
        "fixedCode": "EORD"
      },
      {
        "id": "Task.identifier:ormTaskIdentifier.type.coding.userSelected",
        "path": "Task.identifier.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Task.identifier:ormTaskIdentifier.type.text",
        "path": "Task.identifier.type.text",
        "max": "0"
      },
      {
        "id": "Task.identifier:ormTaskIdentifier.system",
        "path": "Task.identifier.system",
        "min": 1
      },
      {
        "id": "Task.identifier:ormTaskIdentifier.value",
        "path": "Task.identifier.value",
        "min": 1
      },
      {
        "id": "Task.instantiatesUri",
        "path": "Task.instantiatesUri",
        "definition": "The URL identifying the workflow, normally starting with http://workflow.xt.dev/ for all standard x-tention workflows."
      },
      {
        "id": "Task.businessStatus",
        "path": "Task.businessStatus",
        "max": "0"
      },
      {
        "id": "Task.intent",
        "path": "Task.intent",
        "short": "plan | order",
        "definition": "Tasks for patients currently only support 2 modes, \"plan\" for suggested actions and \"order\" for required actions."
      },
      {
        "id": "Task.code",
        "path": "Task.code",
        "min": 1,
        "binding": {
          "strength": "extensible",
          "description": "Codes to identify the type of task for the patient",
          "valueSet": "http://fhir.xt.dev/ValueSet/PatientTaskTypes"
        }
      },
      {
        "id": "Task.code.coding",
        "path": "Task.code.coding",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "extensible",
          "valueSet": "http://fhir.xt.dev/ValueSet/PatientTaskTypes"
        }
      },
      {
        "id": "Task.code.coding.system",
        "path": "Task.code.coding.system",
        "min": 1
      },
      {
        "id": "Task.code.coding.code",
        "path": "Task.code.coding.code",
        "min": 1
      },
      {
        "id": "Task.code.coding.userSelected",
        "path": "Task.code.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Task.code.text",
        "path": "Task.code.text",
        "max": "0"
      },
      {
        "id": "Task.description",
        "path": "Task.description",
        "min": 1
      },
      {
        "id": "Task.for",
        "path": "Task.for",
        "definition": "The patient who benefits from the performance of the service specified in the task.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Task.for.reference",
        "path": "Task.for.reference",
        "short": "Literal reference to Patient",
        "definition": "A literal reference to the Patient resource. The reference must be a relative reference relative to the service base URL.",
        "min": 1
      },
      {
        "id": "Task.for.identifier",
        "path": "Task.for.identifier",
        "max": "0"
      },
      {
        "id": "Task.authoredOn",
        "path": "Task.authoredOn",
        "min": 1
      },
      {
        "id": "Task.lastModified",
        "path": "Task.lastModified",
        "min": 1
      },
      {
        "id": "Task.requester",
        "path": "Task.requester",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Task.requester.reference",
        "path": "Task.requester.reference",
        "min": 1
      },
      {
        "id": "Task.requester.identifier",
        "path": "Task.requester.identifier",
        "max": "0"
      },
      {
        "id": "Task.performerType",
        "path": "Task.performerType",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.code"
            }
          ],
          "rules": "closed"
        },
        "definition": "Requesters can set this to PAT to denote a task that should not be performed by representatives or to GUARD to denote a task that should only be performed by representatives. GUARD covers all supported forms of representatives. It can only be set to one of the two. If both the patient and the representatives may perform this task then the performerType must be left empty.",
        "max": "1"
      },
      {
        "id": "Task.performerType:patientOnly",
        "path": "Task.performerType",
        "sliceName": "patientOnly",
        "max": "1"
      },
      {
        "id": "Task.performerType:patientOnly.coding",
        "path": "Task.performerType.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Task.performerType:patientOnly.coding.system",
        "path": "Task.performerType.coding.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v3-RoleClass"
      },
      {
        "id": "Task.performerType:patientOnly.coding.version",
        "path": "Task.performerType.coding.version",
        "max": "0"
      },
      {
        "id": "Task.performerType:patientOnly.coding.code",
        "path": "Task.performerType.coding.code",
        "min": 1,
        "fixedCode": "PAT"
      },
      {
        "id": "Task.performerType:patientOnly.coding.userSelected",
        "path": "Task.performerType.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Task.performerType:patientOnly.text",
        "path": "Task.performerType.text",
        "max": "0"
      },
      {
        "id": "Task.performerType:guardianOnly",
        "path": "Task.performerType",
        "sliceName": "guardianOnly",
        "max": "1"
      },
      {
        "id": "Task.performerType:guardianOnly.coding",
        "path": "Task.performerType.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Task.performerType:guardianOnly.coding.system",
        "path": "Task.performerType.coding.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/v3-RoleClass"
      },
      {
        "id": "Task.performerType:guardianOnly.coding.version",
        "path": "Task.performerType.coding.version",
        "max": "0"
      },
      {
        "id": "Task.performerType:guardianOnly.coding.code",
        "path": "Task.performerType.coding.code",
        "min": 1,
        "fixedCode": "GUARD"
      },
      {
        "id": "Task.performerType:guardianOnly.coding.userSelected",
        "path": "Task.performerType.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Task.performerType:guardianOnly.text",
        "path": "Task.performerType.text",
        "max": "0"
      },
      {
        "id": "Task.owner",
        "path": "Task.owner",
        "comment": "This type of Task may only be created with an identified owner.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Task.owner.reference",
        "path": "Task.owner.reference",
        "short": "Literal reference to Patient",
        "definition": "A literal reference to the Patient resource. The reference must be a relative reference relative to the service base URL.",
        "min": 1
      },
      {
        "id": "Task.owner.identifier",
        "path": "Task.owner.identifier",
        "max": "0"
      },
      {
        "id": "Task.location",
        "path": "Task.location",
        "max": "0"
      },
      {
        "id": "Task.reasonCode",
        "path": "Task.reasonCode",
        "max": "0"
      },
      {
        "id": "Task.reasonReference",
        "path": "Task.reasonReference",
        "max": "0"
      }
    ]
  }
}