As with patient lists (cohorts) the initial intention is to do this work in a module and eventually migrate it into core.
That’s the intention. It might be nice if we could indicate that someone was waiting on a particular service rather than just a room (this is why my diagram has a concept_waiting_for
field), but it seems as if locations are often used as a proxy for this and it simplifies the implementation a bit…
Thanks @corneliouzbett! Those are some great questions!
My initial hope is that we can initially (at least) simplify queues to just priority queues, where order is determined by patient priority and then wait time. There’s some scope for adding alternative queueing strategies at some point, but neither UgandaEMR (from what I understood) or the 3.x designs seem to have a need for a different strategy just yet. This nice property of these priority queues is that as long as the priority for all patients is the same, they are effectively FIFO queues.
My hope was that by storing priority in the concept dictionary, we can (to a certain extent) leave this decision to implementations. That said, it’s probably good to come up with a sort of baseline OpenMRS reference vocabulary for priorities (unless @akanter this is something that belongs in CIEL?).
There is a difficulty around this, which is just that while sort_weight
is a property of concept answers and concept set members, it’s not a property of concepts per se. So, we’d either need to extend the concept model by introducing, e.g., ConceptPriority or a more generic ConceptSortable or maybe adding a ConceptAttribute to capture this.
This certainly doesn’t involve messing with the concept model! My preference is to have each priority define its order rather than adding this to the queue model, mostly because this ensures that the user can tell at a glance why the queue is ordered the way it is (otherwise, you might end up in a state where two patients are marked “urgent” but one comes in the queue before the other despite arriving later because the sort_weight
property was set to 3 instead of 4).