We are planning to build a functionality to enable recurring appointments, just like in Google Calendar. We would appreciate feedback and inputs on the same.
We do not expect any changes to the data model. We are planning to use Appointment number to map the common appointments
Cancellation of appointments will be supported, prompting the user to choose whether to cancel the appointment for only that day or for all recurring appointments, similar to Google Calendar
Awesome. Beware, the current appointment-number generation will need to be worked on. Also, try to keep this generation extensible. meaning, specific implementation should be able to override the default.
You should think ideas over how to bring this extensibility. Lets say you have defined an interface like âAppointmentNumberGeneratorâ, you can think of multiple ways to do this. For Example
have a âregisterGenerator(AppointmentNumberGenerator)â method - this will allow others to wire up such an implementation from their modules.
Or have a Groovy script based solution like Bahmni provides for Observations.
for ⊠"same appoint number will be given ⊠", try to provide an extensible way for that as well.
Generating an appointment number, may have other logics, and we should not assume that the same number will be valid. For example, if someone provides a generator which generates unique numbers but only for the day, then reassigning the same number may not work.
The idea is to make a single API call which would create all the recurring appointments. We will need to have a common appointment number for all recurring appointments so that we can implement future functionalities like edit or cancel of that recurring appointment in entirety. A common appointment number is the logical link to group together all the recurring appointments. So, the extensibility will be provided to generate a custom appointment number, which will be common across all recurring appointments.
Ok. I understand that you are trying to use the âAppointment numberâ to tie all the appointments together.
My point
is that generation of appointment number for a new one or reassign (group appointments) should be left to implementation. Therefore think of an injectable interface instance, which can customize both.
Lets not assume that same âAppointment Numberâ will be applicable.
Question:
the effected appointments (group) will be âvoidedâ? or will you just edit the existing ones?
if you are not voiding and just editing the existing records, please add an entry in the appointment audit table âpatient_appointment_auditâ appropriately.
How have you thought of the web endpoint? for creation of series and also change for a series? For example, are you thinking of a different Web endpoint to accept list of âappointmentsâ? Or will you modify the existing API to accept more information? What would you do for editing effected appointments?
For generation of appointment number, assuming, AppointmentsServiceImpl have a âAppointmentNumberGeneratorâ reference.
AppointmentsService Interface should have a âregister(AppointmentNumberGenerator)â
AppointmentsServiceImpl should probably invoke âappointmentNumberGenerator.create(newappointment)â - e.x from here
(obviously this would be effected how you devise the interactions to the Web endpoint)
As already mentioned we will make the appointment number generation logic pluggable, but it would be same for one give set of recurring appointments.
Answers:
the effected appointments (group) will be âvoidedâ? or will you just edit the existing ones? -->
It would behave in the same manner as the existing appointments with an additional option of cancelling one or all in that group of recurring appointments
if you are not voiding and just editing the existing records, please add an entry in the appointment audit table âpatient_appointment_auditâ appropriately. --> does this happen for appointments today?
How have you thought of the web endpoint? for creation of series and also change for a series? For example, are you thinking of a different Web endpoint to accept list of âappointmentsâ? Or will you modify the existing API to accept more information? What would you do for editing effected appointments? --> We are thinking of reusing the existing endpoint and have few additional params (recurring type, number of occurrences and recurring days (for weekly only))
Adding a new column called âparent_appointment_idâ to âpatient_appointmentâ table.
With this approach, we can get all past occurrences of an appointment, even when its recurrence pattern has been changed. It also becomes easier to cancel a set of appointments.
Appointment Number: A unique appointment number for a specific set of ârecurring appointmentsâ.
With this approach, we are not making the model clear enough for a developer to understand the logic out of the box, as we are overloading the appointment number with a responsibility it is not responsible for.
We would like to suggest the 1st approach, as it is independent and does not club with the logic of Appointment number generation. Giving the liberty to the system to use Appointment Number for just identifying an appointment.
Hi - sorry to jump in late - does Bahmni use the OpenMRS Appt Module in your backend? At AMPATH (and I believe PIH too) weâre interested in the ability to create recurring appointment blocks that essentially match the very nice mockups youâve presented.
I suspect canceling/editing a repeating appt would be similar to typical Calendar App - with ability to cancel or edit only that occurrence, or all future ones
Hi,
Attaching the document describing the way we are planning to functionally implement the edit functionality for recurring appointments.
Two thumb rules are:
Edit this appointment
Edit this and following appointments
Also at any point of time we will not edit past appointments.
can you please specify what would be the API and model change for that
any change in appointment, hopefully you will be writing to the audit logs as well.
caution about editing: change of metadata (like speciality, type etc) - constitute cancellation and re-creation of appointments - are we respecting that.
keep in mind of future tractability as well. e.g. Notification - how would I notify someone that their previous appointment is now rescheduled?
Let me know if you want to discuss over slack or zoom
Sure, if we need to extend it can we do it like below just for the recurrence part of it:
{
"frequency" : "<positiveInt>",// no. of occurances
"period" : "<decimal>", // repetition interval
"daysOfWeek" : ["<code>"], // week days
"endDate" :"", // date for the appointment to end
"type":"" // DAY, MONTH or WEEK
}