Skip to content

Tasks

Tasks

You can learn more about the Tasks feature in general on Healthie’s Help platform.

The Task Object

{
"id": "1800",
"client": {
"id": 300
},
"user": {
"id": "200"
},
"creator": {
"id": "100"
},
"complete": false,
"completed_at": null,
"content": "Example task content",
"created_at": "2022-01-01 09:45:20 -0400",
"priority": 1,
"position": 0,
"seen": true,
"reminder": {
"id": "1190",
"interval_type": "once",
"interval_value": "2022-01-08",
"is_enabled": true
},
"hidden": false,
"due_date": "2022-01-10 00:00:00 -0400"
}

Tasks are Task objects.

Some of the Task properties are described below:

FieldDescription
priority0 when standard priority, 1 if high priority
clientA Patient object related to this Task. Null if the Task is not Patient-related
creatorUser who crated the Task. It’s not always the assignee (user)
positionPosition of the Task on the List
seenWhether the Task has been seen by the owner (user)
completeWhether the Task is complete

You can view the full list of available fields here.

Retrieving a Task

query getTask($id: ID) {
task(id: $id) {
id
client {
id
}
user {
id
}
creator {
id
email
}
complete
completed_at
content
created_at
priority
position
seen
reminder {
id
interval_type
interval_value
is_enabled
}
hidden
due_date
}
}

Retrieving a Task is done via the task query.

InputInfo
idRequired. ID of the Task.

Returns a Task object.

Listing Tasks

query tasks(
$client_id: String
$withoutPagination: Boolean
$type: String
$completed_status: String
$sort_by: String
$keywords: String
$show_hidden: Boolean
$created_by_self: Boolean
) {
tasks(
client_id: $client_id
withoutPagination: $withoutPagination
type: $type
completed_status: $completed_status
sort_by: $sort_by
keywords: $keywords
show_hidden: $show_hidden
created_by_self: $created_by_self
) {
id
client {
id
}
user {
id
}
creator {
id
email
}
complete
completed_at
content
created_at
priority
position
seen
reminder {
id
interval_type
interval_value
is_enabled
}
hidden
due_date
}
}

Listing Entries is done via the tasks query.

You can view a full list of potential arguments here.

InputInfo
client_idOptional. ID of the Patient associated with the Task.
withoutPaginationOptional. Keywords to search by. Entries can be searched by description.
typeOptional. Possible values are:
  • all - returns all Tasks that are either assigned or created by the current User
  • assigned - Tasks created by other Users and assigned to the current User
completed_statusOptional.
  • complete - return only complete Tasks
  • incomplete - return only incomplete Tasks
created_by_selfOptional. If set to true, will return only Tasks created by the current User.
show_hiddenOptional. If set to true, will query hidden tasks.
keywordsOptional. Keywords to search Tasks by. Tasks can be searcheds by the content field.
sort_byOptional. Possible values are:
  • task_asc
  • task_desc
  • creator_asc
  • creator_desc
  • assignee_asc
  • assignee_desc
  • created_asc
  • created_desc
  • priority_asc
  • priority_desc
  • due_date_asc
  • due_date_desc
  • completed_asc
  • completed_desc
By default, Healthie API returns Tasks ordered by position, creation date (newest first) and incomplete first.

Returns a list of Task objects.

Creating a Task

mutation createTask(
$content: String
$user_id: String
$priority: Int
$client_id: String
$due_date: String
$reminder: TaskReminderInput
) {
createTask(
input: {
content: $content
user_id: $user_id
priority: $priority
client_id: $client_id
due_date: $due_date
reminder: $reminder
}
) {
task {
id
}
messages {
field
message
}
}
}

Tasks are created via the createTask mutation. Let’s break down the inputs that this mutation accepts.

You can view a full list of potential inputs here.

InputInfo
contentContent of the Task
user_idOptional. ID of the User to assign the Task to. If none provided, will assign the task to the current User
priorityOptional. Possible values are:
  • 0 - normal priority
  • 1 - high priority
client_idOptional. ID of the Patient related to this Task
completeOptional. Set to true if the Task is already complete
due_dateOptional. A due date of the Task
reminderOptional. A configuration object for the reminder. See descriptions below
reminder.is_enabledSet to true to enable the reminder, false otherwise
reminder.reminder_timeTime, expressed in number of minutes from midnight, to trigger the reminder at
reminder.interval_typeFrequency of the reminder. Possible options are:
  • daily
  • weekly
  • once - default
reminder.interval_valueDate when to trigger the reminder

Returns a createTaskPayload object.

Updating a Task

mutation updateTask(
$id: String
$position: Int
$content: String
$user_id: String
$priority: Int
$client_id: String
$due_date: String
$reminder: TaskReminderInput
) {
updateTask(
input: {
id: $id
position: $position
content: $content
user_id: $user_id
priority: $priority
client_id: $client_id
due_date: $due_date
reminder: $reminder
}
) {
task {
id
}
messages {
field
message
}
}
}

The updateTask mutation shares many common inputs with createTask and those inputs (e.g due_date or priority work the same in both places).

You can view a full list of potential inputs here.

InputInfo
idRequired. The ID of the Task to update.
positionOptional. Set the position of the Task on the list.

Returns an updateTaskPayload object.

Marking all Tasks as seen

mutation markTasksAsSeen($seen: Boolean, $update_all_tasks: Boolean) {
updateTasksBulk(input: { seen: $seen, update_all_tasks: $update_all_tasks }) {
messages {
message
}
}
}

You can programmatically mark all Tasks of the current User as seen by using the updateTasksBulk mutation.

You can view a full list of potential inputs here.

InputInfo
seenSet to true to mark Tasks as seen by the current User, false to mark as unseen.
update_all_tasksBoolean indicating whether all User Tasks should be updated. Set to true.

Returns an bulkUpdateTasksPayload object.

Deleting a Task

Tasks can be deleted via the deleteTask mutation.

You can view a full list of potential inputs here.

mutation deleteTask($id: ID) {
deleteTask(input: { id: $id }) {
task {
id
}
messages {
field
message
}
}
}

The deleteTask mutation is called from an authenticated provider/staff account.

InputInfo
idRequired. ID of the Task to delete.

Returns a deleteTaskPayload object.