Class: CandidApiClient::PreEncounter::Appointments::V1::Types::Appointment

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb

Overview

An appointment object with immutable server-owned properties.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, patient_id:, start_timestamp:, service_duration:, services:, status: OMIT, placer_appointment_id: OMIT, attending_doctor: 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) ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::Appointment

Parameters:

  • id (String)
  • organization_id (String)

    The organization that owns this appointment.

  • deactivated (Boolean)

    True if the appointment is deactivated. Deactivated appointments are not returned in search results but are returned in all other endpoints including scan.

  • version (Integer)

    The version of the appointment. Any update to any property of an appointment object will create a new version.

  • updated_at (DateTime)
  • updating_user_id (String)

    The user ID of the user who last updated the appointment.

  • patient_id (String)

    The Candid-defined patient identifier.

  • start_timestamp (DateTime)
  • status (CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentStatus) (defaults to: OMIT)

    Defaults to PENDING. If status is NOT_READY, work_queue must be set. If status is READY or CHECKED_IN, work_queue must be null. If status is CHECKED_IN, checked_in_timestamp must be set. If checked_in_timestamp is set, status must be CHECKED_IN.

  • service_duration (Integer)

    The requested length of time allotted for the appointment. The units are in minutes.

  • services (Array<CandidApiClient::PreEncounter::Appointments::V1::Types::Service>)
  • placer_appointment_id (String) (defaults to: OMIT)

    ID for the appointment/order for the event.

  • attending_doctor (CandidApiClient::PreEncounter::Common::Types::ExternalProvider) (defaults to: OMIT)

    Attending physician information. The attending physician will be stored as the Current MD for the patient.

  • estimated_copay_cents (Integer) (defaults to: OMIT)
  • estimated_patient_responsibility_cents (Integer) (defaults to: OMIT)
  • patient_deposit_cents (Integer) (defaults to: OMIT)
  • checked_in_timestamp (DateTime) (defaults to: OMIT)

    The timestamp when the patient checked in for their appointment. If status is CHECKED_IN, checked_in_timestamp must be set. If checked_in_timestamp is set, status must be CHECKED_IN.

  • notes (String) (defaults to: OMIT)
  • location_resource_id (String) (defaults to: OMIT)

    Contains the coded identification of the location being scheduled. Components: <Identifier (ST)>^<Text (ST)>

  • automated_eligibility_check_complete (Boolean) (defaults to: OMIT)

    True if the automated eligibility check has been completed. It is not recommended to change this value manually via API. This refers explicitly to the automated eligibility check that occurs a specific number of days before the appointment.

  • work_queue (CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentWorkQueue) (defaults to: OMIT)

    The work queue that the appointment belongs to. It is not recommended to change this value manually via API. If status is NOT_READY, work_queue must be set. If status is READY or CHECKED_IN, work_queue must be null.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 123

def initialize(id:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, patient_id:,
               start_timestamp:, service_duration:, services:, status: OMIT, placer_appointment_id: OMIT, attending_doctor: 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)
  @id = id
  @organization_id = organization_id
  @deactivated = deactivated
  @version = version
  @updated_at = updated_at
  @updating_user_id = updating_user_id
  @patient_id = patient_id
  @start_timestamp = start_timestamp
  @status = status if status != OMIT
  @service_duration = service_duration
  @services = services
  @placer_appointment_id = placer_appointment_id if placer_appointment_id != OMIT
  @attending_doctor = attending_doctor if attending_doctor != OMIT
  @estimated_copay_cents = estimated_copay_cents if estimated_copay_cents != OMIT
  if estimated_patient_responsibility_cents != OMIT
    @estimated_patient_responsibility_cents = estimated_patient_responsibility_cents
  end
  @patient_deposit_cents = patient_deposit_cents if patient_deposit_cents != OMIT
  @checked_in_timestamp = checked_in_timestamp if checked_in_timestamp != OMIT
  @notes = notes if notes != OMIT
  @location_resource_id = location_resource_id if location_resource_id != OMIT
  if automated_eligibility_check_complete != OMIT
    @automated_eligibility_check_complete = automated_eligibility_check_complete
  end
  @work_queue = work_queue if work_queue != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "organization_id": organization_id,
    "deactivated": deactivated,
    "version": version,
    "updated_at": updated_at,
    "updating_user_id": updating_user_id,
    "patient_id": patient_id,
    "start_timestamp": start_timestamp,
    "status": status,
    "service_duration": service_duration,
    "services": services,
    "placer_appointment_id": placer_appointment_id,
    "attending_doctor": attending_doctor,
    "estimated_copay_cents": estimated_copay_cents,
    "estimated_patient_responsibility_cents": estimated_patient_responsibility_cents,
    "patient_deposit_cents": patient_deposit_cents,
    "checked_in_timestamp": checked_in_timestamp,
    "notes": notes,
    "location_resource_id": location_resource_id,
    "automated_eligibility_check_complete": automated_eligibility_check_complete,
    "work_queue": work_queue
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



77
78
79
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 77

def additional_properties
  @additional_properties
end

#attending_doctorCandidApiClient::PreEncounter::Common::Types::ExternalProvider (readonly)

Returns Attending physician information. The attending physician will be stored as the Current MD for the patient.

Returns:



51
52
53
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 51

def attending_doctor
  @attending_doctor
end

#automated_eligibility_check_completeBoolean (readonly)

Returns True if the automated eligibility check has been completed. It is not recommended to change this value manually via API. This refers explicitly to the automated eligibility check that occurs a specific number of days before the appointment.

Returns:

  • (Boolean)

    True if the automated eligibility check has been completed. It is not recommended to change this value manually via API. This refers explicitly to the automated eligibility check that occurs a specific number of days before the appointment.



71
72
73
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 71

def automated_eligibility_check_complete
  @automated_eligibility_check_complete
end

#checked_in_timestampDateTime (readonly)

Returns The timestamp when the patient checked in for their appointment. If status is CHECKED_IN, checked_in_timestamp must be set. If checked_in_timestamp is set, status must be CHECKED_IN.

Returns:

  • (DateTime)

    The timestamp when the patient checked in for their appointment. If status is CHECKED_IN, checked_in_timestamp must be set. If checked_in_timestamp is set, status must be CHECKED_IN.



61
62
63
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 61

def checked_in_timestamp
  @checked_in_timestamp
end

#deactivatedBoolean (readonly)

True if the appointment is deactivated. Deactivated appointments are not returned in search results but are returned in all other endpoints including scan.

Returns:

  • (Boolean)

    True if the appointment is deactivated. Deactivated appointments are not returned in search results but are returned in all other endpoints including scan.



25
26
27
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 25

def deactivated
  @deactivated
end

#estimated_copay_centsInteger (readonly)

Returns:

  • (Integer)


53
54
55
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 53

def estimated_copay_cents
  @estimated_copay_cents
end

#estimated_patient_responsibility_centsInteger (readonly)

Returns:

  • (Integer)


55
56
57
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 55

def estimated_patient_responsibility_cents
  @estimated_patient_responsibility_cents
end

#idString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 19

def id
  @id
end

#location_resource_idString (readonly)

Returns Contains the coded identification of the location being scheduled. Components: <Identifier (ST)>^<Text (ST)>.

Returns:

  • (String)

    Contains the coded identification of the location being scheduled. Components: <Identifier (ST)>^<Text (ST)>



66
67
68
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 66

def location_resource_id
  @location_resource_id
end

#notesString (readonly)

Returns:

  • (String)


63
64
65
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 63

def notes
  @notes
end

#organization_idString (readonly)

Returns The organization that owns this appointment.

Returns:

  • (String)

    The organization that owns this appointment.



21
22
23
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 21

def organization_id
  @organization_id
end

#patient_deposit_centsInteger (readonly)

Returns:

  • (Integer)


57
58
59
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 57

def patient_deposit_cents
  @patient_deposit_cents
end

#patient_idString (readonly)

Returns The Candid-defined patient identifier.

Returns:

  • (String)

    The Candid-defined patient identifier.



34
35
36
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 34

def patient_id
  @patient_id
end

#placer_appointment_idString (readonly)

Returns ID for the appointment/order for the event.

Returns:

  • (String)

    ID for the appointment/order for the event.



48
49
50
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 48

def placer_appointment_id
  @placer_appointment_id
end

#service_durationInteger (readonly)

Returns The requested length of time allotted for the appointment. The units are in minutes.

Returns:

  • (Integer)

    The requested length of time allotted for the appointment. The units are in minutes.



44
45
46
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 44

def service_duration
  @service_duration
end

#servicesArray<CandidApiClient::PreEncounter::Appointments::V1::Types::Service> (readonly)



46
47
48
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 46

def services
  @services
end

#start_timestampDateTime (readonly)

Returns:

  • (DateTime)


36
37
38
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 36

def start_timestamp
  @start_timestamp
end

#statusCandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentStatus (readonly)

Returns Defaults to PENDING. If status is NOT_READY, work_queue must be set. If status is READY or CHECKED_IN, work_queue must be null. If status is CHECKED_IN, checked_in_timestamp must be set. If checked_in_timestamp is set, status must be CHECKED_IN.

Returns:



41
42
43
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 41

def status
  @status
end

#updated_atDateTime (readonly)

Returns:

  • (DateTime)


30
31
32
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 30

def updated_at
  @updated_at
end

#updating_user_idString (readonly)

Returns The user ID of the user who last updated the appointment.

Returns:

  • (String)

    The user ID of the user who last updated the appointment.



32
33
34
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 32

def updating_user_id
  @updating_user_id
end

#versionInteger (readonly)

Returns The version of the appointment. Any update to any property of an appointment object will create a new version.

Returns:

  • (Integer)

    The version of the appointment. Any update to any property of an appointment object will create a new version.



28
29
30
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 28

def version
  @version
end

#work_queueCandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentWorkQueue (readonly)

Returns The work queue that the appointment belongs to. It is not recommended to change this value manually via API. If status is NOT_READY, work_queue must be set. If status is READY or CHECKED_IN, work_queue must be null.

Returns:



75
76
77
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 75

def work_queue
  @work_queue
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::Appointment

Deserialize a JSON object to an instance of Appointment

Parameters:

  • json_object (String)

Returns:



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 182

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = struct["id"]
  organization_id = struct["organization_id"]
  deactivated = struct["deactivated"]
  version = struct["version"]
  updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
  updating_user_id = struct["updating_user_id"]
  patient_id = struct["patient_id"]
  start_timestamp = unless parsed_json["start_timestamp"].nil?
                      DateTime.parse(parsed_json["start_timestamp"])
                    end
  status = struct["status"]
  service_duration = struct["service_duration"]
  services = parsed_json["services"]&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Appointments::V1::Types::Service.from_json(json_object: item)
  end
  placer_appointment_id = struct["placer_appointment_id"]
  if parsed_json["attending_doctor"].nil?
    attending_doctor = nil
  else
    attending_doctor = parsed_json["attending_doctor"].to_json
    attending_doctor = CandidApiClient::PreEncounter::Common::Types::ExternalProvider.from_json(json_object: attending_doctor)
  end
  estimated_copay_cents = struct["estimated_copay_cents"]
  estimated_patient_responsibility_cents = struct["estimated_patient_responsibility_cents"]
  patient_deposit_cents = struct["patient_deposit_cents"]
  checked_in_timestamp = unless parsed_json["checked_in_timestamp"].nil?
                           DateTime.parse(parsed_json["checked_in_timestamp"])
                         end
  notes = struct["notes"]
  location_resource_id = struct["location_resource_id"]
  automated_eligibility_check_complete = struct["automated_eligibility_check_complete"]
  work_queue = struct["work_queue"]
  new(
    id: id,
    organization_id: organization_id,
    deactivated: deactivated,
    version: version,
    updated_at: updated_at,
    updating_user_id: updating_user_id,
    patient_id: patient_id,
    start_timestamp: start_timestamp,
    status: status,
    service_duration: service_duration,
    services: services,
    placer_appointment_id: placer_appointment_id,
    attending_doctor: attending_doctor,
    estimated_copay_cents: estimated_copay_cents,
    estimated_patient_responsibility_cents: estimated_patient_responsibility_cents,
    patient_deposit_cents: patient_deposit_cents,
    checked_in_timestamp: checked_in_timestamp,
    notes: notes,
    location_resource_id: location_resource_id,
    automated_eligibility_check_complete: automated_eligibility_check_complete,
    work_queue: work_queue,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 257

def self.validate_raw(obj:)
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.organization_id.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
  obj.deactivated.is_a?(Boolean) != false || raise("Passed value for field obj.deactivated is not the expected type, validation failed.")
  obj.version.is_a?(Integer) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
  obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
  obj.updating_user_id.is_a?(String) != false || raise("Passed value for field obj.updating_user_id is not the expected type, validation failed.")
  obj.patient_id.is_a?(String) != false || raise("Passed value for field obj.patient_id is not the expected type, validation failed.")
  obj.start_timestamp.is_a?(DateTime) != false || raise("Passed value for field obj.start_timestamp is not the expected type, validation failed.")
  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.")
  obj.service_duration.is_a?(Integer) != false || raise("Passed value for field obj.service_duration is not the expected type, validation failed.")
  obj.services.is_a?(Array) != false || raise("Passed value for field obj.services is not the expected type, validation failed.")
  obj.placer_appointment_id&.is_a?(String) != false || raise("Passed value for field obj.placer_appointment_id is not the expected type, validation failed.")
  obj.attending_doctor.nil? || CandidApiClient::PreEncounter::Common::Types::ExternalProvider.validate_raw(obj: obj.attending_doctor)
  obj.estimated_copay_cents&.is_a?(Integer) != false || raise("Passed value for field obj.estimated_copay_cents is not the expected type, validation failed.")
  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.")
  obj.patient_deposit_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_deposit_cents is not the expected type, validation failed.")
  obj.checked_in_timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.checked_in_timestamp is not the expected type, validation failed.")
  obj.notes&.is_a?(String) != false || raise("Passed value for field obj.notes is not the expected type, validation failed.")
  obj.location_resource_id&.is_a?(String) != false || raise("Passed value for field obj.location_resource_id is not the expected type, validation failed.")
  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.")
  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.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of Appointment to a JSON object

Returns:

  • (String)


247
248
249
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 247

def to_json(*_args)
  @_field_set&.to_json
end