Skip to content

NgSurvey integration #13885

Merged
Pa-Touche merged 139 commits into
developmentfrom
feat/13832-ngsurvey-integration-external-api
May 13, 2026
Merged

NgSurvey integration #13885
Pa-Touche merged 139 commits into
developmentfrom
feat/13832-ngsurvey-integration-external-api

Conversation

@Pa-Touche
Copy link
Copy Markdown
Contributor

@Pa-Touche Pa-Touche commented Mar 17, 2026

Summary

Introduces an end-to-end pipeline that lets an external survey tool (ngSurvey) push answer payloads back into SORMAS and have them turned into a CaseDataDto patch.

Feature is broken down into following layers:

  • API layer (sormas-api): new DTOs/facades for external survey messages, a DataPatcher contract, a PartialRetriever contract, plus mapping/alias support.
  • Backend (sormas-backend.patch) - an in-house mini-framework on top of Apache Commons PropertyUtils:
    • DataPatcherImpl orchestrates per-field patching with a result-collecting pipeline.
    • PartialRetrieverImpl reads back the same paths for display.
    • Pluggable ValuePatchMapper (date / enum / customizable enum / primitive / reference DTO) and FieldCustomMapper (person contact details, person birthdate) registries.
    • EqualityChecker registry used when DataReplacementStrategy.IF_NOT_ALREADY_PRESENT.
    • PathAliasHelper lets external systems address fields by their Field ID (see: SORMAS Data Dictionary) instead of the full DTO path (e.g. Symptoms.fever instead of CaseData.symptoms.fever).
  • Survey integration (sormas-backend.externalmessage.survey) - AutomaticSurveyResponseProcessor consumes ExternalMessageDtos, resolves the SurveyToken, and feeds the DataPatcher.
  • UI: new views/forms for survey/token management and survey-response details.

The core abstraction (path-based patcher with pluggable mappers, validators and aliases) is reusable beyond ngSurvey.

Fixes #13832

Check at the entity converter that performs lookups which are mocked in tests.
@Pa-Touche Pa-Touche marked this pull request as ready for review May 12, 2026 08:32
@Pa-Touche Pa-Touche requested a review from roldy May 12, 2026 08:32
Comment thread sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java Dismissed
Comment thread sormas-backend/src/main/java/de/symeda/sormas/backend/patch/PatchFieldHelper.java Dismissed
Comment thread sormas-backend/src/test/java/de/symeda/sormas/backend/util/CollectorUtilsTest.java Dismissed
Comment thread sormas-backend/src/test/java/de/symeda/sormas/patch/DataPatcherImplTest.java Dismissed
@Pa-Touche Pa-Touche merged commit a98a4e3 into development May 13, 2026
7 of 8 checks passed
@Pa-Touche Pa-Touche deleted the feat/13832-ngsurvey-integration-external-api branch May 13, 2026 11: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.

External survey tool integration: ngSurvey

3 participants