-
Notifications
You must be signed in to change notification settings - Fork 32
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
Added POST search capability for prefetch queries with long URLs #155
Added POST search capability for prefetch queries with long URLs #155
Conversation
This is usually handled by the receiving FHIR server when the URL is too long, but not always.
@jmandel Please review when possible. Thanks! |
Thanks! Could you include in the discussion here an explanation of what the problem is, where you've encountered it, and what the fix is? (Generally a FHIR server can support queries via GET, POST, or both... but a client needs to choose a server-supported method.) |
@jmandel Absolutely. The issue stems from prefetch templates that result in long urls that are not supported through GET requests. For example, navigate to the following scenario: When you click the I am happy to employ a better solution! Please let me know if you have any questions or concerns. Thanks! |
Thanks -- that explanation (and the deep link to reproduce!) are extremely helpful. Your approach here works fine, but I'm slightly concerned about the separation of responsibilities. Ultimately the CDS Hooks Sandbox is configured "to act as if" it was associated with a given FHIR endpoint, and it uses that FHIR endpoint to prepare prefetch responses for CDS Clients. The Different FHIR endpoints might have different behaviors. For example, https://opioid-sandbox.cqframework.org/cdc/opioid-cds-r4/ehr/fhir supports POST for any size of request, and supports GET for "short enough" requests. But another server might support only POST, and another server might support only GET. So if it makes sense to you, I'd rather direct the Sandbox more explicitly, e.g. with something like |
…sing GET when POST results in an error
@jmandel Thank you for the feedback! I agree that your approach makes more sense. I have updated the prefetch resolution to attempt search by POST first and then by GET if that results in an error. I will look to add a param to specify the strategy more explicitly in future PRs. I believe what I have implemented should serve well as default behavior. |
This is usually handled by the receiving FHIR server when the URL is too long, but not always.