Task

Introduction #

A Task represents a to-do item to be addressed. Tasks can be assigned to individual staff members and can also have associated comments and labels.

Basic usage #

To get a task by it’s identifier, use the get method on the Task model manager:

from canvas_sdk.v1.data.task import Task

task = Task.objects.get(id="7895e1db-f8de-4660-a0a3-9e5b43a475c6")

From a Patient object, tasks for the patient can be accessed with the tasks attribute:

import arrow
from canvas_sdk.v1.data.patient import Patient
from canvas_sdk.v1.data.task import TaskStatus

patient = Patient.objects.get(id="36950971cb3e4174ad8b9d365abfd6d0")

# All tasks for the patient
tasks_for_patient = patient.tasks.all()

# Tasks for the patient that are overdue
tasks_for_patient_overdue = patient.tasks.filter(due__lte=arrow.utcnow().datetime, status=TaskStatus.OPEN)

Task objects are also able to have associated TaskLabel objects.

from canvas_sdk.v1.data.task import Task

task = Task.objects.get(id="7895e1db-f8de-4660-a0a3-9e5b43a475c6")

[(label.name, label.color,) for label in task.labels.all()]

# [('Emergent', 'red')]

Staff members are able to leave comments on tasks. These are stored as associated TaskComment objects. For example:

from canvas_sdk.v1.data.task import Task

task = Task.objects.get(id="7895e1db-f8de-4660-a0a3-9e5b43a475c6")

[(comment.creator, comment.body,) for comment in task.comments.all()]
# [(<Staff: Sam Jones>, "Please call patient.")]

Attributes #

Task #

Field NameType
idUUID
dbidInteger
createdDateTime
modifiedDateTime
creatorStaff
assigneeStaff
patientPatient
task_typeTaskType
tagString
titleString
dueDateTime
due_eventEventType
statusTaskStatus

TaskComment #

Field NameType
idUUID
dbidInteger
createdDateTime
modifiedDateTime
creatorStaff
taskTask
bodyString

TaskLabel #

Field NameType
idUUID
dbidInteger
tasksM2M
positionInteger
colorColorEnum
task_associationOrigin
nameString
activeBoolean
modulesTaskLabelModule

Enumeration types #

TaskType #

ValueLabel
TaskTask
ReminderReminder

EventType #

ValueLabel
Chart OpenChart Open

TaskStatus #

ValueLabel
COMPLETEDCompleted
CLOSEDClosed
OPENOpen

TaskLabelModule #

ValueLabel
claimsClaims
tasksTasks

Origin #

ValueLabel
REF_CMDReferral command
CMP_IMG_ORDCompleting image orders
IMG_REP_REVImaging report review
LAB_RES_REVLab results review
CON_REP_REVConsult report review
UNC_DOC_REP_REVUncategorized document report review
ASN_NOT_PHN_REVAssigned note/phone call for review
POP_HLT_OUTPopulation health outreach
CMP_LAB_ORDCompleting lab orders
CHT_PDFChart PDF
EXP_CLM_SNOExpired claim snoozed
FLG_PST_REVFlagged posting review
BAT_PTN_STABatch patient statements
INC_COVIncomplete Coverage

ColorEnum #

ValueLabel
redRed
orangeOrange
yellowYellow
oliveOlive
greenGreen
tealTeal
blueBlue
violetViolet
purplePurple
pinkPink
brownBrown
greyGrey
blackBlack