feat: Add collectInOrgUnitGroups to Expression [DHIS2-21245]#97
Merged
enricocolasante merged 1 commit intomainfrom Apr 9, 2026
Merged
feat: Add collectInOrgUnitGroups to Expression [DHIS2-21245]#97enricocolasante merged 1 commit intomainfrom
enricocolasante merged 1 commit intomainfrom
Conversation
dcf46f2 to
be6074e
Compare
|
jbee
approved these changes
Apr 9, 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 a new method to extract org unit group identifiers referenced in expressions via
d2:inOrgUnitGroup(...)calls.This is needed by rule-engine clients to load all and only the needed orgUnitGroup members of the orgUnitGroup(s) referenced by the program rules.
Changes
New public API
Expression.collectInOrgUnitGroups(): Set<String>— returns the set of org unit group names/UIDs found as string arguments to alld2:inOrgUnitGroup(...)calls in the expression.ExpressionJs.collectInOrgUnitGroups(): Array<String>— JS binding for the above.Internal
Api.collectFunctionStringArguments(root, function, argIndex)— generic internal helper that aggregates string arguments at a given position from all calls to a named function in the AST. Implemented usingNode.aggregatewith aFUNCTIONnode filter.