Skip to content
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

To embed a button on athenahealth EHR #214

Closed
viku1996chetu opened this issue Nov 2, 2021 · 4 comments
Closed

To embed a button on athenahealth EHR #214

viku1996chetu opened this issue Nov 2, 2021 · 4 comments

Comments

@viku1996chetu
Copy link

viku1996chetu commented Nov 2, 2021

Hello Team,

We want to embed a button on AthenaHealth EHR.
When this button is clicked, we would want to launch another web application.

Below are some questions:

  1. Is there a way to do this using FHIR or FHIR smart-app-launch (http://www.hl7.org/fhir/smart-app-launch/)?
  2. If yes, can you please guide us to some documentation and resources?
  3. If not, by when can we expect this feature?
  4. Also, if not through FHIR, is it possible to do it through any other means? If yes, can you please point us to some appropriate resources.

Your quick response will be much appreciated.

@viku1996chetu viku1996chetu changed the title Integrate to lunch another application through athenahealth Integrate to launch another application through athenahealth Nov 2, 2021
@viku1996chetu viku1996chetu changed the title Integrate to launch another application through athenahealth To embed a button on athenahealth EHR using FHIR/ FHIR smart-app-launch Nov 2, 2021
@viku1996chetu viku1996chetu changed the title To embed a button on athenahealth EHR using FHIR/ FHIR smart-app-launch To embed a button on athenahealth EHR Nov 2, 2021
@Torin-Shepard-athena
Copy link
Collaborator

@viku1996chetu The attached document is a copy of a help topic from the athenaPractice/athenaFlow help file. There is a MEL function that can be linked to a button in an encounter form to launch SMART applications.

MEL_LAUNCH_SMARTAPP Help Topic.docx
.

@viku1996chetu
Copy link
Author

Thank you @Torin-Shepard-athena
Do you have this MEL_LAUNCH_SMARTAPP available in sandbox
How can we simulate MEL expression/quick text
for development using sandbox.

Any pointer will be greatly appreciated.

@Torin-Shepard-athena
Copy link
Collaborator

@viku1996chetu
You can simulate the funcationality by using FHIR API Server endpoint to create a launch session.

Follow process at https://mydata.athenahealth.com/access-the-apis to get an access token.

POST request to {base_fhir_url}/session/create with valid response body

POST to https://apsandbox.fhirapi.athenahealth.com/demoAPIServer/session/create
Authorization: Bearer Token {access_token}
Headers: Content-Type=application/json
Request Body

{
"user": "hwinston@sboxprovtenant.com",
"ehrSystem": "cps",
"patientId": "1239620410000620",
"aud": "https://apsandbox.fhirapi.athenahealth.com/demoAPIServer/fhir"
}

NOTE: 1239620410000620 = Patient.id for test patient Walter Caldwell.

Sample successful response:

{
"code": "launch_code_from_session_create_endpoint"
}

Now you can invoke your SMART on FHIR application with this launch code.

https://{SMART_App_Base_URL}/?launch={launch_code_from_session_create_endpoint}&iss=https://apsandbox.fhirapi.athenahealth.com/demoAPIServer/fhir

The SMART app must perform 2 requests to FHIR Server to get access token.

SMART app does GET request to FHIR Server authorize endpoint as the first step after being invoked with launch code.
Include launch in the scope parameter.
https://apsandbox.fhirapi.athenahealth.com/demoAPIServer/oauth2/authorize?client_id={SMART_App_client_id}
&state={state_value}
&redirect_uri={SMART_App_redirect_uri}
&response_type=code%20id_token
&response_mode=form_post
&aud=https://apsandbox.fhirapi.athenahealth.com/demoAPIServer/fhir
&disable_userselection=true
&launch={launch_code_given_to_invoke_SMART_App}
&scope=offline_access%20openid%20profile%20user%2F*.read%20launch

NOTE: {launch_code_given_to_invoke_SMART_App} is the same as {launch_code_from_session_create_endpoint}

SMART_App_redirect_uri will receive form data response from API Server authorize endpoint with {auth_code_for_launch_session} and state.

SMART app exchanges auth code for access token.
POST to https://apsandbox.fhirapi.athenahealth.com/demoAPIServer/oauth2/token
Authorization Header = Basic {SMART_App_client_id}:{SMART_App_client_secret} (Base64-encoded)
grant_type=authorization_code
redirect_uri={SMART_App_redirect_uri}
code={auth_code_for_launch_session}

SMART app will receive access_token that is authorized for the user and patient context specified in the launch session/create request.

@AjeetYadav07
Copy link
Collaborator

This issue has been responded and no further communication received, Marking as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants