O3-5692: Build a dedicated REST endpoint for queue entries#114
Open
UjjawalPrabhat wants to merge 3 commits into
Open
O3-5692: Build a dedicated REST endpoint for queue entries#114UjjawalPrabhat wants to merge 3 commits into
UjjawalPrabhat wants to merge 3 commits into
Conversation
jwnasambu
reviewed
May 25, 2026
jwnasambu
left a comment
There was a problem hiding this comment.
@UjjawalPrabhat this is a good progress . Kindly make the following updates here:
- Update SUMMARY_REPRESENTATION to include patientIdentifier.
- Add logic to rename patientIdentifier to identifier and flatten the patient object.
jwnasambu
reviewed
May 25, 2026
jwnasambu
reviewed
May 25, 2026
jwnasambu
reviewed
May 25, 2026
jwnasambu
left a comment
There was a problem hiding this comment.
Also create this file to include test cases for
getQueueEntrySummaries_shouldReturnPaginatedSummariesWithIdentifier,
shouldHandleTotalCountRequest, and shouldReturnEmptyListWhenNoResults. I know the PR originally focuses on DAO tests but without Controller tests there is
no verification that the final JSON keys like identifier or visitUuid are correctly
transformed for the frontend.
jwnasambu
reviewed
May 25, 2026
jwnasambu
reviewed
May 25, 2026
jwnasambu
reviewed
May 25, 2026
|
Contributor
|
Hi @UjjawalPrabhat, some questions I have:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
The Service Queues table currently loads via
QueueEntryResourcewith a deep customv=representation that pulls every encounter, obs, and diagnosis on each patient's visit. On a 50-entry queue this triggers hundreds of cascading Hibernate loads; ~95% of the bytes are never read by the table.Adds
GET /rest/v1/queue-entry-summary— flat, server-paginated, withpreviousQueueEntryUuidresolved via a single batch IN-clause query instead of the per-row N+1 path throughgetPreviousQueueEntry.Mirrors the three-layer batch pattern from openmrs-module-emrapi PR #250.
Response shape
Before (
/queue-entry?v=custom:(…)as requested by the frontend):{ "uuid": "...", "display": "...", "queue": { "uuid": "...", "display": "...", "name": "...", "description": "...", "service": {...}, "location": {...} }, "status": { "uuid": "...", "display": "...", "name": {...}, "datatype": {...}, "conceptClass": {...}, "set": false, "version": "...", "retired": false, "names": [...], "descriptions": [...], "mappings": [...], "answers": [...], "setMembers": [...], ... }, "priority": { /* same deep Concept shape */ }, "patient": { "uuid": "...", "display": "...", "identifiers": [ { "uuid": "...", "identifier": "...", "identifierType": {...}, "location": {...}, "preferred": true, ... } ], "person": { /* full person graph */ } }, "visit": { "uuid": "...", "startDatetime": "...", "encounters": [ { "uuid": "...", "display": "...", "encounterDatetime": "...", "encounterType": {...}, "diagnoses": [ { /* full diagnosis */ } ], "obs": [ { /* full obs, recursively */ } ], "encounterProviders": [ { /* full provider */ } ], "voided": false } /* …every encounter on the visit, each with its full obs/diagnoses/providers graph */ ], "attributes": [ { /* full visit attributes */ } ] }, "priorityComment": "...", "sortWeight": 0.0, "startedAt": "...", "endedAt": null, "locationWaitingFor": {...}, "providerWaitingFor": {...}, "queueComingFrom": {...}, "previousQueueEntry": { /* full QueueEntry, recursively */ } }After (
/queue-entry-summary):{ "uuid": "...", "patient": { "uuid": "...", "display": "100GEJ - John Doe" }, "queue": { "uuid": "...", "display": "Triage" }, "status": { "uuid": "...", "display": "Waiting" }, "priority": { "uuid": "...", "display": "Not urgent" }, "priorityComment": "...", "startedAt": "2026-05-25T09:00:00.000+0000", "visitUuid": "...", "visitStartDatetime": "2026-05-25T08:55:00.000+0000", "previousQueueEntryUuid": null }Relate Issue
O3-5692