candidhealth 0.21.0 → 0.24.1

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 +1021 -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 +719 -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 +182 -86
  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 +70 -47
  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 +9 -7
  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 +30 -53
  386. metadata +42 -55
  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,735 @@ 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::ServiceFacility::Types::EncounterServiceFacility] Encounter Service facility is typically the location a medical service was
86
+ # rendered, such as a provider office or hospital. For telehealth, service
87
+ # facility can represent the provider's location when the service was delivered
88
+ # (e.g., home), or the location where an in-person visit would have taken place,
89
+ # whichever is easier to identify. If the provider is in-network, service facility
90
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
91
+ # for an in-network claim to be successfully adjudicated, the service facility
92
+ # address listed on claims must match what was provided to the payer during the
93
+ # credentialing process.
94
+ attr_reader :service_facility
95
+ # @return [CandidApiClient::Individual::Types::Subscriber] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
96
+ # when the claim should be billed to insurance).
97
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the
98
+ # claim should be billed to the patient).
99
+ # However, if you collect this for patients, even self-pay, we recommend including
100
+ # it when sending encounters to Candid.
101
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
102
+ # to define self-pay claims.
103
+ attr_reader :subscriber_primary
104
+ # @return [CandidApiClient::Individual::Types::Subscriber] Contains details of the secondary insurance subscriber.
105
+ attr_reader :subscriber_secondary
106
+ # @return [String] URL that links directly to the claim created in Candid.
107
+ attr_reader :url
108
+ # @return [Array<CandidApiClient::Diagnoses::Types::Diagnosis>] Ideally, this field should contain no more than 12 diagnoses. However, more
109
+ # diagnoses may be submitted at this time, and coders will later prioritize the 12
110
+ # that will be submitted to the payor.
111
+ attr_reader :diagnoses
112
+ # @return [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during
113
+ # patient encounters.
114
+ attr_reader :clinical_notes
115
+ # @return [Array<CandidApiClient::BillingNotes::V2::Types::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
116
+ # used in the billing process.
117
+ attr_reader :billing_notes
118
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
119
+ # supported. 02 for telemedicine, 11 for in-person. Full list
120
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
121
+ attr_reader :place_of_service_code
122
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently
123
+ # supported. 02 for telemedicine, 11 for in-person. Full list
124
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
125
+ attr_reader :place_of_service_code_as_submitted
126
+ # @return [Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>]
127
+ attr_reader :patient_histories
128
+ # @return [Array<CandidApiClient::PatientPayments::V3::Types::PatientPayment>]
129
+ attr_reader :patient_payments
130
+ # @return [Array<CandidApiClient::Tags::Types::Tag>]
131
+ attr_reader :tags
132
+ # @return [CandidApiClient::Encounters::V4::Types::CodingAttributionType] The entity that performed the coding of medical services for the claim.
133
+ attr_reader :coding_attribution
134
+ # @return [String]
135
+ attr_reader :work_queue_id
136
+ # @return [DateTime]
137
+ attr_reader :work_queue_membership_activated_at
138
+ # @return [CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as
139
+ # defined by ownership of open Tasks.
140
+ attr_reader :owner_of_next_action
141
+ # @return [CandidApiClient::Encounters::V4::Types::EncounterSubmissionOriginType] The party who originally submitted the Claim.
142
+ # For Claims originating in Candid, this will be
143
+ # EncounterSubmissionOriginType.CANDID.
144
+ # For Encounters created with an external_claim_submission object, this will be
145
+ # EncounterSubmissionOriginType.EXTERNAL.
146
+ attr_reader :submission_origin
147
+ # @return [String] A client-specified unique ID to associate with this encounter;
148
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
149
+ # This field should not contain PHI.
150
+ attr_reader :external_id
151
+ # @return [String] Box 23 on the CMS-1500 claim form.
152
+ attr_reader :prior_authorization_number
153
+ # @return [Boolean] Whether this patient has authorized the release of medical information
154
+ # for billing purpose.
155
+ # Box 12 on the CMS-1500 claim form.
156
+ attr_reader :patient_authorized_release
157
+ # @return [Boolean] Whether this patient has authorized insurance payments to be made to you,
158
+ # not them. If false, patient may receive reimbursement.
159
+ # Box 13 on the CMS-1500 claim form.
160
+ attr_reader :benefits_assigned_to_provider
161
+ # @return [Boolean] Whether you have accepted the patient's authorization for insurance payments
162
+ # to be made to you, not them.
163
+ # Box 27 on the CMS-1500 claim form.
164
+ attr_reader :provider_accepts_assignment
165
+ # @return [String] Human-readable description of the appointment type (ex: "Acupuncture -
166
+ # Headaches").
167
+ attr_reader :appointment_type
168
+ # @return [Array<CandidApiClient::Encounters::V4::Types::Medication>]
169
+ attr_reader :existing_medications
170
+ # @return [CandidApiClient::Encounters::V4::Types::Vitals]
171
+ attr_reader :vitals
172
+ # @return [Array<CandidApiClient::Encounters::V4::Types::Intervention>]
173
+ attr_reader :interventions
174
+ # @return [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
175
+ attr_reader :pay_to_address
176
+ # @return [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
177
+ # Asynchronous encounters occur when providers and patients communicate online
178
+ # using
179
+ # forms, instant messaging, or other pre-recorded digital mediums.
180
+ # Synchronous encounters occur in live, real-time settings where the patient
181
+ # interacts
182
+ # directly with the provider, such as over video or a phone call.
183
+ attr_reader :synchronicity
184
+ # @return [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
185
+ # Examples for when this should be set to NOT_BILLABLE include
186
+ # if the Encounter has not occurred yet or if there is no intention of ever
187
+ # billing the responsible_party.
188
+ attr_reader :billable_status
189
+ # @return [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
190
+ attr_reader :responsible_party
191
+ # @return [String] Defines additional information on the claim needed by the payer.
192
+ # Box 19 on the CMS-1500 claim form.
193
+ attr_reader :additional_information
194
+ # @return [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
195
+ # Required when mandated by government law or regulation to obtain authorization
196
+ # for specific service(s) but, for the
197
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
198
+ # the service was performed without
199
+ # obtaining the authorization.
200
+ attr_reader :service_authorization_exception_code
201
+ # @return [Date] 837p Loop2300 DTP\*435, CMS-1500 Box 18
202
+ # Required on all ambulance claims when the patient was known to be admitted to
203
+ # the hospital.
204
+ # OR
205
+ # Required on all claims involving inpatient medical visits.
206
+ attr_reader :admission_date
207
+ # @return [Date] 837p Loop2300 DTP\*096, CMS-1500 Box 18
208
+ # Required for inpatient claims when the patient was discharged from the facility
209
+ # and the discharge date is known.
210
+ attr_reader :discharge_date
211
+ # @return [Date] 837p Loop2300 DTP\*431, CMS-1500 Box 14
212
+ # Required for the initial medical service or visit performed in response to a
213
+ # medical emergency when the date is available and is different than the date of
214
+ # service.
215
+ # OR
216
+ # This date is the onset of acute symptoms for the current illness or condition.
217
+ attr_reader :onset_of_current_illness_or_symptom_date
218
+ # @return [Date] 837p Loop2300 DTP\*484, CMS-1500 Box 14
219
+ # Required when, in the judgment of the provider, the services on this claim are
220
+ # related to the patient's pregnancy.
221
+ attr_reader :last_menstrual_period_date
222
+ # @return [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
223
+ # Code indicating the reason why a request was delayed
224
+ attr_reader :delay_reason_code
225
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
226
+ attr_reader :additional_properties
227
+ # @return [Object]
228
+ attr_reader :_field_set
229
+ protected :_field_set
43
230
 
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
231
+ OMIT = Object.new
276
232
 
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)
233
+ # @param patient_control_number [String] A patient control number (PCN) is a unique identifier assigned to a patient
234
+ # within a healthcare system or facility.
235
+ # It's used to track and manage a patient's medical records, treatments, and other
236
+ # healthcare-related information.
237
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
238
+ # This date must be the local date in the timezone where the service occurred.
239
+ # Box 24a on the CMS-1500 claim form.
240
+ # If service occurred over a range of dates, this should be the start date.
241
+ # date_of_service must be defined on either the encounter or the service lines but
242
+ # not both.
243
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
244
+ # This date must be the local date in the timezone where the service occurred.
245
+ # If omitted, the Encounter is assumed to be for a single day.
246
+ # Must not be temporally before the date_of_service field.
247
+ # @param encounter_id [String]
248
+ # @param claims [Array<CandidApiClient::Claims::Types::Claim>]
249
+ # @param patient [CandidApiClient::Individual::Types::Patient] Contains the identification information of the individual receiving medical
250
+ # services.
251
+ # @param guarantor [CandidApiClient::Guarantor::V1::Types::Guarantor] Personal and contact info for the guarantor of the patient responsibility.
252
+ # @param billing_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider] The billing provider is the provider or business entity submitting the claim.
253
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
254
+ # rendering provider. From a payer's perspective, this represents the person or
255
+ # entity being reimbursed. When a contract exists with the target payer, the
256
+ # billing provider should be the entity contracted with the payer. In some
257
+ # circumstances, this will be an individual provider. In that case, submit that
258
+ # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
259
+ # contracting. In other cases, the billing entity will be a medical group. If so,
260
+ # submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.
261
+ # @param rendering_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider] The rendering provider is the practitioner -- physician, nurse practitioner,
262
+ # etc. -- performing the service.
263
+ # For telehealth services, the rendering provider performs the visit, asynchronous
264
+ # communication, or other service. The rendering provider address should generally
265
+ # be the same as the service facility address.
266
+ # @param referring_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
267
+ # @param initial_referring_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
268
+ # @param supervising_provider [CandidApiClient::EncounterProviders::V2::Types::EncounterProvider]
269
+ # @param service_facility [CandidApiClient::ServiceFacility::Types::EncounterServiceFacility] Encounter Service facility is typically the location a medical service was
270
+ # rendered, such as a provider office or hospital. For telehealth, service
271
+ # facility can represent the provider's location when the service was delivered
272
+ # (e.g., home), or the location where an in-person visit would have taken place,
273
+ # whichever is easier to identify. If the provider is in-network, service facility
274
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
275
+ # for an in-network claim to be successfully adjudicated, the service facility
276
+ # address listed on claims must match what was provided to the payer during the
277
+ # credentialing process.
278
+ # @param subscriber_primary [CandidApiClient::Individual::Types::Subscriber] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
279
+ # when the claim should be billed to insurance).
280
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the
281
+ # claim should be billed to the patient).
282
+ # However, if you collect this for patients, even self-pay, we recommend including
283
+ # it when sending encounters to Candid.
284
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
285
+ # to define self-pay claims.
286
+ # @param subscriber_secondary [CandidApiClient::Individual::Types::Subscriber] Contains details of the secondary insurance subscriber.
287
+ # @param url [String] URL that links directly to the claim created in Candid.
288
+ # @param diagnoses [Array<CandidApiClient::Diagnoses::Types::Diagnosis>] Ideally, this field should contain no more than 12 diagnoses. However, more
289
+ # diagnoses may be submitted at this time, and coders will later prioritize the 12
290
+ # that will be submitted to the payor.
291
+ # @param clinical_notes [Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during
292
+ # patient encounters.
293
+ # @param billing_notes [Array<CandidApiClient::BillingNotes::V2::Types::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
294
+ # used in the billing process.
295
+ # @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
296
+ # supported. 02 for telemedicine, 11 for in-person. Full list
297
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
298
+ # @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
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 patient_histories [Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>]
302
+ # @param patient_payments [Array<CandidApiClient::PatientPayments::V3::Types::PatientPayment>]
303
+ # @param tags [Array<CandidApiClient::Tags::Types::Tag>]
304
+ # @param coding_attribution [CandidApiClient::Encounters::V4::Types::CodingAttributionType] The entity that performed the coding of medical services for the claim.
305
+ # @param work_queue_id [String]
306
+ # @param work_queue_membership_activated_at [DateTime]
307
+ # @param owner_of_next_action [CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as
308
+ # defined by ownership of open Tasks.
309
+ # @param submission_origin [CandidApiClient::Encounters::V4::Types::EncounterSubmissionOriginType] The party who originally submitted the Claim.
310
+ # For Claims originating in Candid, this will be
311
+ # EncounterSubmissionOriginType.CANDID.
312
+ # For Encounters created with an external_claim_submission object, this will be
313
+ # EncounterSubmissionOriginType.EXTERNAL.
314
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
315
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
316
+ # This field should not contain PHI.
317
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
318
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
319
+ # for billing purpose.
320
+ # Box 12 on the CMS-1500 claim form.
321
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
322
+ # not them. If false, patient may receive reimbursement.
323
+ # Box 13 on the CMS-1500 claim form.
324
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
325
+ # to be made to you, not them.
326
+ # Box 27 on the CMS-1500 claim form.
327
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
328
+ # Headaches").
329
+ # @param existing_medications [Array<CandidApiClient::Encounters::V4::Types::Medication>]
330
+ # @param vitals [CandidApiClient::Encounters::V4::Types::Vitals]
331
+ # @param interventions [Array<CandidApiClient::Encounters::V4::Types::Intervention>]
332
+ # @param pay_to_address [CandidApiClient::Commons::Types::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
333
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
334
+ # Asynchronous encounters occur when providers and patients communicate online
335
+ # using
336
+ # forms, instant messaging, or other pre-recorded digital mediums.
337
+ # Synchronous encounters occur in live, real-time settings where the patient
338
+ # interacts
339
+ # directly with the provider, such as over video or a phone call.
340
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
341
+ # Examples for when this should be set to NOT_BILLABLE include
342
+ # if the Encounter has not occurred yet or if there is no intention of ever
343
+ # billing the responsible_party.
344
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
345
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
346
+ # Box 19 on the CMS-1500 claim form.
347
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
348
+ # Required when mandated by government law or regulation to obtain authorization
349
+ # for specific service(s) but, for the
350
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
351
+ # the service was performed without
352
+ # obtaining the authorization.
353
+ # @param admission_date [Date] 837p Loop2300 DTP\*435, CMS-1500 Box 18
354
+ # Required on all ambulance claims when the patient was known to be admitted to
355
+ # the hospital.
356
+ # OR
357
+ # Required on all claims involving inpatient medical visits.
358
+ # @param discharge_date [Date] 837p Loop2300 DTP\*096, CMS-1500 Box 18
359
+ # Required for inpatient claims when the patient was discharged from the facility
360
+ # and the discharge date is known.
361
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP\*431, CMS-1500 Box 14
362
+ # Required for the initial medical service or visit performed in response to a
363
+ # medical emergency when the date is available and is different than the date of
364
+ # service.
365
+ # OR
366
+ # This date is the onset of acute symptoms for the current illness or condition.
367
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP\*484, CMS-1500 Box 14
368
+ # Required when, in the judgment of the provider, the services on this claim are
369
+ # related to the patient's pregnancy.
370
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
371
+ # Code indicating the reason why a request was delayed
372
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
373
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
374
+ def initialize(date_of_service:, encounter_id:, claims:, patient:, billing_provider:, rendering_provider:,
375
+ 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, 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)
376
+ @patient_control_number = patient_control_number if patient_control_number != OMIT
377
+ @date_of_service = date_of_service
378
+ @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
379
+ @encounter_id = encounter_id
380
+ @claims = claims
381
+ @patient = patient
382
+ @guarantor = guarantor if guarantor != OMIT
383
+ @billing_provider = billing_provider
384
+ @rendering_provider = rendering_provider
385
+ @referring_provider = referring_provider if referring_provider != OMIT
386
+ @initial_referring_provider = initial_referring_provider if initial_referring_provider != OMIT
387
+ @supervising_provider = supervising_provider if supervising_provider != OMIT
388
+ @service_facility = service_facility
389
+ @subscriber_primary = subscriber_primary if subscriber_primary != OMIT
390
+ @subscriber_secondary = subscriber_secondary if subscriber_secondary != OMIT
391
+ @url = url
392
+ @diagnoses = diagnoses
393
+ @clinical_notes = clinical_notes
394
+ @billing_notes = billing_notes if billing_notes != OMIT
395
+ @place_of_service_code = place_of_service_code if place_of_service_code != OMIT
396
+ if place_of_service_code_as_submitted != OMIT
397
+ @place_of_service_code_as_submitted = place_of_service_code_as_submitted
398
+ end
399
+ @patient_histories = patient_histories
400
+ @patient_payments = patient_payments
401
+ @tags = tags
402
+ @coding_attribution = coding_attribution if coding_attribution != OMIT
403
+ @work_queue_id = work_queue_id if work_queue_id != OMIT
404
+ if work_queue_membership_activated_at != OMIT
405
+ @work_queue_membership_activated_at = work_queue_membership_activated_at
406
+ end
407
+ @owner_of_next_action = owner_of_next_action
408
+ @submission_origin = submission_origin
409
+ @external_id = external_id
410
+ @prior_authorization_number = prior_authorization_number if prior_authorization_number != OMIT
411
+ @patient_authorized_release = patient_authorized_release
412
+ @benefits_assigned_to_provider = benefits_assigned_to_provider
413
+ @provider_accepts_assignment = provider_accepts_assignment
414
+ @appointment_type = appointment_type if appointment_type != OMIT
415
+ @existing_medications = existing_medications if existing_medications != OMIT
416
+ @vitals = vitals if vitals != OMIT
417
+ @interventions = interventions if interventions != OMIT
418
+ @pay_to_address = pay_to_address if pay_to_address != OMIT
419
+ @synchronicity = synchronicity if synchronicity != OMIT
420
+ @billable_status = billable_status
421
+ @responsible_party = responsible_party
422
+ @additional_information = additional_information if additional_information != OMIT
423
+ if service_authorization_exception_code != OMIT
424
+ @service_authorization_exception_code = service_authorization_exception_code
425
+ end
426
+ @admission_date = admission_date if admission_date != OMIT
427
+ @discharge_date = discharge_date if discharge_date != OMIT
428
+ if onset_of_current_illness_or_symptom_date != OMIT
429
+ @onset_of_current_illness_or_symptom_date = onset_of_current_illness_or_symptom_date
430
+ end
431
+ @last_menstrual_period_date = last_menstrual_period_date if last_menstrual_period_date != OMIT
432
+ @delay_reason_code = delay_reason_code if delay_reason_code != OMIT
433
+ @additional_properties = additional_properties
434
+ @_field_set = {
435
+ "patient_control_number": patient_control_number,
436
+ "date_of_service": date_of_service,
437
+ "end_date_of_service": end_date_of_service,
438
+ "encounter_id": encounter_id,
439
+ "claims": claims,
440
+ "patient": patient,
441
+ "guarantor": guarantor,
442
+ "billing_provider": billing_provider,
443
+ "rendering_provider": rendering_provider,
444
+ "referring_provider": referring_provider,
445
+ "initial_referring_provider": initial_referring_provider,
446
+ "supervising_provider": supervising_provider,
447
+ "service_facility": service_facility,
448
+ "subscriber_primary": subscriber_primary,
449
+ "subscriber_secondary": subscriber_secondary,
450
+ "url": url,
451
+ "diagnoses": diagnoses,
452
+ "clinical_notes": clinical_notes,
453
+ "billing_notes": billing_notes,
454
+ "place_of_service_code": place_of_service_code,
455
+ "place_of_service_code_as_submitted": place_of_service_code_as_submitted,
456
+ "patient_histories": patient_histories,
457
+ "patient_payments": patient_payments,
458
+ "tags": tags,
459
+ "coding_attribution": coding_attribution,
460
+ "work_queue_id": work_queue_id,
461
+ "work_queue_membership_activated_at": work_queue_membership_activated_at,
462
+ "owner_of_next_action": owner_of_next_action,
463
+ "submission_origin": submission_origin,
464
+ "external_id": external_id,
465
+ "prior_authorization_number": prior_authorization_number,
466
+ "patient_authorized_release": patient_authorized_release,
467
+ "benefits_assigned_to_provider": benefits_assigned_to_provider,
468
+ "provider_accepts_assignment": provider_accepts_assignment,
469
+ "appointment_type": appointment_type,
470
+ "existing_medications": existing_medications,
471
+ "vitals": vitals,
472
+ "interventions": interventions,
473
+ "pay_to_address": pay_to_address,
474
+ "synchronicity": synchronicity,
475
+ "billable_status": billable_status,
476
+ "responsible_party": responsible_party,
477
+ "additional_information": additional_information,
478
+ "service_authorization_exception_code": service_authorization_exception_code,
479
+ "admission_date": admission_date,
480
+ "discharge_date": discharge_date,
481
+ "onset_of_current_illness_or_symptom_date": onset_of_current_illness_or_symptom_date,
482
+ "last_menstrual_period_date": last_menstrual_period_date,
483
+ "delay_reason_code": delay_reason_code
484
+ }.reject do |_k, v|
485
+ v == OMIT
486
+ end
348
487
  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)
488
+
489
+ # Deserialize a JSON object to an instance of Encounter
490
+ #
491
+ # @param json_object [String]
492
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
493
+ def self.from_json(json_object:)
494
+ struct = JSON.parse(json_object, object_class: OpenStruct)
495
+ parsed_json = JSON.parse(json_object)
496
+ patient_control_number = struct["patient_control_number"]
497
+ date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
498
+ end_date_of_service = unless parsed_json["end_date_of_service"].nil?
499
+ Date.parse(parsed_json["end_date_of_service"])
500
+ end
501
+ encounter_id = struct["encounter_id"]
502
+ claims = parsed_json["claims"]&.map do |item|
503
+ item = item.to_json
504
+ CandidApiClient::Claims::Types::Claim.from_json(json_object: item)
505
+ end
506
+ if parsed_json["patient"].nil?
507
+ patient = nil
508
+ else
509
+ patient = parsed_json["patient"].to_json
510
+ patient = CandidApiClient::Individual::Types::Patient.from_json(json_object: patient)
511
+ end
512
+ if parsed_json["guarantor"].nil?
513
+ guarantor = nil
514
+ else
515
+ guarantor = parsed_json["guarantor"].to_json
516
+ guarantor = CandidApiClient::Guarantor::V1::Types::Guarantor.from_json(json_object: guarantor)
517
+ end
518
+ if parsed_json["billing_provider"].nil?
519
+ billing_provider = nil
520
+ else
521
+ billing_provider = parsed_json["billing_provider"].to_json
522
+ billing_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: billing_provider)
523
+ end
524
+ if parsed_json["rendering_provider"].nil?
525
+ rendering_provider = nil
526
+ else
527
+ rendering_provider = parsed_json["rendering_provider"].to_json
528
+ rendering_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: rendering_provider)
529
+ end
530
+ if parsed_json["referring_provider"].nil?
531
+ referring_provider = nil
532
+ else
533
+ referring_provider = parsed_json["referring_provider"].to_json
534
+ referring_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: referring_provider)
535
+ end
536
+ if parsed_json["initial_referring_provider"].nil?
537
+ initial_referring_provider = nil
538
+ else
539
+ initial_referring_provider = parsed_json["initial_referring_provider"].to_json
540
+ initial_referring_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: initial_referring_provider)
541
+ end
542
+ if parsed_json["supervising_provider"].nil?
543
+ supervising_provider = nil
544
+ else
545
+ supervising_provider = parsed_json["supervising_provider"].to_json
546
+ supervising_provider = CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.from_json(json_object: supervising_provider)
547
+ end
548
+ if parsed_json["service_facility"].nil?
549
+ service_facility = nil
550
+ else
551
+ service_facility = parsed_json["service_facility"].to_json
552
+ service_facility = CandidApiClient::ServiceFacility::Types::EncounterServiceFacility.from_json(json_object: service_facility)
553
+ end
554
+ if parsed_json["subscriber_primary"].nil?
555
+ subscriber_primary = nil
556
+ else
557
+ subscriber_primary = parsed_json["subscriber_primary"].to_json
558
+ subscriber_primary = CandidApiClient::Individual::Types::Subscriber.from_json(json_object: subscriber_primary)
559
+ end
560
+ if parsed_json["subscriber_secondary"].nil?
561
+ subscriber_secondary = nil
562
+ else
563
+ subscriber_secondary = parsed_json["subscriber_secondary"].to_json
564
+ subscriber_secondary = CandidApiClient::Individual::Types::Subscriber.from_json(json_object: subscriber_secondary)
565
+ end
566
+ url = struct["url"]
567
+ diagnoses = parsed_json["diagnoses"]&.map do |item|
568
+ item = item.to_json
569
+ CandidApiClient::Diagnoses::Types::Diagnosis.from_json(json_object: item)
570
+ end
571
+ clinical_notes = parsed_json["clinical_notes"]&.map do |item|
572
+ item = item.to_json
573
+ CandidApiClient::Encounters::V4::Types::ClinicalNoteCategory.from_json(json_object: item)
574
+ end
575
+ billing_notes = parsed_json["billing_notes"]&.map do |item|
576
+ item = item.to_json
577
+ CandidApiClient::BillingNotes::V2::Types::BillingNote.from_json(json_object: item)
578
+ end
579
+ place_of_service_code = struct["place_of_service_code"]
580
+ place_of_service_code_as_submitted = struct["place_of_service_code_as_submitted"]
581
+ patient_histories = parsed_json["patient_histories"]&.map do |item|
582
+ item = item.to_json
583
+ CandidApiClient::Encounters::V4::Types::PatientHistoryCategory.from_json(json_object: item)
584
+ end
585
+ patient_payments = parsed_json["patient_payments"]&.map do |item|
586
+ item = item.to_json
587
+ CandidApiClient::PatientPayments::V3::Types::PatientPayment.from_json(json_object: item)
588
+ end
589
+ tags = parsed_json["tags"]&.map do |item|
590
+ item = item.to_json
591
+ CandidApiClient::Tags::Types::Tag.from_json(json_object: item)
592
+ end
593
+ coding_attribution = struct["coding_attribution"]
594
+ work_queue_id = struct["work_queue_id"]
595
+ work_queue_membership_activated_at = unless parsed_json["work_queue_membership_activated_at"].nil?
596
+ DateTime.parse(parsed_json["work_queue_membership_activated_at"])
597
+ end
598
+ owner_of_next_action = struct["owner_of_next_action"]
599
+ submission_origin = struct["submission_origin"]
600
+ external_id = struct["external_id"]
601
+ prior_authorization_number = struct["prior_authorization_number"]
602
+ patient_authorized_release = struct["patient_authorized_release"]
603
+ benefits_assigned_to_provider = struct["benefits_assigned_to_provider"]
604
+ provider_accepts_assignment = struct["provider_accepts_assignment"]
605
+ appointment_type = struct["appointment_type"]
606
+ existing_medications = parsed_json["existing_medications"]&.map do |item|
607
+ item = item.to_json
608
+ CandidApiClient::Encounters::V4::Types::Medication.from_json(json_object: item)
609
+ end
610
+ if parsed_json["vitals"].nil?
611
+ vitals = nil
612
+ else
613
+ vitals = parsed_json["vitals"].to_json
614
+ vitals = CandidApiClient::Encounters::V4::Types::Vitals.from_json(json_object: vitals)
615
+ end
616
+ interventions = parsed_json["interventions"]&.map do |item|
617
+ item = item.to_json
618
+ CandidApiClient::Encounters::V4::Types::Intervention.from_json(json_object: item)
619
+ end
620
+ if parsed_json["pay_to_address"].nil?
621
+ pay_to_address = nil
622
+ else
623
+ pay_to_address = parsed_json["pay_to_address"].to_json
624
+ pay_to_address = CandidApiClient::Commons::Types::StreetAddressLongZip.from_json(json_object: pay_to_address)
625
+ end
626
+ synchronicity = struct["synchronicity"]
627
+ billable_status = struct["billable_status"]
628
+ responsible_party = struct["responsible_party"]
629
+ additional_information = struct["additional_information"]
630
+ service_authorization_exception_code = struct["service_authorization_exception_code"]
631
+ admission_date = (Date.parse(parsed_json["admission_date"]) unless parsed_json["admission_date"].nil?)
632
+ discharge_date = (Date.parse(parsed_json["discharge_date"]) unless parsed_json["discharge_date"].nil?)
633
+ onset_of_current_illness_or_symptom_date = unless parsed_json["onset_of_current_illness_or_symptom_date"].nil?
634
+ Date.parse(parsed_json["onset_of_current_illness_or_symptom_date"])
635
+ end
636
+ last_menstrual_period_date = unless parsed_json["last_menstrual_period_date"].nil?
637
+ Date.parse(parsed_json["last_menstrual_period_date"])
638
+ end
639
+ delay_reason_code = struct["delay_reason_code"]
640
+ new(
641
+ patient_control_number: patient_control_number,
642
+ date_of_service: date_of_service,
643
+ end_date_of_service: end_date_of_service,
644
+ encounter_id: encounter_id,
645
+ claims: claims,
646
+ patient: patient,
647
+ guarantor: guarantor,
648
+ billing_provider: billing_provider,
649
+ rendering_provider: rendering_provider,
650
+ referring_provider: referring_provider,
651
+ initial_referring_provider: initial_referring_provider,
652
+ supervising_provider: supervising_provider,
653
+ service_facility: service_facility,
654
+ subscriber_primary: subscriber_primary,
655
+ subscriber_secondary: subscriber_secondary,
656
+ url: url,
657
+ diagnoses: diagnoses,
658
+ clinical_notes: clinical_notes,
659
+ billing_notes: billing_notes,
660
+ place_of_service_code: place_of_service_code,
661
+ place_of_service_code_as_submitted: place_of_service_code_as_submitted,
662
+ patient_histories: patient_histories,
663
+ patient_payments: patient_payments,
664
+ tags: tags,
665
+ coding_attribution: coding_attribution,
666
+ work_queue_id: work_queue_id,
667
+ work_queue_membership_activated_at: work_queue_membership_activated_at,
668
+ owner_of_next_action: owner_of_next_action,
669
+ submission_origin: submission_origin,
670
+ external_id: external_id,
671
+ prior_authorization_number: prior_authorization_number,
672
+ patient_authorized_release: patient_authorized_release,
673
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
674
+ provider_accepts_assignment: provider_accepts_assignment,
675
+ appointment_type: appointment_type,
676
+ existing_medications: existing_medications,
677
+ vitals: vitals,
678
+ interventions: interventions,
679
+ pay_to_address: pay_to_address,
680
+ synchronicity: synchronicity,
681
+ billable_status: billable_status,
682
+ responsible_party: responsible_party,
683
+ additional_information: additional_information,
684
+ service_authorization_exception_code: service_authorization_exception_code,
685
+ admission_date: admission_date,
686
+ discharge_date: discharge_date,
687
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
688
+ last_menstrual_period_date: last_menstrual_period_date,
689
+ delay_reason_code: delay_reason_code,
690
+ additional_properties: struct
691
+ )
399
692
  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
693
 
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
694
+ # Serialize an instance of Encounter to a JSON object
695
+ #
696
+ # @return [String]
697
+ def to_json(*_args)
698
+ @_field_set&.to_json
699
+ end
468
700
 
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.")
701
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
702
+ # hash and check each fields type against the current object's property
703
+ # definitions.
704
+ #
705
+ # @param obj [Object]
706
+ # @return [Void]
707
+ def self.validate_raw(obj:)
708
+ obj.patient_control_number&.is_a?(String) != false || raise("Passed value for field obj.patient_control_number is not the expected type, validation failed.")
709
+ obj.date_of_service.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
710
+ 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.")
711
+ obj.encounter_id.is_a?(String) != false || raise("Passed value for field obj.encounter_id is not the expected type, validation failed.")
712
+ obj.claims.is_a?(Array) != false || raise("Passed value for field obj.claims is not the expected type, validation failed.")
713
+ CandidApiClient::Individual::Types::Patient.validate_raw(obj: obj.patient)
714
+ obj.guarantor.nil? || CandidApiClient::Guarantor::V1::Types::Guarantor.validate_raw(obj: obj.guarantor)
715
+ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.billing_provider)
716
+ CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.rendering_provider)
717
+ obj.referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.referring_provider)
718
+ obj.initial_referring_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.initial_referring_provider)
719
+ obj.supervising_provider.nil? || CandidApiClient::EncounterProviders::V2::Types::EncounterProvider.validate_raw(obj: obj.supervising_provider)
720
+ CandidApiClient::ServiceFacility::Types::EncounterServiceFacility.validate_raw(obj: obj.service_facility)
721
+ obj.subscriber_primary.nil? || CandidApiClient::Individual::Types::Subscriber.validate_raw(obj: obj.subscriber_primary)
722
+ obj.subscriber_secondary.nil? || CandidApiClient::Individual::Types::Subscriber.validate_raw(obj: obj.subscriber_secondary)
723
+ obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
724
+ obj.diagnoses.is_a?(Array) != false || raise("Passed value for field obj.diagnoses is not the expected type, validation failed.")
725
+ obj.clinical_notes.is_a?(Array) != false || raise("Passed value for field obj.clinical_notes is not the expected type, validation failed.")
726
+ obj.billing_notes&.is_a?(Array) != false || raise("Passed value for field obj.billing_notes is not the expected type, validation failed.")
727
+ 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.")
728
+ 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.")
729
+ obj.patient_histories.is_a?(Array) != false || raise("Passed value for field obj.patient_histories is not the expected type, validation failed.")
730
+ obj.patient_payments.is_a?(Array) != false || raise("Passed value for field obj.patient_payments is not the expected type, validation failed.")
731
+ obj.tags.is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.")
732
+ 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.")
733
+ obj.work_queue_id&.is_a?(String) != false || raise("Passed value for field obj.work_queue_id is not the expected type, validation failed.")
734
+ 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.")
735
+ 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.")
736
+ 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.")
737
+ obj.external_id.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
738
+ obj.prior_authorization_number&.is_a?(String) != false || raise("Passed value for field obj.prior_authorization_number is not the expected type, validation failed.")
739
+ obj.patient_authorized_release.is_a?(Boolean) != false || raise("Passed value for field obj.patient_authorized_release is not the expected type, validation failed.")
740
+ 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.")
741
+ obj.provider_accepts_assignment.is_a?(Boolean) != false || raise("Passed value for field obj.provider_accepts_assignment is not the expected type, validation failed.")
742
+ obj.appointment_type&.is_a?(String) != false || raise("Passed value for field obj.appointment_type is not the expected type, validation failed.")
743
+ obj.existing_medications&.is_a?(Array) != false || raise("Passed value for field obj.existing_medications is not the expected type, validation failed.")
744
+ obj.vitals.nil? || CandidApiClient::Encounters::V4::Types::Vitals.validate_raw(obj: obj.vitals)
745
+ obj.interventions&.is_a?(Array) != false || raise("Passed value for field obj.interventions is not the expected type, validation failed.")
746
+ obj.pay_to_address.nil? || CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.pay_to_address)
747
+ obj.synchronicity&.is_a?(CandidApiClient::Encounters::V4::Types::SynchronicityType) != false || raise("Passed value for field obj.synchronicity is not the expected type, validation failed.")
748
+ 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.")
749
+ 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.")
750
+ obj.additional_information&.is_a?(String) != false || raise("Passed value for field obj.additional_information is not the expected type, validation failed.")
751
+ 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.")
752
+ obj.admission_date&.is_a?(Date) != false || raise("Passed value for field obj.admission_date is not the expected type, validation failed.")
753
+ obj.discharge_date&.is_a?(Date) != false || raise("Passed value for field obj.discharge_date is not the expected type, validation failed.")
754
+ 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.")
755
+ 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.")
756
+ 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.")
757
+ end
521
758
  end
522
759
  end
523
760
  end