Recurring Appointments in Appointment Module

bahmni
Tags: #<Tag:0x00007efd1ffa8fc0>

(Jinal Sanghavi) #1

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.

More details available in this word doc: https://docs.google.com/document/d/1ocgz6ROKmntc9G_BC07wnBUEwAYWLFmrCJT_kD8XLxM/edit


Appointment Module,Is there any plan for updating the Appointment Module.
Appointment windows for patients
(Angshuman Sarkar) #2
  1. Would there be any data model changes for this?
  2. How would you support ‘cancellation’ of all appointments in the series?

(Jinal Sanghavi) #3
  1. We do not expect any changes to the data model. We are planning to use Appointment number to map the common appointments

  2. 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


(Angshuman Sarkar) #4

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.


(Jinal Sanghavi) #5

Noted, thanks!


(Angshuman Sarkar) #6

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

  1. have a “registerGenerator(AppointmentNumberGenerator)” method - this will allow others to wire up such an implementation from their modules.
  2. Or have a Groovy script based solution like Bahmni provides for Observations.

Do post back with what approach you thought of.


(Prasanna Lakshmi) #7

Hello, The approach for

Recurring appointments:

  • Have a “registerGenerator(AppointmentNumberGenerator)” method - this will allow others to wire up such an implementation from their modules.

  • Modify appointments creation api and add additional params- recurring type, number of occurrences and recurring days (for weekly only)

Same appointment number will be given for all recurring appointments

@pramidat @angshuonline @swathivarkala @binduak


(Angshuman Sarkar) #8

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.

Maybe something like below?

public interface AppointmentNumberGenerator {
   String create(Appointment apptTobeCreated, Optional<String> prevApptNumber);

}


(Sneha Bagri) #9

Hi @angshuonline ,

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.


(Angshuman Sarkar) #10

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)


Bahmni PAT call Nov 28th 2018
(Sneha Bagri) #11

Hi @angshuonline,

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))