How to access cerner fhir smart app from outside webapplication

640 views
Skip to first unread message

thiyagu83.j

unread,
Dec 3, 2019, 6:57:03 AM12/3/19
to Cerner FHIR Developers
Hi,
I created an App in cerner code and i can view the sample patient information through begin test.
Now iam having two html pages launch.html and index.html to view the patient information through the web pages.
In the launch page i provide the app client id with the scope in the authorize script(FHIR.oauth2.authorize({}) ).
In the index page, i used the script(extractData,drawVisualization(p)) to view the patient information.

I tried to access the launch page url from the browser as(https://username.github.io/myApp/launch.html). The loading icon is displaying and no changes. I can saw the error("Cannot read property 'substr' of undefined" in  fhir-client.js) in console.

Need help!.

How to access the cerner SMART on FHIR app from outside?

Benjamin Eichhorn (Cerner)

unread,
Dec 3, 2019, 9:14:11 AM12/3/19
to Cerner FHIR Developers
Hi,

Are you attempting to simply access that URL or are you launching the app from the code Portal?

Thanks,
Ben (Cerner)

thiyagu83.j

unread,
Dec 4, 2019, 12:27:28 AM12/4/19
to Cerner FHIR Developers
We have an web application(nodejs based). We need to pull the patient records from EHR server using patient Name/MRN/Id and display the information in our web application. 

Our client suggest to use Cerner SMART FHIR. 

Can you please tell shall we achieve our requirement using Cerner SMART FHIR? If yes, Can you please provide more details.

Please also suggest, if there are any other methods.  

Benjamin Eichhorn (Cerner)

unread,
Dec 4, 2019, 9:45:23 AM12/4/19
to Cerner FHIR Developers
Hi,

I would suggest you take a look at our extensive documentation located on https://fhir.cerner.com/ and as well take a look through our SMART on FHIR tutorial https://engineering.cerner.com/smart-on-fhir-tutorial/ if this is your first time building an app. These should all answer most of the questions you have.

Thanks,
Ben (Cerner)

thiyagu83.j

unread,
Dec 5, 2019, 12:19:56 AM12/5/19
to Cerner FHIR Developers
Benjamin,
Thanks for your information. We have followed the tutorial and created SMART on FHIR APP. We can able to access the patient information within the cerner launchpad(through "Begin test") . We tried to acces the app from browser(outside from cerner launchpad) by directly access the url(http://censwteam.github.io/VolkSaas/launchnew.html). But it prompts error as "fhirServiceUrl" was undefined. 
1) How to run the URL directly(without cerner launchpad) from the browser?
Thanks,
thiyagu

thiyagarajan jagan

unread,
Dec 5, 2019, 11:18:15 PM12/5/19
to cerner-fhir...@googlegroups.com
Benjamin,
Can you please help me.

Regards,
Thiyagu.

--
You received this message because you are subscribed to the Google Groups "Cerner FHIR Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cerner-fhir-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cerner-fhir-developers/a2500142-b82f-42bf-afdc-f39b06a2de48%40googlegroups.com.

thiyagu83.j

unread,
Dec 6, 2019, 12:31:34 AM12/6/19
to Cerner FHIR Developers
Benjamin,

Iam trying to access the SMART on FHIR App from outside the launchpad.
If i access the launch URL(launch.html) in browser with iss parameter. It redirects to provider login page. After loggedin it prompts "Failed to call the FHIR Service". 
But if i access the launch URL(launch.html) in browser with iss and launch parameter(got the launch parameter while redirecting from within launchpad) after successfull loggedin, i can view the patient information.
How to access the smart on fhir app without launch parameter. Or how to generate the launch parameter dynamically at the time of launch.
Can you please help us to resolve.

Thanks,
thiyagu

On Thursday, 5 December 2019 23:18:15 UTC-5, thiyagu83.j wrote:
Benjamin,
Can you please help me.

Regards,
Thiyagu.

On Thu, 5 Dec 2019, 10:49 am thiyagu83.j, <thiya...@gmail.com> wrote:
Benjamin,
Thanks for your information. We have followed the tutorial and created SMART on FHIR APP. We can able to access the patient information within the cerner launchpad(through "Begin test") . We tried to acces the app from browser(outside from cerner launchpad) by directly access the url(http://censwteam.github.io/VolkSaas/launchnew.html). But it prompts error as "fhirServiceUrl" was undefined. 
1) How to run the URL directly(without cerner launchpad) from the browser?
Thanks,
thiyagu

On Wednesday, 4 December 2019 09:45:23 UTC-5, Benjamin Eichhorn (Cerner) wrote:
Hi,

I would suggest you take a look at our extensive documentation located on https://fhir.cerner.com/ and as well take a look through our SMART on FHIR tutorial https://engineering.cerner.com/smart-on-fhir-tutorial/ if this is your first time building an app. These should all answer most of the questions you have.

Thanks,
Ben (Cerner)

--
You received this message because you are subscribed to the Google Groups "Cerner FHIR Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cerner-fhir-developers+unsub...@googlegroups.com.

Benjamin Eichhorn (Cerner)

unread,
Dec 6, 2019, 9:10:55 AM12/6/19
to Cerner FHIR Developers
Hi,

The SMART on FHIR tutorial we published is an example of an app that would be launch from the traditional workflow which is an app embedded within the EHR. If you're looking to create an app that isn't launched within PowerChart then you'd need to make modifications. As an example, the iis parameter is telling the application the Service Root URL. There are additional parameters that tell the app the patient in context, that is why the tutorial is not working when you are launching it outside of the code Portal.

You would need to make alterations to allow the app the be launched outside of an EHR setting.

Thanks,
Ben (Cerner)

thiyagarajan jagan

unread,
Dec 6, 2019, 9:20:50 AM12/6/19
to cerner-fhir...@googlegroups.com
Ben,
Thanks for the information. Is there any document on how to make changes to support the application to call the EHR from outside.
Thanks,
Thiyagu 

--
You received this message because you are subscribed to the Google Groups "Cerner FHIR Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cerner-fhir-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cerner-fhir-developers/2da899f0-2171-4a26-9245-58c9c9bfe2cf%40googlegroups.com.

Benjamin Eichhorn (Cerner)

unread,
Dec 6, 2019, 9:29:15 AM12/6/19
to Cerner FHIR Developers
We do not have any such tutorial available, you maybe able to find tutorials from the SMART on FHIR community. The main differences you would see are different scopes (user versus patient scopes) and the lack of a patient in context which would require the app to handle how to discover patients (potentially through searches).

Thanks,
Ben (Cerner)

Mark Butler

unread,
Dec 6, 2019, 1:29:35 PM12/6/19
to Cerner FHIR Developers
You're going to need a service account to access data outside of the EHR system.

MArk B.

Benjamin Eichhorn (Cerner)

unread,
Dec 6, 2019, 1:50:12 PM12/6/19
to Cerner FHIR Developers
Hi Mark,

That is not accurate for stand-alone provider app launches. Stand-alone provider app launches are supported and doable and there are several apps that have done this. A system account is not required. These type of launches require that the app manually determine the URLs to authenticate and launch against.

Thanks,
Ben (Cerner)

Yegor Hanov (Cerner)

unread,
Dec 6, 2019, 2:33:48 PM12/6/19
to Cerner FHIR Developers
Mark,

Please take a look at authorization flow documentation available on our site [1]. It sounds to me like you are trying to implement the Contextless Flow.


-Yegor (Cerner)

thiyagarajan jagan

unread,
Dec 7, 2019, 5:44:33 AM12/7/19
to cerner-fhir...@googlegroups.com
Mark,
We have an web application(nodejs based). We need to pull the patient records from EHR server using patient Name/MRN/Id and display the information in our web application. For this case I created an provider app in cerner code environment with proper scope and redirect URL and I can successfully view the patient information by clicking the begin test button. But if I want to access the url without launchpad.
Actually if I enter the app url with iss and launch context ID parameters with values in the browser. I can navigated to provide login page. After successfully logged in I can view a patient basic information. But if I enter the app url with iss parameter only, I will navigate to login page but I got error after logged in like there was no value in the state parameter. How to generate a valid launch context ID while accessing the launch URL? Please advise.
Thanks,
Thiyagu.

--
You received this message because you are subscribed to the Google Groups "Cerner FHIR Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cerner-fhir-devel...@googlegroups.com.

Jenni Syed (Cerner)

unread,
Dec 9, 2019, 10:34:24 AM12/9/19
to Cerner FHIR Developers
Hi,

You need to remove the "launch" scope from your list of scopes you request during authorization. That launch code is only required when you launch from an EHR, which your application won't be doing based on what you've stated so far. Once you do that, you should be able to launch and authorize without the launch code.

Thanks,
Jenni (Cerner)

thiyagu83.j

unread,
Dec 10, 2019, 12:17:48 AM12/10/19
to Cerner FHIR Developers
Jenni,

Thanks for the information. I tried as per your suggestions as below,
 <script>
     FHIR.oauth2.authorize({
          client_id: "421c9059-3bd6-4007-836d-2435c347e313",
         'scope':  'patient/Patient.read patient/Observation.read',
        });
    </script>  
But i got error as "State parameter is undefined". But if i hard code the launch context id as below javascript(on button click). I can access the patient information without any issues.
        var launch = "e14a9fd1-d2f2-4201-a764-561c7c520a16"
        window.location ="launch.html?iss="+iss+"&launch="+launch     

Note:
i got the launch id by copying the navigation url at each stage while accessing the app by clicking the "Begin test" button.

My findings is how to generate the launch context id dynamically to access the ehr app from outside. Is it possible to generate the launch context id?
 Please suggest any other ways to achieve this.

Thanks,
Thiyagu

Jenni Syed (Cerner)

unread,
Dec 10, 2019, 9:28:44 AM12/10/19
to Cerner FHIR Developers
Patient level scopes are only applicable if you are launching from context of an EHR (where a specific patient will have already been chosen by the user). You'll need to use user scopes. The launch parameter is also only applicable to EHR launches.

Also, are you including the state parameter as required by OAuth in the request? http://fhir.cerner.com/authorization/#state 

Regards,
Jenni

thiyagu83.j

unread,
Dec 11, 2019, 1:09:18 AM12/11/19
to Cerner FHIR Developers
Jenni,
Thanks for the information. Yes i checked with the state parameter but i still got the error "No 'state' parameter found in authorization response.".
Questions. 
Iam having a provider app with scopes (patient,observation). I can access within the EHR but not from outside. 
1) If i publish my provider app in cerner. shall i access the app from outside of the EHR.
2) Is my provider app is eligible for publish in cerner?
3) How to publish my provider app in cerner? 
Thanks,
Thiyagu

Jenni Syed (Cerner)

unread,
Dec 11, 2019, 9:32:01 AM12/11/19
to Cerner FHIR Developers
Hi Thiyagu,

The example you gave above doesn't seem to include the state parameter. However, if you can provide the value of the Cerner-Correlation-Id header that is sent in the error response, we can look at more detailed errors. You can also see this value if you load the URL provided in the error_uri field in the response.

Yes, there is nothing preventing a physician from accessing the app separately. We have applications that access our APIs without doing the launch from the chart without issue.

The first step before publishing is getting a working example here in the sandbox. The next steps are described here: https://code.cerner.com/submit

Thanks,
Jenni

thiyagu83.j

unread,
Dec 12, 2019, 5:45:07 AM12/12/19
to Cerner FHIR Developers
Jenni,
Thanks for the information.
My App name is VolkSaasCoverage, Below is my app InfoApp Info,
Client Id: 9283c310-51b9-4104-9fa6-958b78e54ac9
App Id: d8bb1e8f-a2b6-4460-b74b-3a05879b704c
App Type: provider
Authorized: true
Standard Scopes:
launch
profile
openid
online_access
Patient Scopes:
patient/Observation.read
patient/Patient.read

In my launchCoverage.html page iam using as below,
 FHIR.oauth2.authorize({
        'client_id': '9283c310-51b9-4104-9fa6-958b78e54ac9',
'state':'7883a9c7-c724-7c86-b641-c47393ab2429',
        'scope':  'patient/Patient.read patient/Observation.read online_access openid profile'
      });

Iam accessing the App from the browser with below URL:

I can redirect to provider login page. After successfull logged in. i can see below error link in my url.



In my browser console i got error message as "No 'state' parameter found in authorization response.". I could not get the correlationID from the above error URL.

Please advise,

Note: 
You said, we have applications that access our APIs without doing the launch from the chart without issue. Can you please provide the link how to access your APIs without doing the launch.

Thanks,
Thiyagu

DJ

unread,
Aug 14, 2020, 3:55:48 PM8/14/20
to Cerner FHIR Developers
Hi Thiyagu

May I know how did you resolve this? I am seeing the same error  "No 'state' parameter found" after successful login  

Reply all
Reply to author
Forward
0 new messages