The Task resource represents work items that need to be completed as part of patient care coordination. Tasks support assignment, prioritization, and status tracking.
Endpoints
Create Task
Admin can create tasks for any practitioner. Practitioners can only create tasks assigned to themselves.
POST /api/fhir/Task
Authorization : Bearer {token}
Content-Type : application/json
draft, requested, received, accepted, rejected, ready, cancelled, in-progress, on-hold, failed, completed, entered-in-error
proposal, plan, order, original-order, etc.
routine, urgent, asap, stat
Task code (Care coordination, Medication reconciliation, etc.)
Human-readable description of the task
Reference to Patient: {"reference": "Patient/{id}"}
When the task was created
Most recent task modification timestamp
Who is requesting the task
Practitioner responsible for the task: {"reference": "Practitioner/{userId}"}
Constraints on task execution (period, recipients)
Example Request
curl -X POST https://api.example.com/api/fhir/Task \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resourceType": "Task",
"status": "requested",
"intent": "order",
"priority": "urgent",
"code": {
"coding": [{
"system": "http://hl7.org/fhir/CodeSystem/task-code",
"code": "fulfill",
"display": "Fulfill the focal request"
}]
},
"description": "Review abnormal lab results and contact patient",
"for": {
"reference": "Patient/65f1234567890abcdef12345"
},
"authoredOn": "2024-03-15T08:00:00Z",
"requester": {
"reference": "Practitioner/65f9876543210abcdef98765"
},
"owner": {
"reference": "Practitioner/65f9876543210abcdef98765"
},
"restriction": {
"period": {
"end": "2024-03-16T17:00:00Z"
}
},
"note": [{
"text": "HbA1c results came back at 8.2%, need to discuss treatment adjustment"
}]
}'
Response
{
"resourceType" : "Task" ,
"id" : "65f8901234567abcdef89012" ,
"status" : "requested" ,
"intent" : "order" ,
"priority" : "urgent" ,
"code" : {
"coding" : [{
"system" : "http://hl7.org/fhir/CodeSystem/task-code" ,
"code" : "fulfill" ,
"display" : "Fulfill the focal request"
}]
},
"description" : "Review abnormal lab results and contact patient" ,
"for" : {
"reference" : "Patient/65f1234567890abcdef12345"
},
"authoredOn" : "2024-03-15T08:00:00Z" ,
"owner" : {
"reference" : "Practitioner/65f9876543210abcdef98765"
}
}
List Tasks
GET /api/fhir/Task
Authorization : Bearer {token}
Filter by task owner: Practitioner/{userId}
Filter by patient: Patient/{id}
Practitioners can only see tasks assigned to themselves. Admins and auditors can see all tasks.
Example Request
curl -X GET "https://api.example.com/api/fhir/Task?owner=Practitioner/65f9876543210abcdef98765&status=requested" \
-H "Authorization: Bearer YOUR_TOKEN"
Get Task by ID
GET /api/fhir/Task/:id
Authorization : Bearer {token}
Practitioners can only retrieve their own tasks.
Update Task
Practitioners can only update tasks assigned to themselves. Typically used to change status (e.g., from requested to in-progress to completed).
PUT /api/fhir/Task/:id
Authorization : Bearer {token}
Content-Type : application/json
Example: Mark Task as Completed
curl -X PUT https://api.example.com/api/fhir/Task/65f8901234567abcdef89012 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resourceType": "Task",
"id": "65f8901234567abcdef89012",
"status": "completed",
"intent": "order",
"priority": "urgent",
"description": "Review abnormal lab results and contact patient",
"for": {
"reference": "Patient/65f1234567890abcdef12345"
},
"owner": {
"reference": "Practitioner/65f9876543210abcdef98765"
},
"note": [{
"text": "Contacted patient, scheduled follow-up appointment"
}]
}'
Task Priority Levels
Priority Description Typical Use Case routineNormal priority Scheduled tasks, documentation urgentHigher priority Follow-up on test results asapAs soon as possible Patient callbacks, medication issues statImmediate action required Critical lab values, safety alerts
Task Status Workflow
Requested
Task has been created and assigned
Accepted
Practitioner acknowledges the task
In Progress
Work on the task has begun
Completed
Task has been finished successfully
Common Task Categories
Care Coordination Coordinate care across providers
Medication Reconciliation Review and update medication list
Lab Follow-up Review and act on lab results
Patient Outreach Contact patient for follow-up
Documentation Complete clinical documentation
Referral Management Process specialist referrals
Role Permissions
Role Create Read Update Scope Admin ✅ ✅ ✅ All tasks Practitioner ✅ ✅ ✅ Own tasks only Auditor ❌ ✅ ❌ All tasks
Practitioners attempting to create or update tasks for other practitioners will receive a 403 Forbidden error.