feat: REGISTRATION_OU for events and enrollments (DHIS2-21980) - #24971
Open
luciano-fiandesio wants to merge 13 commits into
Open
feat: REGISTRATION_OU for events and enrollments (DHIS2-21980)#24971luciano-fiandesio wants to merge 13 commits into
luciano-fiandesio wants to merge 13 commits into
Conversation
luciano-fiandesio
force-pushed
the
DHIS2-21980-REGISTRATION-OU-EVENTS-ENROLLMENTS
branch
3 times, most recently
from
August 31, 2026 08:39
0a1eab2 to
5b8b3a3
Compare
luciano-fiandesio
marked this pull request as ready for review
September 1, 2026 07:55
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #24971 +/- ##
=============================================
+ Coverage 28.05% 65.19% +37.13%
- Complexity 149 688 +539
=============================================
Files 3742 3744 +2
Lines 145824 146027 +203
Branches 16979 17001 +22
=============================================
+ Hits 40917 95196 +54279
+ Misses 100787 43079 -57708
- Partials 4120 7752 +3632
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2119 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Instance deployed to https://dev.im.dhis2.org/pr-24971 |
…entVisualization (DHIS2-21980)
luciano-fiandesio
force-pushed
the
DHIS2-21980-REGISTRATION-OU-EVENTS-ENROLLMENTS
branch
from
September 3, 2026 09:23
c6ba0df to
8a5a50a
Compare
|
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
REGISTRATION_OUbecomes a new org-unit dimension and filter on all fourtracker-analytics endpoints (
/analytics/events/query,/analytics/events/aggregate,/analytics/enrollments/query,/analytics/enrollments/aggregate), so clients can select or group by the org unit where the tracked entity was registered.The implementation resolves request items through the existing
oudimension pipeline(
USER_ORGUNIT*,LEVEL-n,OU_GROUP-uidall work), stores them in dedicatedEventQueryParamsfields, and produce SQL against a second, independently aliased join ofanalytics_rs_orgunitstructure(regous, next toousandenrl). Matching is always at or below, aggregate always return one row per requested org unit.Files to review
RegistrationOuSqlFragments.javacontains SQL builders: join,uidlevelNpredicate, uid/name projections.RegistrationOuSqlCoordinator.javaorchestrates join/where/select for both analytics types;RegistrationOuSqlConstants.javacontains aliasregous, struct table,DIMENSION_NAME.EventQueryParams.javaNew fields +hasRegistrationOuDimension(),hasRegistrationOuRestriction(),hasRegistrationOuAggregateColumn().DefaultEventDataQueryService.javamain logic for resolving the Registration ouresolveRegistrationOuColumnHeader,HeaderHelper,MetadataItemsHandler.javaGrid response management