google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
458 stars 238 forks source link

Expose an interface to db.withtransaction through FhirEngine #2531

Open LZRS opened 2 weeks ago

LZRS commented 2 weeks ago

Is your feature request related to a problem? Please describe. Multiple db operations involving create/update/delete of resources cannot be handled atomically such that when updating and inserting extracted resources due to the action of saving a questionnaire, errors that may occur in between lead to inconsistencies and in some cases duplication when a user actions subsequent retries to save the questionnaire…

Describe the solution you'd like Expose an interface to db.withtransaction through FhirEngine that would allow multiple operations to be grouped and committed as a transaction

Describe alternatives you've considered Grouping using a Bundle resource of type ‘transaction’ that would map the different request types to a db crud method. A concern would be on whether it would respect the order of the operations

Would you like to work on the issue? Yes