I have a very basic question. When creating a single resource ( say Patient ), I call POST REST API without the id property ( which is generated by the server ). If I need to add a “transaction” bundle with related resources ( for example Encounter with subject patient and related Account resource etc. ) how can I add it by not specifying Ids that are mapped?
I think I answered my own question. If I create a single resource the server does not allow me to put an ID and generates it. But when I create a bundle, it does allow me to put matching Ids to create an entire bundle.
.id is always generated by a FHIR Server. You can put id into the resource only when you do PUT operation which means you update existing resource with existing id.
When you submit a bundle you can put referencing ids to tell the FHIR Server how to associate the resoruces after submision. For example, you need to give Condition a link on Patient when you submit both resoruces in a bundle. But in this case ids still will be generated by the FHIR Server after submission.