LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
330 stars 157 forks source link

Refactor payload persistence to its own visitor in Bundle processing #3145

Closed punktilious closed 2 years ago

punktilious commented 2 years ago

Describe the bug Currently the payload persistence step is invoked within the FHIRRestInteractionVisitorReferenceMapping visitor, which is the last time the resource is modified and therefore the first opportunity to store the payload.

This, is a little obscure. It could be much clearer (with probably very little performance impact) to loop through the Bundle entries again to perform the offload in a dedicated visitor. This would only need to be done if offload were enabled - which requires a FHIRPersistence method to support this check.

Environment Which version of IBM FHIR Server? main

lmsurpre commented 2 years ago

QA for this will be included with the QA for 3293: https://github.com/IBM/FHIR/issues/3293#issuecomment-1046986301