How to automatically close a visit after x days?

I have been able to set up a scheduler that is executed each day and that is able to end visit as you can see here.

I indicated a visit.autoCloseVisitType in global properties that match visit type I need to automatically close after a certain time, but I don’t know how and where to set up the number of days after a visit can be closed by my scheduler.
Can someone help?

1 Like

Auto closing of visits that take multiple days is not generally recommended. Can you describe your use case a bit more?

Hi @dkayiwa and thank you for your help.

We have only one visit type “External consultation” and a patient comes to the hospital, start with the visit, then they can be hospitalised or not. For the patient in active consultation, we want to close automatically the active consultation after 7 days If the patient is not hospitalized.

In that case you would need a custom module.

…OK, please could you explain ? And can you advise me on a specific module?

You would need to create your own module that implements that logic.