-
Notifications
You must be signed in to change notification settings - Fork 37
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 Returning Response Headers from FHIR Calls #181
Comments
Hi @jtilles-xealth -- You should be able to access the headers with the method httpFor on the client object: Let us know if this solves your problem, Vicki |
We tried playing around with this and found httpFor() from fhir-kit-client didn’t return headers. The screenshot showed the raw response object after calling httpFor , we renamed it responseFromFhirClient in the attached log. From what we can see, it only consists of {size, timeout} fields. This was after making a Patient.read call, per httpFor() documentation:
We traced it back to where the raw response was returned from fetch call in fhir-kit-client: fhir-kit-client/lib/http-client.js Line 172 in b13c62d
Not sure if there is something we are missing here? We don’t even get the usual headers for a Patient Read call, such as ‘x-request-id’. For our actual use case, the exact header we are trying to get is returned from the EHR after making a Create call, where the EHR returns the FHIR ID of the created resource in the Location response header. Example from Postman call below: |
@jtilles-xealth - here is a codesandbox that demonstrates it working with cerner's sandbox (see right-hand panel for output) https://bit.ly/3zwiiAK -- there was a problem with the types, so note this is using a new version I just published 1.9.2. |
Closing due to lack of responses, reopen if needed |
I'd like to reopen this.
This works fine to e.g. extract resourceId from the location header when the request is successful, but when I've formatted my fhirPractitionerBody incorrectly (e.g. having an empty string in an address line), the create call, instead of returning the 400 response, throws an exception. |
Expected Behavior
Caller able to access response headers returned by a FHIR Server (e.g. Location Header returned from a Create Call which received a 201 success response). Verified response headers are received from server when making call via Postman, but unable to access via FHIR-Kit-Client
Actual Behavior
Caller unable to access response headers using FHIR-Kit-Client library.
Steps to Reproduce the Problem
Specifications
Source of issue appears to be in the following file from ~L172-177
fhir-kit-client/lib/http-client.js
Line 172 in b13c62d
The text was updated successfully, but these errors were encountered: