Introduced new disease "shigellosis" to sormas.#13963
Conversation
Changes included in case, epidata, symptoms and sample moduels.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds Shigellosis support end-to-end: disease contagiousness defaults and configuration, new clinical/symptom fields and mappers, epi UI computed transmissibility/prophylaxis rendering, expanded lab metadata and AST fields, Shigellosis-specific sample/test UI, localization, and schema migration. ChangesShigellosis end-to-end support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
sormas-api/src/main/java/de/symeda/sormas/api/sample/SampleMaterial.java (1)
60-68:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd
SHIGELLOSIStoSTOOL.This layer wires Shigellosis into sample/test metadata, but the primary specimen type is still excluded here. Any disease-scoped material selector based on
@Diseaseswill missSTOOLfor Shigellosis while offering secondary materials likeRECTAL_SWAB.Suggested fix
`@Diseases`(value = { Disease.CORONAVIRUS, Disease.RESPIRATORY_SYNCYTIAL_VIRUS, Disease.INVASIVE_MENINGOCOCCAL_INFECTION, Disease.INVASIVE_PNEUMOCOCCAL_INFECTION, Disease.MEASLES, Disease.MALARIA, - Disease.DENGUE }, hide = true) + Disease.DENGUE, + Disease.SHIGELLOSIS }, hide = true) STOOL,🤖 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/sample/SampleMaterial.java` around lines 60 - 68, The `@Diseases` annotation on the SampleMaterial enum constant STOOL is missing Disease.SHIGELLOSIS; update the annotation on STOOL to include Disease.SHIGELLOSIS so disease-scoped selectors will include the primary specimen for Shigellosis (refer to SampleMaterial, the STOOL enum constant, the `@Diseases` annotation, and the Disease.SHIGELLOSIS enum value).sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java (1)
377-425:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winDuplicate key in Map.ofEntries() will cause runtime exception.
Line 413 and line 422 both add
PENICILLIN_SUSCEPTIBILITYto the map.Map.ofEntries()throwsIllegalArgumentExceptionon duplicate keys, causing a crash whenforceUpdateDrugSusceptibilityFields()is invoked.🐛 Proposed fix to remove duplicate entry
Map.entry( DrugSusceptibilityDto.STREPTOMYCIN_SUSCEPTIBILITY, Optional.ofNullable(drugSusceptibilityDto.getStreptomycinSusceptibility())), - Map.entry(DrugSusceptibilityDto.PENICILLIN_SUSCEPTIBILITY, Optional.ofNullable(drugSusceptibilityDto.getPenicillinSusceptibility())), Map.entry( DrugSusceptibilityDto.AZITHROMYCIN_SUSCEPTIBILITY, Optional.ofNullable(drugSusceptibilityDto.getAzithromycinSusceptibility())),🤖 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-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java` around lines 377 - 425, The map construction for applicableFieldIds contains a duplicate key DrugSusceptibilityDto.PENICILLIN_SUSCEPTIBILITY which causes Map.ofEntries() to throw at runtime; open the applicableFieldIds initialization and remove or correct the duplicate Map.entry so each DrugSusceptibilityDto constant appears only once (ensure the intended field isn't accidentally omitted), then verify forceUpdateDrugSusceptibilityFields() still behaves correctly after the fix.sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java (1)
99-110:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove/complete missing consumers for contagious collections
DiseaseConfigurationFacadeEjbonly clears and populatescontagiousEnabledDiseases,minContagiousPeriod, andmaxContagiousPeriodinloadData()(around lines 555-639), with no subsequent reads or reader/accessor methods in the facade class.DiseaseConfigurationFacadealso contains no correspondingContagious/minContagiousPeriod/maxContagiousPeriodAPI methods, so this wiring is currently dead/incomplete (the fields areprivate static, so nothing external can consume them).🤖 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/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java` around lines 99 - 110, The three contagious-related static fields (contagiousEnabledDiseases, minContagiousPeriod, maxContagiousPeriod) are populated in loadData() but never exposed or used; either remove them or expose them via the facade API. Fix by adding corresponding methods to the DiseaseConfigurationFacade interface (e.g., List<Disease> getContagiousEnabledDiseases(), Integer getMinContagiousPeriod(Disease), Integer getMaxContagiousPeriod(Disease) or boolean isDiseaseContagious(Disease)), then implement those methods in DiseaseConfigurationFacadeEjb to return values from the populated collections (contagiousEnabledDiseases, minContagiousPeriod, maxContagiousPeriod) and update callers to use the new API; alternatively delete the unused fields and the loadData() population logic for them if they are not needed.sormas-backend/src/test/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjbTest.java (1)
22-41:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winMake the Shigellosis fixture explicit in this test.
Disease.SHIGELLOSISis asserted here, but this test never initializes its configuration. That makes the result depend on whatever default disease rowsAbstractBeanTesthappens to load, so the assertion can pass without actually proving the new filter behavior and may start failing if the seed data changes. Add an explicitcreator.updateDiseaseConfiguration(Disease.SHIGELLOSIS, ...)in the setup and verify its expected inclusion/exclusion in the relevantgetAllDiseasesvariants.🤖 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/test/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjbTest.java` around lines 22 - 41, Add an explicit fixture for Disease.SHIGELLOSIS in the test setup by calling creator.updateDiseaseConfiguration(Disease.SHIGELLOSIS, ...) with the appropriate booleans/ints to match the scenario being tested in DiseaseConfigurationFacadeEjbTest; then update the assertions around getAllDiseases(...) to explicitly assert contains/doesNotContain for Disease.SHIGELLOSIS for each relevant variant so the test no longer relies on default seed data. Ensure the call is placed alongside the other creator.updateDiseaseConfiguration(...) lines and that the expected inclusion/exclusion aligns with the boolean filters passed to getAllDiseases.
🧹 Nitpick comments (4)
sormas-ui/src/main/java/de/symeda/sormas/ui/samples/sampleLink/SampleListEntry.java (1)
162-163: 💤 Low valueRedundant null ternary inside the
isNotBlankguard.Within
if (StringUtils.isNotBlank(variant)),variantis already guaranteed non-null and non-blank, so thevariant == null ? latestTest.getTestResult() : variantfallback can never select the test-result branch. Simplify to usevariantdirectly.- Label variantLabel = new Label(DataHelper.toStringNullable(variant == null ? latestTest.getTestResult() : variant)); + Label variantLabel = new Label(variant);🤖 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-ui/src/main/java/de/symeda/sormas/ui/samples/sampleLink/SampleListEntry.java` around lines 162 - 163, In SampleListEntry where you build the variant label, remove the redundant null-check ternary inside the isNotBlank guard: inside the if (StringUtils.isNotBlank(variant)) block replace the expression DataHelper.toStringNullable(variant == null ? latestTest.getTestResult() : variant) used when creating Label variantLabel with DataHelper.toStringNullable(variant) (i.e., use the confirmed-non-null variant directly).sormas-ui/src/main/java/de/symeda/sormas/ui/samples/pathogentestlink/PathogenTestListEntry.java (1)
112-114: 💤 Low valueType
resultTextasString.
determineSideComponentVariantreturnsString, so declaringresultTextasObjectloses type information for no reason.- Object resultText = determineSideComponentVariant(pathogenTest); + String resultText = determineSideComponentVariant(pathogenTest);🤖 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-ui/src/main/java/de/symeda/sormas/ui/samples/pathogentestlink/PathogenTestListEntry.java` around lines 112 - 114, The local variable resultText in PathogenTestListEntry is declared as Object but determineSideComponentVariant returns String; change the declaration to String resultText and update the subsequent call to DataHelper.toStringNullable(resultText == null ? pathogenTest.getTestResult() : resultText) so it uses the typed String, ensuring the variable and usages (resultText, determineSideComponentVariant, Label labelResult) reflect the correct String type.sormas-ui/src/main/java/de/symeda/sormas/ui/utils/components/sidecomponent/SideComponentField.java (1)
116-160: ⚡ Quick winHoist
VARIANT_MAPto a static constant and drop the double-brace initialization.
VARIANT_MAPis immutable lookup data but is rebuilt on every call todetermineSideComponentVariant, which runs per list entry render. The anonymousHashMapsubclass (double-brace initialization) is also a recognized anti-pattern (extra class per use, implicit outer reference). Move it to aprivate static finalfield initialized once.♻️ Proposed refactor
- public String determineSideComponentVariant(PathogenTestDto pathogenTest) { - - Map<Disease, List<PathogenTestType>> VARIANT_MAP = Collections.unmodifiableMap(new HashMap<>() { - - { - put( - Disease.MALARIA, - Collections.unmodifiableList( - Arrays.asList( - PathogenTestType.THIN_BLOOD_SMEAR, - ... - PathogenTestType.ANTIGEN_DETECTION))); - ... - } - }); - + private static final Map<Disease, List<PathogenTestType>> VARIANT_MAP = buildVariantMap(); + + private static Map<Disease, List<PathogenTestType>> buildVariantMap() { + Map<Disease, List<PathogenTestType>> map = new EnumMap<>(Disease.class); + map.put(Disease.MALARIA, Arrays.asList(/* ... */)); + // remaining entries ... + return Collections.unmodifiableMap(map); + } + + public String determineSideComponentVariant(PathogenTestDto pathogenTest) {🤖 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-ui/src/main/java/de/symeda/sormas/ui/utils/components/sidecomponent/SideComponentField.java` around lines 116 - 160, The VARIANT_MAP is being rebuilt every time determineSideComponentVariant(PathogenTestDto) is called and uses double-brace initialization; move it out as a private static final field (e.g. private static final Map<Disease,List<PathogenTestType>> VARIANT_MAP) initialized once at class load without double-brace anonymous class (use Map.of / Map.ofEntries and List.of or Collections.unmodifiableMap/Collections.unmodifiableList to preserve immutability). Replace the inline declaration inside determineSideComponentVariant with a reference to that static constant and remove the double-brace block and anonymous HashMap subclass.sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/disease/DiseaseConfigurationEditForm.java (1)
57-58: 💤 Low valueAdd spaces after commas for consistency.
Missing spaces after commas in the argument lists. Other lines in this file (e.g., line 52) include spaces after commas.
♻️ Proposed fix
- + fluidRowLocsCss(CssStyles.VSPACE_5, DiseaseConfigurationDto.INCUBATION_PERIOD_ENABLED,DiseaseConfigurationDto.IS_CONTAGIOUS) - + fluidRowLocsCss(CssStyles.VSPACE_1, DiseaseConfigurationDto.MIN_INCUBATION_PERIOD, DiseaseConfigurationDto.MAX_INCUBATION_PERIOD,DiseaseConfigurationDto.MIN_CONTAGIOUS_PERIOD, DiseaseConfigurationDto.MAX_CONTAGIOUS_PERIOD) + + fluidRowLocsCss(CssStyles.VSPACE_5, DiseaseConfigurationDto.INCUBATION_PERIOD_ENABLED, DiseaseConfigurationDto.IS_CONTAGIOUS) + + fluidRowLocsCss(CssStyles.VSPACE_1, DiseaseConfigurationDto.MIN_INCUBATION_PERIOD, DiseaseConfigurationDto.MAX_INCUBATION_PERIOD, DiseaseConfigurationDto.MIN_CONTAGIOUS_PERIOD, DiseaseConfigurationDto.MAX_CONTAGIOUS_PERIOD)🤖 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-ui/src/main/java/de/symeda/sormas/ui/configuration/disease/DiseaseConfigurationEditForm.java` around lines 57 - 58, The argument lists passed to fluidRowLocsCss in DiseaseConfigurationEditForm (calls using CssStyles.VSPACE_5 and CssStyles.VSPACE_1) are missing spaces after commas; update those calls so each comma is followed by a space (e.g., between DiseaseConfigurationDto.INCUBATION_PERIOD_ENABLED, DiseaseConfigurationDto.IS_CONTAGIOUS and between DiseaseConfigurationDto.MIN_INCUBATION_PERIOD, DiseaseConfigurationDto.MAX_INCUBATION_PERIOD, DiseaseConfigurationDto.MIN_CONTAGIOUS_PERIOD, DiseaseConfigurationDto.MAX_CONTAGIOUS_PERIOD) to match the file's existing spacing conventions.
🤖 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 151-155: Reinstate the DTO-level non-null contract by re-adding
the `@NotNull` annotation to the description field in ExposureDto (restore the
line above the private String description) and re-add the
javax.validation.constraints.NotNull import; ensure the description field keeps
`@SensitiveData` and `@Size` as before so the DTO validation enforces a required
description for all callers while UI-specific deviations are handled where the
form logic lives.
In
`@sormas-api/src/main/java/de/symeda/sormas/api/exposure/ModeOfTransmission.java`:
- Around line 43-48: The `@Diseases` annotation on the ModeOfTransmission enum
constant HEALTHCARE_ASSOCIATED contains a duplicated Disease.SHIGELLOSIS entry;
edit the annotation list on HEALTHCARE_ASSOCIATED to remove the duplicate
Disease.SHIGELLOSIS so each Disease appears only once (keep Disease.GIARDIASIS,
Disease.CRYPTOSPORIDIOSIS, Disease.SHIGELLOSIS).
In `@sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java`:
- Around line 198-200: The enum constant OTHER in PathogenSpecie lost its
`@ApplicableToPathogenTests` metadata causing forPathogenTest to exclude it;
restore the annotation on the OTHER enum constant (i.e., add
`@ApplicableToPathogenTests`(...) as used on other species) so OTHER is included
by forPathogenTest and re-enables the fallback path for Shigellosis handling in
the methods referencing PathogenSpecie.forPathogenTest.
In `@sormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.java`:
- Around line 76-82: The enum constant OTHER in SerotypingMethod is left
unannotated so applicability filtering (using `@ApplicableToPathogenTests` and
`@Diseases`) removes the free-text fallback; update the enum so OTHER is annotated
the same as the concrete methods (or at least with the relevant `@Diseases` and
`@ApplicableToPathogenTests` entries for Shigellosis and pneumococcal flows) so
pickers keep OTHER and the seroTypingMethodText field remains reachable; locate
the SerotypingMethod enum and add the same annotations to the OTHER constant (or
adjust the filtering logic to always include OTHER) to restore the fallback.
In `@sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java`:
- Around line 3196-3199: The field bloodyDiarrhea in SymptomsDto is missing the
disease applicability annotation; add the `@Diseases`({ SHIGELLOSIS }) annotation
to the bloodyDiarrhea field (alongside the existing `@Complication` and
`@SymptomGrouping` annotations) so it follows the same annotation-driven
visibility contract used by other symptoms and is correctly shown/hidden for
SHIGELLOSIS contexts.
In
`@sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java`:
- Around line 243-245: The DTO's isContagious is being set directly from
entity.getIsContagious(), leaving nulls that make the grid blank; change the
assignment in the disease-to-dto mapping so dto.setIsContagious(...) uses the
entity value when non-null and otherwise falls back to disease.isContagious()
(same pattern used for active/primaryDisease), referencing dto.setIsContagious,
entity.getIsContagious(), and disease.isContagious() to locate the change;
ensure the fallback produces a non-null Boolean for the grid.
In `@sormas-backend/src/main/resources/sql/sormas_schema.sql`:
- Line 16163: Update the inconsistent issue/PR references: replace the wrong
references "`#13915`" (in the comment "2026-05-20 Shigellosis disease
configuration (Luxembourg) `#13915`") and "`#13926`" (in the schema version INSERT)
with the correct PR/issue number "`#13963`" so both the comment and the schema
version entry match the actual PR; locate the two occurrences by searching for
the exact strings "`#13915`" and "`#13926`" in the file and update them to "`#13963`".
- Around line 16168-16169: The file contains a duplicate ALTER statement adding
the same column (ALTER TABLE healthconditions ADD COLUMN IF NOT EXISTS
medicationdetails varchar(255);) twice; remove the redundant second line (the
duplicate ALTER TABLE ... medicationdetails statement) or, if a different column
was intended, replace the duplicate line with the correct ALTER TABLE ADD COLUMN
for that intended column name/type, ensuring the unique symbol
"medicationdetails" only appears once in the ALTER statements for table
healthconditions.
In `@sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java`:
- Around line 358-368: In prophylaxisLayout, stop reusing the exposure heading
and use the new i18n key: replace the hardcoded createInfoLabel("Prophylaxis
status") with createInfoLabel(Strings.prophylaxisStatus) and remove the call
that makes LOC_EXPOSURE_PERIOD_CONSIDER_HEADING visible; instead make the
dedicated prophylaxis heading visible (e.g.
getContent().getComponent(LOC_PROPHYLAXIS_HEADING).setVisible(true)); if
LOC_PROPHYLAXIS_HEADING does not yet exist add the corresponding layout/constant
for the prophylaxis heading so the prophylaxis section shows its own localized
heading rather than the exposure heading.
In `@sormas-ui/src/main/webapp/VAADIN/themes/sormas/views/disease.scss`:
- Around line 610-613: The .background-darker rule currently uses `#DAAA69` which
is lighter than the base tone (`#bd1307`); update the .background-darker CSS
(background-color and fill in the .background-darker selector) to a true darker
variant of the base color (choose a hex darker than `#bd1307`) so the "darker"
semantic is correct and consistent with the base tone.
---
Outside diff comments:
In `@sormas-api/src/main/java/de/symeda/sormas/api/sample/SampleMaterial.java`:
- Around line 60-68: The `@Diseases` annotation on the SampleMaterial enum
constant STOOL is missing Disease.SHIGELLOSIS; update the annotation on STOOL to
include Disease.SHIGELLOSIS so disease-scoped selectors will include the primary
specimen for Shigellosis (refer to SampleMaterial, the STOOL enum constant, the
`@Diseases` annotation, and the Disease.SHIGELLOSIS enum value).
In
`@sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java`:
- Around line 99-110: The three contagious-related static fields
(contagiousEnabledDiseases, minContagiousPeriod, maxContagiousPeriod) are
populated in loadData() but never exposed or used; either remove them or expose
them via the facade API. Fix by adding corresponding methods to the
DiseaseConfigurationFacade interface (e.g., List<Disease>
getContagiousEnabledDiseases(), Integer getMinContagiousPeriod(Disease), Integer
getMaxContagiousPeriod(Disease) or boolean isDiseaseContagious(Disease)), then
implement those methods in DiseaseConfigurationFacadeEjb to return values from
the populated collections (contagiousEnabledDiseases, minContagiousPeriod,
maxContagiousPeriod) and update callers to use the new API; alternatively delete
the unused fields and the loadData() population logic for them if they are not
needed.
In
`@sormas-backend/src/test/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjbTest.java`:
- Around line 22-41: Add an explicit fixture for Disease.SHIGELLOSIS in the test
setup by calling creator.updateDiseaseConfiguration(Disease.SHIGELLOSIS, ...)
with the appropriate booleans/ints to match the scenario being tested in
DiseaseConfigurationFacadeEjbTest; then update the assertions around
getAllDiseases(...) to explicitly assert contains/doesNotContain for
Disease.SHIGELLOSIS for each relevant variant so the test no longer relies on
default seed data. Ensure the call is placed alongside the other
creator.updateDiseaseConfiguration(...) lines and that the expected
inclusion/exclusion aligns with the boolean filters passed to getAllDiseases.
In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.java`:
- Around line 377-425: The map construction for applicableFieldIds contains a
duplicate key DrugSusceptibilityDto.PENICILLIN_SUSCEPTIBILITY which causes
Map.ofEntries() to throw at runtime; open the applicableFieldIds initialization
and remove or correct the duplicate Map.entry so each DrugSusceptibilityDto
constant appears only once (ensure the intended field isn't accidentally
omitted), then verify forceUpdateDrugSusceptibilityFields() still behaves
correctly after the fix.
---
Nitpick comments:
In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/disease/DiseaseConfigurationEditForm.java`:
- Around line 57-58: The argument lists passed to fluidRowLocsCss in
DiseaseConfigurationEditForm (calls using CssStyles.VSPACE_5 and
CssStyles.VSPACE_1) are missing spaces after commas; update those calls so each
comma is followed by a space (e.g., between
DiseaseConfigurationDto.INCUBATION_PERIOD_ENABLED,
DiseaseConfigurationDto.IS_CONTAGIOUS and between
DiseaseConfigurationDto.MIN_INCUBATION_PERIOD,
DiseaseConfigurationDto.MAX_INCUBATION_PERIOD,
DiseaseConfigurationDto.MIN_CONTAGIOUS_PERIOD,
DiseaseConfigurationDto.MAX_CONTAGIOUS_PERIOD) to match the file's existing
spacing conventions.
In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/samples/pathogentestlink/PathogenTestListEntry.java`:
- Around line 112-114: The local variable resultText in PathogenTestListEntry is
declared as Object but determineSideComponentVariant returns String; change the
declaration to String resultText and update the subsequent call to
DataHelper.toStringNullable(resultText == null ? pathogenTest.getTestResult() :
resultText) so it uses the typed String, ensuring the variable and usages
(resultText, determineSideComponentVariant, Label labelResult) reflect the
correct String type.
In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/samples/sampleLink/SampleListEntry.java`:
- Around line 162-163: In SampleListEntry where you build the variant label,
remove the redundant null-check ternary inside the isNotBlank guard: inside the
if (StringUtils.isNotBlank(variant)) block replace the expression
DataHelper.toStringNullable(variant == null ? latestTest.getTestResult() :
variant) used when creating Label variantLabel with
DataHelper.toStringNullable(variant) (i.e., use the confirmed-non-null variant
directly).
In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/utils/components/sidecomponent/SideComponentField.java`:
- Around line 116-160: The VARIANT_MAP is being rebuilt every time
determineSideComponentVariant(PathogenTestDto) is called and uses double-brace
initialization; move it out as a private static final field (e.g. private static
final Map<Disease,List<PathogenTestType>> VARIANT_MAP) initialized once at class
load without double-brace anonymous class (use Map.of / Map.ofEntries and
List.of or Collections.unmodifiableMap/Collections.unmodifiableList to preserve
immutability). Replace the inline declaration inside
determineSideComponentVariant with a reference to that static constant and
remove the double-brace block and anonymous HashMap subclass.
🪄 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: 903cf96b-7fa7-4f3d-97a4-b73fb6221256
📒 Files selected for processing (50)
sormas-api/src/main/java/de/symeda/sormas/api/Disease.javasormas-api/src/main/java/de/symeda/sormas/api/clinicalcourse/HealthConditionsDto.javasormas-api/src/main/java/de/symeda/sormas/api/disease/DiseaseConfigurationDto.javasormas-api/src/main/java/de/symeda/sormas/api/disease/DiseaseConfigurationIndexDto.javasormas-api/src/main/java/de/symeda/sormas/api/epidata/EpiDataDto.javasormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.javasormas-api/src/main/java/de/symeda/sormas/api/exposure/InfectionSource.javasormas-api/src/main/java/de/symeda/sormas/api/exposure/ModeOfTransmission.javasormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.javasormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.javasormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.javasormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.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/sample/SerotypingMethod.javasormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.javasormas-api/src/main/java/de/symeda/sormas/api/therapy/Drug.javasormas-api/src/main/java/de/symeda/sormas/api/therapy/DrugSusceptibilityDto.javasormas-api/src/main/resources/captions.propertiessormas-api/src/main/resources/enum.propertiessormas-api/src/main/resources/strings.propertiessormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditions.javasormas-backend/src/main/java/de/symeda/sormas/backend/clinicalcourse/HealthConditionsMapper.javasormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfiguration.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/symptoms/Symptoms.javasormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/SymptomsFacadeEjb.javasormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibility.javasormas-backend/src/main/java/de/symeda/sormas/backend/therapy/DrugSusceptibilityMapper.javasormas-backend/src/main/resources/sql/sormas_schema.sqlsormas-backend/src/test/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjbTest.javasormas-ui/src/main/java/de/symeda/sormas/ui/clinicalcourse/HealthConditionsForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/configuration/disease/DiseaseConfigurationEditForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/configuration/disease/DiseaseConfigurationGrid.javasormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactDataView.javasormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/person/PersonEditForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/PathogenTestController.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/DiseaseSectionFactory.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/diseasesection/ShigellosisSectionComponent.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/pathogentestlink/PathogenTestListEntry.javasormas-ui/src/main/java/de/symeda/sormas/ui/samples/sampleLink/SampleListEntry.javasormas-ui/src/main/java/de/symeda/sormas/ui/symptoms/SymptomsForm.javasormas-ui/src/main/java/de/symeda/sormas/ui/therapy/DrugSusceptibilityForm.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
💤 Files with no reviewable changes (2)
- sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiData.java
- sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.java
| &.background-darker { | ||
| background-color: #DAAA69; | ||
| fill: #DAAA69; | ||
| } |
There was a problem hiding this comment.
background-darker uses a lighter color than the base tone.
Line 611-612 sets .background-darker to #DAAA69, which is lighter than the base #bd1307 and inverts the expected darker-state semantics.
Proposed fix
.background-disease-shigellosis {
background-color: `#bd1307`;
fill: `#bd1307`;
&.background-darker {
- background-color: `#DAAA69`;
- fill: `#DAAA69`;
+ background-color: `#8f0f06`;
+ fill: `#8f0f06`;
}
}📝 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.
| &.background-darker { | |
| background-color: #DAAA69; | |
| fill: #DAAA69; | |
| } | |
| &.background-darker { | |
| background-color: `#8f0f06`; | |
| fill: `#8f0f06`; | |
| } |
🤖 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-ui/src/main/webapp/VAADIN/themes/sormas/views/disease.scss` around
lines 610 - 613, The .background-darker rule currently uses `#DAAA69` which is
lighter than the base tone (`#bd1307`); update the .background-darker CSS
(background-color and fill in the .background-darker selector) to a true darker
variant of the base color (choose a hex darker than `#bd1307`) so the "darker"
semantic is correct and consistent with the base tone.
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-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java`:
- Line 3194: The public field constant HAEMOLYTIC_UREMIC_SYNDROME still holds
the old string "haemolyticuremicsyndrome"; update the constant(s) named
HAEMOLYTIC_UREMIC_SYNDROME (and any duplicate declarations in the file) to use
the new property name "haemolyticUremicSyndrome" so code referencing the DTO
field haemolyticUremicSyndrome resolves correctly.
🪄 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: fcba228e-99ca-45b4-8633-e99f24581c70
📒 Files selected for processing (9)
sormas-api/src/main/java/de/symeda/sormas/api/exposure/ModeOfTransmission.javasormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.javasormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.javasormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.javasormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.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/epidata/EpiDataForm.java
💤 Files with no reviewable changes (1)
- sormas-api/src/main/java/de/symeda/sormas/api/exposure/ModeOfTransmission.java
🚧 Files skipped from review as they are similar to previous changes (4)
- sormas-backend/src/main/java/de/symeda/sormas/backend/symptoms/SymptomsFacadeEjb.java
- sormas-backend/src/main/resources/sql/sormas_schema.sql
- sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java
- sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java (1)
607-607:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd defensive null check for exposures list.
If
getExposures()returns null, calling.stream()will throw a NullPointerException. While the DTO likely initializes exposures to an empty list, adding a defensive check improves robustness.🛡️ Proposed fix
-Optional<ProphylaxisAdherence> adherence = newFieldValue.getExposures() +List<ExposureDto> exposures = newFieldValue.getExposures(); +Optional<ProphylaxisAdherence> adherence = (exposures != null ? exposures : Collections.emptyList()) .stream() .sorted(Comparator.comparing(ExposureDto::getStartDate, Comparator.nullsLast(Comparator.reverseOrder()))) .map(ExposureDto::getProphylaxisAdherence) .filter(Objects::nonNull) .findFirst();🤖 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-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java` at line 607, The current use of newFieldValue.getExposures().stream() in EpiDataForm (where adherence is computed) can NPE if getExposures() is null; update the logic that computes Optional<ProphylaxisAdherence> adherence to handle a null exposures list (e.g., treat null as empty) before streaming—check newFieldValue.getExposures() for null and use an empty collection or skip streaming so the Optional is computed safely.
🧹 Nitpick comments (1)
sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java (1)
365-373: ⚡ Quick winSimplify redundant if/else branches.
Both branches set the prophylaxis status heading to invisible. The logic can be streamlined by extracting the common
setVisible(false)call.♻️ Proposed refactor
if (hideProphylaxisComponent) { + getContent().getComponent(LOC_PROPHYLAXIS_STATUS).setVisible(false); if (prophylaxisComponent != null) { - getContent().getComponent(LOC_PROPHYLAXIS_STATUS).setVisible(false); prophylaxisComponent.setVisible(false); getContent().removeComponent("PROPHYLAXIS_LAYOUT"); - return; - } else { - getContent().getComponent(LOC_PROPHYLAXIS_STATUS).setVisible(false); - return; } + return; }🤖 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-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java` around lines 365 - 373, The code repeats getContent().getComponent(LOC_PROPHYLAXIS_STATUS).setVisible(false) in both branches; simplify by calling getContent().getComponent(LOC_PROPHYLAXIS_STATUS).setVisible(false) once before the conditional, then check if (prophylaxisComponent != null) to call prophylaxisComponent.setVisible(false) and getContent().removeComponent("PROPHYLAXIS_LAYOUT") and return; otherwise just return—remove the redundant else branch and duplicated call.
🤖 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/epidata/EpiDataForm.java`:
- Around line 377-379: The early return when (!hideProphylaxisComponent && value
== null) leaves a visible prophylaxis UI if the enum caption lookup returns
null; change this so that when value == null you explicitly hide the prophylaxis
UI elements (prophylaxisComponent and prophylaxisHeading) and return, instead of
returning only in the !hideProphylaxisComponent case. Locate the block using
hideProphylaxisComponent and value in EpiDataForm, replace the existing
conditional with logic that checks value == null, calls the
hide/setVisible(false) actions on prophylaxisComponent and prophylaxisHeading,
then returns; otherwise continue with the existing flow that shows or updates
those components.
---
Outside diff comments:
In `@sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java`:
- Line 607: The current use of newFieldValue.getExposures().stream() in
EpiDataForm (where adherence is computed) can NPE if getExposures() is null;
update the logic that computes Optional<ProphylaxisAdherence> adherence to
handle a null exposures list (e.g., treat null as empty) before streaming—check
newFieldValue.getExposures() for null and use an empty collection or skip
streaming so the Optional is computed safely.
---
Nitpick comments:
In `@sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java`:
- Around line 365-373: The code repeats
getContent().getComponent(LOC_PROPHYLAXIS_STATUS).setVisible(false) in both
branches; simplify by calling
getContent().getComponent(LOC_PROPHYLAXIS_STATUS).setVisible(false) once before
the conditional, then check if (prophylaxisComponent != null) to call
prophylaxisComponent.setVisible(false) and
getContent().removeComponent("PROPHYLAXIS_LAYOUT") and return; otherwise just
return—remove the redundant else branch and duplicated 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
Run ID: 5b5a189f-fbc8-4989-aa6b-48d98532803a
📒 Files selected for processing (4)
sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.javasormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.javasormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.javasormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java
🚧 Files skipped from review as they are similar to previous changes (3)
- sormas-api/src/main/java/de/symeda/sormas/api/sample/SerotypingMethod.java
- sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java
- sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java
| if (!hideProphylaxisComponent && value == null) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Hide component when value becomes null.
If hideProphylaxisComponent is false but value is null, the method returns early without hiding a previously visible prophylaxis component and heading. This can leave stale data visible if, for example, I18nProperties.getEnumCaption() unexpectedly returns null for a present adherence.
🐛 Proposed fix
if (!hideProphylaxisComponent && value == null) {
+ Component existingComponent = getContent().getComponent("PROPHYLAXIS_LAYOUT");
+ if (existingComponent != null) {
+ getContent().getComponent(LOC_PROPHYLAXIS_STATUS).setVisible(false);
+ existingComponent.setVisible(false);
+ getContent().removeComponent("PROPHYLAXIS_LAYOUT");
+ }
return;
}🤖 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-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java` around
lines 377 - 379, The early return when (!hideProphylaxisComponent && value ==
null) leaves a visible prophylaxis UI if the enum caption lookup returns null;
change this so that when value == null you explicitly hide the prophylaxis UI
elements (prophylaxisComponent and prophylaxisHeading) and return, instead of
returning only in the !hideProphylaxisComponent case. Locate the block using
hideProphylaxisComponent and value in EpiDataForm, replace the existing
conditional with logic that checks value == null, calls the
hide/setVisible(false) actions on prophylaxisComponent and prophylaxisHeading,
then returns; otherwise continue with the existing flow that shows or updates
those components.
There was a problem hiding this comment.
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/resources/sql/sormas_schema.sql`:
- Around line 16166-16173: The migration only updates live tables; add identical
UPDATE statements for the history tables so historical rows use the new enum
values: run UPDATE cases_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE
vaccinationstatus = 'RECOVERED'; UPDATE contact_history SET vaccinationstatus =
'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE
eventparticipant_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE
vaccinationstatus = 'RECOVERED'; and similarly collapse
VACCINATED_ONE_DOSE/VACCINATED_TWO_DOSE into 'VACCINATED' on cases_history,
contact_history and eventparticipant_history (i.e., use WHERE vaccinationstatus
IN ('VACCINATED_ONE_DOSE','VACCINATED_TWO_DOSE') and set to 'VACCINATED');
include these statements in the same migration and wrap in a transaction if the
script uses one.
- Around line 16221-16227: The migration currently deletes and reinserts
USE_QUICK_IMMUNIZATION_CREATION always resetting config_value to 'false';
instead, update any existing row to preserve its config_value and only insert a
new row if none exists. Replace the DELETE/INSERT with: 1) an UPDATE on
systemconfigurationvalue where config_key = 'USE_QUICK_IMMUNIZATION_CREATION' to
set/refresh metadata fields (category_id = general_category_id,
value_description, value_optional, value_pattern, value_encrypt, data_provider,
validation_message, changedate) but do NOT modify config_value; 2) an INSERT of
the same metadata plus default config_value only when NOT EXISTS (select 1 from
systemconfigurationvalue where config_key = 'USE_QUICK_IMMUNIZATION_CREATION'
and category_id = general_category_id). Target the systemconfigurationvalue
table and the config_key 'USE_QUICK_IMMUNIZATION_CREATION' to locate the code to
change.
🪄 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: ea80d644-2b4c-4045-9061-3032fc9915e9
📒 Files selected for processing (7)
sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.javasormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.javasormas-api/src/main/resources/captions.propertiessormas-api/src/main/resources/enum.propertiessormas-api/src/main/resources/strings.propertiessormas-backend/src/main/resources/sql/sormas_schema.sqlsormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactDataView.java
✅ Files skipped from review due to trivial changes (1)
- sormas-api/src/main/resources/strings.properties
🚧 Files skipped from review as they are similar to previous changes (4)
- sormas-api/src/main/resources/enum.properties
- sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
- sormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactDataView.java
- sormas-api/src/main/resources/captions.properties
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
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/resources/sql/sormas_schema.sql`:
- Around line 16166-16173: The migration only updates live tables; add identical
UPDATE statements for the history tables so historical rows use the new enum
values: run UPDATE cases_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE
vaccinationstatus = 'RECOVERED'; UPDATE contact_history SET vaccinationstatus =
'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE
eventparticipant_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE
vaccinationstatus = 'RECOVERED'; and similarly collapse
VACCINATED_ONE_DOSE/VACCINATED_TWO_DOSE into 'VACCINATED' on cases_history,
contact_history and eventparticipant_history (i.e., use WHERE vaccinationstatus
IN ('VACCINATED_ONE_DOSE','VACCINATED_TWO_DOSE') and set to 'VACCINATED');
include these statements in the same migration and wrap in a transaction if the
script uses one.
- Around line 16221-16227: The migration currently deletes and reinserts
USE_QUICK_IMMUNIZATION_CREATION always resetting config_value to 'false';
instead, update any existing row to preserve its config_value and only insert a
new row if none exists. Replace the DELETE/INSERT with: 1) an UPDATE on
systemconfigurationvalue where config_key = 'USE_QUICK_IMMUNIZATION_CREATION' to
set/refresh metadata fields (category_id = general_category_id,
value_description, value_optional, value_pattern, value_encrypt, data_provider,
validation_message, changedate) but do NOT modify config_value; 2) an INSERT of
the same metadata plus default config_value only when NOT EXISTS (select 1 from
systemconfigurationvalue where config_key = 'USE_QUICK_IMMUNIZATION_CREATION'
and category_id = general_category_id). Target the systemconfigurationvalue
table and the config_key 'USE_QUICK_IMMUNIZATION_CREATION' to locate the code to
change.
🪄 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: ea80d644-2b4c-4045-9061-3032fc9915e9
📒 Files selected for processing (7)
sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.javasormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.javasormas-api/src/main/resources/captions.propertiessormas-api/src/main/resources/enum.propertiessormas-api/src/main/resources/strings.propertiessormas-backend/src/main/resources/sql/sormas_schema.sqlsormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactDataView.java
✅ Files skipped from review due to trivial changes (1)
- sormas-api/src/main/resources/strings.properties
🚧 Files skipped from review as they are similar to previous changes (4)
- sormas-api/src/main/resources/enum.properties
- sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
- sormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactDataView.java
- sormas-api/src/main/resources/captions.properties
🛑 Comments failed to post (2)
sormas-backend/src/main/resources/sql/sormas_schema.sql (2)
16166-16173:
⚠️ Potential issue | 🟠 Major | ⚡ Quick winNormalize the renamed vaccination statuses in
_historytables as well.These updates only rewrite the live tables.
cases_history,contact_history, andeventparticipant_historywill still containRECOVERED,VACCINATED_ONE_DOSE, andVACCINATED_TWO_DOSE, which leaves persisted history rows out of sync with the new enum vocabulary.Suggested migration patch
UPDATE cases SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE contact SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE eventparticipant SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; +UPDATE cases_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; +UPDATE contact_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; +UPDATE eventparticipant_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; @@ UPDATE cases SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); UPDATE contact SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); UPDATE eventparticipant SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); +UPDATE cases_history SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); +UPDATE contact_history SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); +UPDATE eventparticipant_history SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE');📝 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.UPDATE cases SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE contact SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE eventparticipant SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE cases_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE contact_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE eventparticipant_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; -- Collapse VACCINATED_ONE_DOSE / VACCINATED_TWO_DOSE → VACCINATED UPDATE cases SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); UPDATE contact SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); UPDATE eventparticipant SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); UPDATE cases_history SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); UPDATE contact_history SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE'); UPDATE eventparticipant_history SET vaccinationstatus = 'VACCINATED' WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE', 'VACCINATED_TWO_DOSE');🤖 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 16166 - 16173, The migration only updates live tables; add identical UPDATE statements for the history tables so historical rows use the new enum values: run UPDATE cases_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE contact_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; UPDATE eventparticipant_history SET vaccinationstatus = 'HAD_THE_DISEASE' WHERE vaccinationstatus = 'RECOVERED'; and similarly collapse VACCINATED_ONE_DOSE/VACCINATED_TWO_DOSE into 'VACCINATED' on cases_history, contact_history and eventparticipant_history (i.e., use WHERE vaccinationstatus IN ('VACCINATED_ONE_DOSE','VACCINATED_TWO_DOSE') and set to 'VACCINATED'); include these statements in the same migration and wrap in a transaction if the script uses one.
16221-16227:
⚠️ Potential issue | 🟠 Major | ⚡ Quick winPreserve the current
USE_QUICK_IMMUNIZATION_CREATIONvalue during upgrade.The
DELETE+INSERTalways recreates this row withconfig_value = 'false', so any instance that already changed the setting loses its configured value during migration. If the goal is to backfill metadata or move the key intoGENERAL_CATEGORY, update the existing row and insert only when it is missing.Suggested migration patch
DO $$ DECLARE general_category_id integer; + quick_immunization_exists boolean; BEGIN @@ -DELETE FROM systemconfigurationvalue WHERE category_id = general_category_id AND config_key = 'USE_QUICK_IMMUNIZATION_CREATION'; -INSERT INTO systemconfigurationvalue(config_key, config_value, value_description, category_id, value_optional, value_pattern, - value_encrypt, data_provider, validation_message, changedate, creationdate, id, - uuid) -VALUES ('USE_QUICK_IMMUNIZATION_CREATION', 'false', 'i18n/infoSystemConfigurationValueDescriptionUseQuickImmunizationCreation', general_category_id, true, - '', false, 'de.symeda.sormas.api.systemconfiguration.SystemConfigurationValueBooleanProvider', - 'i18n/systemConfigurationValueInvalidValue', now(), now(), nextval('entity_seq'), generate_base32_uuid()); +SELECT EXISTS ( + SELECT 1 + FROM systemconfigurationvalue + WHERE config_key = 'USE_QUICK_IMMUNIZATION_CREATION' +) INTO quick_immunization_exists; + +IF quick_immunization_exists THEN + UPDATE systemconfigurationvalue + SET category_id = general_category_id, + value_description = 'i18n/infoSystemConfigurationValueDescriptionUseQuickImmunizationCreation', + value_optional = true, + value_pattern = '', + value_encrypt = false, + data_provider = 'de.symeda.sormas.api.systemconfiguration.SystemConfigurationValueBooleanProvider', + validation_message = 'i18n/systemConfigurationValueInvalidValue', + changedate = now() + WHERE config_key = 'USE_QUICK_IMMUNIZATION_CREATION'; +ELSE + INSERT INTO systemconfigurationvalue(config_key, config_value, value_description, category_id, value_optional, value_pattern, + value_encrypt, data_provider, validation_message, changedate, creationdate, id, + uuid) + VALUES ('USE_QUICK_IMMUNIZATION_CREATION', 'false', 'i18n/infoSystemConfigurationValueDescriptionUseQuickImmunizationCreation', general_category_id, true, + '', false, 'de.symeda.sormas.api.systemconfiguration.SystemConfigurationValueBooleanProvider', + 'i18n/systemConfigurationValueInvalidValue', now(), now(), nextval('entity_seq'), generate_base32_uuid()); +END IF;🤖 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 16221 - 16227, The migration currently deletes and reinserts USE_QUICK_IMMUNIZATION_CREATION always resetting config_value to 'false'; instead, update any existing row to preserve its config_value and only insert a new row if none exists. Replace the DELETE/INSERT with: 1) an UPDATE on systemconfigurationvalue where config_key = 'USE_QUICK_IMMUNIZATION_CREATION' to set/refresh metadata fields (category_id = general_category_id, value_description, value_optional, value_pattern, value_encrypt, data_provider, validation_message, changedate) but do NOT modify config_value; 2) an INSERT of the same metadata plus default config_value only when NOT EXISTS (select 1 from systemconfigurationvalue where config_key = 'USE_QUICK_IMMUNIZATION_CREATION' and category_id = general_category_id). Target the systemconfigurationvalue table and the config_key 'USE_QUICK_IMMUNIZATION_CREATION' to locate the code to change.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java (1)
197-203:⚠️ Potential issue | 🟠 Major | ⚡ Quick winBare
@Diseases/@ApplicableToPathogenTestsno longer match the fallback filters.Line 198 and Line 201 switch
OTHER/UNKNOWNfrom concrete applicability metadata to marker annotations, but bothPathogenSpecie.forPathogenTest(Line 217-226) andAnnotationFieldHelper.getFieldNamesWithMatchingDiseaseAndTestAnnotationsonly return entries whose annotationvalue()explicitly contains the requested disease/test. As written, these two fallback values drop out of the Shigellosis serogrouping lists instead of being “applicable to all”. Please either restore explicit values here or change the shared filter logic to treat empty annotation values as wildcards.🤖 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/sample/PathogenSpecie.java` around lines 197 - 203, The marker annotations on OTHER and UNKNOWN currently use empty `@Diseases/`@ApplicableToPathogenTests which should act as wildcards; update the shared filter logic in AnnotationFieldHelper.getFieldNamesWithMatchingDiseaseAndTestAnnotations (and any disease/test matching code PathogenSpecie.forPathogenTest relies on) so that when an annotation's value() is empty (length 0) it is treated as matching any requested disease or test instead of requiring an explicit match; ensure the check treats empty arrays/values as a wildcard before performing explicit contains() checks so OTHER/UNKNOWN remain applicable to all diseases/tests.
🤖 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.
Duplicate comments:
In `@sormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.java`:
- Around line 197-203: The marker annotations on OTHER and UNKNOWN currently use
empty `@Diseases/`@ApplicableToPathogenTests which should act as wildcards; update
the shared filter logic in
AnnotationFieldHelper.getFieldNamesWithMatchingDiseaseAndTestAnnotations (and
any disease/test matching code PathogenSpecie.forPathogenTest relies on) so that
when an annotation's value() is empty (length 0) it is treated as matching any
requested disease or test instead of requiring an explicit match; ensure the
check treats empty arrays/values as a wildcard before performing explicit
contains() checks so OTHER/UNKNOWN remain applicable to all diseases/tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9c679673-8528-4c36-8ef8-8b4a679564e5
📒 Files selected for processing (4)
sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.javasormas-api/src/main/java/de/symeda/sormas/api/sample/PathogenSpecie.javasormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.javasormas-api/src/main/resources/captions.properties
✅ Files skipped from review due to trivial changes (2)
- sormas-api/src/main/resources/captions.properties
- sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
🚧 Files skipped from review as they are similar to previous changes (1)
- sormas-api/src/main/java/de/symeda/sormas/api/symptoms/SymptomsDto.java
Changes included in case, epidata, symptoms and sample moduels.
Fixes #
Summary by CodeRabbit
New Features
Data Migration
Tests