We are planning to have a widget on openmrs-coreapps to show upcoming appointment for a patient on different dashboards based on configuration ( link to talk) , and could not find and api in openmrs-module-appointments that gives us the information.
Currently the search endpoint defined within AppointmentsController accepts only start-date and an end-date and both the fields are mandatory.
We are thinking of modifying this end point to
Add an optional field to search by patient uuid as well
Making end-date optional to fetch all future appointments.
We are currently working on recurring appointment, if we do not give any end date it will end up giving a lot of appointments. If we do not want end date to be mandate can we add one more parameter to indicate the noOfAppointments we want to fetch. If no value is provided we can fetch everything??
Yes, we can make end date non mandatory. Also we would need some way to limit the no. of appointments we want so if we can include no of search results it will be good.
If both are passed then we will use both in the query,
Therefore if limit is N and the no of appointments within the date range is greater than N then we will be returning the first N appointments in order of start date.