-
Notifications
You must be signed in to change notification settings - Fork 1.4k
added undo-replace-references operation #7097
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
Conversation
Formatting check succeeded! |
63b9a65
to
cbed965
Compare
7eae37d
to
f169380
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7097 +/- ##
============================================
+ Coverage 83.41% 83.80% +0.38%
- Complexity 29193 29367 +174
============================================
Files 1843 1803 -40
Lines 113422 113602 +180
Branches 14251 14309 +58
============================================
+ Hits 94608 95201 +593
+ Misses 12730 12290 -440
- Partials 6084 6111 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f169380
to
c54fd1b
Compare
c54fd1b
to
b046d98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, approved
closes: #7101
In this PR
$hapi.fhir.undo-replace-references
. This operationrestores the resources that were updated by a
$hapi.fhir.replace-references
operation to their previous versions.Current limitations:
$hapi.fhir.replace-references
operation was performed.I noticed that replace-references operation was creating a Provenance resource even when no resource was updated, so I added logic to prevent it.
Also added logic for replace-references Provenances to not add a resource reference to the Provenance if patch for that resource was a no-op ( so the resource was't really updated by the operation). This is not likely to happen under normal conditions but just added as a precaution, since we don't want to revert the resource a previous version if that resource wasn't really updated by replace-references.
I refactored the ReplaceReferencesTestHelper by extracting the test data generation and the validation specific to that test data into a separate class called ReplaceReferencesLargeTestData. The reasons for doing this:
a. make tests more efficient: ReplaceReferencesTestHelper is used by various different test suites, including the tests for replace-references, merge and undo-replace-references operations. However not all tests require the large amount of data created by default in this class.
b. increase code maintainability/readability.