O3-2635: find all queue entries for a given patient #55
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.
@mseaton , last week while working on the MCOE Check-in form, we have noticed that the queue module was not able to detect and prevent creating duplicate entries for past visits. Here is where we documented this problem:
PIH/openmrs-module-pihcore#481
We could add more checks in the AddPatientToQueueAction post submit action to prevent this use case, but I also took a closer look at the queue module code, and I think the following code is incorrect:
https://github.com/openmrs/openmrs-module-queue/blob/main/api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java#L89
In this PR, I just wrote a unit test to show how the code we use to check for duplicates misses entries. I think we just need to add in the code above searchCriteria.setIsEnded(null); ? I am surprised that by default it does not include all queue entries.
Do you have any other suggestions on how to fix this problem? Thanks!