You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 4
Next »
Need help? Contact us:
The AthenaHealth adapter is designed to provide a template for getting started with Athenahealth API integrations, including:
Authenticating with the Athenahealth API Server via OAuth2.0 using the OAUTH Library.
Demo AthenaOne APIs Integration: saerchPatient and createPatient
Demo FHIR APIs Integration: searchPatientsFhir
This component can be customized and adapted according to your workflow needs.
How to use it:
STEP 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.
STEP 2: Import the Athenhealth Adapter component in Iguana
See Create a Component if this is your first time!
STEP 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:
ATHENAclient - 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.
ATHENAauth - 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 - 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 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.