candidhealth 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/auth/default/client.rb +34 -6
  3. data/lib/candidhealth/charge_capture/v_1/client.rb +48 -48
  4. data/lib/candidhealth/charge_capture/v_1/types/charge_capture_data.rb +70 -56
  5. data/lib/candidhealth/commons/types/clearinghouse.rb +18 -0
  6. data/lib/candidhealth/commons/types/procedure_modifier.rb +11 -0
  7. data/lib/candidhealth/encounter_providers/v_2/types/billing_provider.rb +1 -1
  8. data/lib/candidhealth/encounter_providers/v_2/types/billing_provider_update.rb +1 -1
  9. data/lib/candidhealth/encounter_providers/v_2/types/billing_provider_update_with_optional_address.rb +1 -1
  10. data/lib/candidhealth/encounters/v_4/client.rb +3253 -2040
  11. data/lib/candidhealth/encounters/v_4/types/encounter.rb +111 -86
  12. data/lib/candidhealth/encounters/v_4/types/encounter_base.rb +39 -33
  13. data/lib/candidhealth/encounters/v_4/types/encounter_create.rb +796 -0
  14. data/lib/candidhealth/encounters/v_4/types/encounter_create_from_pre_encounter.rb +131 -117
  15. data/lib/candidhealth/encounters/v_4/types/encounter_deep_optional.rb +70 -56
  16. data/lib/candidhealth/encounters/v_4/types/encounter_optional.rb +29 -39
  17. data/lib/candidhealth/encounters/v_4/types/encounter_rendering_or_attending_provider_required_error.rb +55 -0
  18. data/lib/candidhealth/encounters/v_4/types/encounter_update.rb +736 -0
  19. data/lib/candidhealth/encounters_universal/types/universal_encounter_create.rb +944 -0
  20. data/lib/candidhealth/encounters_universal/types/universal_encounter_create_base.rb +691 -0
  21. data/lib/candidhealth/encounters_universal/types/universal_encounter_create_from_pre_encounter.rb +791 -0
  22. data/lib/candidhealth/encounters_universal/types/universal_encounter_create_from_pre_encounter_base.rb +572 -0
  23. data/lib/candidhealth/encounters_universal/types/universal_encounter_update.rb +872 -0
  24. data/lib/candidhealth/encounters_universal/types/universal_encounter_update_base.rb +700 -0
  25. data/lib/candidhealth/fee_schedules/v_3/client.rb +57 -0
  26. data/lib/candidhealth/fee_schedules/v_3/types/validation_error.rb +12 -0
  27. data/lib/candidhealth/financials/types/patient_transaction_source.rb +1 -0
  28. data/lib/candidhealth/health_care_code_information/v_1/types/admitting_diagnosis_new.rb +206 -0
  29. data/lib/candidhealth/health_care_code_information/v_1/types/condition_information_new.rb +207 -0
  30. data/lib/candidhealth/health_care_code_information/v_1/types/diagnosis_related_group_new.rb +206 -0
  31. data/lib/candidhealth/health_care_code_information/v_1/types/external_cause_of_injury_new.rb +245 -0
  32. data/lib/candidhealth/health_care_code_information/v_1/types/health_care_code_information_create.rb +225 -0
  33. data/lib/candidhealth/health_care_code_information/v_1/types/occurrence_information_new.rb +219 -0
  34. data/lib/candidhealth/health_care_code_information/v_1/types/occurrence_span_information_new.rb +222 -0
  35. data/lib/candidhealth/health_care_code_information/v_1/types/other_diagnosis_information_new.rb +215 -0
  36. data/lib/candidhealth/health_care_code_information/v_1/types/other_procedure_information_new.rb +218 -0
  37. data/lib/candidhealth/health_care_code_information/v_1/types/patient_reason_for_visit_new.rb +206 -0
  38. data/lib/candidhealth/health_care_code_information/v_1/types/principal_diagnosis_new.rb +215 -0
  39. data/lib/candidhealth/health_care_code_information/v_1/types/principal_procedure_information_new.rb +216 -0
  40. data/lib/candidhealth/health_care_code_information/v_1/types/treatment_code_information_new.rb +206 -0
  41. data/lib/candidhealth/health_care_code_information/v_1/types/value_information_new.rb +215 -0
  42. data/lib/candidhealth/individual/types/patient.rb +6 -6
  43. data/lib/candidhealth/individual/types/patient_base.rb +6 -6
  44. data/lib/candidhealth/individual/types/patient_create.rb +6 -6
  45. data/lib/candidhealth/individual/types/patient_update.rb +6 -6
  46. data/lib/candidhealth/individual/types/patient_update_with_optional_address.rb +6 -6
  47. data/lib/candidhealth/organization_providers/v_2/types/license_type.rb +2 -0
  48. data/lib/candidhealth/payers/client.rb +7 -0
  49. data/lib/candidhealth/payers/v_4/client.rb +137 -0
  50. data/lib/candidhealth/payers/v_4/types/clearinghouse_payer_info.rb +93 -0
  51. data/lib/candidhealth/payers/v_4/types/payer.rb +116 -0
  52. data/lib/candidhealth/payers/v_4/types/payer_ids.rb +107 -0
  53. data/lib/candidhealth/payers/v_4/types/payer_page.rb +88 -0
  54. data/lib/candidhealth/payers/v_4/types/support_state.rb +15 -0
  55. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +4 -4
  56. data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +3 -3
  57. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +72 -6
  58. data/lib/candidhealth/pre_encounter/patients/v_1/types/guarantor.rb +3 -3
  59. data/lib/candidhealth/pre_encounter/patients/v_1/types/inferred_patient_metadata.rb +80 -0
  60. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +19 -5
  61. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient_with_mrn.rb +19 -5
  62. data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +18 -4
  63. data/lib/candidhealth/pre_encounter/patients/v_1/types/referral_type.rb +1 -0
  64. data/lib/candidhealth/service_lines/v_2/client.rb +252 -10
  65. data/lib/candidhealth/service_lines/v_2/types/service_line.rb +28 -10
  66. data/lib/candidhealth/service_lines/v_2/types/service_line_create.rb +52 -40
  67. data/lib/candidhealth/service_lines/v_2/types/service_line_create_base.rb +251 -0
  68. data/lib/candidhealth/service_lines/v_2/types/service_line_create_base_base.rb +243 -0
  69. data/lib/candidhealth/service_lines/v_2/types/service_line_create_optional.rb +48 -24
  70. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +58 -46
  71. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone_base.rb +273 -0
  72. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone_base_base.rb +265 -0
  73. data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +64 -54
  74. data/lib/candidhealth/service_lines/v_2/types/service_line_update_base.rb +263 -0
  75. data/lib/candidhealth/service_lines/v_2/types/universal_service_line_create.rb +271 -0
  76. data/lib/candidhealth/service_lines/v_2/types/universal_service_line_create_standalone.rb +317 -0
  77. data/lib/candidhealth/service_lines/v_2/types/universal_service_line_update.rb +307 -0
  78. data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite.rb +2 -2
  79. data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite_base.rb +90 -0
  80. data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite_update.rb +112 -0
  81. data/lib/requests.rb +2 -2
  82. data/lib/types_export.rb +44 -4
  83. metadata +43 -2
@@ -0,0 +1,691 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../individual/types/patient_create"
4
+ require_relative "../../encounter_providers/v_2/types/referring_provider"
5
+ require_relative "../../encounter_providers/v_2/types/initial_referring_provider"
6
+ require_relative "../../encounter_providers/v_2/types/supervising_provider"
7
+ require_relative "../../service_facility/types/encounter_service_facility_base"
8
+ require_relative "../../individual/types/subscriber_create"
9
+ require_relative "../../encounters/v_4/types/responsible_party_type"
10
+ require_relative "../../encounters/v_4/types/clinical_note_category_create"
11
+ require_relative "../../billing_notes/v_2/types/billing_note_base"
12
+ require_relative "../../encounters/v_4/types/patient_history_category"
13
+ require_relative "../../guarantor/v_1/types/guarantor_create"
14
+ require_relative "../../claim_submission/v_1/types/external_claim_submission_create"
15
+ require_relative "../../custom_schemas/v_1/types/schema_instance"
16
+ require_relative "../../encounters/v_4/types/epsdt_referral"
17
+ require_relative "../../encounters/v_4/types/claim_supplemental_information"
18
+ require "date"
19
+ require_relative "../../encounters/v_4/types/medication"
20
+ require_relative "../../encounters/v_4/types/intervention"
21
+ require_relative "../../commons/types/street_address_long_zip"
22
+ require_relative "../../encounters/v_4/types/synchronicity_type"
23
+ require_relative "../../encounters/v_4/types/vitals"
24
+ require_relative "../../encounters/v_4/types/billable_status_type"
25
+ require_relative "../../encounters/v_4/types/service_authorization_exception_code"
26
+ require_relative "../../commons/types/delay_reason_code"
27
+ require "ostruct"
28
+ require "json"
29
+
30
+ module CandidApiClient
31
+ module EncountersUniversal
32
+ module Types
33
+ class UniversalEncounterCreateBase
34
+ # @return [CandidApiClient::Individual::Types::PatientCreate] Contains the identification information of the individual receiving medical
35
+ # services.
36
+ attr_reader :patient
37
+ # @return [CandidApiClient::EncounterProviders::V2::Types::ReferringProvider] The final provider who referred the services that were rendered.
38
+ # All physicians who order services or refer Medicare beneficiaries must
39
+ # report this data.
40
+ attr_reader :referring_provider
41
+ # @return [CandidApiClient::EncounterProviders::V2::Types::InitialReferringProvider] The second iteration of Loop ID-2310 on an 837P form. Use code "P3 - Primary
42
+ # Care Provider" in this loop to
43
+ # indicate the initial referral from the primary care provider or whatever
44
+ # provider wrote the initial referral for this patient's episode of care being
45
+ # billed/reported in this transaction.
46
+ # Not used in an 837i claim
47
+ attr_reader :initial_referring_provider
48
+ # @return [CandidApiClient::EncounterProviders::V2::Types::SupervisingProvider] Required when the rendering provider is supervised by a physician. If not
49
+ # required by this implementation guide, do not send.
50
+ attr_reader :supervising_provider
51
+ # @return [CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityBase] Encounter Service facility is typically the location a medical service was
52
+ # rendered, such as a provider office or hospital. For telehealth, service
53
+ # facility can represent the provider's location when the service was delivered
54
+ # (e.g., home), or the location where an in-person visit would have taken place,
55
+ # whichever is easier to identify. If the provider is in-network, service facility
56
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. There is
57
+ # no equivalent on the paper UB-04 claim form, but this field is equivalent to
58
+ # Loop 2310E Service Facility Location details on an 837i form, and is used when
59
+ # this is different to the entity identified as the Billing Provider. Note that
60
+ # for an in-network claim to be successfully adjudicated, the service facility
61
+ # address listed
62
+ attr_reader :service_facility
63
+ # @return [CandidApiClient::Individual::Types::SubscriberCreate] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
64
+ # when the claim should be billed to insurance).
65
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the
66
+ # claim should be billed to the patient).
67
+ # However, if you collect this for patients, even self-pay, we recommend including
68
+ # it when sending encounters to Candid.
69
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
70
+ # to define self-pay claims.
71
+ attr_reader :subscriber_primary
72
+ # @return [CandidApiClient::Individual::Types::SubscriberCreate] Please always include this when you have it, even for self-pay claims.
73
+ attr_reader :subscriber_secondary
74
+ # @return [CandidApiClient::Individual::Types::SubscriberCreate] Please always include this when you have it, even for self-pay claims.
75
+ attr_reader :subscriber_tertiary
76
+ # @return [String] Box 23 on the CMS-1500 claim form or Form Locator 63 on a UB-04 claim form.
77
+ attr_reader :prior_authorization_number
78
+ # @return [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
79
+ attr_reader :responsible_party
80
+ # @return [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>] Holds a collection of clinical observations made by healthcare providers during
81
+ # patient encounters. Please note that medical records for appeals should be sent
82
+ # using the Encounter Attachments API.
83
+ attr_reader :clinical_notes
84
+ # @return [Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>] Spot to store misc, human-readable, notes about this encounter to be used
85
+ # in the billing process.
86
+ attr_reader :billing_notes
87
+ # @return [Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>]
88
+ attr_reader :patient_histories
89
+ # @return [CandidApiClient::Guarantor::V1::Types::GuarantorCreate] Personal and contact info for the guarantor of the patient responsibility.
90
+ attr_reader :guarantor
91
+ # @return [CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate] To be included for claims that have been submitted outside of Candid.
92
+ # Candid supports posting remits and payments to these claims and working them
93
+ # in-platform (e.g. editing, resubmitting).
94
+ attr_reader :external_claim_submission
95
+ # @return [Array<String>] Names of tags that should be on the encounter.
96
+ attr_reader :tag_ids
97
+ # @return [Array<CandidApiClient::CustomSchemas::V1::Types::SchemaInstance>] Key-value pairs that must adhere to a schema created via the Custom Schema API.
98
+ # Multiple schema
99
+ # instances cannot be created for the same schema on an encounter.
100
+ attr_reader :schema_instances
101
+ # @return [String] Refers to REF*9F on the 837p and 837i. Value cannot be greater than 50
102
+ # characters.
103
+ attr_reader :referral_number
104
+ # @return [CandidApiClient::Encounters::V4::Types::EpsdtReferral] Refers to Box 24H on the CMS1500 form and Loop 2300 CRC - EPSDT Referral on the
105
+ # 837P and 837i form
106
+ attr_reader :epsdt_referral
107
+ # @return [Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>] Refers to Loop 2300 - Segment PWK on the 837P and 837i forms. No more than 10
108
+ # entries are permitted.
109
+ attr_reader :claim_supplemental_information
110
+ # @return [String] When Medicaid is billed as the secondary payer the Carrier Code is used to
111
+ # identify the primary payer. This is required for certain states.
112
+ attr_reader :secondary_payer_carrier_code
113
+ # @return [String] A client-specified unique ID to associate with this encounter;
114
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
115
+ # This field should not contain PHI.
116
+ attr_reader :external_id
117
+ # @return [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
118
+ # This date must be the local date in the timezone where the service occurred.
119
+ # Box 24a on the CMS-1500 claim form or Form Locator 45 on the UB-04 claim form.
120
+ # If service occurred over a range of dates, this should be the start date.
121
+ # date_of_service must be defined on either the encounter or the service lines but
122
+ # not both.
123
+ # If there are greater than zero service lines, it is recommended to specify
124
+ # date_of_service on the service_line instead of on the encounter to prepare for
125
+ # future API versions.
126
+ attr_reader :date_of_service
127
+ # @return [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
128
+ # This date must be the local date in the timezone where the service occurred.
129
+ # If omitted, the Encounter is assumed to be for a single day.
130
+ # Must not be temporally before the date_of_service field.
131
+ # If there are greater than zero service lines, it is recommended to specify
132
+ # end_date_of_service on the service_line instead of on the encounter to prepare
133
+ # for future API versions.
134
+ attr_reader :end_date_of_service
135
+ # @return [Boolean] Whether this patient has authorized the release of medical information
136
+ # for billing purpose.
137
+ # Box 12 on the CMS-1500 claim form or Form Locator 52 on a UB-04 claim form.
138
+ attr_reader :patient_authorized_release
139
+ # @return [Boolean] Whether this patient has authorized insurance payments to be made to you,
140
+ # not them. If false, patient may receive reimbursement.
141
+ # Box 13 on the CMS-1500 claim form or Form Locator 53 on a UB-04 claim form.
142
+ attr_reader :benefits_assigned_to_provider
143
+ # @return [Boolean] Whether you have accepted the patient's authorization for insurance payments
144
+ # to be made to you, not them.
145
+ # Box 27 on the CMS-1500 claim form. There is no exact equivalent of this field on
146
+ # a UB-04 claim, however contributes to the concept of Form Locator 53.
147
+ attr_reader :provider_accepts_assignment
148
+ # @return [String] Human-readable description of the appointment type (ex: "Acupuncture -
149
+ # Headaches").
150
+ attr_reader :appointment_type
151
+ # @return [Array<CandidApiClient::Encounters::V4::Types::Medication>]
152
+ attr_reader :existing_medications
153
+ # @return [Array<CandidApiClient::Encounters::V4::Types::Intervention>]
154
+ attr_reader :interventions
155
+ # @return [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
156
+ attr_reader :pay_to_address
157
+ # @return [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
158
+ # Asynchronous encounters occur when providers and patients communicate online
159
+ # using
160
+ # forms, instant messaging, or other pre-recorded digital mediums.
161
+ # Synchronous encounters occur in live, real-time settings where the patient
162
+ # interacts
163
+ # directly with the provider, such as over video or a phone call.
164
+ attr_reader :synchronicity
165
+ # @return [CandidApiClient::Encounters::V4::Types::Vitals]
166
+ attr_reader :vitals
167
+ # @return [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
168
+ # Examples for when this should be set to NOT_BILLABLE include
169
+ # if the Encounter has not occurred yet or if there is no intention of ever
170
+ # billing the responsible_party.
171
+ attr_reader :billable_status
172
+ # @return [String] Defines additional information on the claim needed by the payer.
173
+ # Box 19 on the CMS-1500 claim form or Form Locator 80 on a UB-04 claim form.
174
+ attr_reader :additional_information
175
+ # @return [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
176
+ # Required when mandated by government law or regulation to obtain authorization
177
+ # for specific service(s) but, for the
178
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
179
+ # the service was performed without
180
+ # obtaining the authorization.
181
+ attr_reader :service_authorization_exception_code
182
+ # @return [Date] 837p Loop2300 DTP*435, CMS-1500 Box 18 or UB-04 Form Locator 12.
183
+ # Required on all ambulance claims when the patient was known to be admitted to
184
+ # the hospital.
185
+ # OR
186
+ # Required on all claims involving inpatient medical visits.
187
+ attr_reader :admission_date
188
+ # @return [Date] 837p Loop2300 DTP*096, CMS-1500 Box 18 Required for inpatient claims when the
189
+ # patient was discharged from the facility and the discharge date is known. Not
190
+ # used on an institutional claim.
191
+ attr_reader :discharge_date
192
+ # @return [Date] 837p Loop2300 DTP*431, CMS-1500 Box 14
193
+ # Required for the initial medical service or visit performed in response to a
194
+ # medical emergency when the date is available and is different than the date of
195
+ # service.
196
+ # OR
197
+ # This date is the onset of acute symptoms for the current illness or condition.
198
+ # For UB-04 claims, this is populated separately via occurrence codes.
199
+ attr_reader :onset_of_current_illness_or_symptom_date
200
+ # @return [Date] 837p Loop2300 DTP*484, CMS-1500 Box 14
201
+ # Required when, in the judgment of the provider, the services on this claim are
202
+ # related to the patient's pregnancy.
203
+ # This field is populated separately via occurrence codes for UB-04 claim forms.
204
+ attr_reader :last_menstrual_period_date
205
+ # @return [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
206
+ # Code indicating the reason why a request was delayed
207
+ attr_reader :delay_reason_code
208
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
209
+ attr_reader :additional_properties
210
+ # @return [Object]
211
+ attr_reader :_field_set
212
+ protected :_field_set
213
+
214
+ OMIT = Object.new
215
+
216
+ # @param patient [CandidApiClient::Individual::Types::PatientCreate] Contains the identification information of the individual receiving medical
217
+ # services.
218
+ # @param referring_provider [CandidApiClient::EncounterProviders::V2::Types::ReferringProvider] The final provider who referred the services that were rendered.
219
+ # All physicians who order services or refer Medicare beneficiaries must
220
+ # report this data.
221
+ # @param initial_referring_provider [CandidApiClient::EncounterProviders::V2::Types::InitialReferringProvider] The second iteration of Loop ID-2310 on an 837P form. Use code "P3 - Primary
222
+ # Care Provider" in this loop to
223
+ # indicate the initial referral from the primary care provider or whatever
224
+ # provider wrote the initial referral for this patient's episode of care being
225
+ # billed/reported in this transaction.
226
+ # Not used in an 837i claim
227
+ # @param supervising_provider [CandidApiClient::EncounterProviders::V2::Types::SupervisingProvider] Required when the rendering provider is supervised by a physician. If not
228
+ # required by this implementation guide, do not send.
229
+ # @param service_facility [CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityBase] Encounter Service facility is typically the location a medical service was
230
+ # rendered, such as a provider office or hospital. For telehealth, service
231
+ # facility can represent the provider's location when the service was delivered
232
+ # (e.g., home), or the location where an in-person visit would have taken place,
233
+ # whichever is easier to identify. If the provider is in-network, service facility
234
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. There is
235
+ # no equivalent on the paper UB-04 claim form, but this field is equivalent to
236
+ # Loop 2310E Service Facility Location details on an 837i form, and is used when
237
+ # this is different to the entity identified as the Billing Provider. Note that
238
+ # for an in-network claim to be successfully adjudicated, the service facility
239
+ # address listed
240
+ # @param subscriber_primary [CandidApiClient::Individual::Types::SubscriberCreate] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
241
+ # when the claim should be billed to insurance).
242
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the
243
+ # claim should be billed to the patient).
244
+ # However, if you collect this for patients, even self-pay, we recommend including
245
+ # it when sending encounters to Candid.
246
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
247
+ # to define self-pay claims.
248
+ # @param subscriber_secondary [CandidApiClient::Individual::Types::SubscriberCreate] Please always include this when you have it, even for self-pay claims.
249
+ # @param subscriber_tertiary [CandidApiClient::Individual::Types::SubscriberCreate] Please always include this when you have it, even for self-pay claims.
250
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form or Form Locator 63 on a UB-04 claim form.
251
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
252
+ # @param clinical_notes [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>] Holds a collection of clinical observations made by healthcare providers during
253
+ # patient encounters. Please note that medical records for appeals should be sent
254
+ # using the Encounter Attachments API.
255
+ # @param billing_notes [Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>] Spot to store misc, human-readable, notes about this encounter to be used
256
+ # in the billing process.
257
+ # @param patient_histories [Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>]
258
+ # @param guarantor [CandidApiClient::Guarantor::V1::Types::GuarantorCreate] Personal and contact info for the guarantor of the patient responsibility.
259
+ # @param external_claim_submission [CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate] To be included for claims that have been submitted outside of Candid.
260
+ # Candid supports posting remits and payments to these claims and working them
261
+ # in-platform (e.g. editing, resubmitting).
262
+ # @param tag_ids [Array<String>] Names of tags that should be on the encounter.
263
+ # @param schema_instances [Array<CandidApiClient::CustomSchemas::V1::Types::SchemaInstance>] Key-value pairs that must adhere to a schema created via the Custom Schema API.
264
+ # Multiple schema
265
+ # instances cannot be created for the same schema on an encounter.
266
+ # @param referral_number [String] Refers to REF*9F on the 837p and 837i. Value cannot be greater than 50
267
+ # characters.
268
+ # @param epsdt_referral [CandidApiClient::Encounters::V4::Types::EpsdtReferral] Refers to Box 24H on the CMS1500 form and Loop 2300 CRC - EPSDT Referral on the
269
+ # 837P and 837i form
270
+ # @param claim_supplemental_information [Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>] Refers to Loop 2300 - Segment PWK on the 837P and 837i forms. No more than 10
271
+ # entries are permitted.
272
+ # @param secondary_payer_carrier_code [String] When Medicaid is billed as the secondary payer the Carrier Code is used to
273
+ # identify the primary payer. This is required for certain states.
274
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
275
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
276
+ # This field should not contain PHI.
277
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
278
+ # This date must be the local date in the timezone where the service occurred.
279
+ # Box 24a on the CMS-1500 claim form or Form Locator 45 on the UB-04 claim form.
280
+ # If service occurred over a range of dates, this should be the start date.
281
+ # date_of_service must be defined on either the encounter or the service lines but
282
+ # not both.
283
+ # If there are greater than zero service lines, it is recommended to specify
284
+ # date_of_service on the service_line instead of on the encounter to prepare for
285
+ # future API versions.
286
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
287
+ # This date must be the local date in the timezone where the service occurred.
288
+ # If omitted, the Encounter is assumed to be for a single day.
289
+ # Must not be temporally before the date_of_service field.
290
+ # If there are greater than zero service lines, it is recommended to specify
291
+ # end_date_of_service on the service_line instead of on the encounter to prepare
292
+ # for future API versions.
293
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
294
+ # for billing purpose.
295
+ # Box 12 on the CMS-1500 claim form or Form Locator 52 on a UB-04 claim form.
296
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
297
+ # not them. If false, patient may receive reimbursement.
298
+ # Box 13 on the CMS-1500 claim form or Form Locator 53 on a UB-04 claim form.
299
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
300
+ # to be made to you, not them.
301
+ # Box 27 on the CMS-1500 claim form. There is no exact equivalent of this field on
302
+ # a UB-04 claim, however contributes to the concept of Form Locator 53.
303
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
304
+ # Headaches").
305
+ # @param existing_medications [Array<CandidApiClient::Encounters::V4::Types::Medication>]
306
+ # @param interventions [Array<CandidApiClient::Encounters::V4::Types::Intervention>]
307
+ # @param pay_to_address [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
308
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
309
+ # Asynchronous encounters occur when providers and patients communicate online
310
+ # using
311
+ # forms, instant messaging, or other pre-recorded digital mediums.
312
+ # Synchronous encounters occur in live, real-time settings where the patient
313
+ # interacts
314
+ # directly with the provider, such as over video or a phone call.
315
+ # @param vitals [CandidApiClient::Encounters::V4::Types::Vitals]
316
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
317
+ # Examples for when this should be set to NOT_BILLABLE include
318
+ # if the Encounter has not occurred yet or if there is no intention of ever
319
+ # billing the responsible_party.
320
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
321
+ # Box 19 on the CMS-1500 claim form or Form Locator 80 on a UB-04 claim form.
322
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
323
+ # Required when mandated by government law or regulation to obtain authorization
324
+ # for specific service(s) but, for the
325
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
326
+ # the service was performed without
327
+ # obtaining the authorization.
328
+ # @param admission_date [Date] 837p Loop2300 DTP*435, CMS-1500 Box 18 or UB-04 Form Locator 12.
329
+ # Required on all ambulance claims when the patient was known to be admitted to
330
+ # the hospital.
331
+ # OR
332
+ # Required on all claims involving inpatient medical visits.
333
+ # @param discharge_date [Date] 837p Loop2300 DTP*096, CMS-1500 Box 18 Required for inpatient claims when the
334
+ # patient was discharged from the facility and the discharge date is known. Not
335
+ # used on an institutional claim.
336
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP*431, CMS-1500 Box 14
337
+ # Required for the initial medical service or visit performed in response to a
338
+ # medical emergency when the date is available and is different than the date of
339
+ # service.
340
+ # OR
341
+ # This date is the onset of acute symptoms for the current illness or condition.
342
+ # For UB-04 claims, this is populated separately via occurrence codes.
343
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP*484, CMS-1500 Box 14
344
+ # Required when, in the judgment of the provider, the services on this claim are
345
+ # related to the patient's pregnancy.
346
+ # This field is populated separately via occurrence codes for UB-04 claim forms.
347
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
348
+ # Code indicating the reason why a request was delayed
349
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
350
+ # @return [CandidApiClient::EncountersUniversal::Types::UniversalEncounterCreateBase]
351
+ def initialize(patient:, responsible_party:, external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, referring_provider: OMIT, initial_referring_provider: OMIT,
352
+ supervising_provider: OMIT, service_facility: OMIT, subscriber_primary: OMIT, subscriber_secondary: OMIT, subscriber_tertiary: OMIT, prior_authorization_number: OMIT, clinical_notes: OMIT, billing_notes: OMIT, patient_histories: OMIT, guarantor: OMIT, external_claim_submission: OMIT, tag_ids: OMIT, schema_instances: OMIT, referral_number: OMIT, epsdt_referral: OMIT, claim_supplemental_information: OMIT, secondary_payer_carrier_code: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, appointment_type: OMIT, existing_medications: OMIT, interventions: OMIT, pay_to_address: OMIT, synchronicity: OMIT, vitals: 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)
353
+ @patient = patient
354
+ @referring_provider = referring_provider if referring_provider != OMIT
355
+ @initial_referring_provider = initial_referring_provider if initial_referring_provider != OMIT
356
+ @supervising_provider = supervising_provider if supervising_provider != OMIT
357
+ @service_facility = service_facility if service_facility != OMIT
358
+ @subscriber_primary = subscriber_primary if subscriber_primary != OMIT
359
+ @subscriber_secondary = subscriber_secondary if subscriber_secondary != OMIT
360
+ @subscriber_tertiary = subscriber_tertiary if subscriber_tertiary != OMIT
361
+ @prior_authorization_number = prior_authorization_number if prior_authorization_number != OMIT
362
+ @responsible_party = responsible_party
363
+ @clinical_notes = clinical_notes if clinical_notes != OMIT
364
+ @billing_notes = billing_notes if billing_notes != OMIT
365
+ @patient_histories = patient_histories if patient_histories != OMIT
366
+ @guarantor = guarantor if guarantor != OMIT
367
+ @external_claim_submission = external_claim_submission if external_claim_submission != OMIT
368
+ @tag_ids = tag_ids if tag_ids != OMIT
369
+ @schema_instances = schema_instances if schema_instances != OMIT
370
+ @referral_number = referral_number if referral_number != OMIT
371
+ @epsdt_referral = epsdt_referral if epsdt_referral != OMIT
372
+ @claim_supplemental_information = claim_supplemental_information if claim_supplemental_information != OMIT
373
+ @secondary_payer_carrier_code = secondary_payer_carrier_code if secondary_payer_carrier_code != OMIT
374
+ @external_id = external_id
375
+ @date_of_service = date_of_service if date_of_service != OMIT
376
+ @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
377
+ @patient_authorized_release = patient_authorized_release
378
+ @benefits_assigned_to_provider = benefits_assigned_to_provider
379
+ @provider_accepts_assignment = provider_accepts_assignment
380
+ @appointment_type = appointment_type if appointment_type != OMIT
381
+ @existing_medications = existing_medications if existing_medications != OMIT
382
+ @interventions = interventions if interventions != OMIT
383
+ @pay_to_address = pay_to_address if pay_to_address != OMIT
384
+ @synchronicity = synchronicity if synchronicity != OMIT
385
+ @vitals = vitals if vitals != OMIT
386
+ @billable_status = billable_status
387
+ @additional_information = additional_information if additional_information != OMIT
388
+ if service_authorization_exception_code != OMIT
389
+ @service_authorization_exception_code = service_authorization_exception_code
390
+ end
391
+ @admission_date = admission_date if admission_date != OMIT
392
+ @discharge_date = discharge_date if discharge_date != OMIT
393
+ if onset_of_current_illness_or_symptom_date != OMIT
394
+ @onset_of_current_illness_or_symptom_date = onset_of_current_illness_or_symptom_date
395
+ end
396
+ @last_menstrual_period_date = last_menstrual_period_date if last_menstrual_period_date != OMIT
397
+ @delay_reason_code = delay_reason_code if delay_reason_code != OMIT
398
+ @additional_properties = additional_properties
399
+ @_field_set = {
400
+ "patient": patient,
401
+ "referring_provider": referring_provider,
402
+ "initial_referring_provider": initial_referring_provider,
403
+ "supervising_provider": supervising_provider,
404
+ "service_facility": service_facility,
405
+ "subscriber_primary": subscriber_primary,
406
+ "subscriber_secondary": subscriber_secondary,
407
+ "subscriber_tertiary": subscriber_tertiary,
408
+ "prior_authorization_number": prior_authorization_number,
409
+ "responsible_party": responsible_party,
410
+ "clinical_notes": clinical_notes,
411
+ "billing_notes": billing_notes,
412
+ "patient_histories": patient_histories,
413
+ "guarantor": guarantor,
414
+ "external_claim_submission": external_claim_submission,
415
+ "tag_ids": tag_ids,
416
+ "schema_instances": schema_instances,
417
+ "referral_number": referral_number,
418
+ "epsdt_referral": epsdt_referral,
419
+ "claim_supplemental_information": claim_supplemental_information,
420
+ "secondary_payer_carrier_code": secondary_payer_carrier_code,
421
+ "external_id": external_id,
422
+ "date_of_service": date_of_service,
423
+ "end_date_of_service": end_date_of_service,
424
+ "patient_authorized_release": patient_authorized_release,
425
+ "benefits_assigned_to_provider": benefits_assigned_to_provider,
426
+ "provider_accepts_assignment": provider_accepts_assignment,
427
+ "appointment_type": appointment_type,
428
+ "existing_medications": existing_medications,
429
+ "interventions": interventions,
430
+ "pay_to_address": pay_to_address,
431
+ "synchronicity": synchronicity,
432
+ "vitals": vitals,
433
+ "billable_status": billable_status,
434
+ "additional_information": additional_information,
435
+ "service_authorization_exception_code": service_authorization_exception_code,
436
+ "admission_date": admission_date,
437
+ "discharge_date": discharge_date,
438
+ "onset_of_current_illness_or_symptom_date": onset_of_current_illness_or_symptom_date,
439
+ "last_menstrual_period_date": last_menstrual_period_date,
440
+ "delay_reason_code": delay_reason_code
441
+ }.reject do |_k, v|
442
+ v == OMIT
443
+ end
444
+ end
445
+
446
+ # Deserialize a JSON object to an instance of UniversalEncounterCreateBase
447
+ #
448
+ # @param json_object [String]
449
+ # @return [CandidApiClient::EncountersUniversal::Types::UniversalEncounterCreateBase]
450
+ def self.from_json(json_object:)
451
+ struct = JSON.parse(json_object, object_class: OpenStruct)
452
+ parsed_json = JSON.parse(json_object)
453
+ if parsed_json["patient"].nil?
454
+ patient = nil
455
+ else
456
+ patient = parsed_json["patient"].to_json
457
+ patient = CandidApiClient::Individual::Types::PatientCreate.from_json(json_object: patient)
458
+ end
459
+ if parsed_json["referring_provider"].nil?
460
+ referring_provider = nil
461
+ else
462
+ referring_provider = parsed_json["referring_provider"].to_json
463
+ referring_provider = CandidApiClient::EncounterProviders::V2::Types::ReferringProvider.from_json(json_object: referring_provider)
464
+ end
465
+ if parsed_json["initial_referring_provider"].nil?
466
+ initial_referring_provider = nil
467
+ else
468
+ initial_referring_provider = parsed_json["initial_referring_provider"].to_json
469
+ initial_referring_provider = CandidApiClient::EncounterProviders::V2::Types::InitialReferringProvider.from_json(json_object: initial_referring_provider)
470
+ end
471
+ if parsed_json["supervising_provider"].nil?
472
+ supervising_provider = nil
473
+ else
474
+ supervising_provider = parsed_json["supervising_provider"].to_json
475
+ supervising_provider = CandidApiClient::EncounterProviders::V2::Types::SupervisingProvider.from_json(json_object: supervising_provider)
476
+ end
477
+ if parsed_json["service_facility"].nil?
478
+ service_facility = nil
479
+ else
480
+ service_facility = parsed_json["service_facility"].to_json
481
+ service_facility = CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityBase.from_json(json_object: service_facility)
482
+ end
483
+ if parsed_json["subscriber_primary"].nil?
484
+ subscriber_primary = nil
485
+ else
486
+ subscriber_primary = parsed_json["subscriber_primary"].to_json
487
+ subscriber_primary = CandidApiClient::Individual::Types::SubscriberCreate.from_json(json_object: subscriber_primary)
488
+ end
489
+ if parsed_json["subscriber_secondary"].nil?
490
+ subscriber_secondary = nil
491
+ else
492
+ subscriber_secondary = parsed_json["subscriber_secondary"].to_json
493
+ subscriber_secondary = CandidApiClient::Individual::Types::SubscriberCreate.from_json(json_object: subscriber_secondary)
494
+ end
495
+ if parsed_json["subscriber_tertiary"].nil?
496
+ subscriber_tertiary = nil
497
+ else
498
+ subscriber_tertiary = parsed_json["subscriber_tertiary"].to_json
499
+ subscriber_tertiary = CandidApiClient::Individual::Types::SubscriberCreate.from_json(json_object: subscriber_tertiary)
500
+ end
501
+ prior_authorization_number = struct["prior_authorization_number"]
502
+ responsible_party = struct["responsible_party"]
503
+ clinical_notes = parsed_json["clinical_notes"]&.map do |item|
504
+ item = item.to_json
505
+ CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate.from_json(json_object: item)
506
+ end
507
+ billing_notes = parsed_json["billing_notes"]&.map do |item|
508
+ item = item.to_json
509
+ CandidApiClient::BillingNotes::V2::Types::BillingNoteBase.from_json(json_object: item)
510
+ end
511
+ patient_histories = parsed_json["patient_histories"]&.map do |item|
512
+ item = item.to_json
513
+ CandidApiClient::Encounters::V4::Types::PatientHistoryCategory.from_json(json_object: item)
514
+ end
515
+ if parsed_json["guarantor"].nil?
516
+ guarantor = nil
517
+ else
518
+ guarantor = parsed_json["guarantor"].to_json
519
+ guarantor = CandidApiClient::Guarantor::V1::Types::GuarantorCreate.from_json(json_object: guarantor)
520
+ end
521
+ if parsed_json["external_claim_submission"].nil?
522
+ external_claim_submission = nil
523
+ else
524
+ external_claim_submission = parsed_json["external_claim_submission"].to_json
525
+ external_claim_submission = CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate.from_json(json_object: external_claim_submission)
526
+ end
527
+ tag_ids = struct["tag_ids"]
528
+ schema_instances = parsed_json["schema_instances"]&.map do |item|
529
+ item = item.to_json
530
+ CandidApiClient::CustomSchemas::V1::Types::SchemaInstance.from_json(json_object: item)
531
+ end
532
+ referral_number = struct["referral_number"]
533
+ if parsed_json["epsdt_referral"].nil?
534
+ epsdt_referral = nil
535
+ else
536
+ epsdt_referral = parsed_json["epsdt_referral"].to_json
537
+ epsdt_referral = CandidApiClient::Encounters::V4::Types::EpsdtReferral.from_json(json_object: epsdt_referral)
538
+ end
539
+ claim_supplemental_information = parsed_json["claim_supplemental_information"]&.map do |item|
540
+ item = item.to_json
541
+ CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation.from_json(json_object: item)
542
+ end
543
+ secondary_payer_carrier_code = struct["secondary_payer_carrier_code"]
544
+ external_id = struct["external_id"]
545
+ date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
546
+ end_date_of_service = unless parsed_json["end_date_of_service"].nil?
547
+ Date.parse(parsed_json["end_date_of_service"])
548
+ end
549
+ patient_authorized_release = struct["patient_authorized_release"]
550
+ benefits_assigned_to_provider = struct["benefits_assigned_to_provider"]
551
+ provider_accepts_assignment = struct["provider_accepts_assignment"]
552
+ appointment_type = struct["appointment_type"]
553
+ existing_medications = parsed_json["existing_medications"]&.map do |item|
554
+ item = item.to_json
555
+ CandidApiClient::Encounters::V4::Types::Medication.from_json(json_object: item)
556
+ end
557
+ interventions = parsed_json["interventions"]&.map do |item|
558
+ item = item.to_json
559
+ CandidApiClient::Encounters::V4::Types::Intervention.from_json(json_object: item)
560
+ end
561
+ if parsed_json["pay_to_address"].nil?
562
+ pay_to_address = nil
563
+ else
564
+ pay_to_address = parsed_json["pay_to_address"].to_json
565
+ pay_to_address = CandidApiClient::Commons::Types::StreetAddressLongZip.from_json(json_object: pay_to_address)
566
+ end
567
+ synchronicity = struct["synchronicity"]
568
+ if parsed_json["vitals"].nil?
569
+ vitals = nil
570
+ else
571
+ vitals = parsed_json["vitals"].to_json
572
+ vitals = CandidApiClient::Encounters::V4::Types::Vitals.from_json(json_object: vitals)
573
+ end
574
+ billable_status = struct["billable_status"]
575
+ additional_information = struct["additional_information"]
576
+ service_authorization_exception_code = struct["service_authorization_exception_code"]
577
+ admission_date = (Date.parse(parsed_json["admission_date"]) unless parsed_json["admission_date"].nil?)
578
+ discharge_date = (Date.parse(parsed_json["discharge_date"]) unless parsed_json["discharge_date"].nil?)
579
+ onset_of_current_illness_or_symptom_date = unless parsed_json["onset_of_current_illness_or_symptom_date"].nil?
580
+ Date.parse(parsed_json["onset_of_current_illness_or_symptom_date"])
581
+ end
582
+ last_menstrual_period_date = unless parsed_json["last_menstrual_period_date"].nil?
583
+ Date.parse(parsed_json["last_menstrual_period_date"])
584
+ end
585
+ delay_reason_code = struct["delay_reason_code"]
586
+ new(
587
+ patient: patient,
588
+ referring_provider: referring_provider,
589
+ initial_referring_provider: initial_referring_provider,
590
+ supervising_provider: supervising_provider,
591
+ service_facility: service_facility,
592
+ subscriber_primary: subscriber_primary,
593
+ subscriber_secondary: subscriber_secondary,
594
+ subscriber_tertiary: subscriber_tertiary,
595
+ prior_authorization_number: prior_authorization_number,
596
+ responsible_party: responsible_party,
597
+ clinical_notes: clinical_notes,
598
+ billing_notes: billing_notes,
599
+ patient_histories: patient_histories,
600
+ guarantor: guarantor,
601
+ external_claim_submission: external_claim_submission,
602
+ tag_ids: tag_ids,
603
+ schema_instances: schema_instances,
604
+ referral_number: referral_number,
605
+ epsdt_referral: epsdt_referral,
606
+ claim_supplemental_information: claim_supplemental_information,
607
+ secondary_payer_carrier_code: secondary_payer_carrier_code,
608
+ external_id: external_id,
609
+ date_of_service: date_of_service,
610
+ end_date_of_service: end_date_of_service,
611
+ patient_authorized_release: patient_authorized_release,
612
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
613
+ provider_accepts_assignment: provider_accepts_assignment,
614
+ appointment_type: appointment_type,
615
+ existing_medications: existing_medications,
616
+ interventions: interventions,
617
+ pay_to_address: pay_to_address,
618
+ synchronicity: synchronicity,
619
+ vitals: vitals,
620
+ billable_status: billable_status,
621
+ additional_information: additional_information,
622
+ service_authorization_exception_code: service_authorization_exception_code,
623
+ admission_date: admission_date,
624
+ discharge_date: discharge_date,
625
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
626
+ last_menstrual_period_date: last_menstrual_period_date,
627
+ delay_reason_code: delay_reason_code,
628
+ additional_properties: struct
629
+ )
630
+ end
631
+
632
+ # Serialize an instance of UniversalEncounterCreateBase to a JSON object
633
+ #
634
+ # @return [String]
635
+ def to_json(*_args)
636
+ @_field_set&.to_json
637
+ end
638
+
639
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
640
+ # hash and check each fields type against the current object's property
641
+ # definitions.
642
+ #
643
+ # @param obj [Object]
644
+ # @return [Void]
645
+ def self.validate_raw(obj:)
646
+ CandidApiClient::Individual::Types::PatientCreate.validate_raw(obj: obj.patient)
647
+ obj.referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::ReferringProvider.validate_raw(obj: obj.referring_provider)
648
+ obj.initial_referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::InitialReferringProvider.validate_raw(obj: obj.initial_referring_provider)
649
+ obj.supervising_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::SupervisingProvider.validate_raw(obj: obj.supervising_provider)
650
+ obj.service_facility.nil? || CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityBase.validate_raw(obj: obj.service_facility)
651
+ obj.subscriber_primary.nil? || CandidApiClient::Individual::Types::SubscriberCreate.validate_raw(obj: obj.subscriber_primary)
652
+ obj.subscriber_secondary.nil? || CandidApiClient::Individual::Types::SubscriberCreate.validate_raw(obj: obj.subscriber_secondary)
653
+ obj.subscriber_tertiary.nil? || CandidApiClient::Individual::Types::SubscriberCreate.validate_raw(obj: obj.subscriber_tertiary)
654
+ obj.prior_authorization_number&.is_a?(String) != false || raise("Passed value for field obj.prior_authorization_number is not the expected type, validation failed.")
655
+ obj.responsible_party.is_a?(CandidApiClient::Encounters::V4::Types::ResponsiblePartyType) != false || raise("Passed value for field obj.responsible_party is not the expected type, validation failed.")
656
+ obj.clinical_notes&.is_a?(Array) != false || raise("Passed value for field obj.clinical_notes is not the expected type, validation failed.")
657
+ obj.billing_notes&.is_a?(Array) != false || raise("Passed value for field obj.billing_notes is not the expected type, validation failed.")
658
+ obj.patient_histories&.is_a?(Array) != false || raise("Passed value for field obj.patient_histories is not the expected type, validation failed.")
659
+ obj.guarantor.nil? || CandidApiClient::Guarantor::V1::Types::GuarantorCreate.validate_raw(obj: obj.guarantor)
660
+ obj.external_claim_submission.nil? || CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate.validate_raw(obj: obj.external_claim_submission)
661
+ obj.tag_ids&.is_a?(Array) != false || raise("Passed value for field obj.tag_ids is not the expected type, validation failed.")
662
+ obj.schema_instances&.is_a?(Array) != false || raise("Passed value for field obj.schema_instances is not the expected type, validation failed.")
663
+ obj.referral_number&.is_a?(String) != false || raise("Passed value for field obj.referral_number is not the expected type, validation failed.")
664
+ obj.epsdt_referral.nil? || CandidApiClient::Encounters::V4::Types::EpsdtReferral.validate_raw(obj: obj.epsdt_referral)
665
+ obj.claim_supplemental_information&.is_a?(Array) != false || raise("Passed value for field obj.claim_supplemental_information is not the expected type, validation failed.")
666
+ obj.secondary_payer_carrier_code&.is_a?(String) != false || raise("Passed value for field obj.secondary_payer_carrier_code is not the expected type, validation failed.")
667
+ obj.external_id.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
668
+ obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
669
+ 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.")
670
+ obj.patient_authorized_release.is_a?(Boolean) != false || raise("Passed value for field obj.patient_authorized_release is not the expected type, validation failed.")
671
+ 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.")
672
+ obj.provider_accepts_assignment.is_a?(Boolean) != false || raise("Passed value for field obj.provider_accepts_assignment is not the expected type, validation failed.")
673
+ obj.appointment_type&.is_a?(String) != false || raise("Passed value for field obj.appointment_type is not the expected type, validation failed.")
674
+ obj.existing_medications&.is_a?(Array) != false || raise("Passed value for field obj.existing_medications is not the expected type, validation failed.")
675
+ obj.interventions&.is_a?(Array) != false || raise("Passed value for field obj.interventions is not the expected type, validation failed.")
676
+ obj.pay_to_address.nil? || CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.pay_to_address)
677
+ obj.synchronicity&.is_a?(CandidApiClient::Encounters::V4::Types::SynchronicityType) != false || raise("Passed value for field obj.synchronicity is not the expected type, validation failed.")
678
+ obj.vitals.nil? || CandidApiClient::Encounters::V4::Types::Vitals.validate_raw(obj: obj.vitals)
679
+ 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.")
680
+ obj.additional_information&.is_a?(String) != false || raise("Passed value for field obj.additional_information is not the expected type, validation failed.")
681
+ obj.service_authorization_exception_code&.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.")
682
+ obj.admission_date&.is_a?(Date) != false || raise("Passed value for field obj.admission_date is not the expected type, validation failed.")
683
+ obj.discharge_date&.is_a?(Date) != false || raise("Passed value for field obj.discharge_date is not the expected type, validation failed.")
684
+ 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.")
685
+ 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.")
686
+ 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.")
687
+ end
688
+ end
689
+ end
690
+ end
691
+ end