Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-749 | To extend laboratory filter panel with search by patient #2104

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

ra247362
Copy link

@ra247362 ra247362 commented Dec 6, 2024

See OH-749

We added a text field in the laboratory section to allow for search by code, as described in the issue. We added error messages when invalid codes were added. The implemented behavior follows the one described in the issue, with the ENTER key being used to search only by code and the SEARCH button used to search by code and date.

Changes were made only in "LabBrowser.java" and the bundled language file "language_en.properties".

} else {
try {
pat = patManager.getPatientById(Integer.parseInt(patid));
exists = pat == null ? false : true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
exists = pat == null ? false : true;
exists = pat != null;

This is much simpler and does the same thing. The variable exists appears to be used only one in line 532. Why not just test the variable pat there? And if there is an exception (catch block at line 527) the variable exists will not be reset and will use the assigned value from line 518 which is true. So, if there is an exception then line 533 will be executed which given that pat is null will most likely cause other errors. It looks like some rethinking of this logic is in order.

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.

5 participants