PackagesCanonicalsLogsProblems
    Packages
    uk.nhsdigital.r4@2.4.4
    https://fhir.nhs.uk/StructureDefinition/NHSDigital-Task
{
  "description": null,
  "_filename": "NHSDigital-Task.StructureDefinition.json",
  "package_name": "uk.nhsdigital.r4",
  "date": null,
  "derivation": "constraint",
  "publisher": null,
  "fhirVersion": "4.0.1",
  "name": "NHSDigitalTask",
  "abstract": false,
  "type": "Task",
  "experimental": null,
  "resourceType": "StructureDefinition",
  "title": null,
  "package_version": "2.4.4",
  "status": "draft",
  "id": "16987e47-f5b6-47a5-9d4f-8d293e526160",
  "kind": "resource",
  "url": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Task",
  "version": null,
  "differential": {
    "element": [ {
      "id": "Task",
      "path": "Task",
      "comment": "Within NHS Digital this resource will often be associated with workflow management. \r\n\r\nSimilar concepts exist outside of NHS Digital for example a GP system has the concept of Task and this includes:\r\n\r\n- telephone patient\r\n- form to complete\r\n- prescription\r\n- referral\r\n- book appointment\r\n- medication review\r\n\r\nThese are complemented with more detailed Task management around:\r\n\r\n- pathology\r\n- medicine management and also includes EPS\r\n  - Rejected Prescriptions\r\n  - Cancelled Prescriptions\r\n  - Subsequent cancellation rejections \r\n- referrals\r\n\r\nNHS App also includes the ability to order **repeat prescriptions** which relates to the GP systems **prescriptions**.",
      "definition": "FHIR Task usage and scope is defined as \r\n\r\n> A task resource describes an activity that can be performed and tracks the state of completion of that activity. It is a representation that an activity should be or has been initiated, and eventually, represents the successful or unsuccessful completion of that activity. Note that there are a variety of processes associated with making and processing orders. Some orders may be handled immediately by automated systems but most require real world actions by one or more humans. Some orders can only be processed when other real world actions happen, such as a patient presenting themselves so that the action to be performed can actually be performed. Often these real world dependencies are only implicit in the order details.\r\n\r\n**A Task resource often exists in parallel with clinical resources.** \r\n\r\nFor example, a Task could request fulfillment of a ServiceRequest ordering a Procedure that would result in a Procedure, Observation, DiagnosticReport, ImagingStudy or similar resource. Another example would be a Task that requests fulfillment of a CommunicationRequest to be performed between various actors."
    }, {
      "id": "Task.extension",
      "min": 0,
      "path": "Task.extension",
      "slicing": {
        "rules": "open",
        "discriminator": [ {
          "path": "url",
          "type": "value"
        } ]
      }
    }, {
      "path": "Task.extension",
      "min": 0,
      "definition": "Is used as the author on request resources.",
      "short": "Provenance of the resource",
      "type": [ {
        "code": "Extension",
        "profile": [ "https://fhir.nhs.uk/StructureDefinition/Extension-Provenance-agent" ]
      } ],
      "mustSupport": true,
      "sliceName": "agent",
      "max": "1",
      "id": "Task.extension:agent"
    }, {
      "path": "Task.extension",
      "min": 0,
      "definition": "```json\r\n\"extension\":  [\r\n        {\r\n            \"url\": \"https://fhir.nhs.uk/StructureDefinition/Extension-EPS-Prescription\",\r\n            \"extension\":  [\r\n                {\r\n                    \"url\": \"courseOfTherapyType\",\r\n                    \"valueCoding\": {\r\n                        \"system\": \"http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy\",\r\n                        \"code\": \"acute\",\r\n                        \"display\": \"Acute\"\r\n                    }\r\n                }\r\n            ]\r\n        }\r\n    ],\r\n```",
      "short": "EPS Patient Tracker extension",
      "type": [ {
        "code": "Extension",
        "profile": [ "https://fhir.nhs.uk/StructureDefinition/Extension-EPS-Prescription" ]
      } ],
      "mustSupport": true,
      "sliceName": "prescription",
      "max": "1",
      "id": "Task.extension:prescription"
    }, {
      "path": "Task.extension",
      "min": 0,
      "definition": "```json\r\n\"extension\": [\r\n        {\r\n            \"url\": \"https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation\",\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"numberOfRepeatsAllowed\",\r\n                    \"valueUnsignedInt\": 6\r\n                },\r\n                {\r\n                    \"url\": \"numberOfRepeatsIssued\",\r\n                    \"valueUnsignedInt\": 2\r\n                }\r\n            ]\r\n        },\r\n```",
      "short": "Used in the EPS Prescription Tracker",
      "type": [ {
        "code": "Extension",
        "profile": [ "https://fhir.nhs.uk/StructureDefinition/Extension-EPS-RepeatInformation" ]
      } ],
      "mustSupport": true,
      "sliceName": "repeatInformation",
      "max": "1",
      "id": "Task.extension:repeatInformation"
    }, {
      "id": "Task.identifier",
      "path": "Task.identifier",
      "definition": "For **EPS**\r\n\r\nA single identifier **MUST** be present and the value must be a UUID.\r\n\r\n```json\r\n\"identifier\":  [\r\n        {\r\n            \"system\": \"https://tools.ietf.org/html/rfc4122\",\r\n            \"value\": \"5AC84C11-DB8B-44DA-8FCF-8980B3D13596\"\r\n        }\r\n    ],\r\n```",
      "mustSupport": true
    }, {
      "id": "Task.groupIdentifier",
      "path": "Task.groupIdentifier",
      "definition": "**EPS Only**\r\n\r\nAn identifier to the original `prescription-order` **MUST** be present. Only the short form identifier needs to be supplied.\r\n\r\n```json\r\n\"groupIdentifier\": {\r\n        \"system\": \"https://fhir.nhs.uk/Id/prescription-order-number\",\r\n        \"value\": \"88AF6C-C81007-00001C\"\r\n    },\r\n```",
      "mustSupport": true
    }, {
      "id": "Task.status",
      "path": "Task.status",
      "comment": "For **EPS**\r\n\r\nOnly `in-progress` is currently supported for reasonCode = 373784005 (Dispensing medication) and focus is a `dispense-notification`. \r\n\r\n`rejected` / `cancelled` / `failed` are supported for reasonCode = 33633005 (Prescription of drug) and focus is a `prescription-order`.",
      "definition": "These workflow tasks have `status` which indicates the Task status. \r\n\r\nThe following diagram reflects the \"typical\" state machine for Task. Note that not all states will be supported by all workflows and that some workflows may support additional transitions, including transitions from terminal states (e.g. back to \"in-progress\" from \"failed\" or \"completed\").\r\n\r\n\r\n\r\nFor example: \r\n\r\nA patient requesting a repeat prescription would ask for task with code `fulfil` used with `103742009 | Renewal of prescription` and a status of `requested`.  \r\nOnce reviewed (by a clinician), the task status would be changed to `accepted`. When the task is then picked up (`in-progress`) and the related *MedicationRequest* is sent, the status would change to `completed`.",
      "mustSupport": true
    }, {
      "id": "Task.statusReason",
      "path": "Task.statusReason",
      "definition": "**For EPS only**\r\n\r\n| reasonCode | focus | status | CodeSystem |\r\n|--|--|--|--|\r\n| 373784005 - Dispensing medication | `dispense-notification` | `cancelled` | [https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-withdraw-reason](https://simplifier.net/resolve?target=simplifier&scope=uk.nhsdigital.r4&canonical=https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-withdraw-reason) |\r\n| 33633005 - Prescription of drug | `prescription-order` | `rejected` / `cancelled` / `failed` |  [https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-return-status-reason](https://simplifier.net/resolve?target=simplifier&scope=uk.nhsdigital.r4&canonical=https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-return-status-reason) |\r\n\r\n```json\r\n\"statusReason\": [{\r\n        \"coding\":  [\r\n            {\r\n                \"system\": \"https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-withdraw-reason\",\r\n                \"code\": \"DA\",\r\n                \"display\": \"Dosage Amendments\"\r\n            }\r\n        ]\r\n    }]\r\n```"
    }, {
      "id": "Task.intent",
      "path": "Task.intent",
      "comment": "Is not processed by EPS and is included for FHIR compliance reasons. The value should always be `order`.",
      "mustSupport": true
    }, {
      "id": "Task.code",
      "path": "Task.code",
      "binding": {
        "strength": "extensible",
        "valueSet": "https://fhir.nhs.uk/ValueSet/England-task-code"
      },
      "definition": "**e-RS** \r\n\r\nA SNOMED CT procedure code to indicate the action\r\n\r\n```json\r\n  \"code\": {\r\n        \"coding\": [\r\n            {\r\n                \"system\": \"http://snomed.info/sct\",\r\n                \"code\": \"386053000\",\r\n                \"display\": \"Evaluation procedure\"\r\n            }\r\n        ]\r\n    },\r\n```\r\n\r\n**EPS**\r\n\r\nThe reasonCode's are complemented with [task-code](https://www.hl7.org/fhir/valueset-task-code.html) which indicates the type of action to be performed. \r\n\r\nFor example:\r\n\r\nThe code `fulfil` used with `182836005 | Review of medication` means a task to review medication.\r\nThe code `approve` used with `103742009 | Renewal of prescription` is a task for a clinician to approve the issue of a repeat medication.\r\n\r\n```json\r\n \"code\": {\r\n        \"coding\":  [\r\n            {\r\n                \"system\": \"http://hl7.org/fhir/CodeSystem/task-code\",\r\n                \"code\": \"fulfill\",\r\n                \"display\": \"Fulfill the focal request\"\r\n            }\r\n        ]\r\n ```",
      "mustSupport": true
    }, {
      "id": "Task.focus",
      "path": "Task.focus",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Appointment", "https://fhir.nhs.uk/StructureDefinition/NHSDigital-ServiceRequest", "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Bundle-FHIRMessage", "https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest" ]
      } ],
      "comment": "Tasks are often generated as a consequence of other workflows or relate to FHIR Workflow resources. For example a repeat medication request will be related to a previous `MedicationRequest` or a medication reconciliation may relate to a hospital admissions `Encounter/EpisodeOfCare`. This is carried in the `focus` element.\r\n\r\n`focus` can be omitted. For example if an ED generated a Medication Review as a result of COPD Emergency encounter they may chose to include a reference to the Encounter but they may decide instead to use a more specific reasonCode such as `394720003 | Asthma medication review`.",
      "definition": "**e-RS**\r\n\r\nReference to the resource which is the focus of the action \r\n\r\n```json\r\n \"focus\": {\r\n        \"reference\": \"https://server.fire.ly/ServiceRequest/eb13327f-e990-4667-b37a-89eb93a94c47\"\r\n    },\r\n```\r\n\r\n** EPS Only**\r\n\r\nThis will be the `Bundle.identifier` of the message this Task is acting on. \r\nFor Tasks with a reasonCode of `373784005 - Dispensing medication`  this will be a `dispense-notification` message. \r\nFor Tasks with a reasonCode of `33633005 - Prescription of drug` this will be the `prescription-order` message from the Task/$release operation.\r\n\r\n```json\r\n\"focus\": {\r\n        \"type\": \"Bundle\",\r\n        \"identifier\": {\r\n            \"system\": \"https://tools.ietf.org/html/rfc4122\",\r\n            \"value\": \"334a3195-1f6c-497a-8efe-d272ca9c4e38\"\r\n        }\r\n    },\r\n```",
      "mustSupport": true
    }, {
      "id": "Task.for",
      "min": 1,
      "path": "Task.for",
      "constraint": [ {
        "key": "patient-reference",
        "human": "An identifier reference or resource reference must be provided",
        "source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Task",
        "severity": "error",
        "expression": "(reference.exists() or identifier.exists())"
      }, {
        "key": "patient-nhs",
        "human": "NHS Number must be in the English and Welsh NHS Number range or length of the number is wrong.",
        "source": "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Claim",
        "severity": "error",
        "expression": "identifier.where(system='https://fhir.nhs.uk/Id/nhs-number').exists().not() or (identifier.where(system='https://fhir.nhs.uk/Id/nhs-number').exists()  and identifier.where(system='https://fhir.nhs.uk/Id/nhs-number').value.matches('^([456789]{1}[0-9]{9})$'))"
      } ],
      "definition": "A reference to the patient the Task is for. This will always be an identifier reference using the Patients NHSNumber.\r\n\r\n```json\r\n\"for\": {\r\n        \"identifier\": {\r\n            \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\r\n            \"value\": \"9446368138\"\r\n        }\r\n    },\r\n```",
      "mustSupport": true
    }, {
      "id": "Task.for.identifier",
      "min": 1,
      "path": "Task.for.identifier"
    }, {
      "id": "Task.for.identifier.system",
      "min": 1,
      "path": "Task.for.identifier.system",
      "fixedUri": "https://fhir.nhs.uk/Id/nhs-number"
    }, {
      "id": "Task.for.identifier.value",
      "min": 1,
      "path": "Task.for.identifier.value"
    }, {
      "id": "Task.authoredOn",
      "path": "Task.authoredOn",
      "definition": "Date and time the task was created.\r\n\r\n```json\r\n\"authoredOn\": \"2020-12-21T17:03:20-00:00\",\r\n```",
      "mustSupport": true
    }, {
      "id": "Task.requester",
      "path": "Task.requester",
      "type": [ {
        "code": "Reference",
        "aggregation": [ "contained" ],
        "targetProfile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole-Minimal" ]
      } ],
      "definition": "Who is created the Request or the Event. In NHSDigital API's this **SHOULD** always be a PractitionerRole role reference.\r\n\r\n```json\r\n \"requester\": {\r\n        \"reference\": \"#requester\"\r\n    },\r\n```\r\n\r\nThis will reference a `contained` PractitionerRole (note: this resource only contains limited user metadata such as ODS Code, professional code and SDS User Profile Id). This resource should not hold data which is held in SDS, only enough information to identify the SDS Entry,\r\n\r\n```json\r\n{\r\n    \"resourceType\": \"Task\",\r\n    \"id\": \"bd1ca5c4-ff49-4f2a-9db4-f5dda0112084\",\r\n    \"meta\": {\r\n        \"lastUpdated\": \"2016-07-11T11:07:22+00:00\"\r\n    },\r\n    \"contained\": [\r\n        {\r\n            \"resourceType\": \"PractitionerRole\",\r\n            \"id\": \"requester\",\r\n            \"practitioner\": {\r\n                \"identifier\": {\r\n                    \"system\": \"https://fhir.hl7.org.uk/Id/gmp-number\",\r\n                    \"value\": \"G8123456\"\r\n                },\r\n                \"display\": \"DR AA BHATIA\"\r\n            },\r\n            \"organization\": {\r\n                \"identifier\": {\r\n                    \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\r\n                    \"value\": \"C81007\"\r\n                },\r\n                \"display\": \"VERNON STREET MEDICAL CTR\"\r\n            },\r\n            \"telecom\": [\r\n                {\r\n                    \"system\": \"phone\",\r\n                    \"use\": \"work\",\r\n                    \"value\": \"01234567890\"\r\n                }\r\n            ]\r\n        }\r\n    ],\r\n```",
      "mustSupport": true
    }, {
      "id": "Task.requester.identifier.system",
      "min": 1,
      "path": "Task.requester.identifier.system"
    }, {
      "id": "Task.requester.identifier.value",
      "min": 1,
      "path": "Task.requester.identifier.value"
    }, {
      "id": "Task.owner",
      "path": "Task.owner",
      "type": [ {
        "code": "Reference",
        "targetProfile": [ "https://fhir.nhs.uk/StructureDefinition/NHSDigital-PractitionerRole", "https://fhir.nhs.uk/StructureDefinition/NHSDigital-Organization" ]
      } ],
      "short": "Responsible organisation",
      "definition": "**EPS**\r\n\r\nWho is responsible for actioning the request Task (e.g. for a prescription-order this will be the pharmacy). \r\n\r\n```json\r\n\"owner\": {\r\n        \"identifier\": {\r\n            \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\r\n            \"value\": \"FB444\"\r\n        },\r\n        \"display\": \"Freds Pharmacy\"\r\n    },\r\n```\r\n\r\n**e-RS**\r\n\r\n```json\r\n\"owner\": {\r\n        \"identifier\": {\r\n            \"system\": \"https://fhir.nhs.uk/Id/ers-service\",\r\n            \"value\": \"12444\"\r\n        }\r\n    },\r\n```",
      "mustSupport": true
    }, {
      "id": "Task.owner.identifier.system",
      "min": 1,
      "path": "Task.owner.identifier.system"
    }, {
      "id": "Task.owner.identifier.value",
      "min": 1,
      "path": "Task.owner.identifier.value"
    }, {
      "id": "Task.reasonCode",
      "path": "Task.reasonCode",
      "definition": "In FHIR Task these types of workflow would be represented via **reasonCode** and/or **reasonReference**\r\n\r\nFor medication this is probably SNOMED CT based using codes under the SNOMED CT 182832007 Medication management and includes codes such as:\r\n\r\n| SNOMED CT | Display |\r\n|--|--|\r\n| 182836005 | Review of medication | \r\n| 430193006 | Medication Reconciliation |\r\n| 103742009 | Renewal of prescription |\r\n| 33633005 | Prescription of drug |\r\n| 373784005 | Dispensing medication |\r\n\r\n
\r\n\r\nFor referral management\r\n\r\n| SNOMED CT | Display |\r\n|--|--|\r\n| 3457005 | Patient Referral |\r\n| 185499000| Expedite appointment |\r\n\r\n```json\r\n\r\n```", "mustSupport": true }, { "id": "Task.reasonCode.coding", "path": "Task.reasonCode.coding", "slicing": { "rules": "open", "discriminator": [ { "path": "system", "type": "value" } ] } }, { "id": "Task.reasonCode.coding.system", "min": 1, "path": "Task.reasonCode.coding.system" }, { "id": "Task.reasonCode.coding.code", "min": 1, "path": "Task.reasonCode.coding.code" }, { "id": "Task.reasonCode.coding.display", "min": 1, "path": "Task.reasonCode.coding.display" }, { "id": "Task.reasonCode.coding:SNOMED", "path": "Task.reasonCode.coding", "sliceName": "SNOMED" }, { "id": "Task.reasonCode.coding:SNOMED.system", "path": "Task.reasonCode.coding.system", "fixedUri": "http://snomed.info/sct" }, { "id": "Task.note", "path": "Task.note", "definition": "**EPS Only**\r\n\r\nThis may contain cancellation reason.\r\n\r\n**e-RS**\r\n\r\nUsed to add notes to the worklist items\r\n\r\n```json\r\n\"note\": [\r\n {\r\n \"text\": \"Optional comments\"\r\n }\r\n ]\r\n```", "mustSupport": true }, { "id": "Task.restriction", "path": "Task.restriction", "mustSupport": true }, { "id": "Task.restriction.period.end", "path": "Task.restriction.period.end", "comment": "**e-RS**\r\n\r\n- If deferred to provider (because there were no appointments available for a directly bookable service) then this is the date by which the provide should resolve the appointment slot issue; or\r\n- If the referral was sent to a triage service then this is the date by which the provider should have reviewed the referral", "definition": "In **e-RS** this is also known as the review date due.", "mustSupport": true }, { "id": "Task.input", "path": "Task.input", "mustSupport": true } ] }, "baseDefinition": "https://fhir.hl7.org.uk/StructureDefinition/UKCore-Task" }