#13742 - Fixed missing disease in Sample/PathogenTest form#13746
Conversation
- 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
|
Caution Review failedThe pull request is closed. WalkthroughAdded a Changes
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)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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. Comment |
There was a problem hiding this comment.
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
diseaseinstance field is mutated across multiple methods (lines 125, 134, 139) and read inaddPathogenTestComponent(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
diseaseas 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
📒 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
Fixes #13742
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.