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

Support POST based search operations #87

Open
anchita-g opened this issue Feb 2, 2023 · 4 comments
Open

Support POST based search operations #87

anchita-g opened this issue Feb 2, 2023 · 4 comments
Labels
enhancement New feature or request P2:should An issue to be addressed in a quarter or so.

Comments

@anchita-g
Copy link
Collaborator

http://hl7.org/fhir/http.html#search
Add support for POST based search in the existing Access Checkers:

  1. PatientAccessChecker
  2. ListAccessChecker
@bashir2 bashir2 added enhancement New feature or request P2:should An issue to be addressed in a quarter or so. labels Feb 14, 2023
@bashir2
Copy link
Collaborator

bashir2 commented Feb 14, 2023

Marking this as P2 as it would be nice to have this for the Beta launch.

@vivekmittal07
Copy link
Collaborator

Search by POST allows requests of this type (Reference)-

POST [base]/[resource-type]/_search
Content-Type: application/x-www-form-urlencoded
param1=value&...{&_format=[mime-type]}

HAPI doesn't support search by POST. I get 404 error when trying the following curl to HAPI server

curl --location --request POST 'localhost:8080/Patient/_search' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode '_id=3810'

Do we still need to support this feature for Beta ?

@bashir2
Copy link
Collaborator

bashir2 commented Apr 12, 2023

@vivekmittal07 it works for me with a HAPI JPA server. I am guessing that the error is in the URL you are using as it does not have /fhir/ in the path. Here is a sample query that works for me (note the URL path /fhir/Patient/_search):

curl -X POST -H 'Content-Type: application/x-www-form-urlencoded'  \
  --data-urlencode '_id=25949' \
  'http://localhost:8091/fhir/Patient/_search'

@vivekmittal07
Copy link
Collaborator

vivekmittal07 commented Apr 13, 2023

Thanks @bashir2 for verifying this. I made a stupid mistake!

The FHIR path in server was configured as PROXY_TO=<IP>/fhir. So this was adding a /fhir to the outgoing request.
I used the same collection to test Hapi directly and made an error there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2:should An issue to be addressed in a quarter or so.
Projects
None yet
Development

No branches or pull requests

3 participants