Feature 14233 mumps samples and pathogen test form changes - #14248
Feature 14233 mumps samples and pathogen test form changes#14248KarnaiahPesula wants to merge 12 commits into
Conversation
…-mumps-exposure-for-changes
…ature-14232-mumps-exposure-for-changes
…ature-14232-mumps-exposure-for-changes
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughMumps 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. ChangesMumps surveillance
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
Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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: 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
clinicalManifestationTextis missingMUMPS, breaking the paired-field contract.
clinicalManifestationnow includesMUMPS, but its dependent free-text fieldclinicalManifestationText(unchanged, still@Diseases({ DENGUE })only) was not updated to match. Every other paired enable/text field in this file keeps both fields'@Diseaseslists in sync (e.g.OTHER_NEUROLOGICAL_SYMPTOMS/OTHER_NEUROLOGICAL_SYMPTOMS_TEXT,OTHER_COMPLICATIONS/OTHER_COMPLICATIONS_TEXT, both extended toMUMPSin this same diff).Since
SymptomsFormshowsCLINICAL_MANIFESTATION_TEXTonlywhenClinicalManifestation == OTHER, and the disease-basedFieldVisibilityCheckerwill hide the text field entirely for Mumps (its@Diseaseslist doesn't includeMUMPS), 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
📒 Files selected for processing (44)
sormas-api/src/main/java/de/symeda/sormas/api/Disease.javasormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.javasormas-api/src/main/java/de/symeda/sormas/api/contact/ContactDto.javasormas-api/src/main/java/de/symeda/sormas/api/epidata/ClusterType.javasormas-api/src/main/java/de/symeda/sormas/api/epidata/EpiDataDto.javasormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureCategory.javasormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSetting.javasormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.javasormas-api/src/main/java/de/symeda/sormas/api/sample/GenoType.javasormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestDto.javasormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenTestType.javasormas-api/src/main/java/de/symeda/sormas/api/sample/SampleMaterial.javasormas-api/src/main/java/de/symeda/sormas/api/symptoms/ClinicalManifestation.javasormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.javasormas-api/src/main/resources/captions.propertiessormas-api/src/main/resources/enum.propertiessormas-backend/src/main/java/de/symeda/sormas/backend/caze/Case.javasormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.javasormas-backend/src/main/java/de/symeda/sormas/backend/contact/Contact.javasormas-backend/src/main/java/de/symeda/sormas/backend/contact/ContactFacadeEjb.javasormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.javasormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.javasormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.javasormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTest.javasormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTestFacadeEjb.javasormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/Symptoms.javasormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/SymptomsFacadeEjb.javasormas-backend/src/main/resources/sql/sormas_schema.sqlsormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseCreateForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseSymptomSideViewComponent.javasormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactController.javasormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactDataForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/AdditionalTestInfoComponent.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/FourFoldCtCqComponent.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/AbstractDiseaseSectionComponent.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/DiseaseSectionFactory.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/MumpsSectionComponent.javasormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/utils/CssStyles.javasormas-ui/src/main/java/de/symeda/sormas/ui/utils/components/sidecomponent/SideComponentField.javasormas-ui/src/main/webapp/VAADIN/themes/sormas/views/disease.scss
| // 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), |
There was a problem hiding this comment.
🎯 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 -200Repository: 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 -200Repository: 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 -250Repository: 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 3Repository: 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.
| // 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.
| 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; |
There was a problem hiding this comment.
🗄️ 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 iffalseis 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.
There was a problem hiding this comment.
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
📒 Files selected for processing (10)
sormas-api/src/main/java/de/symeda/sormas/api/Disease.javasormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.javasormas-api/src/main/resources/enum.propertiessormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.javasormas-backend/src/main/java/de/symeda/sormas/backend/sample/PathogenTest.javasormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseDataForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/AdditionalTestInfoComponent.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/components/FourFoldCtCqComponent.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.javasormas-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
Fixes #
Summary by CodeRabbit