-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FhirPatch diff treats a simultaneous add/delete as an update #5513
Comments
The issue described is hard to solve i think, however we have a similar situation with a different case where not last item in an array was deleted (e.g. we have 3 CarePlan Activities and remove second) and hence it shows us 1 deletion (of last item) and 2 modifications of second to last item (as code and status differs). I think that the diff operation should identify which element of an array has been deleted not by simply checking which list is larger, but instead compare array elements by equalsDeep, to identify, which one was deleted, exclude them from further checks and only then check modifications. |
hapi-fhir/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/patch/FhirPatch.java
Lines 508 to 548 in e15d043
Array element comparison has the following assumptions:
Because of this a simultaneous insert + delete is treated as an update, and the same with reordering array elements
The text was updated successfully, but these errors were encountered: