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,736 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "vitals_update"
4
+ require_relative "epsdt_referral"
5
+ require_relative "clinical_note_category_create"
6
+ require_relative "claim_supplemental_information"
7
+ require_relative "../../../custom_schemas/v_1/types/schema_instance"
8
+ require_relative "medication"
9
+ require_relative "../../../guarantor/v_1/types/guarantor_update"
10
+ require_relative "../../../individual/types/subscriber_create"
11
+ require_relative "../../../commons/types/street_address_long_zip"
12
+ require_relative "../../../encounter_providers/v_2/types/initial_referring_provider_update"
13
+ require_relative "../../../encounter_providers/v_2/types/referring_provider_update"
14
+ require_relative "../../../individual/types/patient_update"
15
+ require_relative "../../../encounter_providers/v_2/types/rendering_provider_update"
16
+ require_relative "../../../service_facility/types/encounter_service_facility_update"
17
+ require_relative "../../../encounter_providers/v_2/types/supervising_provider_update"
18
+ require_relative "../../../encounter_providers/v_2/types/billing_provider_update"
19
+ require_relative "../../../commons/types/facility_type_code"
20
+ require "date"
21
+ require_relative "billable_status_type"
22
+ require_relative "responsible_party_type"
23
+ require_relative "synchronicity_type"
24
+ require_relative "service_authorization_exception_code"
25
+ require_relative "../../../commons/types/delay_reason_code"
26
+ require "ostruct"
27
+ require "json"
28
+
29
+ module CandidApiClient
30
+ module Encounters
31
+ module V4
32
+ module Types
33
+ class EncounterUpdate
34
+ # @return [CandidApiClient::Encounters::V4::Types::VitalsUpdate] If a vitals entity already exists for the encounter, then all values will be
35
+ # updated to the provided values.
36
+ # Otherwise, a new vitals object will be created for the encounter.
37
+ attr_reader :vitals
38
+ # @return [Array<String>] Ideally, this field should contain no more than 12 diagnoses. However, more
39
+ # diagnoses
40
+ # may be submitted at this time, and coders will later prioritize the 12 that will
41
+ # be
42
+ # submitted to the payor.
43
+ attr_reader :diagnosis_ids
44
+ # @return [CandidApiClient::Encounters::V4::Types::EpsdtReferral] Refers to Box 24H on the CMS1500 form and Loop 2300 CRC - EPSDT Referral on the
45
+ # 837P and 837i form
46
+ attr_reader :epsdt_referral
47
+ # @return [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>] Holds a collection of clinical observations made by healthcare providers during
48
+ # patient encounters. Please note that medical records for appeals should be sent
49
+ # using the Encounter Attachments API.
50
+ attr_reader :clinical_notes
51
+ # @return [Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>] Refers to Loop 2300 - Segment PWK on the 837P and 837i form. No more than 10
52
+ # entries are permitted.
53
+ attr_reader :claim_supplemental_information
54
+ # @return [Array<CandidApiClient::CustomSchemas::V1::Types::SchemaInstance>] Key-value pairs that must adhere to a schema created via the Custom Schema API.
55
+ # Multiple schema
56
+ # instances cannot be created for the same schema on an encounter. Updating schema
57
+ # instances utilizes PUT
58
+ # semantics, so the schema instances on the encounter will be set to whatever
59
+ # inputs are provided. If null
60
+ # is provided as an input, then the encounter's schema instances will be cleared.
61
+ attr_reader :schema_instances
62
+ # @return [Array<CandidApiClient::Encounters::V4::Types::Medication>] Existing medications that should be on the encounter.
63
+ # Note all current existing medications on encounter will be overridden with this
64
+ # list.
65
+ attr_reader :existing_medications
66
+ # @return [CandidApiClient::Guarantor::V1::Types::GuarantorUpdate] Personal and contact info for the guarantor of the patient responsibility.
67
+ attr_reader :guarantor
68
+ # @return [CandidApiClient::Individual::Types::SubscriberCreate] Contains details of the primary insurance subscriber.
69
+ attr_reader :subscriber_primary
70
+ # @return [CandidApiClient::Individual::Types::SubscriberCreate] Contains details of the secondary insurance subscriber.
71
+ attr_reader :subscriber_secondary
72
+ # @return [CandidApiClient::Individual::Types::SubscriberCreate] Contains details of the tertiary insurance subscriber.
73
+ attr_reader :subscriber_tertiary
74
+ # @return [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
75
+ attr_reader :pay_to_address
76
+ # @return [CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdate] The second iteration of Loop ID-2310 on an 837P form. Use code "P3 - Primary
77
+ # Care Provider" in this loop to
78
+ # indicate the initial referral from the primary care provider or whatever
79
+ # provider wrote the initial referral for this patient's episode of care being
80
+ # billed/reported in this transaction.
81
+ # Not used in an 837i claim
82
+ attr_reader :initial_referring_provider
83
+ # @return [CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdate] The final provider who referred the services that were rendered.
84
+ # All physicians who order services or refer Medicare beneficiaries must
85
+ # report this data.
86
+ attr_reader :referring_provider
87
+ # @return [CandidApiClient::Individual::Types::PatientUpdate] Contains the identification information of the individual receiving medical
88
+ # services.
89
+ attr_reader :patient
90
+ # @return [CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate] The rendering provider is the practitioner -- physician, nurse practitioner,
91
+ # etc. -- performing the service.
92
+ # For telehealth services, the rendering provider performs the visit, asynchronous
93
+ # communication, or other service. The rendering provider address should generally
94
+ # be the same as the service facility address.
95
+ attr_reader :rendering_provider
96
+ # @return [CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityUpdate] Encounter Service facility is typically the location a medical service was
97
+ # rendered, such as a provider office or hospital. For telehealth, service
98
+ # facility can represent the provider's location when the service was delivered
99
+ # (e.g., home), or the location where an in-person visit would have taken place,
100
+ # whichever is easier to identify. If the provider is in-network, service facility
101
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. There is
102
+ # no equivalent on the paper UB-04 claim form, but this field is equivalent to
103
+ # Loop 2310E Service Facility Location details on an 837i form, and is used when
104
+ # this is different to the entity identified as the Billing Provider. Note that
105
+ # for an in-network claim to be successfully adjudicated, the service facility
106
+ # address listed
107
+ attr_reader :service_facility
108
+ # @return [CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdate] Required when the rendering provider is supervised by a physician. If not
109
+ # required by this implementation guide, do not send.
110
+ attr_reader :supervising_provider
111
+ # @return [CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdate] The billing provider is the provider or business entity submitting the claim.
112
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
113
+ # rendering provider. From a payer's perspective, this represents the person or
114
+ # entity being reimbursed. When a contract exists with the target payer, the
115
+ # billing provider should be the entity contracted with the payer. In some
116
+ # circumstances, this will be an individual provider. In that case, submit that
117
+ # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
118
+ # contracting. In other cases, the billing entity will be a medical group. If so,
119
+ # submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim or
120
+ # Form Locator 1 on a UB-04 claim form.
121
+ attr_reader :billing_provider
122
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. 837p Loop2300, CLM-05-1. This box is not
123
+ # used on a UB-04 or 837i claim form. 02 for telemedicine, 11 for in-person. Full
124
+ # list
125
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
126
+ attr_reader :place_of_service_code_as_submitted
127
+ # @return [Boolean] Whether this patient has authorized insurance payments to be made to you, not
128
+ # them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim
129
+ # form or Form Locator 53 on a UB-04 claim form.
130
+ attr_reader :benefits_assigned_to_provider
131
+ # @return [String] Box 23 on the CMS-1500 claim form or Form Locator 63 on a UB-04 claim form.
132
+ attr_reader :prior_authorization_number
133
+ # @return [String] A client-specified unique ID to associate with this encounter;
134
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
135
+ # This field should not contain PHI.
136
+ attr_reader :external_id
137
+ # @return [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
138
+ # This date must be the local date in the timezone where the service occurred.
139
+ # Box 24a on the CMS-1500 claim form or Form Locator 45 on the UB-04 claim form.
140
+ # If service occurred over a range of dates, this should be the start date.
141
+ # If service lines have distinct date_of_service values, updating the encounter's
142
+ # date_of_service will fail. If all service line date_of_service values are the
143
+ # same, updating the encounter's date_of_service will update all service line
144
+ # date_of_service values.
145
+ attr_reader :date_of_service
146
+ # @return [Array<String>] Names of tags that should be on the encounter. Note all tags on encounter will
147
+ # be overridden with this list.
148
+ attr_reader :tag_ids
149
+ # @return [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
150
+ # Examples for when this should be set to NOT_BILLABLE include if the Encounter
151
+ # has not occurred yet or if there is no intention of ever billing the
152
+ # responsible_party.
153
+ attr_reader :billable_status
154
+ # @return [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use
155
+ # SELF_PAY if you intend to bill self pay/cash pay.
156
+ attr_reader :responsible_party
157
+ # @return [Boolean] Whether you have accepted the patient's authorization for insurance payments to
158
+ # be made to you, not them. Box 27 on the CMS-1500 claim form. There is no exact
159
+ # equivalent of this field on a UB-04 claim, however contributes to the concept of
160
+ # Form Locator 53.
161
+ attr_reader :provider_accepts_assignment
162
+ # @return [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter. Asynchronous
163
+ # encounters occur when providers and patients communicate online using forms,
164
+ # instant messaging, or other pre-recorded digital mediums. Synchronous encounters
165
+ # occur in live, real-time settings where the patient interacts directly with the
166
+ # provider, such as over video or a phone call.
167
+ attr_reader :synchronicity
168
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. 837p Loop2300, CLM-05-1. 02 for
169
+ # telemedicine, 11 for in-person. Full list
170
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
171
+ attr_reader :place_of_service_code
172
+ # @return [String] Human-readable description of the appointment type (ex: "Acupuncture -
173
+ # Headaches").
174
+ attr_reader :appointment_type
175
+ # @return [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
176
+ # This date must be the local date in the timezone where the service occurred.
177
+ # If omitted, the Encounter is assumed to be for a single day.
178
+ # Must not be temporally before the date_of_service field.
179
+ # If service lines have distinct end_date_of_service values, updating the
180
+ # encounter's end_date_of_service will fail. If all service line
181
+ # end_date_of_service values are the same, updating the encounter's
182
+ # end_date_of_service will update all service line date_of_service values.
183
+ attr_reader :end_date_of_service
184
+ # @return [String] Defines additional information on the claim needed by the payer.
185
+ # Box 19 on the CMS-1500 claim form or Form Locator 80 on a UB-04 claim form.
186
+ attr_reader :additional_information
187
+ # @return [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
188
+ # Required when mandated by government law or regulation to obtain authorization
189
+ # for specific service(s) but, for the
190
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
191
+ # the service was performed without
192
+ # obtaining the authorization.
193
+ attr_reader :service_authorization_exception_code
194
+ # @return [Date] 837p Loop2300 DTP*435, CMS-1500 Box 18 or UB-04 Form Locator 12.
195
+ # Required on all ambulance claims when the patient was known to be admitted to
196
+ # the hospital.
197
+ # OR
198
+ # Required on all claims involving inpatient medical visits.
199
+ attr_reader :admission_date
200
+ # @return [Date] 837p Loop2300 DTP*096, CMS-1500 Box 18 Required for inpatient claims when the
201
+ # patient was discharged from the facility and the discharge date is known. Not
202
+ # used on an institutional claim.
203
+ attr_reader :discharge_date
204
+ # @return [Date] 837p Loop2300 DTP*431, CMS-1500 Box 14
205
+ # Required for the initial medical service or visit performed in response to a
206
+ # medical emergency when the date is available and is different than the date of
207
+ # service.
208
+ # OR
209
+ # This date is the onset of acute symptoms for the current illness or condition.
210
+ # For UB-04 claims, this is populated separately via occurrence codes.
211
+ attr_reader :onset_of_current_illness_or_symptom_date
212
+ # @return [Date] 837p Loop2300 DTP*484, CMS-1500 Box 14
213
+ # Required when, in the judgment of the provider, the services on this claim are
214
+ # related to the patient's pregnancy.de
215
+ # This field is populated separately via occurrence codes for UB-04 claim forms.
216
+ attr_reader :last_menstrual_period_date
217
+ # @return [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
218
+ # Code indicating the reason why a request was delayed
219
+ attr_reader :delay_reason_code
220
+ # @return [Boolean] Whether this patient has authorized the release of medical information
221
+ # for billing purpose.
222
+ # Box 12 on the CMS-1500 claim form or Form Locator 52 on a UB-04 claim form.
223
+ attr_reader :patient_authorized_release
224
+ # @return [String] Refers to REF*9F on the 837p. Value cannot be greater than 50 characters.
225
+ attr_reader :referral_number
226
+ # @return [String] When Medicaid is billed as the secondary payer the Carrier Code is used to
227
+ # identify the primary payer. This is required for certain states.
228
+ attr_reader :secondary_payer_carrier_code
229
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
230
+ attr_reader :additional_properties
231
+ # @return [Object]
232
+ attr_reader :_field_set
233
+ protected :_field_set
234
+
235
+ OMIT = Object.new
236
+
237
+ # @param vitals [CandidApiClient::Encounters::V4::Types::VitalsUpdate] If a vitals entity already exists for the encounter, then all values will be
238
+ # updated to the provided values.
239
+ # Otherwise, a new vitals object will be created for the encounter.
240
+ # @param diagnosis_ids [Array<String>] Ideally, this field should contain no more than 12 diagnoses. However, more
241
+ # diagnoses
242
+ # may be submitted at this time, and coders will later prioritize the 12 that will
243
+ # be
244
+ # submitted to the payor.
245
+ # @param epsdt_referral [CandidApiClient::Encounters::V4::Types::EpsdtReferral] Refers to Box 24H on the CMS1500 form and Loop 2300 CRC - EPSDT Referral on the
246
+ # 837P and 837i form
247
+ # @param clinical_notes [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>] Holds a collection of clinical observations made by healthcare providers during
248
+ # patient encounters. Please note that medical records for appeals should be sent
249
+ # using the Encounter Attachments API.
250
+ # @param claim_supplemental_information [Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>] Refers to Loop 2300 - Segment PWK on the 837P and 837i form. No more than 10
251
+ # entries are permitted.
252
+ # @param schema_instances [Array<CandidApiClient::CustomSchemas::V1::Types::SchemaInstance>] Key-value pairs that must adhere to a schema created via the Custom Schema API.
253
+ # Multiple schema
254
+ # instances cannot be created for the same schema on an encounter. Updating schema
255
+ # instances utilizes PUT
256
+ # semantics, so the schema instances on the encounter will be set to whatever
257
+ # inputs are provided. If null
258
+ # is provided as an input, then the encounter's schema instances will be cleared.
259
+ # @param existing_medications [Array<CandidApiClient::Encounters::V4::Types::Medication>] Existing medications that should be on the encounter.
260
+ # Note all current existing medications on encounter will be overridden with this
261
+ # list.
262
+ # @param guarantor [CandidApiClient::Guarantor::V1::Types::GuarantorUpdate] Personal and contact info for the guarantor of the patient responsibility.
263
+ # @param subscriber_primary [CandidApiClient::Individual::Types::SubscriberCreate] Contains details of the primary insurance subscriber.
264
+ # @param subscriber_secondary [CandidApiClient::Individual::Types::SubscriberCreate] Contains details of the secondary insurance subscriber.
265
+ # @param subscriber_tertiary [CandidApiClient::Individual::Types::SubscriberCreate] Contains details of the tertiary insurance subscriber.
266
+ # @param pay_to_address [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
267
+ # @param initial_referring_provider [CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdate] The second iteration of Loop ID-2310 on an 837P form. Use code "P3 - Primary
268
+ # Care Provider" in this loop to
269
+ # indicate the initial referral from the primary care provider or whatever
270
+ # provider wrote the initial referral for this patient's episode of care being
271
+ # billed/reported in this transaction.
272
+ # Not used in an 837i claim
273
+ # @param referring_provider [CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdate] The final provider who referred the services that were rendered.
274
+ # All physicians who order services or refer Medicare beneficiaries must
275
+ # report this data.
276
+ # @param patient [CandidApiClient::Individual::Types::PatientUpdate] Contains the identification information of the individual receiving medical
277
+ # services.
278
+ # @param rendering_provider [CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate] The rendering provider is the practitioner -- physician, nurse practitioner,
279
+ # etc. -- performing the service.
280
+ # For telehealth services, the rendering provider performs the visit, asynchronous
281
+ # communication, or other service. The rendering provider address should generally
282
+ # be the same as the service facility address.
283
+ # @param service_facility [CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityUpdate] Encounter Service facility is typically the location a medical service was
284
+ # rendered, such as a provider office or hospital. For telehealth, service
285
+ # facility can represent the provider's location when the service was delivered
286
+ # (e.g., home), or the location where an in-person visit would have taken place,
287
+ # whichever is easier to identify. If the provider is in-network, service facility
288
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. There is
289
+ # no equivalent on the paper UB-04 claim form, but this field is equivalent to
290
+ # Loop 2310E Service Facility Location details on an 837i form, and is used when
291
+ # this is different to the entity identified as the Billing Provider. Note that
292
+ # for an in-network claim to be successfully adjudicated, the service facility
293
+ # address listed
294
+ # @param supervising_provider [CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdate] Required when the rendering provider is supervised by a physician. If not
295
+ # required by this implementation guide, do not send.
296
+ # @param billing_provider [CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdate] The billing provider is the provider or business entity submitting the claim.
297
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
298
+ # rendering provider. From a payer's perspective, this represents the person or
299
+ # entity being reimbursed. When a contract exists with the target payer, the
300
+ # billing provider should be the entity contracted with the payer. In some
301
+ # circumstances, this will be an individual provider. In that case, submit that
302
+ # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
303
+ # contracting. In other cases, the billing entity will be a medical group. If so,
304
+ # submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim or
305
+ # Form Locator 1 on a UB-04 claim form.
306
+ # @param place_of_service_code_as_submitted [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. 837p Loop2300, CLM-05-1. This box is not
307
+ # used on a UB-04 or 837i claim form. 02 for telemedicine, 11 for in-person. Full
308
+ # list
309
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
310
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you, not
311
+ # them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim
312
+ # form or Form Locator 53 on a UB-04 claim form.
313
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form or Form Locator 63 on a UB-04 claim form.
314
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
315
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
316
+ # This field should not contain PHI.
317
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
318
+ # This date must be the local date in the timezone where the service occurred.
319
+ # Box 24a on the CMS-1500 claim form or Form Locator 45 on the UB-04 claim form.
320
+ # If service occurred over a range of dates, this should be the start date.
321
+ # If service lines have distinct date_of_service values, updating the encounter's
322
+ # date_of_service will fail. If all service line date_of_service values are the
323
+ # same, updating the encounter's date_of_service will update all service line
324
+ # date_of_service values.
325
+ # @param tag_ids [Array<String>] Names of tags that should be on the encounter. Note all tags on encounter will
326
+ # be overridden with this list.
327
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
328
+ # Examples for when this should be set to NOT_BILLABLE include if the Encounter
329
+ # has not occurred yet or if there is no intention of ever billing the
330
+ # responsible_party.
331
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use
332
+ # SELF_PAY if you intend to bill self pay/cash pay.
333
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments to
334
+ # be made to you, not them. Box 27 on the CMS-1500 claim form. There is no exact
335
+ # equivalent of this field on a UB-04 claim, however contributes to the concept of
336
+ # Form Locator 53.
337
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter. Asynchronous
338
+ # encounters occur when providers and patients communicate online using forms,
339
+ # instant messaging, or other pre-recorded digital mediums. Synchronous encounters
340
+ # occur in live, real-time settings where the patient interacts directly with the
341
+ # provider, such as over video or a phone call.
342
+ # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. 837p Loop2300, CLM-05-1. 02 for
343
+ # telemedicine, 11 for in-person. Full list
344
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
345
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
346
+ # Headaches").
347
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
348
+ # This date must be the local date in the timezone where the service occurred.
349
+ # If omitted, the Encounter is assumed to be for a single day.
350
+ # Must not be temporally before the date_of_service field.
351
+ # If service lines have distinct end_date_of_service values, updating the
352
+ # encounter's end_date_of_service will fail. If all service line
353
+ # end_date_of_service values are the same, updating the encounter's
354
+ # end_date_of_service will update all service line date_of_service values.
355
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
356
+ # Box 19 on the CMS-1500 claim form or Form Locator 80 on a UB-04 claim form.
357
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
358
+ # Required when mandated by government law or regulation to obtain authorization
359
+ # for specific service(s) but, for the
360
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
361
+ # the service was performed without
362
+ # obtaining the authorization.
363
+ # @param admission_date [Date] 837p Loop2300 DTP*435, CMS-1500 Box 18 or UB-04 Form Locator 12.
364
+ # Required on all ambulance claims when the patient was known to be admitted to
365
+ # the hospital.
366
+ # OR
367
+ # Required on all claims involving inpatient medical visits.
368
+ # @param discharge_date [Date] 837p Loop2300 DTP*096, CMS-1500 Box 18 Required for inpatient claims when the
369
+ # patient was discharged from the facility and the discharge date is known. Not
370
+ # used on an institutional claim.
371
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP*431, CMS-1500 Box 14
372
+ # Required for the initial medical service or visit performed in response to a
373
+ # medical emergency when the date is available and is different than the date of
374
+ # service.
375
+ # OR
376
+ # This date is the onset of acute symptoms for the current illness or condition.
377
+ # For UB-04 claims, this is populated separately via occurrence codes.
378
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP*484, CMS-1500 Box 14
379
+ # Required when, in the judgment of the provider, the services on this claim are
380
+ # related to the patient's pregnancy.de
381
+ # This field is populated separately via occurrence codes for UB-04 claim forms.
382
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
383
+ # Code indicating the reason why a request was delayed
384
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
385
+ # for billing purpose.
386
+ # Box 12 on the CMS-1500 claim form or Form Locator 52 on a UB-04 claim form.
387
+ # @param referral_number [String] Refers to REF*9F on the 837p. Value cannot be greater than 50 characters.
388
+ # @param secondary_payer_carrier_code [String] When Medicaid is billed as the secondary payer the Carrier Code is used to
389
+ # identify the primary payer. This is required for certain states.
390
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
391
+ # @return [CandidApiClient::Encounters::V4::Types::EncounterUpdate]
392
+ def initialize(vitals: OMIT, diagnosis_ids: OMIT, epsdt_referral: OMIT, clinical_notes: OMIT,
393
+ claim_supplemental_information: OMIT, schema_instances: OMIT, existing_medications: OMIT, guarantor: OMIT, subscriber_primary: OMIT, subscriber_secondary: OMIT, subscriber_tertiary: OMIT, pay_to_address: OMIT, initial_referring_provider: OMIT, referring_provider: OMIT, patient: OMIT, rendering_provider: OMIT, service_facility: OMIT, supervising_provider: OMIT, billing_provider: OMIT, place_of_service_code_as_submitted: OMIT, benefits_assigned_to_provider: OMIT, prior_authorization_number: OMIT, external_id: OMIT, date_of_service: OMIT, tag_ids: OMIT, billable_status: OMIT, responsible_party: OMIT, provider_accepts_assignment: OMIT, synchronicity: OMIT, place_of_service_code: OMIT, appointment_type: OMIT, end_date_of_service: 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, patient_authorized_release: OMIT, referral_number: OMIT, secondary_payer_carrier_code: OMIT, additional_properties: nil)
394
+ @vitals = vitals if vitals != OMIT
395
+ @diagnosis_ids = diagnosis_ids if diagnosis_ids != OMIT
396
+ @epsdt_referral = epsdt_referral if epsdt_referral != OMIT
397
+ @clinical_notes = clinical_notes if clinical_notes != OMIT
398
+ @claim_supplemental_information = claim_supplemental_information if claim_supplemental_information != OMIT
399
+ @schema_instances = schema_instances if schema_instances != OMIT
400
+ @existing_medications = existing_medications if existing_medications != OMIT
401
+ @guarantor = guarantor if guarantor != OMIT
402
+ @subscriber_primary = subscriber_primary if subscriber_primary != OMIT
403
+ @subscriber_secondary = subscriber_secondary if subscriber_secondary != OMIT
404
+ @subscriber_tertiary = subscriber_tertiary if subscriber_tertiary != OMIT
405
+ @pay_to_address = pay_to_address if pay_to_address != OMIT
406
+ @initial_referring_provider = initial_referring_provider if initial_referring_provider != OMIT
407
+ @referring_provider = referring_provider if referring_provider != OMIT
408
+ @patient = patient if patient != OMIT
409
+ @rendering_provider = rendering_provider if rendering_provider != OMIT
410
+ @service_facility = service_facility if service_facility != OMIT
411
+ @supervising_provider = supervising_provider if supervising_provider != OMIT
412
+ @billing_provider = billing_provider if billing_provider != OMIT
413
+ if place_of_service_code_as_submitted != OMIT
414
+ @place_of_service_code_as_submitted = place_of_service_code_as_submitted
415
+ end
416
+ @benefits_assigned_to_provider = benefits_assigned_to_provider if benefits_assigned_to_provider != OMIT
417
+ @prior_authorization_number = prior_authorization_number if prior_authorization_number != OMIT
418
+ @external_id = external_id if external_id != OMIT
419
+ @date_of_service = date_of_service if date_of_service != OMIT
420
+ @tag_ids = tag_ids if tag_ids != OMIT
421
+ @billable_status = billable_status if billable_status != OMIT
422
+ @responsible_party = responsible_party if responsible_party != OMIT
423
+ @provider_accepts_assignment = provider_accepts_assignment if provider_accepts_assignment != OMIT
424
+ @synchronicity = synchronicity if synchronicity != OMIT
425
+ @place_of_service_code = place_of_service_code if place_of_service_code != OMIT
426
+ @appointment_type = appointment_type if appointment_type != OMIT
427
+ @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
428
+ @additional_information = additional_information if additional_information != OMIT
429
+ if service_authorization_exception_code != OMIT
430
+ @service_authorization_exception_code = service_authorization_exception_code
431
+ end
432
+ @admission_date = admission_date if admission_date != OMIT
433
+ @discharge_date = discharge_date if discharge_date != OMIT
434
+ if onset_of_current_illness_or_symptom_date != OMIT
435
+ @onset_of_current_illness_or_symptom_date = onset_of_current_illness_or_symptom_date
436
+ end
437
+ @last_menstrual_period_date = last_menstrual_period_date if last_menstrual_period_date != OMIT
438
+ @delay_reason_code = delay_reason_code if delay_reason_code != OMIT
439
+ @patient_authorized_release = patient_authorized_release if patient_authorized_release != OMIT
440
+ @referral_number = referral_number if referral_number != OMIT
441
+ @secondary_payer_carrier_code = secondary_payer_carrier_code if secondary_payer_carrier_code != OMIT
442
+ @additional_properties = additional_properties
443
+ @_field_set = {
444
+ "vitals": vitals,
445
+ "diagnosis_ids": diagnosis_ids,
446
+ "epsdt_referral": epsdt_referral,
447
+ "clinical_notes": clinical_notes,
448
+ "claim_supplemental_information": claim_supplemental_information,
449
+ "schema_instances": schema_instances,
450
+ "existing_medications": existing_medications,
451
+ "guarantor": guarantor,
452
+ "subscriber_primary": subscriber_primary,
453
+ "subscriber_secondary": subscriber_secondary,
454
+ "subscriber_tertiary": subscriber_tertiary,
455
+ "pay_to_address": pay_to_address,
456
+ "initial_referring_provider": initial_referring_provider,
457
+ "referring_provider": referring_provider,
458
+ "patient": patient,
459
+ "rendering_provider": rendering_provider,
460
+ "service_facility": service_facility,
461
+ "supervising_provider": supervising_provider,
462
+ "billing_provider": billing_provider,
463
+ "place_of_service_code_as_submitted": place_of_service_code_as_submitted,
464
+ "benefits_assigned_to_provider": benefits_assigned_to_provider,
465
+ "prior_authorization_number": prior_authorization_number,
466
+ "external_id": external_id,
467
+ "date_of_service": date_of_service,
468
+ "tag_ids": tag_ids,
469
+ "billable_status": billable_status,
470
+ "responsible_party": responsible_party,
471
+ "provider_accepts_assignment": provider_accepts_assignment,
472
+ "synchronicity": synchronicity,
473
+ "place_of_service_code": place_of_service_code,
474
+ "appointment_type": appointment_type,
475
+ "end_date_of_service": end_date_of_service,
476
+ "additional_information": additional_information,
477
+ "service_authorization_exception_code": service_authorization_exception_code,
478
+ "admission_date": admission_date,
479
+ "discharge_date": discharge_date,
480
+ "onset_of_current_illness_or_symptom_date": onset_of_current_illness_or_symptom_date,
481
+ "last_menstrual_period_date": last_menstrual_period_date,
482
+ "delay_reason_code": delay_reason_code,
483
+ "patient_authorized_release": patient_authorized_release,
484
+ "referral_number": referral_number,
485
+ "secondary_payer_carrier_code": secondary_payer_carrier_code
486
+ }.reject do |_k, v|
487
+ v == OMIT
488
+ end
489
+ end
490
+
491
+ # Deserialize a JSON object to an instance of EncounterUpdate
492
+ #
493
+ # @param json_object [String]
494
+ # @return [CandidApiClient::Encounters::V4::Types::EncounterUpdate]
495
+ def self.from_json(json_object:)
496
+ struct = JSON.parse(json_object, object_class: OpenStruct)
497
+ parsed_json = JSON.parse(json_object)
498
+ if parsed_json["vitals"].nil?
499
+ vitals = nil
500
+ else
501
+ vitals = parsed_json["vitals"].to_json
502
+ vitals = CandidApiClient::Encounters::V4::Types::VitalsUpdate.from_json(json_object: vitals)
503
+ end
504
+ diagnosis_ids = struct["diagnosis_ids"]
505
+ if parsed_json["epsdt_referral"].nil?
506
+ epsdt_referral = nil
507
+ else
508
+ epsdt_referral = parsed_json["epsdt_referral"].to_json
509
+ epsdt_referral = CandidApiClient::Encounters::V4::Types::EpsdtReferral.from_json(json_object: epsdt_referral)
510
+ end
511
+ clinical_notes = parsed_json["clinical_notes"]&.map do |item|
512
+ item = item.to_json
513
+ CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate.from_json(json_object: item)
514
+ end
515
+ claim_supplemental_information = parsed_json["claim_supplemental_information"]&.map do |item|
516
+ item = item.to_json
517
+ CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation.from_json(json_object: item)
518
+ end
519
+ schema_instances = parsed_json["schema_instances"]&.map do |item|
520
+ item = item.to_json
521
+ CandidApiClient::CustomSchemas::V1::Types::SchemaInstance.from_json(json_object: item)
522
+ end
523
+ existing_medications = parsed_json["existing_medications"]&.map do |item|
524
+ item = item.to_json
525
+ CandidApiClient::Encounters::V4::Types::Medication.from_json(json_object: item)
526
+ end
527
+ if parsed_json["guarantor"].nil?
528
+ guarantor = nil
529
+ else
530
+ guarantor = parsed_json["guarantor"].to_json
531
+ guarantor = CandidApiClient::Guarantor::V1::Types::GuarantorUpdate.from_json(json_object: guarantor)
532
+ end
533
+ if parsed_json["subscriber_primary"].nil?
534
+ subscriber_primary = nil
535
+ else
536
+ subscriber_primary = parsed_json["subscriber_primary"].to_json
537
+ subscriber_primary = CandidApiClient::Individual::Types::SubscriberCreate.from_json(json_object: subscriber_primary)
538
+ end
539
+ if parsed_json["subscriber_secondary"].nil?
540
+ subscriber_secondary = nil
541
+ else
542
+ subscriber_secondary = parsed_json["subscriber_secondary"].to_json
543
+ subscriber_secondary = CandidApiClient::Individual::Types::SubscriberCreate.from_json(json_object: subscriber_secondary)
544
+ end
545
+ if parsed_json["subscriber_tertiary"].nil?
546
+ subscriber_tertiary = nil
547
+ else
548
+ subscriber_tertiary = parsed_json["subscriber_tertiary"].to_json
549
+ subscriber_tertiary = CandidApiClient::Individual::Types::SubscriberCreate.from_json(json_object: subscriber_tertiary)
550
+ end
551
+ if parsed_json["pay_to_address"].nil?
552
+ pay_to_address = nil
553
+ else
554
+ pay_to_address = parsed_json["pay_to_address"].to_json
555
+ pay_to_address = CandidApiClient::Commons::Types::StreetAddressLongZip.from_json(json_object: pay_to_address)
556
+ end
557
+ if parsed_json["initial_referring_provider"].nil?
558
+ initial_referring_provider = nil
559
+ else
560
+ initial_referring_provider = parsed_json["initial_referring_provider"].to_json
561
+ initial_referring_provider = CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdate.from_json(json_object: initial_referring_provider)
562
+ end
563
+ if parsed_json["referring_provider"].nil?
564
+ referring_provider = nil
565
+ else
566
+ referring_provider = parsed_json["referring_provider"].to_json
567
+ referring_provider = CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdate.from_json(json_object: referring_provider)
568
+ end
569
+ if parsed_json["patient"].nil?
570
+ patient = nil
571
+ else
572
+ patient = parsed_json["patient"].to_json
573
+ patient = CandidApiClient::Individual::Types::PatientUpdate.from_json(json_object: patient)
574
+ end
575
+ if parsed_json["rendering_provider"].nil?
576
+ rendering_provider = nil
577
+ else
578
+ rendering_provider = parsed_json["rendering_provider"].to_json
579
+ rendering_provider = CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate.from_json(json_object: rendering_provider)
580
+ end
581
+ if parsed_json["service_facility"].nil?
582
+ service_facility = nil
583
+ else
584
+ service_facility = parsed_json["service_facility"].to_json
585
+ service_facility = CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityUpdate.from_json(json_object: service_facility)
586
+ end
587
+ if parsed_json["supervising_provider"].nil?
588
+ supervising_provider = nil
589
+ else
590
+ supervising_provider = parsed_json["supervising_provider"].to_json
591
+ supervising_provider = CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdate.from_json(json_object: supervising_provider)
592
+ end
593
+ if parsed_json["billing_provider"].nil?
594
+ billing_provider = nil
595
+ else
596
+ billing_provider = parsed_json["billing_provider"].to_json
597
+ billing_provider = CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdate.from_json(json_object: billing_provider)
598
+ end
599
+ place_of_service_code_as_submitted = struct["place_of_service_code_as_submitted"]
600
+ benefits_assigned_to_provider = struct["benefits_assigned_to_provider"]
601
+ prior_authorization_number = struct["prior_authorization_number"]
602
+ external_id = struct["external_id"]
603
+ date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
604
+ tag_ids = struct["tag_ids"]
605
+ billable_status = struct["billable_status"]
606
+ responsible_party = struct["responsible_party"]
607
+ provider_accepts_assignment = struct["provider_accepts_assignment"]
608
+ synchronicity = struct["synchronicity"]
609
+ place_of_service_code = struct["place_of_service_code"]
610
+ appointment_type = struct["appointment_type"]
611
+ end_date_of_service = unless parsed_json["end_date_of_service"].nil?
612
+ Date.parse(parsed_json["end_date_of_service"])
613
+ end
614
+ additional_information = struct["additional_information"]
615
+ service_authorization_exception_code = struct["service_authorization_exception_code"]
616
+ admission_date = (Date.parse(parsed_json["admission_date"]) unless parsed_json["admission_date"].nil?)
617
+ discharge_date = (Date.parse(parsed_json["discharge_date"]) unless parsed_json["discharge_date"].nil?)
618
+ onset_of_current_illness_or_symptom_date = unless parsed_json["onset_of_current_illness_or_symptom_date"].nil?
619
+ Date.parse(parsed_json["onset_of_current_illness_or_symptom_date"])
620
+ end
621
+ last_menstrual_period_date = unless parsed_json["last_menstrual_period_date"].nil?
622
+ Date.parse(parsed_json["last_menstrual_period_date"])
623
+ end
624
+ delay_reason_code = struct["delay_reason_code"]
625
+ patient_authorized_release = struct["patient_authorized_release"]
626
+ referral_number = struct["referral_number"]
627
+ secondary_payer_carrier_code = struct["secondary_payer_carrier_code"]
628
+ new(
629
+ vitals: vitals,
630
+ diagnosis_ids: diagnosis_ids,
631
+ epsdt_referral: epsdt_referral,
632
+ clinical_notes: clinical_notes,
633
+ claim_supplemental_information: claim_supplemental_information,
634
+ schema_instances: schema_instances,
635
+ existing_medications: existing_medications,
636
+ guarantor: guarantor,
637
+ subscriber_primary: subscriber_primary,
638
+ subscriber_secondary: subscriber_secondary,
639
+ subscriber_tertiary: subscriber_tertiary,
640
+ pay_to_address: pay_to_address,
641
+ initial_referring_provider: initial_referring_provider,
642
+ referring_provider: referring_provider,
643
+ patient: patient,
644
+ rendering_provider: rendering_provider,
645
+ service_facility: service_facility,
646
+ supervising_provider: supervising_provider,
647
+ billing_provider: billing_provider,
648
+ place_of_service_code_as_submitted: place_of_service_code_as_submitted,
649
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
650
+ prior_authorization_number: prior_authorization_number,
651
+ external_id: external_id,
652
+ date_of_service: date_of_service,
653
+ tag_ids: tag_ids,
654
+ billable_status: billable_status,
655
+ responsible_party: responsible_party,
656
+ provider_accepts_assignment: provider_accepts_assignment,
657
+ synchronicity: synchronicity,
658
+ place_of_service_code: place_of_service_code,
659
+ appointment_type: appointment_type,
660
+ end_date_of_service: end_date_of_service,
661
+ additional_information: additional_information,
662
+ service_authorization_exception_code: service_authorization_exception_code,
663
+ admission_date: admission_date,
664
+ discharge_date: discharge_date,
665
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
666
+ last_menstrual_period_date: last_menstrual_period_date,
667
+ delay_reason_code: delay_reason_code,
668
+ patient_authorized_release: patient_authorized_release,
669
+ referral_number: referral_number,
670
+ secondary_payer_carrier_code: secondary_payer_carrier_code,
671
+ additional_properties: struct
672
+ )
673
+ end
674
+
675
+ # Serialize an instance of EncounterUpdate to a JSON object
676
+ #
677
+ # @return [String]
678
+ def to_json(*_args)
679
+ @_field_set&.to_json
680
+ end
681
+
682
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
683
+ # hash and check each fields type against the current object's property
684
+ # definitions.
685
+ #
686
+ # @param obj [Object]
687
+ # @return [Void]
688
+ def self.validate_raw(obj:)
689
+ obj.vitals.nil? || CandidApiClient::Encounters::V4::Types::VitalsUpdate.validate_raw(obj: obj.vitals)
690
+ obj.diagnosis_ids&.is_a?(Array) != false || raise("Passed value for field obj.diagnosis_ids is not the expected type, validation failed.")
691
+ obj.epsdt_referral.nil? || CandidApiClient::Encounters::V4::Types::EpsdtReferral.validate_raw(obj: obj.epsdt_referral)
692
+ obj.clinical_notes&.is_a?(Array) != false || raise("Passed value for field obj.clinical_notes is not the expected type, validation failed.")
693
+ obj.claim_supplemental_information&.is_a?(Array) != false || raise("Passed value for field obj.claim_supplemental_information is not the expected type, validation failed.")
694
+ obj.schema_instances&.is_a?(Array) != false || raise("Passed value for field obj.schema_instances is not the expected type, validation failed.")
695
+ obj.existing_medications&.is_a?(Array) != false || raise("Passed value for field obj.existing_medications is not the expected type, validation failed.")
696
+ obj.guarantor.nil? || CandidApiClient::Guarantor::V1::Types::GuarantorUpdate.validate_raw(obj: obj.guarantor)
697
+ obj.subscriber_primary.nil? || CandidApiClient::Individual::Types::SubscriberCreate.validate_raw(obj: obj.subscriber_primary)
698
+ obj.subscriber_secondary.nil? || CandidApiClient::Individual::Types::SubscriberCreate.validate_raw(obj: obj.subscriber_secondary)
699
+ obj.subscriber_tertiary.nil? || CandidApiClient::Individual::Types::SubscriberCreate.validate_raw(obj: obj.subscriber_tertiary)
700
+ obj.pay_to_address.nil? || CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.pay_to_address)
701
+ obj.initial_referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdate.validate_raw(obj: obj.initial_referring_provider)
702
+ obj.referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdate.validate_raw(obj: obj.referring_provider)
703
+ obj.patient.nil? || CandidApiClient::Individual::Types::PatientUpdate.validate_raw(obj: obj.patient)
704
+ obj.rendering_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate.validate_raw(obj: obj.rendering_provider)
705
+ obj.service_facility.nil? || CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityUpdate.validate_raw(obj: obj.service_facility)
706
+ obj.supervising_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdate.validate_raw(obj: obj.supervising_provider)
707
+ obj.billing_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdate.validate_raw(obj: obj.billing_provider)
708
+ obj.place_of_service_code_as_submitted&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code_as_submitted is not the expected type, validation failed.")
709
+ 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.")
710
+ obj.prior_authorization_number&.is_a?(String) != false || raise("Passed value for field obj.prior_authorization_number is not the expected type, validation failed.")
711
+ obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
712
+ obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
713
+ obj.tag_ids&.is_a?(Array) != false || raise("Passed value for field obj.tag_ids is not the expected type, validation failed.")
714
+ 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.")
715
+ 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.")
716
+ obj.provider_accepts_assignment&.is_a?(Boolean) != false || raise("Passed value for field obj.provider_accepts_assignment is not the expected type, validation failed.")
717
+ obj.synchronicity&.is_a?(CandidApiClient::Encounters::V4::Types::SynchronicityType) != false || raise("Passed value for field obj.synchronicity is not the expected type, validation failed.")
718
+ obj.place_of_service_code&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code is not the expected type, validation failed.")
719
+ obj.appointment_type&.is_a?(String) != false || raise("Passed value for field obj.appointment_type is not the expected type, validation failed.")
720
+ 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.")
721
+ obj.additional_information&.is_a?(String) != false || raise("Passed value for field obj.additional_information is not the expected type, validation failed.")
722
+ 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.")
723
+ obj.admission_date&.is_a?(Date) != false || raise("Passed value for field obj.admission_date is not the expected type, validation failed.")
724
+ obj.discharge_date&.is_a?(Date) != false || raise("Passed value for field obj.discharge_date is not the expected type, validation failed.")
725
+ 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.")
726
+ 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.")
727
+ 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.")
728
+ obj.patient_authorized_release&.is_a?(Boolean) != false || raise("Passed value for field obj.patient_authorized_release is not the expected type, validation failed.")
729
+ obj.referral_number&.is_a?(String) != false || raise("Passed value for field obj.referral_number is not the expected type, validation failed.")
730
+ 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.")
731
+ end
732
+ end
733
+ end
734
+ end
735
+ end
736
+ end