-
Notifications
You must be signed in to change notification settings - Fork 341
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
POSTing a Bundle should not append /Bundle to the URL #2100
Comments
This is the transaction I am sending - it's that Bundle on the end of the URL that is objectionable.
Where p is a new Patient This is in order to do Client Assigned IDs.
|
Hi @johnkwaters, What is your question exactly? Is there an issue in our FHIR Client with posting transaction bundles to a /Bundle endpoint? EDIT: I think I get it. You want to perform a transaction, but you are using Please try to use So in your code, that last line should be:
|
The Philips CDR team told me the same thing - a bundle transaction should post to the base path, not /Bundle: |
Yes, the problem is that the /Bundle is not supposed to be on the URL - will try using TransactionAsync (I haven't seen that mentioned anywhere before - the docs could and examples sure could use some more complex non 101 cases!). |
No problem, happy to help. Let me know if |
I guess I am a little confused here...
And looking at the source code for TransactionAsync, I see:
So I already have a TransactionBundle ... with an Update in it - then your code turns the TransactionBundle into.... a TransactionBundle? Seems the only difference is that you then call executeAsync? So would all of this just be the same as:
And the reason I am doing this convoluted call, is that I am trying to do a client assigned ID for the Patient p, and the CDR vendor said I can only do that by create a request that has this form:
The outer part is a POST to the endpoint WITHOUT /Bundle, and inside of it is a PUT for the patient with an ID. |
I can confirm that the change above
generates the request I was looking for:
|
Good! I'll close this issue then :) |
See except from Smile CDR:
If you POST to [baseUrl]/Bundle you are submitting the bundle for storage as-is. In other words, the bundle is stored as a Bundle, and the contents inside aren’t looked at by the server (aside from any validation that is enabled). This mode is generally used to store Bundle resources with Bundle.type values such as document, and collection. In its default configuration, Smile CDR will prohibit storing a Bundle with a type value of transaction or batch as this is generally a sign that the client is attempting to perform the operations described below but with an incorrect request URL.
Naming: This is not a FHIR Transaction, but instead is simply a simple resource create where the resource happens to be a Bundle resource.
If you POST to [baseUrl] and your Bundle has a Bundle.type value of transaction you are performing a FHIR “transaction operation”, meaning that all of the individual resources inside the bundle will be processed. It is also possible to include other REST operations such as searches in this kind of bundle. The processing works as an atomic unit, meaning that if anything fails (e.g. invalid data in an individual element) the entire thing will be rolled back.
Naming: This operation is referred to as a FHIR Transaction operation.
If you POST to [baseUrl] and your Bundle has a Bundle.type value of batch, the same processing as the transaction applies, except that individual operations are executed in individual database transactions, so an individual failure doesn’t cause the entire operation to be rolled back. In this case, the response Bundle returned by the server will include status entries indicating the outome for the individual operations within. Note that the batch operation does require the entire Bundle to be valid FHIR at a minimum. This means that it can’t have non-existent resource types in it, malformed datatypes, etc.
Naming: This operation is referred to as a FHIR Batch operation.
The text was updated successfully, but these errors were encountered: