fix: EventDataValue mapping with idScheme!=UID DHIS2-14968 #19303
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.
Event
dataValue.storedBy
is set on importdhis2-core/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/bundle/persister/EventPersister.java
Line 229 in 9b6d958
This might not always have been the case. At least in SL DB there are
dataValues
without that property in the JSONB.event.eventdatavalues
being JSONB leads to a different query whendataElementIdScheme!=UID
see #19153. This then requires different code to aggregate the rows into the event and itsdataValues
.I defaulted to the empty string using
dataValueJson.getString("storedBy").string("")
which meant it was exported as such. This was different than when requestingidScheme=UID
where nostoredBy
in the DB means nostoredBy
property in the JSON. This PR alignsdataElementIdScheme!=UID
withdataElementIdScheme==UID
.