Skip to content

Shigellosis lab message processing + minor defects.#13988

Merged
KarnaiahPesula merged 5 commits into
developmentfrom
feature-13965-shigellosis-lab-messages
Jun 18, 2026
Merged

Shigellosis lab message processing + minor defects.#13988
KarnaiahPesula merged 5 commits into
developmentfrom
feature-13965-shigellosis-lab-messages

Conversation

@KarnaiahPesula

@KarnaiahPesula KarnaiahPesula commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #

Summary by CodeRabbit

Release Notes

New Features

  • Added sexual contact selection to exposure/ePID data collection, including new enum options and household contact sub-setting.
  • Added pathogen test category support to laboratory test reports.
  • Added susceptibility method fields for additional antibiotics.

Improvements

  • Renamed medication status from “under medication” to “on medication”, including updated UI labeling, visibility rules, and persistence.
  • Expanded Shigellosis support with improved serotyping/option behavior, disease-scoped test-method visibility, and broadened applicability.
  • Improved UI clearing/reset behavior when changing test method/category and form visibility triggers.

@KarnaiahPesula KarnaiahPesula linked an issue Jun 16, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 73e35775-6739-41a6-b404-990a8fd8db5f

📥 Commits

Reviewing files that changed from the base of the PR and between cf3b155 and a0d5ef6.

📒 Files selected for processing (1)
  • sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibilityMapper.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibilityMapper.java

📝 Walkthrough

Walkthrough

This PR implements Shigellosis lab message support (#13965) by renaming underMedication to onMedication across the stack, introducing a SexualContact enum for exposure data, adding PathogenTestCategory to lab test reports, scoping numerous PathogenTestType constants for SHIGELLOSIS, updating pathogen species and serotyping method annotations, extending antibiotic susceptibility method fields, refactoring serotyping UI with a new visibility-clearing helper, and migrating the database schema to version 638.

Changes

Shigellosis Lab Messages

Layer / File(s) Summary
onMedication rename: DTO, entity, mapper, form, i18n, SQL
sormas-api/.../clinicalcourse/HealthConditionsDto.java, sormas-backend/.../clinicalcourse/HealthConditions.java, sormas-backend/.../clinicalcourse/HealthConditionsMapper.java, sormas-ui/.../clinicalcourse/HealthConditionsForm.java, sormas-api/.../i18n/Captions.java, sormas-api/src/main/resources/captions.properties
Renames UNDER_MEDICATION/underMedication to ON_MEDICATION/onMedication across DTO constant and accessors, backend entity field and accessors, bidirectional mapper, UI form field references and visibility rules, and i18n keys/captions. SQL column rename is covered in the migration layer.
SexualContact enum, ExposureDto/Exposure entity, EpiData mapping, and ExposureForm UI
sormas-api/.../exposure/SexualContact.java, sormas-api/.../exposure/ExposureDto.java, sormas-api/.../exposure/ExposureSubSetting.java, sormas-backend/.../exposure/Exposure.java, sormas-backend/.../epidata/EpiDataFacadeEjb.java, sormas-ui/.../exposure/ExposureForm.java, sormas-api/.../i18n/Captions.java, sormas-api/src/main/resources/captions.properties, sormas-api/src/main/resources/enum.properties
Introduces SexualContact enum with localized toString, adds sexualContact field to ExposureDto (scoped to SHIGELLOSIS) and the JPA entity with @Enumerated(STRING) persistence, wires bidirectional EpiDataFacadeEjb mapping in both directions, annotates HOUSEHOLD_CONTACT ExposureSubSetting for SHIGELLOSIS, and adds a ComboBox in ExposureForm with show/hide toggling based on SEXUAL_ACTIVITY sub-setting selection and proper setValue restoration.
PathogenTestCategory on TestReport/TestReportDto and facade
sormas-api/.../externalmessage/labmessage/TestReportDto.java, sormas-backend/.../externalmessage/labmessage/TestReport.java, sormas-backend/.../externalmessage/labmessage/TestReportFacadeEjb.java
Adds pathogenTestCategory field (with @Enumerated(STRING) getter) to TestReport entity and TestReportDto, and wires both conversion directions in TestReportFacadeEjb (toDto and fillOrBuildEntity).
PathogenTestType SHIGELLOSIS disease-scoping annotations
sormas-api/.../sample/PathogenTestType.java
Adds @Diseases(SHIGELLOSIS, hide=true) to ~18 PathogenTestType constants across Molecular Assays, Serological Tests, Antigen Detection, Culture & Isolation, Microscopy & Staining, Antimicrobial Susceptibility, and Functional Immune Assays. Removes SHIGELLOSIS from SLIDE_AGGLUTINATION and extends SNP_TYPING's @RevealsTestTypeText to include SHIGELLOSIS alongside SALMONELLOSIS.
PathogenSpecie test-type broadening and SerotypingMethod annotation updates
sormas-api/.../sample/PathogenSpecie.java, sormas-api/.../sample/SerotypingMethod.java
Broadens Shigella species constants (BOYDII, DYSENTERIAE, FLEXNERI, SONNEI, SHIGELLA_SPP) and OTHER @ApplicableToPathogenTests to include BACTERIAL_CULTURE, SEROGROUPING, and SEROTYPING. Updates SerotypingMethod entries to switch SEROGROUPING to SEROTYPING for MULTIPLEX_PCR, AGGLUTINATION, and WGS_PREDICTION, narrows DISK_DIFFUSION, and removes MIC_DETERMINATION enum constant.
DrugSusceptibilityDto method fields, DrugSusceptibility entity, mapper, and DrugSusceptibilityForm UI
sormas-api/.../therapy/DrugSusceptibilityDto.java, sormas-backend/.../therapy/DrugSusceptibility.java, sormas-backend/.../therapy/DrugSusceptibilityMapper.java, sormas-ui/.../therapy/DrugSusceptibilityForm.java
Adds susceptibility method field support for azithromycin, ceftazidime, cefotaxime, ampicillin, and trimethoprim-sulfamethoxazole by introducing constants, private fields with @Diseases/@ApplicableToPathogenTests annotations (scoped to SHIGELLOSIS), and getter/setter methods in the DTO. Mirrors these as SusceptibilityMethod fields in the backend entity with @Enumerated(STRING) accessors. Wires bidirectional mapping in the facade. Updates DrugSusceptibilityForm to expand HTML layout rows and add method field dropdowns for all affected drugs. Also broadens @Diseases for capreomycin and streptomycin surveillance fields to include SHIGELLOSIS.
ShigellosisSectionComponent serotyping UI refactor, setVisibleClear helper, SideComponentField, TestMethodComponent
sormas-ui/.../samples/diseasesection/AbstractDiseaseSectionComponent.java, sormas-ui/.../samples/diseasesection/ShigellosisSectionComponent.java, sormas-ui/.../utils/components/sidecomponent/SideComponentField.java, sormas-ui/.../samples/components/TestMethodComponent.java
Adds setVisibleClear(AbstractComponent...) helper to AbstractDiseaseSectionComponent for atomic hide-and-clear operations on Vaadin fields. Refactors ShigellosisSectionComponent to introduce serotypeTF, serotypingMethodCBF, serotypingMethodTF fields with binder bindings, resets test result on TestTypeChangedEvent, treats both SEROGROUPING and SEROTYPING as POSITIVE, and rewrites updateFieldVisibility using computed boolean flags with setVisibleClear calls. Expands SideComponentField SHIGELLOSIS variant map to include SEROTYPING and adds null guards. Adds null-category guard in TestMethodComponent to clear test-type field when category becomes null.
SQL migration version 638, PersonEditForm simplification, and caption updates
sormas-backend/src/main/resources/sql/sormas_schema.sql, sormas-ui/.../person/PersonEditForm.java, sormas-api/src/main/resources/captions.properties
Schema version 638 adds pathogentestcategory and sexualcontact columns to testreport/exposures (and history tables), adds method columns to drugsusceptibility/drugsusceptibility_history, and conditionally renames undermedication to onmedication in healthconditions/healthconditions_history. Simplifies PersonEditForm by removing ENTRY_DATE_DISEASE whitelist and Luxembourg/foreign-status conditional visibility logic. Updates several Symptoms.* caption values with revised wording and spacing.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • #13965: The main issue tracking Shigellosis lab message processing; the database schema migration is explicitly tagged with comment #13965 - Shigellosis Lab messages.

Possibly related PRs

Suggested reviewers

  • obinna-h-n
  • raulbob

Poem

🐇 Hop hop, the rabbit checks the changes,
onMedication now rearranges,
Shigella types scoped with care,
SexualContact blooms so fair,
Serotyping flows with grace,
Schema 638 sets the place! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is incomplete; it contains only the template with no actual details about the changes, objectives, or issue reference despite the template requesting issue number specification. Fill in the issue reference (e.g., 'Fixes #13965') and provide a brief description of the shigellosis lab message processing feature and the minor defects being addressed.
Docstring Coverage ⚠️ Warning Docstring coverage is 4.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Shigellosis lab message processing + minor defects' clearly identifies the main change: shigellosis lab message processing feature, with acknowledgment of related minor fixes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature-13965-shigellosis-lab-messages

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: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java`:
- Around line 470-472: The sexualContact field in the ExposureDto class is
missing the `@SensitiveData` annotation, which is required for proper
sensitive-data access control. Add the `@SensitiveData` annotation above the
`@Diseases` annotation on the sexualContact field to ensure it is properly
protected as sensitive data.

In `@sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java`:
- Line 206: The enum constant SHISPP in PathogenSpecie.java was renamed from
SHIGELLA_SPP, but this breaking change requires three synchronization updates to
prevent deserialization failures and UI display issues. Update all 46 language
enum.properties files (enum.properties, enum_en-KE.properties, etc.) to replace
Pathogen.SHIGELLA_SPP with Pathogen.SHISPP. Update sormas_schema.sql to replace
the seed value 'SHIGELLA_SPP' with 'SHISPP' in the customizableenumvalue table
insert statement. Create a database migration script to update any existing
persisted records in the customizableenumvalue table that contain the old value
'SHIGELLA_SPP' to 'SHISPP' to ensure existing data can be properly deserialized
when JPA attempts to map them to the renamed enum constant.

In `@sormas-backend/src/main/resources/sql/sormas_schema.sql`:
- Around line 16305-16312: The migration logic contains an impossible condition
where both the EXISTS and NOT EXISTS checks look for the same column
'undermedication', making the condition always false and preventing the
migration from running. Fix this by changing the NOT EXISTS clause to check for
'onmedication' instead of 'undermedication', so the condition properly verifies
that the old column exists and the new column does not. Additionally, remove the
duplicate IF block that appears immediately after (the second identical IF
statement in each pair), since only one migration check is needed for each
column rename operation. Apply these fixes to both occurrences of this pattern
in the file.

In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java`:
- Around line 149-171: The updateFieldVisibility method clears field values in
the setVisibleClear calls before subsequently making those same fields visible
again, causing data loss. The negative condition guards (if (!isSerogrouping),
if (!isSerotype), if (!showDrugSusceptibilityForm)) cause overlapping field
clearances. Restructure the logic so that setVisibleClear only executes when the
field will definitely remain hidden, by either: (1) inverting the guard
conditions to check that the field won't be shown in the subsequent visibility
assignments, or (2) reorganizing to clear fields only when they should remain
invisible across all visibility-setting paths. Ensure specie is only cleared
when both isSerogrouping and isSerotype are false, serotypeTF is only cleared
when isSerotype is false, and serotypingMethodCBF is only cleared when both
isSerotype and showDrugSusceptibilityForm are false.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7e9bb40f-d88d-4f01-9bf5-8d3137dd0940

📥 Commits

Reviewing files that changed from the base of the PR and between 443a003 and 3239a4c.

📒 Files selected for processing (25)
  • sormas-api/src/main/java/de/symeda/sormas/api/clinicalcourse/HealthConditionsDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSubSetting.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/SexualContact.java
  • sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/labmessage/TestReportDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
  • sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java
  • sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestType.java
  • sormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.java
  • sormas-api/src/main/resources/captions.properties
  • sormas-api/src/main/resources/enum.properties
  • sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditions.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditionsMapper.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReport.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjb.java
  • sormas-backend/src/main/resources/sql/sormas_schema.sql
  • sormas-ui/src/main/java/de/symeda/sormas/ui/clinicalcourse/HealthConditionsForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposureForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/person/PersonEditForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/TestMethodComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/AbstractDiseaseSectionComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/utils/components/sidecomponent/SideComponentField.java

Comment thread sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java Outdated
Comment thread sormas-backend/src/main/resources/sql/sormas_schema.sql
Some minor issues fixed.
@KarnaiahPesula KarnaiahPesula changed the title Shigellosis lab message processing + some minor defects. Shigellosis lab message processing + minor defects. Jun 16, 2026

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibilityMapper.java`:
- Around line 133-137: The hasData method in DrugSusceptibilityMapper is missing
validation for the five newly introduced *Method fields that were added to the
mapping logic. Update the hasData method to include checks for
AzithromycinMethod, AmpicillinMethod, CeftazidimeMethod, CefotaximeMethod, and
TrimethoprimSulfamethoxazoleMethod so that records containing only these method
values are not incorrectly treated as empty data. Apply the same fix to all
locations where hasData performs similar validation checks for
DrugSusceptibility fields.

In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java`:
- Around line 96-97: Remove the empty string field-location placeholders from
all fluidRowLocsCss method calls in the DrugSusceptibilityForm class. These
empty strings ("") are being passed as arguments for zone-diameter and
surveillance fields, but they generate invalid location='' HTML attributes that
break Vaadin template binding. For each affected fluidRowLocsCss call, identify
the empty strings and either omit those parameters entirely from the argument
list or restructure the call to pass only the fields that have actual location
values, ensuring no empty strings are passed as location placeholders.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 421de8d0-a1bf-4321-8918-cb6f91f286fd

📥 Commits

Reviewing files that changed from the base of the PR and between 3239a4c and 31c75d0.

📒 Files selected for processing (10)
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java
  • sormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.java
  • sormas-api/src/main/java/de/symeda/sormas/api/therapy/DrugSusceptibilityDto.java
  • sormas-api/src/main/resources/enum.properties
  • sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibility.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibilityMapper.java
  • sormas-backend/src/main/resources/sql/sormas_schema.sql
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java

Comment thread sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java Outdated
@KarnaiahPesula KarnaiahPesula requested review from raulbob and roldy June 17, 2026 07:56
# Conflicts:
#	sormas-backend/src/main/resources/sql/sormas_schema.sql
@KarnaiahPesula KarnaiahPesula merged commit 3d1a2e3 into development Jun 18, 2026
7 checks passed
@KarnaiahPesula KarnaiahPesula deleted the feature-13965-shigellosis-lab-messages branch June 18, 2026 08:35
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.

Shigellosis - lab messages

2 participants