Skip to content

Default follow-up is enabled for AFP Influenza subtypes like A & B are inactive by default.#13641

Closed
KarnaiahPesula wants to merge 1 commit into
developmentfrom
bugfix-13640-afp-contacts-should-be-enabled-in-default-configuration
Closed

Default follow-up is enabled for AFP Influenza subtypes like A & B are inactive by default.#13641
KarnaiahPesula wants to merge 1 commit into
developmentfrom
bugfix-13640-afp-contacts-should-be-enabled-in-default-configuration

Conversation

@KarnaiahPesula
Copy link
Copy Markdown
Contributor

@KarnaiahPesula KarnaiahPesula commented Oct 29, 2025

Fixes #

Summary by CodeRabbit

  • Bug Fixes
    • Updated AFP follow-up settings to enable automatic follow-up with a 60-day duration.
    • Adjusted INFLUENZA disease classification flags to properly reflect disease categorization hierarchy.

Influenza subtypes like A & B are inactive by default.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 29, 2025

Walkthrough

This pull request modifies disease enum constants in the Disease.java file, adjusting configuration flags and follow-up durations for AFP, INFLUENZA, INFLUENZA_A, and INFLUENZA_B. Specifically, AFP gains follow-up tracking enabled with a 60-day duration, while INFLUENZA-related constants have their active and primary flags redistributed.

Changes

Cohort / File(s) Summary
Disease enum constant configuration updates
sormas-api/src/main/java/de/symeda/sormas/api/Disease.java
Modified AFP to enable default follow-up with 60-day duration. Adjusted INFLUENZA, INFLUENZA_A, and INFLUENZA_B active/primary flag assignments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that the new flag assignments (active/primary) and follow-up durations align with intended disease surveillance behavior
  • Confirm AFP's 60-day follow-up duration is appropriate for epidemiological protocols
  • Check whether these enum changes propagate correctly to dependent services or configurations downstream

Possibly related PRs

Poem

🐰 A rabbit hops through INFLUENZA's hall,
Redistributing flags left and right,
AFP now follows up with care,
Sixty days of watchful sight,
Disease constants dance anew!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is essentially empty, containing only the repository template comment and an incomplete placeholder "Fixes #" with no issue number specified. According to the description template, the author should specify the related issue number, but this required information is missing. The PR objectives indicate this relates to issue 13640 based on the branch name, but this has not been filled in by the author, resulting in a largely incomplete description that provides no substantive details about the changes. The author must complete the description by filling in the issue number after "Fixes #" (likely issue 13640 based on the branch name) and should consider adding additional context about why these disease configuration changes are needed for better clarity during review.
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 (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Default follow-up is enabled for AFP Influenza subtypes like A & B are inactive by default" directly corresponds to the main changes in the pull request. The changeset modifies the AFP disease constant to enable default follow-up (defaultFollowUpEnabled = true, defaultFollowUpDuration = 60) and changes INFLUENZA_A and INFLUENZA_B to be inactive by default (defaultActive = false). While the phrasing could be clearer and more concise, the title is specific and accurately summarizes both primary modifications rather than being vague or generic.
✨ 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-13640-afp-contacts-should-be-enabled-in-default-configuration

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.

Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
sormas-api/src/main/java/de/symeda/sormas/api/Disease.java (1)

28-28: AFP follow-up enabled (60 days): confirm requirement and add a regression test

Change seems correct given the PR goal. Please confirm 60 days is the intended default and add a small test asserting AFP.isDefaultFollowUpEnabled() and AFP.getDefaultFollowUpDuration() == 60.

I can draft the unit test if helpful.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f89986 and 1a32141.

📒 Files selected for processing (1)
  • sormas-api/src/main/java/de/symeda/sormas/api/Disease.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). (4)
  • GitHub Check: android app test (27)
  • GitHub Check: android app test (26)
  • GitHub Check: android app test (28)
  • GitHub Check: SORMAS CI

Comment on lines +73 to +75
INFLUENZA(true, false, false, false, false, 0, true, false, false),
INFLUENZA_A(false, true, true, false, false, 0, true, false, false),
INFLUENZA_B(false, true, true, false, false, 0, true, false, false),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

INFLUENZA tuples likely wrong: case surveillance disabled for INFLUENZA, A/B marked primary while inactive

Per constructor order (lines 106–115), you set:

  • INFLUENZA: defaultCaseSurveillanceEnabled=false and defaultPrimary=false
  • INFLUENZA_A/B: defaultActive=false but defaultPrimary=true

If the intent is only “INFLUENZA_A and INFLUENZA_B inactive by default” while keeping INFLUENZA as the active, primary disease with case surveillance enabled, adjust as below.

Apply this diff:

-	INFLUENZA(true, false, false, false, false, 0, true, false, false),
-	INFLUENZA_A(false, true, true, false, false, 0, true, false, false),
-	INFLUENZA_B(false, true, true, false, false, 0, true, false, false),
+	INFLUENZA(true, true, true, false, false, 0, true, false, false),
+	INFLUENZA_A(false, false, true, false, false, 0, true, false, false),
+	INFLUENZA_B(false, false, true, false, false, 0, true, false, false),

Optional maintainability tweak: add inline argument comments to avoid boolean mis-ordering in future, e.g.
INFLUENZA(/*active*/true, /*primary*/true, /*case*/true, /*aggregate*/false, /*followUp*/false, /*days*/0, /*variant*/true, /*ext*/false, /*extMulti*/false).

Run this quick grep to see where these flags drive behavior and confirm no invariants are violated:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Call sites of case surveillance flag:"
rg -nP '\.isDefaultCaseSurveillanceEnabled\s*\(' -C3 || true

echo "Call sites of primary flag:"
rg -nP '\.isDefaultPrimary\s*\(' -C3 || true

echo "References to INFLUENZA and subtypes:"
rg -nP 'Disease\.(INFLUENZA|INFLUENZA_A|INFLUENZA_B)\b' -n -C2

Length of output: 44146


🏁 Script executed:

#!/bin/bash
# Extract Disease enum constructor definition
cat sormas-api/src/main/java/de/symeda/sormas/api/Disease.java | grep -A 20 "Disease(boolean"

Length of output: 90


🏁 Script executed:

#!/bin/bash
# Find Disease.java file
fd -name "Disease.java" -type f

Length of output: 230


🏁 Script executed:

#!/bin/bash
# Find Disease.java using find
find . -name "Disease.java" -type f 2>/dev/null | head -5

Length of output: 64


🏁 Script executed:

#!/bin/bash
# Extract constructor from Disease.java around lines 106-115
sed -n '106,115p' ./git/sormas-api/src/main/java/de/symeda/sormas/api/Disease.java

Length of output: 326


🏁 Script executed:

#!/bin/bash
# Search for tests related to Disease defaults or INFLUENZA configuration
find . -path "*/test/*" -name "*.java" -type f 2>/dev/null | xargs grep -l "INFLUENZA\|defaultPrimary\|defaultCaseSurveillanceEnabled" 2>/dev/null | head -10

Length of output: 312


🏁 Script executed:

#!/bin/bash
# Extract DiseasesConfigurationTest.java to check for INFLUENZA assertions
cat ./git/sormas-api/src/test/java/de/symeda/sormas/api/utils/DiseasesConfigurationTest.java

Length of output: 3107


🏁 Script executed:

#!/bin/bash
# Check for any logic combining INFLUENZA_A/B with primary or active checks
rg -n 'INFLUENZA_A|INFLUENZA_B' --type=java -C5 | grep -E '(primary|active|Primary|Active)' | head -20

Length of output: 0


INFLUENZA tuples have inconsistent defaults: A/B inactive but marked primary; INFLUENZA active but case surveillance disabled

Constructor parameter order (lines 106–115) is: defaultActive, defaultPrimary, defaultCaseSurveillanceEnabled, ...

Current state:

  • INFLUENZA(true, false, false, ...): active, not primary, no case surveillance
  • INFLUENZA_A(false, true, true, ...): inactive, primary, case surveillance enabled
  • INFLUENZA_B(false, true, true, ...): inactive, primary, case surveillance enabled

This contradicts typical enum semantics. If INFLUENZA_A and INFLUENZA_B are inactive by design, they should not be marked as primary. If INFLUENZA is the active parent disease, it should be both primary and have case surveillance enabled by default.

Apply this fix:

-	INFLUENZA(true, false, false, false, false, 0, true, false, false),
-	INFLUENZA_A(false, true, true, false, false, 0, true, false, false),
-	INFLUENZA_B(false, true, true, false, false, 0, true, false, false),
+	INFLUENZA(true, true, true, false, false, 0, true, false, false),
+	INFLUENZA_A(false, false, true, false, false, 0, true, false, false),
+	INFLUENZA_B(false, false, true, false, false, 0, true, false, false),

Optional: Add inline comments to prevent future boolean parameter mix-ups:

INFLUENZA(/*active*/true, /*primary*/true, /*case*/true, /*aggregate*/false, /*followUp*/false, /*days*/0, /*variant*/true, /*ext*/false, /*extMulti*/false)

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.

Acute Flaccid Paralysis - Contacts should be enabled in default configuration

1 participant