In Bahmni we allow the undo of the Check-in action. However, for actions like Missed or complete, we cannot undo this change. We must have a way of going back, especially in cases of manual errors in changing the statuses
A new privilege “Reset Appointment Status” is added for this purpose. This privilege has to be assigned to the users to allow reset the status. If the user doesn’t have this privilege they will not be able to reset the status.
The following must be added to /bahmni_config/openmrs/apps/appointments/app.json
"enableResetAppointmentStatusesFor": [“CheckedIn”, “Missed”, “Cancelled”]
In the list we mention all the statuses from which we want to move back to scheduled
In order to see the Reset button enabled on screen, “Reset Appointment Status” privilege must be assigned to the user
Existing users of Undo check-in must follow these steps:
Add the privilege “Reset Appointment Status” to all roles that you want to assign this ability to reset. If you do not add this to the config, the “Undo-checkin” action will be disabled on screen.
If along with Checkin, you would want to allow other statuses to be reset
Then add the above config and mentioned the respective statuses in the list as shown above.
If this is not added to the config, as long as the user has the “Reset Appointment Status” privilege assigned, they will be able to do “Undo Check-In”.
PR Link → Appointments backend →
Bahmniapps UI →
Documentation Link →
If enableResetAppointmentStatuses variable is not given in config, undo checkin works as it is
we can add any status in the config
Tested the all the PR changes with default-configuration. PR is good to be merged.
Tested all the PR changes with default-setup and the functionality is working as mentioned in the AC’s. Below are the commit details