fix: /events?dataElementIdScheme!=UID for shared data elements DHIS2-14968 #19291
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.
added in #19153
The issue was that if two events like
blZxytttTqq
andehxNi0D67uQ
in the SL DB havedataValues
for the same data element only one of the events would be exported with that dataValue/element.Example DB
eventdatavalues
JSONB column forblZxytttTqq
andehxNi0D67uQ
I made the mistake of assuming I can aggregate event
dataValues
like we do notes in theResultSetExtractor
of theJdbcEventStore
.dhis2-core/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/event/JdbcEventStore.java
Line 290 in 34c2cff
That works for notes as they are kept in the set using their note uids which are unique across events. For
dataValues/Elements
we obviously need aSet
scoped per event as multiple events can have a value for the same data element 🤦🏻 .