Closed msohaib308 closed 1 week ago
The client does NOT support XML but it sends and accept: application/json
header on each request to tell the server how to respond. This seems to work fine with your server.
As the screenshot shows, the problem is not there. You just need to configure / modify your FHIR server to support CORS.
Issue is the XML response type
Anyway if i can handle on client side Because FHIR server is owned by third party
If you try loading those URLs in a browser window you will get back XML. That is because browsers send some accept headers by default. Otherwise you would get JSON, even if you don't send any accept header. Don't let that trick you into thinking that XML is the issue - in this case what you see is not what you get :)
Every FHIR server MUST support CORS. Otherwise it would be unusable (even if you didn't need to authenticate). You can't work around this from the client side and that is exactly the point of CORS - clients should be rejected unless server admins say they shouldn't.
Your only choice is to let them know that CORS must be enabled and perhaps send them that screenshot for reference.
Is this resolve? @msohaib308 Can you please guide me on this?
Hy @zamananjum0
Issue is not resolved yet however they suggested to try implementation on backend side Below is the email that i got from ECW Team
Did the 21st Century Act require SMART on FHIR apps by EHRs for EHR-launch require it to be browser-based? Like is this allowable behavior that eCW can argue CORS whitelisting as an "enhancement request" if @vlad-ignatov is stating it's a requirement for SMART on FHIR to function and push us to do (3). @msohaib308 - how did you end up resolving this?
I see that they have added CORS now, so this can be closed.
I am having XML response issue
fhirClient is expecting JSON format but fhir server is returning XML here is the fhir server URLs
https://staging-fhir.ecwcloud.com/fhir/r4/FFBJCD/metadata https://staging-fhir.ecwcloud.com/fhir/r4/FFBJCD/.well-known/smart-configuration
Fhir server provide extra query parameter "_format=json" to get JSON response, this option is only for metadata but they did not provide this option for "smart-configuration" end point
I don't know how to set this ("_format=json" ) configuration in fhirCLient Library.
https://staging-fhir.ecwcloud.com/fhir/r4/FFBJCD/metadata?_format=json
Is there any option to accept XML responses