You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This introduces a new model, `Patient::ConsentStatus`, which stores the
status of a patient-programme pair in the database so it can queried and
rendered quickly. Locally, I'm seeing the consent tab on sessions with
50,000 patients load almost instantly even when filtering on statuses.
The session overview page has a slight improvement, but that will only
load quickly once the other statuses are cached.
I've decided not to implement a state machine as had been previously
discussed, but this could be built on top of this change to enhancement
the functionality. For now, this effectively caches the existing logic
that runs on the fly to the database.
I've also decided not to implement this using Rails callbacks and
instead be explicit where the status is refreshed. This allows us to
optimise for bulk refreshes, as is necessary when adding new programmes
to sessions, running the seeds, or generally updating the status of an
entire session.
This is proposed as an alternative to #3262 for consent statuses, we'd
need to apply the same functionality to triage, programmes, sessions and
next actions. If we're happy with this approach, we can migrate the
statuses one by one to avoid a big bang approach unlike #3262.
0 commit comments