NHS Digital FHIR Medicines (Retired - 2.1.14)

This guidance is under active development by NHS Digital and content may be added or updated on a regular basis.

NHSDigital-Task

Conformance Url
https://fhir.nhs.uk/StructureDefinition/NHSDigital-Task




idΣ0..1string
metaΣ0..1Meta
implicitRulesΣ ?!0..1uri
language0..1codeBinding
text0..1Narrative
contained0..*Resource
extensionI0..*Extension
modifierExtension?! I0..*Extension
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
instantiatesCanonicalΣ0..1canonical(ActivityDefinition)
instantiatesUriΣ0..1uri
basedOnΣ I0..*Reference(Resource)
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
partOfΣ I0..*Reference(Task)
statusΣ ?!1..1codeBinding
statusReasonΣ0..1CodeableConcept
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ1..1string
userSelectedΣ0..1boolean
textΣ0..1string
intentΣ1..1codeBinding
priority0..1codeBinding
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ1..1string
userSelectedΣ0..1boolean
textΣ0..1string
descriptionΣ0..1string
id0..1string
extensionI0..*Extension
referenceΣ I0..1string
typeΣ0..1uriBinding
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
displayΣ0..1string
id0..1string
extensionI0..*Extension
referenceΣ I0..1string
typeΣ0..1uriBinding
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
displayΣ0..1string
encounterΣ I0..1Reference(Encounter)
executionPeriodΣ I0..1Period
authoredOnI1..1dateTime
lastModifiedΣ I0..1dateTime
requesterΣ I0..1Reference(Device | Organization | Patient | Practitioner | PractitionerRole | RelatedPerson)
performerType0..*CodeableConceptBinding
id0..1string
extensionI0..*Extension
referenceΣ I0..1string
typeΣ0..1uriBinding
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
displayΣ0..1string
locationΣ I0..1Reference(Location)
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ1..1string
userSelectedΣ0..1boolean
textΣ0..1string
reasonReferenceI0..1Reference(Resource)
insuranceI0..*Reference(Coverage | ClaimResponse)
note0..*Annotation
relevantHistoryI0..*Reference(Provenance)
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
repetitions0..1positiveInt
periodI0..1Period
recipientI0..*Reference(Patient | Practitioner | PractitionerRole | RelatedPerson | Group | Organization)
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
type1..1CodeableConcept
valueBase64Binarybase64Binary
valueBooleanboolean
valueCanonicalcanonical()
valueCodecode
valueDatedate
valueDateTimedateTime
valueDecimaldecimal
valueIdid
valueInstantinstant
valueIntegerinteger
valueMarkdownmarkdown
valueOidoid
valuePositiveIntpositiveInt
valueStringstring
valueTimetime
valueUnsignedIntunsignedInt
valueUriuri
valueUrlurl
valueUuiduuid
valueAddressAddress
valueAgeAge
valueAnnotationAnnotation
valueAttachmentAttachment
valueCodeableConceptCodeableConcept
valueCodingCoding
valueContactPointContactPoint
valueCountCount
valueDistanceDistance
valueDurationDuration
valueHumanNameHumanName
valueIdentifierIdentifier
valueMoneyMoney
valuePeriodPeriod
valueQuantityQuantity
valueRangeRange
valueRatioRatio
valueSampledDataSampledData
valueSignatureSignature
valueTimingTiming
valueContactDetailContactDetail
valueContributorContributor
valueDataRequirementDataRequirement
valueExpressionExpression
valueParameterDefinitionParameterDefinition
valueRelatedArtifactRelatedArtifact
valueTriggerDefinitionTriggerDefinition
valueUsageContextUsageContext
valueDosageDosage
valueMetaMeta
valueReferenceReference()
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
type1..1CodeableConcept
valueBase64Binarybase64Binary
valueBooleanboolean
valueCanonicalcanonical()
valueCodecode
valueDatedate
valueDateTimedateTime
valueDecimaldecimal
valueIdid
valueInstantinstant
valueIntegerinteger
valueMarkdownmarkdown
valueOidoid
valuePositiveIntpositiveInt
valueStringstring
valueTimetime
valueUnsignedIntunsignedInt
valueUriuri
valueUrlurl
valueUuiduuid
valueAddressAddress
valueAgeAge
valueAnnotationAnnotation
valueAttachmentAttachment
valueCodeableConceptCodeableConcept
valueCodingCoding
valueContactPointContactPoint
valueCountCount
valueDistanceDistance
valueDurationDuration
valueHumanNameHumanName
valueIdentifierIdentifier
valueMoneyMoney
valuePeriodPeriod
valueQuantityQuantity
valueRangeRange
valueRatioRatio
valueSampledDataSampledData
valueSignatureSignature
valueTimingTiming
valueContactDetailContactDetail
valueContributorContributor
valueDataRequirementDataRequirement
valueExpressionExpression
valueParameterDefinitionParameterDefinition
valueRelatedArtifactRelatedArtifact
valueTriggerDefinitionTriggerDefinition
valueUsageContextUsageContext
valueDosageDosage
valueMetaMeta
valueReferenceReference()

idΣ0..1string
metaΣ0..1Meta
implicitRulesΣ ?!0..1uri
language0..1codeBinding
text0..1Narrative
contained0..*Resource
extensionI0..*Extension
modifierExtension?! I0..*Extension
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
instantiatesCanonicalΣ0..1canonical(ActivityDefinition)
instantiatesUriΣ0..1uri
basedOnΣ I0..*Reference(Resource)
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
partOfΣ I0..*Reference(Task)
statusΣ ?!1..1codeBinding
statusReasonΣ0..1CodeableConcept
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ1..1string
userSelectedΣ0..1boolean
textΣ0..1string
intentΣ1..1codeBinding
priority0..1codeBinding
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ1..1string
userSelectedΣ0..1boolean
textΣ0..1string
descriptionΣ0..1string
id0..1string
extensionI0..*Extension
referenceΣ I0..1string
typeΣ0..1uriBinding
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
displayΣ0..1string
id0..1string
extensionI0..*Extension
referenceΣ I0..1string
typeΣ0..1uriBinding
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
displayΣ0..1string
encounterΣ I0..1Reference(Encounter)
executionPeriodΣ I0..1Period
authoredOnI1..1dateTime
lastModifiedΣ I0..1dateTime
requesterΣ I0..1Reference(Device | Organization | Patient | Practitioner | PractitionerRole | RelatedPerson)
performerType0..*CodeableConceptBinding
id0..1string
extensionI0..*Extension
referenceΣ I0..1string
typeΣ0..1uriBinding
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
displayΣ0..1string
locationΣ I0..1Reference(Location)
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ1..1string
userSelectedΣ0..1boolean
textΣ0..1string
reasonReferenceI0..1Reference(Resource)
insuranceI0..*Reference(Coverage | ClaimResponse)
note0..*Annotation
relevantHistoryI0..*Reference(Provenance)
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
repetitions0..1positiveInt
periodI0..1Period
recipientI0..*Reference(Patient | Practitioner | PractitionerRole | RelatedPerson | Group | Organization)
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
type1..1CodeableConcept
valueBase64Binarybase64Binary
valueBooleanboolean
valueCanonicalcanonical()
valueCodecode
valueDatedate
valueDateTimedateTime
valueDecimaldecimal
valueIdid
valueInstantinstant
valueIntegerinteger
valueMarkdownmarkdown
valueOidoid
valuePositiveIntpositiveInt
valueStringstring
valueTimetime
valueUnsignedIntunsignedInt
valueUriuri
valueUrlurl
valueUuiduuid
valueAddressAddress
valueAgeAge
valueAnnotationAnnotation
valueAttachmentAttachment
valueCodeableConceptCodeableConcept
valueCodingCoding
valueContactPointContactPoint
valueCountCount
valueDistanceDistance
valueDurationDuration
valueHumanNameHumanName
valueIdentifierIdentifier
valueMoneyMoney
valuePeriodPeriod
valueQuantityQuantity
valueRangeRange
valueRatioRatio
valueSampledDataSampledData
valueSignatureSignature
valueTimingTiming
valueContactDetailContactDetail
valueContributorContributor
valueDataRequirementDataRequirement
valueExpressionExpression
valueParameterDefinitionParameterDefinition
valueRelatedArtifactRelatedArtifact
valueTriggerDefinitionTriggerDefinition
valueUsageContextUsageContext
valueDosageDosage
valueMetaMeta
valueReferenceReference()
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
type1..1CodeableConcept
valueBase64Binarybase64Binary
valueBooleanboolean
valueCanonicalcanonical()
valueCodecode
valueDatedate
valueDateTimedateTime
valueDecimaldecimal
valueIdid
valueInstantinstant
valueIntegerinteger
valueMarkdownmarkdown
valueOidoid
valuePositiveIntpositiveInt
valueStringstring
valueTimetime
valueUnsignedIntunsignedInt
valueUriuri
valueUrlurl
valueUuiduuid
valueAddressAddress
valueAgeAge
valueAnnotationAnnotation
valueAttachmentAttachment
valueCodeableConceptCodeableConcept
valueCodingCoding
valueContactPointContactPoint
valueCountCount
valueDistanceDistance
valueDurationDuration
valueHumanNameHumanName
valueIdentifierIdentifier
valueMoneyMoney
valuePeriodPeriod
valueQuantityQuantity
valueRangeRange
valueRatioRatio
valueSampledDataSampledData
valueSignatureSignature
valueTimingTiming
valueContactDetailContactDetail
valueContributorContributor
valueDataRequirementDataRequirement
valueExpressionExpression
valueParameterDefinitionParameterDefinition
valueRelatedArtifactRelatedArtifact
valueTriggerDefinitionTriggerDefinition
valueUsageContextUsageContext
valueDosageDosage
valueMetaMeta
valueReferenceReference()

key human severity expression
nhds-10 groupIdentifier and reasonCode are mandatory for EPS interactions error code.coding.where(system = 'http://hl7.org/fhir/CodeSystem/task-code').exists().not() or (code.coding.where(system = 'http://hl7.org/fhir/CodeSystem/task-code').exists() and groupIdentifier.exists() and reasonCode.exists())


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.

A Task resource often exists in parallel with clinical resources.

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.


Task Type

Task Type Description
Request Represents an order that needs to be fulfilled. The request will be contained in 'Task.input'
Event Represents an order that has been or is being fulfilled. The events will be contained in 'Task.output'

In simple workflow Requests and Events may be combined into one Task. For more complex workflow the use of sub-Tasks is allowed, in this case the use of 'basedOn' to reference the Request Task is recommended. See examples in Prescription Management


Must Support, Optional and Not Supported

Elements marked with a S MUST be supported by both producing and receiving systems. They should be populated if the data exists or the profile has made them mandatory.

The following elements SHOULD NOT are not expected to be supported by consuming or receiving systems.

  • doNotPerform
  • detectedIssue

Elements that are neither marked as Must Support or listed as unsupported are optional.


extension courseOfTherapyType (Prescription Therapy Type)

See Prescribing Models for more details.

A single Code from DM-MedicationRequest-Course-of-Therapy values.

"extension":  [
        {
            "url": "https://fhir.nhs.uk/StructureDefinition/Extension-EPS-Prescription",
            "extension":  [
                {
                    "url": "courseOfTherapyType",
                    "valueCoding": {
                        "system": "http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy",
                        "code": "acute",
                        "display": "Acute"
                    }
                }
            ]
        }
    ],


identifier

A single identifier MUST be present and the value must be a UUID.

"identifier":  [
        {
            "system": "https://tools.ietf.org/html/rfc4122",
            "value": "5AC84C11-DB8B-44DA-8FCF-8980B3D13596"
        }
    ],


status

Only in-progress and rejected are currently supported.

rejected means I have taken no action on the order and I am returning the prescription-order to EPS.

in-progress means I am still working on the prescription-order task and I am altering one the actions I have previously made (e.g. cancelling a previous dispense-notification)

statusReason

A code from DM-Task-Reason-Code Only codes from EPS Dispense Withdraw Reason can be used when the status is in-progress. Only codes from EPS Dispense Return Reason can be used when the status is rejected.

"statusReason": [{
        "coding":  [
            {
                "system": "https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-withdraw-reason",
                "code": "DA",
                "display": "Dosage Amendments"
            }
        ]
    }]

intent

Is not processed by EPS and is included for FHIR compliance reasons. The value should always be order.

groupIdentifier

An identifier to the original prescription-order MUST be present. Only the short form identifier needs to be supplied.

"groupIdentifier": {
        "system": "https://fhir.nhs.uk/Id/prescription-order-number",
        "value": "88AF6C-C81007-00001C"
    },

code

The code indicates the action to perform on the focus resource. A code from TaskCode

 "code": {
        "coding":  [
            {
                "system": "http://hl7.org/fhir/CodeSystem/task-code",
                "code": "fulfill",
                "display": "Fulfill the focal request"
            }
        ]
    }

focus

This will be the Bundle.identifier of the message this Task is acting on. For Tasks with a status of in-progress this will be a dispense-notification message. For Tasks with a status of rejected this will be the prescription-order message from the Task/$release operation.

"focus": {
        "type": "Bundle",
        "identifier": {
            "system": "https://tools.ietf.org/html/rfc4122",
            "value": "334a3195-1f6c-497a-8efe-d272ca9c4e38"
        }
    },

for

A reference to the patient the Task is for. This will always be an identifier reference using the Patients NHSNumber.

"for": {
        "identifier": {
            "system": "https://fhir.nhs.uk/Id/nhs-number",
            "value": "9446368138"
        }
    },

requester

Who is created the Request or the Event.

"requester": {
        "identifier": {
            "system": "https://fhir.nhs.uk/Id/ods-organization-code",
            "value": "C81007"
        },
        "display": "VERNON STREET MEDICAL CTR"
    },

authoredOn

Date and time the task was created.

"authoredOn": "2020-12-21T17:03:20-00:00",

owner

Who is responsible for actioning the request Task (e.g. for a prescription-order this will be the pharmacy).

"owner": {
        "identifier": {
            "system": "https://fhir.nhs.uk/Id/ods-organization-code",
            "value": "FB444"
        },
        "display": "Freds Pharmacy"
    },

reasonCode

A code from DM-Task-Reason-Code Only codes from EPS Dispense Withdraw Reason can be used when the status is in-progress. Only codes from EPS Dispense Return Reason can be used when the status is rejected.

"reasonCode": {
        "coding":  [
            {
                "system": "https://fhir.nhs.uk/CodeSystem/EPS-task-dispense-withdraw-reason",
                "code": "DA",
                "display": "Dosage Amendments"
            }
        ]
    }

input

Information used to perform task.

For request Tasks this will contain references to the key resources that are used to process the Task. E.g. for prescription-order this will be the MedicationRequest resources.

For event Tasks this may also be used to hold the key resources, however if the event has a corresponding request Task i.e. this is a sub-Task, the basedOn element can be used instead.

"input":  [
        {
            "type": {
                "coding":  [
                    {
                        "system": "http://snomed.info/sct",
                        "code": "16076005",
                        "display": "Prescription"
                    }
                ]
            },
            "valueReference": {
                "type": "MedicationRequest",
                "reference": "https://prescriptions.spineservices.nhs.uk/FHIR/R4/MedicationRequest/30b7e9cf-6f42-40a8-84c1-e61ef638eee2",
                "identifier": {
                    "system": "https://fhir.nhs.uk/Id/prescription-order-item-number",
                    "value": "30b7e9cf-6f42-40a8-84c1-e61ef638eee2"
                },
                "display" : "Perindopril erbumine 2mg tablets"
            }
        },

output

Information produced as part of task.

For event Tasks this will contain references to the key resources that are produced on completion of the Task. E.g. for dispense-notification this will be the MedicationDispense resources.

"output":  [
        {
            "type": {
                "coding":  [
                    {
                        "system": "http://snomed.info/sct",
                        "code": "373784005",
                        "display": "Dispensing medication"
                    }
                ]
            },
            "valueReference": {
                "type": "MedicationDispense",
                "reference": "https://prescriptions.spineservices.nhs.uk/FHIR/R4/MedicationDispense/fd833d33-f128-4fa2-a807-1fc8a7db2658",
                "identifier": {
                    "system": "https://fhir.nhs.uk/Id/prescription-dispense-item-number",
                    "value": "fd833d33-f128-4fa2-a807-1fc8a7db2658"
                },
                "display": "Paracetamol 500mg soluble tablets (Alliance Healthcare (Distribution) Ltd) 60 tablet"
            }
        },

Search Parameters

Name Type Description Conformance Path
authored-on date Search by creation date (of prescription) SHOULD Task.authoredOn
identifier token Search for a task instance by its business identifier MAY Task.identifier
focus:identifier token Search by prescription short form id SHOULD Task.focus.identifier
owner:identifier token Search by task (Prescription) owner SHALL Task.owner (Organization)
patient:identifier token The identity of a patient to list Tasks (prescription) for SHALL Task.for.where(resolve() is Patient) (Patient)
business-status token Search by business status SHOULD Task.businessStatus
status token Search by task (/prescription) status SHOULD Task.status

Additional parameters can be on Task - Search Parameters


Mandatory Search Parameters

patient:identifier

SHALL support searching using the patient:identifier search parameter.

GET [baseUrl]/Task?patient:identifier={system|}[code]

Example:

GET [baseUrl]/Task?patient:identifier=https://fhir.nhs.uk/Id/nhs-number|9876543210

Return all Task resources for Patients with a NHS Number of 9876543210

owner:identifier

SHALL support searching using the owner:identifier search parameter.

GET [baseUrl]/Task?owner:identifier={system|}[code]

Example:

GET [baseUrl]/Task?owner:identifier=https://fhir.nhs.uk/Id/ods-organization-code|FA666

Return all Task resources for ODS Code of FA666


focus:identifier

SHALL support searching using the focus:identifier search parameter.

GET [baseUrl]/Task?focus:identifier={system|}[code]

Example:

GET [baseUrl]/Task?focus:identifier=https://fhir.nhs.uk/Id/prescription-order-number|2D35F7-ZA0448-11E88Z

Return all Task resources for with prescription short form of 2D35F7-ZA0448-11E88Z


Optional Search Parameters

authored-on + patient:identifier

SHOULD support searching using the combination of the patient:identifier and authored-on search parameters

GET [baseUrl]/Task?patient:identifier={system|}[code]&authored-on=[date]

Example:

GET [baseUrl]/MedicationRequest?patient:identifier=9876543210&authored-on=ge2010-01-01&authored-on=le2011-12-31

Return all Task resources that have a authoredon greater than or equal to 1st Jan 2010, a date less than or equal to 31st Dec 2011 and Patient with an identifier code of 9876543210.

identifier

SHOULD support searching using the identifier search parameter.

GET [baseUrl]/Task?identifier={system|}[code]

Example:

GET [baseUrl]/Task?identifier=https://fhir.nhs.uk/Id/prescription-order-number|DC2C66-A1B2C3-23407B

business-status + patient:identifier

SHOULD support searching using the combination of the patient:identifier and business-status search parameters

GET [baseUrl]/Task?patient:identifier={system|}[code]&business-status=[code]

Example:

GET [baseUrl]/Task?patient:identifier=9876543210&business-status=active

Return all Task resources with a status of active and Patient with an identifier code of 9876543210.

business-status + owner:identifier

SHOULD support searching using the combination of the owner:identifier and business-status search parameters

GET [baseUrl]/Task?owner:identifier={system|}[code]&business-status=[code]

Example:

GET [baseUrl]/Task?https://fhir.nhs.uk/Id/ods-organization-code|FA666&business-status=active

Return all Task resources with a status of active and owner with an ODS code of FA666.

back to top