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
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 exists or if the 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.png

Expand
titlemethods/ATHENAcreatePatient - 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.

Expand
titlemethods/ATHENAsearchPatients - prepares arguments for ATHENAcustom to search for a patient based on the provided query parameters

ATHENAsearchPatients prepares the arguments, including populating the path parameters (ex. practice ID) in the API string. It then calls ATHENAcustom to search for a patient in Athenahealth.

Expand
titlemethods/ATHENAsearchPatientsFhir - prepares arguments for ATHENAcustom to search for a FHIR patient based on the provided query parameters

ATHENAsearchPatientsFhir prepares the arguments, including the FHIR-specific API string, and calls ATHENAcustom to search for a FHIR patient in Athenahealth.