candidhealth 0.32.0 → 0.33.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/encounter_providers/client.rb +30 -0
  3. data/lib/candidhealth/encounter_providers/v_2/client.rb +789 -0
  4. data/lib/candidhealth/encounter_providers/v_2/types/initial_referring_provider_update.rb +132 -0
  5. data/lib/candidhealth/encounter_providers/v_2/types/ordering_provider_update.rb +123 -0
  6. data/lib/candidhealth/encounter_providers/v_2/types/referring_provider_update.rb +123 -0
  7. data/lib/candidhealth/encounter_providers/v_2/types/supervising_provider_update.rb +123 -0
  8. data/lib/candidhealth/pre_encounter/appointments/v_1/client.rb +32 -270
  9. data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb +87 -75
  10. data/lib/candidhealth/pre_encounter/appointments/v_1/types/{appointment_sort_field.rb → appointment_status.rb} +5 -3
  11. data/lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb +87 -75
  12. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +4 -4
  13. data/lib/candidhealth/pre_encounter/coverages/v_1/types/plan_date.rb +87 -0
  14. data/lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb +13 -10
  15. data/lib/candidhealth/pre_encounter/lists/client.rb +32 -0
  16. data/lib/candidhealth/pre_encounter/lists/v_1/client.rb +213 -0
  17. data/lib/candidhealth/pre_encounter/lists/v_1/types/appointment_list_item.rb +104 -0
  18. data/lib/candidhealth/pre_encounter/lists/v_1/types/appointment_list_page.rb +90 -0
  19. data/lib/candidhealth/pre_encounter/lists/v_1/types/patient_list_item.rb +104 -0
  20. data/lib/candidhealth/pre_encounter/lists/v_1/types/patient_list_page.rb +90 -0
  21. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +126 -150
  22. data/lib/candidhealth/pre_encounter/patients/v_1/types/guarantor.rb +121 -0
  23. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +32 -2
  24. data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +32 -2
  25. data/lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patient.rb +72 -0
  26. data/lib/candidhealth/pre_encounter/patients/v_1/types/potential_duplicate_patients_error_body.rb +84 -0
  27. data/lib/candidhealth.rb +7 -0
  28. data/lib/requests.rb +2 -2
  29. data/lib/types_export.rb +13 -3
  30. metadata +19 -5
  31. data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment_reason.rb +0 -19
  32. data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment_type.rb +0 -17
@@ -1,10 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "date"
4
- require_relative "../../../common/types/external_provider"
4
+ require_relative "appointment_status"
5
5
  require_relative "service"
6
- require_relative "appointment_reason"
7
- require_relative "appointment_type"
8
6
  require_relative "appointment_work_queue"
9
7
  require "ostruct"
10
8
  require "json"
@@ -33,20 +31,13 @@ module CandidApiClient
33
31
  attr_reader :updating_user_id
34
32
  # @return [String] The Candid-defined patient identifier.
35
33
  attr_reader :patient_id
36
- # @return [Boolean] True if the patient has checked in. Defaults to false.
37
- attr_reader :checked_in
38
- # @return [String] Patient’s initial assigned location or the location to which the patient is
39
- # being moved. This location is stored on the Patient Demographics tab and is used
40
- # when creating orders.
41
- attr_reader :assigned_patient_location
42
- # @return [CandidApiClient::PreEncounter::Common::Types::ExternalProvider] Attending physician information. The attending physician will be stored as the
43
- # Current MD for the patient.
44
- attr_reader :attending_doctor
45
- # @return [CandidApiClient::PreEncounter::Common::Types::ExternalProvider] Referring physician information. The referring physician will be stored as the
46
- # Referring MD in the patient’s Providers list.
47
- attr_reader :referring_doctor
48
34
  # @return [DateTime]
49
35
  attr_reader :start_timestamp
36
+ # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentStatus] Defaults to PENDING. If status is NOT_READY, work_queue must be set. If status
37
+ # is READY or CHECKED_IN, work_queue must be null. If status is CHECKED_IN,
38
+ # checked_in_timestamp must be set. If checked_in_timestamp is set, status must be
39
+ # CHECKED_IN.
40
+ attr_reader :status
50
41
  # @return [Integer] The requested length of time allotted for the appointment. The units are in
51
42
  # minutes.
52
43
  attr_reader :service_duration
@@ -54,15 +45,29 @@ module CandidApiClient
54
45
  attr_reader :services
55
46
  # @return [String] ID for the appointment/order for the event.
56
47
  attr_reader :placer_appointment_id
57
- # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentReason]
58
- attr_reader :appointment_reason
59
- # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentType] Contains the identifier code for the appointment.
60
- attr_reader :appointment_type
48
+ # @return [Integer]
49
+ attr_reader :estimated_copay_cents
50
+ # @return [Integer]
51
+ attr_reader :estimated_patient_responsibility_cents
52
+ # @return [Integer]
53
+ attr_reader :patient_deposit_cents
54
+ # @return [DateTime] The timestamp when the patient checked in for their appointment. If status is
55
+ # CHECKED_IN, checked_in_timestamp must be set. If checked_in_timestamp is set,
56
+ # status must be CHECKED_IN.
57
+ attr_reader :checked_in_timestamp
58
+ # @return [String]
59
+ attr_reader :notes
61
60
  # @return [String] Contains the coded identification of the location being scheduled. Components:
62
61
  # <Identifier (ST)>^<Text (ST)>
63
62
  attr_reader :location_resource_id
63
+ # @return [Boolean] True if the automated eligibility check has been completed. It is not
64
+ # recommended to change this value manually via API. This refers explicitly to the
65
+ # automated eligibility check that occurs a specific number of days before the
66
+ # appointment.
67
+ attr_reader :automated_eligibility_check_complete
64
68
  # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentWorkQueue] The work queue that the appointment belongs to. It is not recommended to change
65
- # this value manually via API.
69
+ # this value manually via API. If status is NOT_READY, work_queue must be set. If
70
+ # status is READY or CHECKED_IN, work_queue must be null.
66
71
  attr_reader :work_queue
67
72
  # @return [OpenStruct] Additional properties unmapped to the current class definition
68
73
  attr_reader :additional_properties
@@ -82,29 +87,35 @@ module CandidApiClient
82
87
  # @param updated_at [DateTime]
83
88
  # @param updating_user_id [String] The user ID of the user who last updated the appointment.
84
89
  # @param patient_id [String] The Candid-defined patient identifier.
85
- # @param checked_in [Boolean] True if the patient has checked in. Defaults to false.
86
- # @param assigned_patient_location [String] Patient’s initial assigned location or the location to which the patient is
87
- # being moved. This location is stored on the Patient Demographics tab and is used
88
- # when creating orders.
89
- # @param attending_doctor [CandidApiClient::PreEncounter::Common::Types::ExternalProvider] Attending physician information. The attending physician will be stored as the
90
- # Current MD for the patient.
91
- # @param referring_doctor [CandidApiClient::PreEncounter::Common::Types::ExternalProvider] Referring physician information. The referring physician will be stored as the
92
- # Referring MD in the patient’s Providers list.
93
90
  # @param start_timestamp [DateTime]
91
+ # @param status [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentStatus] Defaults to PENDING. If status is NOT_READY, work_queue must be set. If status
92
+ # is READY or CHECKED_IN, work_queue must be null. If status is CHECKED_IN,
93
+ # checked_in_timestamp must be set. If checked_in_timestamp is set, status must be
94
+ # CHECKED_IN.
94
95
  # @param service_duration [Integer] The requested length of time allotted for the appointment. The units are in
95
96
  # minutes.
96
97
  # @param services [Array<CandidApiClient::PreEncounter::Appointments::V1::Types::Service>]
97
98
  # @param placer_appointment_id [String] ID for the appointment/order for the event.
98
- # @param appointment_reason [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentReason]
99
- # @param appointment_type [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentType] Contains the identifier code for the appointment.
99
+ # @param estimated_copay_cents [Integer]
100
+ # @param estimated_patient_responsibility_cents [Integer]
101
+ # @param patient_deposit_cents [Integer]
102
+ # @param checked_in_timestamp [DateTime] The timestamp when the patient checked in for their appointment. If status is
103
+ # CHECKED_IN, checked_in_timestamp must be set. If checked_in_timestamp is set,
104
+ # status must be CHECKED_IN.
105
+ # @param notes [String]
100
106
  # @param location_resource_id [String] Contains the coded identification of the location being scheduled. Components:
101
107
  # <Identifier (ST)>^<Text (ST)>
108
+ # @param automated_eligibility_check_complete [Boolean] True if the automated eligibility check has been completed. It is not
109
+ # recommended to change this value manually via API. This refers explicitly to the
110
+ # automated eligibility check that occurs a specific number of days before the
111
+ # appointment.
102
112
  # @param work_queue [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentWorkQueue] The work queue that the appointment belongs to. It is not recommended to change
103
- # this value manually via API.
113
+ # this value manually via API. If status is NOT_READY, work_queue must be set. If
114
+ # status is READY or CHECKED_IN, work_queue must be null.
104
115
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
105
116
  # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::Appointment]
106
- def initialize(id:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, patient_id:, service_duration:, services:,
107
- checked_in: OMIT, assigned_patient_location: OMIT, attending_doctor: OMIT, referring_doctor: OMIT, start_timestamp: OMIT, placer_appointment_id: OMIT, appointment_reason: OMIT, appointment_type: OMIT, location_resource_id: OMIT, work_queue: OMIT, additional_properties: nil)
117
+ def initialize(id:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, patient_id:,
118
+ start_timestamp:, service_duration:, services:, status: OMIT, placer_appointment_id: OMIT, estimated_copay_cents: OMIT, estimated_patient_responsibility_cents: OMIT, patient_deposit_cents: OMIT, checked_in_timestamp: OMIT, notes: OMIT, location_resource_id: OMIT, automated_eligibility_check_complete: OMIT, work_queue: OMIT, additional_properties: nil)
108
119
  @id = id
109
120
  @organization_id = organization_id
110
121
  @deactivated = deactivated
@@ -112,17 +123,22 @@ module CandidApiClient
112
123
  @updated_at = updated_at
113
124
  @updating_user_id = updating_user_id
114
125
  @patient_id = patient_id
115
- @checked_in = checked_in if checked_in != OMIT
116
- @assigned_patient_location = assigned_patient_location if assigned_patient_location != OMIT
117
- @attending_doctor = attending_doctor if attending_doctor != OMIT
118
- @referring_doctor = referring_doctor if referring_doctor != OMIT
119
- @start_timestamp = start_timestamp if start_timestamp != OMIT
126
+ @start_timestamp = start_timestamp
127
+ @status = status if status != OMIT
120
128
  @service_duration = service_duration
121
129
  @services = services
122
130
  @placer_appointment_id = placer_appointment_id if placer_appointment_id != OMIT
123
- @appointment_reason = appointment_reason if appointment_reason != OMIT
124
- @appointment_type = appointment_type if appointment_type != OMIT
131
+ @estimated_copay_cents = estimated_copay_cents if estimated_copay_cents != OMIT
132
+ if estimated_patient_responsibility_cents != OMIT
133
+ @estimated_patient_responsibility_cents = estimated_patient_responsibility_cents
134
+ end
135
+ @patient_deposit_cents = patient_deposit_cents if patient_deposit_cents != OMIT
136
+ @checked_in_timestamp = checked_in_timestamp if checked_in_timestamp != OMIT
137
+ @notes = notes if notes != OMIT
125
138
  @location_resource_id = location_resource_id if location_resource_id != OMIT
139
+ if automated_eligibility_check_complete != OMIT
140
+ @automated_eligibility_check_complete = automated_eligibility_check_complete
141
+ end
126
142
  @work_queue = work_queue if work_queue != OMIT
127
143
  @additional_properties = additional_properties
128
144
  @_field_set = {
@@ -133,17 +149,18 @@ module CandidApiClient
133
149
  "updated_at": updated_at,
134
150
  "updating_user_id": updating_user_id,
135
151
  "patient_id": patient_id,
136
- "checked_in": checked_in,
137
- "assigned_patient_location": assigned_patient_location,
138
- "attending_doctor": attending_doctor,
139
- "referring_doctor": referring_doctor,
140
152
  "start_timestamp": start_timestamp,
153
+ "status": status,
141
154
  "service_duration": service_duration,
142
155
  "services": services,
143
156
  "placer_appointment_id": placer_appointment_id,
144
- "appointment_reason": appointment_reason,
145
- "appointment_type": appointment_type,
157
+ "estimated_copay_cents": estimated_copay_cents,
158
+ "estimated_patient_responsibility_cents": estimated_patient_responsibility_cents,
159
+ "patient_deposit_cents": patient_deposit_cents,
160
+ "checked_in_timestamp": checked_in_timestamp,
161
+ "notes": notes,
146
162
  "location_resource_id": location_resource_id,
163
+ "automated_eligibility_check_complete": automated_eligibility_check_complete,
147
164
  "work_queue": work_queue
148
165
  }.reject do |_k, v|
149
166
  v == OMIT
@@ -164,32 +181,25 @@ module CandidApiClient
164
181
  updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
165
182
  updating_user_id = struct["updating_user_id"]
166
183
  patient_id = struct["patient_id"]
167
- checked_in = struct["checked_in"]
168
- assigned_patient_location = struct["assigned_patient_location"]
169
- if parsed_json["attending_doctor"].nil?
170
- attending_doctor = nil
171
- else
172
- attending_doctor = parsed_json["attending_doctor"].to_json
173
- attending_doctor = CandidApiClient::PreEncounter::Common::Types::ExternalProvider.from_json(json_object: attending_doctor)
174
- end
175
- if parsed_json["referring_doctor"].nil?
176
- referring_doctor = nil
177
- else
178
- referring_doctor = parsed_json["referring_doctor"].to_json
179
- referring_doctor = CandidApiClient::PreEncounter::Common::Types::ExternalProvider.from_json(json_object: referring_doctor)
180
- end
181
184
  start_timestamp = unless parsed_json["start_timestamp"].nil?
182
185
  DateTime.parse(parsed_json["start_timestamp"])
183
186
  end
187
+ status = struct["status"]
184
188
  service_duration = struct["service_duration"]
185
189
  services = parsed_json["services"]&.map do |item|
186
190
  item = item.to_json
187
191
  CandidApiClient::PreEncounter::Appointments::V1::Types::Service.from_json(json_object: item)
188
192
  end
189
193
  placer_appointment_id = struct["placer_appointment_id"]
190
- appointment_reason = struct["appointment_reason"]
191
- appointment_type = struct["appointment_type"]
194
+ estimated_copay_cents = struct["estimated_copay_cents"]
195
+ estimated_patient_responsibility_cents = struct["estimated_patient_responsibility_cents"]
196
+ patient_deposit_cents = struct["patient_deposit_cents"]
197
+ checked_in_timestamp = unless parsed_json["checked_in_timestamp"].nil?
198
+ DateTime.parse(parsed_json["checked_in_timestamp"])
199
+ end
200
+ notes = struct["notes"]
192
201
  location_resource_id = struct["location_resource_id"]
202
+ automated_eligibility_check_complete = struct["automated_eligibility_check_complete"]
193
203
  work_queue = struct["work_queue"]
194
204
  new(
195
205
  id: id,
@@ -199,17 +209,18 @@ module CandidApiClient
199
209
  updated_at: updated_at,
200
210
  updating_user_id: updating_user_id,
201
211
  patient_id: patient_id,
202
- checked_in: checked_in,
203
- assigned_patient_location: assigned_patient_location,
204
- attending_doctor: attending_doctor,
205
- referring_doctor: referring_doctor,
206
212
  start_timestamp: start_timestamp,
213
+ status: status,
207
214
  service_duration: service_duration,
208
215
  services: services,
209
216
  placer_appointment_id: placer_appointment_id,
210
- appointment_reason: appointment_reason,
211
- appointment_type: appointment_type,
217
+ estimated_copay_cents: estimated_copay_cents,
218
+ estimated_patient_responsibility_cents: estimated_patient_responsibility_cents,
219
+ patient_deposit_cents: patient_deposit_cents,
220
+ checked_in_timestamp: checked_in_timestamp,
221
+ notes: notes,
212
222
  location_resource_id: location_resource_id,
223
+ automated_eligibility_check_complete: automated_eligibility_check_complete,
213
224
  work_queue: work_queue,
214
225
  additional_properties: struct
215
226
  )
@@ -236,17 +247,18 @@ module CandidApiClient
236
247
  obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
237
248
  obj.updating_user_id.is_a?(String) != false || raise("Passed value for field obj.updating_user_id is not the expected type, validation failed.")
238
249
  obj.patient_id.is_a?(String) != false || raise("Passed value for field obj.patient_id is not the expected type, validation failed.")
239
- obj.checked_in&.is_a?(Boolean) != false || raise("Passed value for field obj.checked_in is not the expected type, validation failed.")
240
- obj.assigned_patient_location&.is_a?(String) != false || raise("Passed value for field obj.assigned_patient_location is not the expected type, validation failed.")
241
- obj.attending_doctor.nil? || CandidApiClient::PreEncounter::Common::Types::ExternalProvider.validate_raw(obj: obj.attending_doctor)
242
- obj.referring_doctor.nil? || CandidApiClient::PreEncounter::Common::Types::ExternalProvider.validate_raw(obj: obj.referring_doctor)
243
- obj.start_timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.start_timestamp is not the expected type, validation failed.")
250
+ obj.start_timestamp.is_a?(DateTime) != false || raise("Passed value for field obj.start_timestamp is not the expected type, validation failed.")
251
+ obj.status&.is_a?(CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
244
252
  obj.service_duration.is_a?(Integer) != false || raise("Passed value for field obj.service_duration is not the expected type, validation failed.")
245
253
  obj.services.is_a?(Array) != false || raise("Passed value for field obj.services is not the expected type, validation failed.")
246
254
  obj.placer_appointment_id&.is_a?(String) != false || raise("Passed value for field obj.placer_appointment_id is not the expected type, validation failed.")
247
- obj.appointment_reason&.is_a?(CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentReason) != false || raise("Passed value for field obj.appointment_reason is not the expected type, validation failed.")
248
- obj.appointment_type&.is_a?(CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentType) != false || raise("Passed value for field obj.appointment_type is not the expected type, validation failed.")
255
+ obj.estimated_copay_cents&.is_a?(Integer) != false || raise("Passed value for field obj.estimated_copay_cents is not the expected type, validation failed.")
256
+ obj.estimated_patient_responsibility_cents&.is_a?(Integer) != false || raise("Passed value for field obj.estimated_patient_responsibility_cents is not the expected type, validation failed.")
257
+ obj.patient_deposit_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_deposit_cents is not the expected type, validation failed.")
258
+ obj.checked_in_timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.checked_in_timestamp is not the expected type, validation failed.")
259
+ obj.notes&.is_a?(String) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.")
249
260
  obj.location_resource_id&.is_a?(String) != false || raise("Passed value for field obj.location_resource_id is not the expected type, validation failed.")
261
+ obj.automated_eligibility_check_complete&.is_a?(Boolean) != false || raise("Passed value for field obj.automated_eligibility_check_complete is not the expected type, validation failed.")
250
262
  obj.work_queue&.is_a?(CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentWorkQueue) != false || raise("Passed value for field obj.work_queue is not the expected type, validation failed.")
251
263
  end
252
264
  end
@@ -5,9 +5,11 @@ module CandidApiClient
5
5
  module Appointments
6
6
  module V1
7
7
  module Types
8
- class AppointmentSortField
9
- START_TIMESTAMP = "startTimestamp"
10
- UPDATED_AT = "updatedAt"
8
+ class AppointmentStatus
9
+ PENDING = "PENDING"
10
+ NOT_READY = "NOT_READY"
11
+ READY = "READY"
12
+ CHECKED_IN = "CHECKED_IN"
11
13
  end
12
14
  end
13
15
  end
@@ -1,10 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../../../common/types/external_provider"
4
3
  require "date"
4
+ require_relative "appointment_status"
5
5
  require_relative "service"
6
- require_relative "appointment_reason"
7
- require_relative "appointment_type"
8
6
  require_relative "appointment_work_queue"
9
7
  require "ostruct"
10
8
  require "json"
@@ -18,20 +16,13 @@ module CandidApiClient
18
16
  class MutableAppointment
19
17
  # @return [String] The Candid-defined patient identifier.
20
18
  attr_reader :patient_id
21
- # @return [Boolean] True if the patient has checked in. Defaults to false.
22
- attr_reader :checked_in
23
- # @return [String] Patient’s initial assigned location or the location to which the patient is
24
- # being moved. This location is stored on the Patient Demographics tab and is used
25
- # when creating orders.
26
- attr_reader :assigned_patient_location
27
- # @return [CandidApiClient::PreEncounter::Common::Types::ExternalProvider] Attending physician information. The attending physician will be stored as the
28
- # Current MD for the patient.
29
- attr_reader :attending_doctor
30
- # @return [CandidApiClient::PreEncounter::Common::Types::ExternalProvider] Referring physician information. The referring physician will be stored as the
31
- # Referring MD in the patient’s Providers list.
32
- attr_reader :referring_doctor
33
19
  # @return [DateTime]
34
20
  attr_reader :start_timestamp
21
+ # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentStatus] Defaults to PENDING. If status is NOT_READY, work_queue must be set. If status
22
+ # is READY or CHECKED_IN, work_queue must be null. If status is CHECKED_IN,
23
+ # checked_in_timestamp must be set. If checked_in_timestamp is set, status must be
24
+ # CHECKED_IN.
25
+ attr_reader :status
35
26
  # @return [Integer] The requested length of time allotted for the appointment. The units are in
36
27
  # minutes.
37
28
  attr_reader :service_duration
@@ -39,15 +30,29 @@ module CandidApiClient
39
30
  attr_reader :services
40
31
  # @return [String] ID for the appointment/order for the event.
41
32
  attr_reader :placer_appointment_id
42
- # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentReason]
43
- attr_reader :appointment_reason
44
- # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentType] Contains the identifier code for the appointment.
45
- attr_reader :appointment_type
33
+ # @return [Integer]
34
+ attr_reader :estimated_copay_cents
35
+ # @return [Integer]
36
+ attr_reader :estimated_patient_responsibility_cents
37
+ # @return [Integer]
38
+ attr_reader :patient_deposit_cents
39
+ # @return [DateTime] The timestamp when the patient checked in for their appointment. If status is
40
+ # CHECKED_IN, checked_in_timestamp must be set. If checked_in_timestamp is set,
41
+ # status must be CHECKED_IN.
42
+ attr_reader :checked_in_timestamp
43
+ # @return [String]
44
+ attr_reader :notes
46
45
  # @return [String] Contains the coded identification of the location being scheduled. Components:
47
46
  # <Identifier (ST)>^<Text (ST)>
48
47
  attr_reader :location_resource_id
48
+ # @return [Boolean] True if the automated eligibility check has been completed. It is not
49
+ # recommended to change this value manually via API. This refers explicitly to the
50
+ # automated eligibility check that occurs a specific number of days before the
51
+ # appointment.
52
+ attr_reader :automated_eligibility_check_complete
49
53
  # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentWorkQueue] The work queue that the appointment belongs to. It is not recommended to change
50
- # this value manually via API.
54
+ # this value manually via API. If status is NOT_READY, work_queue must be set. If
55
+ # status is READY or CHECKED_IN, work_queue must be null.
51
56
  attr_reader :work_queue
52
57
  # @return [OpenStruct] Additional properties unmapped to the current class definition
53
58
  attr_reader :additional_properties
@@ -58,56 +63,68 @@ module CandidApiClient
58
63
  OMIT = Object.new
59
64
 
60
65
  # @param patient_id [String] The Candid-defined patient identifier.
61
- # @param checked_in [Boolean] True if the patient has checked in. Defaults to false.
62
- # @param assigned_patient_location [String] Patient’s initial assigned location or the location to which the patient is
63
- # being moved. This location is stored on the Patient Demographics tab and is used
64
- # when creating orders.
65
- # @param attending_doctor [CandidApiClient::PreEncounter::Common::Types::ExternalProvider] Attending physician information. The attending physician will be stored as the
66
- # Current MD for the patient.
67
- # @param referring_doctor [CandidApiClient::PreEncounter::Common::Types::ExternalProvider] Referring physician information. The referring physician will be stored as the
68
- # Referring MD in the patient’s Providers list.
69
66
  # @param start_timestamp [DateTime]
67
+ # @param status [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentStatus] Defaults to PENDING. If status is NOT_READY, work_queue must be set. If status
68
+ # is READY or CHECKED_IN, work_queue must be null. If status is CHECKED_IN,
69
+ # checked_in_timestamp must be set. If checked_in_timestamp is set, status must be
70
+ # CHECKED_IN.
70
71
  # @param service_duration [Integer] The requested length of time allotted for the appointment. The units are in
71
72
  # minutes.
72
73
  # @param services [Array<CandidApiClient::PreEncounter::Appointments::V1::Types::Service>]
73
74
  # @param placer_appointment_id [String] ID for the appointment/order for the event.
74
- # @param appointment_reason [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentReason]
75
- # @param appointment_type [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentType] Contains the identifier code for the appointment.
75
+ # @param estimated_copay_cents [Integer]
76
+ # @param estimated_patient_responsibility_cents [Integer]
77
+ # @param patient_deposit_cents [Integer]
78
+ # @param checked_in_timestamp [DateTime] The timestamp when the patient checked in for their appointment. If status is
79
+ # CHECKED_IN, checked_in_timestamp must be set. If checked_in_timestamp is set,
80
+ # status must be CHECKED_IN.
81
+ # @param notes [String]
76
82
  # @param location_resource_id [String] Contains the coded identification of the location being scheduled. Components:
77
83
  # <Identifier (ST)>^<Text (ST)>
84
+ # @param automated_eligibility_check_complete [Boolean] True if the automated eligibility check has been completed. It is not
85
+ # recommended to change this value manually via API. This refers explicitly to the
86
+ # automated eligibility check that occurs a specific number of days before the
87
+ # appointment.
78
88
  # @param work_queue [CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentWorkQueue] The work queue that the appointment belongs to. It is not recommended to change
79
- # this value manually via API.
89
+ # this value manually via API. If status is NOT_READY, work_queue must be set. If
90
+ # status is READY or CHECKED_IN, work_queue must be null.
80
91
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
81
92
  # @return [CandidApiClient::PreEncounter::Appointments::V1::Types::MutableAppointment]
82
- def initialize(patient_id:, service_duration:, services:, checked_in: OMIT, assigned_patient_location: OMIT, attending_doctor: OMIT,
83
- referring_doctor: OMIT, start_timestamp: OMIT, placer_appointment_id: OMIT, appointment_reason: OMIT, appointment_type: OMIT, location_resource_id: OMIT, work_queue: OMIT, additional_properties: nil)
93
+ def initialize(patient_id:, start_timestamp:, service_duration:, services:, status: OMIT,
94
+ placer_appointment_id: OMIT, estimated_copay_cents: OMIT, estimated_patient_responsibility_cents: OMIT, patient_deposit_cents: OMIT, checked_in_timestamp: OMIT, notes: OMIT, location_resource_id: OMIT, automated_eligibility_check_complete: OMIT, work_queue: OMIT, additional_properties: nil)
84
95
  @patient_id = patient_id
85
- @checked_in = checked_in if checked_in != OMIT
86
- @assigned_patient_location = assigned_patient_location if assigned_patient_location != OMIT
87
- @attending_doctor = attending_doctor if attending_doctor != OMIT
88
- @referring_doctor = referring_doctor if referring_doctor != OMIT
89
- @start_timestamp = start_timestamp if start_timestamp != OMIT
96
+ @start_timestamp = start_timestamp
97
+ @status = status if status != OMIT
90
98
  @service_duration = service_duration
91
99
  @services = services
92
100
  @placer_appointment_id = placer_appointment_id if placer_appointment_id != OMIT
93
- @appointment_reason = appointment_reason if appointment_reason != OMIT
94
- @appointment_type = appointment_type if appointment_type != OMIT
101
+ @estimated_copay_cents = estimated_copay_cents if estimated_copay_cents != OMIT
102
+ if estimated_patient_responsibility_cents != OMIT
103
+ @estimated_patient_responsibility_cents = estimated_patient_responsibility_cents
104
+ end
105
+ @patient_deposit_cents = patient_deposit_cents if patient_deposit_cents != OMIT
106
+ @checked_in_timestamp = checked_in_timestamp if checked_in_timestamp != OMIT
107
+ @notes = notes if notes != OMIT
95
108
  @location_resource_id = location_resource_id if location_resource_id != OMIT
109
+ if automated_eligibility_check_complete != OMIT
110
+ @automated_eligibility_check_complete = automated_eligibility_check_complete
111
+ end
96
112
  @work_queue = work_queue if work_queue != OMIT
97
113
  @additional_properties = additional_properties
98
114
  @_field_set = {
99
115
  "patient_id": patient_id,
100
- "checked_in": checked_in,
101
- "assigned_patient_location": assigned_patient_location,
102
- "attending_doctor": attending_doctor,
103
- "referring_doctor": referring_doctor,
104
116
  "start_timestamp": start_timestamp,
117
+ "status": status,
105
118
  "service_duration": service_duration,
106
119
  "services": services,
107
120
  "placer_appointment_id": placer_appointment_id,
108
- "appointment_reason": appointment_reason,
109
- "appointment_type": appointment_type,
121
+ "estimated_copay_cents": estimated_copay_cents,
122
+ "estimated_patient_responsibility_cents": estimated_patient_responsibility_cents,
123
+ "patient_deposit_cents": patient_deposit_cents,
124
+ "checked_in_timestamp": checked_in_timestamp,
125
+ "notes": notes,
110
126
  "location_resource_id": location_resource_id,
127
+ "automated_eligibility_check_complete": automated_eligibility_check_complete,
111
128
  "work_queue": work_queue
112
129
  }.reject do |_k, v|
113
130
  v == OMIT
@@ -122,46 +139,40 @@ module CandidApiClient
122
139
  struct = JSON.parse(json_object, object_class: OpenStruct)
123
140
  parsed_json = JSON.parse(json_object)
124
141
  patient_id = struct["patient_id"]
125
- checked_in = struct["checked_in"]
126
- assigned_patient_location = struct["assigned_patient_location"]
127
- if parsed_json["attending_doctor"].nil?
128
- attending_doctor = nil
129
- else
130
- attending_doctor = parsed_json["attending_doctor"].to_json
131
- attending_doctor = CandidApiClient::PreEncounter::Common::Types::ExternalProvider.from_json(json_object: attending_doctor)
132
- end
133
- if parsed_json["referring_doctor"].nil?
134
- referring_doctor = nil
135
- else
136
- referring_doctor = parsed_json["referring_doctor"].to_json
137
- referring_doctor = CandidApiClient::PreEncounter::Common::Types::ExternalProvider.from_json(json_object: referring_doctor)
138
- end
139
142
  start_timestamp = unless parsed_json["start_timestamp"].nil?
140
143
  DateTime.parse(parsed_json["start_timestamp"])
141
144
  end
145
+ status = struct["status"]
142
146
  service_duration = struct["service_duration"]
143
147
  services = parsed_json["services"]&.map do |item|
144
148
  item = item.to_json
145
149
  CandidApiClient::PreEncounter::Appointments::V1::Types::Service.from_json(json_object: item)
146
150
  end
147
151
  placer_appointment_id = struct["placer_appointment_id"]
148
- appointment_reason = struct["appointment_reason"]
149
- appointment_type = struct["appointment_type"]
152
+ estimated_copay_cents = struct["estimated_copay_cents"]
153
+ estimated_patient_responsibility_cents = struct["estimated_patient_responsibility_cents"]
154
+ patient_deposit_cents = struct["patient_deposit_cents"]
155
+ checked_in_timestamp = unless parsed_json["checked_in_timestamp"].nil?
156
+ DateTime.parse(parsed_json["checked_in_timestamp"])
157
+ end
158
+ notes = struct["notes"]
150
159
  location_resource_id = struct["location_resource_id"]
160
+ automated_eligibility_check_complete = struct["automated_eligibility_check_complete"]
151
161
  work_queue = struct["work_queue"]
152
162
  new(
153
163
  patient_id: patient_id,
154
- checked_in: checked_in,
155
- assigned_patient_location: assigned_patient_location,
156
- attending_doctor: attending_doctor,
157
- referring_doctor: referring_doctor,
158
164
  start_timestamp: start_timestamp,
165
+ status: status,
159
166
  service_duration: service_duration,
160
167
  services: services,
161
168
  placer_appointment_id: placer_appointment_id,
162
- appointment_reason: appointment_reason,
163
- appointment_type: appointment_type,
169
+ estimated_copay_cents: estimated_copay_cents,
170
+ estimated_patient_responsibility_cents: estimated_patient_responsibility_cents,
171
+ patient_deposit_cents: patient_deposit_cents,
172
+ checked_in_timestamp: checked_in_timestamp,
173
+ notes: notes,
164
174
  location_resource_id: location_resource_id,
175
+ automated_eligibility_check_complete: automated_eligibility_check_complete,
165
176
  work_queue: work_queue,
166
177
  additional_properties: struct
167
178
  )
@@ -182,17 +193,18 @@ module CandidApiClient
182
193
  # @return [Void]
183
194
  def self.validate_raw(obj:)
184
195
  obj.patient_id.is_a?(String) != false || raise("Passed value for field obj.patient_id is not the expected type, validation failed.")
185
- obj.checked_in&.is_a?(Boolean) != false || raise("Passed value for field obj.checked_in is not the expected type, validation failed.")
186
- obj.assigned_patient_location&.is_a?(String) != false || raise("Passed value for field obj.assigned_patient_location is not the expected type, validation failed.")
187
- obj.attending_doctor.nil? || CandidApiClient::PreEncounter::Common::Types::ExternalProvider.validate_raw(obj: obj.attending_doctor)
188
- obj.referring_doctor.nil? || CandidApiClient::PreEncounter::Common::Types::ExternalProvider.validate_raw(obj: obj.referring_doctor)
189
- obj.start_timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.start_timestamp is not the expected type, validation failed.")
196
+ obj.start_timestamp.is_a?(DateTime) != false || raise("Passed value for field obj.start_timestamp is not the expected type, validation failed.")
197
+ obj.status&.is_a?(CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
190
198
  obj.service_duration.is_a?(Integer) != false || raise("Passed value for field obj.service_duration is not the expected type, validation failed.")
191
199
  obj.services.is_a?(Array) != false || raise("Passed value for field obj.services is not the expected type, validation failed.")
192
200
  obj.placer_appointment_id&.is_a?(String) != false || raise("Passed value for field obj.placer_appointment_id is not the expected type, validation failed.")
193
- obj.appointment_reason&.is_a?(CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentReason) != false || raise("Passed value for field obj.appointment_reason is not the expected type, validation failed.")
194
- obj.appointment_type&.is_a?(CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentType) != false || raise("Passed value for field obj.appointment_type is not the expected type, validation failed.")
201
+ obj.estimated_copay_cents&.is_a?(Integer) != false || raise("Passed value for field obj.estimated_copay_cents is not the expected type, validation failed.")
202
+ obj.estimated_patient_responsibility_cents&.is_a?(Integer) != false || raise("Passed value for field obj.estimated_patient_responsibility_cents is not the expected type, validation failed.")
203
+ obj.patient_deposit_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_deposit_cents is not the expected type, validation failed.")
204
+ obj.checked_in_timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.checked_in_timestamp is not the expected type, validation failed.")
205
+ obj.notes&.is_a?(String) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.")
195
206
  obj.location_resource_id&.is_a?(String) != false || raise("Passed value for field obj.location_resource_id is not the expected type, validation failed.")
207
+ obj.automated_eligibility_check_complete&.is_a?(Boolean) != false || raise("Passed value for field obj.automated_eligibility_check_complete is not the expected type, validation failed.")
196
208
  obj.work_queue&.is_a?(CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentWorkQueue) != false || raise("Passed value for field obj.work_queue is not the expected type, validation failed.")
197
209
  end
198
210
  end
@@ -93,7 +93,7 @@ module CandidApiClient
93
93
  # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage]
94
94
  # @example
95
95
  # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
96
- # api.pre_encounter.coverages.v_1.create(request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { start: {"key":"value"}, end_: {"key":"value"} } }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", plan_type: SELF_PAY, type: C_01, period: { start: {"key":"value"}, end_: {"key":"value"} }, insurance_card_image_locator: "string" }, verified: true, eligibility_checks: [{ check_id: "string", service_code: MEDICAL_CARE, status: CREATED, initiated_by: "string", initiated_at: DateTime.parse(2024-01-15T09:30:00.000Z) }], benefits: { plan_coverage: {"key":"value"}, service_specific_coverage: {"key":"value"} } })
96
+ # api.pre_encounter.coverages.v_1.create(request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) } }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", plan_type: SELF_PAY, type: C_01, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) }, insurance_card_image_locator: "string" }, verified: true, eligibility_checks: [{ check_id: "string", service_code: MEDICAL_CARE, status: CREATED, initiated_by: "string", initiated_at: DateTime.parse(2024-01-15T09:30:00.000Z) }], benefits: { plan_coverage: {"key":"value"}, service_specific_coverage: {"key":"value"} } })
97
97
  def create(request:, request_options: nil)
98
98
  response = @request_client.conn.post do |req|
99
99
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -181,7 +181,7 @@ module CandidApiClient
181
181
  # api.pre_encounter.coverages.v_1.update(
182
182
  # id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
183
183
  # version: "string",
184
- # request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { start: {"key":"value"}, end_: {"key":"value"} } }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", plan_type: SELF_PAY, type: C_01, period: { start: {"key":"value"}, end_: {"key":"value"} }, insurance_card_image_locator: "string" }, verified: true, eligibility_checks: [{ check_id: "string", service_code: MEDICAL_CARE, status: CREATED, initiated_by: "string", initiated_at: DateTime.parse(2024-01-15T09:30:00.000Z) }], benefits: { plan_coverage: {"key":"value"}, service_specific_coverage: {"key":"value"} } }
184
+ # request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) } }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", plan_type: SELF_PAY, type: C_01, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) }, insurance_card_image_locator: "string" }, verified: true, eligibility_checks: [{ check_id: "string", service_code: MEDICAL_CARE, status: CREATED, initiated_by: "string", initiated_at: DateTime.parse(2024-01-15T09:30:00.000Z) }], benefits: { plan_coverage: {"key":"value"}, service_specific_coverage: {"key":"value"} } }
185
185
  # )
186
186
  def update(id:, version:, request:, request_options: nil)
187
187
  response = @request_client.conn.put do |req|
@@ -449,7 +449,7 @@ module CandidApiClient
449
449
  # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage]
450
450
  # @example
451
451
  # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
452
- # api.pre_encounter.coverages.v_1.create(request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { start: {"key":"value"}, end_: {"key":"value"} } }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", plan_type: SELF_PAY, type: C_01, period: { start: {"key":"value"}, end_: {"key":"value"} }, insurance_card_image_locator: "string" }, verified: true, eligibility_checks: [{ check_id: "string", service_code: MEDICAL_CARE, status: CREATED, initiated_by: "string", initiated_at: DateTime.parse(2024-01-15T09:30:00.000Z) }], benefits: { plan_coverage: {"key":"value"}, service_specific_coverage: {"key":"value"} } })
452
+ # api.pre_encounter.coverages.v_1.create(request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) } }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", plan_type: SELF_PAY, type: C_01, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) }, insurance_card_image_locator: "string" }, verified: true, eligibility_checks: [{ check_id: "string", service_code: MEDICAL_CARE, status: CREATED, initiated_by: "string", initiated_at: DateTime.parse(2024-01-15T09:30:00.000Z) }], benefits: { plan_coverage: {"key":"value"}, service_specific_coverage: {"key":"value"} } })
453
453
  def create(request:, request_options: nil)
454
454
  Async do
455
455
  response = @request_client.conn.post do |req|
@@ -539,7 +539,7 @@ module CandidApiClient
539
539
  # api.pre_encounter.coverages.v_1.update(
540
540
  # id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
541
541
  # version: "string",
542
- # request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { start: {"key":"value"}, end_: {"key":"value"} } }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", plan_type: SELF_PAY, type: C_01, period: { start: {"key":"value"}, end_: {"key":"value"} }, insurance_card_image_locator: "string" }, verified: true, eligibility_checks: [{ check_id: "string", service_code: MEDICAL_CARE, status: CREATED, initiated_by: "string", initiated_at: DateTime.parse(2024-01-15T09:30:00.000Z) }], benefits: { plan_coverage: {"key":"value"}, service_specific_coverage: {"key":"value"} } }
542
+ # request: { status: ACTIVE, subscriber: { name: { family: "string", given: ["string"], use: USUAL, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) } }, date_of_birth: DateTime.parse(2023-01-15), biological_sex: FEMALE }, relationship: SELF, patient: "string", insurance_plan: { member_id: "string", payer_id: "string", payer_name: "string", group_number: "string", name: "string", plan_type: SELF_PAY, type: C_01, period: { start: DateTime.parse(2023-01-15), end_: DateTime.parse(2023-01-15) }, insurance_card_image_locator: "string" }, verified: true, eligibility_checks: [{ check_id: "string", service_code: MEDICAL_CARE, status: CREATED, initiated_by: "string", initiated_at: DateTime.parse(2024-01-15T09:30:00.000Z) }], benefits: { plan_coverage: {"key":"value"}, service_specific_coverage: {"key":"value"} } }
543
543
  # )
544
544
  def update(id:, version:, request:, request_options: nil)
545
545
  Async do