<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://fhir.nhs.uk/StructureDefinition/Framework-Task" />
  <name value="FrameworkTask" />
  <status value="draft" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Task" />
  <baseDefinition value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Task" />
  <derivation value="constraint" />
  <differential>
    <element id="Task">
      <path value="Task" />
      <definition value="FHIR Task usage and scope is defined as &#xD;&#xA;&#xD;&#xA;&gt; 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.&#xD;&#xA;&#xD;&#xA;**A Task resource often exists in parallel with clinical resources.** &#xD;&#xA;&#xD;&#xA;For 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." />
      <comment value="Task has three main uses: &#xD;&#xA;&#xD;&#xA;- basic delivery of an order resource (e.g. MedicationRequest or ServiceRequest)&#xD;&#xA;- minor workflow requests (e.g. phone patient, complete form or validate a referral)&#xD;&#xA;- workflow support (centred around complex workflow support and may involves a workflow engine)&#xD;&#xA;&#xD;&#xA;##### Order Fulfilment&#xD;&#xA;&#xD;&#xA;Centres on the fulfilment of the order. It does not contain the order details which are held in a referenced request resource. &#xD;&#xA;In the diagram below the recipient or fulfiller of the order uses FHIR Task to accept or reject the order, it also uses Task to send `event` updates. &#xD;&#xA;Note the fulfiller will use other resources to record the details of the fulfilment such as MedicationDispense for a MedicationRequest.&#xD;&#xA;&#xD;&#xA;&lt;img src=&quot;https://raw.githubusercontent.com/NHSDigital/NHSDigital-FHIR-ImplementationGuide/master/Diagams/Task-Deliver.PNG&quot; width=&quot;60%&quot;/&gt;&#xD;&#xA;&#xD;&#xA;Examples:&#xD;&#xA;&#xD;&#xA;| Task.code | Task.status | Task.focus | Task.requester | Meaning | &#xD;&#xA;|--|--|--|--|&#xD;&#xA;| fulfill | rejected | MedicationRequest | dispenser | The dispenser is rejecting the fulfilment/deliver of a referenced MedicationRequest. The MedicationRequest is not cancelled |&#xD;&#xA;| fullfill | cancelled | MedicationRequest | any | The requested fulfilment of the MedicationRequest is cancelled. The referenced MedicationRequest is not cancelled |&#xD;&#xA;| fullfill | accepted | MedicationRequest | dispenser | The dispenser is taking responsibility of fulfilling the referenced MedicationRequest. |&#xD;&#xA;| fullfill | completed | MedicationRequest | dispenser | The requested fulfilment of the MedicationRequest is completed. The referenced MedicationRequest can now be changed to completed. |&#xD;&#xA;&#xD;&#xA;See the section on `status` for more details.&#xD;&#xA;&#xD;&#xA;&lt;br/&gt;&#xD;&#xA;&#xD;&#xA;##### Minor Workflow Requests&#xD;&#xA;&#xD;&#xA;This is used to implement additional around an order or to record specific workflow requests. These may not have a focused resource reference. It is anticipated they are coded using SNOMED CT.&#xD;&#xA;&#xD;&#xA;&lt;img src=&quot;https://raw.githubusercontent.com/NHSDigital/NHSDigital-FHIR-ImplementationGuide/master/Diagams/Task-Action.PNG&quot; width=&quot;60%&quot;/&gt;&#xD;&#xA;Examples:&#xD;&#xA;&#xD;&#xA;| Task.code | Task.focus | Task.requester | Task.owner | Task.reasonCode | Meaning |&#xD;&#xA;|--|--|--|--|--|&#xD;&#xA;| 413292001 Assessment for referral | ServiceRequest | referrer |  clinician | 3457005 Patient Referral | Check the referenced referral is valid. |  &#xD;&#xA;| 182836005 Review of medication |  | clinician | GP | 151715009 Emergency admission, asthma  | Request to review medication following an emergency admission. |  &#xD;&#xA;| 103742009 Renewal of prescription | MedicationRequest | patient | GP |   | Request for a reissue/refill of a medication |  &#xD;&#xA;| 324861000000109 Review of patient laboratory test report | DiagnosticReport | consultant | |   | Request for a lab report to be reviewed. See also &lt;a href=&quot;https://nhsconnect.github.io/CareConnectAPI/engage_poc_uhscc.html&quot;&gt;UHS Lab Reports&lt;/a&gt; | &#xD;&#xA;&#xD;&#xA;The Task.status can be used to indicate fulfilment/delivery status.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&lt;br/&gt;&#xD;&#xA;&#xD;&#xA;##### Workflow Support&#xD;&#xA;&#xD;&#xA;More advanced workflow is supported, this adds in the use of Task.input and Task.output. This allows the passage of inputs and outputs which may be found in automated workflow activities.&#xD;&#xA;&#xD;&#xA;The diagram below is from an acute trusts handling of a received eRS referral request. Each process communicates via the FHIR Task, the first process takes the eRS referral and gets the referral letter from eRS, these are then passed to the clinician for triage. Once triaged, the clinician creates a book appointment Task which the admin's action.&#xD;&#xA;&#xD;&#xA;&lt;img src=&quot;https://raw.githubusercontent.com/NHSDigital/NHSDigital-FHIR-ImplementationGuide/master/Diagams/Task-automated.PNG&quot; width=&quot;60%&quot;/&gt;" />
    </element>
    <element id="Task.identifier">
      <path value="Task.identifier" />
      <definition value="For **EPS**&#xD;&#xA;&#xD;&#xA;A single identifier **MUST** be present and the value must be a UUID.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;identifier&quot;:  [&#xD;&#xA;        {&#xD;&#xA;            &quot;system&quot;: &quot;https://tools.ietf.org/html/rfc4122&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;5AC84C11-DB8B-44DA-8FCF-8980B3D13596&quot;&#xD;&#xA;        }&#xD;&#xA;    ],&#xD;&#xA;```" />
      <mustSupport value="true" />
    </element>
    <element id="Task.groupIdentifier">
      <path value="Task.groupIdentifier" />
      <definition value="**EPS Only**&#xD;&#xA;&#xD;&#xA;An identifier to the original `prescription-order` **MUST** be present. Only the short form identifier needs to be supplied.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;groupIdentifier&quot;: {&#xD;&#xA;        &quot;system&quot;: &quot;https://fhir.nhs.uk/Id/prescription-order-number&quot;,&#xD;&#xA;        &quot;value&quot;: &quot;88AF6C-C81007-00001C&quot;&#xD;&#xA;    },&#xD;&#xA;```" />
      <mustSupport value="true" />
    </element>
    <element id="Task.status">
      <path value="Task.status" />
      <definition value="These workflow tasks have `status` which indicates the Task status. &#xD;&#xA;&#xD;&#xA;The following diagram reflects the &quot;typical&quot; 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 &quot;in-progress&quot; from &quot;failed&quot; or &quot;completed&quot;).&#xD;&#xA;&#xD;&#xA;&lt;img src=&quot;https://www.hl7.org/fhir/task-state-machine.svg&quot;&gt;&lt;/img&gt;&#xD;&#xA;&#xD;&#xA;For example: &#xD;&#xA;&#xD;&#xA;A patient requesting a repeat prescription would ask for task with code `fulfil` used with `103742009 | Renewal of prescription` and a status of `requested`.  &#xD;&#xA;Once 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`." />
      <comment value="For **EPS**&#xD;&#xA;&#xD;&#xA;Only `in-progress` is currently supported for reasonCode = 373784005 (Dispensing medication) and focus is a `dispense-notification`. &#xD;&#xA;&#xD;&#xA;`rejected` / `cancelled` / `failed` are supported for reasonCode = 33633005 (Prescription of drug) and focus is a `prescription-order`." />
      <mustSupport value="true" />
    </element>
    <element id="Task.statusReason">
      <path value="Task.statusReason" />
      <definition value="**For EPS only**&#xD;&#xA;&#xD;&#xA;| reasonCode | focus | status | CodeSystem |&#xD;&#xA;|--|--|--|--|&#xD;&#xA;| 373784005 - Dispensing medication | `dispense-notification` | `cancelled` | [https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-withdraw-reason](https://simplifier.net/resolve?target=simplifier&amp;scope=uk.nhsdigital.r4&amp;canonical=https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-withdraw-reason) |&#xD;&#xA;| 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&amp;scope=uk.nhsdigital.r4&amp;canonical=https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-return-status-reason) |&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;statusReason&quot;: [{&#xD;&#xA;        &quot;coding&quot;:  [&#xD;&#xA;            {&#xD;&#xA;                &quot;system&quot;: &quot;https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-withdraw-reason&quot;,&#xD;&#xA;                &quot;code&quot;: &quot;DA&quot;,&#xD;&#xA;                &quot;display&quot;: &quot;Dosage Amendments&quot;&#xD;&#xA;            }&#xD;&#xA;        ]&#xD;&#xA;    }]&#xD;&#xA;```" />
    </element>
    <element id="Task.intent">
      <path value="Task.intent" />
      <comment value="Is not processed by EPS and is included for FHIR compliance reasons. The value should always be `order`." />
      <mustSupport value="true" />
    </element>
    <element id="Task.code">
      <path value="Task.code" />
      <definition value="**e-RS** &#xD;&#xA;&#xD;&#xA;A SNOMED CT procedure code to indicate the action&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;  &quot;code&quot;: {&#xD;&#xA;        &quot;coding&quot;: [&#xD;&#xA;            {&#xD;&#xA;                &quot;system&quot;: &quot;http://snomed.info/sct&quot;,&#xD;&#xA;                &quot;code&quot;: &quot;386053000&quot;,&#xD;&#xA;                &quot;display&quot;: &quot;Evaluation procedure&quot;&#xD;&#xA;            }&#xD;&#xA;        ]&#xD;&#xA;    },&#xD;&#xA;```&#xD;&#xA;&#xD;&#xA;**EPS**&#xD;&#xA;&#xD;&#xA;The SNOMED action codes are complemented with `order delivery` [task-code](https://www.hl7.org/fhir/valueset-task-code.html) which indicates the type of action to be performed against the focal resource. &#xD;&#xA;&#xD;&#xA;For example:&#xD;&#xA;&#xD;&#xA;The code `fulfil` used with `182836005 | Review of medication` means a task to review medication.&#xD;&#xA;The code `approve` used with `103742009 | Renewal of prescription` is a task for a clinician to approve the issue of a repeat medication.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA; &quot;code&quot;: {&#xD;&#xA;        &quot;coding&quot;:  [&#xD;&#xA;            {&#xD;&#xA;                &quot;system&quot;: &quot;http://hl7.org/fhir/CodeSystem/task-code&quot;,&#xD;&#xA;                &quot;code&quot;: &quot;fulfill&quot;,&#xD;&#xA;                &quot;display&quot;: &quot;Fulfill the focal request&quot;&#xD;&#xA;            }&#xD;&#xA;        ]&#xD;&#xA; ```" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Task.code.coding">
      <path value="Task.code.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Task.code.coding.system">
      <path value="Task.code.coding.system" />
      <min value="1" />
    </element>
    <element id="Task.code.coding.code">
      <path value="Task.code.coding.code" />
      <min value="1" />
    </element>
    <element id="Task.code.coding:SNOMED">
      <path value="Task.code.coding" />
      <sliceName value="SNOMED" />
      <binding>
        <strength value="extensible" />
        <valueSet value="https://fhir.nhs.uk/ValueSet/NHSDigital-action-code" />
      </binding>
    </element>
    <element id="Task.code.coding:SNOMED.system">
      <path value="Task.code.coding.system" />
      <fixedUri value="http://snomed.info/sct" />
    </element>
    <element id="Task.code.coding:Fulfilment">
      <path value="Task.code.coding" />
      <sliceName value="Fulfilment" />
      <binding>
        <strength value="extensible" />
        <valueSet value="https://fhir.nhs.uk/ValueSet/NHSDigital-task-code" />
      </binding>
    </element>
    <element id="Task.code.coding:Fulfilment.system">
      <path value="Task.code.coding.system" />
      <fixedUri value="http://hl7.org/fhir/CodeSystem/task-code" />
    </element>
    <element id="Task.code.coding:Worflow">
      <path value="Task.code.coding" />
      <sliceName value="Worflow" />
      <binding>
        <strength value="extensible" />
        <valueSet value="https://fhir.nhs.uk/ValueSet/NHSDigital-workflow-code" />
      </binding>
    </element>
    <element id="Task.code.coding:Worflow.system">
      <path value="Task.code.coding.system" />
      <fixedUri value="https://fhir.nhs.uk/CodeSystem/Workflow-Code" />
    </element>
    <element id="Task.focus">
      <path value="Task.focus" />
      <definition value="**e-RS**&#xD;&#xA;&#xD;&#xA;Reference to the resource which is the focus of the action &#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA; &quot;focus&quot;: {&#xD;&#xA;        &quot;reference&quot;: &quot;https://server.fire.ly/ServiceRequest/eb13327f-e990-4667-b37a-89eb93a94c47&quot;&#xD;&#xA;    },&#xD;&#xA;```&#xD;&#xA;&#xD;&#xA;** EPS Only**&#xD;&#xA;&#xD;&#xA;This will be the `Bundle.identifier` of the message this Task is acting on. &#xD;&#xA;For Tasks with a reasonCode of `373784005 - Dispensing medication`  this will be a `dispense-notification` message. &#xD;&#xA;For Tasks with a reasonCode of `33633005 - Prescription of drug` this will be the `prescription-order` message from the Task/$release operation.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;focus&quot;: {&#xD;&#xA;        &quot;type&quot;: &quot;Bundle&quot;,&#xD;&#xA;        &quot;identifier&quot;: {&#xD;&#xA;            &quot;system&quot;: &quot;https://tools.ietf.org/html/rfc4122&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;334a3195-1f6c-497a-8efe-d272ca9c4e38&quot;&#xD;&#xA;        }&#xD;&#xA;    },&#xD;&#xA;```" />
      <comment value="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.&#xD;&#xA;&#xD;&#xA;`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`." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Appointment" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-MedicationRequest" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Patient" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Questionnaire" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ActivityDefinition" />
      </type>
      <constraint>
        <key value="nhsd-taskfocus" />
        <severity value="error" />
        <human value="focus - An identifier reference or resource reference must be provided" />
        <expression value="(reference.exists() or identifier.exists())" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="Task.for">
      <path value="Task.for" />
      <definition value="A reference to the patient the Task is for. This will always be an identifier reference using the Patients NHSNumber.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;for&quot;: {&#xD;&#xA;        &quot;identifier&quot;: {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.nhs.uk/Id/nhs-number&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;9446368138&quot;&#xD;&#xA;        }&#xD;&#xA;    },&#xD;&#xA;```" />
      <min value="1" />
      <constraint>
        <key value="patient-reference" />
        <severity value="error" />
        <human value="An identifier reference or resource reference must be provided" />
        <expression value="(reference.exists() or identifier.exists())" />
      </constraint>
      <constraint>
        <key value="patient-nhs" />
        <severity value="error" />
        <human value="NHS Number must be in the English and Welsh NHS Number range or length of the number is wrong." />
        <expression value="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})$'))" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="Task.for.identifier">
      <path value="Task.for.identifier" />
      <min value="1" />
    </element>
    <element id="Task.for.identifier.system">
      <path value="Task.for.identifier.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.uk/Id/nhs-number" />
    </element>
    <element id="Task.for.identifier.value">
      <path value="Task.for.identifier.value" />
      <min value="1" />
    </element>
    <element id="Task.authoredOn">
      <path value="Task.authoredOn" />
      <definition value="Date and time the task was created.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;authoredOn&quot;: &quot;2020-12-21T17:03:20-00:00&quot;,&#xD;&#xA;```" />
      <mustSupport value="true" />
    </element>
    <element id="Task.requester">
      <path value="Task.requester" />
      <definition value="Who is created the Request or the Event. In NHSDigital API's this **SHOULD** always be a PractitionerRole role reference.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA; &quot;requester&quot;: {&#xD;&#xA;        &quot;reference&quot;: &quot;#requester&quot;&#xD;&#xA;    },&#xD;&#xA;```&#xD;&#xA;&#xD;&#xA;This 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,&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;{&#xD;&#xA;    &quot;resourceType&quot;: &quot;Task&quot;,&#xD;&#xA;    &quot;id&quot;: &quot;bd1ca5c4-ff49-4f2a-9db4-f5dda0112084&quot;,&#xD;&#xA;    &quot;meta&quot;: {&#xD;&#xA;        &quot;lastUpdated&quot;: &quot;2016-07-11T11:07:22+00:00&quot;&#xD;&#xA;    },&#xD;&#xA;    &quot;contained&quot;: [&#xD;&#xA;        {&#xD;&#xA;            &quot;resourceType&quot;: &quot;PractitionerRole&quot;,&#xD;&#xA;            &quot;id&quot;: &quot;requester&quot;,&#xD;&#xA;            &quot;practitioner&quot;: {&#xD;&#xA;                &quot;identifier&quot;: {&#xD;&#xA;                    &quot;system&quot;: &quot;https://fhir.hl7.org.uk/Id/gmp-number&quot;,&#xD;&#xA;                    &quot;value&quot;: &quot;G8123456&quot;&#xD;&#xA;                },&#xD;&#xA;                &quot;display&quot;: &quot;DR AA BHATIA&quot;&#xD;&#xA;            },&#xD;&#xA;            &quot;organization&quot;: {&#xD;&#xA;                &quot;identifier&quot;: {&#xD;&#xA;                    &quot;system&quot;: &quot;https://fhir.nhs.uk/Id/ods-organization-code&quot;,&#xD;&#xA;                    &quot;value&quot;: &quot;C81007&quot;&#xD;&#xA;                },&#xD;&#xA;                &quot;display&quot;: &quot;VERNON STREET MEDICAL CTR&quot;&#xD;&#xA;            },&#xD;&#xA;            &quot;telecom&quot;: [&#xD;&#xA;                {&#xD;&#xA;                    &quot;system&quot;: &quot;phone&quot;,&#xD;&#xA;                    &quot;use&quot;: &quot;work&quot;,&#xD;&#xA;                    &quot;value&quot;: &quot;01234567890&quot;&#xD;&#xA;                }&#xD;&#xA;            ]&#xD;&#xA;        }&#xD;&#xA;    ],&#xD;&#xA;```" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole" />
        <aggregation value="contained" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Task.requester.identifier.system">
      <path value="Task.requester.identifier.system" />
      <min value="1" />
    </element>
    <element id="Task.requester.identifier.value">
      <path value="Task.requester.identifier.value" />
      <min value="1" />
    </element>
    <element id="Task.owner">
      <path value="Task.owner" />
      <short value="Responsible organisation" />
      <definition value="**EPS**&#xD;&#xA;&#xD;&#xA;Who is responsible for actioning the request Task (e.g. for a prescription-order this will be the pharmacy). &#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;owner&quot;: {&#xD;&#xA;        &quot;identifier&quot;: {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.nhs.uk/Id/ods-organization-code&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;FB444&quot;&#xD;&#xA;        },&#xD;&#xA;        &quot;display&quot;: &quot;Freds Pharmacy&quot;&#xD;&#xA;    },&#xD;&#xA;```&#xD;&#xA;&#xD;&#xA;**e-RS**&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;owner&quot;: {&#xD;&#xA;        &quot;identifier&quot;: {&#xD;&#xA;            &quot;system&quot;: &quot;https://fhir.nhs.uk/Id/ers-service&quot;,&#xD;&#xA;            &quot;value&quot;: &quot;12444&quot;&#xD;&#xA;        }&#xD;&#xA;    },&#xD;&#xA;```" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-PractitionerRole" />
        <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Organization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Task.owner.identifier.system">
      <path value="Task.owner.identifier.system" />
      <min value="1" />
    </element>
    <element id="Task.owner.identifier.value">
      <path value="Task.owner.identifier.value" />
      <min value="1" />
    </element>
    <element id="Task.reasonCode">
      <path value="Task.reasonCode" />
      <definition value="In FHIR Task these types of workflow would be represented via **reasonCode** and/or **reasonReference**&#xD;&#xA;&#xD;&#xA;For medication this is probably SNOMED CT based using codes under the SNOMED CT 182832007 Medication management and includes codes such as:&#xD;&#xA;&#xD;&#xA;| SNOMED CT | Display |&#xD;&#xA;|--|--|&#xD;&#xA;| 33633005 | Prescription of drug |&#xD;&#xA;| 373784005 | Dispensing medication |&#xD;&#xA;&#xD;&#xA;&lt;br/&gt;&#xD;&#xA;&#xD;&#xA;For referral management&#xD;&#xA;&#xD;&#xA;| SNOMED CT | Display |&#xD;&#xA;|--|--|&#xD;&#xA;| &lt;a href=&quot;https://ontoserver.csiro.au/shrimp/?concept=3457005&amp;version=http%3A%2F%2Fsnomed.info%2Fsct%2F83821000000107%2Fversion%2F20211124&amp;valueset=http%3A%2F%2Fsnomed.info%2Fsct%2F83821000000107%3Ffhir_vs&amp;fhir=https%3A%2F%2Fontology.nhs.uk%2Fauthoring%2Ffhir&quot;&gt;3457005&lt;/a&gt; | Patient Referral |&#xD;&#xA;| &lt;a href=&quot;https://ontoserver.csiro.au/shrimp/?concept=185499000&amp;version=http%3A%2F%2Fsnomed.info%2Fsct%2F83821000000107%2Fversion%2F20211124&amp;valueset=http%3A%2F%2Fsnomed.info%2Fsct%2F83821000000107%3Ffhir_vs&amp;fhir=https%3A%2F%2Fontology.nhs.uk%2Fauthoring%2Ffhir&quot;&gt;185499000&lt;/a&gt;| Expedite appointment |" />
      <mustSupport value="true" />
    </element>
    <element id="Task.reasonCode.coding">
      <path value="Task.reasonCode.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Task.reasonCode.coding.system">
      <path value="Task.reasonCode.coding.system" />
      <min value="1" />
    </element>
    <element id="Task.reasonCode.coding.code">
      <path value="Task.reasonCode.coding.code" />
      <min value="1" />
    </element>
    <element id="Task.reasonCode.coding.display">
      <path value="Task.reasonCode.coding.display" />
      <min value="1" />
    </element>
    <element id="Task.reasonCode.coding:SNOMED">
      <path value="Task.reasonCode.coding" />
      <sliceName value="SNOMED" />
    </element>
    <element id="Task.reasonCode.coding:SNOMED.system">
      <path value="Task.reasonCode.coding.system" />
      <fixedUri value="http://snomed.info/sct" />
    </element>
    <element id="Task.note">
      <path value="Task.note" />
      <definition value="**EPS Only**&#xD;&#xA;&#xD;&#xA;This may contain cancellation reason.&#xD;&#xA;&#xD;&#xA;**e-RS**&#xD;&#xA;&#xD;&#xA;Used to add notes to the worklist items&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;note&quot;: [&#xD;&#xA;    {&#xD;&#xA;      &quot;text&quot;: &quot;Optional comments&quot;&#xD;&#xA;    }&#xD;&#xA;  ]&#xD;&#xA;```" />
      <mustSupport value="true" />
    </element>
    <element id="Task.restriction">
      <path value="Task.restriction" />
      <mustSupport value="true" />
    </element>
    <element id="Task.restriction.period.end">
      <path value="Task.restriction.period.end" />
      <definition value="In **e-RS** this is also known as the review date due." />
      <comment value="**e-RS**&#xD;&#xA;&#xD;&#xA;- 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&#xD;&#xA;- If the referral was sent to a triage service then this is the date by which the provider should have reviewed the referral" />
      <mustSupport value="true" />
    </element>
    <element id="Task.input">
      <path value="Task.input" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>