Module: AthenaHealth::Endpoints::Appointments

Included in:
Client
Defined in:
lib/athena_health/endpoints/appointments.rb

Instance Method Summary collapse

Instance Method Details

#all_appointment_types(practice_id:, params: {}) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/athena_health/endpoints/appointments.rb', line 4

def all_appointment_types(practice_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointmenttypes",
    method: :get,
    params: params
  )

  AppointmentTypeCollection.new(response)
end

#all_patient_appointment_reasons(practice_id:, department_id:, provider_id:, params: {}) ⇒ Object



59
60
61
62
63
64
65
66
67
# File 'lib/athena_health/endpoints/appointments.rb', line 59

def all_patient_appointment_reasons(practice_id:, department_id:, provider_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/patientappointmentreasons",
    method: :get,
    params: params.merge!(departmentid: department_id, providerid: provider_id)
  )

  PatientAppointmentReasonCollection.new(response)
end

#appointment_insurances(practice_id:, appointment_id:, params: {}) ⇒ Object



210
211
212
213
214
215
216
217
218
# File 'lib/athena_health/endpoints/appointments.rb', line 210

def appointment_insurances(practice_id:, appointment_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}/insurances",
    method: :get,
    params: params
  )

  InsuranceCollection.new(response)
end

#appointment_notes(practice_id:, appointment_id:, params: {}) ⇒ Object



105
106
107
108
109
110
111
112
113
# File 'lib/athena_health/endpoints/appointments.rb', line 105

def appointment_notes(practice_id:, appointment_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}/notes",
    method: :get,
    params: params
  )

  NoteCollection.new(response)
end

#appointment_reminders(practice_id:, start_date:, end_date:, department_id:, params: {}) ⇒ Object



168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/athena_health/endpoints/appointments.rb', line 168

def appointment_reminders(practice_id:, start_date:, end_date:, department_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointments/appointmentreminders",
    method: :get,
    params: params.merge!(
      startdate: start_date,
      enddate: end_date,
      departmentid: department_id
    )
  )

  AppointmentReminderCollection.new(response)
end

#book_appointment(practice_id:, appointment_id:, patient_id:, params: {}) ⇒ Object



49
50
51
52
53
54
55
56
57
# File 'lib/athena_health/endpoints/appointments.rb', line 49

def book_appointment(practice_id:, appointment_id:, patient_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}",
    method: :put,
    params: params.merge(patientid: patient_id)
  )

  Appointment.new(response.first)
end

#booked_appointments(practice_id:, department_id:, start_date:, end_date:, params: {}) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/athena_health/endpoints/appointments.rb', line 69

def booked_appointments(practice_id:, department_id:, start_date:, end_date:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointments/booked",
    method: :get,
    params: params.merge!(
      departmentid: department_id,
      startdate: start_date,
      enddate: end_date
    )
  )

  AppointmentCollection.new(response)
end

#cancel_appointment(practice_id:, appointment_id:, patient_id:, body: {}) ⇒ Object



97
98
99
100
101
102
103
# File 'lib/athena_health/endpoints/appointments.rb', line 97

def cancel_appointment(practice_id:, appointment_id:, patient_id:, body: {})
  @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}/cancel",
    method: :put,
    body: body.merge!(patientid: patient_id)
  )
end

#cancel_check_in(practice_id:, appointment_id:) ⇒ Object



130
131
132
133
134
135
# File 'lib/athena_health/endpoints/appointments.rb', line 130

def cancel_check_in(practice_id:, appointment_id:)
  @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}/cancelcheckin",
    method: :post
  )
end

#check_in(practice_id:, appointment_id:) ⇒ Object



137
138
139
140
141
142
# File 'lib/athena_health/endpoints/appointments.rb', line 137

def check_in(practice_id:, appointment_id:)
  @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}/checkin",
    method: :post
  )
end

#create_appointment_note(practice_id:, appointment_id:, note_text:) ⇒ Object



115
116
117
118
119
120
121
# File 'lib/athena_health/endpoints/appointments.rb', line 115

def create_appointment_note(practice_id:, appointment_id:, note_text:)
  @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}/notes",
    method: :post,
    body: { notetext: note_text }
  )
end

#create_appointment_reminder(practice_id:, approximate_date:, department_id:, patient_id:, params: {}) ⇒ Object



191
192
193
194
195
196
197
198
199
200
201
# File 'lib/athena_health/endpoints/appointments.rb', line 191

def create_appointment_reminder(practice_id:, approximate_date:, department_id:, patient_id:, params: {})
  @api.call(
    endpoint: "#{practice_id}/appointments/appointmentreminders",
    method: :post,
    body: params.merge!(
      approximatedate: approximate_date,
      departmentid: department_id,
      patientid: patient_id
    )
  )
end

#create_appointment_slot(practice_id:, department_id:, appointment_date:, appointment_time:, provider_id:, body: {}) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/athena_health/endpoints/appointments.rb', line 36

def create_appointment_slot(practice_id:, department_id:, appointment_date:, appointment_time:, provider_id:, body: {})
  @api.call(
    endpoint: "#{practice_id}/appointments/open",
    method: :post,
    body: body.merge(
      departmentid: department_id,
      appointmentdate: appointment_date,
      appointmenttime: appointment_time,
      providerid: provider_id
    )
  )
end

#create_appointment_waitlist(practice_id:, params: {}) ⇒ Object



220
221
222
223
224
225
226
# File 'lib/athena_health/endpoints/appointments.rb', line 220

def create_appointment_waitlist(practice_id:, params: {})
  @api.call(
    endpoint: "#{practice_id}/appointments/waitlist",
    method: :post,
    body: params
  )
end

#delete_appointment_reminder(practice_id:, appointment_reminder_id:) ⇒ Object



203
204
205
206
207
208
# File 'lib/athena_health/endpoints/appointments.rb', line 203

def delete_appointment_reminder(practice_id:, appointment_reminder_id:)
  @api.call(
    endpoint: "#{practice_id}/appointments/appointmentreminders/#{appointment_reminder_id}",
    method: :delete
  )
end

#find_appointment(practice_id:, appointment_id:, params: {}) ⇒ Object



157
158
159
160
161
162
163
164
165
# File 'lib/athena_health/endpoints/appointments.rb', line 157

def find_appointment(practice_id:, appointment_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}",
    method: :get,
    params: params
  )

  Appointment.new(response.first)
end

#find_appointment_reminder(practice_id:, appointment_reminder_id:) ⇒ Object



182
183
184
185
186
187
188
189
# File 'lib/athena_health/endpoints/appointments.rb', line 182

def find_appointment_reminder(practice_id:, appointment_reminder_id:)
  response = @api.call(
    endpoint: "#{practice_id}/appointments/appointmentreminders/#{appointment_reminder_id}",
    method: :get
  )

  AppointmentReminder.new(response)
end

#find_appointment_type(practice_id:, appointment_type_id:, params: {}) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/athena_health/endpoints/appointments.rb', line 14

def find_appointment_type(practice_id:, appointment_type_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointmenttypes/#{appointment_type_id}",
    method: :get,
    params: params
  )

  AppointmentType.new(response.first)
end

#multipledepartment_booked_appointments(practice_id:, department_id:, start_date:, end_date:, params: {}) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/athena_health/endpoints/appointments.rb', line 83

def multipledepartment_booked_appointments(practice_id:, department_id:, start_date:, end_date:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointments/booked/multipledepartment",
    method: :get,
    params: params.merge!(
      departmentid: department_id,
      startdate: start_date,
      enddate: end_date
    )
  )

  AppointmentCollection.new(response)
end

#open_appointment_slots(practice_id:, department_id:, params: {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/athena_health/endpoints/appointments.rb', line 24

def open_appointment_slots(practice_id:, department_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointments/open",
    method: :get,
    params: params.merge(
      departmentid: department_id
    )
  )

  AppointmentCollection.new(response)
end

#reschedule_appointment(practice_id:, patient_id:, appointment_id:, new_appointment_id:, params: {}) ⇒ Object



144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/athena_health/endpoints/appointments.rb', line 144

def reschedule_appointment(practice_id:, patient_id:, appointment_id:, new_appointment_id:, params: {})
  response = @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}/reschedule",
    method: :put,
    params: params.merge!(
      patientid: patient_id,
      newappointmentid: new_appointment_id
    )
  )

  Appointment.new(response.first)
end

#start_check_in(practice_id:, appointment_id:) ⇒ Object



123
124
125
126
127
128
# File 'lib/athena_health/endpoints/appointments.rb', line 123

def start_check_in(practice_id:, appointment_id:)
  @api.call(
    endpoint: "#{practice_id}/appointments/#{appointment_id}/startcheckin",
    method: :post
  )
end