candidhealth 0.20.1 → 0.24.0.pre.2a6d412

Sign up to get free protection for your applications and to get access to all the features.
Files changed (439) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/auth/client.rb +8 -6
  3. data/lib/candidhealth/auth/v_2/client.rb +86 -38
  4. data/lib/candidhealth/auth/v_2/types/auth_get_token_response.rb +61 -43
  5. data/lib/candidhealth/auth/v_2/types/too_many_requests_error_type.rb +44 -33
  6. data/lib/candidhealth/billing_notes/client.rb +8 -6
  7. data/lib/candidhealth/billing_notes/v_2/client.rb +43 -21
  8. data/lib/candidhealth/billing_notes/v_2/types/billing_note.rb +95 -72
  9. data/lib/candidhealth/billing_notes/v_2/types/billing_note_base.rb +44 -33
  10. data/lib/candidhealth/claim_submission/v_1/types/claim_frequency_type_code.rb +6 -4
  11. data/lib/candidhealth/claim_submission/v_1/types/claim_submission_record_create.rb +80 -59
  12. data/lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb +78 -56
  13. data/lib/candidhealth/claims/types/claim.rb +114 -86
  14. data/lib/candidhealth/claims/types/claim_status.rb +19 -17
  15. data/lib/candidhealth/commons/types/claim_adjustment_group_codes.rb +14 -12
  16. data/lib/candidhealth/commons/types/claim_submission_payer_responsibility_type.rb +6 -4
  17. data/lib/candidhealth/commons/types/date_range_optional_end.rb +57 -40
  18. data/lib/candidhealth/commons/types/delay_reason_code.rb +19 -17
  19. data/lib/candidhealth/commons/types/emr_payer_crosswalk.rb +6 -4
  20. data/lib/candidhealth/commons/types/entity_conflict_error_message.rb +45 -34
  21. data/lib/candidhealth/commons/types/entity_not_found_error_message.rb +45 -34
  22. data/lib/candidhealth/commons/types/facility_type_code.rb +58 -55
  23. data/lib/candidhealth/commons/types/http_service_unavailable_error_message.rb +47 -34
  24. data/lib/candidhealth/commons/types/insurance_type_code.rb +76 -73
  25. data/lib/candidhealth/commons/types/intended_submission_medium.rb +9 -5
  26. data/lib/candidhealth/commons/types/network_type.rb +23 -21
  27. data/lib/candidhealth/commons/types/organization_not_authorized_error_message.rb +46 -34
  28. data/lib/candidhealth/commons/types/patient_relationship_to_insured_code_all.rb +28 -26
  29. data/lib/candidhealth/commons/types/phone_number.rb +55 -39
  30. data/lib/candidhealth/commons/types/phone_number_type.rb +7 -5
  31. data/lib/candidhealth/commons/types/procedure_modifier.rb +391 -389
  32. data/lib/candidhealth/commons/types/qualifier_code.rb +14 -0
  33. data/lib/candidhealth/commons/types/region_national.rb +39 -29
  34. data/lib/candidhealth/commons/types/region_states.rb +45 -34
  35. data/lib/candidhealth/commons/types/regions.rb +78 -72
  36. data/lib/candidhealth/commons/types/removable_date_range_optional_end.rb +77 -71
  37. data/lib/candidhealth/commons/types/request_validation_error.rb +57 -39
  38. data/lib/candidhealth/commons/types/resource_page.rb +57 -40
  39. data/lib/candidhealth/commons/types/service_line_units.rb +6 -4
  40. data/lib/candidhealth/commons/types/sort_direction.rb +6 -4
  41. data/lib/candidhealth/commons/types/source_of_payment_code.rb +28 -26
  42. data/lib/candidhealth/commons/types/state.rb +66 -64
  43. data/lib/candidhealth/commons/types/street_address_base.rb +84 -61
  44. data/lib/candidhealth/commons/types/street_address_long_zip.rb +93 -68
  45. data/lib/candidhealth/commons/types/street_address_short_zip.rb +93 -68
  46. data/lib/candidhealth/commons/types/unauthorized_error_message.rb +47 -34
  47. data/lib/candidhealth/commons/types/unprocessable_entity_error_message.rb +47 -34
  48. data/lib/candidhealth/commons/types/updates_disabled_due_to_external_system_integration_error_message.rb +49 -34
  49. data/lib/candidhealth/contracts/client.rb +8 -6
  50. data/lib/candidhealth/contracts/v_2/client.rb +251 -127
  51. data/lib/candidhealth/contracts/v_2/types/authorized_signatory.rb +92 -67
  52. data/lib/candidhealth/contracts/v_2/types/authorized_signatory_update.rb +76 -70
  53. data/lib/candidhealth/contracts/v_2/types/contract.rb +178 -141
  54. data/lib/candidhealth/contracts/v_2/types/contract_base.rb +134 -106
  55. data/lib/candidhealth/contracts/v_2/types/contract_is_linked_to_fee_schedule_error.rb +44 -33
  56. data/lib/candidhealth/contracts/v_2/types/contract_status.rb +6 -4
  57. data/lib/candidhealth/contracts/v_2/types/contract_with_providers.rb +191 -152
  58. data/lib/candidhealth/contracts/v_2/types/contracts_page.rb +70 -47
  59. data/lib/candidhealth/contracts/v_2/types/date_update.rb +76 -71
  60. data/lib/candidhealth/contracts/v_2/types/insurance_types.rb +86 -80
  61. data/lib/candidhealth/contracts/v_2/types/regions_update.rb +76 -70
  62. data/lib/candidhealth/diagnoses/types/diagnosis.rb +126 -91
  63. data/lib/candidhealth/diagnoses/types/diagnosis_create.rb +88 -58
  64. data/lib/candidhealth/diagnoses/types/diagnosis_type_code.rb +14 -12
  65. data/lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb +100 -64
  66. data/lib/candidhealth/eligibility/client.rb +8 -6
  67. data/lib/candidhealth/eligibility/v_2/client.rb +210 -124
  68. data/lib/candidhealth/encounter_providers/v_2/types/billing_provider.rb +126 -86
  69. data/lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb +128 -85
  70. data/lib/candidhealth/encounter_providers/v_2/types/encounter_provider_base.rb +73 -44
  71. data/lib/candidhealth/encounter_providers/v_2/types/initial_referring_provider.rb +132 -0
  72. data/lib/candidhealth/encounter_providers/v_2/types/ordering_provider.rb +123 -0
  73. data/lib/candidhealth/encounter_providers/v_2/types/referring_provider.rb +105 -73
  74. data/lib/candidhealth/encounter_providers/v_2/types/rendering_provider.rb +105 -73
  75. data/lib/candidhealth/encounter_providers/v_2/types/supervising_provider.rb +123 -0
  76. data/lib/candidhealth/encounters/client.rb +8 -6
  77. data/lib/candidhealth/encounters/v_4/client.rb +1056 -476
  78. data/lib/candidhealth/encounters/v_4/types/billable_status_type.rb +5 -3
  79. data/lib/candidhealth/encounters/v_4/types/cash_pay_payer_error_message.rb +44 -33
  80. data/lib/candidhealth/encounters/v_4/types/clinical_note.rb +76 -50
  81. data/lib/candidhealth/encounters/v_4/types/clinical_note_category.rb +70 -45
  82. data/lib/candidhealth/encounters/v_4/types/clinical_note_category_create.rb +57 -40
  83. data/lib/candidhealth/encounters/v_4/types/coding_attribution_type.rb +7 -5
  84. data/lib/candidhealth/encounters/v_4/types/encounter.rb +732 -482
  85. data/lib/candidhealth/encounters/v_4/types/encounter_base.rb +304 -223
  86. data/lib/candidhealth/encounters/v_4/types/encounter_external_id_uniqueness_error_type.rb +47 -34
  87. data/lib/candidhealth/encounters/v_4/types/encounter_guarantor_missing_contact_info_error_type.rb +46 -33
  88. data/lib/candidhealth/encounters/v_4/types/encounter_owner_of_next_action_type.rb +7 -5
  89. data/lib/candidhealth/encounters/v_4/types/encounter_page.rb +70 -47
  90. data/lib/candidhealth/encounters/v_4/types/encounter_patient_control_number_uniqueness_error_type.rb +46 -33
  91. data/lib/candidhealth/encounters/v_4/types/encounter_sort_options.rb +7 -5
  92. data/lib/candidhealth/encounters/v_4/types/encounter_submission_origin_type.rb +5 -3
  93. data/lib/candidhealth/encounters/v_4/types/intake_follow_up.rb +63 -44
  94. data/lib/candidhealth/encounters/v_4/types/intake_question.rb +66 -46
  95. data/lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb +59 -40
  96. data/lib/candidhealth/encounters/v_4/types/intervention.rb +92 -66
  97. data/lib/candidhealth/encounters/v_4/types/intervention_category.rb +7 -5
  98. data/lib/candidhealth/encounters/v_4/types/lab.rb +63 -43
  99. data/lib/candidhealth/encounters/v_4/types/lab_code_type.rb +5 -3
  100. data/lib/candidhealth/encounters/v_4/types/medication.rb +92 -68
  101. data/lib/candidhealth/encounters/v_4/types/note_category.rb +17 -15
  102. data/lib/candidhealth/encounters/v_4/types/patient_history_category.rb +57 -40
  103. data/lib/candidhealth/encounters/v_4/types/patient_history_category_enum.rb +7 -5
  104. data/lib/candidhealth/encounters/v_4/types/responsible_party_type.rb +6 -4
  105. data/lib/candidhealth/encounters/v_4/types/service_authorization_exception_code.rb +14 -10
  106. data/lib/candidhealth/encounters/v_4/types/synchronicity_type.rb +5 -3
  107. data/lib/candidhealth/encounters/v_4/types/vitals.rb +84 -62
  108. data/lib/candidhealth/era/types/era.rb +62 -46
  109. data/lib/candidhealth/era/types/era_base.rb +55 -40
  110. data/lib/candidhealth/era/types/era_not_fully_processed_error_message.rb +55 -40
  111. data/lib/candidhealth/era_commons/types/claim_status_code_create.rb +14 -12
  112. data/lib/candidhealth/expected_network_status/client.rb +16 -10
  113. data/lib/candidhealth/expected_network_status/v_1/client.rb +76 -29
  114. data/lib/candidhealth/expected_network_status/v_1/types/expected_network_status.rb +6 -4
  115. data/lib/candidhealth/expected_network_status/v_1/types/expected_network_status_response.rb +69 -49
  116. data/lib/candidhealth/expected_network_status/v_2/client.rb +108 -69
  117. data/lib/candidhealth/expected_network_status/v_2/types/compute_all_in_network_providers_request.rb +129 -96
  118. data/lib/candidhealth/expected_network_status/v_2/types/compute_all_in_network_providers_response.rb +62 -47
  119. data/lib/candidhealth/expected_network_status/v_2/types/compute_all_in_network_rendering_providers_result.rb +89 -82
  120. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_check_error_message.rb +45 -33
  121. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_request_v_2.rb +129 -96
  122. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_response_v_2.rb +59 -44
  123. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_subscriber_information.rb +68 -49
  124. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_v_2.rb +88 -82
  125. data/lib/candidhealth/expected_network_status/v_2/types/explanation.rb +11 -9
  126. data/lib/candidhealth/expected_network_status/v_2/types/in_network_rendering_providers_detail.rb +66 -51
  127. data/lib/candidhealth/expected_network_status/v_2/types/in_network_status.rb +57 -41
  128. data/lib/candidhealth/expected_network_status/v_2/types/indeterminate_network_status.rb +76 -57
  129. data/lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb +59 -43
  130. data/lib/candidhealth/expected_network_status/v_2/types/insurance_type_codes.rb +86 -80
  131. data/lib/candidhealth/expected_network_status/v_2/types/line_of_business.rb +6 -4
  132. data/lib/candidhealth/expected_network_status/v_2/types/out_of_network_status.rb +65 -50
  133. data/lib/candidhealth/expected_network_status/v_2/types/service_type.rb +44 -42
  134. data/lib/candidhealth/exports/client.rb +8 -6
  135. data/lib/candidhealth/exports/v_3/client.rb +88 -48
  136. data/lib/candidhealth/exports/v_3/types/get_exports_response.rb +79 -58
  137. data/lib/candidhealth/external_payment_account_config/client.rb +30 -0
  138. data/lib/candidhealth/external_payment_account_config/v_1/client.rb +89 -0
  139. data/lib/candidhealth/external_payment_account_config/v_1/types/external_payment_account_config.rb +70 -0
  140. data/lib/candidhealth/external_payment_account_config/v_1/types/external_payment_account_config_page.rb +88 -0
  141. data/lib/candidhealth/fee_schedules/client.rb +8 -6
  142. data/lib/candidhealth/fee_schedules/v_3/client.rb +429 -181
  143. data/lib/candidhealth/fee_schedules/v_3/types/dimension_match.rb +159 -130
  144. data/lib/candidhealth/fee_schedules/v_3/types/dimension_name.rb +7 -5
  145. data/lib/candidhealth/fee_schedules/v_3/types/dimensions.rb +146 -117
  146. data/lib/candidhealth/fee_schedules/v_3/types/dimensions_page.rb +70 -51
  147. data/lib/candidhealth/fee_schedules/v_3/types/match_cpt_code.rb +62 -44
  148. data/lib/candidhealth/fee_schedules/v_3/types/match_date.rb +65 -44
  149. data/lib/candidhealth/fee_schedules/v_3/types/match_facility_type_code.rb +64 -44
  150. data/lib/candidhealth/fee_schedules/v_3/types/match_geo.rb +76 -49
  151. data/lib/candidhealth/fee_schedules/v_3/types/match_license_type.rb +64 -44
  152. data/lib/candidhealth/fee_schedules/v_3/types/match_modifiers.rb +67 -48
  153. data/lib/candidhealth/fee_schedules/v_3/types/match_network_types.rb +67 -48
  154. data/lib/candidhealth/fee_schedules/v_3/types/match_payer.rb +62 -45
  155. data/lib/candidhealth/fee_schedules/v_3/types/match_provider.rb +64 -45
  156. data/lib/candidhealth/fee_schedules/v_3/types/match_result.rb +59 -43
  157. data/lib/candidhealth/fee_schedules/v_3/types/match_test_result.rb +63 -46
  158. data/lib/candidhealth/fee_schedules/v_3/types/new_rate.rb +61 -44
  159. data/lib/candidhealth/fee_schedules/v_3/types/new_rate_version.rb +70 -46
  160. data/lib/candidhealth/fee_schedules/v_3/types/optional_dimensions.rb +148 -117
  161. data/lib/candidhealth/fee_schedules/v_3/types/overlapping_rate_entries_error.rb +71 -52
  162. data/lib/candidhealth/fee_schedules/v_3/types/payer_threshold.rb +77 -50
  163. data/lib/candidhealth/fee_schedules/v_3/types/payer_thresholds_page.rb +70 -51
  164. data/lib/candidhealth/fee_schedules/v_3/types/rate.rb +100 -75
  165. data/lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb +79 -55
  166. data/lib/candidhealth/fee_schedules/v_3/types/rate_upload.rb +77 -71
  167. data/lib/candidhealth/fee_schedules/v_3/types/rate_upload_with_possible_errors.rb +79 -55
  168. data/lib/candidhealth/fee_schedules/v_3/types/rates_page.rb +70 -47
  169. data/lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb +79 -54
  170. data/lib/candidhealth/fee_schedules/v_3/types/validation_error.rb +108 -102
  171. data/lib/candidhealth/financials/types/account_type.rb +6 -4
  172. data/lib/candidhealth/financials/types/allocation.rb +60 -43
  173. data/lib/candidhealth/financials/types/allocation_create.rb +63 -45
  174. data/lib/candidhealth/financials/types/allocation_target.rb +102 -95
  175. data/lib/candidhealth/financials/types/allocation_target_create.rb +113 -110
  176. data/lib/candidhealth/financials/types/billing_provider_allocation_target.rb +45 -35
  177. data/lib/candidhealth/financials/types/claim_allocation_target.rb +55 -41
  178. data/lib/candidhealth/financials/types/invoice_update.rb +77 -72
  179. data/lib/candidhealth/financials/types/note_update.rb +77 -71
  180. data/lib/candidhealth/financials/types/patient_transaction_source.rb +11 -9
  181. data/lib/candidhealth/financials/types/refund_reason.rb +5 -3
  182. data/lib/candidhealth/financials/types/refund_reason_update.rb +77 -71
  183. data/lib/candidhealth/financials/types/service_line_allocation_target.rb +62 -48
  184. data/lib/candidhealth/guarantor/client.rb +8 -6
  185. data/lib/candidhealth/guarantor/v_1/client.rb +136 -63
  186. data/lib/candidhealth/guarantor/v_1/types/encounter_has_existing_guarantor_error_type.rb +45 -33
  187. data/lib/candidhealth/guarantor/v_1/types/guarantor.rb +131 -100
  188. data/lib/candidhealth/guarantor/v_1/types/guarantor_base.rb +89 -65
  189. data/lib/candidhealth/guarantor/v_1/types/guarantor_create.rb +123 -93
  190. data/lib/candidhealth/identifiers/types/identifier.rb +85 -64
  191. data/lib/candidhealth/identifiers/types/identifier_base.rb +77 -53
  192. data/lib/candidhealth/identifiers/types/identifier_code.rb +6 -4
  193. data/lib/candidhealth/identifiers/types/identifier_create.rb +77 -53
  194. data/lib/candidhealth/identifiers/types/identifier_update.rb +86 -65
  195. data/lib/candidhealth/identifiers/types/identifier_value.rb +78 -72
  196. data/lib/candidhealth/identifiers/types/medicaid_provider_identifier.rb +55 -39
  197. data/lib/candidhealth/identifiers/types/medicare_provider_identifier.rb +55 -39
  198. data/lib/candidhealth/identifiers/types/updatable_identifier.rb +89 -84
  199. data/lib/candidhealth/import_invoice/client.rb +8 -6
  200. data/lib/candidhealth/import_invoice/v_1/client.rb +239 -59
  201. data/lib/candidhealth/import_invoice/v_1/types/create_import_invoice_request.rb +123 -83
  202. data/lib/candidhealth/import_invoice/v_1/types/import_invoice.rb +145 -110
  203. data/lib/candidhealth/import_invoice/v_1/types/import_invoice_update_request.rb +89 -65
  204. data/lib/candidhealth/import_invoice/v_1/types/import_invoices_page.rb +88 -0
  205. data/lib/candidhealth/import_invoice/v_1/types/invoice_item_info_update.rb +61 -42
  206. data/lib/candidhealth/import_invoice/v_1/types/invoice_item_update_type.rb +5 -3
  207. data/lib/candidhealth/individual/types/gender.rb +9 -7
  208. data/lib/candidhealth/individual/types/individual_base.rb +62 -44
  209. data/lib/candidhealth/individual/types/patient.rb +145 -108
  210. data/lib/candidhealth/individual/types/patient_base.rb +101 -73
  211. data/lib/candidhealth/individual/types/patient_create.rb +137 -101
  212. data/lib/candidhealth/individual/types/subscriber.rb +119 -91
  213. data/lib/candidhealth/individual/types/subscriber_base.rb +99 -74
  214. data/lib/candidhealth/individual/types/subscriber_create.rb +111 -84
  215. data/lib/candidhealth/insurance_adjudications/client.rb +8 -6
  216. data/lib/candidhealth/insurance_adjudications/v_1/client.rb +106 -47
  217. data/lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb +106 -81
  218. data/lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication_create.rb +98 -74
  219. data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb +104 -80
  220. data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb +113 -87
  221. data/lib/candidhealth/insurance_adjudications/v_1/types/service_line_adjudication.rb +121 -91
  222. data/lib/candidhealth/insurance_adjudications/v_1/types/service_line_adjudication_create.rb +113 -84
  223. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb +140 -105
  224. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb +76 -55
  225. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_create.rb +140 -104
  226. data/lib/candidhealth/insurance_payments/client.rb +8 -6
  227. data/lib/candidhealth/insurance_payments/v_1/client.rb +214 -102
  228. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payment.rb +101 -77
  229. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payment_create.rb +93 -70
  230. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payment_sort_field.rb +6 -4
  231. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payments_page.rb +70 -47
  232. data/lib/candidhealth/insurance_refunds/client.rb +8 -6
  233. data/lib/candidhealth/insurance_refunds/v_1/client.rb +218 -108
  234. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refund.rb +109 -83
  235. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refund_create.rb +101 -76
  236. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refund_sort_field.rb +7 -5
  237. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refunds_page.rb +70 -47
  238. data/lib/candidhealth/invoices/types/invoice.rb +152 -117
  239. data/lib/candidhealth/invoices/types/invoice_item.rb +55 -40
  240. data/lib/candidhealth/invoices/types/invoice_status.rb +10 -8
  241. data/lib/candidhealth/invoices/v_2/types/claim_invoice_item.rb +54 -39
  242. data/lib/candidhealth/invoices/v_2/types/claim_invoice_item_info.rb +66 -48
  243. data/lib/candidhealth/invoices/v_2/types/invoice.rb +151 -114
  244. data/lib/candidhealth/invoices/v_2/types/invoice_destination.rb +8 -5
  245. data/lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb +78 -55
  246. data/lib/candidhealth/invoices/v_2/types/invoice_info.rb +66 -48
  247. data/lib/candidhealth/invoices/v_2/types/invoice_item_attribution_create.rb +88 -84
  248. data/lib/candidhealth/invoices/v_2/types/invoice_item_create.rb +59 -42
  249. data/lib/candidhealth/invoices/v_2/types/invoice_item_info.rb +59 -43
  250. data/lib/candidhealth/invoices/v_2/types/invoice_sort_field.rb +18 -0
  251. data/lib/candidhealth/invoices/v_2/types/invoice_status.rb +9 -7
  252. data/lib/candidhealth/invoices/v_2/types/service_line_invoice_item.rb +54 -39
  253. data/lib/candidhealth/invoices/v_2/types/unattributed_invoice_item.rb +44 -33
  254. data/lib/candidhealth/organization_providers/client.rb +8 -6
  255. data/lib/candidhealth/organization_providers/v_2/types/address_type.rb +4 -2
  256. data/lib/candidhealth/organization_providers/v_2/types/employment_status.rb +5 -3
  257. data/lib/candidhealth/organization_providers/v_2/types/license_type.rb +71 -69
  258. data/lib/candidhealth/organization_providers/v_2/types/organization_provider.rb +189 -138
  259. data/lib/candidhealth/organization_providers/v_2/types/organization_provider_address.rb +59 -42
  260. data/lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb +157 -112
  261. data/lib/candidhealth/organization_providers/v_2/types/organization_provider_sort_options.rb +7 -5
  262. data/lib/candidhealth/organization_providers/v_2/types/provider_type.rb +5 -3
  263. data/lib/candidhealth/organization_providers/v_3/client.rb +166 -80
  264. data/lib/candidhealth/organization_providers/v_3/types/organization_provider_create_v_2.rb +171 -124
  265. data/lib/candidhealth/organization_providers/v_3/types/organization_provider_page_v_2.rb +70 -47
  266. data/lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb +169 -121
  267. data/lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb +179 -131
  268. data/lib/candidhealth/organization_service_facilities/client.rb +8 -6
  269. data/lib/candidhealth/organization_service_facilities/v_2/client.rb +186 -90
  270. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb +149 -111
  271. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_create.rb +141 -104
  272. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_page.rb +70 -47
  273. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_update.rb +141 -104
  274. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_mode.rb +5 -3
  275. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_operational_status.rb +9 -7
  276. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_physical_type.rb +17 -15
  277. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_status.rb +6 -4
  278. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_type.rb +126 -124
  279. data/lib/candidhealth/patient_payments/client.rb +8 -6
  280. data/lib/candidhealth/patient_payments/v_3/types/patient_payment.rb +143 -111
  281. data/lib/candidhealth/patient_payments/v_3/types/patient_payment_source.rb +12 -10
  282. data/lib/candidhealth/patient_payments/v_3/types/patient_payment_status.rb +14 -12
  283. data/lib/candidhealth/patient_payments/v_4/client.rb +230 -103
  284. data/lib/candidhealth/patient_payments/v_4/types/patient_payment.rb +129 -100
  285. data/lib/candidhealth/patient_payments/v_4/types/patient_payment_sort_field.rb +7 -5
  286. data/lib/candidhealth/patient_payments/v_4/types/patient_payments_page.rb +70 -47
  287. data/lib/candidhealth/patient_refunds/client.rb +8 -6
  288. data/lib/candidhealth/patient_refunds/v_1/client.rb +236 -107
  289. data/lib/candidhealth/patient_refunds/v_1/types/patient_refund.rb +137 -106
  290. data/lib/candidhealth/patient_refunds/v_1/types/patient_refund_sort_field.rb +8 -6
  291. data/lib/candidhealth/patient_refunds/v_1/types/patient_refunds_page.rb +70 -47
  292. data/lib/candidhealth/payers/client.rb +8 -6
  293. data/lib/candidhealth/payers/v_3/client.rb +73 -32
  294. data/lib/candidhealth/payers/v_3/types/payer.rb +61 -44
  295. data/lib/candidhealth/payers/v_3/types/payer_identifier.rb +77 -72
  296. data/lib/candidhealth/payers/v_3/types/payer_info.rb +54 -40
  297. data/lib/candidhealth/payers/v_3/types/payer_page.rb +70 -47
  298. data/lib/candidhealth/pre_encounter/client.rb +30 -0
  299. data/lib/candidhealth/pre_encounter/common/types/address.rb +123 -0
  300. data/lib/candidhealth/pre_encounter/common/types/address_use.rb +17 -0
  301. data/lib/candidhealth/pre_encounter/common/types/contact_point.rb +87 -0
  302. data/lib/candidhealth/pre_encounter/common/types/contact_point_use.rb +17 -0
  303. data/lib/candidhealth/pre_encounter/common/types/error_base.rb +60 -0
  304. data/lib/candidhealth/pre_encounter/common/types/gender.rb +16 -0
  305. data/lib/candidhealth/pre_encounter/common/types/human_name.rb +94 -0
  306. data/lib/candidhealth/pre_encounter/common/types/name_use.rb +19 -0
  307. data/lib/candidhealth/pre_encounter/common/types/not_found_error_body.rb +70 -0
  308. data/lib/candidhealth/pre_encounter/common/types/period.rb +74 -0
  309. data/lib/candidhealth/pre_encounter/common/types/relationship.rb +17 -0
  310. data/lib/candidhealth/pre_encounter/common/types/version_conflict_error_body.rb +77 -0
  311. data/lib/candidhealth/pre_encounter/coverages/client.rb +32 -0
  312. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +34 -0
  313. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/client.rb +487 -0
  314. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage.rb +185 -0
  315. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_status.rb +22 -0
  316. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_type.rb +18 -0
  317. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/insurance_plan.rb +136 -0
  318. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/mutable_coverage.rb +131 -0
  319. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/subscriber.rb +90 -0
  320. data/lib/candidhealth/pre_encounter/patients/client.rb +32 -0
  321. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +34 -0
  322. data/lib/candidhealth/pre_encounter/patients/v_1/patients/client.rb +590 -0
  323. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/contact.rb +135 -0
  324. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provenance.rb +75 -0
  325. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provider.rb +116 -0
  326. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/marital_status.rb +28 -0
  327. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/mutable_patient.rb +242 -0
  328. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/patient.rb +294 -0
  329. data/lib/candidhealth/remits/v_1/types/payee.rb +59 -42
  330. data/lib/candidhealth/remits/v_1/types/payee_identifier.rb +84 -80
  331. data/lib/candidhealth/service_facility/client.rb +58 -27
  332. data/lib/candidhealth/service_facility/types/encounter_service_facility.rb +87 -62
  333. data/lib/candidhealth/service_facility/types/encounter_service_facility_base.rb +87 -57
  334. data/lib/candidhealth/service_lines/v_2/types/denial_reason_content.rb +33 -31
  335. data/lib/candidhealth/service_lines/v_2/types/drug_identification.rb +92 -68
  336. data/lib/candidhealth/service_lines/v_2/types/measurement_unit_code.rb +8 -6
  337. data/lib/candidhealth/service_lines/v_2/types/service_id_qualifier.rb +10 -8
  338. data/lib/candidhealth/service_lines/v_2/types/service_line.rb +352 -222
  339. data/lib/candidhealth/service_lines/v_2/types/service_line_adjustment.rb +85 -62
  340. data/lib/candidhealth/service_lines/v_2/types/service_line_create.rb +235 -113
  341. data/lib/candidhealth/service_lines/v_2/types/service_line_denial_reason.rb +49 -35
  342. data/lib/candidhealth/service_lines/v_2/types/service_line_era_data.rb +60 -44
  343. data/lib/candidhealth/tags/types/tag.rb +69 -51
  344. data/lib/candidhealth/tags/types/tag_color_enum.rb +14 -12
  345. data/lib/candidhealth/tags/types/tag_create.rb +62 -45
  346. data/lib/candidhealth/tasks/client.rb +8 -6
  347. data/lib/candidhealth/tasks/commons/types/task_category.rb +45 -43
  348. data/lib/candidhealth/tasks/commons/types/task_status.rb +11 -9
  349. data/lib/candidhealth/tasks/commons/types/task_type.rb +16 -14
  350. data/lib/candidhealth/tasks/v_3/client.rb +208 -96
  351. data/lib/candidhealth/tasks/v_3/types/task.rb +193 -146
  352. data/lib/candidhealth/tasks/v_3/types/task_action.rb +66 -47
  353. data/lib/candidhealth/tasks/v_3/types/task_action_execution_method.rb +65 -59
  354. data/lib/candidhealth/tasks/v_3/types/task_action_type.rb +5 -3
  355. data/lib/candidhealth/tasks/v_3/types/task_actions.rb +47 -35
  356. data/lib/candidhealth/tasks/v_3/types/task_assignment.rb +59 -40
  357. data/lib/candidhealth/tasks/v_3/types/task_create_v_3.rb +100 -77
  358. data/lib/candidhealth/tasks/v_3/types/task_note.rb +83 -62
  359. data/lib/candidhealth/tasks/v_3/types/task_page.rb +70 -47
  360. data/lib/candidhealth/tasks/v_3/types/task_sort_options.rb +25 -23
  361. data/lib/candidhealth/tasks/v_3/types/task_update_v_3.rb +68 -49
  362. data/lib/candidhealth/tasks/v_3/types/task_updated_to_deprecated_status_error_type.rb +47 -33
  363. data/lib/candidhealth/write_offs/client.rb +8 -6
  364. data/lib/candidhealth/write_offs/v_1/client.rb +168 -83
  365. data/lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb +47 -35
  366. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off.rb +127 -97
  367. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb +103 -78
  368. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_reason.rb +19 -17
  369. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_target.rb +84 -81
  370. data/lib/candidhealth/write_offs/v_1/types/patient_write_off.rb +111 -84
  371. data/lib/candidhealth/write_offs/v_1/types/patient_write_off_create.rb +87 -65
  372. data/lib/candidhealth/write_offs/v_1/types/patient_write_off_reason.rb +12 -10
  373. data/lib/candidhealth/write_offs/v_1/types/write_off.rb +77 -71
  374. data/lib/candidhealth/write_offs/v_1/types/write_off_create.rb +77 -71
  375. data/lib/candidhealth/write_offs/v_1/types/write_off_sort_field.rb +6 -4
  376. data/lib/candidhealth/write_offs/v_1/types/write_offs_page.rb +70 -47
  377. data/lib/candidhealth/x_12/v_1/types/carc.rb +406 -404
  378. data/lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb +61 -44
  379. data/lib/candidhealth/x_12/v_1/types/rarc.rb +1063 -1061
  380. data/lib/candidhealth/x_12/v_1/types/remittance_advice_remark_code.rb +44 -33
  381. data/lib/candidhealth.rb +189 -87
  382. data/lib/core/oauth.rb +62 -0
  383. data/lib/environment.rb +8 -2
  384. data/lib/requests.rb +98 -48
  385. data/lib/types_export.rb +32 -53
  386. metadata +46 -57
  387. data/lib/candidhealth/billing_notes/v_2/types/billing_note_id.rb +0 -9
  388. data/lib/candidhealth/commons/types/claim_id.rb +0 -7
  389. data/lib/candidhealth/commons/types/date.rb +0 -7
  390. data/lib/candidhealth/commons/types/decimal.rb +0 -7
  391. data/lib/candidhealth/commons/types/email.rb +0 -7
  392. data/lib/candidhealth/commons/types/encounter_external_id.rb +0 -7
  393. data/lib/candidhealth/commons/types/encounter_id.rb +0 -7
  394. data/lib/candidhealth/commons/types/error_message.rb +0 -7
  395. data/lib/candidhealth/commons/types/invoice_id.rb +0 -7
  396. data/lib/candidhealth/commons/types/link_url.rb +0 -7
  397. data/lib/candidhealth/commons/types/npi.rb +0 -7
  398. data/lib/candidhealth/commons/types/organization_id.rb +0 -7
  399. data/lib/candidhealth/commons/types/page_token.rb +0 -7
  400. data/lib/candidhealth/commons/types/patient_external_id.rb +0 -7
  401. data/lib/candidhealth/commons/types/provider_id.rb +0 -7
  402. data/lib/candidhealth/commons/types/rate_id.rb +0 -7
  403. data/lib/candidhealth/commons/types/service_line_id.rb +0 -7
  404. data/lib/candidhealth/commons/types/task_assignment_id.rb +0 -7
  405. data/lib/candidhealth/commons/types/task_id.rb +0 -7
  406. data/lib/candidhealth/commons/types/task_note_id.rb +0 -7
  407. data/lib/candidhealth/commons/types/tax_id.rb +0 -7
  408. data/lib/candidhealth/commons/types/user_id.rb +0 -7
  409. data/lib/candidhealth/commons/types/work_queue_id.rb +0 -7
  410. data/lib/candidhealth/contracts/v_2/types/contract_id.rb +0 -9
  411. data/lib/candidhealth/contracts/v_2/types/contracting_provider_id.rb +0 -9
  412. data/lib/candidhealth/contracts/v_2/types/rendering_providerid.rb +0 -9
  413. data/lib/candidhealth/diagnoses/types/diagnosis_id.rb +0 -7
  414. data/lib/candidhealth/encounter_providers/v_2/types/provider_id.rb +0 -9
  415. data/lib/candidhealth/encounters/v_4/types/intake_follow_up_id.rb +0 -9
  416. data/lib/candidhealth/encounters/v_4/types/intake_question_id.rb +0 -9
  417. data/lib/candidhealth/encounters/v_4/types/prior_authorization_number.rb +0 -9
  418. data/lib/candidhealth/encounters/v_4/types/rx_cui.rb +0 -9
  419. data/lib/candidhealth/era/types/era_id.rb +0 -7
  420. data/lib/candidhealth/expected_network_status/v_2/types/network_status_check_id.rb +0 -9
  421. data/lib/candidhealth/guarantor/v_1/types/guarantor_id.rb +0 -9
  422. data/lib/candidhealth/identifiers/types/identifier_id.rb +0 -7
  423. data/lib/candidhealth/individual/types/individual_id.rb +0 -7
  424. data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_id.rb +0 -9
  425. data/lib/candidhealth/insurance_adjudications/v_1/types/service_line_adjudication_id.rb +0 -9
  426. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_id.rb +0 -9
  427. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payment_id.rb +0 -9
  428. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refund_id.rb +0 -9
  429. data/lib/candidhealth/organization_providers/v_2/types/organization_provider_id.rb +0 -9
  430. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_id.rb +0 -9
  431. data/lib/candidhealth/patient_payments/v_3/types/patient_payment_id.rb +0 -9
  432. data/lib/candidhealth/patient_payments/v_4/types/patient_payment_id.rb +0 -9
  433. data/lib/candidhealth/patient_refunds/v_1/types/patient_refund_id.rb +0 -9
  434. data/lib/candidhealth/payers/v_3/types/payer_id.rb +0 -9
  435. data/lib/candidhealth/payers/v_3/types/payer_name.rb +0 -9
  436. data/lib/candidhealth/payers/v_3/types/payer_uuid.rb +0 -9
  437. data/lib/candidhealth/service_facility/types/service_facility_id.rb +0 -7
  438. data/lib/candidhealth/tags/types/tag_id.rb +0 -7
  439. data/lib/candidhealth/write_offs/v_1/types/write_off_id.rb +0 -9
@@ -1,14 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../../../commons/types/date"
4
- require_relative "../../../commons/types/encounter_id"
3
+ require "date"
5
4
  require_relative "../../../claims/types/claim"
6
5
  require_relative "../../../individual/types/patient"
7
6
  require_relative "../../../guarantor/v_1/types/guarantor"
8
7
  require_relative "../../../encounter_providers/v_2/types/encounter_provider"
9
8
  require_relative "../../../service_facility/types/encounter_service_facility"
10
9
  require_relative "../../../individual/types/subscriber"
11
- require_relative "../../../commons/types/link_url"
12
10
  require_relative "../../../diagnoses/types/diagnosis"
13
11
  require_relative "clinical_note_category"
14
12
  require_relative "../../../billing_notes/v_2/types/billing_note"
@@ -17,12 +15,8 @@ require_relative "patient_history_category"
17
15
  require_relative "../../../patient_payments/v_3/types/patient_payment"
18
16
  require_relative "../../../tags/types/tag"
19
17
  require_relative "coding_attribution_type"
20
- require_relative "../../../commons/types/work_queue_id"
21
- require "date"
22
18
  require_relative "encounter_owner_of_next_action_type"
23
19
  require_relative "encounter_submission_origin_type"
24
- require_relative "../../../commons/types/encounter_external_id"
25
- require_relative "prior_authorization_number"
26
20
  require_relative "medication"
27
21
  require_relative "vitals"
28
22
  require_relative "intervention"
@@ -32,492 +26,748 @@ require_relative "billable_status_type"
32
26
  require_relative "responsible_party_type"
33
27
  require_relative "service_authorization_exception_code"
34
28
  require_relative "../../../commons/types/delay_reason_code"
29
+ require "ostruct"
35
30
  require "json"
36
31
 
37
32
  module CandidApiClient
38
33
  module Encounters
39
34
  module V4
40
- class Encounter
41
- attr_reader :patient_control_number, :date_of_service, :end_date_of_service, :encounter_id, :claims, :patient,
42
- :guarantor, :billing_provider, :rendering_provider, :referring_provider, :service_facility, :subscriber_primary, :subscriber_secondary, :url, :diagnoses, :clinical_notes, :billing_notes, :place_of_service_code, :place_of_service_code_as_submitted, :patient_histories, :patient_payments, :tags, :coding_attribution, :work_queue_id, :work_queue_membership_activated_at, :owner_of_next_action, :submission_origin, :external_id, :prior_authorization_number, :patient_authorized_release, :benefits_assigned_to_provider, :provider_accepts_assignment, :appointment_type, :existing_medications, :vitals, :interventions, :pay_to_address, :synchronicity, :billable_status, :responsible_party, :additional_information, :service_authorization_exception_code, :admission_date, :discharge_date, :onset_of_current_illness_or_symptom_date, :last_menstrual_period_date, :delay_reason_code, :additional_properties
35
+ module Types
36
+ class Encounter
37
+ # @return [String] A patient control number (PCN) is a unique identifier assigned to a patient
38
+ # within a healthcare system or facility.
39
+ # It's used to track and manage a patient's medical records, treatments, and other
40
+ # healthcare-related information.
41
+ attr_reader :patient_control_number
42
+ # @return [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
43
+ # This date must be the local date in the timezone where the service occurred.
44
+ # Box 24a on the CMS-1500 claim form.
45
+ # If service occurred over a range of dates, this should be the start date.
46
+ # date_of_service must be defined on either the encounter or the service lines but
47
+ # not both.
48
+ attr_reader :date_of_service
49
+ # @return [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
50
+ # This date must be the local date in the timezone where the service occurred.
51
+ # If omitted, the Encounter is assumed to be for a single day.
52
+ # Must not be temporally before the date_of_service field.
53
+ attr_reader :end_date_of_service
54
+ # @return [String]
55
+ attr_reader :encounter_id
56
+ # @return [Array<CandidApiClient::Claims::Types::Claim>]
57
+ attr_reader :claims
58
+ # @return [CandidApiClient::Individual::Types::Patient] Contains the identification information of the individual receiving medical
59
+ # services.
60
+ attr_reader :patient
61
+ # @return [CandidApiClient::Guarantor::V1::Types::Guarantor] Personal and contact info for the guarantor of the patient responsibility.
62
+ attr_reader :guarantor
63
+ # @return [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider] The billing provider is the provider or business entity submitting the claim.
64
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
65
+ # rendering provider. From a payer's perspective, this represents the person or
66
+ # entity being reimbursed. When a contract exists with the target payer, the
67
+ # billing provider should be the entity contracted with the payer. In some
68
+ # circumstances, this will be an individual provider. In that case, submit that
69
+ # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
70
+ # contracting. In other cases, the billing entity will be a medical group. If so,
71
+ # submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.
72
+ attr_reader :billing_provider
73
+ # @return [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider] The rendering provider is the practitioner -- physician, nurse practitioner,
74
+ # etc. -- performing the service.
75
+ # For telehealth services, the rendering provider performs the visit, asynchronous
76
+ # communication, or other service. The rendering provider address should generally
77
+ # be the same as the service facility address.
78
+ attr_reader :rendering_provider
79
+ # @return [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
80
+ attr_reader :referring_provider
81
+ # @return [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
82
+ attr_reader :initial_referring_provider
83
+ # @return [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
84
+ attr_reader :supervising_provider
85
+ # @return [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
86
+ attr_reader :ordering_provider
87
+ # @return [CandidApiClient::ServiceFacility::Types::EncounterServiceFacility] Encounter Service facility is typically the location a medical service was
88
+ # rendered, such as a provider office or hospital. For telehealth, service
89
+ # facility can represent the provider's location when the service was delivered
90
+ # (e.g., home), or the location where an in-person visit would have taken place,
91
+ # whichever is easier to identify. If the provider is in-network, service facility
92
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
93
+ # for an in-network claim to be successfully adjudicated, the service facility
94
+ # address listed on claims must match what was provided to the payer during the
95
+ # credentialing process.
96
+ attr_reader :service_facility
97
+ # @return [CandidApiClient::Individual::Types::Subscriber] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
98
+ # when the claim should be billed to insurance).
99
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the
100
+ # claim should be billed to the patient).
101
+ # However, if you collect this for patients, even self-pay, we recommend including
102
+ # it when sending encounters to Candid.
103
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
104
+ # to define self-pay claims.
105
+ attr_reader :subscriber_primary
106
+ # @return [CandidApiClient::Individual::Types::Subscriber] Contains details of the secondary insurance subscriber.
107
+ attr_reader :subscriber_secondary
108
+ # @return [String] URL that links directly to the claim created in Candid.
109
+ attr_reader :url
110
+ # @return [Array<CandidApiClient::Diagnoses::Types::Diagnosis>] Ideally, this field should contain no more than 12 diagnoses. However, more
111
+ # diagnoses may be submitted at this time, and coders will later prioritize the 12
112
+ # that will be submitted to the payor.
113
+ attr_reader :diagnoses
114
+ # @return [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during
115
+ # patient encounters.
116
+ attr_reader :clinical_notes
117
+ # @return [Array<CandidApiClient::BillingNotes::V2::Types::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
118
+ # used in the billing process.
119
+ attr_reader :billing_notes
120
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
121
+ # supported. 02 for telemedicine, 11 for in-person. Full list
122
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
123
+ attr_reader :place_of_service_code
124
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
125
+ # supported. 02 for telemedicine, 11 for in-person. Full list
126
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
127
+ attr_reader :place_of_service_code_as_submitted
128
+ # @return [Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>]
129
+ attr_reader :patient_histories
130
+ # @return [Array<CandidApiClient::PatientPayments::V3::Types::PatientPayment>]
131
+ attr_reader :patient_payments
132
+ # @return [Array<CandidApiClient::Tags::Types::Tag>]
133
+ attr_reader :tags
134
+ # @return [CandidApiClient::Encounters::V4::Types::CodingAttributionType] The entity that performed the coding of medical services for the claim.
135
+ attr_reader :coding_attribution
136
+ # @return [String]
137
+ attr_reader :work_queue_id
138
+ # @return [DateTime]
139
+ attr_reader :work_queue_membership_activated_at
140
+ # @return [CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as
141
+ # defined by ownership of open Tasks.
142
+ attr_reader :owner_of_next_action
143
+ # @return [CandidApiClient::Encounters::V4::Types::EncounterSubmissionOriginType] The party who originally submitted the Claim.
144
+ # For Claims originating in Candid, this will be
145
+ # EncounterSubmissionOriginType.CANDID.
146
+ # For Encounters created with an external_claim_submission object, this will be
147
+ # EncounterSubmissionOriginType.EXTERNAL.
148
+ attr_reader :submission_origin
149
+ # @return [String] A client-specified unique ID to associate with this encounter;
150
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
151
+ # This field should not contain PHI.
152
+ attr_reader :external_id
153
+ # @return [String] Box 23 on the CMS-1500 claim form.
154
+ attr_reader :prior_authorization_number
155
+ # @return [Boolean] Whether this patient has authorized the release of medical information
156
+ # for billing purpose.
157
+ # Box 12 on the CMS-1500 claim form.
158
+ attr_reader :patient_authorized_release
159
+ # @return [Boolean] Whether this patient has authorized insurance payments to be made to you,
160
+ # not them. If false, patient may receive reimbursement.
161
+ # Box 13 on the CMS-1500 claim form.
162
+ attr_reader :benefits_assigned_to_provider
163
+ # @return [Boolean] Whether you have accepted the patient's authorization for insurance payments
164
+ # to be made to you, not them.
165
+ # Box 27 on the CMS-1500 claim form.
166
+ attr_reader :provider_accepts_assignment
167
+ # @return [String] Human-readable description of the appointment type (ex: "Acupuncture -
168
+ # Headaches").
169
+ attr_reader :appointment_type
170
+ # @return [Array<CandidApiClient::Encounters::V4::Types::Medication>]
171
+ attr_reader :existing_medications
172
+ # @return [CandidApiClient::Encounters::V4::Types::Vitals]
173
+ attr_reader :vitals
174
+ # @return [Array<CandidApiClient::Encounters::V4::Types::Intervention>]
175
+ attr_reader :interventions
176
+ # @return [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
177
+ attr_reader :pay_to_address
178
+ # @return [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
179
+ # Asynchronous encounters occur when providers and patients communicate online
180
+ # using
181
+ # forms, instant messaging, or other pre-recorded digital mediums.
182
+ # Synchronous encounters occur in live, real-time settings where the patient
183
+ # interacts
184
+ # directly with the provider, such as over video or a phone call.
185
+ attr_reader :synchronicity
186
+ # @return [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
187
+ # Examples for when this should be set to NOT_BILLABLE include
188
+ # if the Encounter has not occurred yet or if there is no intention of ever
189
+ # billing the responsible_party.
190
+ attr_reader :billable_status
191
+ # @return [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
192
+ attr_reader :responsible_party
193
+ # @return [String] Defines additional information on the claim needed by the payer.
194
+ # Box 19 on the CMS-1500 claim form.
195
+ attr_reader :additional_information
196
+ # @return [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
197
+ # Required when mandated by government law or regulation to obtain authorization
198
+ # for specific service(s) but, for the
199
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
200
+ # the service was performed without
201
+ # obtaining the authorization.
202
+ attr_reader :service_authorization_exception_code
203
+ # @return [Date] 837p Loop2300 DTP\*435, CMS-1500 Box 18
204
+ # Required on all ambulance claims when the patient was known to be admitted to
205
+ # the hospital.
206
+ # OR
207
+ # Required on all claims involving inpatient medical visits.
208
+ attr_reader :admission_date
209
+ # @return [Date] 837p Loop2300 DTP\*096, CMS-1500 Box 18
210
+ # Required for inpatient claims when the patient was discharged from the facility
211
+ # and the discharge date is known.
212
+ attr_reader :discharge_date
213
+ # @return [Date] 837p Loop2300 DTP\*431, CMS-1500 Box 14
214
+ # Required for the initial medical service or visit performed in response to a
215
+ # medical emergency when the date is available and is different than the date of
216
+ # service.
217
+ # OR
218
+ # This date is the onset of acute symptoms for the current illness or condition.
219
+ attr_reader :onset_of_current_illness_or_symptom_date
220
+ # @return [Date] 837p Loop2300 DTP\*484, CMS-1500 Box 14
221
+ # Required when, in the judgment of the provider, the services on this claim are
222
+ # related to the patient's pregnancy.
223
+ attr_reader :last_menstrual_period_date
224
+ # @return [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
225
+ # Code indicating the reason why a request was delayed
226
+ attr_reader :delay_reason_code
227
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
228
+ attr_reader :additional_properties
229
+ # @return [Object]
230
+ attr_reader :_field_set
231
+ protected :_field_set
43
232
 
44
- # @param patient_control_number [String] A patient control number (PCN) is a unique identifier assigned to a patient within a healthcare system or facility.
45
- # It's used to track and manage a patient's medical records, treatments, and other healthcare-related information.
46
- # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
47
- # This date must be the local date in the timezone where the service occurred.
48
- # Box 24a on the CMS-1500 claim form.
49
- # If service occurred over a range of dates, this should be the start date.
50
- # date_of_service must be defined on either the encounter or the service lines but not both.
51
- # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
52
- # This date must be the local date in the timezone where the service occurred.
53
- # If omitted, the Encounter is assumed to be for a single day.
54
- # Must not be temporally before the date_of_service field.
55
- # @param encounter_id [Commons::ENCOUNTER_ID]
56
- # @param claims [Array<Claims::Claim>]
57
- # @param patient [Individual::Patient] Contains the identification information of the individual receiving medical services.
58
- # @param guarantor [Guarantor::V1::Guarantor] Personal and contact info for the guarantor of the patient responsibility.
59
- # @param billing_provider [EncounterProviders::V2::EncounterProvider] The billing provider is the provider or business entity submitting the claim. Billing provider may be, but is not necessarily, the same person/NPI as the rendering provider. From a payer's perspective, this represents the person or entity being reimbursed. When a contract exists with the target payer, the billing provider should be the entity contracted with the payer. In some circumstances, this will be an individual provider. In that case, submit that provider's NPI and the tax ID (TIN) that the provider gave to the payer during contracting. In other cases, the billing entity will be a medical group. If so, submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.
60
- # @param rendering_provider [EncounterProviders::V2::EncounterProvider] The rendering provider is the practitioner -- physician, nurse practitioner, etc. -- performing the service.
61
- # For telehealth services, the rendering provider performs the visit, asynchronous communication, or other service. The rendering provider address should generally be the same as the service facility address.
62
- # @param referring_provider [EncounterProviders::V2::EncounterProvider]
63
- # @param service_facility [ServiceFacility::EncounterServiceFacility] Encounter Service facility is typically the location a medical service was rendered, such as a provider office or hospital. For telehealth, service facility can represent the provider's location when the service was delivered (e.g., home), or the location where an in-person visit would have taken place, whichever is easier to identify. If the provider is in-network, service facility may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that for an in-network claim to be successfully adjudicated, the service facility address listed on claims must match what was provided to the payer during the credentialing process.
64
- # @param subscriber_primary [Individual::Subscriber] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e. when the claim should be billed to insurance).
65
- # These are not required fields when responsible_party is SELF_PAY (i.e. when the claim should be billed to the patient).
66
- # However, if you collect this for patients, even self-pay, we recommend including it when sending encounters to Candid.
67
- # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party to define self-pay claims.
68
- # @param subscriber_secondary [Individual::Subscriber] Contains details of the secondary insurance subscriber.
69
- # @param url [Commons::LINK_URL] URL that links directly to the claim created in Candid.
70
- # @param diagnoses [Array<Diagnoses::Diagnosis>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses may be submitted at this time, and coders will later prioritize the 12 that will be submitted to the payor.
71
- # @param clinical_notes [Array<Encounters::V4::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during patient encounters.
72
- # @param billing_notes [Array<BillingNotes::V2::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
73
- # used in the billing process.
74
- # @param place_of_service_code [Commons::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently supported. 02 for telemedicine, 11 for in-person. Full list [here](https://www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
75
- # @param place_of_service_code_as_submitted [Commons::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently supported. 02 for telemedicine, 11 for in-person. Full list [here](https://www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
76
- # @param patient_histories [Array<Encounters::V4::PatientHistoryCategory>]
77
- # @param patient_payments [Array<PatientPayments::V3::PatientPayment>]
78
- # @param tags [Array<Tags::Tag>]
79
- # @param coding_attribution [Encounters::V4::CodingAttributionType] The entity that performed the coding of medical services for the claim.
80
- # @param work_queue_id [Commons::WORK_QUEUE_ID]
81
- # @param work_queue_membership_activated_at [DateTime]
82
- # @param owner_of_next_action [Encounters::V4::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as defined by ownership of open Tasks.
83
- # @param submission_origin [Encounters::V4::EncounterSubmissionOriginType] The party who originally submitted the Claim.
84
- # For Claims originating in Candid, this will be EncounterSubmissionOriginType.CANDID.
85
- # For Encounters created with an external_claim_submission object, this will be EncounterSubmissionOriginType.EXTERNAL.
86
- # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
87
- # for example, your internal encounter ID or a Dr. Chrono encounter ID.
88
- # This field should not contain PHI.
89
- # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
90
- # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
91
- # for billing purpose.
92
- # Box 12 on the CMS-1500 claim form.
93
- # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
94
- # not them. If false, patient may receive reimbursement.
95
- # Box 13 on the CMS-1500 claim form.
96
- # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
97
- # to be made to you, not them.
98
- # Box 27 on the CMS-1500 claim form.
99
- # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
100
- # @param existing_medications [Array<Encounters::V4::Medication>]
101
- # @param vitals [Encounters::V4::Vitals]
102
- # @param interventions [Array<Encounters::V4::Intervention>]
103
- # @param pay_to_address [Commons::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
104
- # @param synchronicity [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
105
- # Asynchronous encounters occur when providers and patients communicate online using
106
- # forms, instant messaging, or other pre-recorded digital mediums.
107
- # Synchronous encounters occur in live, real-time settings where the patient interacts
108
- # directly with the provider, such as over video or a phone call.
109
- # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
110
- # Examples for when this should be set to NOT_BILLABLE include
111
- # if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
112
- # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
113
- # @param additional_information [String] Defines additional information on the claim needed by the payer.
114
- # Box 19 on the CMS-1500 claim form.
115
- # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
116
- # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
117
- # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
118
- # obtaining the authorization.
119
- # @param admission_date [Commons::DATE] 837p Loop2300 DTP\*435, CMS-1500 Box 18
120
- # Required on all ambulance claims when the patient was known to be admitted to the hospital.
121
- # OR
122
- # Required on all claims involving inpatient medical visits.
123
- # @param discharge_date [Commons::DATE] 837p Loop2300 DTP\*096, CMS-1500 Box 18
124
- # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
125
- # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP\*431, CMS-1500 Box 14
126
- # Required for the initial medical service or visit performed in response to a medical emergency when the date is available and is different than the date of service.
127
- # OR
128
- # This date is the onset of acute symptoms for the current illness or condition.
129
- # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP\*484, CMS-1500 Box 14
130
- # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
131
- # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
132
- # Code indicating the reason why a request was delayed
133
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
134
- # @return [Encounters::V4::Encounter]
135
- def initialize(date_of_service:, encounter_id:, claims:, patient:, billing_provider:, rendering_provider:,
136
- service_facility:, url:, diagnoses:, clinical_notes:, patient_histories:, patient_payments:, tags:, owner_of_next_action:, submission_origin:, external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, responsible_party:, patient_control_number: nil, end_date_of_service: nil, guarantor: nil, referring_provider: nil, subscriber_primary: nil, subscriber_secondary: nil, billing_notes: nil, place_of_service_code: nil, place_of_service_code_as_submitted: nil, coding_attribution: nil, work_queue_id: nil, work_queue_membership_activated_at: nil, prior_authorization_number: nil, appointment_type: nil, existing_medications: nil, vitals: nil, interventions: nil, pay_to_address: nil, synchronicity: nil, additional_information: nil, service_authorization_exception_code: nil, admission_date: nil, discharge_date: nil, onset_of_current_illness_or_symptom_date: nil, last_menstrual_period_date: nil, delay_reason_code: nil, additional_properties: nil)
137
- # @type [String] A patient control number (PCN) is a unique identifier assigned to a patient within a healthcare system or facility.
138
- # It's used to track and manage a patient's medical records, treatments, and other healthcare-related information.
139
- @patient_control_number = patient_control_number
140
- # @type [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
141
- # This date must be the local date in the timezone where the service occurred.
142
- # Box 24a on the CMS-1500 claim form.
143
- # If service occurred over a range of dates, this should be the start date.
144
- # date_of_service must be defined on either the encounter or the service lines but not both.
145
- @date_of_service = date_of_service
146
- # @type [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
147
- # This date must be the local date in the timezone where the service occurred.
148
- # If omitted, the Encounter is assumed to be for a single day.
149
- # Must not be temporally before the date_of_service field.
150
- @end_date_of_service = end_date_of_service
151
- # @type [Commons::ENCOUNTER_ID]
152
- @encounter_id = encounter_id
153
- # @type [Array<Claims::Claim>]
154
- @claims = claims
155
- # @type [Individual::Patient] Contains the identification information of the individual receiving medical services.
156
- @patient = patient
157
- # @type [Guarantor::V1::Guarantor] Personal and contact info for the guarantor of the patient responsibility.
158
- @guarantor = guarantor
159
- # @type [EncounterProviders::V2::EncounterProvider] The billing provider is the provider or business entity submitting the claim. Billing provider may be, but is not necessarily, the same person/NPI as the rendering provider. From a payer's perspective, this represents the person or entity being reimbursed. When a contract exists with the target payer, the billing provider should be the entity contracted with the payer. In some circumstances, this will be an individual provider. In that case, submit that provider's NPI and the tax ID (TIN) that the provider gave to the payer during contracting. In other cases, the billing entity will be a medical group. If so, submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.
160
- @billing_provider = billing_provider
161
- # @type [EncounterProviders::V2::EncounterProvider] The rendering provider is the practitioner -- physician, nurse practitioner, etc. -- performing the service.
162
- # For telehealth services, the rendering provider performs the visit, asynchronous communication, or other service. The rendering provider address should generally be the same as the service facility address.
163
- @rendering_provider = rendering_provider
164
- # @type [EncounterProviders::V2::EncounterProvider]
165
- @referring_provider = referring_provider
166
- # @type [ServiceFacility::EncounterServiceFacility] Encounter Service facility is typically the location a medical service was rendered, such as a provider office or hospital. For telehealth, service facility can represent the provider's location when the service was delivered (e.g., home), or the location where an in-person visit would have taken place, whichever is easier to identify. If the provider is in-network, service facility may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that for an in-network claim to be successfully adjudicated, the service facility address listed on claims must match what was provided to the payer during the credentialing process.
167
- @service_facility = service_facility
168
- # @type [Individual::Subscriber] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e. when the claim should be billed to insurance).
169
- # These are not required fields when responsible_party is SELF_PAY (i.e. when the claim should be billed to the patient).
170
- # However, if you collect this for patients, even self-pay, we recommend including it when sending encounters to Candid.
171
- # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party to define self-pay claims.
172
- @subscriber_primary = subscriber_primary
173
- # @type [Individual::Subscriber] Contains details of the secondary insurance subscriber.
174
- @subscriber_secondary = subscriber_secondary
175
- # @type [Commons::LINK_URL] URL that links directly to the claim created in Candid.
176
- @url = url
177
- # @type [Array<Diagnoses::Diagnosis>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses may be submitted at this time, and coders will later prioritize the 12 that will be submitted to the payor.
178
- @diagnoses = diagnoses
179
- # @type [Array<Encounters::V4::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during patient encounters.
180
- @clinical_notes = clinical_notes
181
- # @type [Array<BillingNotes::V2::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
182
- # used in the billing process.
183
- @billing_notes = billing_notes
184
- # @type [Commons::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently supported. 02 for telemedicine, 11 for in-person. Full list [here](https://www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
185
- @place_of_service_code = place_of_service_code
186
- # @type [Commons::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently supported. 02 for telemedicine, 11 for in-person. Full list [here](https://www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
187
- @place_of_service_code_as_submitted = place_of_service_code_as_submitted
188
- # @type [Array<Encounters::V4::PatientHistoryCategory>]
189
- @patient_histories = patient_histories
190
- # @type [Array<PatientPayments::V3::PatientPayment>]
191
- @patient_payments = patient_payments
192
- # @type [Array<Tags::Tag>]
193
- @tags = tags
194
- # @type [Encounters::V4::CodingAttributionType] The entity that performed the coding of medical services for the claim.
195
- @coding_attribution = coding_attribution
196
- # @type [Commons::WORK_QUEUE_ID]
197
- @work_queue_id = work_queue_id
198
- # @type [DateTime]
199
- @work_queue_membership_activated_at = work_queue_membership_activated_at
200
- # @type [Encounters::V4::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as defined by ownership of open Tasks.
201
- @owner_of_next_action = owner_of_next_action
202
- # @type [Encounters::V4::EncounterSubmissionOriginType] The party who originally submitted the Claim.
203
- # For Claims originating in Candid, this will be EncounterSubmissionOriginType.CANDID.
204
- # For Encounters created with an external_claim_submission object, this will be EncounterSubmissionOriginType.EXTERNAL.
205
- @submission_origin = submission_origin
206
- # @type [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
207
- # for example, your internal encounter ID or a Dr. Chrono encounter ID.
208
- # This field should not contain PHI.
209
- @external_id = external_id
210
- # @type [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
211
- @prior_authorization_number = prior_authorization_number
212
- # @type [Boolean] Whether this patient has authorized the release of medical information
213
- # for billing purpose.
214
- # Box 12 on the CMS-1500 claim form.
215
- @patient_authorized_release = patient_authorized_release
216
- # @type [Boolean] Whether this patient has authorized insurance payments to be made to you,
217
- # not them. If false, patient may receive reimbursement.
218
- # Box 13 on the CMS-1500 claim form.
219
- @benefits_assigned_to_provider = benefits_assigned_to_provider
220
- # @type [Boolean] Whether you have accepted the patient's authorization for insurance payments
221
- # to be made to you, not them.
222
- # Box 27 on the CMS-1500 claim form.
223
- @provider_accepts_assignment = provider_accepts_assignment
224
- # @type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
225
- @appointment_type = appointment_type
226
- # @type [Array<Encounters::V4::Medication>]
227
- @existing_medications = existing_medications
228
- # @type [Encounters::V4::Vitals]
229
- @vitals = vitals
230
- # @type [Array<Encounters::V4::Intervention>]
231
- @interventions = interventions
232
- # @type [Commons::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
233
- @pay_to_address = pay_to_address
234
- # @type [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
235
- # Asynchronous encounters occur when providers and patients communicate online using
236
- # forms, instant messaging, or other pre-recorded digital mediums.
237
- # Synchronous encounters occur in live, real-time settings where the patient interacts
238
- # directly with the provider, such as over video or a phone call.
239
- @synchronicity = synchronicity
240
- # @type [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
241
- # Examples for when this should be set to NOT_BILLABLE include
242
- # if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
243
- @billable_status = billable_status
244
- # @type [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
245
- @responsible_party = responsible_party
246
- # @type [String] Defines additional information on the claim needed by the payer.
247
- # Box 19 on the CMS-1500 claim form.
248
- @additional_information = additional_information
249
- # @type [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
250
- # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
251
- # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
252
- # obtaining the authorization.
253
- @service_authorization_exception_code = service_authorization_exception_code
254
- # @type [Commons::DATE] 837p Loop2300 DTP\*435, CMS-1500 Box 18
255
- # Required on all ambulance claims when the patient was known to be admitted to the hospital.
256
- # OR
257
- # Required on all claims involving inpatient medical visits.
258
- @admission_date = admission_date
259
- # @type [Commons::DATE] 837p Loop2300 DTP\*096, CMS-1500 Box 18
260
- # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
261
- @discharge_date = discharge_date
262
- # @type [Commons::DATE] 837p Loop2300 DTP\*431, CMS-1500 Box 14
263
- # Required for the initial medical service or visit performed in response to a medical emergency when the date is available and is different than the date of service.
264
- # OR
265
- # This date is the onset of acute symptoms for the current illness or condition.
266
- @onset_of_current_illness_or_symptom_date = onset_of_current_illness_or_symptom_date
267
- # @type [Commons::DATE] 837p Loop2300 DTP\*484, CMS-1500 Box 14
268
- # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
269
- @last_menstrual_period_date = last_menstrual_period_date
270
- # @type [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
271
- # Code indicating the reason why a request was delayed
272
- @delay_reason_code = delay_reason_code
273
- # @type [OpenStruct] Additional properties unmapped to the current class definition
274
- @additional_properties = additional_properties
275
- end
233
+ OMIT = Object.new
276
234
 
277
- # Deserialize a JSON object to an instance of Encounter
278
- #
279
- # @param json_object [JSON]
280
- # @return [Encounters::V4::Encounter]
281
- def self.from_json(json_object:)
282
- struct = JSON.parse(json_object, object_class: OpenStruct)
283
- parsed_json = JSON.parse(json_object)
284
- patient_control_number = struct.patient_control_number
285
- date_of_service = struct.date_of_service
286
- end_date_of_service = struct.end_date_of_service
287
- encounter_id = struct.encounter_id
288
- claims = parsed_json["claims"]&.map do |v|
289
- v = v.to_json
290
- Claims::Claim.from_json(json_object: v)
291
- end
292
- if parsed_json["patient"].nil?
293
- patient = nil
294
- else
295
- patient = parsed_json["patient"].to_json
296
- patient = Individual::Patient.from_json(json_object: patient)
297
- end
298
- if parsed_json["guarantor"].nil?
299
- guarantor = nil
300
- else
301
- guarantor = parsed_json["guarantor"].to_json
302
- guarantor = Guarantor::V1::Guarantor.from_json(json_object: guarantor)
303
- end
304
- if parsed_json["billing_provider"].nil?
305
- billing_provider = nil
306
- else
307
- billing_provider = parsed_json["billing_provider"].to_json
308
- billing_provider = EncounterProviders::V2::EncounterProvider.from_json(json_object: billing_provider)
309
- end
310
- if parsed_json["rendering_provider"].nil?
311
- rendering_provider = nil
312
- else
313
- rendering_provider = parsed_json["rendering_provider"].to_json
314
- rendering_provider = EncounterProviders::V2::EncounterProvider.from_json(json_object: rendering_provider)
315
- end
316
- if parsed_json["referring_provider"].nil?
317
- referring_provider = nil
318
- else
319
- referring_provider = parsed_json["referring_provider"].to_json
320
- referring_provider = EncounterProviders::V2::EncounterProvider.from_json(json_object: referring_provider)
321
- end
322
- if parsed_json["service_facility"].nil?
323
- service_facility = nil
324
- else
325
- service_facility = parsed_json["service_facility"].to_json
326
- service_facility = ServiceFacility::EncounterServiceFacility.from_json(json_object: service_facility)
327
- end
328
- if parsed_json["subscriber_primary"].nil?
329
- subscriber_primary = nil
330
- else
331
- subscriber_primary = parsed_json["subscriber_primary"].to_json
332
- subscriber_primary = Individual::Subscriber.from_json(json_object: subscriber_primary)
333
- end
334
- if parsed_json["subscriber_secondary"].nil?
335
- subscriber_secondary = nil
336
- else
337
- subscriber_secondary = parsed_json["subscriber_secondary"].to_json
338
- subscriber_secondary = Individual::Subscriber.from_json(json_object: subscriber_secondary)
339
- end
340
- url = struct.url
341
- diagnoses = parsed_json["diagnoses"]&.map do |v|
342
- v = v.to_json
343
- Diagnoses::Diagnosis.from_json(json_object: v)
344
- end
345
- clinical_notes = parsed_json["clinical_notes"]&.map do |v|
346
- v = v.to_json
347
- Encounters::V4::ClinicalNoteCategory.from_json(json_object: v)
235
+ # @param patient_control_number [String] A patient control number (PCN) is a unique identifier assigned to a patient
236
+ # within a healthcare system or facility.
237
+ # It's used to track and manage a patient's medical records, treatments, and other
238
+ # healthcare-related information.
239
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
240
+ # This date must be the local date in the timezone where the service occurred.
241
+ # Box 24a on the CMS-1500 claim form.
242
+ # If service occurred over a range of dates, this should be the start date.
243
+ # date_of_service must be defined on either the encounter or the service lines but
244
+ # not both.
245
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
246
+ # This date must be the local date in the timezone where the service occurred.
247
+ # If omitted, the Encounter is assumed to be for a single day.
248
+ # Must not be temporally before the date_of_service field.
249
+ # @param encounter_id [String]
250
+ # @param claims [Array<CandidApiClient::Claims::Types::Claim>]
251
+ # @param patient [CandidApiClient::Individual::Types::Patient] Contains the identification information of the individual receiving medical
252
+ # services.
253
+ # @param guarantor [CandidApiClient::Guarantor::V1::Types::Guarantor] Personal and contact info for the guarantor of the patient responsibility.
254
+ # @param billing_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider] The billing provider is the provider or business entity submitting the claim.
255
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
256
+ # rendering provider. From a payer's perspective, this represents the person or
257
+ # entity being reimbursed. When a contract exists with the target payer, the
258
+ # billing provider should be the entity contracted with the payer. In some
259
+ # circumstances, this will be an individual provider. In that case, submit that
260
+ # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
261
+ # contracting. In other cases, the billing entity will be a medical group. If so,
262
+ # submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.
263
+ # @param rendering_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider] The rendering provider is the practitioner -- physician, nurse practitioner,
264
+ # etc. -- performing the service.
265
+ # For telehealth services, the rendering provider performs the visit, asynchronous
266
+ # communication, or other service. The rendering provider address should generally
267
+ # be the same as the service facility address.
268
+ # @param referring_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
269
+ # @param initial_referring_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
270
+ # @param supervising_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
271
+ # @param ordering_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
272
+ # @param service_facility [CandidApiClient::ServiceFacility::Types::EncounterServiceFacility] Encounter Service facility is typically the location a medical service was
273
+ # rendered, such as a provider office or hospital. For telehealth, service
274
+ # facility can represent the provider's location when the service was delivered
275
+ # (e.g., home), or the location where an in-person visit would have taken place,
276
+ # whichever is easier to identify. If the provider is in-network, service facility
277
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
278
+ # for an in-network claim to be successfully adjudicated, the service facility
279
+ # address listed on claims must match what was provided to the payer during the
280
+ # credentialing process.
281
+ # @param subscriber_primary [CandidApiClient::Individual::Types::Subscriber] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
282
+ # when the claim should be billed to insurance).
283
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the
284
+ # claim should be billed to the patient).
285
+ # However, if you collect this for patients, even self-pay, we recommend including
286
+ # it when sending encounters to Candid.
287
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
288
+ # to define self-pay claims.
289
+ # @param subscriber_secondary [CandidApiClient::Individual::Types::Subscriber] Contains details of the secondary insurance subscriber.
290
+ # @param url [String] URL that links directly to the claim created in Candid.
291
+ # @param diagnoses [Array<CandidApiClient::Diagnoses::Types::Diagnosis>] Ideally, this field should contain no more than 12 diagnoses. However, more
292
+ # diagnoses may be submitted at this time, and coders will later prioritize the 12
293
+ # that will be submitted to the payor.
294
+ # @param clinical_notes [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during
295
+ # patient encounters.
296
+ # @param billing_notes [Array<CandidApiClient::BillingNotes::V2::Types::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
297
+ # used in the billing process.
298
+ # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
299
+ # supported. 02 for telemedicine, 11 for in-person. Full list
300
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
301
+ # @param place_of_service_code_as_submitted [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
302
+ # supported. 02 for telemedicine, 11 for in-person. Full list
303
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
304
+ # @param patient_histories [Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>]
305
+ # @param patient_payments [Array<CandidApiClient::PatientPayments::V3::Types::PatientPayment>]
306
+ # @param tags [Array<CandidApiClient::Tags::Types::Tag>]
307
+ # @param coding_attribution [CandidApiClient::Encounters::V4::Types::CodingAttributionType] The entity that performed the coding of medical services for the claim.
308
+ # @param work_queue_id [String]
309
+ # @param work_queue_membership_activated_at [DateTime]
310
+ # @param owner_of_next_action [CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as
311
+ # defined by ownership of open Tasks.
312
+ # @param submission_origin [CandidApiClient::Encounters::V4::Types::EncounterSubmissionOriginType] The party who originally submitted the Claim.
313
+ # For Claims originating in Candid, this will be
314
+ # EncounterSubmissionOriginType.CANDID.
315
+ # For Encounters created with an external_claim_submission object, this will be
316
+ # EncounterSubmissionOriginType.EXTERNAL.
317
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
318
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
319
+ # This field should not contain PHI.
320
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
321
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
322
+ # for billing purpose.
323
+ # Box 12 on the CMS-1500 claim form.
324
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
325
+ # not them. If false, patient may receive reimbursement.
326
+ # Box 13 on the CMS-1500 claim form.
327
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
328
+ # to be made to you, not them.
329
+ # Box 27 on the CMS-1500 claim form.
330
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
331
+ # Headaches").
332
+ # @param existing_medications [Array<CandidApiClient::Encounters::V4::Types::Medication>]
333
+ # @param vitals [CandidApiClient::Encounters::V4::Types::Vitals]
334
+ # @param interventions [Array<CandidApiClient::Encounters::V4::Types::Intervention>]
335
+ # @param pay_to_address [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
336
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
337
+ # Asynchronous encounters occur when providers and patients communicate online
338
+ # using
339
+ # forms, instant messaging, or other pre-recorded digital mediums.
340
+ # Synchronous encounters occur in live, real-time settings where the patient
341
+ # interacts
342
+ # directly with the provider, such as over video or a phone call.
343
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
344
+ # Examples for when this should be set to NOT_BILLABLE include
345
+ # if the Encounter has not occurred yet or if there is no intention of ever
346
+ # billing the responsible_party.
347
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
348
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
349
+ # Box 19 on the CMS-1500 claim form.
350
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
351
+ # Required when mandated by government law or regulation to obtain authorization
352
+ # for specific service(s) but, for the
353
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
354
+ # the service was performed without
355
+ # obtaining the authorization.
356
+ # @param admission_date [Date] 837p Loop2300 DTP\*435, CMS-1500 Box 18
357
+ # Required on all ambulance claims when the patient was known to be admitted to
358
+ # the hospital.
359
+ # OR
360
+ # Required on all claims involving inpatient medical visits.
361
+ # @param discharge_date [Date] 837p Loop2300 DTP\*096, CMS-1500 Box 18
362
+ # Required for inpatient claims when the patient was discharged from the facility
363
+ # and the discharge date is known.
364
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP\*431, CMS-1500 Box 14
365
+ # Required for the initial medical service or visit performed in response to a
366
+ # medical emergency when the date is available and is different than the date of
367
+ # service.
368
+ # OR
369
+ # This date is the onset of acute symptoms for the current illness or condition.
370
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP\*484, CMS-1500 Box 14
371
+ # Required when, in the judgment of the provider, the services on this claim are
372
+ # related to the patient's pregnancy.
373
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
374
+ # Code indicating the reason why a request was delayed
375
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
376
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
377
+ def initialize(date_of_service:, encounter_id:, claims:, patient:, billing_provider:, rendering_provider:,
378
+ service_facility:, url:, diagnoses:, clinical_notes:, patient_histories:, patient_payments:, tags:, owner_of_next_action:, submission_origin:, external_id:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, responsible_party:, patient_control_number: OMIT, end_date_of_service: OMIT, guarantor: OMIT, referring_provider: OMIT, initial_referring_provider: OMIT, supervising_provider: OMIT, ordering_provider: OMIT, subscriber_primary: OMIT, subscriber_secondary: 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, prior_authorization_number: 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)
379
+ @patient_control_number = patient_control_number if patient_control_number != OMIT
380
+ @date_of_service = date_of_service
381
+ @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
382
+ @encounter_id = encounter_id
383
+ @claims = claims
384
+ @patient = patient
385
+ @guarantor = guarantor if guarantor != OMIT
386
+ @billing_provider = billing_provider
387
+ @rendering_provider = rendering_provider
388
+ @referring_provider = referring_provider if referring_provider != OMIT
389
+ @initial_referring_provider = initial_referring_provider if initial_referring_provider != OMIT
390
+ @supervising_provider = supervising_provider if supervising_provider != OMIT
391
+ @ordering_provider = ordering_provider if ordering_provider != OMIT
392
+ @service_facility = service_facility
393
+ @subscriber_primary = subscriber_primary if subscriber_primary != OMIT
394
+ @subscriber_secondary = subscriber_secondary if subscriber_secondary != OMIT
395
+ @url = url
396
+ @diagnoses = diagnoses
397
+ @clinical_notes = clinical_notes
398
+ @billing_notes = billing_notes if billing_notes != OMIT
399
+ @place_of_service_code = place_of_service_code if place_of_service_code != OMIT
400
+ if place_of_service_code_as_submitted != OMIT
401
+ @place_of_service_code_as_submitted = place_of_service_code_as_submitted
402
+ end
403
+ @patient_histories = patient_histories
404
+ @patient_payments = patient_payments
405
+ @tags = tags
406
+ @coding_attribution = coding_attribution if coding_attribution != OMIT
407
+ @work_queue_id = work_queue_id if work_queue_id != OMIT
408
+ if work_queue_membership_activated_at != OMIT
409
+ @work_queue_membership_activated_at = work_queue_membership_activated_at
410
+ end
411
+ @owner_of_next_action = owner_of_next_action
412
+ @submission_origin = submission_origin
413
+ @external_id = external_id
414
+ @prior_authorization_number = prior_authorization_number if prior_authorization_number != OMIT
415
+ @patient_authorized_release = patient_authorized_release
416
+ @benefits_assigned_to_provider = benefits_assigned_to_provider
417
+ @provider_accepts_assignment = provider_accepts_assignment
418
+ @appointment_type = appointment_type if appointment_type != OMIT
419
+ @existing_medications = existing_medications if existing_medications != OMIT
420
+ @vitals = vitals if vitals != OMIT
421
+ @interventions = interventions if interventions != OMIT
422
+ @pay_to_address = pay_to_address if pay_to_address != OMIT
423
+ @synchronicity = synchronicity if synchronicity != OMIT
424
+ @billable_status = billable_status
425
+ @responsible_party = responsible_party
426
+ @additional_information = additional_information if additional_information != OMIT
427
+ if service_authorization_exception_code != OMIT
428
+ @service_authorization_exception_code = service_authorization_exception_code
429
+ end
430
+ @admission_date = admission_date if admission_date != OMIT
431
+ @discharge_date = discharge_date if discharge_date != OMIT
432
+ if onset_of_current_illness_or_symptom_date != OMIT
433
+ @onset_of_current_illness_or_symptom_date = onset_of_current_illness_or_symptom_date
434
+ end
435
+ @last_menstrual_period_date = last_menstrual_period_date if last_menstrual_period_date != OMIT
436
+ @delay_reason_code = delay_reason_code if delay_reason_code != OMIT
437
+ @additional_properties = additional_properties
438
+ @_field_set = {
439
+ "patient_control_number": patient_control_number,
440
+ "date_of_service": date_of_service,
441
+ "end_date_of_service": end_date_of_service,
442
+ "encounter_id": encounter_id,
443
+ "claims": claims,
444
+ "patient": patient,
445
+ "guarantor": guarantor,
446
+ "billing_provider": billing_provider,
447
+ "rendering_provider": rendering_provider,
448
+ "referring_provider": referring_provider,
449
+ "initial_referring_provider": initial_referring_provider,
450
+ "supervising_provider": supervising_provider,
451
+ "ordering_provider": ordering_provider,
452
+ "service_facility": service_facility,
453
+ "subscriber_primary": subscriber_primary,
454
+ "subscriber_secondary": subscriber_secondary,
455
+ "url": url,
456
+ "diagnoses": diagnoses,
457
+ "clinical_notes": clinical_notes,
458
+ "billing_notes": billing_notes,
459
+ "place_of_service_code": place_of_service_code,
460
+ "place_of_service_code_as_submitted": place_of_service_code_as_submitted,
461
+ "patient_histories": patient_histories,
462
+ "patient_payments": patient_payments,
463
+ "tags": tags,
464
+ "coding_attribution": coding_attribution,
465
+ "work_queue_id": work_queue_id,
466
+ "work_queue_membership_activated_at": work_queue_membership_activated_at,
467
+ "owner_of_next_action": owner_of_next_action,
468
+ "submission_origin": submission_origin,
469
+ "external_id": external_id,
470
+ "prior_authorization_number": prior_authorization_number,
471
+ "patient_authorized_release": patient_authorized_release,
472
+ "benefits_assigned_to_provider": benefits_assigned_to_provider,
473
+ "provider_accepts_assignment": provider_accepts_assignment,
474
+ "appointment_type": appointment_type,
475
+ "existing_medications": existing_medications,
476
+ "vitals": vitals,
477
+ "interventions": interventions,
478
+ "pay_to_address": pay_to_address,
479
+ "synchronicity": synchronicity,
480
+ "billable_status": billable_status,
481
+ "responsible_party": responsible_party,
482
+ "additional_information": additional_information,
483
+ "service_authorization_exception_code": service_authorization_exception_code,
484
+ "admission_date": admission_date,
485
+ "discharge_date": discharge_date,
486
+ "onset_of_current_illness_or_symptom_date": onset_of_current_illness_or_symptom_date,
487
+ "last_menstrual_period_date": last_menstrual_period_date,
488
+ "delay_reason_code": delay_reason_code
489
+ }.reject do |_k, v|
490
+ v == OMIT
491
+ end
348
492
  end
349
- billing_notes = parsed_json["billing_notes"]&.map do |v|
350
- v = v.to_json
351
- BillingNotes::V2::BillingNote.from_json(json_object: v)
352
- end
353
- place_of_service_code = struct.place_of_service_code
354
- place_of_service_code_as_submitted = struct.place_of_service_code_as_submitted
355
- patient_histories = parsed_json["patient_histories"]&.map do |v|
356
- v = v.to_json
357
- Encounters::V4::PatientHistoryCategory.from_json(json_object: v)
358
- end
359
- patient_payments = parsed_json["patient_payments"]&.map do |v|
360
- v = v.to_json
361
- PatientPayments::V3::PatientPayment.from_json(json_object: v)
362
- end
363
- tags = parsed_json["tags"]&.map do |v|
364
- v = v.to_json
365
- Tags::Tag.from_json(json_object: v)
366
- end
367
- coding_attribution = struct.coding_attribution
368
- work_queue_id = struct.work_queue_id
369
- work_queue_membership_activated_at = unless parsed_json["work_queue_membership_activated_at"].nil?
370
- DateTime.parse(parsed_json["work_queue_membership_activated_at"])
371
- end
372
- owner_of_next_action = struct.owner_of_next_action
373
- submission_origin = struct.submission_origin
374
- external_id = struct.external_id
375
- prior_authorization_number = struct.prior_authorization_number
376
- patient_authorized_release = struct.patient_authorized_release
377
- benefits_assigned_to_provider = struct.benefits_assigned_to_provider
378
- provider_accepts_assignment = struct.provider_accepts_assignment
379
- appointment_type = struct.appointment_type
380
- existing_medications = parsed_json["existing_medications"]&.map do |v|
381
- v = v.to_json
382
- Encounters::V4::Medication.from_json(json_object: v)
383
- end
384
- if parsed_json["vitals"].nil?
385
- vitals = nil
386
- else
387
- vitals = parsed_json["vitals"].to_json
388
- vitals = Encounters::V4::Vitals.from_json(json_object: vitals)
389
- end
390
- interventions = parsed_json["interventions"]&.map do |v|
391
- v = v.to_json
392
- Encounters::V4::Intervention.from_json(json_object: v)
393
- end
394
- if parsed_json["pay_to_address"].nil?
395
- pay_to_address = nil
396
- else
397
- pay_to_address = parsed_json["pay_to_address"].to_json
398
- pay_to_address = Commons::StreetAddressLongZip.from_json(json_object: pay_to_address)
493
+
494
+ # Deserialize a JSON object to an instance of Encounter
495
+ #
496
+ # @param json_object [String]
497
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
498
+ def self.from_json(json_object:)
499
+ struct = JSON.parse(json_object, object_class: OpenStruct)
500
+ parsed_json = JSON.parse(json_object)
501
+ patient_control_number = struct["patient_control_number"]
502
+ date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
503
+ end_date_of_service = unless parsed_json["end_date_of_service"].nil?
504
+ Date.parse(parsed_json["end_date_of_service"])
505
+ end
506
+ encounter_id = struct["encounter_id"]
507
+ claims = parsed_json["claims"]&.map do |item|
508
+ item = item.to_json
509
+ CandidApiClient::Claims::Types::Claim.from_json(json_object: item)
510
+ end
511
+ if parsed_json["patient"].nil?
512
+ patient = nil
513
+ else
514
+ patient = parsed_json["patient"].to_json
515
+ patient = CandidApiClient::Individual::Types::Patient.from_json(json_object: patient)
516
+ end
517
+ if parsed_json["guarantor"].nil?
518
+ guarantor = nil
519
+ else
520
+ guarantor = parsed_json["guarantor"].to_json
521
+ guarantor = CandidApiClient::Guarantor::V1::Types::Guarantor.from_json(json_object: guarantor)
522
+ end
523
+ if parsed_json["billing_provider"].nil?
524
+ billing_provider = nil
525
+ else
526
+ billing_provider = parsed_json["billing_provider"].to_json
527
+ billing_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: billing_provider)
528
+ end
529
+ if parsed_json["rendering_provider"].nil?
530
+ rendering_provider = nil
531
+ else
532
+ rendering_provider = parsed_json["rendering_provider"].to_json
533
+ rendering_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: rendering_provider)
534
+ end
535
+ if parsed_json["referring_provider"].nil?
536
+ referring_provider = nil
537
+ else
538
+ referring_provider = parsed_json["referring_provider"].to_json
539
+ referring_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: referring_provider)
540
+ end
541
+ if parsed_json["initial_referring_provider"].nil?
542
+ initial_referring_provider = nil
543
+ else
544
+ initial_referring_provider = parsed_json["initial_referring_provider"].to_json
545
+ initial_referring_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: initial_referring_provider)
546
+ end
547
+ if parsed_json["supervising_provider"].nil?
548
+ supervising_provider = nil
549
+ else
550
+ supervising_provider = parsed_json["supervising_provider"].to_json
551
+ supervising_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: supervising_provider)
552
+ end
553
+ if parsed_json["ordering_provider"].nil?
554
+ ordering_provider = nil
555
+ else
556
+ ordering_provider = parsed_json["ordering_provider"].to_json
557
+ ordering_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: ordering_provider)
558
+ end
559
+ if parsed_json["service_facility"].nil?
560
+ service_facility = nil
561
+ else
562
+ service_facility = parsed_json["service_facility"].to_json
563
+ service_facility = CandidApiClient::ServiceFacility::Types::EncounterServiceFacility.from_json(json_object: service_facility)
564
+ end
565
+ if parsed_json["subscriber_primary"].nil?
566
+ subscriber_primary = nil
567
+ else
568
+ subscriber_primary = parsed_json["subscriber_primary"].to_json
569
+ subscriber_primary = CandidApiClient::Individual::Types::Subscriber.from_json(json_object: subscriber_primary)
570
+ end
571
+ if parsed_json["subscriber_secondary"].nil?
572
+ subscriber_secondary = nil
573
+ else
574
+ subscriber_secondary = parsed_json["subscriber_secondary"].to_json
575
+ subscriber_secondary = CandidApiClient::Individual::Types::Subscriber.from_json(json_object: subscriber_secondary)
576
+ end
577
+ url = struct["url"]
578
+ diagnoses = parsed_json["diagnoses"]&.map do |item|
579
+ item = item.to_json
580
+ CandidApiClient::Diagnoses::Types::Diagnosis.from_json(json_object: item)
581
+ end
582
+ clinical_notes = parsed_json["clinical_notes"]&.map do |item|
583
+ item = item.to_json
584
+ CandidApiClient::Encounters::V4::Types::ClinicalNoteCategory.from_json(json_object: item)
585
+ end
586
+ billing_notes = parsed_json["billing_notes"]&.map do |item|
587
+ item = item.to_json
588
+ CandidApiClient::BillingNotes::V2::Types::BillingNote.from_json(json_object: item)
589
+ end
590
+ place_of_service_code = struct["place_of_service_code"]
591
+ place_of_service_code_as_submitted = struct["place_of_service_code_as_submitted"]
592
+ patient_histories = parsed_json["patient_histories"]&.map do |item|
593
+ item = item.to_json
594
+ CandidApiClient::Encounters::V4::Types::PatientHistoryCategory.from_json(json_object: item)
595
+ end
596
+ patient_payments = parsed_json["patient_payments"]&.map do |item|
597
+ item = item.to_json
598
+ CandidApiClient::PatientPayments::V3::Types::PatientPayment.from_json(json_object: item)
599
+ end
600
+ tags = parsed_json["tags"]&.map do |item|
601
+ item = item.to_json
602
+ CandidApiClient::Tags::Types::Tag.from_json(json_object: item)
603
+ end
604
+ coding_attribution = struct["coding_attribution"]
605
+ work_queue_id = struct["work_queue_id"]
606
+ work_queue_membership_activated_at = unless parsed_json["work_queue_membership_activated_at"].nil?
607
+ DateTime.parse(parsed_json["work_queue_membership_activated_at"])
608
+ end
609
+ owner_of_next_action = struct["owner_of_next_action"]
610
+ submission_origin = struct["submission_origin"]
611
+ external_id = struct["external_id"]
612
+ prior_authorization_number = struct["prior_authorization_number"]
613
+ patient_authorized_release = struct["patient_authorized_release"]
614
+ benefits_assigned_to_provider = struct["benefits_assigned_to_provider"]
615
+ provider_accepts_assignment = struct["provider_accepts_assignment"]
616
+ appointment_type = struct["appointment_type"]
617
+ existing_medications = parsed_json["existing_medications"]&.map do |item|
618
+ item = item.to_json
619
+ CandidApiClient::Encounters::V4::Types::Medication.from_json(json_object: item)
620
+ end
621
+ if parsed_json["vitals"].nil?
622
+ vitals = nil
623
+ else
624
+ vitals = parsed_json["vitals"].to_json
625
+ vitals = CandidApiClient::Encounters::V4::Types::Vitals.from_json(json_object: vitals)
626
+ end
627
+ interventions = parsed_json["interventions"]&.map do |item|
628
+ item = item.to_json
629
+ CandidApiClient::Encounters::V4::Types::Intervention.from_json(json_object: item)
630
+ end
631
+ if parsed_json["pay_to_address"].nil?
632
+ pay_to_address = nil
633
+ else
634
+ pay_to_address = parsed_json["pay_to_address"].to_json
635
+ pay_to_address = CandidApiClient::Commons::Types::StreetAddressLongZip.from_json(json_object: pay_to_address)
636
+ end
637
+ synchronicity = struct["synchronicity"]
638
+ billable_status = struct["billable_status"]
639
+ responsible_party = struct["responsible_party"]
640
+ additional_information = struct["additional_information"]
641
+ service_authorization_exception_code = struct["service_authorization_exception_code"]
642
+ admission_date = (Date.parse(parsed_json["admission_date"]) unless parsed_json["admission_date"].nil?)
643
+ discharge_date = (Date.parse(parsed_json["discharge_date"]) unless parsed_json["discharge_date"].nil?)
644
+ onset_of_current_illness_or_symptom_date = unless parsed_json["onset_of_current_illness_or_symptom_date"].nil?
645
+ Date.parse(parsed_json["onset_of_current_illness_or_symptom_date"])
646
+ end
647
+ last_menstrual_period_date = unless parsed_json["last_menstrual_period_date"].nil?
648
+ Date.parse(parsed_json["last_menstrual_period_date"])
649
+ end
650
+ delay_reason_code = struct["delay_reason_code"]
651
+ new(
652
+ patient_control_number: patient_control_number,
653
+ date_of_service: date_of_service,
654
+ end_date_of_service: end_date_of_service,
655
+ encounter_id: encounter_id,
656
+ claims: claims,
657
+ patient: patient,
658
+ guarantor: guarantor,
659
+ billing_provider: billing_provider,
660
+ rendering_provider: rendering_provider,
661
+ referring_provider: referring_provider,
662
+ initial_referring_provider: initial_referring_provider,
663
+ supervising_provider: supervising_provider,
664
+ ordering_provider: ordering_provider,
665
+ service_facility: service_facility,
666
+ subscriber_primary: subscriber_primary,
667
+ subscriber_secondary: subscriber_secondary,
668
+ url: url,
669
+ diagnoses: diagnoses,
670
+ clinical_notes: clinical_notes,
671
+ billing_notes: billing_notes,
672
+ place_of_service_code: place_of_service_code,
673
+ place_of_service_code_as_submitted: place_of_service_code_as_submitted,
674
+ patient_histories: patient_histories,
675
+ patient_payments: patient_payments,
676
+ tags: tags,
677
+ coding_attribution: coding_attribution,
678
+ work_queue_id: work_queue_id,
679
+ work_queue_membership_activated_at: work_queue_membership_activated_at,
680
+ owner_of_next_action: owner_of_next_action,
681
+ submission_origin: submission_origin,
682
+ external_id: external_id,
683
+ prior_authorization_number: prior_authorization_number,
684
+ patient_authorized_release: patient_authorized_release,
685
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
686
+ provider_accepts_assignment: provider_accepts_assignment,
687
+ appointment_type: appointment_type,
688
+ existing_medications: existing_medications,
689
+ vitals: vitals,
690
+ interventions: interventions,
691
+ pay_to_address: pay_to_address,
692
+ synchronicity: synchronicity,
693
+ billable_status: billable_status,
694
+ responsible_party: responsible_party,
695
+ additional_information: additional_information,
696
+ service_authorization_exception_code: service_authorization_exception_code,
697
+ admission_date: admission_date,
698
+ discharge_date: discharge_date,
699
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
700
+ last_menstrual_period_date: last_menstrual_period_date,
701
+ delay_reason_code: delay_reason_code,
702
+ additional_properties: struct
703
+ )
399
704
  end
400
- synchronicity = struct.synchronicity
401
- billable_status = struct.billable_status
402
- responsible_party = struct.responsible_party
403
- additional_information = struct.additional_information
404
- service_authorization_exception_code = struct.service_authorization_exception_code
405
- admission_date = struct.admission_date
406
- discharge_date = struct.discharge_date
407
- onset_of_current_illness_or_symptom_date = struct.onset_of_current_illness_or_symptom_date
408
- last_menstrual_period_date = struct.last_menstrual_period_date
409
- delay_reason_code = struct.delay_reason_code
410
- new(patient_control_number: patient_control_number, date_of_service: date_of_service,
411
- end_date_of_service: end_date_of_service, encounter_id: encounter_id, claims: claims, patient: patient, guarantor: guarantor, billing_provider: billing_provider, rendering_provider: rendering_provider, referring_provider: referring_provider, service_facility: service_facility, subscriber_primary: subscriber_primary, subscriber_secondary: subscriber_secondary, url: url, diagnoses: diagnoses, clinical_notes: clinical_notes, billing_notes: billing_notes, place_of_service_code: place_of_service_code, place_of_service_code_as_submitted: place_of_service_code_as_submitted, patient_histories: patient_histories, patient_payments: patient_payments, tags: tags, coding_attribution: coding_attribution, work_queue_id: work_queue_id, work_queue_membership_activated_at: work_queue_membership_activated_at, owner_of_next_action: owner_of_next_action, submission_origin: submission_origin, external_id: external_id, prior_authorization_number: prior_authorization_number, patient_authorized_release: patient_authorized_release, benefits_assigned_to_provider: benefits_assigned_to_provider, provider_accepts_assignment: provider_accepts_assignment, appointment_type: appointment_type, existing_medications: existing_medications, vitals: vitals, interventions: interventions, pay_to_address: pay_to_address, synchronicity: synchronicity, billable_status: billable_status, responsible_party: responsible_party, additional_information: additional_information, service_authorization_exception_code: service_authorization_exception_code, admission_date: admission_date, discharge_date: discharge_date, onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date, last_menstrual_period_date: last_menstrual_period_date, delay_reason_code: delay_reason_code, additional_properties: struct)
412
- end
413
705
 
414
- # Serialize an instance of Encounter to a JSON object
415
- #
416
- # @return [JSON]
417
- def to_json(*_args)
418
- {
419
- "patient_control_number": @patient_control_number,
420
- "date_of_service": @date_of_service,
421
- "end_date_of_service": @end_date_of_service,
422
- "encounter_id": @encounter_id,
423
- "claims": @claims,
424
- "patient": @patient,
425
- "guarantor": @guarantor,
426
- "billing_provider": @billing_provider,
427
- "rendering_provider": @rendering_provider,
428
- "referring_provider": @referring_provider,
429
- "service_facility": @service_facility,
430
- "subscriber_primary": @subscriber_primary,
431
- "subscriber_secondary": @subscriber_secondary,
432
- "url": @url,
433
- "diagnoses": @diagnoses,
434
- "clinical_notes": @clinical_notes,
435
- "billing_notes": @billing_notes,
436
- "place_of_service_code": @place_of_service_code,
437
- "place_of_service_code_as_submitted": @place_of_service_code_as_submitted,
438
- "patient_histories": @patient_histories,
439
- "patient_payments": @patient_payments,
440
- "tags": @tags,
441
- "coding_attribution": @coding_attribution,
442
- "work_queue_id": @work_queue_id,
443
- "work_queue_membership_activated_at": @work_queue_membership_activated_at,
444
- "owner_of_next_action": @owner_of_next_action,
445
- "submission_origin": @submission_origin,
446
- "external_id": @external_id,
447
- "prior_authorization_number": @prior_authorization_number,
448
- "patient_authorized_release": @patient_authorized_release,
449
- "benefits_assigned_to_provider": @benefits_assigned_to_provider,
450
- "provider_accepts_assignment": @provider_accepts_assignment,
451
- "appointment_type": @appointment_type,
452
- "existing_medications": @existing_medications,
453
- "vitals": @vitals,
454
- "interventions": @interventions,
455
- "pay_to_address": @pay_to_address,
456
- "synchronicity": @synchronicity,
457
- "billable_status": @billable_status,
458
- "responsible_party": @responsible_party,
459
- "additional_information": @additional_information,
460
- "service_authorization_exception_code": @service_authorization_exception_code,
461
- "admission_date": @admission_date,
462
- "discharge_date": @discharge_date,
463
- "onset_of_current_illness_or_symptom_date": @onset_of_current_illness_or_symptom_date,
464
- "last_menstrual_period_date": @last_menstrual_period_date,
465
- "delay_reason_code": @delay_reason_code
466
- }.to_json
467
- end
706
+ # Serialize an instance of Encounter to a JSON object
707
+ #
708
+ # @return [String]
709
+ def to_json(*_args)
710
+ @_field_set&.to_json
711
+ end
468
712
 
469
- # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
470
- #
471
- # @param obj [Object]
472
- # @return [Void]
473
- def self.validate_raw(obj:)
474
- obj.patient_control_number&.is_a?(String) != false || raise("Passed value for field obj.patient_control_number is not the expected type, validation failed.")
475
- obj.date_of_service.is_a?(String) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
476
- obj.end_date_of_service&.is_a?(String) != false || raise("Passed value for field obj.end_date_of_service is not the expected type, validation failed.")
477
- obj.encounter_id.is_a?(UUID) != false || raise("Passed value for field obj.encounter_id is not the expected type, validation failed.")
478
- obj.claims.is_a?(Array) != false || raise("Passed value for field obj.claims is not the expected type, validation failed.")
479
- Individual::Patient.validate_raw(obj: obj.patient)
480
- obj.guarantor.nil? || Guarantor::V1::Guarantor.validate_raw(obj: obj.guarantor)
481
- EncounterProviders::V2::EncounterProvider.validate_raw(obj: obj.billing_provider)
482
- EncounterProviders::V2::EncounterProvider.validate_raw(obj: obj.rendering_provider)
483
- obj.referring_provider.nil? || EncounterProviders::V2::EncounterProvider.validate_raw(obj: obj.referring_provider)
484
- ServiceFacility::EncounterServiceFacility.validate_raw(obj: obj.service_facility)
485
- obj.subscriber_primary.nil? || Individual::Subscriber.validate_raw(obj: obj.subscriber_primary)
486
- obj.subscriber_secondary.nil? || Individual::Subscriber.validate_raw(obj: obj.subscriber_secondary)
487
- obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
488
- obj.diagnoses.is_a?(Array) != false || raise("Passed value for field obj.diagnoses is not the expected type, validation failed.")
489
- obj.clinical_notes.is_a?(Array) != false || raise("Passed value for field obj.clinical_notes is not the expected type, validation failed.")
490
- obj.billing_notes&.is_a?(Array) != false || raise("Passed value for field obj.billing_notes is not the expected type, validation failed.")
491
- obj.place_of_service_code&.is_a?(Commons::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code is not the expected type, validation failed.")
492
- obj.place_of_service_code_as_submitted&.is_a?(Commons::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code_as_submitted is not the expected type, validation failed.")
493
- obj.patient_histories.is_a?(Array) != false || raise("Passed value for field obj.patient_histories is not the expected type, validation failed.")
494
- obj.patient_payments.is_a?(Array) != false || raise("Passed value for field obj.patient_payments is not the expected type, validation failed.")
495
- obj.tags.is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.")
496
- obj.coding_attribution&.is_a?(Encounters::V4::CodingAttributionType) != false || raise("Passed value for field obj.coding_attribution is not the expected type, validation failed.")
497
- obj.work_queue_id&.is_a?(String) != false || raise("Passed value for field obj.work_queue_id is not the expected type, validation failed.")
498
- obj.work_queue_membership_activated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.work_queue_membership_activated_at is not the expected type, validation failed.")
499
- obj.owner_of_next_action.is_a?(Encounters::V4::EncounterOwnerOfNextActionType) != false || raise("Passed value for field obj.owner_of_next_action is not the expected type, validation failed.")
500
- obj.submission_origin.is_a?(Encounters::V4::EncounterSubmissionOriginType) != false || raise("Passed value for field obj.submission_origin is not the expected type, validation failed.")
501
- obj.external_id.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
502
- obj.prior_authorization_number&.is_a?(String) != false || raise("Passed value for field obj.prior_authorization_number is not the expected type, validation failed.")
503
- obj.patient_authorized_release.is_a?(Boolean) != false || raise("Passed value for field obj.patient_authorized_release is not the expected type, validation failed.")
504
- 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.")
505
- obj.provider_accepts_assignment.is_a?(Boolean) != false || raise("Passed value for field obj.provider_accepts_assignment is not the expected type, validation failed.")
506
- obj.appointment_type&.is_a?(String) != false || raise("Passed value for field obj.appointment_type is not the expected type, validation failed.")
507
- obj.existing_medications&.is_a?(Array) != false || raise("Passed value for field obj.existing_medications is not the expected type, validation failed.")
508
- obj.vitals.nil? || Encounters::V4::Vitals.validate_raw(obj: obj.vitals)
509
- obj.interventions&.is_a?(Array) != false || raise("Passed value for field obj.interventions is not the expected type, validation failed.")
510
- obj.pay_to_address.nil? || Commons::StreetAddressLongZip.validate_raw(obj: obj.pay_to_address)
511
- obj.synchronicity&.is_a?(Encounters::V4::SynchronicityType) != false || raise("Passed value for field obj.synchronicity is not the expected type, validation failed.")
512
- obj.billable_status.is_a?(Encounters::V4::BillableStatusType) != false || raise("Passed value for field obj.billable_status is not the expected type, validation failed.")
513
- obj.responsible_party.is_a?(Encounters::V4::ResponsiblePartyType) != false || raise("Passed value for field obj.responsible_party is not the expected type, validation failed.")
514
- obj.additional_information&.is_a?(String) != false || raise("Passed value for field obj.additional_information is not the expected type, validation failed.")
515
- obj.service_authorization_exception_code&.is_a?(Encounters::V4::ServiceAuthorizationExceptionCode) != false || raise("Passed value for field obj.service_authorization_exception_code is not the expected type, validation failed.")
516
- obj.admission_date&.is_a?(String) != false || raise("Passed value for field obj.admission_date is not the expected type, validation failed.")
517
- obj.discharge_date&.is_a?(String) != false || raise("Passed value for field obj.discharge_date is not the expected type, validation failed.")
518
- obj.onset_of_current_illness_or_symptom_date&.is_a?(String) != false || raise("Passed value for field obj.onset_of_current_illness_or_symptom_date is not the expected type, validation failed.")
519
- obj.last_menstrual_period_date&.is_a?(String) != false || raise("Passed value for field obj.last_menstrual_period_date is not the expected type, validation failed.")
520
- obj.delay_reason_code&.is_a?(Commons::DelayReasonCode) != false || raise("Passed value for field obj.delay_reason_code is not the expected type, validation failed.")
713
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
714
+ # hash and check each fields type against the current object's property
715
+ # definitions.
716
+ #
717
+ # @param obj [Object]
718
+ # @return [Void]
719
+ def self.validate_raw(obj:)
720
+ obj.patient_control_number&.is_a?(String) != false || raise("Passed value for field obj.patient_control_number is not the expected type, validation failed.")
721
+ obj.date_of_service.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
722
+ 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.")
723
+ obj.encounter_id.is_a?(String) != false || raise("Passed value for field obj.encounter_id is not the expected type, validation failed.")
724
+ obj.claims.is_a?(Array) != false || raise("Passed value for field obj.claims is not the expected type, validation failed.")
725
+ CandidApiClient::Individual::Types::Patient.validate_raw(obj: obj.patient)
726
+ obj.guarantor.nil? || CandidApiClient::Guarantor::V1::Types::Guarantor.validate_raw(obj: obj.guarantor)
727
+ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.billing_provider)
728
+ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.rendering_provider)
729
+ obj.referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.referring_provider)
730
+ obj.initial_referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.initial_referring_provider)
731
+ obj.supervising_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.supervising_provider)
732
+ obj.ordering_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.ordering_provider)
733
+ CandidApiClient::ServiceFacility::Types::EncounterServiceFacility.validate_raw(obj: obj.service_facility)
734
+ obj.subscriber_primary.nil? || CandidApiClient::Individual::Types::Subscriber.validate_raw(obj: obj.subscriber_primary)
735
+ obj.subscriber_secondary.nil? || CandidApiClient::Individual::Types::Subscriber.validate_raw(obj: obj.subscriber_secondary)
736
+ obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
737
+ obj.diagnoses.is_a?(Array) != false || raise("Passed value for field obj.diagnoses is not the expected type, validation failed.")
738
+ obj.clinical_notes.is_a?(Array) != false || raise("Passed value for field obj.clinical_notes is not the expected type, validation failed.")
739
+ obj.billing_notes&.is_a?(Array) != false || raise("Passed value for field obj.billing_notes is not the expected type, validation failed.")
740
+ 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.")
741
+ 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.")
742
+ obj.patient_histories.is_a?(Array) != false || raise("Passed value for field obj.patient_histories is not the expected type, validation failed.")
743
+ obj.patient_payments.is_a?(Array) != false || raise("Passed value for field obj.patient_payments is not the expected type, validation failed.")
744
+ obj.tags.is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.")
745
+ obj.coding_attribution&.is_a?(CandidApiClient::Encounters::V4::Types::CodingAttributionType) != false || raise("Passed value for field obj.coding_attribution is not the expected type, validation failed.")
746
+ obj.work_queue_id&.is_a?(String) != false || raise("Passed value for field obj.work_queue_id is not the expected type, validation failed.")
747
+ obj.work_queue_membership_activated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.work_queue_membership_activated_at is not the expected type, validation failed.")
748
+ obj.owner_of_next_action.is_a?(CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType) != false || raise("Passed value for field obj.owner_of_next_action is not the expected type, validation failed.")
749
+ obj.submission_origin.is_a?(CandidApiClient::Encounters::V4::Types::EncounterSubmissionOriginType) != false || raise("Passed value for field obj.submission_origin is not the expected type, validation failed.")
750
+ obj.external_id.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
751
+ obj.prior_authorization_number&.is_a?(String) != false || raise("Passed value for field obj.prior_authorization_number is not the expected type, validation failed.")
752
+ obj.patient_authorized_release.is_a?(Boolean) != false || raise("Passed value for field obj.patient_authorized_release is not the expected type, validation failed.")
753
+ 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.")
754
+ obj.provider_accepts_assignment.is_a?(Boolean) != false || raise("Passed value for field obj.provider_accepts_assignment is not the expected type, validation failed.")
755
+ obj.appointment_type&.is_a?(String) != false || raise("Passed value for field obj.appointment_type is not the expected type, validation failed.")
756
+ obj.existing_medications&.is_a?(Array) != false || raise("Passed value for field obj.existing_medications is not the expected type, validation failed.")
757
+ obj.vitals.nil? || CandidApiClient::Encounters::V4::Types::Vitals.validate_raw(obj: obj.vitals)
758
+ obj.interventions&.is_a?(Array) != false || raise("Passed value for field obj.interventions is not the expected type, validation failed.")
759
+ obj.pay_to_address.nil? || CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.pay_to_address)
760
+ obj.synchronicity&.is_a?(CandidApiClient::Encounters::V4::Types::SynchronicityType) != false || raise("Passed value for field obj.synchronicity is not the expected type, validation failed.")
761
+ 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.")
762
+ 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.")
763
+ obj.additional_information&.is_a?(String) != false || raise("Passed value for field obj.additional_information is not the expected type, validation failed.")
764
+ 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.")
765
+ obj.admission_date&.is_a?(Date) != false || raise("Passed value for field obj.admission_date is not the expected type, validation failed.")
766
+ obj.discharge_date&.is_a?(Date) != false || raise("Passed value for field obj.discharge_date is not the expected type, validation failed.")
767
+ 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.")
768
+ 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.")
769
+ 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.")
770
+ end
521
771
  end
522
772
  end
523
773
  end