Skip to content

add enums, modify entities, dtos for exposure form redesign#13888

Merged
obinna-h-n merged 1 commit intodevelopmentfrom
13887-exposure-form-redesign
Mar 22, 2026
Merged

add enums, modify entities, dtos for exposure form redesign#13888
obinna-h-n merged 1 commit intodevelopmentfrom
13887-exposure-form-redesign

Conversation

@obinna-h-n
Copy link
Contributor

@obinna-h-n obinna-h-n commented Mar 22, 2026

add enums, modify entities, dtos required for exposure form redesign

Summary by CodeRabbit

Release Notes

  • New Features
    • Added comprehensive exposure categorization with multiple transmission types and environmental settings.
    • New fields for documenting protective measures, contact factors, and exposure sub-settings during case investigation.
    • Enhanced animal exposure tracking with category and condition details.
    • Added fomite transmission location specification and "other details" field for epidemiological data.

@obinna-h-n obinna-h-n self-assigned this Mar 22, 2026
@obinna-h-n obinna-h-n merged commit 2100265 into development Mar 22, 2026
4 of 9 checks passed
@obinna-h-n obinna-h-n deleted the 13887-exposure-form-redesign branch March 22, 2026 22:39
@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c4f94c8-ce74-43d6-97d0-d98414451fbf

📥 Commits

Reviewing files that changed from the base of the PR and between a3b69fb and ccdf73c.

📒 Files selected for processing (14)
  • sormas-api/src/main/java/de/symeda/sormas/api/epidata/EpiDataDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/AnimalCategory.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureCategory.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureContactFactor.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureProtectiveMeasure.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSetting.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureSubSetting.java
  • sormas-api/src/main/java/de/symeda/sormas/api/exposure/FomiteTransmissionLocation.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/epidata/EpiDataFacadeEjb.java
  • sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java
  • sormas-backend/src/main/resources/sql/sormas_schema.sql

📝 Walkthrough

Walkthrough

This PR redesigns the SORMAS exposure data model by introducing a comprehensive classification system with new enums for exposure types, settings, contact factors, and protective measures. The API and backend layers are extended with corresponding fields and collection mappings. Database schema changes include new columns, junction tables, and versioning infrastructure to persist exposure subcategories and associated factors.

Changes

Cohort / File(s) Summary
New Exposure Classification Enums
sormas-api/src/main/java/de/symeda/sormas/api/exposure/AnimalCategory.java, ExposureCategory.java, ExposureSetting.java, ExposureSubSetting.java, ExposureContactFactor.java, ExposureProtectiveMeasure.java, FomiteTransmissionLocation.java
Seven new enums introduced for comprehensive exposure classification. Each defines constants with localized toString() overrides. Enums like ExposureSetting, ExposureSubSetting, ExposureContactFactor, and ExposureProtectiveMeasure include category/setting mappings and static filter methods (getValues()) for retrieving matching values based on category and setting constraints.
DTO Layer Updates
sormas-api/src/main/java/de/symeda/sormas/api/exposure/ExposureDto.java, de/symeda/sormas/api/epidata/EpiDataDto.java
Extended ExposureDto with 14 new fields including exposure category, setting, multiple detail/comment strings, animal-related properties, fomite transmission location, and three new collection fields (subSettings, contactFactors, protectiveMeasures) initialized as empty HashSets in the factory method. EpiDataDto gains otherDetails field.
Entity Layer Updates
sormas-backend/src/main/java/de/symeda/sormas/backend/exposure/Exposure.java, de/symeda/sormas/backend/epidata/EpiData.java
Corresponding entity classes extended with matching persisted fields. Exposure adds @Enumerated properties for categories and conditions, text fields for details/comments, and three @ElementCollection(fetch = FetchType.EAGER) sets with backing join tables and uniqueness constraints. EpiData adds otherDetails text column.
Facade Mapping Logic
sormas-backend/src/main/java/de/symeda/sormas/backend/epidata/EpiDataFacadeEjb.java
Updates fillOrBuildEntity and toDto to propagate otherDetails. For Exposure, adds scalar field copying (category, setting, details, animal properties) and explicitly rebuilds three collection fields by clearing and repopulating from source Sets, only adding non-null elements.
Localization Data
sormas-api/src/main/resources/enum.properties
Adds 80+ new enum property entries for display captions across ExposureCategory, ExposureSetting, ExposureSubSetting, ExposureContactFactor, and ExposureProtectiveMeasure enums.
Database Schema Migration
sormas-backend/src/main/resources/sql/sormas_schema.sql
Extends epidata and exposures tables with new columns for category, setting, details, animal properties, and fomite location. Introduces three new junction tables (exposures_subsettings, exposures_contactfactors, exposures_protectivemeasures) with foreign keys, uniqueness constraints, and corresponding history tables. Adds versioning and deletion triggers. Increments schema version to 614.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

Suggested reviewers

  • raulbob
  • KarnaiahPesula

Poem

🐰 Hops through enums with glee,
Categories set exposure free!
Settings, factors, measures bright—
Database schema shines with light!
Collections mapped, the schema's right!

✨ 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.

Tip

You can disable poems in the walkthrough.

Disable the reviews.poem setting to disable the poems in the walkthrough.

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