Skip to content

fix(rest): create ignores the client-supplied id, per spec - #707

Merged
smunini merged 2 commits into
mainfrom
fix/647-post-server-ids
Aug 26, 2026
Merged

fix(rest): create ignores the client-supplied id, per spec#707
smunini merged 2 commits into
mainfrom
fix/647-post-server-ids

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Closes #647.

Per http.html#create "the server ignores the id provided in the resource" and assigns its own. HFS honored the client id and answered 409 on reuse, which failed whole Synthea transaction bundles: consecutive patient bundles repeat shared Organizations/Practitioners under fixed ids as plain POST entries, so the first bundle committed and every later one refused (found in #448's transaction leg — 1 of 10 sample bundles).

Where the strip lives: the REST boundary — create_handler and parse_bundle_entry (the one parser both batch and transaction go through), so it covers direct POSTs and bundle POST entries on every backend in one place. The storage create contract is deliberately untouched: spec conformance seeding relies on caller-supplied ids + AlreadyExists for its idempotency and goes straight to storage.

Of the two options the issue offered (spec behavior vs. documented deviation), this takes the spec: a FHIR server that 409s standard transaction ingestion is the worse deviation, and anyone relying on client-assigned ids has PUT — which keeps update-or-create semantics unchanged.

Tests (create_client_id.rs): the exact POST that used to 409 now answers 201 twice with distinct server ids and nothing stored under the client id; and two consecutive transactions repeating the same fixed-id Organization both commit. Full helios-rest targeted tests green locally.

Per http.html#create the server ignores the id provided in the resource
and assigns its own. Honoring it made a second POST of the same document
answer 409, which failed whole Synthea transaction bundles - consecutive
patient bundles repeat shared Organizations/Practitioners under fixed
ids as plain POST entries, so the first bundle committed and every later
one refused (#448's transaction leg, 1 of 10 sample bundles).

The strip happens at the REST boundary - create_handler and the one
bundle-entry parser both batch and transaction go through - so the
storage create contract is untouched: spec conformance seeding relies
on caller-supplied ids and AlreadyExists for its idempotency, and goes
straight to storage.

Closes #647
Main carries two ten-argument mount_with_conformance_source sites whose
fixes ride the unmerged UI PRs; this branch needs them compiling now.
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@smunini
smunini merged commit 6b9b497 into main Aug 26, 2026
25 checks passed
@smunini
smunini deleted the fix/647-post-server-ids branch August 26, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rest: create (POST) honors the client-supplied resource id and 409s on reuse

2 participants