Skip to content
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

Upload local changed resources using Bundle transaction #1084

Merged
merged 26 commits into from
Feb 25, 2022

Conversation

aditya-07
Copy link
Collaborator

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #1021

Description
Instead of making individual CRUD request for each local change, we would Bundle multiple resources inside a Bundle Transaction.
This PR also mandates for now that all the resources are created on server using Http PUT instead of POST.

Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type
Choose one: Feature

Screenshots (if applicable)

Checklist

  • I have read and acknowledged the Code of conduct
  • I have read How to Contribute
  • I have read the Developer's guide
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally
  • I have built and run the reference app(s) to verify my change fixes the issue and/or does not break the reference app(s)

@aditya-07 aditya-07 added type:enhancement New feature or request FHIR engine labels Jan 27, 2022
@aditya-07 aditya-07 added this to In progress in FHIR engine library via automation Jan 27, 2022
@aditya-07 aditya-07 marked this pull request as draft January 27, 2022 15:26
@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #1084 (a99bfd9) into master (27cfe1f) will decrease coverage by 0.04%.
The diff coverage is 68.46%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1084      +/-   ##
============================================
- Coverage     84.57%   84.53%   -0.05%     
- Complexity      632      646      +14     
============================================
  Files           135      140       +5     
  Lines         10407    10488      +81     
  Branches        787      795       +8     
============================================
+ Hits           8802     8866      +64     
- Misses         1209     1223      +14     
- Partials        396      399       +3     
Impacted Files Coverage Δ
...ava/com/google/android/fhir/impl/FhirEngineImpl.kt 42.00% <24.13%> (-31.34%) ⬇️
...oid/fhir/sync/bundle/TransactionBundleGenerator.kt 77.27% <77.27%> (ø)
.../google/android/fhir/sync/bundle/BundleUploader.kt 77.77% <77.77%> (ø)
...a/com/google/android/fhir/sync/FhirSynchronizer.kt 81.57% <80.00%> (+14.54%) ⬆️
...ndle/HttpVerbBasedBundleEntryComponentGenerator.kt 90.90% <90.90%> (ø)
...android/fhir/db/impl/entities/LocalChangeEntity.kt 100.00% <100.00%> (ø)
...main/java/com/google/android/fhir/sync/Uploader.kt 100.00% <100.00%> (ø)
...ttpVerbBasedBundleEntryComponentImplementations.kt 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27cfe1f...a99bfd9. Read the comment docs.

@aditya-07 aditya-07 marked this pull request as ready for review January 31, 2022 08:50
@aditya-07 aditya-07 force-pushed the ak/bundle-transaction-for-upload branch from 450504d to ef49423 Compare February 4, 2022 11:15
FHIR engine library automation moved this from In progress to Review in progress Feb 14, 2022
Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

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

like the abstraction of the generator much better - thanks @aditya-07 🙏

FHIR engine library automation moved this from Review in progress to Reviewer approved Feb 18, 2022
FHIR engine library automation moved this from Reviewer approved to Review in progress Feb 21, 2022
FHIR engine library automation moved this from Review in progress to Reviewer approved Feb 25, 2022
@aditya-07 aditya-07 enabled auto-merge (squash) February 25, 2022 11:43
@aditya-07 aditya-07 merged commit de92a42 into master Feb 25, 2022
FHIR engine library automation moved this from Reviewer approved to Done Feb 25, 2022
@aditya-07 aditya-07 deleted the ak/bundle-transaction-for-upload branch February 25, 2022 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use Fhir Bundle type transaction for uploading the local changes to the server.
4 participants