Skip to main content
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
resourceType
string
required
Must be "Task"
status
string
required
draft, requested, received, accepted, rejected, ready, cancelled, in-progress, on-hold, failed, completed, entered-in-error
intent
string
required
proposal, plan, order, original-order, etc.
priority
string
routine, urgent, asap, stat
code
object
Task code (Care coordination, Medication reconciliation, etc.)
description
string
Human-readable description of the task
for
object
Reference to Patient: {"reference": "Patient/{id}"}
authoredOn
string
When the task was created
lastModified
string
Most recent task modification timestamp
requester
object
Who is requesting the task
owner
object
required
Practitioner responsible for the task: {"reference": "Practitioner/{userId}"}
restriction
object
Constraints on task execution (period, recipients)
note
array
Comments about the task

Example Request

cURL
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}
owner
string
Filter by task owner: Practitioner/{userId}
status
string
Filter by task status
priority
string
Filter by priority level
patient
string
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

PriorityDescriptionTypical Use Case
routineNormal priorityScheduled tasks, documentation
urgentHigher priorityFollow-up on test results
asapAs soon as possiblePatient callbacks, medication issues
statImmediate action requiredCritical lab values, safety alerts

Task Status Workflow

1

Requested

Task has been created and assigned
2

Accepted

Practitioner acknowledges the task
3

In Progress

Work on the task has begun
4

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

RoleCreateReadUpdateScope
AdminAll tasks
PractitionerOwn tasks only
AuditorAll tasks
Practitioners attempting to create or update tasks for other practitioners will receive a 403 Forbidden error.

Build docs developers (and LLMs) love