Skip to content

O3-5696: Fix Wrong ORM mapping, duplicate DB lookup & null crash#115

Open
UjjawalPrabhat wants to merge 1 commit into
openmrs:mainfrom
UjjawalPrabhat:O3-5696
Open

O3-5696: Fix Wrong ORM mapping, duplicate DB lookup & null crash#115
UjjawalPrabhat wants to merge 1 commit into
openmrs:mainfrom
UjjawalPrabhat:O3-5696

Conversation

@UjjawalPrabhat
Copy link
Copy Markdown

@UjjawalPrabhat UjjawalPrabhat commented Jun 3, 2026

Three independent backend defects in the queue module:

  • QueueEntry.queueComingFrom used @OneToOne, implying each source queue belongs to a single entry. Many entries can transition from the same queue, so switch to @ManyToOne (matching queue/patient/visit/etc.).

  • AbstractBaseQueueDaoImpl.get(uuid) executed its criteria query twice, discarding the first result. Drop the redundant call so each UUID lookup runs exactly one query (affects all queue DAOs via the base).

  • QueueEntryResource.getDisplay null-checked personName but dereferenced a possibly-null patient first, throwing NPE on bad data rows and crashing the whole REST page. Null-check the patient and fall back to the queue entry UUID. Added a unit test for the null-patient case.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

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.

1 participant