Skip to content

13887-exposure-form-redesign#13905

Merged
obinna-h-n merged 3 commits intodevelopmentfrom
13887-exposure-form-redesign
Apr 8, 2026
Merged

13887-exposure-form-redesign#13905
obinna-h-n merged 3 commits intodevelopmentfrom
13887-exposure-form-redesign

Conversation

@obinna-h-n
Copy link
Copy Markdown
Contributor

@obinna-h-n obinna-h-n commented Apr 8, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added exposure category configuration for disease management
    • Enhanced exposure form with organized sections for activity, location, and details
    • Added "Other Details" field for epidemiological data
    • Improved exposure information display with category and setting details
  • Style

    • Updated visual styling of section containers for better appearance

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 73e89452-5e6b-489e-863d-293d7243b638

📥 Commits

Reviewing files that changed from the base of the PR and between 20092e7 and d87ec8c.

📒 Files selected for processing (22)
  • sormas-api/src/main/java/de/symeda/sormas/api/disease/DiseaseConfigurationDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/disease/DiseaseConfigurationIndexDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureCategory.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSubSetting.java
  • sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
  • sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java
  • sormas-api/src/main/resources/captions.properties
  • sormas-api/src/main/resources/enum.properties
  • sormas-api/src/main/resources/strings.properties
  • sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfiguration.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/disease/DiseaseConfigurationFacadeEjb.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/ExposureCategorySetConverter.java
  • sormas-backend/src/main/resources/sql/sormas_schema.sql
  • sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/disease/DiseaseConfigurationEditForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/disease/DiseaseConfigurationGrid.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/epidata/EpiDataForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposureForm.java
  • sormas-ui/src/main/java/de/symeda/sormas/ui/exposure/ExposuresField.java
  • sormas-ui/src/main/webapp/VAADIN/themes/sormas/global.scss

📝 Walkthrough

Walkthrough

The PR adds exposure category configuration to disease settings, introduces corresponding persistence and data mapping layers, extends the exposure form UI with a three-section accordion layout for category-dependent fields, and updates supporting i18n resources and database schema to persist the new exposure category associations.

Changes

Cohort / File(s) Summary
Disease Configuration DTOs
sormas-api/.../disease/DiseaseConfigurationDto.java, sormas-api/.../disease/DiseaseConfigurationIndexDto.java
Added exposureCategories field and getter/setter to DiseaseConfigurationDto; added exposureCategoryNames string field and methods to DiseaseConfigurationIndexDto for display in index views.
Exposure API Extensions
sormas-api/.../exposure/ExposureCategory.java, sormas-api/.../exposure/ExposureDto.java, sormas-api/.../exposure/ExposureSubSetting.java
Added hasNoSetting() and hasNoSubSetting() membership-check methods to ExposureCategory enum; added CONDITION_OF_ANIMAL constant to ExposureDto; added new getValuesForCategoryOnly() method and refactored getValues() logic in ExposureSubSetting to handle category-only sub-settings.
i18n Captions and Strings
sormas-api/.../i18n/Captions.java, sormas-api/.../i18n/Strings.java, sormas-api/.../resources/captions.properties, sormas-api/.../resources/strings.properties, sormas-api/.../resources/enum.properties
Added new caption constants for disease configuration exposure fields, exposure details, animal categories, and section titles; added string heading constants for exposures and other information; populated corresponding resource properties with display values for UI rendering.
Backend Disease Configuration
sormas-backend/.../disease/DiseaseConfiguration.java, sormas-backend/.../disease/DiseaseConfigurationFacadeEjb.java
Added exposureCategories persisted field with @Convert annotation to entity; updated facade mapping methods to copy exposure category data between entities and DTOs, with formatter for index DTO display.
Backend Exposure Persistence
sormas-backend/.../exposure/ExposureCategorySetConverter.java, sormas-backend/.../exposure/Exposure.java
Introduced new ExposureCategorySetConverter JPA converter for comma-separated string storage of Set<ExposureCategory>; added CONDITION_OF_ANIMAL constant to Exposure entity; removed unique constraints from collection table mappings.
Backend EpiData Facade
sormas-backend/.../epidata/EpiDataFacadeEjb.java
Simplified collection assignment logic for subSettings, contactFactors, and protectiveMeasures by removing Optional-based dereferencing in favor of direct null-coalescing assignment.
Database Schema Migration
sormas-backend/.../resources/sql/sormas_schema.sql
Added exposurecategories varchar(255) column to diseaseconfiguration and diseaseconfiguration_history tables; modified primary key constraints on exposure-related collection tables; dropped history triggers on those tables.
Disease Configuration UI
sormas-ui/.../configuration/disease/DiseaseConfigurationEditForm.java, sormas-ui/.../configuration/disease/DiseaseConfigurationGrid.java
Added CheckboxSet field for exposure category selection in edit form; added corresponding column to grid with non-sortable marking.
Exposure Form and Field UI
sormas-ui/.../epidata/EpiDataForm.java, sormas-ui/.../exposure/ExposureForm.java, sormas-ui/.../exposure/ExposuresField.java
Extended EpiDataForm with "other information" section and text area for additional details; refactored ExposureForm into three accordion sections with dynamic field visibility based on exposure category selection; updated ExposuresField to display exposure category and setting columns instead of type-based columns.
Style Updates
sormas-ui/.../webapp/VAADIN/themes/sormas/global.scss
Changed view-section border-radius from 4px to 8px.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • PR #13888 — Modifies ExposureCategory and ExposureSubSetting enums along with exposure-related DTO fields; closely aligned with this PR's exposure model changes.
  • PR #13877 — Updates DiseaseConfigurationDto and DiseaseConfigurationIndexDto with new field declarations matching this PR's disease configuration extensions.
  • PR #13889 — Modifies EpiDataForm UI layout and i18n Captions/Strings constants in parallel with this PR's exposure and epidata form changes.

Suggested reviewers

  • KarnaiahPesula
  • raulbob

Poem

🐰 Categories bloom in disease configurations bright,
Accordions fold exposures into organized sight,
Converters transform sets to strings so neat,
Database grows stronger, the architecture complete! ✨

✨ 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 13887-exposure-form-redesign

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@obinna-h-n obinna-h-n merged commit ac0e072 into development Apr 8, 2026
6 of 8 checks passed
@obinna-h-n obinna-h-n deleted the 13887-exposure-form-redesign branch April 8, 2026 22:38
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.

1 participant