athenahealth / apiserver-athenaFlex

Software developers can use sample code and documentation to use athenahealth's athenaPractice/athenaFlow FHIR API Server.
https://mydata.athenahealth.com/home
17 stars 7 forks source link

Create Appointment not honoring passed SlotId #295

Open schlueterryan opened 4 months ago

schlueterryan commented 4 months ago

When I'm creating a new appointment I pass in the slot reference a long with StartTime,EndTime, and Duration. It looks to be using only the StartTime, EndTime, and Duration and not necessarily using the passed in slot reference.

"slot": [ { "reference": "Slot/68167920" } ], If there are multiple slots for that time range it looks like it just picks one. image

If I then retrieve the created appointment it has a different Slot reference

"slot": [ { "reference": "Slot/68167919" } ],

Is there anything I could be missing or what are the situations where that could happen?

AjeetYadav07 commented 3 months ago

@schlueterryan

To create an appointment in overriding booking of slots, even when multiple slots are present for the same time duration will not respect slot references. Appointment API booking slots based on the time duration, start and end time. if there is an overriding condition occurs, it will book the next slot based on incremental order and availability of slots.

schlueterryan commented 3 months ago

@AjeetYadav07

Hello thanks so much for getting back to me on this. We are also having issues with the cancel so that might also be having an effect here with the one slot actually still being filled.

But as you can see in the image above it does not look like it's taking account duration and scheduling a 10 minute slot into a 20 minute slot.

Should the overbook slot selection take into account duration ie if one slot is 10 and one 20 and the appointment length is 10 should it select the 10 duration.

Also does this take into account appointment types at all or does it ignore that when selecting a slot?

AjeetYadav07 commented 3 months ago

@schlueterryan,

The slot booking is done based on the appointment duration, if the slot duration is more than appointment duration it will consider the whole slot to book. The system currently allocates appointment slots based on the full duration of the appointment. Bookings for a portion of a slot are not supported.

If two overriding slots are present for different slot durations, The system prioritizes slots that are open first (availability) and bookings that come in earlier (incremental orders). In this case, the system focuses on filling any available slot, even if it's not the perfect size for the appointment.

The appointment duration will be determined by the appointment type, not necessarily by what's provided in the booking request. Most appointment types have a standard duration associated with them. This default duration will be used to book the appointments.

e.g. the appointment has type as followup-15 and duration for this type in 15 minutes. once you select the appointment type as followup-15, it does not respect what duration you want to book and slot duration, it will book the appointment for 15 minutes only.

schlueterryan commented 3 months ago

Thanks @AjeetYadav07

For the two overriding slots example if both slots are open and one has a "New Patient' slotType and one has an "Existing Patient" slotType. If the appointmentType is NewPatient will it try to schedule in that slot first or will it still just try to pick the first available slot?

rashmi1977 commented 3 months ago

In the above example as per design it will always pick the first available slot. If there are other examples/clarification, can we start a new issue in github?

schlueterryan commented 3 months ago

@rashmi1977 So if the customer has a new patient slot and an existing patient slot in overbook. It's going to just pick the first slot regardless most likely leading to incorrectly scheduling two new patients or two existing patients appointment types? I understand if it matches both using the priority rules but if it doesn't match that seems wrong. Let me know if I'm misunderstanding or if you still want me to create another ticket.

rashmi1977 commented 3 months ago

@schlueterryan : It is going to pick the first slot regardless of whether it is first or existing patient slot. Hope this clarifies.

schlueterryan commented 3 months ago

@rashmi1977 @AjeetYadav07

Thanks for the follow up. Want to try asking a different way to make sure we are on the same page. So say I have one slot for Physical Appointments and one slot for Sick Visit. If the Physical slot is the 1st slot it will schedule the Sick Visit there no matter what I do? Possibly leading to two Sick visits and no physical. visits How do other clients work with that or is there something we could set up differently to work around this?

If the answer is the same I will close.

rashmi1977 commented 3 weeks ago

If you have one slot for physical Appointment and one slot for Sick visit, system will still pick the first available which on our case in Physical Appointment. Hope this clarifies