Hello Bahmni / OpenMRS Community,
A long asked feature proposal below. ![]()
Background
The Bahmni Appointments module supports recurring weekly availability per service
(ServiceWeeklyAvailability), allowing facilities to define operating hours on a
day-of-week basis. However, there is currently no way to mark an ad-hoc
date/time-bounded period as unavailable — for example, “Facility is closed
from 03-Aug 11:00 AM to 04-Aug 11:00 AM due to a public holiday” or “Service X with
Provider Y is unavailable on 03-Aug from 7:00 AM to 7:00 PM for training”. Facilities
today rely on manual workarounds such as blocking individual appointments or disabling
services entirely. This proposal introduces a lightweight Unavailability definition
layer to address this gap.
What We Are Building
Admins will be able to define an unavailability block by specifying:
- Location (required) — must carry the
Appointment Locationtag - Start date + Start time and End date + End time (required, stored as separate
DATE/TIMEcolumns, consistent withServiceWeeklyAvailability) - Service (optional — leave blank to apply to all services at the location)
- Provider (optional — leave blank to apply to all providers)
When a service and location are both specified, the service’s location must be the same as or a descendant of the unavailability location, reflecting real-world location hierarchies. The admin UI built on the new bahmni-apps-frontend allows multi-select for service and provider; the REST API accepts a batch array of fully-formed records and persists them in a single transaction.
Data Model
├── location → org.openmrs.Location [NOT NULL]
├── service → AppointmentServiceDefinition [nullable — null = all services]
├── provider → org.openmrs.Provider [nullable — null = all providers]
├── startDate → java.sql.Date [NOT NULL]
├── startTime → java.sql.Time [NOT NULL]
├── endDate → java.sql.Date [NOT NULL]
└── endTime → java.sql.Time [NOT NULL]
Inherits uuid, voided, creator, dateCreated, and related audit fields from
BaseOpenmrsData.
User Interaction
-
Admins can defined Services and create weekly availability definitions.
-
Admins can define unavailabilities against a location or a specific service.
-
Users using the appointment booking, while booking appointments they will see a warning as they see today when there is service unavailability.
We welcome feedback from the community on the model and any extensions that would make this feature more flexible for communities.
cc. @angshuonline @binduak @akhilmalhotra @sumazmrs @rohit.v @mseaton @burke @mogoodrich @dkayiwa
Related talk threads:
- Is it possible to mark holidays in the Appointment module?
- Blocking Public Holidays and Weekends in Calendar
- I’m sure there are more
Thanks.