FHIR REST API: Synchronizing Specific FHIR-Resource with Challenges in Nested references

102 Views Asked by At

I'm working on a program what synchronizes FHIR resources in a heavy load, using the REST API. I specifically aiming to retrieve creation and updates to a specific resource based on the lastUpdated element. While I’m able to do the synchronization part, I'm running into challenges when dealing with nested links, especially when a resource, like a MedicationRequest, refers to another resource, like a Patient and this has again references to other Resources and so on. This creates a potentially complex chain of linked resources. What also raises the question what is a "valid" Transaction-Bundle in regards to the data in the bundle. Thinking of sending this bundle to an empty FHIR-Server. Like all references must be resolved by the actual resources?! How can I efficiently handle deeply nested resources when synchronizing data, considering the potential circular dependencies or excessive data retrieval? I found the iterate function, what gives me the possibility to give me the Resources of referenced Resources. But i need to do this by hand. Like saying there will be this Resource typ. E.g.:

FHIRBASE/MedicationRequest?_lastUpdated=ge2023-11-20&_include=*&_include:iterate=Encounter:*&_include:iterate=Patient:*&_include:iterate=Medication:*

E.g. with this option i dont get e.g. the Device of a possible linked Condition in an Encounter.

Are there best practices or recommended approaches for addressing this issue in FHIR?

1

There are 1 best solutions below

0
On

I think, just wildcard the iteration could be the solution:

FHIRBASE/MedicationRequest?_lastUpdated=ge2023-11-20&_include:iterate=*

I did not check how deep this will go.