FHIR Chat · No server URL found, it must be specified as 'iss' or 'fhirS · javascript

Stream: javascript

Topic: No server URL found, it must be specified as 'iss' or 'fhirS


view this post on Zulip Corey Wen (Oct 14 2021 at 16:16):

I am using the FHIR Client JS. T
rying to launch and authorize a SMART on FHIR app, gets the error "Error: No server url found. It must be specified as iss or as fhirServiceUrl parameter".
According to the documentation 'iss' should only be included for a standalone launch; I am trying to get an EHR launch working through the Epic sandbox. I believe I have added my clientId, redirectUri, and scope correctly.

view this post on Zulip Vladimir Ignatov (Oct 14 2021 at 17:08):

In EHR launch the iss parameter will be passed to your launch_uri by Epic. Are you sure you have configured your client (in Epic) correctly?
You should have separate launch_uri page/route which is what Epic will call initially, and a redirect_uri page/route which is where your app actually is.

view this post on Zulip Corey Wen (Oct 14 2021 at 17:56):

Could you describe in more detail how one would check if the client in Epic is configured correctly/what would make a client be configured incorrectly?
As for the launch and redirect page routes, I believe I have those set up correctly as I do have two separate routes.
My app follows the example from the documentation for the React example. I have a Launcher component w/ smart.authorize() which redirects to a route that renders the FhirClientProvider component which has smart.ready()
The smart.authorize seems to fail in the Launcher component and goes into the catch block I added: smart.authorize.catch
The app works with the smarthealthit launcher and Logica sandbox. The situation is the app is launching from an Epic BPA which comes from a CDS service. The CDS card returned has the url for the launcher component of the app (the url is the root path, similar to the example linked)

view this post on Zulip Vladimir Ignatov (Oct 15 2021 at 16:55):

Yes, sorry. I meant that you might have swapped the launch and redirect URLs in your Epic client configuration. If that is not the case, and if it works with the launcher and Logica, then the next logical step would be to debug and see if the app is being passed that iss parameter. If it isn't, then it is some kind of CDS problem.

I have not followed CDS for a while so I don't even remember if CDS Hooks supports EHR launch?

I also can't understand what you mean by "(the url is the root path, similar to the example linked)"

view this post on Zulip Corey Wen (Oct 18 2021 at 18:43):

I believe the launch/redirect URLs are correct in the Epic client configuration.
Could you explain more how one would debug to see if the app is being passed the iss parameter/what one would look for to spot issues? The only error message I am able to get is the 'No server URL found, it must be specified as 'iss' or 'fhirServiceUrl'. I am unable to open developer tools to look at any console.log statements as developer tools are disabled in the window the app opens in.
I believe CDS hooks supports EHR launch as I had done some testing in the CDS sandbox with a card that launches the app.
What I mean by "(the url is the root path, similar to the example linked)" is the app's launch path is something like my-app.com and the redirect is to `my-app.com/the-app'.

view this post on Zulip Vladimir Ignatov (Oct 19 2021 at 15:12):

In your launch endpoint:

  • You can comment out the authorize call so that it does not redirect and then look at the URL.
  • If you don't see the url either, then you can add alert(location.href) before authorize is called.

Last updated: Apr 12 2022 at 19:14 UTC