FHIR Chat · Bundle Link URL · ibm

Stream: ibm

Topic: Bundle Link URL


view this post on Zulip Sagar Sarvankar (Jan 24 2022 at 17:17):

Hello @Lee Surprenant
When there are many records for a resource, it gives "next" url in the bundle. We have a case as below
"link": [
{
"relation": "self",
"url": "https://fhirserver.justtest.in:9443/fhir-server/api/v4/Observation?_count=10&category=vital-signs&date=gt1940-10-04T00:00:00+00:00&patient=17e77411359-8837d878-ea1e-45b5-bb89-882fdfb2be4b&_page=1"
},
{
"relation": "next",
"url": "https://fhirserver.justtest.in:9443/fhir-server/api/v4/Observation?_count=10&category=vital-signs&date=gt1940-10-04T00:00:00+00:00&patient=17e77411359-8837d878-ea1e-45b5-bb89-882fdfb2be4b&_page=2"
}

Here in the URL, there is "+" sign in the date parameter, and hence the GET on this URL to FHIR server fails saying below
{
"resourceType": "OperationOutcome",
"id": "ac-1f-5-a3-1d80ad82-06d4-41c1-9f6a-2cd2c2ecfc7a",
"issue": [
{
"severity": "fatal",
"code": "invalid",
"details": {
"text": "Invalid Date Time Format found please use 'yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm].'"
},

    }
]

}

Just to test, the moment, I encode, the + sign to make the URL https://fhirserver.justtest.in:9443/fhir-server/api/v4/Observation?_count=10&category=vital-signs&date=gt1940-10-04T00:00:00%2B00:00&patient=17e77411359-8837d878-ea1e-45b5-bb89-882fdfb2be4b&_page=2
it gives me the desired result.

Could you please let me know your thoughts?

Thanks,
Sagar

view this post on Zulip Paul Bastide (Jan 24 2022 at 17:54):

HI Sagar, + is a special case. It also signals a space in URLs. It's best that they be URL Encoded.

view this post on Zulip Sagar Sarvankar (Jan 25 2022 at 05:05):

Hello @Paul Bastide ,
Thank you for your reply.

Here in this case, the + signifies part of the date and is not a space.

In the link https://www.hl7.org/fhir/http.html#paging it says "The links are opaque to the client, have no dictated structure, and only the server understands them. The client must use the server supplied links in order to traverse the pages."

So going by the above information, do you think the IBM FHIR should encode it and send it?

Regards,
Sagar

view this post on Zulip Lee Surprenant (Jan 25 2022 at 12:37):

I'm not sure if we should url-encode the full link url in our responses or not.
I think it might make sense for us to at least encode the datetime values since + is known to cause trouble.
@Paul Bastide agree?
@Sagar Sarvankar care to open an issue for it at https://github.com/IBM/FHIR/issues ?

view this post on Zulip Paul Bastide (Jan 25 2022 at 12:52):

I agree @Lee Surprenant

view this post on Zulip Sagar Sarvankar (Jan 25 2022 at 15:09):

Thank you @Lee Surprenant and @Paul Bastide

Please find the issue created at https://github.com/IBM/FHIR/issues/3245


Last updated: Apr 12 2022 at 19:14 UTC