Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundle of type transaction fails to create resources [enhancement] #149

Closed
citizenrich opened this issue Jun 9, 2018 · 3 comments
Closed

Comments

@citizenrich
Copy link

tl;dr Bundles of type transaction sent to Hearth with a POST will fail. I realized bundle transactions may or may not be supported by servers, or I made a mistake but this does work on http://fhirtest.uhn.ca/baseDstu3/

Reproduction:

  • Generate synthea fake record.
  • Modify the type to be transaction.
  • Add POST method and URL to each resource under entry.
    POST to Hearth.

Error: 'Specifying an id is not allowed on a create action'

@rcrichton
Copy link
Member

Hey Richard, transactions should work, we have used them before in other work. It looks like it is rejecting this because an id field already exists on the resources, we don't support supplying your own ids when creating resources which is causing the issue - https://github.com/jembi/hearth/blob/master/lib/fhir/core.js#L358

@citizenrich
Copy link
Author

I can see bundles for batching working, but not really bundles for transactions. The use case is preserving the references between resources in a bundle that is submitted to the server for creation. In order to do that it requires that there be IDs already. The server may replace every ID (as it should control its own namespace), but at least the references remain. Is there another way I can submit a transaction (not batch) bundle but retain the relationships between resources?

@citizenrich
Copy link
Author

Closing as stale.

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

No branches or pull requests

2 participants