API Request | subscriptions.WatchTable == 'Schedule'

For requests or help with our API
Post Reply
rinse-dental
Posts: 118
Joined: Wed Apr 06, 2022 12:04 pm

API Request | subscriptions.WatchTable == 'Schedule'

Post by rinse-dental » Tue Mar 18, 2025 4:24 pm

Hello. re: Open Dental v. 24.4.24

Question. Can you please confirm which db events events.Schedule is listening for? As far as I can tell it's only ADD.

Two requests
1. Please add the operatories string array to the event. Please also see my notes regarding type inconsistencies.
{
"ScheduleNum": "24555", << FYI events.Schedule returns an int.
"SchedDate": "2022-04-04",
"StartTime": "08:00:00",
"StopTime": "12:00:00",
"SchedType": "Provider",
"ProvNum": "2", << FYI. events.Schedule returns an int.
"BlockoutType": "0", << FYI. events.Schedule returns an int.
"blockoutType": "",
"Note": "",
"operatories": "5", << PLEASE ADD
"EmployeeNum": "0" << FYI. events.Schedule returns an int.
}

2. Please include edits to the Schedule object (specifically operatories) to your listener. Please also include Schedule Delete.

If it's possible, rather than add distinct Schedule Delete listening, perhaps you can add a type field with schedule.add, schedule.edit, schedule.delete that we can then process.

Thank you!

justine
Posts: 278
Joined: Tue Dec 28, 2021 7:59 am

Re: API Request | subscriptions.WatchTable == 'Schedule'

Post by justine » Thu Mar 20, 2025 2:59 pm

rinse-dental wrote:
Tue Mar 18, 2025 4:24 pm
Hello. re: Open Dental v. 24.4.24

Question. Can you please confirm which db events events.Schedule is listening for? As far as I can tell it's only ADD.

Two requests
1. Please add the operatories string array to the event. Please also see my notes regarding type inconsistencies.
{
"ScheduleNum": "24555", << FYI events.Schedule returns an int.
"SchedDate": "2022-04-04",
"StartTime": "08:00:00",
"StopTime": "12:00:00",
"SchedType": "Provider",
"ProvNum": "2", << FYI. events.Schedule returns an int.
"BlockoutType": "0", << FYI. events.Schedule returns an int.
"blockoutType": "",
"Note": "",
"operatories": "5", << PLEASE ADD
"EmployeeNum": "0" << FYI. events.Schedule returns an int.
}

2. Please include edits to the Schedule object (specifically operatories) to your listener. Please also include Schedule Delete.

If it's possible, rather than add distinct Schedule Delete listening, perhaps you can add a type field with schedule.add, schedule.edit, schedule.delete that we can then process.

Thank you!
Hello rinse-dental,

API database events fire whenever something changed in the table you are subscribed to. This includes a new row, or an updated row. However, it is impossible to return a row that has been deleted.

We cannot add schedule delete.
The schedule table does not contain an operatory field.
We are not adding distinct Schedule listening.

Thanks!

rinse-dental
Posts: 118
Joined: Wed Apr 06, 2022 12:04 pm

Re: API Request | subscriptions.WatchTable == 'Schedule'

Post by rinse-dental » Thu Mar 20, 2025 6:22 pm

API database events fire whenever something changed in the table you are subscribed to. This includes a new row, or an updated row. However, it is impossible to return a row that has been deleted.

We cannot add schedule delete.
The schedule table does not contain an operatory field.
We are not adding distinct Schedule listening.
Thanks. My assumption is this is working similar to the appointments event, which also return fields not on the table.

justine
Posts: 278
Joined: Tue Dec 28, 2021 7:59 am

Re: API Request | subscriptions.WatchTable == 'Schedule'

Post by justine » Fri Mar 21, 2025 8:45 am

rinse-dental wrote:
Thu Mar 20, 2025 6:22 pm
API database events fire whenever something changed in the table you are subscribed to. This includes a new row, or an updated row. However, it is impossible to return a row that has been deleted.

We cannot add schedule delete.
The schedule table does not contain an operatory field.
We are not adding distinct Schedule listening.
Thanks. My assumption is this is working similar to the appointments event, which also return fields not on the table.
Hello rinse-dental,

The Appointment event does include some additional fields that aren’t stored directly in the database table, but they are not pulled from other tables. They’re derived or calculated—not joined.

Thanks!

rinse-dental
Posts: 118
Joined: Wed Apr 06, 2022 12:04 pm

Re: API Request | subscriptions.WatchTable == 'Schedule'

Post by rinse-dental » Tue Mar 25, 2025 5:25 pm

Thanks! Maybe you can help me work through the best approach for my issue...

I'm using the Appointment, AppointmentDeleted, and Schedule Events to calculate and store Appointment Slots for each location in Google Firestore... not dissimilar to the GET Slots endpoint, but with blockouts incorporated into the logic. I've found this to be a significantly more efficient approach to returning appointment availability given our other requirements.

My issues are: 1) if a schedule is deleted or 2) if an operatory is added or removed from an existing Schedule. This is most noticeable with blockouts.

If we want to have a near zero chance of scheduling issues, the only two solutions that come to mind are:
[*] Update events.Schedule (original request, and not possible)
[*] Update Schedules GET (multiple) to include a DateTStamp to that I can run a period check; however, DateTStamp doesn't exist on the Schedule table.

As a stop gap, I'm using Schedules GET (multiple) to get and recalculate the day's availability when I hear Event.Appointment and Event.AppointmentDeleted fire. It's both inefficient and imperfect.

I welcome any suggestions. Thank you for your help!

Post Reply