NHS Digital FHIR Medicines

NHSDigital-Task

Profile url
https://fhir.nhs.uk/StructureDefinition/NHSDigital-Task Workflow trial-use




agentS I0..1Extension(Reference(NHSDigitalPractitionerRole | NHSDigitalPractitioner | NHSDigitalHealthcareService))
prescriptionS I0..1Extension(Complex)
repeatInformationS I0..1Extension(Complex)
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
instantiatesCanonicalΣ0..1canonical(ActivityDefinition)
instantiatesUriΣ0..1uri
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
groupIdentifierS Σ0..1Identifier
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
statusS Σ ?!1..1codeBinding
statusReasonΣ0..1CodeableConcept
businessStatusΣ0..1CodeableConcept
intentS Σ1..1codeBinding
priority0..1codeBinding
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ0..1string
userSelectedΣ0..1boolean
systemΣ0..1uriFixed Value
versionΣ0..1string
codeΣ0..1code
displayΣ0..1string
userSelectedΣ0..1boolean
systemΣ0..1uriFixed Value
versionΣ0..1string
codeΣ0..1code
displayΣ0..1string
userSelectedΣ0..1boolean
systemΣ0..1uriFixed Value
versionΣ0..1string
codeΣ0..1code
displayΣ0..1string
userSelectedΣ0..1boolean
textΣ0..1string
descriptionΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uriFixed Value
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
executionPeriodΣ I0..1Period
authoredOnS I0..1dateTime
lastModifiedΣ I0..1dateTime
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
performerType0..*CodeableConceptBinding
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ1..1string
userSelectedΣ0..1boolean
systemΣ0..1uriFixed Value
versionΣ0..1string
codeΣ0..1code
displayΣ0..1string
userSelectedΣ0..1boolean
textΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
noteS0..*Annotation
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
repetitions0..1positiveInt
startΣ I0..1dateTime
endS Σ I0..1dateTime
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
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()
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()

agentS I0..1Extension(Reference(NHSDigitalPractitionerRole | NHSDigitalPractitioner | NHSDigitalHealthcareService))
prescriptionS I0..1Extension(Complex)
repeatInformationS I0..1Extension(Complex)
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
instantiatesCanonicalΣ0..1canonical(ActivityDefinition)
instantiatesUriΣ0..1uri
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
groupIdentifierS Σ0..1Identifier
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
statusS Σ ?!1..1codeBinding
statusReasonΣ0..1CodeableConcept
businessStatusΣ0..1CodeableConcept
intentS Σ1..1codeBinding
priority0..1codeBinding
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ0..1string
userSelectedΣ0..1boolean
systemΣ0..1uriFixed Value
versionΣ0..1string
codeΣ0..1code
displayΣ0..1string
userSelectedΣ0..1boolean
systemΣ0..1uriFixed Value
versionΣ0..1string
codeΣ0..1code
displayΣ0..1string
userSelectedΣ0..1boolean
systemΣ0..1uriFixed Value
versionΣ0..1string
codeΣ0..1code
displayΣ0..1string
userSelectedΣ0..1boolean
textΣ0..1string
descriptionΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uriFixed Value
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
executionPeriodΣ I0..1Period
authoredOnS I0..1dateTime
lastModifiedΣ I0..1dateTime
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
performerType0..*CodeableConceptBinding
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
systemΣ1..1uri
versionΣ0..1string
codeΣ1..1code
displayΣ1..1string
userSelectedΣ0..1boolean
systemΣ0..1uriFixed Value
versionΣ0..1string
codeΣ0..1code
displayΣ0..1string
userSelectedΣ0..1boolean
textΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
noteS0..*Annotation
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
repetitions0..1positiveInt
startΣ I0..1dateTime
endS Σ I0..1dateTime
referenceΣ I0..1string
typeΣ0..1uriBinding
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ0..1uri
valueΣ0..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(UK Core Organization)
displayΣ0..1string
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()
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.


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 prescribingmodels (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 is currently supported for reasonCode = 373784005 (Dispensing medication) and focus is a dispense-notification.

rejected / cancelled / failed are supported for reasonCode = 33633005 (Prescription of drug) and focus is a prescription-order. See also Fulfilment States

statusReason

A code from DM-Task-Reason-Code

reasonCode focus status CodeSystem
373784005 - Dispensing medication dispense-notification cancelled EPS Dispense Withdraw Reason
33633005 - Prescription of drug prescription-order rejected / cancelled / failed EPS Dispense Return Reason
"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 reasonCode of 373784005 - Dispensing medication this will be a dispense-notification message. For Tasks with a reasonCode of 33633005 - Prescription of drug 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

This is a SNOMED CT :

SNOMED CT Display
33633005 Prescription of drug
373784005 Dispensing medication

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"
            }
        },

back to top