You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Right now, we have a problem adding multiple activities to the CarePlan. The issue lies in the Json Patch. It's giving us the same path for each activity in the patch file. When the changes are merged, the system compares them based on the path in this file.associateBy { it.optString("op") to it.optString("path") }. This causes it to pick only one activity that's being updated, resulting in the server returning a CarePlan with just one added activity.
After investigating the Json Patch further, it seems there are problems with it, causing it to return the wrong patch. json-patch
Component
Fhir Engine
To Reproduce
Steps to reproduce the behavior:
Open an existing CarePlan in app (already in sync with server)
Update it to add 2 or more Task activities to the CarePlan, to generate LocalChange for the CarePlan
Sync to server, only the last task activity in the Careplan gets synced
This issue is also causing household members to disappear when syncing.
The same line of code @evance-mose pointed out causes add patch operations performed on the same Group.member resource to disappear. This is because having the key of the hashmap be a non unique value (i.e the op) causes the overwrite
Describe the bug
Right now, we have a problem adding multiple activities to the CarePlan. The issue lies in the Json Patch. It's giving us the same path for each activity in the patch file. When the changes are merged, the system compares them based on the path in this file
.associateBy { it.optString("op") to it.optString("path") }
. This causes it to pick only one activity that's being updated, resulting in the server returning a CarePlan with just one added activity.After investigating the Json Patch further, it seems there are problems with it, causing it to return the wrong patch. json-patch
Component
Fhir Engine
To Reproduce
Steps to reproduce the behavior:
Additional context
Patch File - LocalChange payload
Local CarePlan.
local-careplan.json
Remote CarePlan
remote-careplan.json
Would you like to work on the issue?
yes, @LZRS and @evance-mose
cc @KhumboLihonga
The text was updated successfully, but these errors were encountered: