Class: AthenaHealth::Client
- Inherits:
-
Object
- Object
- AthenaHealth::Client
- Includes:
- Endpoints::Appointments, Endpoints::Claims, Endpoints::Configurations, Endpoints::CustomFields, Endpoints::Departments, Endpoints::Encounters, Endpoints::InsurancePackages, Endpoints::Patients, Endpoints::Practices, Endpoints::Providers, Endpoints::Subscriptions
- Defined in:
- lib/athena_health/client.rb
Constant Summary collapse
- PRODUCTION_BASE_URL =
'https://api.platform.athenahealth.com'.freeze
- PREVIEW_BASE_URL =
'https://api.preview.platform.athenahealth.com'.freeze
- API_VERSION =
'v1'.freeze
Constants included from Endpoints::Subscriptions
Endpoints::Subscriptions::SUBSCRIPTION_TYPES
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(client_id:, secret:, production: false, auth_token_hash: nil) ⇒ Client
constructor
A new instance of Client.
- #serialized_token ⇒ Object
Methods included from Endpoints::CustomFields
Methods included from Endpoints::Claims
Methods included from Endpoints::Configurations
#all_allergies, #all_facilities, #all_gender_identities, #all_insurances, #all_medications, #all_order_types
Methods included from Endpoints::Encounters
#create_encounter_diagnoses, #create_encounter_order_lab, #create_order_group, #encounter_order, #encounter_orders, #encounter_summary, #find_encounter
Methods included from Endpoints::InsurancePackages
#common_insurance_packages, #top_insurance_packages
Methods included from Endpoints::Providers
#all_providers, #find_provider
Methods included from Endpoints::Appointments
#all_appointment_types, #all_patient_appointment_reasons, #appointment_insurances, #appointment_notes, #appointment_reminders, #book_appointment, #booked_appointments, #cancel_appointment, #cancel_check_in, #check_in, #create_appointment_note, #create_appointment_reminder, #create_appointment_slot, #create_appointment_waitlist, #delete_appointment_reminder, #find_appointment, #find_appointment_reminder, #find_appointment_type, #multipledepartment_booked_appointments, #open_appointment_slots, #reschedule_appointment, #start_check_in
Methods included from Endpoints::Patients
#add_patient_medication, #add_patient_preferred_pharmacy, #all_patients, #create_patient, #create_patient_case, #create_patient_document, #create_patient_insurance, #create_patient_problem, #delete_patient, #delete_patient_insurance, #find_bestmatch_patients, #find_patient, #find_patient_problems, #patient_allergies, #patient_analytes, #patient_appointments, #patient_default_laboratory, #patient_default_pharmacy, #patient_documents, #patient_encounters, #patient_insurances, #patient_lab_result_document, #patient_lab_results, #patient_medical_history, #patient_medications, #patient_preferred_pharmacies, #patient_prescriptions, #patient_social_history, #patient_social_history_templates, #record_payment, #set_patient_default_laboratory, #set_patient_default_pharmacy, #set_patient_social_history_templates, #update_patient, #update_patient_allergies, #update_patient_insurance, #update_patient_insurance_card_image, #update_patient_medical_history, #update_patient_medications, #update_patient_photo, #update_patient_social_history, #verify_patient_privacy_information
Methods included from Endpoints::Departments
#all_departments, #find_department
Methods included from Endpoints::Practices
#all_practices, #find_practice
Constructor Details
#initialize(client_id:, secret:, production: false, auth_token_hash: nil) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/athena_health/client.rb', line 7 def initialize(client_id:, secret:, production: false, auth_token_hash: nil) base_url = Client.base_url(production: production) @token = AthenaHealth::AuthToken.new( client_id: client_id, secret: secret, auth_token_hash: auth_token_hash, base_url: base_url, api_version: API_VERSION ) @api = AthenaHealth::Connection.new( base_url: base_url, api_version: API_VERSION, token: @token ) end |
Class Method Details
.base_url(production:) ⇒ Object
37 38 39 |
# File 'lib/athena_health/client.rb', line 37 def self.base_url(production:) production ? PRODUCTION_BASE_URL : PREVIEW_BASE_URL end |
Instance Method Details
#serialized_token ⇒ Object
21 22 23 |
# File 'lib/athena_health/client.rb', line 21 def serialized_token @token.serialized_token end |