rabbit_rabbit
09/15/2026, 5:27 PMreshma
09/15/2026, 5:43 PMurn:uuid: fullUrls. Within one bundle, any
reference to urn:uuid:<your-id> resolves to the resource that entry creates, so you can
build a Patient, an Encounter and three Observations on device, wire them to each other
with your own IDs, and post the whole graph in one request. The server assigns the real IDs
and returns them in the response bundle, so the reference juggling happens server side
rather than in your app.
https://www.medplum.com/docs/fhir-datastore/fhir-batch-requests#internal-references
2. For replays, put a stable business identifier on each resource and set ifNoneExist on
the entry. A resubmitted bundle no-ops instead of duplicating, which is the case you hit
when a phone retries on a flaky connection.
https://www.medplum.com/docs/fhir-datastore/fhir-batch-requests#conditional-batch-actions
3. For links to resources that already exist on the server, you can write the reference as a
search instead of an ID, for example {"reference": "Patient?identifier=http://yoursystem|12345"},
resolved at write time. It has to match exactly one resource.
https://www.medplum.com/docs/fhir-datastore/fhir-batch-requests#external-conditional-references