Skip to content

Feature 14233 mumps samples and pathogen test form changes - #14248

Closed
KarnaiahPesula wants to merge 12 commits into
developmentfrom
feature-14233-mumps-samples-and-pathogen-test-form-changes
Closed

Feature 14233 mumps samples and pathogen test form changes#14248
KarnaiahPesula wants to merge 12 commits into
developmentfrom
feature-14233-mumps-samples-and-pathogen-test-form-changes

Conversation

@KarnaiahPesula

@KarnaiahPesula KarnaiahPesula commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #

Summary by CodeRabbit

  • New Features
    • Added Mumps-specific data fields and logic across case reporting (reporting exclusion), contacts (pregnant/postpartum/trimester), epi data (cluster identifier), symptoms (including salivary swelling, orchitis, pancreatitis, and complication flags), and pathogen testing (genotypes, sequence ID, sero-conversion).
    • Extended clinical manifestations, sample/material and test type applicability for Mumps, plus added respiratory droplet exposure categorization.
    • Expanded cluster type options (including not applicable/unknown).
  • UI Improvements
    • Introduced a Mumps-focused pathogen test section with conditional inputs and improved field visibility/clearing behavior.
    • Updated Mumps styling and adjusted related forms for conditional display.

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

coderabbitai Bot commented Jul 28, 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 Plus

Run ID: ac04ae63-b9f5-4f9b-9402-c038c4834908

📥 Commits

Reviewing files that changed from the base of the PR and between 64c7fc6 and f82ea65.

📒 Files selected for processing (4)
  • sormas-backend/src/main/resources/sql/sormas_schema.sql
  • sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/FourFoldCtCqComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java
💤 Files with no reviewable changes (1)
  • sormas-backend/src/main/resources/sql/sormas_schema.sql
🚧 Files skipped from review as they are similar to previous changes (3)
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/FourFoldCtCqComponent.java

📝 Walkthrough

Walkthrough

Mumps support is added across disease defaults, API DTOs, persistence mappings, database migrations, case/contact/epidemiological forms, laboratory workflows, symptoms, enum metadata, captions, and disease-specific styling.

Changes

Mumps surveillance

Layer / File(s) Summary
Disease and domain metadata
sormas-api/src/main/java/de/symeda/sormas/api/..., sormas-api/src/main/resources/enum.properties
Mumps defaults, cluster types, exposure categories, genotypes, specimen/test applicability, and clinical manifestations are added or updated.
API fields and captions
sormas-api/src/main/java/de/symeda/sormas/api/caze/..., contact/..., sample/..., symptoms/..., i18n/Captions.java, sormas-api/src/main/resources/captions.properties
Case reporting exclusion, pregnancy data, cluster identifiers, pathogen-test fields, Mumps symptoms, and corresponding caption labels are introduced.
Persistence and schema migrations
sormas-backend/src/main/java/de/symeda/sormas/backend/..., sormas-backend/src/main/resources/sql/sormas_schema.sql
New entity fields are mapped in both directions and persisted through schema changes for current and history tables.
Case, contact, and epidemiological UI
sormas-ui/src/main/java/de/symeda/sormas/ui/caze/..., contact/..., epidata/...
Forms add reporting, pregnancy, and cluster fields with disease-, sex-, and state-dependent visibility and clearing.
Mumps laboratory workflow
sormas-ui/src/main/java/de/symeda/sormas/ui/samples/...
Laboratory forms add reference-laboratory behavior, sero-conversion, genotype, and sequence-ID handling based on test type and result.
Mumps symptoms and complication flow
sormas-api/src/main/java/de/symeda/sormas/api/symptoms/..., sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/..., sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/...
Mumps-specific symptoms and complication fields are added across DTOs, entities, mappings, and form visibility logic.
Disease presentation styling
sormas-ui/src/main/java/de/symeda/sormas/ui/utils/..., sormas-ui/src/main/webapp/VAADIN/themes/sormas/views/disease.scss
Mumps disease colors and side-component variant rendering are added, and Shigellosis colors are adjusted.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant FormEventBus
  participant AdditionalTestInfoComponent
  participant MumpsSectionComponent
  participant PathogenTestDto
  User->>FormEventBus: select test type or result
  FormEventBus->>AdditionalTestInfoComponent: publish disease/test event
  FormEventBus->>MumpsSectionComponent: publish test-type/result event
  MumpsSectionComponent->>PathogenTestDto: update genotype and sequenceId bindings
  MumpsSectionComponent->>MumpsSectionComponent: toggle fields and test result
Loading

Possibly related issues

Possibly related PRs

Suggested reviewers: obinna-h-n, raulbob

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only says "Fixes #" and omits the required issue number from the template. Replace it with "Fixes #14233" or the correct issue number and keep the template requirement intact.
Docstring Coverage ⚠️ Warning Docstring coverage is 3.97% 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 clearly identifies the main Mumps-related sample and pathogen test form changes.
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.
✨ 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-14233-mumps-samples-and-pathogen-test-form-changes

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.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java (1)

3159-3165: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

clinicalManifestationText is missing MUMPS, breaking the paired-field contract.

clinicalManifestation now includes MUMPS, but its dependent free-text field clinicalManifestationText (unchanged, still @Diseases({ DENGUE }) only) was not updated to match. Every other paired enable/text field in this file keeps both fields' @Diseases lists in sync (e.g. OTHER_NEUROLOGICAL_SYMPTOMS/OTHER_NEUROLOGICAL_SYMPTOMS_TEXT, OTHER_COMPLICATIONS/OTHER_COMPLICATIONS_TEXT, both extended to MUMPS in this same diff).

Since SymptomsForm shows CLINICAL_MANIFESTATION_TEXT only whenClinicalManifestation == OTHER, and the disease-based FieldVisibilityChecker will hide the text field entirely for Mumps (its @Diseases list doesn't include MUMPS), a Mumps case selecting "Other" for clinical manifestation has no way to enter the free text.

🐛 Proposed fix
 	`@Diseases`({
-		DENGUE })
+		DENGUE,
+		MUMPS })
 	`@Outbreaks`
 	`@HideForCountriesExcept`(countries = {
 		COUNTRY_CODE_LUXEMBOURG })
 	private String clinicalManifestationText;
🤖 Prompt for 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.

In `@sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java`
around lines 3159 - 3165, Update the `@Diseases` annotation on the
clinicalManifestationText field to include MUMPS, matching clinicalManifestation
and preserving the paired-field visibility contract for Mumps cases.
🤖 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/Disease.java`:
- Around line 101-102: Update the MUMPS entry in Disease so its minimum
incubation-period constructor argument matches the stated 21-day requirement,
preserving the existing 25-day maximum and all other values.

In `@sormas-api/src/main/resources/enum.properties`:
- Line 588: Preserve the existing Syphilis caption keys referenced by
CaseDataDto and add the Disease.MUMPS caption alongside them. Update the
affected enum.properties entries without replacing or removing the original
Syphilis keys.

In `@sormas-backend/src/main/resources/sql/sormas_schema.sql`:
- Around line 16976-16980: Align the database schema and JPA mappings for both
fields by choosing the existing text contract: in
sormas-backend/src/main/resources/sql/sormas_schema.sql lines 16976-16980,
change epidata.clusteridentifier and its history column to text; in
sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.java lines
367-374, preserve or update the mapping to text. Apply the same change to
pathogentest.sequenceid and its history column in
sormas-backend/src/main/resources/sql/sormas_schema.sql lines 17005-17013, and
ensure PathogenTest.java lines 869-876 uses the matching text mapping.
- Around line 17006-17013: Resolve the nullable seroconversion contract by
choosing one consistent behavior: either keep seroconversion nullable in the
pathogentest and pathogentest_history schema, or use false as the required
default. If false is the intended default, update the schema migration at
sormas-backend/src/main/resources/sql/sormas_schema.sql lines 17006-17013 to
enforce that default and update PathogenTest at
sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTest.java
lines 878-884 to use a non-null Boolean contract; otherwise remove the NOT NULL
enforcement so nullable DTO values persist safely.

In `@sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java`:
- Line 734: Update the disease-change listener in CaseDataForm to refresh
CaseDataDto.REPORTING_EXCLUDED visibility whenever the selected disease changes.
Mirror CaseCreateForm.handleDiseaseChanged(...) by applying setVisibleClear with
visibility enabled only when selectedDisease equals Disease.MUMPS.

In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/AdditionalTestInfoComponent.java`:
- Around line 67-75: Update wireEvents in AdditionalTestInfoComponent to listen
for DiseaseChangedEvent and refresh the reference laboratory using the current
test type and newly selected disease, keeping currentDisease synchronized. Also
invoke the reference-laboratory update when TestTypeChangedEvent clears the test
type by removing the currentTestType null guard, preserving reset behavior for
null values.

In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/FourFoldCtCqComponent.java`:
- Around line 76-85: Remove fourFoldIncrease and seroConversion from the addRow
call in FourFoldCtCqComponent, since they are already attached directly to this
component; keep the row’s spacer and existing layout structure intact so no
field is assigned to multiple parents.
- Around line 72-74: Initialize the seroConversion checkbox as inapplicable
immediately after creating it in FourFoldCtCqComponent, matching the existing
fourFoldIncrease initialization behavior. Ensure it starts hidden and disabled
until the relevant event enables it, while preserving its styling and component
registration.

In `@sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.java`:
- Around line 1041-1048: Remove NO_COMPLICATIONS, UNKNOWN_COMPLICATIONS, and
OTHER_GENERAL_SYMPTOMS from unconditionalSymptomFieldIds in SymptomsForm. Keep
them only in YES_NO_UNKNOWN_SYMPTOM_FIELD_IDS so the dedicated Yes/No/Unknown
clearing path handles their values instead of the SymptomState loop.

---

Outside diff comments:
In `@sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java`:
- Around line 3159-3165: Update the `@Diseases` annotation on the
clinicalManifestationText field to include MUMPS, matching clinicalManifestation
and preserving the paired-field visibility contract for Mumps cases.
🪄 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 Plus

Run ID: fb5116a3-2035-4fb1-9c83-69702b7fb760

📥 Commits

Reviewing files that changed from the base of the PR and between 0bff92e and 62b0f95.

📒 Files selected for processing (44)
  • sormas-api/src/main/java/de/symeda/sormas/api/Disease.java
  • sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/contact/ContactDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/epidata/ClusterType.java
  • sormas-api/src/main/java/de/symeda/sormas/api/epidata/EpiDataDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureCategory.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSetting.java
  • sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
  • sormas-api/src/main/java/de/symeda/sormas/api/sample/GenoType.java
  • sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestType.java
  • sormas-api/src/main/java/de/symeda/sormas/api/sample/SampleMaterial.java
  • sormas-api/src/main/java/de/symeda/sormas/api/symptoms/ClinicalManifestation.java
  • sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java
  • sormas-api/src/main/resources/captions.properties
  • sormas-api/src/main/resources/enum.properties
  • sormas-backend/src/main/java/de/symeda/sormas/backend/caze/Case.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/contact/Contact.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTest.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTestFacadeEjb.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/Symptoms.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/SymptomsFacadeEjb.java
  • sormas-backend/src/main/resources/sql/sormas_schema.sql
  • sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseCreateForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseSymptomSideViewComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactController.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactDataForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/AdditionalTestInfoComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/FourFoldCtCqComponent.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/DiseaseSectionFactory.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/MumpsSectionComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/utils/CssStyles.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/utils/components/sidecomponent/SideComponentField.java
  • sormas-ui/src/main/webapp/VAADIN/themes/sormas/views/disease.scss

Comment on lines +101 to +102
// As per the requested requirement, setting the follow-up duration 21 and min and max incubation period as 21 and 25.
MUMPS(true, true, true, false, true, 21, false, false, false, true, 12, 25, true, 3, 9),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate Disease.java =="
fd -a 'Disease.java' . | sed 's#^\./##'

echo "== relevant Disease.java lines =="
if [ -f sormas-api/src/main/java/de/symeda/sormas/api/Disease.java ]; then
  nl -ba sormas-api/src/main/java/de/symeda/sormas/api/Disease.java | sed -n '80,115p'
fi

echo "== Disease constructor outline/definition =="
rg -n "public Disease\(|Disease\(|minIncubation|maxIncubation|followUpDuration|MUMPS" sormas-api/src/main/java/de/symeda/sormas/api/Disease.java -C 3

echo "== facade references =="
rg -n "updateDtoNullPropertiesWithDefaultDiseaseEnumProperties|defaultDiseaseEnumProperties|Disease.Enum|Disease\." sormas-api/src/main/java/de/symeda/sormas/api sormas-api/src/main/java -g '*.java' | head -200

Repository: SORMAS-Foundation/SORMAS-Project

Length of output: 451


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== relevant Disease.java lines =="
sed -n '1,140p' sormas-api/src/main/java/de/symeda/sormas/api/Disease.java

echo "== Disease constructor / enum fields references =="
grep -nE "public Disease\(|Disease\(|int .*Incubation|followUpDuration|MUMPS" sormas-api/src/main/java/de/symeda/sormas/api/Disease.java || true

echo "== facade references =="
grep -RIn "updateDtoNullPropertiesWithDefaultDiseaseEnumProperties|defaultDiseaseEnumProperties|Disease\.values\(\)" sormas-api/src/main/java/de/symeda/sormas sormas-api/src/main/java/de/symeda/sormas/api -g '*.java' | head -200

Repository: SORMAS-Foundation/SORMAS-Project

Length of output: 10422


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Disease constructor body and getters =="
sed -n '128,180p;220,240p' sormas-api/src/main/java/de/symeda/sormas/api/Disease.java

echo "== locate DiseaseConfigurationFacadeEjb =="
fd -a 'DiseaseConfigurationFacadeEjb.java' . | sed 's#^\./##'

echo "== relevant facade method =="
for f in $(fd -a 'DiseaseConfigurationFacadeEjb.java' .); do
  echo "FILE: ${f#./}"
  grep -n "updateDtoNullPropertiesWithDefaultDiseaseEnumProperties\|defaultMinIncubationPeriod\|defaultMaxIncubationPeriod\|defaultMinContagiousPeriod\|defaultMaxContagiousPeriod" "$f" -C 5 || true
done

echo "== search for defaultMinIncubationPeriod usages =="
grep -RIn "defaultMinIncubationPeriod|defaultMaxIncubationPeriod" . -g '*.java' | head -250

Repository: SORMAS-Foundation/SORMAS-Project

Length of output: 3459


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== facade method body =="
sed -n '273,420p' sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java

echo "== DiseaseConfigurationDto incubation fields =="
rg -n "class DiseaseConfigurationDto|defaultMinIncubationPeriod|defaultMaxIncubationPeriod|minIncubationPeriod|maxIncubationPeriod" -s sormas-backend/src/main/java sormas-api/src/main/java -g '*.java' | head -200

echo "== precise facade call context =="
rg -n "updateDtoNullPropertiesWithDefaultDiseaseEnumProperties|toDto\(service|getByUuid|save|DiseaseConfiguration" sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java -C 3

Repository: SORMAS-Foundation/SORMAS-Project

Length of output: 18398


Align the Mumps incubation default with the stated requirement.

The Mumps entry comments 21–25 days for minimum/maximum incubation, but the constructor passes 12, 25, which becomes Disease.getDefaultMinIncubationPeriod() and is copied into null incubation properties for the configuration DTO.

Proposed correction if the requirement is authoritative
-	MUMPS(true, true, true, false, true, 21, false, false, false, true, 12, 25, true, 3, 9),
+	MUMPS(true, true, true, false, true, 21, false, false, false, true, 21, 25, true, 3, 9),
📝 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.

Suggested change
// As per the requested requirement, setting the follow-up duration 21 and min and max incubation period as 21 and 25.
MUMPS(true, true, true, false, true, 21, false, false, false, true, 12, 25, true, 3, 9),
// As per the requested requirement, setting the follow-up duration 21 and min and max incubation period as 21 and 25.
MUMPS(true, true, true, false, true, 21, false, false, false, true, 21, 25, true, 3, 9),
🤖 Prompt for 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.

In `@sormas-api/src/main/java/de/symeda/sormas/api/Disease.java` around lines 101
- 102, Update the MUMPS entry in Disease so its minimum incubation-period
constructor argument matches the stated 21-day requirement, preserving the
existing 25-day maximum and all other values.

Comment thread sormas-api/src/main/resources/enum.properties
Comment thread sormas-backend/src/main/resources/sql/sormas_schema.sql
Comment on lines +17006 to +17013
ALTER TABLE pathogentest ADD COLUMN IF NOT EXISTS seroconversion boolean;
UPDATE pathogentest SET seroconversion = false WHERE seroconversion IS NULL;
ALTER TABLE pathogentest ALTER COLUMN seroconversion SET NOT NULL;

ALTER TABLE pathogentest_history ADD COLUMN IF NOT EXISTS sequenceid varchar(255);
ALTER TABLE pathogentest_history ADD COLUMN IF NOT EXISTS seroconversion boolean;
UPDATE pathogentest_history SET seroconversion = false WHERE seroconversion IS NULL;
ALTER TABLE pathogentest_history ALTER COLUMN seroconversion SET NOT NULL;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Resolve the seroConversion nullability contract.

The migration makes this column NOT NULL, but the entity and facade accept a nullable Boolean. A null DTO value—such as from an older client or a non-Mumps workflow—will cause the pathogen-test write to fail. Either keep the column nullable or normalize missing values before persistence.

  • sormas-backend/src/main/resources/sql/sormas_schema.sql#L17006-L17013: align the constraint/default with the intended nullable semantics.
  • sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTest.java#L878-L884: use a non-null entity contract if false is the required default.
📍 Affects 2 files
  • sormas-backend/src/main/resources/sql/sormas_schema.sql#L17006-L17013 (this comment)
  • sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTest.java#L878-L884
🤖 Prompt for 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.

In `@sormas-backend/src/main/resources/sql/sormas_schema.sql` around lines 17006 -
17013, Resolve the nullable seroconversion contract by choosing one consistent
behavior: either keep seroconversion nullable in the pathogentest and
pathogentest_history schema, or use false as the required default. If false is
the intended default, update the schema migration at
sormas-backend/src/main/resources/sql/sormas_schema.sql lines 17006-17013 to
enforce that default and update PathogenTest at
sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTest.java
lines 878-884 to use a non-null Boolean contract; otherwise remove the NOT NULL
enforcement so nullable DTO values persist safely.

Comment thread sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
Comment thread sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.java Outdated

@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

🤖 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-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java`:
- Around line 165-166: Update the condition guarding setVisibleClear in
ShigellosisSectionComponent so it runs whenever !isSerotype, including
antibiotic-susceptibility mode. Ensure both serotypingMethodCBF and
serotypingMethodTF are cleared, hidden, and unbound through the existing
setVisibleClear call.
🪄 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 Plus

Run ID: c126f3aa-de84-4dcd-8181-3b6aafc0aed6

📥 Commits

Reviewing files that changed from the base of the PR and between 62b0f95 and 64c7fc6.

📒 Files selected for processing (10)
  • sormas-api/src/main/java/de/symeda/sormas/api/Disease.java
  • sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java
  • sormas-api/src/main/resources/enum.properties
  • sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTest.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/AdditionalTestInfoComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/FourFoldCtCqComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.java
🚧 Files skipped from review as they are similar to previous changes (6)
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/AdditionalTestInfoComponent.java
  • sormas-api/src/main/resources/enum.properties
  • sormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/FourFoldCtCqComponent.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTest.java
  • sormas-api/src/main/java/de/symeda/sormas/api/Disease.java
  • sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java

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.

Mumps - Samples and Pathogen test form changes

1 participant