Class: CandidApiClient::PreEncounter::Appointments::V1::Types::MutableAppointment
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Appointments::V1::Types::MutableAppointment
- 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
-
#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.
- #estimated_copay_cents ⇒ Integer readonly
- #estimated_patient_responsibility_cents ⇒ Integer readonly
-
#location_resource_id ⇒ String
readonly
Contains the coded identification of the location being scheduled.
- #notes ⇒ String readonly
- #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.
-
#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::MutableAppointment
Deserialize a JSON object to an instance of MutableAppointment.
-
.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(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 constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of MutableAppointment to a JSON object.
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
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 = @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 = { "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.
62 63 64 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 62 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.
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_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.
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_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.
46 47 48 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 46 def @checked_in_timestamp end |
#estimated_copay_cents ⇒ Integer (readonly)
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_cents ⇒ Integer (readonly)
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_id ⇒ String (readonly)
Returns 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 |
#notes ⇒ String (readonly)
48 49 50 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 48 def notes @notes end |
#patient_deposit_cents ⇒ Integer (readonly)
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_id ⇒ String (readonly)
Returns 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_id ⇒ String (readonly)
Returns 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_duration ⇒ Integer (readonly)
Returns 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 |
#services ⇒ Array<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_timestamp ⇒ DateTime (readonly)
21 22 23 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 21 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.
26 27 28 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb', line 26 def status @status 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.
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"] = 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( 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.
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..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 MutableAppointment to a JSON object
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 |