API Issue - Slots

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

API Issue - Slots

Post by PBECKER » Tue Feb 15, 2022 7:14 am

Open Dental Team

We believe we may have found an issue with the following API call. https://api.opendental.com/api/v1/appoi ... ProvNum=18

Scenario: Provider 18 is scheduled to work in OPNum 21 from 0800 to 1900.

Issue: When we run the following GET https://api.opendental.com/api/v1/appoi ... ProvNum=18 it returns the entire schedule for ProvNumber 18 which "only assigned" to OpNum 21.

The issue is the results should only return "open slots" that are available. Example If ProvNum 18 has an opening from 08:00 to 11:00 then the results should only show open slots that are available to schedule and not the entire day 0800 to 1900 as the provider only has 08:00 to 11:00 available


{
"DateTimeStart": "2022-02-24 08:00:00",
"DateTimeEnd": "2022-02-24 19:00:00",
"ProvNum": 18,
"OpNum": 21
}

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

Re: API Issue - Slots

Post by SLeon » Tue Feb 15, 2022 12:11 pm

Based on the scenario you provided, I would expect the JSON results you included. You mention that Provider 18 is only available 0800-1100 even though they are scheduled 0800-1900? Is this because you have appointments during the 1100-1900 time frame?

I also noticed a date in the url of your API method, but it is not labeled. To filter your results to a single day, use the date parameter like this "/appointments/Slots?date=2022-02-16&ProvNum=18".

If the provider is scheduled and assigned to the operatory in question, then the returned timeslots will not overlap those appointments.

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

Re: API Issue - Slots

Post by PBECKER » Tue Feb 15, 2022 12:23 pm

Hello Leon

Yes we're using the following exact URI https://api.opendental.com/api/v1/appoi ... ProvNum=18

If the provider has various empty "available slots" why are they not being returned? Instead we're receiving the actual "entire day working hours" instead of empty slots that we can use to schedule. Let me know if this make sense.

[
{
"DateTimeStart": "2022-02-16 11:00:00",
"DateTimeEnd": "2022-02-16 19:00:00",
"ProvNum": 18,
"OpNum": 21
}
]

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: API Issue - Slots

Post by jordansparks » Tue Feb 15, 2022 1:12 pm

This is a good point. The thinking was that if you count each possible time as a slot, then you would just get a bunch of slots for the same day, whereas it might be more useful to get one for each day, and then you could pick any time within that range. Unfortunately, you would need to do a little math to not allow scheduling that would overshoot the end. Clearly, you would rather have individual slots, even if you get 10 in a row for one day. So we will add that functionality as an option without damaging the existing functionality in case someone is already using it or might find it useful.
Jordan Sparks, DMD
http://www.opendental.com

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

Re: API Issue - Slots

Post by PBECKER » Tue Feb 15, 2022 1:23 pm

Jordan

Quick question, is there currently any GET method that will return what times are available to be scheduled?

example provider 1 works in op3 and schedule is 8am to 8pm. but they have many open slots that can be filled. example 8am-10am and 1pm-2pm.

If not what is good method to achieve this?

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: API Issue - Slots

Post by jordansparks » Tue Feb 15, 2022 2:00 pm

I think Get Slots is the best right now until we add the new functionality. You could use a little math to generate appropriate individual slots.
Jordan Sparks, DMD
http://www.opendental.com

benlicas
Posts: 1
Joined: Fri Aug 20, 2021 11:34 am

Re: API Issue - Slots

Post by benlicas » Tue Feb 15, 2022 2:34 pm

Hi, sorry to piggy back off of this post, but I feel that it might be related-

I am trying to GET any available appointment slots for any provider without any date parameters. I'm using the GET Slots endpoint.. I am only able receive an empty JSON array. I've also tried with each provider ID using all of the IDs available through the GET Providers endpoint, but I still just get the empty [].. None of the providers have the "IsSecondary" bool as true, so I assume they are all Primary Providers. Does something have to be updated on the client's UI to allow the timeslots to appear, or am I missing something else more obvious?

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

Re: API Issue - Slots

Post by PBECKER » Tue Feb 15, 2022 2:39 pm

Just want to make sure we're following along here.

Right now when we do GET on slots we get the below response which is an entire business day. 8am to 7pm, which is great but how do find out which slot are not yet taken i.e already scheduled.

Should we also be pulling all scheduled appointments and then compare for slots not taken as scheduled?

Thank you so much Jordan

{
"DateTimeStart": "2022-02-24 08:00:00",
"DateTimeEnd": "2022-02-24 19:00:00",
"ProvNum": 18,
"OpNum": 21
}

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

Re: API Issue - Slots

Post by PBECKER » Tue Feb 15, 2022 2:41 pm

benlicas wrote:
Tue Feb 15, 2022 2:34 pm
Hi, sorry to piggy back off of this post, but I feel that it might be related-

I am trying to GET any available appointment slots for any provider without any date parameters. I'm using the GET Slots endpoint.. I am only able receive an empty JSON array. I've also tried with each provider ID using all of the IDs available through the GET Providers endpoint, but I still just get the empty [].. None of the providers have the "IsSecondary" bool as true, so I assume they are all Primary Providers. Does something have to be updated on the client's UI to allow the timeslots to appear, or am I missing something else more obvious?
yes, you need to make sure the "actual operatory" has a schedule meaning from time and to time. 8am to 9pm

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

Re: API Issue - Slots

Post by SLeon » Tue Feb 15, 2022 2:50 pm

Benlicas,

If you do not specify a ProvNum in the appointments GET Slots endpoint, the search is performed with the customer's Default Practice Provider. Similarly, if a date (or date range) is not specified, the search defaults to the next two weeks.

These providers must be scheduled (either to an operatory or not) to be considered available for appointments. If the provider you are specified isn't scheduled, they are not available, and the method will return no results.

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

Re: API Issue - Slots

Post by SLeon » Tue Feb 15, 2022 3:01 pm

PBECKER wrote:
Tue Feb 15, 2022 2:39 pm
...
Right now when we do GET on slots we get the below response which is an entire business day. 8am to 7pm, which is great but how do find out which slot are not yet taken i.e already scheduled.

Should we also be pulling all scheduled appointments and then compare for slots not taken as scheduled?
...
You do not need to pull scheduled appointments and compare to find timeslots, the API already considers those appointments. If an appointment exists, then the search results will show available time on either side of that appointment, but not during the appointment itself.

For example if Provider 18 is scheduled 0800-1900 in Operatory 21, and there is an appointment from 1030-1100, then the results would be as follows:
[
{
"DateTimeStart": "2022-02-15 08:00:00",
"DateTimeEnd": "2022-02-15 10:30:00",
"ProvNum": 18,
"OpNum": 21
},
{
"DateTimeStart": "2022-02-15 11:00:00",
"DateTimeEnd": "2022-02-15 19:00:00",
"ProvNum": 18,
"OpNum": 21
}
]

There is more information in our documentation for this method that may be helpful: https://www.opendental.com/site/apiappointments.html

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

Re: API Issue - Slots

Post by justine » Wed Mar 30, 2022 8:57 am

Appointments GET Slots has been enhanced. Now includes an OpNum as a parameter and will return results for providers or hygienists. This will be available in 22.1.17.

See: https://www.opendental.com/site/apiappointments.html

To get what you're after, you probably want to use the ProvNum, OpNum and date parameters.

Post Reply