Skip to content

feat: replace semantics for ADE [DHIS2-16851]#22973

Merged
jbee merged 16 commits intomasterfrom
DHIS2-16851-take2
Feb 26, 2026
Merged

feat: replace semantics for ADE [DHIS2-16851]#22973
jbee merged 16 commits intomasterfrom
DHIS2-16851-take2

Conversation

@jbee
Copy link
Contributor

@jbee jbee commented Feb 16, 2026

Summary

Adds the deletion scope to the ADE.

To allow specifying the scope the old DataValueSet based analytics result needed to be replaced with DataEntryGroup (internal ADE) and DataExportGroup (external ADE).

Mentions

Renames
I also realized that DataEntryKey was not specific to data entry so it got renamed to DataValueKey.
Later I then found I didn't need it in context of this PR anyhow.

Validation
Inputs are more strictly validated

  • use IdProperty instead of String for input and output schemas
  • validate all periods of a SourceRequest are of the same period type

Value Normalization
Since analytics exports even integer types as floating point values with .0 I added a normalization
to data entry that will erase this because otherwise such values would be rejected.

Fixes

  • null as default COC is now correctly validated when checked the DE-COC is valid for the target DS.

Manual Testing

  • goto app management and install the data exchange app
  • goto data administration app and run analytics
  • open data exchange app as superuser
  • there should be an exchange showing preview data now
  • press the button to perform the exchange at the bottom
  • confirm the result numbers match the preview table shown

Automatic Testing

Existing tests were adjusted.
This usually meant to simplify the setup since it otherwise would not lead to valid data entry.
Before ADE would not be properly be piped though data entry allowing broken data to get into the table.

Design Issues

ATM the ADE on the source side allows to use the full extent of what analytics can understand and export.
This however often is in conflict what is valid or understandable by the target.

For example, analytics allows to use OU sources other than OUs, like OU levels, OU groups or programs. While this seems handy at first it is in conflict with how DS limit the scope of data entry to an explicit list of OUs. If anything other than explicit lists are used on the source side the relation easily breaks as those sets change.

Another example are using DE as source that do not use default COC in the source.
For an internal exchange this cannot work as the target DE is the same as the source but assuming default COC (since the analytics result is the aggregate/total of the disaggregation) which then leads to validation errors in data entry as the default COC is not useable with the DE.
While in theory a disaggregated DE could be exchanged with an external target where the total is tracked using the DE that on the source is the disaggregation this obviously is not a good idea as it will be very confusing using the same DE for two different things on source and target.

@jbee jbee self-assigned this Feb 16, 2026
@jbee jbee marked this pull request as ready for review February 25, 2026 14:55
@sonarqubecloud
Copy link

@jbee jbee merged commit 8befcb6 into master Feb 26, 2026
16 checks passed
@jbee jbee deleted the DHIS2-16851-take2 branch February 26, 2026 07:36
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.

3 participants