candidhealth 0.43.1 → 0.45.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.
@@ -153,6 +153,9 @@ module CandidApiClient
153
153
  # @return [Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>] Refers to Loop 2300 - Segment PWK on the 837P form. No more than 10 entries are
154
154
  # permitted.
155
155
  attr_reader :claim_supplemental_information
156
+ # @return [String] When Medicaid is billed as the secondary payer the Carrier Code is used to
157
+ # identify the primary payer. This is required for certain states.
158
+ attr_reader :secondary_payer_carrier_code
156
159
  # @return [DateTime] The date and time the encounter was last submitted to a payer.
157
160
  attr_reader :last_submitted_at
158
161
  # @return [DateTime] The date and time the encounter was created.
@@ -339,6 +342,8 @@ module CandidApiClient
339
342
  # 837P form
340
343
  # @param claim_supplemental_information [Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>] Refers to Loop 2300 - Segment PWK on the 837P form. No more than 10 entries are
341
344
  # permitted.
345
+ # @param secondary_payer_carrier_code [String] When Medicaid is billed as the secondary payer the Carrier Code is used to
346
+ # identify the primary payer. This is required for certain states.
342
347
  # @param last_submitted_at [DateTime] The date and time the encounter was last submitted to a payer.
343
348
  # @param created_at [DateTime] The date and time the encounter was created.
344
349
  # @param external_id [String] A client-specified unique ID to associate with this encounter;
@@ -416,7 +421,7 @@ module CandidApiClient
416
421
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
417
422
  # @return [CandidApiClient::Encounters::V4::Types::Encounter]
418
423
  def initialize(encounter_id:, claims:, patient:, billing_provider:, rendering_provider:, service_facility:,
419
- responsible_party:, url:, diagnoses:, clinical_notes:, patient_histories:, patient_payments:, tags:, owner_of_next_action:, submission_origin:, schema_instances:, created_at:, external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, patient_control_number: OMIT, guarantor: OMIT, referring_provider: OMIT, initial_referring_provider: OMIT, supervising_provider: OMIT, subscriber_primary: OMIT, subscriber_secondary: OMIT, subscriber_tertiary: OMIT, prior_authorization_number: OMIT, billing_notes: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, coding_attribution: OMIT, work_queue_id: OMIT, work_queue_membership_activated_at: OMIT, referral_number: OMIT, epsdt_referral: OMIT, claim_supplemental_information: OMIT, last_submitted_at: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, appointment_type: OMIT, existing_medications: OMIT, vitals: OMIT, interventions: OMIT, pay_to_address: OMIT, synchronicity: OMIT, additional_information: OMIT, service_authorization_exception_code: OMIT, admission_date: OMIT, discharge_date: OMIT, onset_of_current_illness_or_symptom_date: OMIT, last_menstrual_period_date: OMIT, delay_reason_code: OMIT, additional_properties: nil)
424
+ responsible_party:, url:, diagnoses:, clinical_notes:, patient_histories:, patient_payments:, tags:, owner_of_next_action:, submission_origin:, schema_instances:, created_at:, external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, patient_control_number: OMIT, guarantor: OMIT, referring_provider: OMIT, initial_referring_provider: OMIT, supervising_provider: OMIT, subscriber_primary: OMIT, subscriber_secondary: OMIT, subscriber_tertiary: OMIT, prior_authorization_number: OMIT, billing_notes: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, coding_attribution: OMIT, work_queue_id: OMIT, work_queue_membership_activated_at: OMIT, referral_number: OMIT, epsdt_referral: OMIT, claim_supplemental_information: OMIT, secondary_payer_carrier_code: OMIT, last_submitted_at: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, appointment_type: OMIT, existing_medications: OMIT, vitals: OMIT, interventions: OMIT, pay_to_address: OMIT, synchronicity: OMIT, additional_information: OMIT, service_authorization_exception_code: OMIT, admission_date: OMIT, discharge_date: OMIT, onset_of_current_illness_or_symptom_date: OMIT, last_menstrual_period_date: OMIT, delay_reason_code: OMIT, additional_properties: nil)
420
425
  @patient_control_number = patient_control_number if patient_control_number != OMIT
421
426
  @encounter_id = encounter_id
422
427
  @claims = claims
@@ -455,6 +460,7 @@ module CandidApiClient
455
460
  @referral_number = referral_number if referral_number != OMIT
456
461
  @epsdt_referral = epsdt_referral if epsdt_referral != OMIT
457
462
  @claim_supplemental_information = claim_supplemental_information if claim_supplemental_information != OMIT
463
+ @secondary_payer_carrier_code = secondary_payer_carrier_code if secondary_payer_carrier_code != OMIT
458
464
  @last_submitted_at = last_submitted_at if last_submitted_at != OMIT
459
465
  @created_at = created_at
460
466
  @external_id = external_id
@@ -517,6 +523,7 @@ module CandidApiClient
517
523
  "referral_number": referral_number,
518
524
  "epsdt_referral": epsdt_referral,
519
525
  "claim_supplemental_information": claim_supplemental_information,
526
+ "secondary_payer_carrier_code": secondary_payer_carrier_code,
520
527
  "last_submitted_at": last_submitted_at,
521
528
  "created_at": created_at,
522
529
  "external_id": external_id,
@@ -674,6 +681,7 @@ module CandidApiClient
674
681
  item = item.to_json
675
682
  CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation.from_json(json_object: item)
676
683
  end
684
+ secondary_payer_carrier_code = struct["secondary_payer_carrier_code"]
677
685
  last_submitted_at = unless parsed_json["last_submitted_at"].nil?
678
686
  DateTime.parse(parsed_json["last_submitted_at"])
679
687
  end
@@ -755,6 +763,7 @@ module CandidApiClient
755
763
  referral_number: referral_number,
756
764
  epsdt_referral: epsdt_referral,
757
765
  claim_supplemental_information: claim_supplemental_information,
766
+ secondary_payer_carrier_code: secondary_payer_carrier_code,
758
767
  last_submitted_at: last_submitted_at,
759
768
  created_at: created_at,
760
769
  external_id: external_id,
@@ -829,6 +838,7 @@ module CandidApiClient
829
838
  obj.referral_number&.is_a?(String) != false || raise("Passed value for field obj.referral_number is not the expected type, validation failed.")
830
839
  obj.epsdt_referral.nil? || CandidApiClient::Encounters::V4::Types::EpsdtReferral.validate_raw(obj: obj.epsdt_referral)
831
840
  obj.claim_supplemental_information&.is_a?(Array) != false || raise("Passed value for field obj.claim_supplemental_information is not the expected type, validation failed.")
841
+ 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.")
832
842
  obj.last_submitted_at&.is_a?(DateTime) != false || raise("Passed value for field obj.last_submitted_at is not the expected type, validation failed.")
833
843
  obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
834
844
  obj.external_id.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "date"
4
4
  require_relative "clinical_note_category_create"
5
- require_relative "../../../commons/types/street_address_long_zip"
6
5
  require_relative "billable_status_type"
7
6
  require_relative "responsible_party_type"
8
7
  require_relative "synchronicity_type"
@@ -10,17 +9,10 @@ require_relative "../../../commons/types/facility_type_code"
10
9
  require_relative "../../../individual/types/subscriber_create"
11
10
  require_relative "service_authorization_exception_code"
12
11
  require_relative "../../../commons/types/delay_reason_code"
13
- require_relative "../../../individual/types/patient_update"
14
12
  require_relative "../../../custom_schemas/v_1/types/schema_instance"
15
13
  require_relative "vitals_update"
16
14
  require_relative "medication"
17
- require_relative "../../../encounter_providers/v_2/types/rendering_provider_update"
18
- require_relative "../../../service_facility/types/encounter_service_facility_update"
19
15
  require_relative "../../../guarantor/v_1/types/guarantor_update"
20
- require_relative "../../../encounter_providers/v_2/types/billing_provider_update"
21
- require_relative "../../../encounter_providers/v_2/types/supervising_provider_update"
22
- require_relative "../../../encounter_providers/v_2/types/referring_provider_update"
23
- require_relative "../../../encounter_providers/v_2/types/initial_referring_provider_update"
24
16
  require_relative "epsdt_referral"
25
17
  require_relative "claim_supplemental_information"
26
18
  require "ostruct"
@@ -56,8 +48,6 @@ module CandidApiClient
56
48
  # @return [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>] Holds a collection of clinical observations made by healthcare providers during
57
49
  # patient encounters.
58
50
  attr_reader :clinical_notes
59
- # @return [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
60
- attr_reader :pay_to_address
61
51
  # @return [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
62
52
  # Examples for when this should be set to NOT_BILLABLE include if the Encounter
63
53
  # has not occurred yet or if there is no intention of ever billing the
@@ -131,9 +121,6 @@ module CandidApiClient
131
121
  # @return [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
132
122
  # Code indicating the reason why a request was delayed
133
123
  attr_reader :delay_reason_code
134
- # @return [CandidApiClient::Individual::Types::PatientUpdate] Contains the identification information of the individual receiving medical
135
- # services.
136
- attr_reader :patient
137
124
  # @return [Boolean] Whether this patient has authorized the release of medical information
138
125
  # for billing purpose.
139
126
  # Box 12 on the CMS-1500 claim form.
@@ -154,47 +141,8 @@ module CandidApiClient
154
141
  # Note all current existing medications on encounter will be overridden with this
155
142
  # list.
156
143
  attr_reader :existing_medications
157
- # @return [CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate] The rendering provider is the practitioner -- physician, nurse practitioner,
158
- # etc. -- performing the service.
159
- # For telehealth services, the rendering provider performs the visit, asynchronous
160
- # communication, or other service. The rendering provider address should generally
161
- # be the same as the service facility address.
162
- attr_reader :rendering_provider
163
- # @return [CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityUpdate] Encounter Service facility is typically the location a medical service was
164
- # rendered, such as a provider office or hospital. For telehealth, service
165
- # facility can represent the provider's location when the service was delivered
166
- # (e.g., home), or the location where an in-person visit would have taken place,
167
- # whichever is easier to identify. If the provider is in-network, service facility
168
- # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
169
- # for an in-network claim to be successfully adjudicated, the service facility
170
- # address listed on claims must match what was provided to the payer during the
171
- # credentialing process.
172
- attr_reader :service_facility
173
144
  # @return [CandidApiClient::Guarantor::V1::Types::GuarantorUpdate] Personal and contact info for the guarantor of the patient responsibility.
174
145
  attr_reader :guarantor
175
- # @return [CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdate] The billing provider is the provider or business entity submitting the claim.
176
- # Billing provider may be, but is not necessarily, the same person/NPI as the
177
- # rendering provider. From a payer's perspective, this represents the person or
178
- # entity being reimbursed. When a contract exists with the target payer, the
179
- # billing provider should be the entity contracted with the payer. In some
180
- # circumstances, this will be an individual provider. In that case, submit that
181
- # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
182
- # contracting. In other cases, the billing entity will be a medical group. If so,
183
- # submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.
184
- attr_reader :billing_provider
185
- # @return [CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdate] Required when the rendering provider is supervised by a physician. If not
186
- # required by this implementation guide, do not send.
187
- attr_reader :supervising_provider
188
- # @return [CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdate] The final provider who referred the services that were rendered.
189
- # All physicians who order services or refer Medicare beneficiaries must
190
- # report this data.
191
- attr_reader :referring_provider
192
- # @return [CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdate] The second iteration of Loop ID-2310. Use code "P3 - Primary Care Provider" in
193
- # this loop to
194
- # indicate the initial referral from the primary care provider or whatever
195
- # provider wrote the initial referral for this patient's episode of care being
196
- # billed/reported in this transaction.
197
- attr_reader :initial_referring_provider
198
146
  # @return [String] Refers to REF\*9F on the 837p. Value cannot be greater than 50 characters.
199
147
  attr_reader :referral_number
200
148
  # @return [CandidApiClient::Encounters::V4::Types::EpsdtReferral] Refers Box 24H on the CMS1500 form and Loop 2300 CRC - EPSDT Referral on the
@@ -203,6 +151,9 @@ module CandidApiClient
203
151
  # @return [Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>] Refers to Loop 2300 - Segment PWK on the 837P form. No more than 10 entries are
204
152
  # permitted.
205
153
  attr_reader :claim_supplemental_information
154
+ # @return [String] When Medicaid is billed as the secondary payer the Carrier Code is used to
155
+ # identify the primary payer. This is required for certain states.
156
+ attr_reader :secondary_payer_carrier_code
206
157
  # @return [OpenStruct] Additional properties unmapped to the current class definition
207
158
  attr_reader :additional_properties
208
159
  # @return [Object]
@@ -230,7 +181,6 @@ module CandidApiClient
230
181
  # be overridden with this list.
231
182
  # @param clinical_notes [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>] Holds a collection of clinical observations made by healthcare providers during
232
183
  # patient encounters.
233
- # @param pay_to_address [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
234
184
  # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
235
185
  # Examples for when this should be set to NOT_BILLABLE include if the Encounter
236
186
  # has not occurred yet or if there is no intention of ever billing the
@@ -287,8 +237,6 @@ module CandidApiClient
287
237
  # related to the patient's pregnancy.de
288
238
  # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
289
239
  # Code indicating the reason why a request was delayed
290
- # @param patient [CandidApiClient::Individual::Types::PatientUpdate] Contains the identification information of the individual receiving medical
291
- # services.
292
240
  # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
293
241
  # for billing purpose.
294
242
  # Box 12 on the CMS-1500 claim form.
@@ -305,56 +253,24 @@ module CandidApiClient
305
253
  # @param existing_medications [Array<CandidApiClient::Encounters::V4::Types::Medication>] Existing medications that should be on the encounter.
306
254
  # Note all current existing medications on encounter will be overridden with this
307
255
  # list.
308
- # @param rendering_provider [CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate] The rendering provider is the practitioner -- physician, nurse practitioner,
309
- # etc. -- performing the service.
310
- # For telehealth services, the rendering provider performs the visit, asynchronous
311
- # communication, or other service. The rendering provider address should generally
312
- # be the same as the service facility address.
313
- # @param service_facility [CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityUpdate] Encounter Service facility is typically the location a medical service was
314
- # rendered, such as a provider office or hospital. For telehealth, service
315
- # facility can represent the provider's location when the service was delivered
316
- # (e.g., home), or the location where an in-person visit would have taken place,
317
- # whichever is easier to identify. If the provider is in-network, service facility
318
- # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
319
- # for an in-network claim to be successfully adjudicated, the service facility
320
- # address listed on claims must match what was provided to the payer during the
321
- # credentialing process.
322
256
  # @param guarantor [CandidApiClient::Guarantor::V1::Types::GuarantorUpdate] Personal and contact info for the guarantor of the patient responsibility.
323
- # @param billing_provider [CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdate] The billing provider is the provider or business entity submitting the claim.
324
- # Billing provider may be, but is not necessarily, the same person/NPI as the
325
- # rendering provider. From a payer's perspective, this represents the person or
326
- # entity being reimbursed. When a contract exists with the target payer, the
327
- # billing provider should be the entity contracted with the payer. In some
328
- # circumstances, this will be an individual provider. In that case, submit that
329
- # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
330
- # contracting. In other cases, the billing entity will be a medical group. If so,
331
- # submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.
332
- # @param supervising_provider [CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdate] Required when the rendering provider is supervised by a physician. If not
333
- # required by this implementation guide, do not send.
334
- # @param referring_provider [CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdate] The final provider who referred the services that were rendered.
335
- # All physicians who order services or refer Medicare beneficiaries must
336
- # report this data.
337
- # @param initial_referring_provider [CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdate] The second iteration of Loop ID-2310. Use code "P3 - Primary Care Provider" in
338
- # this loop to
339
- # indicate the initial referral from the primary care provider or whatever
340
- # provider wrote the initial referral for this patient's episode of care being
341
- # billed/reported in this transaction.
342
257
  # @param referral_number [String] Refers to REF\*9F on the 837p. Value cannot be greater than 50 characters.
343
258
  # @param epsdt_referral [CandidApiClient::Encounters::V4::Types::EpsdtReferral] Refers Box 24H on the CMS1500 form and Loop 2300 CRC - EPSDT Referral on the
344
259
  # 837P form
345
260
  # @param claim_supplemental_information [Array<CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation>] Refers to Loop 2300 - Segment PWK on the 837P form. No more than 10 entries are
346
261
  # permitted.
262
+ # @param secondary_payer_carrier_code [String] When Medicaid is billed as the secondary payer the Carrier Code is used to
263
+ # identify the primary payer. This is required for certain states.
347
264
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
348
265
  # @return [CandidApiClient::Encounters::V4::Types::EncounterOptional]
349
266
  def initialize(benefits_assigned_to_provider: OMIT, prior_authorization_number: OMIT, external_id: OMIT,
350
- date_of_service: OMIT, tag_ids: OMIT, clinical_notes: OMIT, pay_to_address: 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, subscriber_primary: OMIT, subscriber_secondary: OMIT, subscriber_tertiary: 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: OMIT, patient_authorized_release: OMIT, schema_instances: OMIT, vitals: OMIT, existing_medications: OMIT, rendering_provider: OMIT, service_facility: OMIT, guarantor: OMIT, billing_provider: OMIT, supervising_provider: OMIT, referring_provider: OMIT, initial_referring_provider: OMIT, referral_number: OMIT, epsdt_referral: OMIT, claim_supplemental_information: OMIT, additional_properties: nil)
267
+ date_of_service: OMIT, tag_ids: OMIT, clinical_notes: 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, subscriber_primary: OMIT, subscriber_secondary: OMIT, subscriber_tertiary: 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, schema_instances: OMIT, vitals: OMIT, existing_medications: OMIT, guarantor: OMIT, referral_number: OMIT, epsdt_referral: OMIT, claim_supplemental_information: OMIT, secondary_payer_carrier_code: OMIT, additional_properties: nil)
351
268
  @benefits_assigned_to_provider = benefits_assigned_to_provider if benefits_assigned_to_provider != OMIT
352
269
  @prior_authorization_number = prior_authorization_number if prior_authorization_number != OMIT
353
270
  @external_id = external_id if external_id != OMIT
354
271
  @date_of_service = date_of_service if date_of_service != OMIT
355
272
  @tag_ids = tag_ids if tag_ids != OMIT
356
273
  @clinical_notes = clinical_notes if clinical_notes != OMIT
357
- @pay_to_address = pay_to_address if pay_to_address != OMIT
358
274
  @billable_status = billable_status if billable_status != OMIT
359
275
  @responsible_party = responsible_party if responsible_party != OMIT
360
276
  @provider_accepts_assignment = provider_accepts_assignment if provider_accepts_assignment != OMIT
@@ -376,21 +292,15 @@ module CandidApiClient
376
292
  end
377
293
  @last_menstrual_period_date = last_menstrual_period_date if last_menstrual_period_date != OMIT
378
294
  @delay_reason_code = delay_reason_code if delay_reason_code != OMIT
379
- @patient = patient if patient != OMIT
380
295
  @patient_authorized_release = patient_authorized_release if patient_authorized_release != OMIT
381
296
  @schema_instances = schema_instances if schema_instances != OMIT
382
297
  @vitals = vitals if vitals != OMIT
383
298
  @existing_medications = existing_medications if existing_medications != OMIT
384
- @rendering_provider = rendering_provider if rendering_provider != OMIT
385
- @service_facility = service_facility if service_facility != OMIT
386
299
  @guarantor = guarantor if guarantor != OMIT
387
- @billing_provider = billing_provider if billing_provider != OMIT
388
- @supervising_provider = supervising_provider if supervising_provider != OMIT
389
- @referring_provider = referring_provider if referring_provider != OMIT
390
- @initial_referring_provider = initial_referring_provider if initial_referring_provider != OMIT
391
300
  @referral_number = referral_number if referral_number != OMIT
392
301
  @epsdt_referral = epsdt_referral if epsdt_referral != OMIT
393
302
  @claim_supplemental_information = claim_supplemental_information if claim_supplemental_information != OMIT
303
+ @secondary_payer_carrier_code = secondary_payer_carrier_code if secondary_payer_carrier_code != OMIT
394
304
  @additional_properties = additional_properties
395
305
  @_field_set = {
396
306
  "benefits_assigned_to_provider": benefits_assigned_to_provider,
@@ -399,7 +309,6 @@ module CandidApiClient
399
309
  "date_of_service": date_of_service,
400
310
  "tag_ids": tag_ids,
401
311
  "clinical_notes": clinical_notes,
402
- "pay_to_address": pay_to_address,
403
312
  "billable_status": billable_status,
404
313
  "responsible_party": responsible_party,
405
314
  "provider_accepts_assignment": provider_accepts_assignment,
@@ -417,21 +326,15 @@ module CandidApiClient
417
326
  "onset_of_current_illness_or_symptom_date": onset_of_current_illness_or_symptom_date,
418
327
  "last_menstrual_period_date": last_menstrual_period_date,
419
328
  "delay_reason_code": delay_reason_code,
420
- "patient": patient,
421
329
  "patient_authorized_release": patient_authorized_release,
422
330
  "schema_instances": schema_instances,
423
331
  "vitals": vitals,
424
332
  "existing_medications": existing_medications,
425
- "rendering_provider": rendering_provider,
426
- "service_facility": service_facility,
427
333
  "guarantor": guarantor,
428
- "billing_provider": billing_provider,
429
- "supervising_provider": supervising_provider,
430
- "referring_provider": referring_provider,
431
- "initial_referring_provider": initial_referring_provider,
432
334
  "referral_number": referral_number,
433
335
  "epsdt_referral": epsdt_referral,
434
- "claim_supplemental_information": claim_supplemental_information
336
+ "claim_supplemental_information": claim_supplemental_information,
337
+ "secondary_payer_carrier_code": secondary_payer_carrier_code
435
338
  }.reject do |_k, v|
436
339
  v == OMIT
437
340
  end
@@ -453,12 +356,6 @@ module CandidApiClient
453
356
  item = item.to_json
454
357
  CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate.from_json(json_object: item)
455
358
  end
456
- if parsed_json["pay_to_address"].nil?
457
- pay_to_address = nil
458
- else
459
- pay_to_address = parsed_json["pay_to_address"].to_json
460
- pay_to_address = CandidApiClient::Commons::Types::StreetAddressLongZip.from_json(json_object: pay_to_address)
461
- end
462
359
  billable_status = struct["billable_status"]
463
360
  responsible_party = struct["responsible_party"]
464
361
  provider_accepts_assignment = struct["provider_accepts_assignment"]
@@ -497,12 +394,6 @@ module CandidApiClient
497
394
  Date.parse(parsed_json["last_menstrual_period_date"])
498
395
  end
499
396
  delay_reason_code = struct["delay_reason_code"]
500
- if parsed_json["patient"].nil?
501
- patient = nil
502
- else
503
- patient = parsed_json["patient"].to_json
504
- patient = CandidApiClient::Individual::Types::PatientUpdate.from_json(json_object: patient)
505
- end
506
397
  patient_authorized_release = struct["patient_authorized_release"]
507
398
  schema_instances = parsed_json["schema_instances"]&.map do |item|
508
399
  item = item.to_json
@@ -518,48 +409,12 @@ module CandidApiClient
518
409
  item = item.to_json
519
410
  CandidApiClient::Encounters::V4::Types::Medication.from_json(json_object: item)
520
411
  end
521
- if parsed_json["rendering_provider"].nil?
522
- rendering_provider = nil
523
- else
524
- rendering_provider = parsed_json["rendering_provider"].to_json
525
- rendering_provider = CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate.from_json(json_object: rendering_provider)
526
- end
527
- if parsed_json["service_facility"].nil?
528
- service_facility = nil
529
- else
530
- service_facility = parsed_json["service_facility"].to_json
531
- service_facility = CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityUpdate.from_json(json_object: service_facility)
532
- end
533
412
  if parsed_json["guarantor"].nil?
534
413
  guarantor = nil
535
414
  else
536
415
  guarantor = parsed_json["guarantor"].to_json
537
416
  guarantor = CandidApiClient::Guarantor::V1::Types::GuarantorUpdate.from_json(json_object: guarantor)
538
417
  end
539
- if parsed_json["billing_provider"].nil?
540
- billing_provider = nil
541
- else
542
- billing_provider = parsed_json["billing_provider"].to_json
543
- billing_provider = CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdate.from_json(json_object: billing_provider)
544
- end
545
- if parsed_json["supervising_provider"].nil?
546
- supervising_provider = nil
547
- else
548
- supervising_provider = parsed_json["supervising_provider"].to_json
549
- supervising_provider = CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdate.from_json(json_object: supervising_provider)
550
- end
551
- if parsed_json["referring_provider"].nil?
552
- referring_provider = nil
553
- else
554
- referring_provider = parsed_json["referring_provider"].to_json
555
- referring_provider = CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdate.from_json(json_object: referring_provider)
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
418
  referral_number = struct["referral_number"]
564
419
  if parsed_json["epsdt_referral"].nil?
565
420
  epsdt_referral = nil
@@ -571,6 +426,7 @@ module CandidApiClient
571
426
  item = item.to_json
572
427
  CandidApiClient::Encounters::V4::Types::ClaimSupplementalInformation.from_json(json_object: item)
573
428
  end
429
+ secondary_payer_carrier_code = struct["secondary_payer_carrier_code"]
574
430
  new(
575
431
  benefits_assigned_to_provider: benefits_assigned_to_provider,
576
432
  prior_authorization_number: prior_authorization_number,
@@ -578,7 +434,6 @@ module CandidApiClient
578
434
  date_of_service: date_of_service,
579
435
  tag_ids: tag_ids,
580
436
  clinical_notes: clinical_notes,
581
- pay_to_address: pay_to_address,
582
437
  billable_status: billable_status,
583
438
  responsible_party: responsible_party,
584
439
  provider_accepts_assignment: provider_accepts_assignment,
@@ -596,21 +451,15 @@ module CandidApiClient
596
451
  onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
597
452
  last_menstrual_period_date: last_menstrual_period_date,
598
453
  delay_reason_code: delay_reason_code,
599
- patient: patient,
600
454
  patient_authorized_release: patient_authorized_release,
601
455
  schema_instances: schema_instances,
602
456
  vitals: vitals,
603
457
  existing_medications: existing_medications,
604
- rendering_provider: rendering_provider,
605
- service_facility: service_facility,
606
458
  guarantor: guarantor,
607
- billing_provider: billing_provider,
608
- supervising_provider: supervising_provider,
609
- referring_provider: referring_provider,
610
- initial_referring_provider: initial_referring_provider,
611
459
  referral_number: referral_number,
612
460
  epsdt_referral: epsdt_referral,
613
461
  claim_supplemental_information: claim_supplemental_information,
462
+ secondary_payer_carrier_code: secondary_payer_carrier_code,
614
463
  additional_properties: struct
615
464
  )
616
465
  end
@@ -635,7 +484,6 @@ module CandidApiClient
635
484
  obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
636
485
  obj.tag_ids&.is_a?(Array) != false || raise("Passed value for field obj.tag_ids is not the expected type, validation failed.")
637
486
  obj.clinical_notes&.is_a?(Array) != false || raise("Passed value for field obj.clinical_notes is not the expected type, validation failed.")
638
- obj.pay_to_address.nil? || CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.pay_to_address)
639
487
  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.")
640
488
  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.")
641
489
  obj.provider_accepts_assignment&.is_a?(Boolean) != false || raise("Passed value for field obj.provider_accepts_assignment is not the expected type, validation failed.")
@@ -653,21 +501,15 @@ module CandidApiClient
653
501
  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.")
654
502
  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.")
655
503
  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.")
656
- obj.patient.nil? || CandidApiClient::Individual::Types::PatientUpdate.validate_raw(obj: obj.patient)
657
504
  obj.patient_authorized_release&.is_a?(Boolean) != false || raise("Passed value for field obj.patient_authorized_release is not the expected type, validation failed.")
658
505
  obj.schema_instances&.is_a?(Array) != false || raise("Passed value for field obj.schema_instances is not the expected type, validation failed.")
659
506
  obj.vitals.nil? || CandidApiClient::Encounters::V4::Types::VitalsUpdate.validate_raw(obj: obj.vitals)
660
507
  obj.existing_medications&.is_a?(Array) != false || raise("Passed value for field obj.existing_medications is not the expected type, validation failed.")
661
- obj.rendering_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::RenderingProviderUpdate.validate_raw(obj: obj.rendering_provider)
662
- obj.service_facility.nil? || CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityUpdate.validate_raw(obj: obj.service_facility)
663
508
  obj.guarantor.nil? || CandidApiClient::Guarantor::V1::Types::GuarantorUpdate.validate_raw(obj: obj.guarantor)
664
- obj.billing_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::BillingProviderUpdate.validate_raw(obj: obj.billing_provider)
665
- obj.supervising_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::SupervisingProviderUpdate.validate_raw(obj: obj.supervising_provider)
666
- obj.referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::ReferringProviderUpdate.validate_raw(obj: obj.referring_provider)
667
- obj.initial_referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::InitialReferringProviderUpdate.validate_raw(obj: obj.initial_referring_provider)
668
509
  obj.referral_number&.is_a?(String) != false || raise("Passed value for field obj.referral_number is not the expected type, validation failed.")
669
510
  obj.epsdt_referral.nil? || CandidApiClient::Encounters::V4::Types::EpsdtReferral.validate_raw(obj: obj.epsdt_referral)
670
511
  obj.claim_supplemental_information&.is_a?(Array) != false || raise("Passed value for field obj.claim_supplemental_information is not the expected type, validation failed.")
512
+ 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.")
671
513
  end
672
514
  end
673
515
  end
@@ -0,0 +1,179 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "gender"
4
+ require "date"
5
+ require_relative "../../commons/types/street_address_short_zip_optional"
6
+ require_relative "../../commons/types/phone_number"
7
+ require_relative "patient_non_insurance_payer_info_create"
8
+ require "ostruct"
9
+ require "json"
10
+
11
+ module CandidApiClient
12
+ module Individual
13
+ module Types
14
+ class PatientUpdateWithOptionalAddress
15
+ # @return [String]
16
+ attr_reader :first_name
17
+ # @return [String]
18
+ attr_reader :last_name
19
+ # @return [CandidApiClient::Individual::Types::Gender]
20
+ attr_reader :gender
21
+ # @return [String] The ID used to identify this individual in your system. For example, your
22
+ # internal patient ID or an EHR patient ID.
23
+ attr_reader :external_id
24
+ # @return [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
25
+ # formatted YYYY-MM-DD (i.e. 2012-02-01)
26
+ attr_reader :date_of_birth
27
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional] Box 5 on the CMS-1500 claim form.
28
+ attr_reader :address
29
+ # @return [Array<CandidApiClient::Commons::Types::PhoneNumber>]
30
+ attr_reader :phone_numbers
31
+ # @return [Boolean]
32
+ attr_reader :phone_consent
33
+ # @return [String]
34
+ attr_reader :email
35
+ # @return [Boolean]
36
+ attr_reader :email_consent
37
+ # @return [Array<String>] On update, we will replace the existing list of non-insurance payers with the
38
+ # new list if populated.
39
+ attr_reader :non_insurance_payers
40
+ # @return [Array<CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreate>] On update, we will replace the existing list of non-insurance payers with the
41
+ # new list if populated.
42
+ attr_reader :non_insurance_payers_info
43
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
44
+ attr_reader :additional_properties
45
+ # @return [Object]
46
+ attr_reader :_field_set
47
+ protected :_field_set
48
+
49
+ OMIT = Object.new
50
+
51
+ # @param first_name [String]
52
+ # @param last_name [String]
53
+ # @param gender [CandidApiClient::Individual::Types::Gender]
54
+ # @param external_id [String] The ID used to identify this individual in your system. For example, your
55
+ # internal patient ID or an EHR patient ID.
56
+ # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
57
+ # formatted YYYY-MM-DD (i.e. 2012-02-01)
58
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional] Box 5 on the CMS-1500 claim form.
59
+ # @param phone_numbers [Array<CandidApiClient::Commons::Types::PhoneNumber>]
60
+ # @param phone_consent [Boolean]
61
+ # @param email [String]
62
+ # @param email_consent [Boolean]
63
+ # @param non_insurance_payers [Array<String>] On update, we will replace the existing list of non-insurance payers with the
64
+ # new list if populated.
65
+ # @param non_insurance_payers_info [Array<CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreate>] On update, we will replace the existing list of non-insurance payers with the
66
+ # new list if populated.
67
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
68
+ # @return [CandidApiClient::Individual::Types::PatientUpdateWithOptionalAddress]
69
+ def initialize(first_name: OMIT, last_name: OMIT, gender: OMIT, external_id: OMIT, date_of_birth: OMIT,
70
+ address: OMIT, phone_numbers: OMIT, phone_consent: OMIT, email: OMIT, email_consent: OMIT, non_insurance_payers: OMIT, non_insurance_payers_info: OMIT, additional_properties: nil)
71
+ @first_name = first_name if first_name != OMIT
72
+ @last_name = last_name if last_name != OMIT
73
+ @gender = gender if gender != OMIT
74
+ @external_id = external_id if external_id != OMIT
75
+ @date_of_birth = date_of_birth if date_of_birth != OMIT
76
+ @address = address if address != OMIT
77
+ @phone_numbers = phone_numbers if phone_numbers != OMIT
78
+ @phone_consent = phone_consent if phone_consent != OMIT
79
+ @email = email if email != OMIT
80
+ @email_consent = email_consent if email_consent != OMIT
81
+ @non_insurance_payers = non_insurance_payers if non_insurance_payers != OMIT
82
+ @non_insurance_payers_info = non_insurance_payers_info if non_insurance_payers_info != OMIT
83
+ @additional_properties = additional_properties
84
+ @_field_set = {
85
+ "first_name": first_name,
86
+ "last_name": last_name,
87
+ "gender": gender,
88
+ "external_id": external_id,
89
+ "date_of_birth": date_of_birth,
90
+ "address": address,
91
+ "phone_numbers": phone_numbers,
92
+ "phone_consent": phone_consent,
93
+ "email": email,
94
+ "email_consent": email_consent,
95
+ "non_insurance_payers": non_insurance_payers,
96
+ "non_insurance_payers_info": non_insurance_payers_info
97
+ }.reject do |_k, v|
98
+ v == OMIT
99
+ end
100
+ end
101
+
102
+ # Deserialize a JSON object to an instance of PatientUpdateWithOptionalAddress
103
+ #
104
+ # @param json_object [String]
105
+ # @return [CandidApiClient::Individual::Types::PatientUpdateWithOptionalAddress]
106
+ def self.from_json(json_object:)
107
+ struct = JSON.parse(json_object, object_class: OpenStruct)
108
+ parsed_json = JSON.parse(json_object)
109
+ first_name = struct["first_name"]
110
+ last_name = struct["last_name"]
111
+ gender = struct["gender"]
112
+ external_id = struct["external_id"]
113
+ date_of_birth = (Date.parse(parsed_json["date_of_birth"]) unless parsed_json["date_of_birth"].nil?)
114
+ if parsed_json["address"].nil?
115
+ address = nil
116
+ else
117
+ address = parsed_json["address"].to_json
118
+ address = CandidApiClient::Commons::Types::StreetAddressShortZipOptional.from_json(json_object: address)
119
+ end
120
+ phone_numbers = parsed_json["phone_numbers"]&.map do |item|
121
+ item = item.to_json
122
+ CandidApiClient::Commons::Types::PhoneNumber.from_json(json_object: item)
123
+ end
124
+ phone_consent = struct["phone_consent"]
125
+ email = struct["email"]
126
+ email_consent = struct["email_consent"]
127
+ non_insurance_payers = struct["non_insurance_payers"]
128
+ non_insurance_payers_info = parsed_json["non_insurance_payers_info"]&.map do |item|
129
+ item = item.to_json
130
+ CandidApiClient::Individual::Types::PatientNonInsurancePayerInfoCreate.from_json(json_object: item)
131
+ end
132
+ new(
133
+ first_name: first_name,
134
+ last_name: last_name,
135
+ gender: gender,
136
+ external_id: external_id,
137
+ date_of_birth: date_of_birth,
138
+ address: address,
139
+ phone_numbers: phone_numbers,
140
+ phone_consent: phone_consent,
141
+ email: email,
142
+ email_consent: email_consent,
143
+ non_insurance_payers: non_insurance_payers,
144
+ non_insurance_payers_info: non_insurance_payers_info,
145
+ additional_properties: struct
146
+ )
147
+ end
148
+
149
+ # Serialize an instance of PatientUpdateWithOptionalAddress to a JSON object
150
+ #
151
+ # @return [String]
152
+ def to_json(*_args)
153
+ @_field_set&.to_json
154
+ end
155
+
156
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
157
+ # hash and check each fields type against the current object's property
158
+ # definitions.
159
+ #
160
+ # @param obj [Object]
161
+ # @return [Void]
162
+ def self.validate_raw(obj:)
163
+ obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
164
+ obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
165
+ obj.gender&.is_a?(CandidApiClient::Individual::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
166
+ obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
167
+ obj.date_of_birth&.is_a?(Date) != false || raise("Passed value for field obj.date_of_birth is not the expected type, validation failed.")
168
+ obj.address.nil? || CandidApiClient::Commons::Types::StreetAddressShortZipOptional.validate_raw(obj: obj.address)
169
+ obj.phone_numbers&.is_a?(Array) != false || raise("Passed value for field obj.phone_numbers is not the expected type, validation failed.")
170
+ obj.phone_consent&.is_a?(Boolean) != false || raise("Passed value for field obj.phone_consent is not the expected type, validation failed.")
171
+ obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
172
+ obj.email_consent&.is_a?(Boolean) != false || raise("Passed value for field obj.email_consent is not the expected type, validation failed.")
173
+ obj.non_insurance_payers&.is_a?(Array) != false || raise("Passed value for field obj.non_insurance_payers is not the expected type, validation failed.")
174
+ obj.non_insurance_payers_info&.is_a?(Array) != false || raise("Passed value for field obj.non_insurance_payers_info is not the expected type, validation failed.")
175
+ end
176
+ end
177
+ end
178
+ end
179
+ end