Search by duplicated _id parameter

Does it make sense to provide array as _id parameter? For example:
GET [base]/Patient?_id=[23,45,67]
As a result server would return bundle with Patients with given ids. Is it correct with FHIR specification?

You don’t need the square brackets. The comma is an “or” operator for the search part of the FHIR API. See the bit on composite search parameters.

1 Like

Thanks for your response.
One more question - what about conditional update? Does it make sense to use multiple values of _id?
PUT [base]/Patient?_id=23,45,67
And what about rules described in conditional update section regarding usage of provided resourceId in case of missing resource.

No matches, id provided : The server treats the interaction as an Update as Create interaction

According to Update as Create server allows client to define resourceId (in this case value of _id parameter should be used as id for new resource). If multiple resourceIds are provide which one should I use as id for new resource?

If you’re doing a PUT, it would normally be PUT [base]/Patient/23 - you wouldn’t use conditional update if you’ve already got a resource id. Conditional update is for when you don’t have a resource id but instead have a set of search criteria that should resolve to a single resource instance based on the rules of the system. E.g. PUT [base]/Patient?identifer=http://myhospital.com/patientmrn|1234567890.

For conditional update to work, the search would need to resolve to exactly one resource.

Does it mean that I shouldn’t handle _id parameter in conditional update?

If you have an id, you don’t need to do conditional update at all.