Skip to content

#13742 - Fixed missing disease in Sample/PathogenTest form#13746

Merged
raulbob merged 2 commits into
developmentfrom
bugfix-13742-igra_values_not_visible_lab_message
Nov 25, 2025
Merged

#13742 - Fixed missing disease in Sample/PathogenTest form#13746
raulbob merged 2 commits into
developmentfrom
bugfix-13742-igra_values_not_visible_lab_message

Conversation

@raulbob

@raulbob raulbob commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Fixes #13742

Summary by CodeRabbit

  • Refactor
    • Improved internal handling and accessibility of disease information within sample and pathogen-test workflows.
  • Bug Fix
    • Ensured pathogen test forms receive and prefill the correct disease value, falling back to the sample’s disease when needed.

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

- Sample/Pathogen forms were created with empty disease when chained from other forms
- Added disease field to AbstractSampleForm allowing it to be accessed from other places
- Modified `SampleController.addPathogenTestComponent` to use the disease from the sample form
@coderabbitai

coderabbitai Bot commented Nov 25, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Added a Disease field to AbstractSampleForm (constructor + getter) and updated SampleController to resolve and pass a disease into PathogenTestForm, using the provided disease or falling back to the sample component’s disease.

Changes

Cohort / File(s) Change Summary
AbstractSampleForm — disease field
sormas-ui/src/main/java/de/symeda/sormas/ui/samples/AbstractSampleForm.java
Added private Disease disease field, extended constructor to accept Disease disease, and added public Disease getDisease() getter.
SampleController — disease resolution for PathogenTestForm
sormas-ui/src/main/java/de/symeda/sormas/ui/samples/humansample/SampleController.java
Added disease field; when creating PathogenTestForm, compute pathogenTestFormDisease = this.disease != null ? this.disease : sampleComponent.getWrappedComponent().getDisease() and pass it into the PathogenTestForm constructor; updated prefill logic to use resolved disease.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Controller as SampleController
  participant Component as SampleComponent
  participant Form as PathogenTestForm

  Controller->>Controller: determine pathogenTestFormDisease
  Note right of Controller `#E8F5E9`: pathogenTestFormDisease = this.disease ? this.disease : component.disease
  Controller->>Component: getWrappedComponent().getDisease()
  Controller->>Form: new PathogenTestForm(..., pathogenTestFormDisease, ...)
  Form-->Controller: constructed (prefill uses pathogenTestFormDisease)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify constructor call sites for AbstractSampleForm are updated with the new Disease parameter.
  • Confirm SampleController's fallback logic correctly obtains disease from the wrapped component in all call paths.
  • Check PathogenTestForm behavior with the passed disease (visibility/prefill of IGRA-related fields).

Possibly related PRs

Suggested reviewers

  • obinna-h-n
  • KarnaiahPesula

Poem

🐰 A tiny field hops into form and frame,
Disease travels along so IGRA shows its name,
The rabbit nods, the form is clear and bright,
Hooray — the tests now wear the proper light! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.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 accurately and concisely describes the main fix: addressing the missing disease parameter in Sample/PathogenTest form.
Description check ✅ Passed The description is minimal but follows the template by referencing the issue number (#13742). While sparse, it meets the basic template requirement.
Linked Issues check ✅ Passed The code changes directly address issue #13742 by introducing a disease parameter to AbstractSampleForm and passing the correct disease to PathogenTestForm, which resolves the IGRA values visibility issue.
Out of Scope Changes check ✅ Passed All changes are focused and directly related to fixing the missing disease parameter issue; no unrelated modifications were introduced.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9660764 and 748882b.

📒 Files selected for processing (1)
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/humansample/SampleController.java (3 hunks)

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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-ui/src/main/java/de/symeda/sormas/ui/samples/humansample/SampleController.java (1)

102-102: Consider refactoring to eliminate stateful disease field.

The disease instance field is mutated across multiple methods (lines 125, 134, 139) and read in addPathogenTestComponent (line 215). This stateful design could lead to unexpected behavior if the controller instance is shared across requests or used in concurrent scenarios.

Consider refactoring to pass disease as a parameter through the call chain instead of storing it as instance state, which would make the controller stateless and thread-safe.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c8b30e and 9660764.

📒 Files selected for processing (2)
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/AbstractSampleForm.java (2 hunks)
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/humansample/SampleController.java (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
sormas-ui/src/main/java/de/symeda/sormas/ui/samples/AbstractSampleForm.java (2)
sormas-api/src/main/java/de/symeda/sormas/api/utils/fieldvisibility/FieldVisibilityCheckers.java (1)
  • FieldVisibilityCheckers (30-176)
sormas-api/src/main/java/de/symeda/sormas/api/FacadeProvider.java (1)
  • FacadeProvider (128-599)
⏰ 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 (1)
sormas-ui/src/main/java/de/symeda/sormas/ui/samples/AbstractSampleForm.java (1)

114-114: LGTM! Disease field properly added to support pathogen test form context.

The addition of the disease field and getter enables the SampleController to retrieve the disease context when creating pathogen test forms, which aligns with the PR objective to fix missing IGRA values in lab message processing.

Also applies to: 123-123, 464-466

@raulbob raulbob merged commit bd57f94 into development Nov 25, 2025
3 of 6 checks passed
@raulbob raulbob deleted the bugfix-13742-igra_values_not_visible_lab_message branch November 25, 2025 19:10
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.

IGRA test values are not visible in lab message processing test results - Lab Message - Tuberculosis

2 participants