Appointment duration set per provider schedule not appointment type

I am posting this message to see if any of you have solved this issue already. @adunsulag I am including you because you are overhauling the calendar to use twig.

The practice has several providers and they all have different durations of visit. There are only 4 visit types in the system.

They want to be able to set the appointment duration based on the provider schedule and not by the visit type. The way the system currently now works to achieve what they want from the calendar. They would have to create a lot of different visit types for 15, 30, and 1hr increments. The calendar is set for 15 minute intervals. This is a good starting point so that each duration can be displayed properly.

My thoughts are adding a global to check of whether duration will be set by the provider schedule or visit type. Next, create a class to handle this function of collecting the provider specific duration. We have tested setting the duration in the provider tab of the calendar but it returns an odd number value and not 15, 30, or 90. Also there are some other factors that make using that structure to retrieve a stable value.
I was looking at creating a twig form to manage the data input. Once a schedule has been set for the provider, the provider would show on this form so the duration of their appointments can be set. I was thinking of storing this information in the first “In Office” entry. This entry will never change is the reason that I am selecting this spot. The rest is substituting the destination in the add edit event.

Share your thoughts, insights, and things I may not have considered.


This sounds like Behavioral Health, am I right?

You are correct. It is a group of different specialties if you want to call them that.

So I know that the CPT codes are contigent on the amount of time spent with the patient. I’m wondering if you can use that as leverage to get what you need done.

This seems like a lot of complexity for a solution that can already be replicated in the system. I assume each Provider doesn’t have a different duration of visit, but instead each group of providers have a different duration (i.e. “All Adolescents Therapists have a 90 minute appointment time, all adult therapists have a 60 minute time, etc”)

I would be hesitant to inject this feature into core as it only solves a narrowly defined problem. Instead, we should look at what in the Calendar needs to be modified to allow a Module to handle this task. This keeps the complexity of core at bay, and allows modules to interact with the calendar to address these very specific cases.

1 Like

I know this could be a vary narrow issue. The complexity for us is that each provider in this group are different. There are 5 providers and each one treats a different patient type.

Looking purely at the calendar. It is the duration field that needs to be populated with the specific duration requested by the provider. That is what I have gotten it down too. There is not going to be a lot of changes to the codebase. I created a form and table to store the duration information for each provider. I decided not to change anything about the core of the system. The durations will be populated into the add edit event form when the staff opens it. That is the only thing that needs to change.

Instead of the category populating the duration. The data from the provider duration table will populate that field. Problem solved. I hope. I can certainly turn this into a module but at this time I see no interest for others in the community to do so.

Thanks for your input @robert.down and @growlingflea

The next day:

I created a screen to individually set the providers appointment durations. I made a new table for that information alone as to not interfere with the calendar at all. In the add edit events form, I called the data for that provider and put in it in the duration instead of the default.

If I understand the problem, I have seen it dealt with by creating appointment categories named for the provider and procedure or appointment type, e.g., ‘SmithMHSExam’ or ‘JonesIQTest’.

Each category can have its own duration, as a multiple of the global minimum session length, and the name makes sure the category is used in the right calendar. And it’s much simpler than using a code revision to accomplish the same thing.

Just offering a non-dev’s perspective…

  • HT

I have done it that way in the past but then you end up with a whole bunch of categories trying to solve this delimma.

I created this:

This is outside of the calendar system. It allow them to set the duration of appointments by the provider and not the category. They on have 4 categories for the calendar. They way they can keep the same 4 categories and as providers come on or leave. The categories stay the same. The list is populated by the user being marked on the calendar with a schedule. That ensures that only providers with proper calendar schedule is on the list. The data is stored in its own table. I just had to make a couple of small changes to the add edit event page to get this working. Now all the appointments are set according to the providers desired appointment time.

If there is enough interest in this add on. I will make a repo for it.