Class: CandidApiClient::Encounters::V4::Types::EncounterBase
- Inherits:
-
Object
- Object
- CandidApiClient::Encounters::V4::Types::EncounterBase
- Defined in:
- lib/candidhealth/encounters/v_4/types/encounter_base.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_information ⇒ String
readonly
Defines additional information on the claim needed by the payer.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#admission_date ⇒ Date
readonly
837p Loop2300 DTP*435, CMS-1500 Box 18 Required on all ambulance claims when the patient was known to be admitted to the hospital.
-
#appointment_type ⇒ String
readonly
Human-readable description of the appointment type (ex: “Acupuncture - Headaches”).
-
#benefits_assigned_to_provider ⇒ Boolean
readonly
Whether this patient has authorized insurance payments to be made to you, not them.
-
#billable_status ⇒ CandidApiClient::Encounters::V4::Types::BillableStatusType
readonly
Defines if the Encounter is to be billed by Candid to the responsible_party.
-
#date_of_service ⇒ Date
readonly
Date formatted as YYYY-MM-DD; eg: 2019-08-24.
-
#delay_reason_code ⇒ CandidApiClient::Commons::Types::DelayReasonCode
readonly
837i Loop2300, CLM-1300 Box 20 Code indicating the reason why a request was delayed.
-
#discharge_date ⇒ Date
readonly
837p Loop2300 DTP*096, CMS-1500 Box 18 Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
-
#end_date_of_service ⇒ Date
readonly
Date formatted as YYYY-MM-DD; eg: 2019-08-25.
- #existing_medications ⇒ Array<CandidApiClient::Encounters::V4::Types::Medication> readonly
-
#external_id ⇒ String
readonly
A client-specified unique ID to associate with this encounter; for example, your internal encounter ID or a Dr.
- #interventions ⇒ Array<CandidApiClient::Encounters::V4::Types::Intervention> readonly
-
#last_menstrual_period_date ⇒ Date
readonly
837p Loop2300 DTP*484, CMS-1500 Box 14 Required when, in the judgment of the provider, the services on this claim are related to the patient’s pregnancy.
-
#onset_of_current_illness_or_symptom_date ⇒ Date
readonly
837p Loop2300 DTP*431, CMS-1500 Box 14 Required for the initial medical service or visit performed in response to a medical emergency when the date is available and is different than the date of service.
-
#patient_authorized_release ⇒ Boolean
readonly
Whether this patient has authorized the release of medical information for billing purpose.
-
#pay_to_address ⇒ CandidApiClient::Commons::Types::StreetAddressLongZip
readonly
Specifies the address to which payments for the claim should be sent.
-
#provider_accepts_assignment ⇒ Boolean
readonly
Whether you have accepted the patient’s authorization for insurance payments to be made to you, not them.
-
#service_authorization_exception_code ⇒ CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode
readonly
837p Loop2300 REF*4N Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without obtaining the authorization.
-
#synchronicity ⇒ CandidApiClient::Encounters::V4::Types::SynchronicityType
readonly
Whether or not this was a synchronous or asynchronous encounter.
- #vitals ⇒ CandidApiClient::Encounters::V4::Types::Vitals readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::EncounterBase
Deserialize a JSON object to an instance of EncounterBase.
-
.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(external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, date_of_service: OMIT, end_date_of_service: OMIT, appointment_type: OMIT, existing_medications: OMIT, vitals: OMIT, interventions: OMIT, pay_to_address: OMIT, synchronicity: OMIT, additional_information: OMIT, service_authorization_exception_code: OMIT, admission_date: OMIT, discharge_date: OMIT, onset_of_current_illness_or_symptom_date: OMIT, last_menstrual_period_date: OMIT, delay_reason_code: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::EncounterBase constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of EncounterBase to a JSON object.
Constructor Details
#initialize(external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, date_of_service: OMIT, end_date_of_service: OMIT, appointment_type: OMIT, existing_medications: OMIT, vitals: OMIT, interventions: OMIT, pay_to_address: OMIT, synchronicity: OMIT, additional_information: OMIT, service_authorization_exception_code: OMIT, admission_date: OMIT, discharge_date: OMIT, onset_of_current_illness_or_symptom_date: OMIT, last_menstrual_period_date: OMIT, delay_reason_code: OMIT, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::EncounterBase
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 243 244 245 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 194 def initialize(external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, date_of_service: OMIT, end_date_of_service: OMIT, appointment_type: OMIT, existing_medications: OMIT, vitals: OMIT, interventions: OMIT, pay_to_address: OMIT, synchronicity: OMIT, additional_information: OMIT, service_authorization_exception_code: OMIT, admission_date: OMIT, discharge_date: OMIT, onset_of_current_illness_or_symptom_date: OMIT, last_menstrual_period_date: OMIT, delay_reason_code: OMIT, additional_properties: nil) @external_id = external_id @date_of_service = date_of_service if date_of_service != OMIT @end_date_of_service = end_date_of_service if end_date_of_service != OMIT @patient_authorized_release = @benefits_assigned_to_provider = benefits_assigned_to_provider @provider_accepts_assignment = provider_accepts_assignment @appointment_type = appointment_type if appointment_type != OMIT @existing_medications = existing_medications if existing_medications != OMIT @vitals = vitals if vitals != OMIT @interventions = interventions if interventions != OMIT @pay_to_address = pay_to_address if pay_to_address != OMIT @synchronicity = synchronicity if synchronicity != OMIT @billable_status = billable_status @additional_information = additional_information if additional_information != OMIT if != OMIT @service_authorization_exception_code = end @admission_date = admission_date if admission_date != OMIT @discharge_date = discharge_date if discharge_date != OMIT if onset_of_current_illness_or_symptom_date != OMIT @onset_of_current_illness_or_symptom_date = onset_of_current_illness_or_symptom_date end @last_menstrual_period_date = last_menstrual_period_date if last_menstrual_period_date != OMIT @delay_reason_code = delay_reason_code if delay_reason_code != OMIT @additional_properties = additional_properties @_field_set = { "external_id": external_id, "date_of_service": date_of_service, "end_date_of_service": end_date_of_service, "patient_authorized_release": , "benefits_assigned_to_provider": benefits_assigned_to_provider, "provider_accepts_assignment": provider_accepts_assignment, "appointment_type": appointment_type, "existing_medications": existing_medications, "vitals": vitals, "interventions": interventions, "pay_to_address": pay_to_address, "synchronicity": synchronicity, "billable_status": billable_status, "additional_information": additional_information, "service_authorization_exception_code": , "admission_date": admission_date, "discharge_date": discharge_date, "onset_of_current_illness_or_symptom_date": onset_of_current_illness_or_symptom_date, "last_menstrual_period_date": last_menstrual_period_date, "delay_reason_code": delay_reason_code }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_information ⇒ String (readonly)
Returns Defines additional information on the claim needed by the payer. Box 19 on the CMS-1500 claim form.
80 81 82 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 80 def additional_information @additional_information end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
113 114 115 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 113 def additional_properties @additional_properties end |
#admission_date ⇒ Date (readonly)
Returns 837p Loop2300 DTP*435, CMS-1500 Box 18 Required on all ambulance claims when the patient was known to be admitted to the hospital. OR Required on all claims involving inpatient medical visits.
93 94 95 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 93 def admission_date @admission_date end |
#appointment_type ⇒ String (readonly)
Returns Human-readable description of the appointment type (ex: “Acupuncture - Headaches”).
56 57 58 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 56 def appointment_type @appointment_type end |
#benefits_assigned_to_provider ⇒ Boolean (readonly)
Returns Whether this patient has authorized insurance payments to be made to you, not them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim form.
49 50 51 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 49 def benefits_assigned_to_provider @benefits_assigned_to_provider end |
#billable_status ⇒ CandidApiClient::Encounters::V4::Types::BillableStatusType (readonly)
Returns Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
77 78 79 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 77 def billable_status @billable_status end |
#date_of_service ⇒ Date (readonly)
Returns Date formatted as YYYY-MM-DD; eg: 2019-08-24. This date must be the local date in the timezone where the service occurred. Box 24a on the CMS-1500 claim form. If service occurred over a range of dates, this should be the start date. date_of_service must be defined on either the encounter or the service lines but not both. If there are greater than zero service lines, it is recommended to specify date_of_service on the service_line instead of on the encounter to prepare for future API versions.
33 34 35 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 33 def date_of_service @date_of_service end |
#delay_reason_code ⇒ CandidApiClient::Commons::Types::DelayReasonCode (readonly)
Returns 837i Loop2300, CLM-1300 Box 20 Code indicating the reason why a request was delayed.
111 112 113 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 111 def delay_reason_code @delay_reason_code end |
#discharge_date ⇒ Date (readonly)
Returns 837p Loop2300 DTP*096, CMS-1500 Box 18 Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
97 98 99 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 97 def discharge_date @discharge_date end |
#end_date_of_service ⇒ Date (readonly)
Returns Date formatted as YYYY-MM-DD; eg: 2019-08-25. This date must be the local date in the timezone where the service occurred. If omitted, the Encounter is assumed to be for a single day. Must not be temporally before the date_of_service field. If there are greater than zero service lines, it is recommended to specify end_date_of_service on the service_line instead of on the encounter to prepare for future API versions.
41 42 43 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 41 def end_date_of_service @end_date_of_service end |
#existing_medications ⇒ Array<CandidApiClient::Encounters::V4::Types::Medication> (readonly)
58 59 60 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 58 def existing_medications @existing_medications end |
#external_id ⇒ String (readonly)
Returns A client-specified unique ID to associate with this encounter; for example, your internal encounter ID or a Dr. Chrono encounter ID. This field should not contain PHI.
23 24 25 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 23 def external_id @external_id end |
#interventions ⇒ Array<CandidApiClient::Encounters::V4::Types::Intervention> (readonly)
62 63 64 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 62 def interventions @interventions end |
#last_menstrual_period_date ⇒ Date (readonly)
Returns 837p Loop2300 DTP*484, CMS-1500 Box 14 Required when, in the judgment of the provider, the services on this claim are related to the patient’s pregnancy.
108 109 110 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 108 def last_menstrual_period_date @last_menstrual_period_date end |
#onset_of_current_illness_or_symptom_date ⇒ Date (readonly)
Returns 837p Loop2300 DTP*431, CMS-1500 Box 14 Required for the initial medical service or visit performed in response to a medical emergency when the date is available and is different than the date of service. OR This date is the onset of acute symptoms for the current illness or condition.
104 105 106 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 104 def onset_of_current_illness_or_symptom_date @onset_of_current_illness_or_symptom_date end |
#patient_authorized_release ⇒ Boolean (readonly)
Returns Whether this patient has authorized the release of medical information for billing purpose. Box 12 on the CMS-1500 claim form.
45 46 47 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 45 def @patient_authorized_release end |
#pay_to_address ⇒ CandidApiClient::Commons::Types::StreetAddressLongZip (readonly)
Returns Specifies the address to which payments for the claim should be sent.
64 65 66 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 64 def pay_to_address @pay_to_address end |
#provider_accepts_assignment ⇒ Boolean (readonly)
Returns Whether you have accepted the patient’s authorization for insurance payments to be made to you, not them. Box 27 on the CMS-1500 claim form.
53 54 55 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 53 def provider_accepts_assignment @provider_accepts_assignment end |
#service_authorization_exception_code ⇒ CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode (readonly)
Returns 837p Loop2300 REF*4N Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without obtaining the authorization.
87 88 89 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 87 def @service_authorization_exception_code end |
#synchronicity ⇒ CandidApiClient::Encounters::V4::Types::SynchronicityType (readonly)
Returns Whether or not this was a synchronous or asynchronous encounter. Asynchronous encounters occur when providers and patients communicate online using forms, instant messaging, or other pre-recorded digital mediums. Synchronous encounters occur in live, real-time settings where the patient interacts directly with the provider, such as over video or a phone call.
72 73 74 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 72 def synchronicity @synchronicity end |
#vitals ⇒ CandidApiClient::Encounters::V4::Types::Vitals (readonly)
60 61 62 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 60 def vitals @vitals end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::EncounterBase
Deserialize a JSON object to an instance of EncounterBase
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 251 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) external_id = struct["external_id"] date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?) end_date_of_service = unless parsed_json["end_date_of_service"].nil? Date.parse(parsed_json["end_date_of_service"]) end = struct["patient_authorized_release"] benefits_assigned_to_provider = struct["benefits_assigned_to_provider"] provider_accepts_assignment = struct["provider_accepts_assignment"] appointment_type = struct["appointment_type"] existing_medications = parsed_json["existing_medications"]&.map do |item| item = item.to_json CandidApiClient::Encounters::V4::Types::Medication.from_json(json_object: item) end if parsed_json["vitals"].nil? vitals = nil else vitals = parsed_json["vitals"].to_json vitals = CandidApiClient::Encounters::V4::Types::Vitals.from_json(json_object: vitals) end interventions = parsed_json["interventions"]&.map do |item| item = item.to_json CandidApiClient::Encounters::V4::Types::Intervention.from_json(json_object: item) end if parsed_json["pay_to_address"].nil? pay_to_address = nil else pay_to_address = parsed_json["pay_to_address"].to_json pay_to_address = CandidApiClient::Commons::Types::StreetAddressLongZip.from_json(json_object: pay_to_address) end synchronicity = struct["synchronicity"] billable_status = struct["billable_status"] additional_information = struct["additional_information"] = struct["service_authorization_exception_code"] admission_date = (Date.parse(parsed_json["admission_date"]) unless parsed_json["admission_date"].nil?) discharge_date = (Date.parse(parsed_json["discharge_date"]) unless parsed_json["discharge_date"].nil?) onset_of_current_illness_or_symptom_date = unless parsed_json["onset_of_current_illness_or_symptom_date"].nil? Date.parse(parsed_json["onset_of_current_illness_or_symptom_date"]) end last_menstrual_period_date = unless parsed_json["last_menstrual_period_date"].nil? Date.parse(parsed_json["last_menstrual_period_date"]) end delay_reason_code = struct["delay_reason_code"] new( external_id: external_id, date_of_service: date_of_service, end_date_of_service: end_date_of_service, patient_authorized_release: , benefits_assigned_to_provider: benefits_assigned_to_provider, provider_accepts_assignment: provider_accepts_assignment, appointment_type: appointment_type, existing_medications: existing_medications, vitals: vitals, interventions: interventions, pay_to_address: pay_to_address, synchronicity: synchronicity, billable_status: billable_status, additional_information: additional_information, service_authorization_exception_code: , admission_date: admission_date, discharge_date: discharge_date, onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date, last_menstrual_period_date: last_menstrual_period_date, delay_reason_code: delay_reason_code, 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.
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 334 def self.validate_raw(obj:) obj.external_id.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.") obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.") obj.end_date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.end_date_of_service is not the expected type, validation failed.") obj..is_a?(Boolean) != false || raise("Passed value for field obj.patient_authorized_release is not the expected type, validation failed.") obj.benefits_assigned_to_provider.is_a?(Boolean) != false || raise("Passed value for field obj.benefits_assigned_to_provider is not the expected type, validation failed.") obj.provider_accepts_assignment.is_a?(Boolean) != false || raise("Passed value for field obj.provider_accepts_assignment is not the expected type, validation failed.") obj.appointment_type&.is_a?(String) != false || raise("Passed value for field obj.appointment_type is not the expected type, validation failed.") obj.existing_medications&.is_a?(Array) != false || raise("Passed value for field obj.existing_medications is not the expected type, validation failed.") obj.vitals.nil? || CandidApiClient::Encounters::V4::Types::Vitals.validate_raw(obj: obj.vitals) obj.interventions&.is_a?(Array) != false || raise("Passed value for field obj.interventions is not the expected type, validation failed.") obj.pay_to_address.nil? || CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.pay_to_address) obj.synchronicity&.is_a?(CandidApiClient::Encounters::V4::Types::SynchronicityType) != false || raise("Passed value for field obj.synchronicity is not the expected type, validation failed.") obj.billable_status.is_a?(CandidApiClient::Encounters::V4::Types::BillableStatusType) != false || raise("Passed value for field obj.billable_status is not the expected type, validation failed.") obj.additional_information&.is_a?(String) != false || raise("Passed value for field obj.additional_information is not the expected type, validation failed.") obj.&.is_a?(CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode) != false || raise("Passed value for field obj.service_authorization_exception_code is not the expected type, validation failed.") obj.admission_date&.is_a?(Date) != false || raise("Passed value for field obj.admission_date is not the expected type, validation failed.") obj.discharge_date&.is_a?(Date) != false || raise("Passed value for field obj.discharge_date is not the expected type, validation failed.") obj.onset_of_current_illness_or_symptom_date&.is_a?(Date) != false || raise("Passed value for field obj.onset_of_current_illness_or_symptom_date is not the expected type, validation failed.") obj.last_menstrual_period_date&.is_a?(Date) != false || raise("Passed value for field obj.last_menstrual_period_date is not the expected type, validation failed.") obj.delay_reason_code&.is_a?(CandidApiClient::Commons::Types::DelayReasonCode) != false || raise("Passed value for field obj.delay_reason_code is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of EncounterBase to a JSON object
324 325 326 |
# File 'lib/candidhealth/encounters/v_4/types/encounter_base.rb', line 324 def to_json(*_args) @_field_set&.to_json end |