Skip to content

Conversation

@roldy
Copy link

@roldy roldy commented Dec 17, 2025

…e their status to alive

Fixes #13454

Summary by CodeRabbit

  • Bug Fixes
    • Corrected outcome change warning to display the accurate present condition based on the case outcome, ensuring users see the correct status information when modifying case outcomes.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

This change fixes a bug in the case outcome confirmation UI where the displayed present condition value was incorrect. A new helper method maps case outcomes to appropriate present conditions—DECEASED maps to DEAD, RECOVERED to ALIVE, and others to UNKNOWN—ensuring the confirmation popup displays the correct status change message.

Changes

Cohort / File(s) Summary
Bug Fix
sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java
Adds a helper method to correctly map CaseOutcome values to PresentCondition for display in the outcome change confirmation UI, replacing the previous logic that showed incorrect status values

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the CaseOutcome-to-PresentCondition mapping logic covers all enum values appropriately
  • Confirm the helper method is applied consistently in the confirmation UI flow
  • Validate that the fix resolves the reported issue where "deceased" was incorrectly displayed as "alive"

Suggested reviewers

  • KarnaiahPesula

Poem

🐰 A mapping was tangled, the status got mixed,
Deceased showed as living—a troublesome fix!
Now outcomes align with their truth on display,
Dead stays dead, alive stays that way! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references issue #13454 and describes the main fix: correcting the popup text that incorrectly displays status as 'alive' when declaring someone deceased.
Description check ✅ Passed The description includes the required issue reference (Fixes #13454) and completes the title by providing context about the fix, though it is minimal.
Linked Issues check ✅ Passed The code changes directly address the linked issue #13454 by introducing a helper that maps CaseOutcome values to appropriate PresentCondition values (DECEASED→DEAD, RECOVERED→ALIVE, others→UNKNOWN) to display correct status in the confirmation popup.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the popup display issue in CaseController by correcting the present condition mapping for case outcome changes, with no unrelated modifications detected.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix-13454-popup-present-condition-label

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af6249b and d37d27b.

📒 Files selected for processing (1)
  • sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.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 (2)
sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseController.java (2)

1585-1585: LGTM! Correct fix for the popup display bug.

The change correctly displays the future present condition derived from the new case outcome, rather than the person's current present condition. This fixes issue #13454 where the popup incorrectly showed "Alive" when changing outcome to "Deceased".


1612-1626: LGTM! Well-designed helper method.

The mapping logic is correct and handles all cases appropriately:

  • DECEASED → DEAD (fixes the reported bug)
  • RECOVERED → ALIVE (correct mapping)
  • NO_OUTCOME/UNKNOWN/null → UNKNOWN (safe defaults)

The method is more general than the current usage, which is good design for potential reuse if similar outcome-to-condition mappings are needed elsewhere.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sormas-vitagroup
Copy link
Contributor

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.

Popup after declaring someone deceased says will change their status to alive

3 participants