FHIR Chat · If-None-Exist header and non-ASCI search params · implementers

Stream: implementers

Topic: If-None-Exist header and non-ASCI search params


view this post on Zulip Aleksandr Sorokin (Sep 02 2020 at 18:58):

Аccording to Fhir R4 and earlier versions, for the Conditional Create operation, we shoud use the If-None-Exist header with search parameters. However, non-ASCII characters are prohibited by RFC7230 in header values, see https://tools.ietf.org/html/rfc7230#section-3.2.4 So, conditional create with non-ascii parameters like 'name=Грайм' won't work. We avoid this by using batch/transaction, but it is not convenient for creating single resource. I propose in future versions of standart to abandon the use of the header and use query params in urls as well as conditional delete and update. Another approach is to use base64string encoding in If-None-Exist header.

view this post on Zulip Michele Mottini (Sep 02 2020 at 19:31):

Use a transaction?

view this post on Zulip Aleksandr Sorokin (Sep 02 2020 at 19:33):

Michele Mottini said:

Use a transaction?

https://www.hl7.org/fhir/http.html#transaction

view this post on Zulip Michele Mottini (Sep 02 2020 at 19:37):

Yes, that. If-None-Exist will be inside the bundle, no longer in the header, so without limitations in the character set I guess

view this post on Zulip Aleksandr Sorokin (Sep 02 2020 at 19:42):

Michele Mottini said:

Yes, that. If-None-Exist will be inside the bundle, no longer in the header, so without limitations in the character set I guess

Did you read the full message?
We already avoid this by using transaction, but it is not convenient for creating single resource

view this post on Zulip Grahame Grieve (Sep 02 2020 at 20:11):

non-ASCII characters are prohibited in header values

we certainly overlooked that. :-(

view this post on Zulip Grahame Grieve (Sep 02 2020 at 20:12):

no we didn't. you can URL encode in the headers, like in the URL

view this post on Zulip Michele Mottini (Sep 02 2020 at 20:19):

Did you read the full message?

Clearly I didn't !

view this post on Zulip Aleksandr Sorokin (Sep 02 2020 at 23:15):

Grahame Grieve said:

no we didn't. you can URL encode in the headers, like in the URL

ok, but what are the advantages of using custom header for conditional create?
why can't it be done the same everywhere?

view this post on Zulip Josh Mandel (Sep 02 2020 at 23:22):

I think the point is that it's not custom; it's a standard header.

view this post on Zulip Josh Mandel (Sep 02 2020 at 23:22):

In practice I don't know how important this is :-)

view this post on Zulip Aleksandr Sorokin (Sep 02 2020 at 23:29):

Josh Mandel said:

I think the point is that it's not custom; it's a standard header.

Really? Of course it's standard header because it's defined by fhir standard :)
Due to docs https://www.hl7.org/fhir/http.html#ccreate
HL7 defined extension header "If-None-Exist"

view this post on Zulip Grahame Grieve (Sep 03 2020 at 07:58):

I don't recall whether we discussed using a URL parameter instead

view this post on Zulip Josh Mandel (Sep 03 2020 at 13:19):

@Aleksandr Sorokin you're totally right -- I was thinking about If-None-Match, etc, the etag-based conditionals (https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests). I do think there's benefit in parallelism here, but you're right then we're still inventing something.


Last updated: Apr 12 2022 at 19:14 UTC