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

Encode the datetime values in the bundle.Link.URL in the resource #3245

Closed
sagarsarvankar opened this issue Jan 25, 2022 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@sagarsarvankar
Copy link

sagarsarvankar commented Jan 25, 2022

Describe the bug
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].'"
},}]}

Environment
4.10.1

To Reproduce
Steps to reproduce the behavior:

  1. search with a timestamp that include timezone offset
  2. check the self url

Expected behavior
The returned URL after encoding should look like 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
where + is replaced with %2B

More details are located at 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."

Also, there was a discussion in the chat and is available at https://chat.fhir.org/#narrow/stream/212434-ibm/topic/Bundle.20Link.20URL

@sagarsarvankar sagarsarvankar added the bug Something isn't working label Jan 25, 2022
prb112 added a commit that referenced this issue Jan 25, 2022
@prb112 prb112 self-assigned this Jan 25, 2022
lmsurpre pushed a commit that referenced this issue Jan 26, 2022
… (#3246)

* Encode the datetime values in the bundle.Link.URL in the resource #3245

Signed-off-by: Paul Bastide <[email protected]>

* Update per code review - adds an integration test to confirm no '+' sign is included in the timezone

Signed-off-by: Paul Bastide <[email protected]>

* Update copyright

Signed-off-by: Paul Bastide <[email protected]>
@tbieste
Copy link
Contributor

tbieste commented Feb 1, 2022

I verified that each '+' in the link URLs are encoded as %2B.

@tbieste tbieste closed this as completed Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants