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