Calendar Create

Create a Clinic or Administrative calendar for a provider, optionally for one location. Canvas titles the calendar from the provider’s name, the calendar type, and the location name.

To keep the calendar linked to its provider after a name change, set description to the provider’s staff id.

Build a Calendar with the attributes you want to set, then return its create() from your handler.

Methods #

create() → Effect #

Creates the calendar.

  • provider and type are required.

Attributes #

AttributeTypeDescriptionRequired
idstr \| UUID \| NoneOptional unique identifier for the calendar.No
providerstr \| UUIDThe id of the provider.Yes
typeCalendarTypeThe type of calendar: CalendarType.Clinic or CalendarType.Administrative.Yes
locationstr \| UUID \| NoneThe id of the location to associate with the calendar.No
descriptionstr \| NoneThe provider’s staff id, the same value as provider. Canvas uses it to link the calendar to the provider. With any other value, Canvas matches the calendar by the provider name in its title, and that match stops working when the provider is renamed.No, but strongly recommended

CalendarType #

An enumeration of calendar types:

ValueDescription
ClinicCalendar for clinical appointments
AdministrativeCalendar for administrative tasks

Example #

from canvas_sdk.effects.calendar import Calendar, CalendarType

provider_id = "4150cd20de8a470aa570a852859ac87e"  # The provider's staff id

Calendar(
   provider=provider_id,
   type=CalendarType.Clinic,
   location="location-uuid",
   description=provider_id,
).create()

Find a provider’s calendar #

To check whether a provider already has a calendar before you create one, filter the Calendar data model by description:

from canvas_sdk.v1.data.calendar import Calendar

provider_id = "4150cd20de8a470aa570a852859ac87e"  # The provider's staff id

calendars = Calendar.objects.filter(description=provider_id)