Are there any best practices or industry standards when ingesting FHIR resources from another system? More specifically - when multiple healthcare entities using FHIR resources begin sharing data (and wanting to store each other's data within their own system), how should a resource's metadata and ID be handled?
Let's consider one organization has a Patient resource for John Doe. A Practitioner in that system orders a lab (ServiceRequest) and sends that resource to a lab. After the lab is performed, that organization receives the results via a DiagnosticReport and Observation from the 3rd party who performed the test. The metadata (version id, profile, etc.) and ID are going to be referring to that 3rd party, which the ingesting system may not care about.
My gut feeling is the system ingesting those two resources for the lab result would:
- Replace the metadata and identifier with information pertaining to it's own system.
- Transform any attributes based on the profile being used (if different from the 3rd party)
- Store off the 3rd party's identifiers and/or metadata (if needed to be kept for later) elsewhere.
For 3, this could be:
- Resource.identifier contains both the ingesting system's AND 3rd party system's identifier
- Resource.metadata.source moved to an extension indicating the system it originated from.
- References to the Patient in the ingested resource updated to the ingesting system's patient identifier.
Is this the "correct" way to handle persisting external FHIR resources? Or are there other solutions?