LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
330 stars 157 forks source link

Bundle validation for duplicate resources should be done #3453

Open d0roppe opened 2 years ago

d0roppe commented 2 years ago

Is your feature request related to a problem? Please describe. when working with a transaction or batch bundle we should validate that resources are not duplicated in the same bundle like more than 1 update to the same resource. or a update and a delete to the same resource. we should stop that before we start processing the bundle.

Describe the solution you'd like A message should be issued if you reference a resource more than 1 time in the same bundle, and it should be at validation stage before we start processing the bundle

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Acceptance Criteria

  1. GIVEN [a precondition] AND [another precondition] WHEN [test step] AND [test step] THEN [verification step] AND [verification step]

Additional context From https://hl7.org/fhir/bundle.html#bundle-unique

When processing batches and transactions, it is at server discretion how to behave if multiple versions of a single resource are present.

lmsurpre commented 2 years ago

an edge case for this one might be a conditional create/update/delete where the search resolves to the same resource

lmsurpre commented 2 years ago

team decision: lets do this one JUST FOR TRANSACTION (and leave batch processing alone)