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

/Patient/nonexistentid/$everything returns 200 #7

Open
0xmichalis opened this issue Oct 13, 2019 · 1 comment
Open

/Patient/nonexistentid/$everything returns 200 #7

0xmichalis opened this issue Oct 13, 2019 · 1 comment

Comments

@0xmichalis
Copy link

0xmichalis commented Oct 13, 2019

When querying a non-existent ID with the patient ID as the last part of the path, 404 is returned correctly but when $everything is added in the end, 200 is returned instead of 404.

$ curl -vvv localhost:3001/Patient/X32824200X
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3001 (#0)
> GET /Patient/X32824200X HTTP/1.1
> Host: localhost:3001
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Vary: Origin
< X-Mutex-Used: 0
< Date: Sun, 13 Oct 2019 20:05:38 GMT
< Content-Length: 0
< 
* Connection #0 to host localhost left intact

$ curl -vvv localhost:3001/Patient/X32824200X/\$everything
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3001 (#0)
> GET /Patient/X32824200X/$everything HTTP/1.1
> Host: localhost:3001
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: application/fhir+json; charset=utf-8
< Vary: Origin
< X-Mutex-Used: 0
< Date: Sun, 13 Oct 2019 20:06:05 GMT
< Content-Length: 378
< 
* Connection #0 to host localhost left intact
{"resourceType":"Bundle","meta":{"lastUpdated":"2019-10-13T20:06:05Z"},"type":"searchset","id":"5da383adfeec7576da2c0455","link":[{"relation":"self","url":"http://localhost:3001/Patient?_id=X32824200X&_offset=0&_count=100&_include=%2A&_revinclude=%2A"},{"relation":"first","url":"http://localhost:3001/Patient?_id=X32824200X&_offset=0&_count=100&_include=%2A&_revinclude=%2A"}]}

server log:

[GIN] 2019/10/13 - 20:05:44 | 404 |       7.187µs |      172.17.0.1 | GET      /Patient/X32824200X
[GIN] 2019/10/13 - 20:06:05 | 200 |    9.484635ms |      172.17.0.1 | GET      /Patient/X32824200X/$everything
@eug48
Copy link
Owner

eug48 commented Oct 14, 2019

I can't see the FHIR specification definitively stating that 404 should be returned, so your code probably shouldn't rely on a 404 (http://www.hl7.org/fhir/patient-operation-everything.html). However I'd be happy to match HAPI's behaviour of returning a 404. A patch would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants