Task — Operational FHIR activity
Where ServiceRequest says what, Task says where we are: received, accepted, in progress, completed. The operational workflow pivot.
Purpose
Task describes an activity to perform or being performed: process a request, deliver a medication, get a prescription approved, run a questionnaire. Where ServiceRequest carries the request, Task carries the operational follow-up: who executes, when, in what state, with what inputs and outputs.
Common pattern: a clinician creates a ServiceRequest; a Task with
focus = ServiceRequest/... is created to notify the laboratory it must
fulfill it. The lab advances the Task through received → accepted
→ in-progress → completed.
Key fields
| Field | Type | Cardinality | Role |
|---|---|---|---|
status | code | 1..1 | Mandatory. Lifecycle: draft, requested, received, accepted, rejected, ready, cancelled, in-progress, on-hold, failed, completed, entered-in-error. |
statusReason | CodeableReference | 0..1 | Reason for the current status. |
businessStatus | CodeableConcept | 0..1 | Free-form business status — finer-grained than status. |
intent | code | 1..1 | Mandatory. unknown, proposal, plan, order, original-order, reflex-order, filler-order, instance-order, option. |
priority | code | 0..1 | routine, urgent, asap, stat. |
code | CodeableConcept | 0..1 | Task nature (often fulfill, abort, replace, change). |
focus | Reference(Any) | 0..1 | Resource acted on. |
for | Reference(Any) | 0..1 | Beneficiary (typically Patient). |
encounter | Reference(Encounter) | 0..1 | Care context. |
requestedPeriod | Period | 0..1 | Requested period. |
executionPeriod | Period | 0..1 | Actual execution period. |
authoredOn | dateTime | 0..1 | Creation date. |
lastModified | dateTime | 0..1 | Last modification — key for worklists. |
requester | Reference(Device | Organization | Patient | Practitioner | PractitionerRole | RelatedPerson) | 0..1 | Requester. |
owner | Reference(...) | 0..1 | Assigned executor. |
partOf | Reference(Task) | 0..* | Parent task (decomposition). |
input | BackboneElement[] | 0..* | Input data. |
output | BackboneElement[] | 0..* | Produced outputs. |
Statuses and transitions
The canonical state diagram: draft → requested →
received → accepted or rejected. An accepted
task goes ready → in-progress → completed on
success, or failed / cancelled. on-hold is
reversible.
JSON example
A fulfill Task for a CBC order, assigned to the central lab:
{
"resourceType": "Task",
"id": "fulfill-labtest-001",
"status": "in-progress",
"intent": "order",
"priority": "routine",
"code": {
"coding": [{
"system": "http://hl7.org/fhir/CodeSystem/task-code",
"code": "fulfill",
"display": "Fulfill the focal request"
}]
},
"description": "Fulfill CBC order for Mr. Doe",
"focus": { "reference": "ServiceRequest/sr-cbc-001" },
"for": { "reference": "Patient/doe-john" },
"encounter": { "reference": "Encounter/enc-2026-05-15" },
"executionPeriod": {
"start": "2026-05-15T08:30:00+02:00"
},
"authoredOn": "2026-05-15T08:25:00+02:00",
"lastModified": "2026-05-15T09:10:00+02:00",
"requester": { "reference": "Practitioner/dr-smith" },
"owner": { "reference": "Organization/lab-central" },
"businessStatus": {
"coding": [{
"system": "http://example.org/CodeSystem/lab-status",
"code": "in-analyzer"
}]
},
"input": [{
"type": { "text": "Specimen" },
"valueReference": { "reference": "Specimen/spec-001" }
}]
} Common pitfalls
- Confusing Task with ServiceRequest — ServiceRequest = the request, Task = the execution follow-up. A ServiceRequest can spawn multiple Tasks (per step, per executor).
- Invalid status transition — going from
completedtoin-progressisn't allowed without flipping throughentered-in-error. - Missing
owner— without an owner, the task is orphaned: no worklist will surface it. - Confusing
requestedPeriodwithexecutionPeriod— the former is planned, the latter actual. Mixing them up skews delay KPIs. - Polling instead of Subscription — for active task lists, a Subscription on
Task?owner=...&status=ready,in-progressbeats polling load.
Related resources
- ServiceRequest — the request Task fulfills.
- MedicationRequest — Task
fulfillin hospital pharmacy. - Questionnaire — Task asking the patient to fill out a form.
- TaskList — task container (Bundle or Composition).
- Provenance — traceability for status changes.