{
  "resourceType": "StructureDefinition",
  "id": "KT2Task",
  "language": "nl-NL",
  "url": "http://koppeltaal.nl/fhir/StructureDefinition/KT2Task",
  "version": "0.8.1",
  "name": "KT2_Task",
  "status": "draft",
  "date": "2023-01-24",
  "publisher": "VZVZ",
  "contact": [
    {
      "name": "VZVZ",
      "telecom": [
        {
          "system": "email",
          "value": "standaardisatie@vzvz.nl",
          "use": "work"
        }
      ]
    }
  ],
  "description": "The Task resource represents an eHealth activity that has been assigned to a specific patient. It tracks the lifecycle of patient assignments, from initial creation through completion, and may include subtasks for complex multi-step interventions. Tasks are created based on ActivityDefinition resources and managed throughout their execution within the Koppeltaal ecosystem.",
  "jurisdiction": [
    {
      "coding": [
        {
          "code": "NL",
          "system": "urn:iso:std:iso:3166",
          "display": "Netherlands"
        }
      ]
    }
  ],
  "copyright": "VZVZ",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Task",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Task",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Task",
        "path": "Task",
        "definition": "An eHealth activity assigned to a patient."
      },
      {
        "id": "Task.extension",
        "path": "Task.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Task.extension:resource-origin",
        "path": "Task.extension",
        "sliceName": "resource-origin",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://koppeltaal.nl/fhir/StructureDefinition/resource-origin"
            ]
          }
        ]
      },
      {
        "id": "Task.extension:instantiates",
        "path": "Task.extension",
        "sliceName": "instantiates",
        "short": "Reference to ActivityDefinition",
        "definition": "Reference to the ActivityDefinition, which conforms to the KT2_ActivityDefinition profile.",
        "comment": "Use this extension to refer to the ActivityDefinition it instantiates.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://vzvz.nl/fhir/StructureDefinition/instantiates"
            ]
          }
        ]
      },
      {
        "id": "Task.identifier",
        "path": "Task.identifier",
        "min": 1
      },
      {
        "id": "Task.instantiatesCanonical",
        "path": "Task.instantiatesCanonical",
        "comment": "As of 2023-11-02 this element is no longer used in Koppeltaal 2.0. Use the extension `instantiates` instead.",
        "type": [
          {
            "code": "canonical",
            "targetProfile": [
              "http://koppeltaal.nl/fhir/StructureDefinition/KT2ActivityDefinition"
            ]
          }
        ]
      },
      {
        "id": "Task.instantiatesUri",
        "path": "Task.instantiatesUri",
        "max": "0"
      },
      {
        "id": "Task.basedOn",
        "path": "Task.basedOn",
        "max": "0"
      },
      {
        "id": "Task.groupIdentifier",
        "path": "Task.groupIdentifier",
        "max": "0"
      },
      {
        "id": "Task.partOf",
        "path": "Task.partOf",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://koppeltaal.nl/fhir/StructureDefinition/KT2Task"
            ]
          }
        ]
      },
      {
        "id": "Task.statusReason",
        "path": "Task.statusReason",
        "max": "0"
      },
      {
        "id": "Task.businessStatus",
        "path": "Task.businessStatus",
        "max": "0"
      },
      {
        "id": "Task.priority",
        "path": "Task.priority",
        "fixedCode": "routine"
      },
      {
        "id": "Task.code",
        "path": "Task.code",
        "comment": "See [Koppeltaal Implementation Guide](https://simplifier.net/guide/koppeltaal/Home/Profile-Specific-Notes/Task.page.md?version=current) for more information on the ValueSet",
        "binding": {
          "strength": "preferred",
          "valueSet": "http://vzvz.nl/fhir/ValueSet/koppeltaal-task-code"
        }
      },
      {
        "id": "Task.focus",
        "path": "Task.focus",
        "max": "0"
      },
      {
        "id": "Task.for",
        "path": "Task.for",
        "definition": "The patient who benefits from the performance of the service specified in the task.",
        "comment": "In Koppeltaal this element always refers to the patient for whom the task is intended.",
        "requirements": "Used to track tasks outstanding for a beneficiary.  Do not use to track the task owner or creator (see owner and creator respectively).  This _can_ also affect access control.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://koppeltaal.nl/fhir/StructureDefinition/KT2Patient"
            ]
          }
        ]
      },
      {
        "id": "Task.encounter",
        "path": "Task.encounter",
        "max": "0"
      },
      {
        "id": "Task.requester",
        "path": "Task.requester",
        "definition": "In Koppeltaal this element contains a reference to the person requesting the eHealth Task",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://koppeltaal.nl/fhir/StructureDefinition/KT2Practitioner"
            ]
          }
        ]
      },
      {
        "id": "Task.performerType",
        "path": "Task.performerType",
        "max": "0"
      },
      {
        "id": "Task.owner",
        "path": "Task.owner",
        "definition": "Practitioner, CareTeam, RelatedPerson or Patient currently responsible for task execution.",
        "comment": "In Koppeltaal the patient is usually the person who executes the task.\r\n\r\nNote, this element is not intended to be used for access restriction. That is left to the relevant applications.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://koppeltaal.nl/fhir/StructureDefinition/KT2CareTeam",
              "http://koppeltaal.nl/fhir/StructureDefinition/KT2Patient",
              "http://koppeltaal.nl/fhir/StructureDefinition/KT2Practitioner",
              "http://koppeltaal.nl/fhir/StructureDefinition/KT2RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "Task.location",
        "path": "Task.location",
        "max": "0"
      },
      {
        "id": "Task.reasonCode",
        "path": "Task.reasonCode",
        "max": "0"
      },
      {
        "id": "Task.reasonReference",
        "path": "Task.reasonReference",
        "max": "0"
      },
      {
        "id": "Task.insurance",
        "path": "Task.insurance",
        "max": "0"
      },
      {
        "id": "Task.note",
        "path": "Task.note",
        "max": "0"
      },
      {
        "id": "Task.relevantHistory",
        "path": "Task.relevantHistory",
        "max": "0"
      },
      {
        "id": "Task.restriction",
        "path": "Task.restriction",
        "max": "0"
      },
      {
        "id": "Task.input",
        "path": "Task.input",
        "max": "0"
      },
      {
        "id": "Task.output",
        "path": "Task.output",
        "max": "0"
      }
    ]
  }
}