Class: CandidApiClient::PreEncounter::Appointments::V1::Types::MutableAppointment

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

Overview

An object representing a appointment.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(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::MutableAppointment

Parameters:

  • 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



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 99

def initialize(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)
  @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 = {
    "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



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

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:



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

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.



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

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.



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

def checked_in_timestamp
  @checked_in_timestamp
end

#estimated_copay_centsInteger (readonly)

Returns:

  • (Integer)


38
39
40
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 38

def estimated_copay_cents
  @estimated_copay_cents
end

#estimated_patient_responsibility_centsInteger (readonly)

Returns:

  • (Integer)


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

def estimated_patient_responsibility_cents
  @estimated_patient_responsibility_cents
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)>



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

def location_resource_id
  @location_resource_id
end

#notesString (readonly)

Returns:

  • (String)


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

def notes
  @notes
end

#patient_deposit_centsInteger (readonly)

Returns:

  • (Integer)


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

def patient_deposit_cents
  @patient_deposit_cents
end

#patient_idString (readonly)

Returns The Candid-defined patient identifier.

Returns:

  • (String)

    The Candid-defined patient identifier.



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

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.



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

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.



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

def service_duration
  @service_duration
end

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



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

def services
  @services
end

#start_timestampDateTime (readonly)

Returns:

  • (DateTime)


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

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:



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

def status
  @status
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:



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

def work_queue
  @work_queue
end

Class Method Details

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

Deserialize a JSON object to an instance of MutableAppointment



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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 146

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  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(
    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)


209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 209

def self.validate_raw(obj:)
  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 MutableAppointment to a JSON object

Returns:

  • (String)


199
200
201
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 199

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