feat: replace semantics for ADE [DHIS2-16851]#22973
Merged
Conversation
|
david-mackessy
approved these changes
Feb 25, 2026
vietnguyen
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds the deletion scope to the ADE.
To allow specifying the scope the old
DataValueSetbased analytics result needed to be replaced withDataEntryGroup(internal ADE) andDataExportGroup(external ADE).Mentions
Renames
I also realized that
DataEntryKeywas not specific to data entry so it got renamed toDataValueKey.Later I then found I didn't need it in context of this PR anyhow.
Validation
Inputs are more strictly validated
IdPropertyinstead ofStringfor input and output schemasSourceRequestare of the same period typeValue Normalization
Since analytics exports even integer types as floating point values with
.0I added a normalizationto data entry that will erase this because otherwise such values would be rejected.
Fixes
nullas default COC is now correctly validated when checked the DE-COC is valid for the target DS.Manual Testing
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.