Note Effects

Note Effects #

The Canvas SDK provides effects to facilitate creating visit notes, appointments, and schedule events. Below you’ll find detailed documentation for each effect type.

Note Effect #

The Note effect facilitates the creation of visit notes for patients.

Attributes #

AttributeTypeDescriptionRequired
note_type_idUUID or strIdentifier for the note typeYes
datetime_of_servicedatetime.datetimeWhen the service was providedYes
patient_idstrIdentifier for the patientYes
practice_location_idUUID or strIdentifier for the practice locationYes
provider_idstrIdentifier for the providerYes

Implementation Details #

  • Validates that the note type exists and has an appropriate category
  • Ensures the patient exists in the system
  • Verifies that the practice location and provider are valid

Example Usage #

from canvas_sdk.effects.note.note import Note
import datetime

note_effect = Note(
    note_type_id="note-type-uuid",
    datetime_of_service=datetime.datetime.now(),
    patient_id="patient-uuid",
    practice_location_id="practice-location-uuid",
    provider_id="provider-uuid"
)

return note_effect.create()

ScheduleEvent Effect #

The ScheduleEvent effect enables creating schedule events for providers, with optional patient association.

Attributes #

AttributeTypeDescriptionRequired
note_type_idUUID or strIdentifier for the note type (must be of category SCHEDULE_EVENT)Yes
patient_idstr or NoneIdentifier for the patient (if applicable)Conditional
descriptionstr or NoneCustom description for the eventConditional
start_timedatetime.datetimeStart time of the eventYes
duration_minutesintDuration of the event in minutesYes
practice_location_idUUID or strIdentifier for the practice locationYes
provider_idstrIdentifier for the providerYes
statusAppointmentProgressStatus or NoneStatus of the eventNo
external_identifierslist[AppointmentIdentifier] or NoneExternal system identifiersNo

Implementation Details #

  • Validates that the note type exists and is of category SCHEDULE_EVENT
  • Ensures patient is provided if the note type requires it
  • Verifies that custom descriptions are only used for note types that allow them
  • Validates that the practice location and provider exist

Example Usage #

from canvas_sdk.effects.note.create_appointment import ScheduleEvent
import datetime

schedule_event_effect = ScheduleEvent(
    note_type_id="schedule-event-note-type-uuid",
    patient_id="patient-uuid",  # Optional depending on note type
    description="Team meeting",  # Optional depending on note type
    start_time=datetime.datetime.now(),
    duration_minutes=30,
    practice_location_id="practice-location-uuid",
    provider_id="provider-uuid"
)

return schedule_event_effect.create()

Appointment Effect #

The Appointment effect facilitates creating patient appointments with providers.

Attributes #

AttributeTypeDescriptionRequired
appointment_note_type_idUUID or strIdentifier for the appointment note type (must be of category ENCOUNTER and scheduleable)Yes
patient_idstrIdentifier for the patientYes
meeting_linkstr or NoneLink for virtual appointmentsNo
start_timedatetime.datetimeStart time of the appointmentYes
duration_minutesintDuration of the appointment in minutesYes
practice_location_idUUID or strIdentifier for the practice locationYes
provider_idstrIdentifier for the providerYes
statusAppointmentProgressStatus or NoneStatus of the appointmentNo
external_identifierslist[AppointmentIdentifier] or NoneExternal system identifiersNo

Implementation Details #

  • Validates that the appointment note type exists, is of category ENCOUNTER, and is scheduleable
  • Ensures the patient exists in the system
  • Verifies that the practice location and provider exist

Example Usage #

from canvas_sdk.effects.note.create_appointment import Appointment
import datetime

appointment_effect = Appointment(
    appointment_note_type_id="appointment-note-type-uuid",
    patient_id="patient-uuid",
    meeting_link="https://zoom.us/example-link",  # Optional
    start_time=datetime.datetime.now(),
    duration_minutes=60,
    practice_location_id="practice-location-uuid",
    provider_id="provider-uuid"
)

return appointment_effect.create()

Validation #

All effects perform comprehensive validation before execution:

  1. Entity Existence: Validates that referenced entities (patients, providers, practice locations, note types) exist in the system
  2. Type Compatibility: Ensures note types are appropriate for the intended operation:
    • Visit notes cannot use APPOINTMENT, SCHEDULE_EVENT, MESSAGE, or LETTER note types
    • Schedule events must use SCHEDULE_EVENT note types
    • Appointments must use ENCOUNTER note types that are scheduleable
  3. Field Requirement Enforcement: The system validates conditional field requirements based on note type configurations:
    • Patient Association Requirements: For note types with is_patient_required=True, the system enforces that a valid patient ID is provided. This is particularly important for schedule events that may or may not be associated with specific patients.
    • Custom Description Validation: When a note type has allow_custom_title=False, the system prevents custom descriptions from being added. This ensures adherence to standardized naming conventions for certain types of appointments and events.
    • Required Field Validation: All required fields are checked for proper values and formats before the effect is executed.