Need some coding help for the calendar

cerber98 wrote on Wednesday, April 25, 2012:

Hello!

I’ve had a few instances where my receptionist would accidentally schedule patients for the wrong time, such as 9pm instead of 9am or 1am instead of 1pm. When she does that, those appointments don’t even show on the schedule, since the grid does not have those late hours.

I would like to add a function to check the date/time of an appointment being scheduled to check to see if the provider is in the office during that time. My question is, is there a function that either does that already or something that’s similar; that is, one that figures out when the provider is in based on calendar events in the database. There is probably something, since the calendar is able to generate the “In Office” blocks on the grid. Alternatively, if there is no such function, I would appreciate any advice on the logic of such a function, because there are a lot of variables to keep track of for each event (repeating events, intervening events, such as lunch, old events, etc).
Any help would be greatly appreciated!

Thanks!