Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Need help? Contact us:

...

 

 

The AthenaHealth Athenahealth adapter is designed to provide a template for getting started with Athenahealth API integrations, including. It leverages the ATHENA Library to:

  1. Authenticating Authenticate with the Athenahealth API Server via OAuth2.0 using the OAUTH Library.

  2. Demo AthenaOne APIs Integration: saerchPatient searchPatient and createPatient

  3. Demo FHIR APIs Integration: searchPatientsFhir

This component can be customized and adapted according to your workflow needs.

How to use it:

Expand
titleSTEP 1: Login or sign up for Athenahealth Developer Portal to access the Testing Sandbox and create a Client App called "IguanaXApp"

Refer to Setup Athenahealth Sandbox for the sign up process, creating and client and gathering the authentication details needed for the Athenahealth Adapter.

Expand
titleSTEP 2: Import the Athenhealth Athenahealth Adapter component in Iguana

See Create a Component if this is your first time!

image-20240410-152821.png

Expand
titleSTEP 3: Configure the ClientId and PrivateKey custom fields and click Edit to open the Translator

Enter the ClientId and PrivateKey certificate path.

Using the information provided, the component will run through the authentication workflow and set the Key and KeyExpiry value of the obtained access token automatically.

How the ATHENA Library works:

Expand
titleATHENAclient - sets up the adapter framework

Sets up the ATHENA adapter framework, adding the various method modules to a metatable and storing the configurations added to the custom fields.

Expand
titleATHENAauth - authenticates with the AthenaHealth server

The ATHENAauth function builds and makes the HTTP POST token request to obtain the access token required for interacting with the AthenaHealth API.

If the token request is successful (HTTP 200 response), the token and token expiry returned are set to the Key and KeyExpiry custom fields respectively.

ATHENAcustom takes in any API requests and parameters to make the API call and return the response.

  • First the function checks if the token Key exists or if the KeyExpiry time has passed and performs the OAuth2.0 authentication workflow to obtain the token to be used in subsequent requests.

  • Uses the passed configurations API request parameters - the method (ex. post), API (ex. v1/1128700/patients), headers (ex. Content-Type), and parameters for the call (ex. the patient details to be created) - to build and carry out the appropriate HTTP request.

  • For resiliency, the Retry Library is used to retry any failed attempts and the response is handled and returned.
    Expand
    titleATHENAcustom - makes API requests and returns the response
    Double click on this component and edit the required component configurations

    Component Configurations

    • ClientId: the Athenahealth application client ID

    • ClientSecret: the Athenahealth application client secret

    • Scopes: the space-delimited string that lists the scopes of access that the application has. By default, this example component will include the scopes you need to access the AthenaOne and FHIR Patient API endpoints (ex. athena/service/Athenanet.MDP.* system/Patient.read )

    • Prod: boolean value to indicate whether to use the Preview or Production AthenaHealth environment

    • PracticeId: AthenaHealth practice ID. By default, this will contain the sandbox practice ID (ex. 1128700).

    You can get ClientId, Client Secret, and Scopes from App Setup: Setup Athenahealth Sandbox

    image-20240412-161750.pngImage Added

    Upon start up, the component will take the provided credentials to retrieve an access token from Athenahealth and store it in an encrypted file for use on subsequent API requests.

    Expand
    titleSTEP 4: Verify the connection is successful by checking the Translator annotations or running the component

    Click Edit > Make a Copy and Edit to open the Translator.

    You can verify the connection from the Translator by clicking on the results of the patient searches in the annotations.

    image-20240412-202356.pngImage Added

    You can also verify the created patient by starting the component, checking the logs for the newly created patient’s ID, and checking the Athenahealth sandbox How to use Athenahealth Sandbox or the updated search results in the Translator.

    image-20240412-200615.pngImage Added