Skip to content

delete operation removes element from list #4782

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

Merged
merged 2 commits into from
Apr 28, 2023

Conversation

JasonRoberts-smile
Copy link
Collaborator

When executing a FHIRPatch delete operation on an element in a list, we were not actually removing the element from the list. We were just nulling out all its fields, which would then cause it to be skipped when rendering as JSON, making it look like it was gone. I followed the patterns used by the move operation to actually update the contents of the list.

@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.07 🎉

Comparison is base (2f5ffe7) 81.32% compared to head (a12dc94) 81.39%.

❗ Current head a12dc94 differs from pull request most recent head cb6b0a3. Consider uploading reports for the commit cb6b0a3 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4782      +/-   ##
============================================
+ Coverage     81.32%   81.39%   +0.07%     
- Complexity    23650    24942    +1292     
============================================
  Files          1425     1530     +105     
  Lines         86399    91470    +5071     
  Branches      11677    12264     +587     
============================================
+ Hits          70265    74456    +4191     
- Misses        10947    11583     +636     
- Partials       5187     5431     +244     

see 1482 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@tadgh tadgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Two things:

  1. Missing changelog
  2. This code is pretty hairy, i wouldn't mind seeing 1-2 more tests surrounding delete, maybe with square brackets as one of the code paths indicates?

@JasonRoberts-smile
Copy link
Collaborator Author

Overall looks good. Two things:

  1. Missing changelog
  2. This code is pretty hairy, i wouldn't mind seeing 1-2 more tests surrounding delete, maybe with square brackets as one of the code paths indicates?

Changelog is coming. I also intend to address a few Sonar suggestions before I merge.

The square brackets test already existed. I just had to add an assert to test that the collection actually changes size.

@JasonRoberts-smile JasonRoberts-smile enabled auto-merge (squash) April 27, 2023 23:15
@JasonRoberts-smile JasonRoberts-smile merged commit ae1e740 into master Apr 28, 2023
@JasonRoberts-smile JasonRoberts-smile deleted the jr-20230426-fhir-patch-for-tebra branch April 28, 2023 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants