Appointments GET Slots - Return all Providers and all Ops

For requests or help with our API
Post Reply
PBECKER
Posts: 125
Joined: Mon Jan 03, 2022 11:54 am

Appointments GET Slots - Return all Providers and all Ops

Post by PBECKER » Wed Oct 12, 2022 12:16 pm

Hello API team, we have a request:


Request : For the following API call --- GET /appointments/Slots?ProvNum=1&OpNum=18&dateStart=2022-03-28&dateEnd=2022-04-01 we need the ability to gives us results for all providers and with all operatories.

Please let me know.

Thank you so much API team

Appointments GET Slots

Version Added: 21.1

This is closer to how search behaves from within Open Dental instead of WebSched. This requires no advanced setup. It looks at open schedule times, whether the schedules are attached to a provider or an operatory.

There are, however, some differences between this and the Search in Open Dental. This returns entire open slots instead of a series of suggested appointment times or the first appointment time for each day. It also currently searches by entire appointment length instead of the XXX provider times on appointments. For providers assigned to a single operatory, the results will be the same as what a person would see if looking at the Appointments Module. If a provider has existing appointments in multiple operatories, it considers all of them as a whole and only returns slots that are available in all operatories for that provider simultaneously. See also Schedules GET.

Most users will specify a Provider and an Operatory.

Parameters: All parameters are optional.

date: For a single day. Must be today or a future date. Default is the next 14 days.
dateStart, dateEnd: For a date range, inclusive of both dates.
lengthMinutes: This allows ignoring slots that are too small.
ProvNum: Provider. Defaults to the Practice Default Provider.
OpNum: (Added in version 22.1) The operatory that the provider is assigned to.

Example Request:
GET /appointments/Slots?date=2021-02-15
GET /appointments/Slots?date=2022-03-30&ProvNum=50&OpNum=16
GET /appointments/Slots?ProvNum=1&OpNum=18&dateStart=2022-03-28&dateEnd=2022-04-01

SLeon
Posts: 476
Joined: Mon Mar 01, 2021 10:00 am

Re: Appointments GET Slots - Return all Providers and all Ops

Post by SLeon » Wed Oct 12, 2022 1:29 pm

The Appointments GET Slots method is meant to check the availability of a provider in their assigned and scheduled operatory. The logic checks the provider's schedule, scheduleops, and appointments for that operatory for the date range. This is helpful for determining when to make a new appointment for patient and a provider (usually the patient.PriProv).

What is your use case for the data on all providers and all operatories? If a single provider is not specified and we attempt to search for all providers, the logic would go through all appointments, all schedules, all scheduleops, and all operatories for each provider on each day of the date range. This would be a huge amount of data that is not particularly useful when scheduling a single appointment.

Could you please clarify how you are wanting to use this?

PBECKER
Posts: 125
Joined: Mon Jan 03, 2022 11:54 am

Re: Appointments GET Slots - Return all Providers and all Ops

Post by PBECKER » Wed Oct 12, 2022 3:23 pm

The requirement is so that we can easily view each provide has an open slot and which one doesn't.

example we would see Dr Becker has open slots (i.e open time available) for an appointment to be created. But, we also need to easily view what open slots for available for Dr Jones. If there are concerns we're also ok if its limited to 5 providers

Let me know if this helps.

Thank you Sarah

-Pedro

SLeon
Posts: 476
Joined: Mon Mar 01, 2021 10:00 am

Re: Appointments GET Slots - Return all Providers and all Ops

Post by SLeon » Thu Oct 13, 2022 8:48 am

Good morning Pedro,

Thank you for the clarification. I understand that you are not just wanting to know a timeslot to schedule an appointment in, but all the available times for your providers and their operatories. I believe you are wanting to something akin to the information shown visually in the Appointment Module within Open Dental. The API already has the capability for you to gather all of this information in just two method calls. To do this:
  1. Run Schedules GET for the date(s) you want to have information on. This will likely be a single day or workweek.
    • You will get the times all the providers are scheduled to work and which operatories they are scheduled in.
    • You will also get the times of any blockouts that are scheduled during that time.
    • Example response:
      Schedules_GET.gif
      Schedules_GET.gif (9.26 KiB) Viewed 1707 times
    • Together this represents all possible schedulable times for the entire dental office.
    • Documentation: https://www.opendental.com/site/apischedules.html
  2. Run Appointments GET (multiple) for the same date range.
    • On each appointment, you can see which provider is unavailable in which operatory.
    • The time the provider is unavailable in that operatory is the appointment.AptDateTime and the duration is represented in appointment.Pattern.
    • Example response, with relevant fields highlighted:
      Appointments_GET.gif
      Appointments_GET.gif (15.17 KiB) Viewed 1707 times
    • Together this represents the times for the entire dental office that are not available for scheduling.
    • Documentation: https://www.opendental.com/site/apiappointments.html
To build your available schedule, you will simply take all possible schedulable times in #1 and remove all of the unavailable times from #2. Then you will have a comprehensive view for when appointments can be scheduled.

There are two ways to keep this list up-to-date:
  1. Use the DateTStamp filter in Appointments GET (multiple) to see all the appointments that have been added/changed since the last time you checked. Adjust the information you gathered in #2 above with these results.
  2. Use Subscriptions POST to subscribe to changes to the dental office's appointment table. At a polling interval you specify (e.g. 5 seconds), Open Dental will automatically query the appointment table for rows that have changed since the last interval (using DateTStamp). This list of appointments is then automatically sent to a webhook endpoint you specified in the Subscription. You would then use this data to adjust the information you gathered in #2 above.
I hope this information and example workflow is helpful. Please let me know if any of the above is unclear.

Post Reply