Versions Compared

Key

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

Need help? Contact us:

...

 

 

The Athenahealth adapter is designed to provide a template for getting started with Athenahealth API integrations, including:

...

Expand
titleSTEP 3: Double click on this component and edit the required component configurations

Manual Populated 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, e.g. . 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

System Auth Configurations

Using the information providedimage-20240412-161750.pngImage Added

Upon start up, the component will

run through the authentication workflow and set the Key and KeyExpiry value of the obtained access token automatically.

image-20240410-154205.pngImage Removed

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

Auto Populate Key and KeyExpiry

image-20240410-154205.pngImage Removed

Check Patient in Sandbox

You can verify Patient results in
Expand
titleSTEP 4: Start Component to Run Athenahealth Adapter Components and Populate System Configurations
Verify the connection is successful by checking the Translator annotations or running the component

You can verify the connection from the Translator and 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 open Component translator to check if your Iguana X adapter can successfully interact with Athenahealth Adapterimage-20240410-160350.pngImage Removedthe updated search results in the Translator.

image-20240412-200615.pngImage Added

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. It also loads the key and key_expiry configurations from the encrypted file if available.

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 respectivelystored in the adapter object (key and key_expiry) and saved in an encrypted file.

Expand
titleATHENAcustom - makes API requests and returns the response

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 key exists or if the KeyExpiry key_expiry 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.

This function is used as the fundamental API operation function in the provided wrapper methods and can also be independently called for a custom operation. An example of how ATHENAcustom can be used to directly query the same endpoint as ATHENAsearchPatients is shown below:

image-20240412-201701.pngImage Added

Expand
titleATHENAcreatePatient - prepares arguments for ATHENAcustom to create a patient

ATHENAcreatePatient prepares the arguments, including populating the path parameters (ex. practice ID) in the API string and loading the required header. It then calls ATHENAcustom to create a patient in Athenahealth via HTTP POST request.

...