Thanks @dkayiwa. I would personally go with option 1, spawn a background thread to recompute...
I think we shall need to;
- Enable asynchronous processing in the 2.x patient flags module
- Modify the existing a service class that handles flag evaluation by adding an asynchronous function that accepts a patient or group of patient as parameters and paste Flag revaluation logic there.
- In the controllers, we shall just call that asynchronous function and pass the desired patient or group of patients.
cc @ibacher