Hey @veronica, excited about this. I’ve been contributing to the O3 Service Queue module (openmrs-module-queue) mostly and there’s a specific gap where AI could make a real clinical impact that I don’t see anyone working on yet.
The idea: An AI-powered SortWeightGenerator for intelligent queue prioritization
Right now, the queue module has a pluggable SortWeightGenerator interface that determines the ordering of patients in a queue. The two built-in implementations are essentially dumb - ExistingValueSortWeightGenerator just preserves whatever the frontend sends (so you get pure FIFO), and BasicPrioritySortWeightGenerator sorts based on a static concept set ordering (e.g., Emergency > Urgent > Normal). Neither of them actually looks at the patient.
The extension point is already there - the interface takes a QueueEntry object, which gives you access to the Patient, the Visit, the Queue, and the priority concept. From the patient, you can pull vitals (via obs), active conditions, age, visit history. The architecture is explicitly designed for custom implementations (the README even says “Modules that require this module can define and configure their own custom algorithms”).
What I’d want to build for the hackathon:
A SmartSortWeightGenerator - a custom implementation that, when a patient enters a queue, pulls their recent vitals and triage data, runs it through a lightweight model (something like a fine-tuned clinical risk scoring model or even a rules-engine backed by an LLM for edge cases), and computes a clinically-informed sort weight. High-risk patients get bumped up automatically without a nurse having to manually change the priority dropdown.
This would plug in without any changes to the core queue module - just set the queue.sortWeightGenerator global property to the new bean name.
Where it complements existing work:
The chartsearchai module already solves the “query patient records” problem using RAG + MedGemma. This proposal is different - it’s not about asking questions about a chart, it’s about using patient data to make a real-time operational decision (queue ordering) at the point of care. The retrieval layer in chartsearchai (the all-MiniLM-L6-v2 embeddings, the obs indexing) could potentially be reused to fetch relevant clinical context for the scoring model, so there’s a natural synergy.
A few questions for the community:
-
Has anyone attempted runtime clinical risk scoring within the O3 workflow before? I want to make sure I’m not duplicating work from an implementation partner.
-
For the hackathon scope - would a simpler “rules-based” approach (e.g., if systolic BP > 180 and age > 60, bump sort weight by X) be more valuable as an MVP than a full ML model, given the need for clinical validation?
-
Data privacy: the SortWeightGenerator runs server-side and only needs access to data already in the OpenMRS DB (obs, conditions), so there’s no external API call needed. But would the community be comfortable with a model making queue ordering decisions, even as a “suggestion” layer?
Happy to scope this further if others are interested in collaborating. I think the queue module’s extensibility makes this one of the lowest-friction places to introduce AI into an actual clinical workflow.