Task

Fields #

NameTypeRequiredDescription
idstringif updatingThe id of the Task.
assigneeStafffalseThe Staff member assigned to the task.
patientPatientfalseThe Patient that the task pertains to.
titlestringtrueThe title of the task. This shows in the task header in the Canvas UI.
duedatetimefalseThe date/time that the task is due.
statusOne of open, completed or closed.trueThe status of the task. Defaults to ‘open’ if not supplied.
commentslist[TaskComment]falseComments that have been left on the task.
labellist[string]falseLabels that have been added to the task.

Methods #

create #

Returns an Effect to create a Task. Example:

from datetime import datetime, timedelta

from canvas_sdk.data.patient import Patient
from canvas_sdk.data.staff import Staff
from canvas_sdk.data.task import Task

task = Task(
    assignee=Staff(id="3640cd20de8a470aa570a852859ac87e"),
    patient=Patient(id="5350cd20de8a470aa570a852859ac87e"),
    title="Follow Up with patient",
    due=datetime.now() + timedelta(days=30),
)

task.create()

update #

Returns an Effect to update a Task. Example:

task.labels = ["Urgent"]
task.update()

add_comment #

Returns an Effect to add a comment to a Task. Example:

task.add_comment("This needs addressing soon.")