You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If I do an upload of a transaction bundle with conditional creates twice, I expect that the second upload will return a status of 200 OK. That is true for the Device and Patient resources, but not for the Observation. All the conditional create options for the 'ifNoneExist' use the identifier.
Upload the attached transaction bundle on the R4 version. TransactionBundle.txt
Upload the same bundle again.
Only one of the resources on the second upload should result in a 201 create, but all the Observations are recreated. One can then go to the server and do a search on the very identifier used and you will get multiple duplicates of the Observations.
For example the identifier here:
I spent some time staring at this pondering how it could possibly not work, given that conditional creates are really basic and used all the time. Eventually it hit me: The issue is this part of the ID: 444+0800
It's completely fine to have a plus symbol in an identifier, but of course when you create the IfNoneExist expression, it's a URL and it needs to be URL encoded. And wouldnt you know it, a + translates to a space character when we unescape the URL.
So the solution is to escape the + in your URL.
I am gonna leave this ticket open though- I think it would be reasonable for HAPI FHIR to be lenient here and not unescape plus symbols. I can't imagine a situation where someone would actually want a space character in their URL and intentionally put a plus symbol there to represent it. Or at least it seems way less likely than the opposite...