Skip to content

Conversation

Fede923
Copy link

@Fede923 Fede923 commented Aug 29, 2025

Fixes #13519

Modify Disease.java Enum to permit the view of IPI disease, in the window to create contact in the case tab.

Summary by CodeRabbit

  • New Features
    • Follow-up is now enabled by default for Invasive pneumococcal infection cases, with a preset duration of 7 days. New cases will automatically receive scheduled follow-up tasks and timelines without additional setup. Users can adjust follow-up settings as needed in case management. No changes were made to follow-up defaults for other diseases.

Copy link

coderabbitai bot commented Aug 29, 2025

Walkthrough

The INVASIVE_PNEUMOCOCCAL_INFECTION enum entry in Disease.java was modified to enable default follow-up and set its default duration from 0 to 7 days. No public APIs or signatures were changed.

Changes

Cohort / File(s) Summary
Disease enum defaults
sormas-api/src/main/java/de/symeda/sormas/api/Disease.java
Updated INVASIVE_PNEUMOCOCCAL_INFECTION: defaultFollowUpEnabled=false→true; defaultFollowUpDuration=0→7. No other enums or signatures changed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
Ensure IPI appears in “disease of source case” list when adding a contact via case person tab (#13519) Change only affects follow-up defaults; no UI/list population logic modified.
Include all case-listable diseases in selection for disease of source case (#13519) No changes to disease availability, filtering, or UI components.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Adjust default follow-up enabled and duration for INVASIVE_PNEUMOCOCCAL_INFECTION (sormas-api/.../Disease.java) This alters follow-up defaults and does not relate to disease listing or selection logic for source case in the UI as required by #13519.

Poem

A nibble of code, a hop in the breeze,
I tweaked IPI’s cousin among the disease.
Seven days follow, enabled and bright—
But the source-case list? Not fixed tonight.
I’ll thump my paws, then swiftly steer,
To make IPI’s name appear! 🥕🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 076b7c8 and bbeefec.

📒 Files selected for processing (1)
  • sormas-api/src/main/java/de/symeda/sormas/api/Disease.java (1 hunks)

Comment on lines +89 to 92
INVASIVE_PNEUMOCOCCAL_INFECTION(true, true, true, false, true, 7, false, false, false),
INVASIVE_MENINGOCOCCAL_INFECTION(true, true, true, false, true, 7, false, false, false),
OTHER(true, true, true, false, true, 21, false, false, false),
UNDEFINED(true, true, true, false, true, 0, false, false, false);
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Enabling follow-up for IPI likely doesn’t fix the dropdown; address the filter logic instead

This toggles defaultFollowUpEnabled and duration for IPI, but the reported bug is that IPI is missing from “disease of source case” when creating a contact. That list should be driven by “case-surveilled/active diseases”, not by whether follow-up is enabled. This change risks introducing unintended default follow-up for IPI system-wide while not fixing the root cause if the UI is filtering on case-surveillance/active diseases. Please verify where the dropdown is populated and base inclusion on isDefaultCaseSurveillanceEnabled() (and/or current server config), not on follow-up flags. If follow-up enablement for IPI is a product decision, document it separately; otherwise, revert it here.

Proposed revert (until the dropdown logic is fixed):

-	INVASIVE_PNEUMOCOCCAL_INFECTION(true, true, true, false, true, 7, false, false, false),
+	INVASIVE_PNEUMOCOCCAL_INFECTION(true, true, true, false, false, 0, false, false, false),

To locate and verify the actual source of the dropdown filtering, run:

If the dropdown is indeed filtered by follow-up-enabled diseases (which explains why IMI appears and IPI didn’t), adjust that code to include all case-surveilled diseases instead. I can prepare the patch once we confirm the location.


🏁 Script executed:

#!/bin/bash
# Find where the "disease of source case" options are built and whether follow-up flags are used.
rg -nP -C3 '(disease.*source.*case|source.*case.*disease)' --type=java --type=ts --type=tsx --type=html
rg -nP -C3 '\b(isDefaultFollowUpEnabled|getDefaultFollowUpDuration)\b' --type=java
rg -nP -C3 '\b(isDefaultCaseSurveillanceEnabled|isDefaultActive)\b' --type=java
# Common UI modules to scan thoroughly:
fd -t f -e java -a | rg -nP -C2 '(Contact|Case).*Form|.*Controller|.*Facade|.*Dto|.*View'

Length of output: 287300


Revert IPI follow-up default change — fix the dropdown filter instead

This PR enables default follow‑up for INVASIVE_PNEUMOCOCCAL_INFECTION (IPI), but the "disease of source case" list is built from case‑surveillance/active flags, not follow‑up. Changing defaultFollowUpEnabled/defaultFollowUpDuration for IPI will not add it to that dropdown and will introduce an unintended system‑wide default follow‑up. Revert this change and update the UI/filter logic to include case‑surveilled diseases (caseSurveillanceEnabled/defaultCaseSurveillanceEnabled) where appropriate.

Proposed revert (restore previous follow‑up defaults for IPI):

-	INVASIVE_PNEUMOCOCCAL_INFECTION(true, true, true, false, true, 7, false, false, false),
+	INVASIVE_PNEUMOCOCCAL_INFECTION(true, true, true, false, false, 0, false, false, false),

Check and fix these locations:

  • sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java (population of caseSurveillanceDiseases vs followUpEnabledDiseases).
  • sormas-app/app/src/main/java/de/symeda/sormas/app/util/DiseaseConfigurationCache.java (caseBasedDiseases / followUpEnabledDiseases logic).
  • UI: sormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactCreateForm.java and ContactSelectionField.java (where the "disease of source case" dropdown is built) — ensure the dropdown uses case‑surveillance (enabled(configuration.getCaseSurveillanceEnabled(), disease.isDefaultCaseSurveillanceEnabled())) rather than follow‑up flags.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
INVASIVE_PNEUMOCOCCAL_INFECTION(true, true, true, false, true, 7, false, false, false),
INVASIVE_MENINGOCOCCAL_INFECTION(true, true, true, false, true, 7, false, false, false),
OTHER(true, true, true, false, true, 21, false, false, false),
UNDEFINED(true, true, true, false, true, 0, false, false, false);
INVASIVE_PNEUMOCOCCAL_INFECTION(true, true, true, false, false, 0, false, false, false),
INVASIVE_MENINGOCOCCAL_INFECTION(true, true, true, false, true, 7, false, false, false),
OTHER(true, true, true, false, true, 21, false, false, false),
UNDEFINED(true, true, true, false, true, 0, false, false, false);
🤖 Prompt for AI Agents
In sormas-api/src/main/java/de/symeda/sormas/api/Disease.java lines 89-92, the
default follow-up flags for INVASIVE_PNEUMOCOCCAL_INFECTION (IPI) were changed;
revert IPI to its previous followUp defaults (restore original
defaultFollowUpEnabled/defaultFollowUpDuration) so the system-wide follow-up
default is not altered, and then update the UI/filter logic to use
case-surveillance flags rather than follow-up flags: in
sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java
ensure population of caseSurveillanceDiseases uses
configuration.getCaseSurveillanceEnabled()/disease.isDefaultCaseSurveillanceEnabled()
(not followUpEnabled), in
sormas-app/app/src/main/java/de/symeda/sormas/app/util/DiseaseConfigurationCache.java
fix caseBasedDiseases vs followUpEnabledDiseases construction to reflect
caseSurveillanceEnabled/defaultCaseSurveillanceEnabled, and in the UI files
sormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactCreateForm.java and
ContactSelectionField.java change the "disease of source case" dropdown filter
to use enabled(configuration.getCaseSurveillanceEnabled(),
disease.isDefaultCaseSurveillanceEnabled()) instead of follow-up flags so IPI
appears correctly when case-surveillance is enabled.

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.

IPI missing from disease of source case when adding new contact via case person tab
1 participant