Tasks

Tasks are the most important unit of information in Infinity. Tasks allow users to collaborate and manage work within the context of an encounter. They represent the "work to do" item.

The task object

id string
Unique identifier for the object.

status string
Current status of the task. Possible values are: pending, in_progress, completed, or cancelled.

title string
Summary of work to be done.

description string
The description for the task.

start_at string
Date and time for when the task should be started.

end_at string
Date and time for when the task should be completed.

encounter object
The encounter associated with the task.

members array of strings
List of identifiers of users associated with the task.

tags array of strings
List of identifiers of tags associated with the task.

custom_values object
Custom values extensions.

Retrieve a task

Retrieves the details of a task with the given id.

GET /tasks/:id

→ Parameters

No parameters.

← Response

Returns a task if a valid id was provided. Returns an error otherwise.

Create a task

Creates a task for a given encounter. Start and end times are saved in UTC. Parameters must be encompassed in a task object.

POST /tasks

→ Parameters

title string REQUIRED
Summary of work to be done.

encounter_id string REQUIRED
ID of the encounter to associate the task with.

status string REQUIRED
Current status of the task. Possible values are: pending, in_progress, completed, or cancelled.

start_at string REQUIRED
Date and time for when the task should be started. In UTC, ISO 8601 formatted. Minutes must be in 15-minute windows, where possible values are: 00, 15, 30, or 45. Seconds are ignored and rounded to zero.

description string optional
The description for the task.

end_at string optional
Date and time for when the task should be completed. In UTC, ISO 8601 formatted. Minutes must be in 15-minute windows, where possible values are: 00, 15, 30, or 45. Seconds are ignored and rounded to zero.

custom_values object
Custom values extensions.

← Response

Returns a task object.

Update a task

Updates the attributes for the given task id. Parameters must be encompassed in a task object.

PUT /tasks/:id

→ Parameters

title string optional
Summary of work to be done.

start_at string optional
Date and time for when the task should be started. In UTC, ISO 8601 formatted. Minutes must be in 15-minute windows, where possible values are: 00, 15, 30, or 45. Seconds are ignored and rounded to zero.

description string optional
The description for the task.

end_at string optional
Date and time for when the task should be completed. In UTC, ISO 8601 formatted. Minutes must be in 15-minute windows, where possible values are: 00, 15, 30, or 45. Seconds are ignored and rounded to zero.

← Response

Returns 204 No Content.

Cancel a task

Cancel a task for the given id. When you cancel a task, a reason for cancellation can be provided.

PUT /tasks/:id/cancel

→ Parameters

reason string optional
Reason for cancellation.

← Response

Returns 204 No Content.

Change task status

A task status can be change to one of the values: pending, in_progress, or completed. Important to note that there's a specific endpoint to cancel a task, where a reason for cancellation can be provided.

PUT /tasks/:id/status

→ Parameters

status string REQUIRED
New status of the task. One of the values: pending, in_progress, or completed.

← Response

Returns 204 No Content.

Search

Tasks can be searched and filtered. Infinity also uses searching as a mechanism for listing tasks, when a search query is empty.

Filters

Use filters to limit your search terms so they only apply to specific fields within applicable objects. Preface a search term with one of these filters. If your search term must include a space, wrap it in quotation marks, e.g., name:"John Doe".

FilterDescriptionExample
title:The title of the tasktitle:"Chase bloods"
start:Task start date in ISO 8601 formatstart:2020-05-03
end:Task end date in ISO 8601 formatend:2020-05-04
status:Status of the taskstatus:in_progress
tag:Tag nametag:urgent
location:Location name of the encounterlocation:NW9
patient:Name of the patientpatient:"John Doe"

Search tasks

You can search tasks using the query parameter. You can also get more specialised searches by using filters within your query. Search results can also be sorted and ordered according to your needs.

To filter tasks to specific encounters, you can use the encounter_id parameter, which can be either a single value or an array.

Searching metadata is also possible using the nested object syntax, e.g., metadata.key:value.

POST /tasks/search

→ Parameters

query string optional
Terms and filters to be applied to the search.

sort string optional
What field to be used for sorting the results. One of: start, end, location, patient, or title. Where location is the encounter location, and patient is the patient name.

order string optional
Direction of the sorting. Possible values are: desc or asc.

page integer optional
Page number for pagination. Integer greater than zero. Default to 1. Pages are limited to 50 items.

encounter_id string or array optional
Unique id for encounters to filter the search by.

← Response

Returns an array of task objects.

Members

Task members are users who have any relation with the task. Usually are the persons responsible for completing the task.

Add member to task

You can add a member to a task for the given id by informing the user_id.

PUT /tasks/:id/members

→ Parameters

user_id string REQUIRED
Unique identification for the user.

← Response

Returns 204 No Content.

Remove member from a task

You can remove a member from a task for the given id by informing the user_id.

DELETE /tasks/:id/members

→ Parameters

user_id string REQUIRED
Unique identification for the user.

← Response

Returns 204 No Content.

Tags

Tags are used to mark tasks that share a common attribute. They're a lightweight, and easy-to-use way of categorisation and classification.

The organization contains the full set of available tags. Tags must be created within the organization before they can be applied to tasks.

Add task tag

You can tag a task providing the tag_id for the given task id.

PUT /tasks/:id/tags

→ Parameters

tag_id string REQUIRED
Unique identification for the tag.

← Response

Returns 204 No Content.

Remove tag from a task

You can untag a task providing the tag_id for the given task id.

DELETE /tasks/:id/tags

→ Parameters

tag_id string REQUIRED
Unique identification for the tag.

← Response

Returns 204 No Content.