Class: CandidApiClient::PreEncounter::Appointments::V1::Types::Appointment
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Appointments::V1::Types::Appointment
- 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
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#attending_doctor ⇒ CandidApiClient::PreEncounter::Common::Types::ExternalProvider
readonly
Attending physician information.
-
#automated_eligibility_check_complete ⇒ Boolean
readonly
True if the automated eligibility check has been completed.
-
#checked_in_timestamp ⇒ DateTime
readonly
The timestamp when the patient checked in for their appointment.
-
#deactivated ⇒ Boolean
readonly
True if the appointment is deactivated.
- #estimated_copay_cents ⇒ Integer readonly
- #estimated_patient_responsibility_cents ⇒ Integer readonly
- #id ⇒ String readonly
-
#location_resource_id ⇒ String
readonly
Contains the coded identification of the location being scheduled.
- #notes ⇒ String readonly
-
#organization_id ⇒ String
readonly
The organization that owns this appointment.
- #patient_deposit_cents ⇒ Integer readonly
-
#patient_id ⇒ String
readonly
The Candid-defined patient identifier.
-
#placer_appointment_id ⇒ String
readonly
ID for the appointment/order for the event.
-
#service_duration ⇒ Integer
readonly
The requested length of time allotted for the appointment.
- #services ⇒ Array<CandidApiClient::PreEncounter::Appointments::V1::Types::Service> readonly
- #start_timestamp ⇒ DateTime readonly
-
#status ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentStatus
readonly
Defaults to PENDING.
- #updated_at ⇒ DateTime readonly
-
#updating_user_id ⇒ String
readonly
The user ID of the user who last updated the appointment.
-
#version ⇒ Integer
readonly
The version of the appointment.
-
#work_queue ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::AppointmentWorkQueue
readonly
The work queue that the appointment belongs to.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::Appointment
Deserialize a JSON object to an instance of Appointment.
-
.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.
Instance Method Summary collapse
- #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 constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Appointment to a JSON object.
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
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 = @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 = if != 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": , "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": , "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_properties ⇒ OpenStruct (readonly)
Returns 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_doctor ⇒ CandidApiClient::PreEncounter::Common::Types::ExternalProvider (readonly)
Returns Attending physician information. The attending physician will be stored as the Current MD for the patient.
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_complete ⇒ Boolean (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.
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_timestamp ⇒ DateTime (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.
61 62 63 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 61 def @checked_in_timestamp end |
#deactivated ⇒ Boolean (readonly)
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_cents ⇒ Integer (readonly)
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_cents ⇒ Integer (readonly)
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 |
#id ⇒ String (readonly)
19 20 21 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 19 def id @id end |
#location_resource_id ⇒ String (readonly)
Returns 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 |
#notes ⇒ String (readonly)
63 64 65 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 63 def notes @notes end |
#organization_id ⇒ String (readonly)
Returns 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_cents ⇒ Integer (readonly)
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_id ⇒ String (readonly)
Returns 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_id ⇒ String (readonly)
Returns 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_duration ⇒ Integer (readonly)
Returns 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 |
#services ⇒ Array<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_timestamp ⇒ DateTime (readonly)
36 37 38 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 36 def @start_timestamp end |
#status ⇒ CandidApiClient::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.
41 42 43 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 41 def status @status end |
#updated_at ⇒ DateTime (readonly)
30 31 32 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb', line 30 def updated_at @updated_at end |
#updating_user_id ⇒ String (readonly)
Returns 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 |
#version ⇒ Integer (readonly)
Returns 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_queue ⇒ CandidApiClient::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.
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
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"] = 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"] = 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: , 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: , 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.
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..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.&.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
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 |