Skip to content

O3-5682: Ship Visit Queue Number visit attribute type#113

Open
UjjawalPrabhat wants to merge 3 commits into
openmrs:mainfrom
UjjawalPrabhat:O3-5682-visit-queue-number
Open

O3-5682: Ship Visit Queue Number visit attribute type#113
UjjawalPrabhat wants to merge 3 commits into
openmrs:mainfrom
UjjawalPrabhat:O3-5682-visit-queue-number

Conversation

@UjjawalPrabhat
Copy link
Copy Markdown

@UjjawalPrabhat UjjawalPrabhat commented May 21, 2026

Summary

Adds a Liquibase changeset that inserts the visitQueueNumber VisitAttributeType (UUID c0c579b0-8e59-401d-8a4a-976a0b183519) on module install/upgrade. Idempotent via sqlCheck precondition.

Why?

The queue screen (/spa/home/service-queues/screen) is blank in default installs because the Call→serve flow depends on a "Visit Queue Number" visit attribute that nothing in the module ever creates. The frontend has long had a visitQueueNumberAttributeUuid config knob that was meant to be overridden by each distribution, but in practice the Reference Application and most installs ran on the null default — so generateVisitQueueNumber silently no-ops, visits never get a ticket number, and the assignticket POST silently 200s with nothing stored. Shipping the VAT in the module itself gives every install a working default; distributions that want their own UUID can still override via config.

Related Issue

O3-5682

Comment thread api/src/main/resources/liquibase.xml Outdated
@UjjawalPrabhat UjjawalPrabhat requested a review from jwnasambu May 21, 2026 19:16
Copy link
Copy Markdown

@jwnasambu jwnasambu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@UjjawalPrabhat Kindly I want to believe with the current changes the screen remains blank because it expects a results array but the API returns a raw Map.

  1. Don't we need to add a patientName field to the assignments model?

  2. Kindly for safety use a ConcurrentHashMap for the in memory storage to prevent server crashes during simultaneous polling and updates.

Thanks.

@sonarqubecloud
Copy link
Copy Markdown

@UjjawalPrabhat
Copy link
Copy Markdown
Author

UjjawalPrabhat commented May 22, 2026

Kindly I want to believe with the current changes the screen remains blank because it expects a results array but the API returns a raw Map.

I had some concerns before going on with this one:

  • Breaking API change. Anything consuming GET /queueutil/active-tickets today (frontend, integration tests, third-party clients) gets the raw Map<String, TicketAssignment>. Switching to {results: [...]} breaks that contract silently.
  • Inconsistent with the rest of the controller. The other utility endpoints in Legacy1xRestController (/queue-entry-number, /queueutil/metrics-by-service) also return custom shapes — the {results: [...]} envelope is for BaseDelegatingResource-backed domain resources, not ad-hoc utility endpoints. Changing only this one makes it the odd one out.
  • Doesn't necessarily fixes O3-5682. Screen renders correctly with the current shape once the VAT exists — verified locally. Probably belongs in a separate "make queueutil endpoints OMRS-conventional" ticket if there's appetite for that refactor.

Happy to defer if you feel strongly.

  1. Don't we need to add a patientName field to the assignments model?

it wasn't present before and even if we need it, should it be included in this PR?

  1. Kindly for safety use a ConcurrentHashMap for the in memory storage to prevent server crashes during simultaneous polling and updates.

done.

@UjjawalPrabhat UjjawalPrabhat requested a review from jwnasambu May 22, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants