-
Notifications
You must be signed in to change notification settings - Fork 160
Fixed issue in Therapy causing Beijing lineage flag to always be true #13770
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
Fixed issue in Therapy causing Beijing lineage flag to always be true #13770
Conversation
- Test result checking was missing when setting the Beijing lineage flag
WalkthroughFixed a bug in TherapyForm where the Beijing lineage field was always set to true regardless of the pathogen test result. Added null-safety check and explicit condition requiring the strain call status to be BEIJING before enabling the flag. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyForm.java (1)
441-445: Core fix correctly addresses the bug; consider explicit false case.The fix properly checks that
strainCallStatusequalsBEIJINGbefore setting the flag to true, which resolves the issue where the flag was incorrectly set for non-BEIJING results. The null-safety checks are good defensive programming.However, consider adding an else clause to explicitly set the field to false when conditions aren't met. This ensures the field is correctly reset if it was previously true:
if (latestBejingGenotypingTest != null && latestBejingGenotypingTest.getStrainCallStatus() != null && latestBejingGenotypingTest.getStrainCallStatus() == PathogenStrainCallStatus.BEIJING) { beijingLineageField.setValue(true); +} else { + beijingLineageField.setValue(false); }This makes the logic more explicit and prevents potential state-persistence issues if the form lifecycle retains previous values.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyForm.java(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: SORMAS CI
🔇 Additional comments (1)
sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/TherapyForm.java (1)
47-47: LGTM!The import is necessary for the fix and correctly added.
|
SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=13770 |
Fixed #13769
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.