thomasrod
(Thomas RODRIGUEZ)
October 22, 2025, 3:27pm
1
Hello everyone,
using Bahmni as a retrospective data entry tool, we don’t want to use Visits. They need to stay open forever once the user clicked on “Start Visit”, in the registration module.
In the advanced settings, in OpenMRS, the option emrapi.visitExpireHours is set to 0.
However some visits are automatically closed and reopened for some patients :
±---------±--------------------±--------------------±-----------±-------------+
| visit_id | date_started | date_stopped | changed_by | date_changed |
±---------±--------------------±--------------------±-----------±-------------+
| 1358 | 2023-08-20 00:00:00 | 2023-08-20 23:59:59 | NULL | NULL |
| 675 | 2023-08-07 00:00:00 | 2023-08-07 23:59:59 | NULL | NULL |
| 674 | 2023-03-07 13:27:22 | 2023-03-08 00:59:59 | NULL | NULL |
| 673 | 2023-03-07 00:00:00 | 2023-03-07 00:59:59 | NULL | NULL |
| 670 | 2024-07-24 13:07:06 | NULL | NULL | NULL |
±---------±--------------------±--------------------±-----------±-------------+
How can we solve this ? Is there an automation in the system that closes visits ?
Thanks
there is a scheduler task, which runs and closes open visits. Most likely thats whats causing it. Stop and disable it. (start on startup = false)
thomasrod
(Thomas RODRIGUEZ)
October 22, 2025, 5:07pm
3
Hello Angshu,
the task is already stopped and disabled on startup in the Scheduler.
is there any other potential scheduler thats running that may close the visit?
Also can you investigate the visit table and see who was it changed by?
thomasrod
(Thomas RODRIGUEZ)
October 24, 2025, 12:53pm
5
I don’t see any other schedulers that could cause that.
for the changed_by, it’s always NULL and the date_stopped time is always 23:59:59 which makes me think it’s the system doing it.
Assuming you are running on docker, do you have a persistent volume? or is the volume being torn down with the openmrsdb container everytime?
@mohant any thoughts?
akanter
(Andrew Kanter)
October 25, 2025, 5:30pm
7
Can you explain why even if you are retrospectively entering data that you wouldn’t want the entry to be considered a visit? Thanks
thomasrod
(Thomas RODRIGUEZ)
October 28, 2025, 11:42am
8
Hi Andrew,
it’s mostly because of the clinical queues, it’s based on the active visit. But I could change it.
Even in that case, I think you should consider a Visit. You can close a visit either manually, or based on your clinic/hospital case (e.g. most hospitals consider continuation of a visit for a certain number of days if not daily). Bahmni has a scheduler job, which can close the visits beyond a specified number of days.
1 Like