Integration Task

Introduction #

The IntegrationTask and IntegrationTaskReview models represent incoming documents that need processing in Canvas. Integration tasks are created when documents arrive via fax, document upload, integration engine, or the patient portal. Each task can have one or more reviews that track who is responsible for processing the document and its current state.

Basic Usage #

To retrieve an IntegrationTask or IntegrationTaskReview by identifier, use the get method on the model manager:

from canvas_sdk.v1.data.integration_task import IntegrationTask, IntegrationTaskReview

task = IntegrationTask.objects.get(id="d2194110-5c9a-4842-8733-ef09ea5ead11")
review = IntegrationTaskReview.objects.get(id="c1a5a35a-4ee2-4a0e-85c0-21739dc8c4a8")

If you have a patient object, integration tasks can be accessed with the integration_tasks attribute on a Patient object:

from canvas_sdk.v1.data.patient import Patient

patient = Patient.objects.get(id="1eed3ea2a8d546a1b681a2a45de1d790")
tasks = patient.integration_tasks.all()

Filtering #

Integration tasks and reviews can be filtered by any attribute that exists on the models.

By status #

Filter tasks by their processing status:

from canvas_sdk.v1.data.integration_task import IntegrationTask

# Get all unread tasks
unread = IntegrationTask.objects.unread()

# Get tasks pending review (UNREAD or READ)
pending = IntegrationTask.objects.pending_review()

# Get processed tasks (PROCESSED or REVIEWED)
processed = IntegrationTask.objects.processed()

# Get tasks with errors
errored = IntegrationTask.objects.with_errors()

# Get non-junked tasks
active = IntegrationTask.objects.not_junked()

By channel #

Filter tasks by their source channel:

from canvas_sdk.v1.data.integration_task import IntegrationTask

faxes = IntegrationTask.objects.faxes()
uploads = IntegrationTask.objects.uploads()
engine_tasks = IntegrationTask.objects.from_integration_engine()
portal_tasks = IntegrationTask.objects.from_patient_portal()

By patient #

from canvas_sdk.v1.data.integration_task import IntegrationTask

tasks = IntegrationTask.objects.for_patient("patient-id")

Filtering reviews #

from canvas_sdk.v1.data.integration_task import IntegrationTaskReview

# Get reviews for a specific task
reviews = IntegrationTaskReview.objects.for_task("task-id")

# Get active (non-junked) reviews
active_reviews = IntegrationTaskReview.objects.active()

# Get reviews by a specific reviewer
reviewer_reviews = IntegrationTaskReview.objects.by_reviewer("staff-id")

# Get reviews assigned to a specific team
team_reviews = IntegrationTaskReview.objects.by_team("team-id")

Attributes #

IntegrationTask #

Field NameType
idUUID
dbidInteger
createdDateTime
modifiedDateTime
statusIntegrationTaskStatus
typeString
titleString
channelIntegrationTaskChannel
patientPatient
service_providerServiceProvider
reviewsIntegrationTaskReview[]

Properties #

PropertyTypeDescription
is_faxBooleanWhether this is a fax task
is_pendingBooleanWhether this task is pending review
is_processedBooleanWhether this task has been processed
has_errorBooleanWhether this task has an error
is_junkedBooleanWhether this task is junked

IntegrationTaskReview #

Field NameType
idUUID
dbidInteger
createdDateTime
modifiedDateTime
taskIntegrationTask
template_nameString
document_keyString
reviewerStaff
team_reviewerTeam
junkedBoolean

Properties #

PropertyTypeDescription
is_activeBooleanWhether this review is active (not junked)

Enumeration types #

IntegrationTaskStatus #

ValueLabel
UNRUnread
UERUnread Error
REARead
ERRError
PROProcessed
REVReviewed
JUNJunk

IntegrationTaskChannel #

ValueLabel
faxFax
document_uploadDocument Upload
from_integration_engineFrom Integration Engine
from_patient_portalFrom Patient Portal