-
Notifications
You must be signed in to change notification settings - Fork 152
#13519 - Modify Disease.java to permit the view of INVASIVE_PNEUMOCOC… #13585
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
base: development
Are you sure you want to change the base?
Conversation
…NVASIVE_PNEUMOCOCCAL_INFECTION (IPI).
WalkthroughThe 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Poem
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 unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 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.
📒 Files selected for processing (1)
sormas-api/src/main/java/de/symeda/sormas/api/Disease.java
(1 hunks)
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); |
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.
💡 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.
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.
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