Events

What is an Event?

An event is an occurrence of an action that happens within Canvas. For example, a patient being prescribed a medication, a user searching for a condition or an appointment being created are all examples of events.

Why should I use them?

By writing plugins that respond to events, plugin code is notified and can react to events that occur in Canvas. This enables plugin authors to create custom workflows whenever a relevant event takes place, such as making a POST request to a webhook.

How do I use them?

To make plugin code react to an event, you can add the event types listed below into the RESPONDS_TO list of a plugin that inherits from BaseProtocol. For example:

from canvas_sdk.events import EventType

class Protocol(BaseProtocol):
    RESPONDS_TO = [EventType.Name(EventType.ALLERGY_INTOLERANCE_CREATED)]

    def compute(self):
        ....

The plugin author can enter custom workflow code into the compute method that will execute every time an Allergy Intolerance is created in Canvas.

For more information on writing plugins, see the guide here.

Event Types #

The following Canvas events are able to trigger a plugin to execute.

EventDescription
CRONThis event fires regularly and can be used for scheduled tasks. See CronTask.
ALLERGY_INTOLERANCE_CREATEDOccurs when an allergy is created for a patient. Additional details for the allergy may become available with subsequent ALLERGY_INTOLERANCE_UPDATED events.
ALLERGY_INTOLERANCE_UPDATEDOccurs when an allergy is updated for a patient.
APPOINTMENT_CANCELEDOccurs when an appointment is cancelled.
APPOINTMENT_CHECKED_INOccurs when a patient has arrived and been checked in for their appointment.
APPOINTMENT_CREATEDOccurs when an appointment is first created/booked.
APPOINTMENT_NO_SHOWEDOccurs when an appointment is marked as a no-show.
APPOINTMENT_RESCHEDULEDOccurs when an appointment is rescheduled. In this case, a new appointment is created that is linked to the appointment it was rescheduled from.
APPOINTMENT_RESTOREDOccurs when a cancelled appointment is restored to a non-cancelled status.
APPOINTMENT_UPDATEDOccurs when details of an appointment are updated.
BILLING_LINE_ITEM_CREATEDOccurs when a billing line item is created from adding a CPT code to a note.
BILLING_LINE_ITEM_UPDATEDOccurs when a billing line item is modified.
CONDITION_ASSESSEDOccurs when a condition is assessed through the Assess Condition command.
CONDITION_CREATEDOccurs when a condition is diagnosed for a patient. Additional details for the condition may become available with subsequent CONDITION_UPDATED events.
CONDITION_RESOLVEDOccurs when a condition is resolved through the Resolve Condition command.
CONDITION_UPDATEDOccurs when a condition is updated for a patient.
CONSENT_CREATEDOccurs when a patient consent is created.
CONSENT_DELETEDOccurs when a patient consent is removed/deleted.
CONSENT_UPDATEDOccurs when a patient consent is updated.
COVERAGE_CREATEDOccurs when a coverage for a patient is created.
COVERAGE_UPDATEDOccurs when a coverage for a patient is updated.
ENCOUNTER_CREATEDOccurs when an encounter is created.
ENCOUNTER_UPDATEDOccurs when an encounter is updated.
IMAGING_REPORT_CREATEDOccurs when an imaging report is entered into the Data Integration section of Canvas.
IMAGING_REPORT_UPDATEDOccurs when an imaging report is updated.
IMMUNIZATION_CREATEDOccurs when an immunization is created. Additional details for the immunization may become available with subsequent IMMUNIZATION_UPDATED events.
IMMUNIZATION_STATEMENT_CREATEDOccurs when an immunization statement is created. Additional details for the immunization statement may become available with subsequent IMMUNIZATION_STATEMENT_UPDATED events.
IMMUNIZATION_STATEMENT_UPDATEDOccurs when an immunization statement is updated.
IMMUNIZATION_UPDATEDOccurs when an immunization is updated.
INSTRUCTION_CREATEDOccurs when an instruction is created using the Instruct command. Additional details for the instruction may become available with subsequent INSTRUCTION_UPDATED events.
INSTRUCTION_UPDATEDOccurs when an instruction is updated.
INTERVIEW_CREATEDOccurs when an interview is created using the Questionnaire command or through the Questionnaire endpoint in the FHIR API. Additional details for the interview may become available with subsequent INTERVIEW_UPDATED events.
INTERVIEW_UPDATEDOccurs when an interview is updated.
LAB_ORDER_CREATEDOccurs when a lab order is created via the Lab Order command. Additional details for the lab order may become available with subsequent LAB_ORDER_UPDATED events.
LAB_ORDER_UPDATEDOccurs when a lab order is updated.
LAB_REPORT_CREATEDOccurs when a lab report is created either through Data Integration, electronic ingestion or the FHIR API.
LAB_REPORT_UPDATEDOccurs when a lab report is updated.
MEDICATION_LIST_ITEM_CREATEDOccurs when a medication is added for a patient.
MEDICATION_LIST_ITEM_UPDATEDOccurs when a medication is updated for a patient.
MESSAGE_CREATEDOccurs when a message (patient/practitioner communication) is created.
PATIENT_CREATEDOccurs when a patient is created.
PATIENT_UPDATEDOccurs when a patient’s data is updated.
PRESCRIPTION_CREATEDOccurs when a prescription is created.
PRESCRIPTION_UPDATEDOccurs when a prescription is created for a patient using the Prescribe command. Additional details for the prescription become available with subsequent PRESCRIPTION_UPDATED events.
REFERRAL_REPORT_CREATEDOccurs when a specialist consult report is created in Data Integration.
REFERRAL_REPORT_UPDATEDOccurs when a specialist consult report is updated.
TASK_COMMENT_CREATEDOccurs when a comment is added to a task.
TASK_CREATEDOccurs when a task is created.
TASK_LABELS_ADJUSTED 
TASK_UPDATEDOccurs when a task is updated.
VITAL_SIGN_CREATEDOccurs when a vitals entry is created for a patient using the Vitals command. Additional details for the vitals become available with subsequent VITAL_SIGN_UPDATED events.
VITAL_SIGN_UPDATEDOccurs when a vitals entry is updated for a patient.
PRE_COMMAND_ORIGINATEOccurs before any command is entered into a note.
POST_COMMAND_ORIGINATEOccurs after any command is entered into a note.
PRE_COMMAND_UPDATEOccurs before the data in any command is updated.
POST_COMMAND_UPDATEOccurs after the data in any command is updated.
PRE_COMMAND_COMMITOccurs before any command is committed.
POST_COMMAND_COMMITOccurs after any command is committed.
PRE_COMMAND_DELETEOccurs before any command is deleted.
POST_COMMAND_DELETEOccurs after any command is deleted.
PRE_COMMAND_ENTER_IN_ERROROccurs before any command is marked as entered in error.
POST_COMMAND_ENTER_IN_ERROROccurs after any command is marked as entered in error.
PRE_COMMAND_EXECUTE_ACTIONOccurs before an action is executed on any command.
POST_COMMAND_EXECUTE_ACTIONOccurs after an action is executed on any command.
ASSESS_COMMAND__CONDITION_SELECTEDOccurs after a condition is selected in the Assess command.
MEDICATION_STATEMENT__MEDICATION__PRE_SEARCHOccurs before a medication statement search for a medication.
MEDICATION_STATEMENT__MEDICATION__POST_SEARCHOccurs after the initial results are fetched for the medication search in the medication statement command.
MEDICATION_STATEMENT__MEDICATION__SELECTEDOccurs when a medication is selected from Medication Statement search results.
ASSESS_COMMAND__PRE_ORIGINATEOccurs before the Assess command is first entered into a note.
ASSESS_COMMAND__POST_ORIGINATEOccurs after the Assess command is first entered into a note.
ASSESS_COMMAND__PRE_UPDATEOccurs before data for the Assess command is updated.
ASSESS_COMMAND__POST_UPDATEOccurs after data for the Assess command is updated.
ASSESS_COMMAND__PRE_COMMITOccurs before the Assess command is committed.
ASSESS_COMMAND__POST_COMMITOccurs after the Assess command is committed.
ASSESS_COMMAND__PRE_DELETEOccurs before the Assess command is deleted.
ASSESS_COMMAND__POST_DELETEOccurs after the Assess command is deleted.
ASSESS_COMMAND__PRE_ENTER_IN_ERROROccurs before the Assess command is marked as entered in error.
ASSESS_COMMAND__POST_ENTER_IN_ERROROccurs after the Assess command is marked as entered in error.
ASSESS_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Assess command.
ASSESS_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Assess command.
ASSESS__CONDITION__POST_SEARCHOccurs after the initial results are fetched for the condition search in the Assess command.
DIAGNOSE__DIAGNOSE__POST_SEARCHOccurs after the initial results are fetched for the diagnosis search in the Diagnose command.
GOAL_COMMAND__PRE_ORIGINATEOccurs before the Goal command is first entered into a note.
GOAL_COMMAND__POST_ORIGINATEOccurs after the Goal command is first entered into a note.
GOAL_COMMAND__PRE_UPDATEOccurs before data for the Goal command is updated.
GOAL_COMMAND__POST_UPDATEOccurs after data for the Goal command is updated.
GOAL_COMMAND__PRE_COMMITOccurs before the Goal command is committed.
GOAL_COMMAND__POST_COMMITOccurs after the Goal command is committed.
GOAL_COMMAND__PRE_DELETEOccurs before the Assess command is deleted.
GOAL_COMMAND__POST_DELETEOccurs after the Assess command is deleted.
GOAL_COMMAND__PRE_ENTER_IN_ERROROccurs before the Goal command is marked as entered in error.
GOAL_COMMAND__POST_ENTER_IN_ERROROccurs after the Goal command is marked as entered in error.
GOAL_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Goal command.
GOAL_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Goal command.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__PRE_ORIGINATEOccurs before the History of Present Illness command is first entered into a note.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__POST_ORIGINATEOccurs after the History of Present Illness command is first entered into a note.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__PRE_UPDATEOccurs before data for the History of Present Illness command is updated.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__POST_UPDATEOccurs after data for the History of Present Illness command is updated.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__PRE_COMMITOccurs before the History of Present Illness command is committed.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__POST_COMMITOccurs after the History of Present Illness command is committed.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__PRE_DELETEOccurs before the History of Present Illness command is deleted.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__POST_DELETEOccurs after the History of Present Illness command is deleted.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__PRE_ENTER_IN_ERROROccurs before the History of Present Illness command is marked as entered in error.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__POST_ENTER_IN_ERROROccurs after the History of Present Illness command is marked as entered in error.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the History of Present Illness command.
HISTORY_OF_PRESENT_ILLNESS_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the History of Present Illness command.
MEDICATION_STATEMENT_COMMAND__PRE_ORIGINATEOccurs before the Medication Statement command is first entered into a note.
MEDICATION_STATEMENT_COMMAND__POST_ORIGINATEOccurs after the Medication Statement command is first entered into a note.
MEDICATION_STATEMENT_COMMAND__PRE_UPDATEOccurs before data for the Medication Statement command is updated.
MEDICATION_STATEMENT_COMMAND__POST_UPDATEOccurs after data for the Medication Statement command is updated.
MEDICATION_STATEMENT_COMMAND__PRE_COMMITOccurs before the Medication Statement command is committed.
MEDICATION_STATEMENT_COMMAND__POST_COMMITOccurs after the Medication Statement command is committed.
MEDICATION_STATEMENT_COMMAND__PRE_DELETEOccurs before the Medication Statement command is deleted.
MEDICATION_STATEMENT_COMMAND__POST_DELETEOccurs after the Medication Statement command is deleted.
MEDICATION_STATEMENT_COMMAND__PRE_ENTER_IN_ERROROccurs before the Medication Statement command is marked as entered in error.
MEDICATION_STATEMENT_COMMAND__POST_ENTER_IN_ERROROccurs after the Medication Statement command is marked as entered in error.
MEDICATION_STATEMENT_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Medication Statement command.
MEDICATION_STATEMENT_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Medication Statement command.
PLAN_COMMAND__PRE_ORIGINATEOccurs before the Plan command is first entered into a note.
PLAN_COMMAND__POST_ORIGINATEOccurs after the Plan command is first entered into a note.
PLAN_COMMAND__PRE_UPDATEOccurs before data for the Plan command is updated.
PLAN_COMMAND__POST_UPDATEOccurs after data for the Plan command is updated.
PLAN_COMMAND__PRE_COMMITOccurs before the Plan command is committed.
PLAN_COMMAND__POST_COMMITOccurs after the Plan command is committed.
PLAN_COMMAND__PRE_DELETEOccurs before the Plan command is deleted.
PLAN_COMMAND__POST_DELETEOccurs after the Plan command is deleted.
PLAN_COMMAND__PRE_ENTER_IN_ERROROccurs before the Plan command is marked as entered in error.
PLAN_COMMAND__POST_ENTER_IN_ERROROccurs after the Plan command is marked as entered in error.
PLAN_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Plan command.
PLAN_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Plan command.
PRESCRIBE_COMMAND__PRE_ORIGINATEOccurs before the Prescribe command is first entered into a note.
PRESCRIBE_COMMAND__POST_ORIGINATEOccurs after the Prescribe command is first entered into a note.
PRESCRIBE_COMMAND__PRE_UPDATEOccurs before data for the Prescribe command is updated.
PRESCRIBE_COMMAND__POST_UPDATEOccurs after data for the Prescribe command is updated.
PRESCRIBE_COMMAND__PRE_COMMITOccurs before the Prescribecommand is committed.
PRESCRIBE_COMMAND__POST_COMMITOccurs after the Prescribe command is committed.
PRESCRIBE_COMMAND__PRE_DELETEOccurs before the Prescribe command is deleted.
PRESCRIBE_COMMAND__POST_DELETEOccurs after the Prescribe command is deleted.
PRESCRIBE_COMMAND__PRE_ENTER_IN_ERROROccurs before the Prescribe command is marked as entered in error.
PRESCRIBE_COMMAND__POST_ENTER_IN_ERROROccurs after the Prescribe command is marked as entered in error.
PRESCRIBE_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Prescribe command.
PRESCRIBE_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Prescribe command.
PRESCRIBE__PRESCRIBE__POST_SEARCHOccurs after the initial results are fetched for the medication search in the Prescribe command.
QUESTIONNAIRE_COMMAND__PRE_ORIGINATEOccurs before the Questionnaire command is first entered into a note.
QUESTIONNAIRE_COMMAND__POST_ORIGINATEOccurs after the Questionnaire command is first entered into a note.
QUESTIONNAIRE_COMMAND__PRE_UPDATEOccurs before data for the Questionnaire command is updated.
QUESTIONNAIRE_COMMAND__POST_UPDATEOccurs after data for the Questionnaire command is updated.
QUESTIONNAIRE_COMMAND__PRE_COMMITOccurs before the Questionnaire command is committed.
QUESTIONNAIRE_COMMAND__POST_COMMITOccurs after the Questionnaire command is committed.
QUESTIONNAIRE_COMMAND__PRE_DELETEOccurs before the Questionnaire command is deleted.
QUESTIONNAIRE_COMMAND__POST_DELETEOccurs after the Questionnaire command is deleted.
QUESTIONNAIRE_COMMAND__PRE_ENTER_IN_ERROROccurs before the Questionnaire command is marked as entered in error.
QUESTIONNAIRE_COMMAND__POST_ENTER_IN_ERROROccurs after the Questionnaire command is marked as entered in error.
QUESTIONNAIRE_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Questionnaire command.
QUESTIONNAIRE_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Questionnaire command.
QUESTIONNAIRE__QUESTIONNAIRE__POST_SEARCHOccurs after the initial results are fetched for the questionnaire search in the Questionnaire command.
REASON_FOR_VISIT_COMMAND__PRE_ORIGINATEOccurs before the Reason for Visit command is first entered into a note.
REASON_FOR_VISIT_COMMAND__POST_ORIGINATEOccurs after the Reason for Visit command is first entered into a note.
REASON_FOR_VISIT_COMMAND__PRE_UPDATEOccurs before data for the Reason for Visit command is updated.
REASON_FOR_VISIT_COMMAND__POST_UPDATEOccurs after data for the Reason for Visit command is updated.
REASON_FOR_VISIT_COMMAND__PRE_COMMITOccurs before the Reason for Visit command is committed.
REASON_FOR_VISIT_COMMAND__POST_COMMITOccurs after the Reason for Visit command is committed.
REASON_FOR_VISIT_COMMAND__PRE_DELETEOccurs before the Reason for Visit command is deleted.
REASON_FOR_VISIT_COMMAND__POST_DELETEOccurs after the Reason for Visit command is deleted.
REASON_FOR_VISIT_COMMAND__PRE_ENTER_IN_ERROROccurs before the Reason for Visit command is marked as entered in error.
REASON_FOR_VISIT_COMMAND__POST_ENTER_IN_ERROROccurs after the Reason for Visit command is marked as entered in error.
REASON_FOR_VISIT_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Reason for Visit command.
REASON_FOR_VISIT_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Reason for Visit command.
REASON_FOR_VISIT__CODING__POST_SEARCHOccurs after the initial results are fetched for the reason search in the Reason for Visit command.
STOP_MEDICATION_COMMAND__PRE_ORIGINATEOccurs before the Stop Medication command is first entered into a note.
STOP_MEDICATION_COMMAND__POST_ORIGINATEOccurs after the Stop Medication command is first entered into a note.
STOP_MEDICATION_COMMAND__PRE_UPDATEOccurs before data for the Stop Medication command is updated.
STOP_MEDICATION_COMMAND__POST_UPDATEOccurs after data for the Stop Medication command is updated.
STOP_MEDICATION_COMMAND__PRE_COMMITOccurs before the Stop Medication command is committed.
STOP_MEDICATION_COMMAND__POST_COMMITOccurs after the Stop Medication command is committed.
STOP_MEDICATION_COMMAND__PRE_DELETEOccurs before the Stop Medication command is deleted.
STOP_MEDICATION_COMMAND__POST_DELETEOccurs after the Stop Medication command is deleted.
STOP_MEDICATION_COMMAND__PRE_ENTER_IN_ERROROccurs before the Stop Medication command is marked as entered in error.
STOP_MEDICATION_COMMAND__POST_ENTER_IN_ERROROccurs after the Stop Medication command is marked as entered in error.
STOP_MEDICATION_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Stop Medication command.
STOP_MEDICATION_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Stop Medication command.
STOP_MEDICATION__MEDICATION__POST_SEARCHOccurs after the initial results are fetched for the medication search in the Stop Medication command.
TASK_COMMAND__PRE_ORIGINATEOccurs before the Task command is first entered into a note.
TASK_COMMAND__POST_ORIGINATEOccurs after the Task command is first entered into a note.
TASK_COMMAND__PRE_UPDATEOccurs before data for the Task command is updated.
TASK_COMMAND__POST_UPDATEOccurs after data for the Task command is updated.
TASK_COMMAND__PRE_COMMITOccurs before the Task command is committed.
TASK_COMMAND__POST_COMMITOccurs after the Task command is committed.
TASK_COMMAND__PRE_DELETEOccurs before the Task command is deleted.
TASK_COMMAND__POST_DELETEOccurs after the Task command is deleted.
TASK_COMMAND__PRE_ENTER_IN_ERROROccurs before the Task command is marked as entered in error.
TASK_COMMAND__POST_ENTER_IN_ERROROccurs after the Task command is marked as entered in error.
TASK_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Task command.
TASK_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Task command.
UPDATE_GOAL_COMMAND__PRE_ORIGINATEOccurs before the Update Goal command is first entered into a note.
UPDATE_GOAL_COMMAND__POST_ORIGINATEOccurs after the Update Goal command is first entered into a note.
UPDATE_GOAL_COMMAND__PRE_UPDATEOccurs before data for the Update Goal command is updated.
UPDATE_GOAL_COMMAND__POST_UPDATEOccurs after data for the Update Goal command is updated.
UPDATE_GOAL_COMMAND__PRE_COMMITOccurs before the Update Goal command is committed.
UPDATE_GOAL_COMMAND__POST_COMMITOccurs after the Update Goal command is committed.
UPDATE_GOAL_COMMAND__PRE_DELETEOccurs before the Update Goal command is deleted.
UPDATE_GOAL_COMMAND__POST_DELETEOccurs after the Update Goal command is deleted.
UPDATE_GOAL_COMMAND__PRE_ENTER_IN_ERROROccurs before the Update Goal command is marked as entered in error.
UPDATE_GOAL_COMMAND__POST_ENTER_IN_ERROROccurs after the Update Goal command is marked as entered in error.
UPDATE_GOAL_COMMAND__PRE_EXECUTE_ACTIONOccurs before an action is executed on the Update Goal command.
UPDATE_GOAL_COMMAND__POST_EXECUTE_ACTIONOccurs after an action is executed on the Update Goal command.
UPDATE_GOAL__GOAL_STATEMENT__POST_SEARCHOccurs after the initial results are fetched for the goal search in the Update Goal command.
PATIENT_CHART__CONDITIONSOccurs when the conditions are loaded within the patient summary
Useful guides
Your First Plugin
On this page