Skip to content

#13456 - Fixes Inconsistent / contradictory data entry is possible in…#13781

Merged
roldy merged 2 commits intodevelopmentfrom
bugfix-13456-contradictory-data-entry
Jan 28, 2026
Merged

#13456 - Fixes Inconsistent / contradictory data entry is possible in…#13781
roldy merged 2 commits intodevelopmentfrom
bugfix-13456-contradictory-data-entry

Conversation

@roldy
Copy link
Copy Markdown
Contributor

@roldy roldy commented Dec 18, 2025

… the medical history of a case

Fixes #13456

Summary by CodeRabbit

  • New Features
    • PREGNANT and POSTPARTUM cannot both be selected; CURRENT_SMOKER and FORMER_SMOKER are mutually exclusive.
    • Selecting ASPLENIA automatically sets related immunodeficiency field when applicable.
    • A dedicated, read-only details field is shown for vaccination status when "Other" is selected.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 18, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds a reusable mutual-exclusion helper to the base form and applies it to prevent contradictory medical-history selections (Pregnant/Postpartum, Current/Former smoker); also auto-checks Immunodeficiency when Asplenia is selected and binds a vaccination-status details field.

Changes

Cohort / File(s) Summary
Base form utility
sormas-ui/src/main/java/de/symeda/sormas/ui/utils/AbstractEditForm.java
Adds setupMutuallyExclusiveFields(NullableOptionGroup, NullableOptionGroup) to wire bidirectional mutual exclusivity between two nullable option groups; adds imports for Arrays, HashSet, and Set.
Case form changes
sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
Captures PREGNANT and POSTPARTUM fields and calls setupMutuallyExclusiveFields if both present; adds a TextArea bound to VACCINATION_STATUS_DETAILS shown when VaccinationStatus is OTHER.
Health conditions form
sormas-ui/src/main/java/de/symeda/sormas/ui/clinicalcourse/HealthConditionsForm.java
Captures CURRENT_SMOKER and FORMER_SMOKER and wires mutual exclusivity; adds listener so selecting ASPLENIA auto-sets IMMUNODEFICIENCY_OTHER_THAN_HIV to YES when applicable.
Build/manifest
pom.xml
Minor lines changed (+9/-4) — no exported/public API declarations altered.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • obinna-h-n
  • KarnaiahPesula
  • raulbob

Poem

🐰
Hop, hop—fields now politely part,
Pregnant and postpartum kept apart.
Asplenia nudges immunity’s box,
Smokers split like two tidy flocks.
Data now dances—order from the heart.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.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 references issue #13456 and clearly summarizes the main change: fixing inconsistent/contradictory data entry in medical history.
Description check ✅ Passed The description follows the repository template correctly, specifying 'Fixes #13456' to link to the related issue as required.
Linked Issues check ✅ Passed The changes fully address all objectives: mutual exclusivity for Current/Former smoker [#13456], Pregnancy/Postpartum [#13456], and auto-linking Asplenia to Immunodeficiency [#13456].
Out of Scope Changes check ✅ Passed All changes are directly related to issue #13456: adding mutual exclusivity logic and auto-linking fields as specified in the requirements.
✨ Finishing touches
  • 📝 Generate docstrings

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
Copy Markdown
Contributor

@roldy roldy merged commit 8308c08 into development Jan 28, 2026
4 of 6 checks passed
@roldy roldy deleted the bugfix-13456-contradictory-data-entry branch January 28, 2026 09:10
@sormas-vitagroup
Copy link
Copy Markdown
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.

Inconsistent or contradictory data entry is possible in the medical history of a case

3 participants