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
@@ -3,19 +3,12 @@
3
3
  require_relative "../../../requests"
4
4
  require_relative "../../claims/types/claim_status"
5
5
  require_relative "types/encounter_sort_options"
6
- require_relative "../../commons/types/page_token"
7
- require_relative "../../commons/types/date"
8
- require_relative "../../commons/types/encounter_external_id"
9
6
  require "date"
10
- require_relative "../../tags/types/tag_id"
11
- require_relative "../../commons/types/work_queue_id"
12
7
  require_relative "types/billable_status_type"
13
8
  require_relative "types/responsible_party_type"
14
9
  require_relative "types/encounter_owner_of_next_action_type"
15
10
  require_relative "types/encounter_page"
16
- require_relative "../../commons/types/encounter_id"
17
11
  require_relative "types/encounter"
18
- require_relative "types/prior_authorization_number"
19
12
  require_relative "types/medication"
20
13
  require_relative "types/vitals"
21
14
  require_relative "types/intervention"
@@ -23,10 +16,13 @@ require_relative "../../commons/types/street_address_long_zip"
23
16
  require_relative "types/synchronicity_type"
24
17
  require_relative "types/service_authorization_exception_code"
25
18
  require_relative "../../commons/types/delay_reason_code"
19
+ require "ostruct"
26
20
  require_relative "../../individual/types/patient_create"
27
21
  require_relative "../../encounter_providers/v_2/types/billing_provider"
28
22
  require_relative "../../encounter_providers/v_2/types/rendering_provider"
29
23
  require_relative "../../encounter_providers/v_2/types/referring_provider"
24
+ require_relative "../../encounter_providers/v_2/types/initial_referring_provider"
25
+ require_relative "../../encounter_providers/v_2/types/supervising_provider"
30
26
  require_relative "../../service_facility/types/encounter_service_facility_base"
31
27
  require_relative "../../individual/types/subscriber_create"
32
28
  require_relative "../../diagnoses/types/diagnosis_create"
@@ -37,48 +33,72 @@ require_relative "types/patient_history_category"
37
33
  require_relative "../../service_lines/v_2/types/service_line_create"
38
34
  require_relative "../../guarantor/v_1/types/guarantor_create"
39
35
  require_relative "../../claim_submission/v_1/types/external_claim_submission_create"
40
- require_relative "../../diagnoses/types/diagnosis_id"
41
36
  require "async"
42
37
 
43
38
  module CandidApiClient
44
39
  module Encounters
45
40
  module V4
46
41
  class V4Client
42
+ # @return [CandidApiClient::RequestClient]
47
43
  attr_reader :request_client
48
44
 
49
- # @param request_client [RequestClient]
50
- # @return [Encounters::V4::V4Client]
45
+ # @param request_client [CandidApiClient::RequestClient]
46
+ # @return [CandidApiClient::Encounters::V4::V4Client]
51
47
  def initialize(request_client:)
52
- # @type [RequestClient]
53
48
  @request_client = request_client
54
49
  end
55
50
 
56
51
  # @param limit [Integer] Maximum number of entities per page, defaults to 100.
57
- # @param claim_status [Claims::ClaimStatus] Indicates the current status of an insurance claim within the billing process.
58
- # @param sort [Encounters::V4::EncounterSortOptions] Defaults to created_at:desc.
59
- # @param page_token [Commons::PAGE_TOKEN]
60
- # @param date_of_service_min [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
61
- # @param date_of_service_max [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
52
+ # @param claim_status [CandidApiClient::Claims::Types::ClaimStatus] Indicates the current status of an insurance claim within the billing process.
53
+ # @param sort [CandidApiClient::Encounters::V4::Types::EncounterSortOptions] Defaults to created_at:desc.
54
+ # @param page_token [String]
55
+ # @param date_of_service_min [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
56
+ # @param date_of_service_max [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
62
57
  # @param primary_payer_names [String] Comma delimited string.
63
- # @param search_term [String] Filter by any of the following fields: encounter_id, claim_id, patient external_id,
64
- # patient date of birth, patient first name, patient last name,
65
- # or encounter external id.
66
- # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] Filter to an exact match on encounter external_id, if one exists.
67
- # @param diagnoses_updated_since [DateTime] ISO 8601 timestamp; ideally in UTC (although not required): 2019-08-24T14:15:22Z.
68
- # @param tag_ids [Tags::TAG_ID] Filter by name of tags on encounters.
69
- # @param work_queue_id [Commons::WORK_QUEUE_ID]
70
- # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
71
- # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use SELF_PAY if you intend to bill self pay/cash pay.
72
- # @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.
58
+ # @param search_term [String] Filter by any of the following fields: encounter_id, claim_id, patient
59
+ # external_id,
60
+ # patient date of birth, patient first name, patient last name,
61
+ # or encounter external id.
62
+ # @param external_id [String] Filter to an exact match on encounter external_id, if one exists.
63
+ # @param diagnoses_updated_since [DateTime] ISO 8601 timestamp; ideally in UTC (although not required):
64
+ # 2019-08-24T14:15:22Z.
65
+ # @param tag_ids [String] Filter by name of tags on encounters.
66
+ # @param work_queue_id [String]
67
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
68
+ # Examples for when this should be set to NOT_BILLABLE include if the Encounter
69
+ # has not occurred yet or if there is no intention of ever billing the
70
+ # responsible_party.
71
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use
72
+ # SELF_PAY if you intend to bill self pay/cash pay.
73
+ # @param owner_of_next_action [CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as
74
+ # defined by ownership of open Tasks.
73
75
  # @param patient_external_id [String] The patient ID from the external EMR platform for the patient
74
- # @param request_options [RequestOptions]
75
- # @return [Encounters::V4::EncounterPage]
76
+ # @param request_options [CandidApiClient::RequestOptions]
77
+ # @return [CandidApiClient::Encounters::V4::Types::EncounterPage]
78
+ # @example
79
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
80
+ # api.encounters.v_4.get_all(
81
+ # limit: 100,
82
+ # claim_status: BILLER_RECEIVED,
83
+ # sort: CREATED_AT_ASC,
84
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
85
+ # date_of_service_min: DateTime.parse(2019-08-24),
86
+ # date_of_service_max: DateTime.parse(2019-08-25),
87
+ # primary_payer_names: "Medicare,Medicaid",
88
+ # search_term: "doe",
89
+ # external_id: "123456",
90
+ # diagnoses_updated_since: DateTime.parse(2019-08-24T14:15:22.000Z)
91
+ # )
76
92
  def get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil,
77
93
  date_of_service_max: nil, primary_payer_names: nil, search_term: nil, external_id: nil, diagnoses_updated_since: nil, tag_ids: nil, work_queue_id: nil, billable_status: nil, responsible_party: nil, owner_of_next_action: nil, patient_external_id: nil, request_options: nil)
78
- response = @request_client.conn.get("/api/encounters/v4") do |req|
94
+ response = @request_client.conn.get do |req|
79
95
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
80
96
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
81
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
97
+ req.headers = {
98
+ **(req.headers || {}),
99
+ **@request_client.get_headers,
100
+ **(request_options&.additional_headers || {})
101
+ }.compact
82
102
  req.params = {
83
103
  **(request_options&.additional_query_parameters || {}),
84
104
  "limit": limit,
@@ -98,133 +118,170 @@ module CandidApiClient
98
118
  "owner_of_next_action": owner_of_next_action,
99
119
  "patient_external_id": patient_external_id
100
120
  }.compact
121
+ req.url "#{@request_client.get_url(environment: CandidApi,
122
+ request_options: request_options)}/api/encounters/v4"
101
123
  end
102
- Encounters::V4::EncounterPage.from_json(json_object: response.body)
124
+ CandidApiClient::Encounters::V4::Types::EncounterPage.from_json(json_object: response.body)
103
125
  end
104
126
 
105
- # @param encounter_id [Commons::ENCOUNTER_ID]
106
- # @param request_options [RequestOptions]
107
- # @return [Encounters::V4::Encounter]
127
+ # @param encounter_id [String]
128
+ # @param request_options [CandidApiClient::RequestOptions]
129
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
130
+ # @example
131
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
132
+ # api.encounters.v_4.get(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
108
133
  def get(encounter_id:, request_options: nil)
109
- response = @request_client.conn.get("/api/encounters/v4/#{encounter_id}") do |req|
134
+ response = @request_client.conn.get do |req|
110
135
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
111
136
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
112
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
137
+ req.headers = {
138
+ **(req.headers || {}),
139
+ **@request_client.get_headers,
140
+ **(request_options&.additional_headers || {})
141
+ }.compact
142
+ req.url "#{@request_client.get_url(environment: CandidApi,
143
+ request_options: request_options)}/api/encounters/v4/#{encounter_id}"
113
144
  end
114
- Encounters::V4::Encounter.from_json(json_object: response.body)
145
+ CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
115
146
  end
116
147
 
117
- # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
118
- # for example, your internal encounter ID or a Dr. Chrono encounter ID.
119
- # This field should not contain PHI.
120
- # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
148
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
149
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
150
+ # This field should not contain PHI.
151
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
121
152
  # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
122
- # for billing purpose.
123
- # Box 12 on the CMS-1500 claim form.
153
+ # for billing purpose.
154
+ # Box 12 on the CMS-1500 claim form.
124
155
  # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
125
- # not them. If false, patient may receive reimbursement.
126
- # Box 13 on the CMS-1500 claim form.
156
+ # not them. If false, patient may receive reimbursement.
157
+ # Box 13 on the CMS-1500 claim form.
127
158
  # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
128
- # to be made to you, not them.
129
- # Box 27 on the CMS-1500 claim form.
130
- # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
131
- # @param existing_medications [Array<Hash>] Request of type Array<Encounters::V4::Medication>, as a Hash
159
+ # to be made to you, not them.
160
+ # Box 27 on the CMS-1500 claim form.
161
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
162
+ # Headaches").
163
+ # @param existing_medications [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Medication>, as a Hash
132
164
  # * :name (String)
133
- # * :rx_cui (Encounters::V4::RX_CUI)
165
+ # * :rx_cui (String)
134
166
  # * :dosage (String)
135
167
  # * :dosage_form (String)
136
168
  # * :frequency (String)
137
169
  # * :as_needed (Boolean)
138
- # @param vitals [Hash] Request of type Encounters::V4::Vitals, as a Hash
170
+ # @param vitals [Hash] Request of type CandidApiClient::Encounters::V4::Types::Vitals, as a Hash
139
171
  # * :height_in (Integer)
140
172
  # * :weight_lbs (Integer)
141
173
  # * :blood_pressure_systolic_mmhg (Integer)
142
174
  # * :blood_pressure_diastolic_mmhg (Integer)
143
175
  # * :body_temperature_f (Float)
144
- # @param interventions [Array<Hash>] Request of type Array<Encounters::V4::Intervention>, as a Hash
176
+ # @param interventions [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Intervention>, as a Hash
145
177
  # * :name (String)
146
- # * :category (Encounters::V4::InterventionCategory)
178
+ # * :category (CandidApiClient::Encounters::V4::Types::InterventionCategory)
147
179
  # * :description (String)
148
180
  # * :medication (Hash)
149
181
  # * :name (String)
150
- # * :rx_cui (Encounters::V4::RX_CUI)
182
+ # * :rx_cui (String)
151
183
  # * :dosage (String)
152
184
  # * :dosage_form (String)
153
185
  # * :frequency (String)
154
186
  # * :as_needed (Boolean)
155
- # * :labs (Array<Encounters::V4::Lab>)
156
- # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type Commons::StreetAddressLongZip, as a Hash
187
+ # * :labs (Array<CandidApiClient::Encounters::V4::Types::Lab>)
188
+ # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type CandidApiClient::Commons::Types::StreetAddressLongZip, as a Hash
157
189
  # * :zip_plus_four_code (String)
158
190
  # * :address_1 (String)
159
191
  # * :address_2 (String)
160
192
  # * :city (String)
161
- # * :state (Commons::State)
193
+ # * :state (CandidApiClient::Commons::Types::State)
162
194
  # * :zip_code (String)
163
- # @param synchronicity [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
164
- # Asynchronous encounters occur when providers and patients communicate online using
165
- # forms, instant messaging, or other pre-recorded digital mediums.
166
- # Synchronous encounters occur in live, real-time settings where the patient interacts
167
- # directly with the provider, such as over video or a phone call.
168
- # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
169
- # Examples for when this should be set to NOT_BILLABLE include
170
- # if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
171
- # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
195
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
196
+ # Asynchronous encounters occur when providers and patients communicate online
197
+ # using
198
+ # forms, instant messaging, or other pre-recorded digital mediums.
199
+ # Synchronous encounters occur in live, real-time settings where the patient
200
+ # interacts
201
+ # directly with the provider, such as over video or a phone call.
202
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
203
+ # Examples for when this should be set to NOT_BILLABLE include
204
+ # if the Encounter has not occurred yet or if there is no intention of ever
205
+ # billing the responsible_party.
206
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
172
207
  # @param additional_information [String] Defines additional information on the claim needed by the payer.
173
- # Box 19 on the CMS-1500 claim form.
174
- # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
175
- # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
176
- # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
177
- # obtaining the authorization.
178
- # @param admission_date [Commons::DATE] 837p Loop2300 DTP\*435, CMS-1500 Box 18
179
- # Required on all ambulance claims when the patient was known to be admitted to the hospital.
180
- # OR
181
- # Required on all claims involving inpatient medical visits.
182
- # @param discharge_date [Commons::DATE] 837p Loop2300 DTP\*096, CMS-1500 Box 18
183
- # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
184
- # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP\*431, CMS-1500 Box 14
185
- # 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.
186
- # OR
187
- # This date is the onset of acute symptoms for the current illness or condition.
188
- # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP\*484, CMS-1500 Box 14
189
- # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
190
- # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
191
- # Code indicating the reason why a request was delayed
208
+ # Box 19 on the CMS-1500 claim form.
209
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
210
+ # Required when mandated by government law or regulation to obtain authorization
211
+ # for specific service(s) but, for the
212
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
213
+ # the service was performed without
214
+ # obtaining the authorization.
215
+ # @param admission_date [Date] 837p Loop2300 DTP\*435, CMS-1500 Box 18
216
+ # Required on all ambulance claims when the patient was known to be admitted to
217
+ # the hospital.
218
+ # OR
219
+ # Required on all claims involving inpatient medical visits.
220
+ # @param discharge_date [Date] 837p Loop2300 DTP\*096, CMS-1500 Box 18
221
+ # Required for inpatient claims when the patient was discharged from the facility
222
+ # and the discharge date is known.
223
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP\*431, CMS-1500 Box 14
224
+ # Required for the initial medical service or visit performed in response to a
225
+ # medical emergency when the date is available and is different than the date of
226
+ # service.
227
+ # OR
228
+ # This date is the onset of acute symptoms for the current illness or condition.
229
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP\*484, CMS-1500 Box 14
230
+ # Required when, in the judgment of the provider, the services on this claim are
231
+ # related to the patient's pregnancy.
232
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
233
+ # Code indicating the reason why a request was delayed
192
234
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
193
- # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
194
- # This date must be the local date in the timezone where the service occurred.
195
- # Box 24a on the CMS-1500 claim form.
196
- # If service occurred over a range of dates, this should be the start date.
197
- # date_of_service must be defined on either the encounter or the service lines but not both.
198
- # If there are greater than zero service lines, it is recommended to specify date_of_service on the service_line instead of on the encounter to prepare for future API versions.
199
- # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
200
- # This date must be the local date in the timezone where the service occurred.
201
- # If omitted, the Encounter is assumed to be for a single day.
202
- # Must not be temporally before the date_of_service field.
203
- # If there are greater than zero service lines, it is recommended to specify end_date_of_service on the service_line instead of on the encounter to prepare for future API versions.
204
- # @param patient [Hash] Contains the identification information of the individual receiving medical services.Request of type Individual::PatientCreate, as a Hash
205
- # * :phone_numbers (Array<Commons::PhoneNumber>)
235
+ # @param _field_set [Object]
236
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
237
+ # This date must be the local date in the timezone where the service occurred.
238
+ # Box 24a on the CMS-1500 claim form.
239
+ # If service occurred over a range of dates, this should be the start date.
240
+ # date_of_service must be defined on either the encounter or the service lines but
241
+ # not both.
242
+ # If there are greater than zero service lines, it is recommended to specify
243
+ # date_of_service on the service_line instead of on the encounter to prepare for
244
+ # future API versions.
245
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
246
+ # This date must be the local date in the timezone where the service occurred.
247
+ # If omitted, the Encounter is assumed to be for a single day.
248
+ # Must not be temporally before the date_of_service field.
249
+ # If there are greater than zero service lines, it is recommended to specify
250
+ # end_date_of_service on the service_line instead of on the encounter to prepare
251
+ # for future API versions.
252
+ # @param patient [Hash] Contains the identification information of the individual receiving medical
253
+ # services.Request of type CandidApiClient::Individual::Types::PatientCreate, as a Hash
254
+ # * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
206
255
  # * :phone_consent (Boolean)
207
- # * :email (Commons::EMAIL)
256
+ # * :email (String)
208
257
  # * :email_consent (Boolean)
209
258
  # * :external_id (String)
210
- # * :date_of_birth (Commons::DATE)
259
+ # * :date_of_birth (Date)
211
260
  # * :address (Hash)
212
261
  # * :zip_plus_four_code (String)
213
262
  # * :address_1 (String)
214
263
  # * :address_2 (String)
215
264
  # * :city (String)
216
- # * :state (Commons::State)
265
+ # * :state (CandidApiClient::Commons::Types::State)
217
266
  # * :zip_code (String)
218
267
  # * :first_name (String)
219
268
  # * :last_name (String)
220
- # * :gender (Individual::Gender)
221
- # @param billing_provider [Hash] 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.Request of type EncounterProviders::V2::BillingProvider, as a Hash
269
+ # * :gender (CandidApiClient::Individual::Types::Gender)
270
+ # @param billing_provider [Hash] The billing provider is the provider or business entity submitting the claim.
271
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
272
+ # rendering provider. From a payer's perspective, this represents the person or
273
+ # entity being reimbursed. When a contract exists with the target payer, the
274
+ # billing provider should be the entity contracted with the payer. In some
275
+ # circumstances, this will be an individual provider. In that case, submit that
276
+ # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
277
+ # contracting. In other cases, the billing entity will be a medical group. If so,
278
+ # submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.Request of type CandidApiClient::EncounterProviders::V2::Types::BillingProvider, as a Hash
222
279
  # * :address (Hash)
223
280
  # * :zip_plus_four_code (String)
224
281
  # * :address_1 (String)
225
282
  # * :address_2 (String)
226
283
  # * :city (String)
227
- # * :state (Commons::State)
284
+ # * :state (CandidApiClient::Commons::Types::State)
228
285
  # * :zip_code (String)
229
286
  # * :tax_id (String)
230
287
  # * :npi (String)
@@ -232,25 +289,26 @@ module CandidApiClient
232
289
  # * :first_name (String)
233
290
  # * :last_name (String)
234
291
  # * :organization_name (String)
235
- # @param rendering_provider [Hash] The rendering provider is the practitioner -- physician, nurse practitioner, etc. -- performing the service.
236
- # 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.Request of type EncounterProviders::V2::RenderingProvider, as a Hash
292
+ # @param rendering_provider [Hash] The rendering provider is the practitioner -- physician, nurse practitioner,
293
+ # etc. -- performing the service.
294
+ # For telehealth services, the rendering provider performs the visit, asynchronous
295
+ # communication, or other service. The rendering provider address should generally
296
+ # be the same as the service facility address.Request of type CandidApiClient::EncounterProviders::V2::Types::RenderingProvider, as a Hash
237
297
  # * :address (Hash)
238
298
  # * :zip_plus_four_code (String)
239
299
  # * :address_1 (String)
240
300
  # * :address_2 (String)
241
301
  # * :city (String)
242
- # * :state (Commons::State)
302
+ # * :state (CandidApiClient::Commons::Types::State)
243
303
  # * :zip_code (String)
244
304
  # * :npi (String)
245
305
  # * :taxonomy_code (String)
246
306
  # * :first_name (String)
247
307
  # * :last_name (String)
248
308
  # * :organization_name (String)
249
- # @param referring_provider [Hash] The provider who referred the services that were rendered.
250
- # All physicians who order services or refer Medicare beneficiaries must
251
- # report this data.
252
- # If a claim involves multiple referring physicians, create a separate
253
- # encounter for each physician.Request of type EncounterProviders::V2::ReferringProvider, as a Hash
309
+ # @param referring_provider [Hash] The final provider who referred the services that were rendered.
310
+ # All physicians who order services or refer Medicare beneficiaries must
311
+ # report this data.Request of type CandidApiClient::EncounterProviders::V2::Types::ReferringProvider, as a Hash
254
312
  # * :npi (String)
255
313
  # * :taxonomy_code (String)
256
314
  # * :address (Hash)
@@ -258,25 +316,73 @@ module CandidApiClient
258
316
  # * :address_1 (String)
259
317
  # * :address_2 (String)
260
318
  # * :city (String)
261
- # * :state (Commons::State)
319
+ # * :state (CandidApiClient::Commons::Types::State)
262
320
  # * :zip_code (String)
263
321
  # * :first_name (String)
264
322
  # * :last_name (String)
265
323
  # * :organization_name (String)
266
- # @param service_facility [Hash] 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.Request of type ServiceFacility::EncounterServiceFacilityBase, as a Hash
324
+ # @param initial_referring_provider [Hash] The second iteration of Loop ID-2310. Use code "P3 - Primary Care Provider" in
325
+ # this loop to
326
+ # indicate the initial referral from the primary care provider or whatever
327
+ # provider wrote the initial referral for this patient's episode of care being
328
+ # billed/reported in this transaction.
329
+ # Information in Loop ID-2310 applies to the entire claim unless overridden on a
330
+ # service line by the presence of Loop ID-2420 with the same value in NM101.Request of type CandidApiClient::EncounterProviders::V2::Types::InitialReferringProvider, as a Hash
331
+ # * :npi (String)
332
+ # * :taxonomy_code (String)
333
+ # * :address (Hash)
334
+ # * :zip_plus_four_code (String)
335
+ # * :address_1 (String)
336
+ # * :address_2 (String)
337
+ # * :city (String)
338
+ # * :state (CandidApiClient::Commons::Types::State)
339
+ # * :zip_code (String)
340
+ # * :qualifier (CandidApiClient::Commons::Types::QualifierCode)
341
+ # * :first_name (String)
342
+ # * :last_name (String)
267
343
  # * :organization_name (String)
344
+ # @param supervising_provider [Hash] Required when the rendering provider is supervised by a physician. If not
345
+ # required by this implementation guide, do not send.
346
+ # Information in Loop ID-2310 applies to the entire claim unless overridden on a
347
+ # service line by the presence of Loop ID-2420 with the same value in NM101.Request of type CandidApiClient::EncounterProviders::V2::Types::SupervisingProvider, as a Hash
268
348
  # * :npi (String)
349
+ # * :taxonomy_code (String)
269
350
  # * :address (Hash)
270
351
  # * :zip_plus_four_code (String)
271
352
  # * :address_1 (String)
272
353
  # * :address_2 (String)
273
354
  # * :city (String)
274
- # * :state (Commons::State)
355
+ # * :state (CandidApiClient::Commons::Types::State)
275
356
  # * :zip_code (String)
276
- # @param subscriber_primary [Hash] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e. when the claim should be billed to insurance).
277
- # These are not required fields when responsible_party is SELF_PAY (i.e. when the claim should be billed to the patient).
278
- # However, if you collect this for patients, even self-pay, we recommend including it when sending encounters to Candid.
279
- # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party to define self-pay claims.Request of type Individual::SubscriberCreate, as a Hash
357
+ # * :first_name (String)
358
+ # * :last_name (String)
359
+ # * :organization_name (String)
360
+ # @param service_facility [Hash] Encounter Service facility is typically the location a medical service was
361
+ # rendered, such as a provider office or hospital. For telehealth, service
362
+ # facility can represent the provider's location when the service was delivered
363
+ # (e.g., home), or the location where an in-person visit would have taken place,
364
+ # whichever is easier to identify. If the provider is in-network, service facility
365
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
366
+ # for an in-network claim to be successfully adjudicated, the service facility
367
+ # address listed on claims must match what was provided to the payer during the
368
+ # credentialing process.Request of type CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityBase, as a Hash
369
+ # * :organization_name (String)
370
+ # * :npi (String)
371
+ # * :address (Hash)
372
+ # * :zip_plus_four_code (String)
373
+ # * :address_1 (String)
374
+ # * :address_2 (String)
375
+ # * :city (String)
376
+ # * :state (CandidApiClient::Commons::Types::State)
377
+ # * :zip_code (String)
378
+ # @param subscriber_primary [Hash] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
379
+ # when the claim should be billed to insurance).
380
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the
381
+ # claim should be billed to the patient).
382
+ # However, if you collect this for patients, even self-pay, we recommend including
383
+ # it when sending encounters to Candid.
384
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
385
+ # to define self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
280
386
  # * :insurance_card (Hash)
281
387
  # * :member_id (String)
282
388
  # * :payer_name (String)
@@ -285,24 +391,24 @@ module CandidApiClient
285
391
  # * :rx_pcn (String)
286
392
  # * :image_url_front (String)
287
393
  # * :image_url_back (String)
288
- # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
394
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
289
395
  # * :group_number (String)
290
396
  # * :plan_name (String)
291
- # * :plan_type (Commons::SourceOfPaymentCode)
292
- # * :insurance_type (Commons::InsuranceTypeCode)
293
- # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
294
- # * :date_of_birth (Commons::DATE)
397
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
398
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
399
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
400
+ # * :date_of_birth (Date)
295
401
  # * :address (Hash)
296
402
  # * :zip_plus_four_code (String)
297
403
  # * :address_1 (String)
298
404
  # * :address_2 (String)
299
405
  # * :city (String)
300
- # * :state (Commons::State)
406
+ # * :state (CandidApiClient::Commons::Types::State)
301
407
  # * :zip_code (String)
302
408
  # * :first_name (String)
303
409
  # * :last_name (String)
304
- # * :gender (Individual::Gender)
305
- # @param subscriber_secondary [Hash] Please always include this when you have it, even for self-pay claims.Request of type Individual::SubscriberCreate, as a Hash
410
+ # * :gender (CandidApiClient::Individual::Types::Gender)
411
+ # @param subscriber_secondary [Hash] Please always include this when you have it, even for self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
306
412
  # * :insurance_card (Hash)
307
413
  # * :member_id (String)
308
414
  # * :payer_name (String)
@@ -311,63 +417,121 @@ module CandidApiClient
311
417
  # * :rx_pcn (String)
312
418
  # * :image_url_front (String)
313
419
  # * :image_url_back (String)
314
- # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
420
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
315
421
  # * :group_number (String)
316
422
  # * :plan_name (String)
317
- # * :plan_type (Commons::SourceOfPaymentCode)
318
- # * :insurance_type (Commons::InsuranceTypeCode)
319
- # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
320
- # * :date_of_birth (Commons::DATE)
423
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
424
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
425
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
426
+ # * :date_of_birth (Date)
321
427
  # * :address (Hash)
322
428
  # * :zip_plus_four_code (String)
323
429
  # * :address_1 (String)
324
430
  # * :address_2 (String)
325
431
  # * :city (String)
326
- # * :state (Commons::State)
432
+ # * :state (CandidApiClient::Commons::Types::State)
327
433
  # * :zip_code (String)
328
434
  # * :first_name (String)
329
435
  # * :last_name (String)
330
- # * :gender (Individual::Gender)
331
- # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
332
- # may be submitted at this time, and coders will later prioritize the 12 that will be
333
- # submitted to the payor.Request of type Array<Diagnoses::DiagnosisCreate>, as a Hash
436
+ # * :gender (CandidApiClient::Individual::Types::Gender)
437
+ # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more
438
+ # diagnoses
439
+ # may be submitted at this time, and coders will later prioritize the 12 that will
440
+ # be
441
+ # submitted to the payor.Request of type Array<CandidApiClient::Diagnoses::Types::DiagnosisCreate>, as a Hash
334
442
  # * :name (String)
335
- # * :code_type (Diagnoses::DiagnosisTypeCode)
443
+ # * :code_type (CandidApiClient::Diagnoses::Types::DiagnosisTypeCode)
336
444
  # * :code (String)
337
- # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during patient encounters.Request of type Array<Encounters::V4::ClinicalNoteCategoryCreate>, as a Hash
338
- # * :category (Encounters::V4::NoteCategory)
339
- # * :notes (Array<Encounters::V4::ClinicalNote>)
445
+ # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during
446
+ # patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash
447
+ # * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
448
+ # * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
340
449
  # @param billing_notes [Array<Hash>] Spot to store misc, human-readable, notes about this encounter to be used
341
- # in the billing process.Request of type Array<BillingNotes::V2::BillingNoteBase>, as a Hash
450
+ # in the billing process.Request of type Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>, as a Hash
342
451
  # * :text (String)
343
- # @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).
344
- # @param patient_histories [Array<Hash>] Request of type Array<Encounters::V4::PatientHistoryCategory>, as a Hash
345
- # * :category (Encounters::V4::PatientHistoryCategoryEnum)
346
- # * :questions (Array<Encounters::V4::IntakeQuestion>)
452
+ # @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
453
+ # supported. 02 for telemedicine, 11 for in-person. Full list
454
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
455
+ # @param patient_histories [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>, as a Hash
456
+ # * :category (CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryEnum)
457
+ # * :questions (Array<CandidApiClient::Encounters::V4::Types::IntakeQuestion>)
347
458
  # @param service_lines [Array<Hash>] Each service line must be linked to a diagnosis. Concretely,
348
- # `service_line.diagnosis_pointers`must contain at least one entry which should be
349
- # in bounds of the diagnoses list field.Request of type Array<ServiceLines::V2::ServiceLineCreate>, as a Hash
350
- # * :modifiers (Array<Commons::ProcedureModifier>)
459
+ # `service_line.diagnosis_pointers`must contain at least one entry which should be
460
+ # in bounds of the diagnoses list field.Request of type Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineCreate>, as a Hash
461
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
351
462
  # * :procedure_code (String)
352
- # * :quantity (Commons::DECIMAL)
353
- # * :units (Commons::ServiceLineUnits)
463
+ # * :quantity (String)
464
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
354
465
  # * :charge_amount_cents (Integer)
355
466
  # * :diagnosis_pointers (Array<Integer>)
356
467
  # * :drug_identification (Hash)
357
- # * :service_id_qualifier (ServiceLines::V2::ServiceIdQualifier)
468
+ # * :service_id_qualifier (CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier)
358
469
  # * :national_drug_code (String)
359
470
  # * :national_drug_unit_count (String)
360
- # * :measurement_unit_code (ServiceLines::V2::MeasurementUnitCode)
471
+ # * :measurement_unit_code (CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode)
361
472
  # * :link_sequence_number (String)
362
473
  # * :pharmacy_prescription_number (String)
363
- # * :place_of_service_code (Commons::FacilityTypeCode)
474
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
364
475
  # * :description (String)
365
476
  # * :date_of_service (Date)
366
477
  # * :end_date_of_service (Date)
367
- # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type Guarantor::V1::GuarantorCreate, as a Hash
368
- # * :phone_numbers (Array<Commons::PhoneNumber>)
478
+ # * :referring_provider (Hash)
479
+ # * :npi (String)
480
+ # * :taxonomy_code (String)
481
+ # * :address (Hash)
482
+ # * :zip_plus_four_code (String)
483
+ # * :address_1 (String)
484
+ # * :address_2 (String)
485
+ # * :city (String)
486
+ # * :state (CandidApiClient::Commons::Types::State)
487
+ # * :zip_code (String)
488
+ # * :first_name (String)
489
+ # * :last_name (String)
490
+ # * :organization_name (String)
491
+ # * :initial_referring_provider (Hash)
492
+ # * :npi (String)
493
+ # * :taxonomy_code (String)
494
+ # * :address (Hash)
495
+ # * :zip_plus_four_code (String)
496
+ # * :address_1 (String)
497
+ # * :address_2 (String)
498
+ # * :city (String)
499
+ # * :state (CandidApiClient::Commons::Types::State)
500
+ # * :zip_code (String)
501
+ # * :qualifier (CandidApiClient::Commons::Types::QualifierCode)
502
+ # * :first_name (String)
503
+ # * :last_name (String)
504
+ # * :organization_name (String)
505
+ # * :supervising_provider (Hash)
506
+ # * :npi (String)
507
+ # * :taxonomy_code (String)
508
+ # * :address (Hash)
509
+ # * :zip_plus_four_code (String)
510
+ # * :address_1 (String)
511
+ # * :address_2 (String)
512
+ # * :city (String)
513
+ # * :state (CandidApiClient::Commons::Types::State)
514
+ # * :zip_code (String)
515
+ # * :first_name (String)
516
+ # * :last_name (String)
517
+ # * :organization_name (String)
518
+ # * :ordering_provider (Hash)
519
+ # * :npi (String)
520
+ # * :taxonomy_code (String)
521
+ # * :address (Hash)
522
+ # * :zip_plus_four_code (String)
523
+ # * :address_1 (String)
524
+ # * :address_2 (String)
525
+ # * :city (String)
526
+ # * :state (CandidApiClient::Commons::Types::State)
527
+ # * :zip_code (String)
528
+ # * :first_name (String)
529
+ # * :last_name (String)
530
+ # * :organization_name (String)
531
+ # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type CandidApiClient::Guarantor::V1::Types::GuarantorCreate, as a Hash
532
+ # * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
369
533
  # * :phone_consent (Boolean)
370
- # * :email (Commons::EMAIL)
534
+ # * :email (String)
371
535
  # * :email_consent (Boolean)
372
536
  # * :first_name (String)
373
537
  # * :last_name (String)
@@ -378,23 +542,52 @@ module CandidApiClient
378
542
  # * :address_1 (String)
379
543
  # * :address_2 (String)
380
544
  # * :city (String)
381
- # * :state (Commons::State)
545
+ # * :state (CandidApiClient::Commons::Types::State)
382
546
  # * :zip_code (String)
383
547
  # @param external_claim_submission [Hash] ***This field is in beta.***
384
- # To be included for claims that have been submitted outside of Candid.
385
- # Candid supports posting remits and payments to these claims and working them in-platform (e.g. editing, resubmitting).Request of type ClaimSubmission::V1::ExternalClaimSubmissionCreate, as a Hash
548
+ # To be included for claims that have been submitted outside of Candid.
549
+ # Candid supports posting remits and payments to these claims and working them
550
+ # in-platform (e.g. editing, resubmitting).Request of type CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate, as a Hash
386
551
  # * :claim_created_at (DateTime)
387
552
  # * :patient_control_number (String)
388
- # * :submission_records (Array<ClaimSubmission::V1::ClaimSubmissionRecordCreate>)
389
- # @param tag_ids [Array<Tags::TAG_ID>] Names of tags that should be on the encounter.
390
- # @param request_options [RequestOptions]
391
- # @return [Encounters::V4::Encounter]
553
+ # * :submission_records (Array<CandidApiClient::ClaimSubmission::V1::Types::ClaimSubmissionRecordCreate>)
554
+ # @param tag_ids [Array<String>] Names of tags that should be on the encounter.
555
+ # @param request_options [CandidApiClient::RequestOptions]
556
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
557
+ # @example
558
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
559
+ # api.encounters.v_4.create(
560
+ # date_of_service: DateTime.parse(2023-01-15),
561
+ # end_date_of_service: DateTime.parse(2023-01-15),
562
+ # patient: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "johndoe@joincandidhealth.com", email_consent: true, external_id: "string", date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
563
+ # billing_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, tax_id: "string", npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
564
+ # rendering_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
565
+ # referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
566
+ # initial_referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, qualifier: DQ, first_name: "string", last_name: "string", organization_name: "string" },
567
+ # supervising_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
568
+ # service_facility: { organization_name: "string", npi: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } },
569
+ # subscriber_primary: { insurance_card: { member_id: "string", payer_name: "string", payer_id: "string", rx_bin: "string", rx_pcn: "string", image_url_front: "string", image_url_back: "string", emr_payer_crosswalk: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
570
+ # subscriber_secondary: { insurance_card: { member_id: "string", payer_name: "string", payer_id: "string", rx_bin: "string", rx_pcn: "string", image_url_front: "string", image_url_back: "string", emr_payer_crosswalk: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
571
+ # diagnoses: [{ name: "string", code_type: ABF, code: "string" }],
572
+ # clinical_notes: [{ category: CLINICAL, notes: [{ }] }],
573
+ # billing_notes: [{ text: "string" }],
574
+ # place_of_service_code: PHARMACY,
575
+ # patient_histories: [{ category: PRESENT_ILLNESS, questions: [{ id: "6E7FBCE4-A8EA-46D0-A8D8-FF83CA3BB176", text: "Do you have any allergies?", responses: [{ response: "No allergies", follow_ups: [{ id: "4F3D57F9-AC94-49D6-87E4-E804B709917A", text: "Do you have any allergies?", response: "No allergies" }] }] }] }],
576
+ # service_lines: [{ modifiers: [TWENTY_TWO], procedure_code: "string", quantity: "string", units: MJ, charge_amount_cents: 1, diagnosis_pointers: [1], drug_identification: { }, place_of_service_code: PHARMACY, description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15), referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" }, initial_referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, qualifier: DQ, first_name: "string", last_name: "string", organization_name: "string" }, supervising_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" }, ordering_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" } }],
577
+ # guarantor: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "johndoe@joincandidhealth.com", email_consent: true, first_name: "string", last_name: "string", external_id: "string", date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } },
578
+ # external_claim_submission: { claim_created_at: DateTime.parse(2023-01-01T12:00:00.000Z), patient_control_number: "PATIENT_CONTROL_NUMBER", submission_records: [{ submitted_at: DateTime.parse(2023-01-01T13:00:00.000Z), claim_frequency_code: ORIGINAL, payer_responsibility: PRIMARY, intended_submission_medium: ELECTRONIC }, { submitted_at: DateTime.parse(2023-01-04T12:00:00.000Z), claim_frequency_code: REPLACEMENT, payer_responsibility: PRIMARY, intended_submission_medium: PAPER }] },
579
+ # tag_ids: ["string"]
580
+ # )
392
581
  def create(external_id:, patient_authorized_release:, benefits_assigned_to_provider:,
393
- provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, 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, date_of_service: nil, end_date_of_service: nil, referring_provider: nil, service_facility: nil, subscriber_primary: nil, subscriber_secondary: nil, clinical_notes: nil, billing_notes: nil, patient_histories: nil, service_lines: nil, guarantor: nil, external_claim_submission: nil, tag_ids: nil, request_options: nil)
394
- response = @request_client.conn.post("/api/encounters/v4") do |req|
582
+ provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, 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, _field_set: nil, date_of_service: nil, end_date_of_service: nil, referring_provider: nil, initial_referring_provider: nil, supervising_provider: nil, service_facility: nil, subscriber_primary: nil, subscriber_secondary: nil, clinical_notes: nil, billing_notes: nil, patient_histories: nil, service_lines: nil, guarantor: nil, external_claim_submission: nil, tag_ids: nil, request_options: nil)
583
+ response = @request_client.conn.post do |req|
395
584
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
396
585
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
397
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
586
+ req.headers = {
587
+ **(req.headers || {}),
588
+ **@request_client.get_headers,
589
+ **(request_options&.additional_headers || {})
590
+ }.compact
398
591
  req.body = {
399
592
  **(request_options&.additional_body_parameters || {}),
400
593
  external_id: external_id,
@@ -418,12 +611,15 @@ module CandidApiClient
418
611
  last_menstrual_period_date: last_menstrual_period_date,
419
612
  delay_reason_code: delay_reason_code,
420
613
  additional_properties: additional_properties,
614
+ _field_set: _field_set,
421
615
  date_of_service: date_of_service,
422
616
  end_date_of_service: end_date_of_service,
423
617
  patient: patient,
424
618
  billing_provider: billing_provider,
425
619
  rendering_provider: rendering_provider,
426
620
  referring_provider: referring_provider,
621
+ initial_referring_provider: initial_referring_provider,
622
+ supervising_provider: supervising_provider,
427
623
  service_facility: service_facility,
428
624
  subscriber_primary: subscriber_primary,
429
625
  subscriber_secondary: subscriber_secondary,
@@ -437,47 +633,76 @@ module CandidApiClient
437
633
  external_claim_submission: external_claim_submission,
438
634
  tag_ids: tag_ids
439
635
  }.compact
636
+ req.url "#{@request_client.get_url(environment: CandidApi,
637
+ request_options: request_options)}/api/encounters/v4"
440
638
  end
441
- Encounters::V4::Encounter.from_json(json_object: response.body)
639
+ CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
442
640
  end
443
641
 
444
- # @param encounter_id [Commons::ENCOUNTER_ID]
445
- # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
446
- # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
447
- # for example, your internal encounter ID or a Dr. Chrono encounter ID.
448
- # This field should not contain PHI.
449
- # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
450
- # This date must be the local date in the timezone where the service occurred.
451
- # Box 24a on the CMS-1500 claim form.
452
- # If service occurred over a range of dates, this should be the start date.
453
- # If service lines have distinct date_of_service values, updating the encounter's date_of_service will fail. If all service line date_of_service values are the same, updating the encounter's date_of_service will update all service line date_of_service values.
454
- # @param diagnosis_ids [Array<Diagnoses::DIAGNOSIS_ID>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
455
- # may be submitted at this time, and coders will later prioritize the 12 that will be
456
- # submitted to the payor.
457
- # @param tag_ids [Array<Tags::TAG_ID>] Names of tags that should be on the encounter. Note all tags on encounter will be overriden with this list.
458
- # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during patient encounters.Request of type Array<Encounters::V4::ClinicalNoteCategoryCreate>, as a Hash
459
- # * :category (Encounters::V4::NoteCategory)
460
- # * :notes (Array<Encounters::V4::ClinicalNote>)
461
- # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type Commons::StreetAddressLongZip, as a Hash
642
+ # @param encounter_id [String]
643
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
644
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
645
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
646
+ # This field should not contain PHI.
647
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
648
+ # This date must be the local date in the timezone where the service occurred.
649
+ # Box 24a on the CMS-1500 claim form.
650
+ # If service occurred over a range of dates, this should be the start date.
651
+ # If service lines have distinct date_of_service values, updating the encounter's
652
+ # date_of_service will fail. If all service line date_of_service values are the
653
+ # same, updating the encounter's date_of_service will update all service line
654
+ # date_of_service values.
655
+ # @param diagnosis_ids [Array<String>] Ideally, this field should contain no more than 12 diagnoses. However, more
656
+ # diagnoses
657
+ # may be submitted at this time, and coders will later prioritize the 12 that will
658
+ # be
659
+ # submitted to the payor.
660
+ # @param tag_ids [Array<String>] Names of tags that should be on the encounter. Note all tags on encounter will
661
+ # be overriden with this list.
662
+ # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during
663
+ # patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash
664
+ # * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
665
+ # * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
666
+ # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type CandidApiClient::Commons::Types::StreetAddressLongZip, as a Hash
462
667
  # * :zip_plus_four_code (String)
463
668
  # * :address_1 (String)
464
669
  # * :address_2 (String)
465
670
  # * :city (String)
466
- # * :state (Commons::State)
671
+ # * :state (CandidApiClient::Commons::Types::State)
467
672
  # * :zip_code (String)
468
- # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
469
- # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use SELF_PAY if you intend to bill self pay/cash pay.
470
- # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments to be made to you, not them. Box 27 on the CMS-1500 claim form.
471
- # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you, not them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim form.
472
- # @param synchronicity [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter. Asynchronous encounters occur when providers and patients communicate online using forms, instant messaging, or other pre-recorded digital mediums. Synchronous encounters occur in live, real-time settings where the patient interacts directly with the provider, such as over video or a phone call.
473
- # @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).
474
- # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
475
- # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
476
- # This date must be the local date in the timezone where the service occurred.
477
- # If omitted, the Encounter is assumed to be for a single day.
478
- # Must not be temporally before the date_of_service field.
479
- # If service lines have distinct end_date_of_service values, updating the encounter's end_date_of_service will fail. If all service line end_date_of_service values are the same, updating the encounter's end_date_of_service will update all service line date_of_service values.
480
- # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
673
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
674
+ # Examples for when this should be set to NOT_BILLABLE include if the Encounter
675
+ # has not occurred yet or if there is no intention of ever billing the
676
+ # responsible_party.
677
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use
678
+ # SELF_PAY if you intend to bill self pay/cash pay.
679
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments to
680
+ # be made to you, not them. Box 27 on the CMS-1500 claim form.
681
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you, not
682
+ # them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim
683
+ # form.
684
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter. Asynchronous
685
+ # encounters occur when providers and patients communicate online using forms,
686
+ # instant messaging, or other pre-recorded digital mediums. Synchronous encounters
687
+ # occur in live, real-time settings where the patient interacts directly with the
688
+ # provider, such as over video or a phone call.
689
+ # @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
690
+ # supported. 02 for telemedicine, 11 for in-person. Full list
691
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
692
+ # @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
693
+ # supported. 02 for telemedicine, 11 for in-person. Full list
694
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
695
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
696
+ # Headaches").
697
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
698
+ # This date must be the local date in the timezone where the service occurred.
699
+ # If omitted, the Encounter is assumed to be for a single day.
700
+ # Must not be temporally before the date_of_service field.
701
+ # If service lines have distinct end_date_of_service values, updating the
702
+ # encounter's end_date_of_service will fail. If all service line
703
+ # end_date_of_service values are the same, updating the encounter's
704
+ # end_date_of_service will update all service line date_of_service values.
705
+ # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
481
706
  # * :insurance_card (Hash)
482
707
  # * :member_id (String)
483
708
  # * :payer_name (String)
@@ -486,24 +711,24 @@ module CandidApiClient
486
711
  # * :rx_pcn (String)
487
712
  # * :image_url_front (String)
488
713
  # * :image_url_back (String)
489
- # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
714
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
490
715
  # * :group_number (String)
491
716
  # * :plan_name (String)
492
- # * :plan_type (Commons::SourceOfPaymentCode)
493
- # * :insurance_type (Commons::InsuranceTypeCode)
494
- # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
495
- # * :date_of_birth (Commons::DATE)
717
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
718
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
719
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
720
+ # * :date_of_birth (Date)
496
721
  # * :address (Hash)
497
722
  # * :zip_plus_four_code (String)
498
723
  # * :address_1 (String)
499
724
  # * :address_2 (String)
500
725
  # * :city (String)
501
- # * :state (Commons::State)
726
+ # * :state (CandidApiClient::Commons::Types::State)
502
727
  # * :zip_code (String)
503
728
  # * :first_name (String)
504
729
  # * :last_name (String)
505
- # * :gender (Individual::Gender)
506
- # @param subscriber_secondary [Hash] Contains details of the secondary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
730
+ # * :gender (CandidApiClient::Individual::Types::Gender)
731
+ # @param subscriber_secondary [Hash] Contains details of the secondary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
507
732
  # * :insurance_card (Hash)
508
733
  # * :member_id (String)
509
734
  # * :payer_name (String)
@@ -512,54 +737,96 @@ module CandidApiClient
512
737
  # * :rx_pcn (String)
513
738
  # * :image_url_front (String)
514
739
  # * :image_url_back (String)
515
- # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
740
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
516
741
  # * :group_number (String)
517
742
  # * :plan_name (String)
518
- # * :plan_type (Commons::SourceOfPaymentCode)
519
- # * :insurance_type (Commons::InsuranceTypeCode)
520
- # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
521
- # * :date_of_birth (Commons::DATE)
743
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
744
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
745
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
746
+ # * :date_of_birth (Date)
522
747
  # * :address (Hash)
523
748
  # * :zip_plus_four_code (String)
524
749
  # * :address_1 (String)
525
750
  # * :address_2 (String)
526
751
  # * :city (String)
527
- # * :state (Commons::State)
752
+ # * :state (CandidApiClient::Commons::Types::State)
528
753
  # * :zip_code (String)
529
754
  # * :first_name (String)
530
755
  # * :last_name (String)
531
- # * :gender (Individual::Gender)
756
+ # * :gender (CandidApiClient::Individual::Types::Gender)
532
757
  # @param additional_information [String] Defines additional information on the claim needed by the payer.
533
- # Box 19 on the CMS-1500 claim form.
534
- # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
535
- # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
536
- # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
537
- # obtaining the authorization.
538
- # @param admission_date [Commons::DATE] 837p Loop2300 DTP*435, CMS-1500 Box 18
539
- # Required on all ambulance claims when the patient was known to be admitted to the hospital.
540
- # OR
541
- # Required on all claims involving inpatient medical visits.
542
- # @param discharge_date [Commons::DATE] 837p Loop2300 DTP*096, CMS-1500 Box 18
543
- # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
544
- # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP*431, CMS-1500 Box 14
545
- # 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.
546
- # OR
547
- # This date is the onset of acute symptoms for the current illness or condition.
548
- # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP*484, CMS-1500 Box 14
549
- # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
550
- # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
551
- # Code indicating the reason why a request was delayed
758
+ # Box 19 on the CMS-1500 claim form.
759
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
760
+ # Required when mandated by government law or regulation to obtain authorization
761
+ # for specific service(s) but, for the
762
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
763
+ # the service was performed without
764
+ # obtaining the authorization.
765
+ # @param admission_date [Date] 837p Loop2300 DTP*435, CMS-1500 Box 18
766
+ # Required on all ambulance claims when the patient was known to be admitted to
767
+ # the hospital.
768
+ # OR
769
+ # Required on all claims involving inpatient medical visits.
770
+ # @param discharge_date [Date] 837p Loop2300 DTP*096, CMS-1500 Box 18
771
+ # Required for inpatient claims when the patient was discharged from the facility
772
+ # and the discharge date is known.
773
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP*431, CMS-1500 Box 14
774
+ # Required for the initial medical service or visit performed in response to a
775
+ # medical emergency when the date is available and is different than the date of
776
+ # service.
777
+ # OR
778
+ # This date is the onset of acute symptoms for the current illness or condition.
779
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP*484, CMS-1500 Box 14
780
+ # Required when, in the judgment of the provider, the services on this claim are
781
+ # related to the patient's pregnancy.
782
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
783
+ # Code indicating the reason why a request was delayed
552
784
  # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
553
- # for billing purpose.
554
- # Box 12 on the CMS-1500 claim form.
555
- # @param request_options [RequestOptions]
556
- # @return [Encounters::V4::Encounter]
785
+ # for billing purpose.
786
+ # Box 12 on the CMS-1500 claim form.
787
+ # @param request_options [CandidApiClient::RequestOptions]
788
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
789
+ # @example
790
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
791
+ # api.encounters.v_4.update(
792
+ # encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
793
+ # prior_authorization_number: "string",
794
+ # external_id: "string",
795
+ # date_of_service: DateTime.parse(2023-01-15),
796
+ # diagnosis_ids: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"],
797
+ # tag_ids: ["string"],
798
+ # clinical_notes: [{ category: CLINICAL, notes: [{ }] }],
799
+ # pay_to_address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" },
800
+ # billable_status: BILLABLE,
801
+ # responsible_party: INSURANCE_PAY,
802
+ # provider_accepts_assignment: true,
803
+ # benefits_assigned_to_provider: true,
804
+ # synchronicity: SYNCHRONOUS,
805
+ # place_of_service_code: PHARMACY,
806
+ # place_of_service_code_as_submitted: PHARMACY,
807
+ # appointment_type: "string",
808
+ # end_date_of_service: DateTime.parse(2023-01-15),
809
+ # subscriber_primary: { insurance_card: { member_id: "string", payer_name: "string", payer_id: "string", rx_bin: "string", rx_pcn: "string", image_url_front: "string", image_url_back: "string", emr_payer_crosswalk: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
810
+ # subscriber_secondary: { insurance_card: { member_id: "string", payer_name: "string", payer_id: "string", rx_bin: "string", rx_pcn: "string", image_url_front: "string", image_url_back: "string", emr_payer_crosswalk: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
811
+ # additional_information: "string",
812
+ # service_authorization_exception_code: C_1,
813
+ # admission_date: DateTime.parse(2023-01-15),
814
+ # discharge_date: DateTime.parse(2023-01-15),
815
+ # onset_of_current_illness_or_symptom_date: DateTime.parse(2023-01-15),
816
+ # last_menstrual_period_date: DateTime.parse(2023-01-15),
817
+ # delay_reason_code: C_1,
818
+ # patient_authorized_release: true
819
+ # )
557
820
  def update(encounter_id:, prior_authorization_number: nil, external_id: nil, date_of_service: nil,
558
- diagnosis_ids: nil, tag_ids: nil, clinical_notes: nil, pay_to_address: nil, billable_status: nil, responsible_party: nil, provider_accepts_assignment: nil, benefits_assigned_to_provider: nil, synchronicity: nil, place_of_service_code: nil, appointment_type: nil, end_date_of_service: nil, subscriber_primary: nil, subscriber_secondary: 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, patient_authorized_release: nil, request_options: nil)
559
- response = @request_client.conn.patch("/api/encounters/v4/#{encounter_id}") do |req|
821
+ diagnosis_ids: nil, tag_ids: nil, clinical_notes: nil, pay_to_address: nil, billable_status: nil, responsible_party: nil, provider_accepts_assignment: nil, benefits_assigned_to_provider: nil, synchronicity: nil, place_of_service_code: nil, place_of_service_code_as_submitted: nil, appointment_type: nil, end_date_of_service: nil, subscriber_primary: nil, subscriber_secondary: 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, patient_authorized_release: nil, request_options: nil)
822
+ response = @request_client.conn.patch do |req|
560
823
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
561
824
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
562
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
825
+ req.headers = {
826
+ **(req.headers || {}),
827
+ **@request_client.get_headers,
828
+ **(request_options&.additional_headers || {})
829
+ }.compact
563
830
  req.body = {
564
831
  **(request_options&.additional_body_parameters || {}),
565
832
  prior_authorization_number: prior_authorization_number,
@@ -575,6 +842,7 @@ module CandidApiClient
575
842
  benefits_assigned_to_provider: benefits_assigned_to_provider,
576
843
  synchronicity: synchronicity,
577
844
  place_of_service_code: place_of_service_code,
845
+ place_of_service_code_as_submitted: place_of_service_code_as_submitted,
578
846
  appointment_type: appointment_type,
579
847
  end_date_of_service: end_date_of_service,
580
848
  subscriber_primary: subscriber_primary,
@@ -588,48 +856,75 @@ module CandidApiClient
588
856
  delay_reason_code: delay_reason_code,
589
857
  patient_authorized_release: patient_authorized_release
590
858
  }.compact
859
+ req.url "#{@request_client.get_url(environment: CandidApi,
860
+ request_options: request_options)}/api/encounters/v4/#{encounter_id}"
591
861
  end
592
- Encounters::V4::Encounter.from_json(json_object: response.body)
862
+ CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
593
863
  end
594
864
  end
595
865
 
596
866
  class AsyncV4Client
867
+ # @return [CandidApiClient::AsyncRequestClient]
597
868
  attr_reader :request_client
598
869
 
599
- # @param request_client [AsyncRequestClient]
600
- # @return [Encounters::V4::AsyncV4Client]
870
+ # @param request_client [CandidApiClient::AsyncRequestClient]
871
+ # @return [CandidApiClient::Encounters::V4::AsyncV4Client]
601
872
  def initialize(request_client:)
602
- # @type [AsyncRequestClient]
603
873
  @request_client = request_client
604
874
  end
605
875
 
606
876
  # @param limit [Integer] Maximum number of entities per page, defaults to 100.
607
- # @param claim_status [Claims::ClaimStatus] Indicates the current status of an insurance claim within the billing process.
608
- # @param sort [Encounters::V4::EncounterSortOptions] Defaults to created_at:desc.
609
- # @param page_token [Commons::PAGE_TOKEN]
610
- # @param date_of_service_min [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
611
- # @param date_of_service_max [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
877
+ # @param claim_status [CandidApiClient::Claims::Types::ClaimStatus] Indicates the current status of an insurance claim within the billing process.
878
+ # @param sort [CandidApiClient::Encounters::V4::Types::EncounterSortOptions] Defaults to created_at:desc.
879
+ # @param page_token [String]
880
+ # @param date_of_service_min [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
881
+ # @param date_of_service_max [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
612
882
  # @param primary_payer_names [String] Comma delimited string.
613
- # @param search_term [String] Filter by any of the following fields: encounter_id, claim_id, patient external_id,
614
- # patient date of birth, patient first name, patient last name,
615
- # or encounter external id.
616
- # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] Filter to an exact match on encounter external_id, if one exists.
617
- # @param diagnoses_updated_since [DateTime] ISO 8601 timestamp; ideally in UTC (although not required): 2019-08-24T14:15:22Z.
618
- # @param tag_ids [Tags::TAG_ID] Filter by name of tags on encounters.
619
- # @param work_queue_id [Commons::WORK_QUEUE_ID]
620
- # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
621
- # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use SELF_PAY if you intend to bill self pay/cash pay.
622
- # @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.
883
+ # @param search_term [String] Filter by any of the following fields: encounter_id, claim_id, patient
884
+ # external_id,
885
+ # patient date of birth, patient first name, patient last name,
886
+ # or encounter external id.
887
+ # @param external_id [String] Filter to an exact match on encounter external_id, if one exists.
888
+ # @param diagnoses_updated_since [DateTime] ISO 8601 timestamp; ideally in UTC (although not required):
889
+ # 2019-08-24T14:15:22Z.
890
+ # @param tag_ids [String] Filter by name of tags on encounters.
891
+ # @param work_queue_id [String]
892
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
893
+ # Examples for when this should be set to NOT_BILLABLE include if the Encounter
894
+ # has not occurred yet or if there is no intention of ever billing the
895
+ # responsible_party.
896
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use
897
+ # SELF_PAY if you intend to bill self pay/cash pay.
898
+ # @param owner_of_next_action [CandidApiClient::Encounters::V4::Types::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as
899
+ # defined by ownership of open Tasks.
623
900
  # @param patient_external_id [String] The patient ID from the external EMR platform for the patient
624
- # @param request_options [RequestOptions]
625
- # @return [Encounters::V4::EncounterPage]
901
+ # @param request_options [CandidApiClient::RequestOptions]
902
+ # @return [CandidApiClient::Encounters::V4::Types::EncounterPage]
903
+ # @example
904
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
905
+ # api.encounters.v_4.get_all(
906
+ # limit: 100,
907
+ # claim_status: BILLER_RECEIVED,
908
+ # sort: CREATED_AT_ASC,
909
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
910
+ # date_of_service_min: DateTime.parse(2019-08-24),
911
+ # date_of_service_max: DateTime.parse(2019-08-25),
912
+ # primary_payer_names: "Medicare,Medicaid",
913
+ # search_term: "doe",
914
+ # external_id: "123456",
915
+ # diagnoses_updated_since: DateTime.parse(2019-08-24T14:15:22.000Z)
916
+ # )
626
917
  def get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil,
627
918
  date_of_service_max: nil, primary_payer_names: nil, search_term: nil, external_id: nil, diagnoses_updated_since: nil, tag_ids: nil, work_queue_id: nil, billable_status: nil, responsible_party: nil, owner_of_next_action: nil, patient_external_id: nil, request_options: nil)
628
919
  Async do
629
- response = @request_client.conn.get("/api/encounters/v4") do |req|
920
+ response = @request_client.conn.get do |req|
630
921
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
631
922
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
632
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
923
+ req.headers = {
924
+ **(req.headers || {}),
925
+ **@request_client.get_headers,
926
+ **(request_options&.additional_headers || {})
927
+ }.compact
633
928
  req.params = {
634
929
  **(request_options&.additional_query_parameters || {}),
635
930
  "limit": limit,
@@ -649,136 +944,173 @@ module CandidApiClient
649
944
  "owner_of_next_action": owner_of_next_action,
650
945
  "patient_external_id": patient_external_id
651
946
  }.compact
947
+ req.url "#{@request_client.get_url(environment: CandidApi,
948
+ request_options: request_options)}/api/encounters/v4"
652
949
  end
653
- Encounters::V4::EncounterPage.from_json(json_object: response.body)
950
+ CandidApiClient::Encounters::V4::Types::EncounterPage.from_json(json_object: response.body)
654
951
  end
655
952
  end
656
953
 
657
- # @param encounter_id [Commons::ENCOUNTER_ID]
658
- # @param request_options [RequestOptions]
659
- # @return [Encounters::V4::Encounter]
954
+ # @param encounter_id [String]
955
+ # @param request_options [CandidApiClient::RequestOptions]
956
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
957
+ # @example
958
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
959
+ # api.encounters.v_4.get(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
660
960
  def get(encounter_id:, request_options: nil)
661
961
  Async do
662
- response = @request_client.conn.get("/api/encounters/v4/#{encounter_id}") do |req|
962
+ response = @request_client.conn.get do |req|
663
963
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
664
964
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
665
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
965
+ req.headers = {
966
+ **(req.headers || {}),
967
+ **@request_client.get_headers,
968
+ **(request_options&.additional_headers || {})
969
+ }.compact
970
+ req.url "#{@request_client.get_url(environment: CandidApi,
971
+ request_options: request_options)}/api/encounters/v4/#{encounter_id}"
666
972
  end
667
- Encounters::V4::Encounter.from_json(json_object: response.body)
973
+ CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
668
974
  end
669
975
  end
670
976
 
671
- # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
672
- # for example, your internal encounter ID or a Dr. Chrono encounter ID.
673
- # This field should not contain PHI.
674
- # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
977
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
978
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
979
+ # This field should not contain PHI.
980
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
675
981
  # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
676
- # for billing purpose.
677
- # Box 12 on the CMS-1500 claim form.
982
+ # for billing purpose.
983
+ # Box 12 on the CMS-1500 claim form.
678
984
  # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
679
- # not them. If false, patient may receive reimbursement.
680
- # Box 13 on the CMS-1500 claim form.
985
+ # not them. If false, patient may receive reimbursement.
986
+ # Box 13 on the CMS-1500 claim form.
681
987
  # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
682
- # to be made to you, not them.
683
- # Box 27 on the CMS-1500 claim form.
684
- # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
685
- # @param existing_medications [Array<Hash>] Request of type Array<Encounters::V4::Medication>, as a Hash
988
+ # to be made to you, not them.
989
+ # Box 27 on the CMS-1500 claim form.
990
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
991
+ # Headaches").
992
+ # @param existing_medications [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Medication>, as a Hash
686
993
  # * :name (String)
687
- # * :rx_cui (Encounters::V4::RX_CUI)
994
+ # * :rx_cui (String)
688
995
  # * :dosage (String)
689
996
  # * :dosage_form (String)
690
997
  # * :frequency (String)
691
998
  # * :as_needed (Boolean)
692
- # @param vitals [Hash] Request of type Encounters::V4::Vitals, as a Hash
999
+ # @param vitals [Hash] Request of type CandidApiClient::Encounters::V4::Types::Vitals, as a Hash
693
1000
  # * :height_in (Integer)
694
1001
  # * :weight_lbs (Integer)
695
1002
  # * :blood_pressure_systolic_mmhg (Integer)
696
1003
  # * :blood_pressure_diastolic_mmhg (Integer)
697
1004
  # * :body_temperature_f (Float)
698
- # @param interventions [Array<Hash>] Request of type Array<Encounters::V4::Intervention>, as a Hash
1005
+ # @param interventions [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Intervention>, as a Hash
699
1006
  # * :name (String)
700
- # * :category (Encounters::V4::InterventionCategory)
1007
+ # * :category (CandidApiClient::Encounters::V4::Types::InterventionCategory)
701
1008
  # * :description (String)
702
1009
  # * :medication (Hash)
703
1010
  # * :name (String)
704
- # * :rx_cui (Encounters::V4::RX_CUI)
1011
+ # * :rx_cui (String)
705
1012
  # * :dosage (String)
706
1013
  # * :dosage_form (String)
707
1014
  # * :frequency (String)
708
1015
  # * :as_needed (Boolean)
709
- # * :labs (Array<Encounters::V4::Lab>)
710
- # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type Commons::StreetAddressLongZip, as a Hash
1016
+ # * :labs (Array<CandidApiClient::Encounters::V4::Types::Lab>)
1017
+ # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type CandidApiClient::Commons::Types::StreetAddressLongZip, as a Hash
711
1018
  # * :zip_plus_four_code (String)
712
1019
  # * :address_1 (String)
713
1020
  # * :address_2 (String)
714
1021
  # * :city (String)
715
- # * :state (Commons::State)
1022
+ # * :state (CandidApiClient::Commons::Types::State)
716
1023
  # * :zip_code (String)
717
- # @param synchronicity [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
718
- # Asynchronous encounters occur when providers and patients communicate online using
719
- # forms, instant messaging, or other pre-recorded digital mediums.
720
- # Synchronous encounters occur in live, real-time settings where the patient interacts
721
- # directly with the provider, such as over video or a phone call.
722
- # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
723
- # Examples for when this should be set to NOT_BILLABLE include
724
- # if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
725
- # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
1024
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
1025
+ # Asynchronous encounters occur when providers and patients communicate online
1026
+ # using
1027
+ # forms, instant messaging, or other pre-recorded digital mediums.
1028
+ # Synchronous encounters occur in live, real-time settings where the patient
1029
+ # interacts
1030
+ # directly with the provider, such as over video or a phone call.
1031
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
1032
+ # Examples for when this should be set to NOT_BILLABLE include
1033
+ # if the Encounter has not occurred yet or if there is no intention of ever
1034
+ # billing the responsible_party.
1035
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
726
1036
  # @param additional_information [String] Defines additional information on the claim needed by the payer.
727
- # Box 19 on the CMS-1500 claim form.
728
- # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
729
- # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
730
- # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
731
- # obtaining the authorization.
732
- # @param admission_date [Commons::DATE] 837p Loop2300 DTP\*435, CMS-1500 Box 18
733
- # Required on all ambulance claims when the patient was known to be admitted to the hospital.
734
- # OR
735
- # Required on all claims involving inpatient medical visits.
736
- # @param discharge_date [Commons::DATE] 837p Loop2300 DTP\*096, CMS-1500 Box 18
737
- # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
738
- # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP\*431, CMS-1500 Box 14
739
- # 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.
740
- # OR
741
- # This date is the onset of acute symptoms for the current illness or condition.
742
- # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP\*484, CMS-1500 Box 14
743
- # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
744
- # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
745
- # Code indicating the reason why a request was delayed
1037
+ # Box 19 on the CMS-1500 claim form.
1038
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
1039
+ # Required when mandated by government law or regulation to obtain authorization
1040
+ # for specific service(s) but, for the
1041
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
1042
+ # the service was performed without
1043
+ # obtaining the authorization.
1044
+ # @param admission_date [Date] 837p Loop2300 DTP\*435, CMS-1500 Box 18
1045
+ # Required on all ambulance claims when the patient was known to be admitted to
1046
+ # the hospital.
1047
+ # OR
1048
+ # Required on all claims involving inpatient medical visits.
1049
+ # @param discharge_date [Date] 837p Loop2300 DTP\*096, CMS-1500 Box 18
1050
+ # Required for inpatient claims when the patient was discharged from the facility
1051
+ # and the discharge date is known.
1052
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP\*431, CMS-1500 Box 14
1053
+ # Required for the initial medical service or visit performed in response to a
1054
+ # medical emergency when the date is available and is different than the date of
1055
+ # service.
1056
+ # OR
1057
+ # This date is the onset of acute symptoms for the current illness or condition.
1058
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP\*484, CMS-1500 Box 14
1059
+ # Required when, in the judgment of the provider, the services on this claim are
1060
+ # related to the patient's pregnancy.
1061
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
1062
+ # Code indicating the reason why a request was delayed
746
1063
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
747
- # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
748
- # This date must be the local date in the timezone where the service occurred.
749
- # Box 24a on the CMS-1500 claim form.
750
- # If service occurred over a range of dates, this should be the start date.
751
- # date_of_service must be defined on either the encounter or the service lines but not both.
752
- # If there are greater than zero service lines, it is recommended to specify date_of_service on the service_line instead of on the encounter to prepare for future API versions.
753
- # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
754
- # This date must be the local date in the timezone where the service occurred.
755
- # If omitted, the Encounter is assumed to be for a single day.
756
- # Must not be temporally before the date_of_service field.
757
- # If there are greater than zero service lines, it is recommended to specify end_date_of_service on the service_line instead of on the encounter to prepare for future API versions.
758
- # @param patient [Hash] Contains the identification information of the individual receiving medical services.Request of type Individual::PatientCreate, as a Hash
759
- # * :phone_numbers (Array<Commons::PhoneNumber>)
1064
+ # @param _field_set [Object]
1065
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
1066
+ # This date must be the local date in the timezone where the service occurred.
1067
+ # Box 24a on the CMS-1500 claim form.
1068
+ # If service occurred over a range of dates, this should be the start date.
1069
+ # date_of_service must be defined on either the encounter or the service lines but
1070
+ # not both.
1071
+ # If there are greater than zero service lines, it is recommended to specify
1072
+ # date_of_service on the service_line instead of on the encounter to prepare for
1073
+ # future API versions.
1074
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1075
+ # This date must be the local date in the timezone where the service occurred.
1076
+ # If omitted, the Encounter is assumed to be for a single day.
1077
+ # Must not be temporally before the date_of_service field.
1078
+ # If there are greater than zero service lines, it is recommended to specify
1079
+ # end_date_of_service on the service_line instead of on the encounter to prepare
1080
+ # for future API versions.
1081
+ # @param patient [Hash] Contains the identification information of the individual receiving medical
1082
+ # services.Request of type CandidApiClient::Individual::Types::PatientCreate, as a Hash
1083
+ # * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
760
1084
  # * :phone_consent (Boolean)
761
- # * :email (Commons::EMAIL)
1085
+ # * :email (String)
762
1086
  # * :email_consent (Boolean)
763
1087
  # * :external_id (String)
764
- # * :date_of_birth (Commons::DATE)
1088
+ # * :date_of_birth (Date)
765
1089
  # * :address (Hash)
766
1090
  # * :zip_plus_four_code (String)
767
1091
  # * :address_1 (String)
768
1092
  # * :address_2 (String)
769
1093
  # * :city (String)
770
- # * :state (Commons::State)
1094
+ # * :state (CandidApiClient::Commons::Types::State)
771
1095
  # * :zip_code (String)
772
1096
  # * :first_name (String)
773
1097
  # * :last_name (String)
774
- # * :gender (Individual::Gender)
775
- # @param billing_provider [Hash] 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.Request of type EncounterProviders::V2::BillingProvider, as a Hash
1098
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1099
+ # @param billing_provider [Hash] The billing provider is the provider or business entity submitting the claim.
1100
+ # Billing provider may be, but is not necessarily, the same person/NPI as the
1101
+ # rendering provider. From a payer's perspective, this represents the person or
1102
+ # entity being reimbursed. When a contract exists with the target payer, the
1103
+ # billing provider should be the entity contracted with the payer. In some
1104
+ # circumstances, this will be an individual provider. In that case, submit that
1105
+ # provider's NPI and the tax ID (TIN) that the provider gave to the payer during
1106
+ # contracting. In other cases, the billing entity will be a medical group. If so,
1107
+ # submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.Request of type CandidApiClient::EncounterProviders::V2::Types::BillingProvider, as a Hash
776
1108
  # * :address (Hash)
777
1109
  # * :zip_plus_four_code (String)
778
1110
  # * :address_1 (String)
779
1111
  # * :address_2 (String)
780
1112
  # * :city (String)
781
- # * :state (Commons::State)
1113
+ # * :state (CandidApiClient::Commons::Types::State)
782
1114
  # * :zip_code (String)
783
1115
  # * :tax_id (String)
784
1116
  # * :npi (String)
@@ -786,25 +1118,26 @@ module CandidApiClient
786
1118
  # * :first_name (String)
787
1119
  # * :last_name (String)
788
1120
  # * :organization_name (String)
789
- # @param rendering_provider [Hash] The rendering provider is the practitioner -- physician, nurse practitioner, etc. -- performing the service.
790
- # 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.Request of type EncounterProviders::V2::RenderingProvider, as a Hash
1121
+ # @param rendering_provider [Hash] The rendering provider is the practitioner -- physician, nurse practitioner,
1122
+ # etc. -- performing the service.
1123
+ # For telehealth services, the rendering provider performs the visit, asynchronous
1124
+ # communication, or other service. The rendering provider address should generally
1125
+ # be the same as the service facility address.Request of type CandidApiClient::EncounterProviders::V2::Types::RenderingProvider, as a Hash
791
1126
  # * :address (Hash)
792
1127
  # * :zip_plus_four_code (String)
793
1128
  # * :address_1 (String)
794
1129
  # * :address_2 (String)
795
1130
  # * :city (String)
796
- # * :state (Commons::State)
1131
+ # * :state (CandidApiClient::Commons::Types::State)
797
1132
  # * :zip_code (String)
798
1133
  # * :npi (String)
799
1134
  # * :taxonomy_code (String)
800
1135
  # * :first_name (String)
801
1136
  # * :last_name (String)
802
1137
  # * :organization_name (String)
803
- # @param referring_provider [Hash] The provider who referred the services that were rendered.
804
- # All physicians who order services or refer Medicare beneficiaries must
805
- # report this data.
806
- # If a claim involves multiple referring physicians, create a separate
807
- # encounter for each physician.Request of type EncounterProviders::V2::ReferringProvider, as a Hash
1138
+ # @param referring_provider [Hash] The final provider who referred the services that were rendered.
1139
+ # All physicians who order services or refer Medicare beneficiaries must
1140
+ # report this data.Request of type CandidApiClient::EncounterProviders::V2::Types::ReferringProvider, as a Hash
808
1141
  # * :npi (String)
809
1142
  # * :taxonomy_code (String)
810
1143
  # * :address (Hash)
@@ -812,25 +1145,73 @@ module CandidApiClient
812
1145
  # * :address_1 (String)
813
1146
  # * :address_2 (String)
814
1147
  # * :city (String)
815
- # * :state (Commons::State)
1148
+ # * :state (CandidApiClient::Commons::Types::State)
816
1149
  # * :zip_code (String)
817
1150
  # * :first_name (String)
818
1151
  # * :last_name (String)
819
1152
  # * :organization_name (String)
820
- # @param service_facility [Hash] 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.Request of type ServiceFacility::EncounterServiceFacilityBase, as a Hash
1153
+ # @param initial_referring_provider [Hash] The second iteration of Loop ID-2310. Use code "P3 - Primary Care Provider" in
1154
+ # this loop to
1155
+ # indicate the initial referral from the primary care provider or whatever
1156
+ # provider wrote the initial referral for this patient's episode of care being
1157
+ # billed/reported in this transaction.
1158
+ # Information in Loop ID-2310 applies to the entire claim unless overridden on a
1159
+ # service line by the presence of Loop ID-2420 with the same value in NM101.Request of type CandidApiClient::EncounterProviders::V2::Types::InitialReferringProvider, as a Hash
1160
+ # * :npi (String)
1161
+ # * :taxonomy_code (String)
1162
+ # * :address (Hash)
1163
+ # * :zip_plus_four_code (String)
1164
+ # * :address_1 (String)
1165
+ # * :address_2 (String)
1166
+ # * :city (String)
1167
+ # * :state (CandidApiClient::Commons::Types::State)
1168
+ # * :zip_code (String)
1169
+ # * :qualifier (CandidApiClient::Commons::Types::QualifierCode)
1170
+ # * :first_name (String)
1171
+ # * :last_name (String)
821
1172
  # * :organization_name (String)
1173
+ # @param supervising_provider [Hash] Required when the rendering provider is supervised by a physician. If not
1174
+ # required by this implementation guide, do not send.
1175
+ # Information in Loop ID-2310 applies to the entire claim unless overridden on a
1176
+ # service line by the presence of Loop ID-2420 with the same value in NM101.Request of type CandidApiClient::EncounterProviders::V2::Types::SupervisingProvider, as a Hash
822
1177
  # * :npi (String)
1178
+ # * :taxonomy_code (String)
823
1179
  # * :address (Hash)
824
1180
  # * :zip_plus_four_code (String)
825
1181
  # * :address_1 (String)
826
1182
  # * :address_2 (String)
827
1183
  # * :city (String)
828
- # * :state (Commons::State)
1184
+ # * :state (CandidApiClient::Commons::Types::State)
829
1185
  # * :zip_code (String)
830
- # @param subscriber_primary [Hash] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e. when the claim should be billed to insurance).
831
- # These are not required fields when responsible_party is SELF_PAY (i.e. when the claim should be billed to the patient).
832
- # However, if you collect this for patients, even self-pay, we recommend including it when sending encounters to Candid.
833
- # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party to define self-pay claims.Request of type Individual::SubscriberCreate, as a Hash
1186
+ # * :first_name (String)
1187
+ # * :last_name (String)
1188
+ # * :organization_name (String)
1189
+ # @param service_facility [Hash] Encounter Service facility is typically the location a medical service was
1190
+ # rendered, such as a provider office or hospital. For telehealth, service
1191
+ # facility can represent the provider's location when the service was delivered
1192
+ # (e.g., home), or the location where an in-person visit would have taken place,
1193
+ # whichever is easier to identify. If the provider is in-network, service facility
1194
+ # may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that
1195
+ # for an in-network claim to be successfully adjudicated, the service facility
1196
+ # address listed on claims must match what was provided to the payer during the
1197
+ # credentialing process.Request of type CandidApiClient::ServiceFacility::Types::EncounterServiceFacilityBase, as a Hash
1198
+ # * :organization_name (String)
1199
+ # * :npi (String)
1200
+ # * :address (Hash)
1201
+ # * :zip_plus_four_code (String)
1202
+ # * :address_1 (String)
1203
+ # * :address_2 (String)
1204
+ # * :city (String)
1205
+ # * :state (CandidApiClient::Commons::Types::State)
1206
+ # * :zip_code (String)
1207
+ # @param subscriber_primary [Hash] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e.
1208
+ # when the claim should be billed to insurance).
1209
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the
1210
+ # claim should be billed to the patient).
1211
+ # However, if you collect this for patients, even self-pay, we recommend including
1212
+ # it when sending encounters to Candid.
1213
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party
1214
+ # to define self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
834
1215
  # * :insurance_card (Hash)
835
1216
  # * :member_id (String)
836
1217
  # * :payer_name (String)
@@ -839,24 +1220,24 @@ module CandidApiClient
839
1220
  # * :rx_pcn (String)
840
1221
  # * :image_url_front (String)
841
1222
  # * :image_url_back (String)
842
- # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
1223
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
843
1224
  # * :group_number (String)
844
1225
  # * :plan_name (String)
845
- # * :plan_type (Commons::SourceOfPaymentCode)
846
- # * :insurance_type (Commons::InsuranceTypeCode)
847
- # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
848
- # * :date_of_birth (Commons::DATE)
1226
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1227
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1228
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1229
+ # * :date_of_birth (Date)
849
1230
  # * :address (Hash)
850
1231
  # * :zip_plus_four_code (String)
851
1232
  # * :address_1 (String)
852
1233
  # * :address_2 (String)
853
1234
  # * :city (String)
854
- # * :state (Commons::State)
1235
+ # * :state (CandidApiClient::Commons::Types::State)
855
1236
  # * :zip_code (String)
856
1237
  # * :first_name (String)
857
1238
  # * :last_name (String)
858
- # * :gender (Individual::Gender)
859
- # @param subscriber_secondary [Hash] Please always include this when you have it, even for self-pay claims.Request of type Individual::SubscriberCreate, as a Hash
1239
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1240
+ # @param subscriber_secondary [Hash] Please always include this when you have it, even for self-pay claims.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
860
1241
  # * :insurance_card (Hash)
861
1242
  # * :member_id (String)
862
1243
  # * :payer_name (String)
@@ -865,63 +1246,121 @@ module CandidApiClient
865
1246
  # * :rx_pcn (String)
866
1247
  # * :image_url_front (String)
867
1248
  # * :image_url_back (String)
868
- # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
1249
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
869
1250
  # * :group_number (String)
870
1251
  # * :plan_name (String)
871
- # * :plan_type (Commons::SourceOfPaymentCode)
872
- # * :insurance_type (Commons::InsuranceTypeCode)
873
- # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
874
- # * :date_of_birth (Commons::DATE)
1252
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1253
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1254
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1255
+ # * :date_of_birth (Date)
875
1256
  # * :address (Hash)
876
1257
  # * :zip_plus_four_code (String)
877
1258
  # * :address_1 (String)
878
1259
  # * :address_2 (String)
879
1260
  # * :city (String)
880
- # * :state (Commons::State)
1261
+ # * :state (CandidApiClient::Commons::Types::State)
881
1262
  # * :zip_code (String)
882
1263
  # * :first_name (String)
883
1264
  # * :last_name (String)
884
- # * :gender (Individual::Gender)
885
- # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
886
- # may be submitted at this time, and coders will later prioritize the 12 that will be
887
- # submitted to the payor.Request of type Array<Diagnoses::DiagnosisCreate>, as a Hash
1265
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1266
+ # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more
1267
+ # diagnoses
1268
+ # may be submitted at this time, and coders will later prioritize the 12 that will
1269
+ # be
1270
+ # submitted to the payor.Request of type Array<CandidApiClient::Diagnoses::Types::DiagnosisCreate>, as a Hash
888
1271
  # * :name (String)
889
- # * :code_type (Diagnoses::DiagnosisTypeCode)
1272
+ # * :code_type (CandidApiClient::Diagnoses::Types::DiagnosisTypeCode)
890
1273
  # * :code (String)
891
- # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during patient encounters.Request of type Array<Encounters::V4::ClinicalNoteCategoryCreate>, as a Hash
892
- # * :category (Encounters::V4::NoteCategory)
893
- # * :notes (Array<Encounters::V4::ClinicalNote>)
1274
+ # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during
1275
+ # patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash
1276
+ # * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
1277
+ # * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
894
1278
  # @param billing_notes [Array<Hash>] Spot to store misc, human-readable, notes about this encounter to be used
895
- # in the billing process.Request of type Array<BillingNotes::V2::BillingNoteBase>, as a Hash
1279
+ # in the billing process.Request of type Array<CandidApiClient::BillingNotes::V2::Types::BillingNoteBase>, as a Hash
896
1280
  # * :text (String)
897
- # @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).
898
- # @param patient_histories [Array<Hash>] Request of type Array<Encounters::V4::PatientHistoryCategory>, as a Hash
899
- # * :category (Encounters::V4::PatientHistoryCategoryEnum)
900
- # * :questions (Array<Encounters::V4::IntakeQuestion>)
1281
+ # @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
1282
+ # supported. 02 for telemedicine, 11 for in-person. Full list
1283
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
1284
+ # @param patient_histories [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::PatientHistoryCategory>, as a Hash
1285
+ # * :category (CandidApiClient::Encounters::V4::Types::PatientHistoryCategoryEnum)
1286
+ # * :questions (Array<CandidApiClient::Encounters::V4::Types::IntakeQuestion>)
901
1287
  # @param service_lines [Array<Hash>] Each service line must be linked to a diagnosis. Concretely,
902
- # `service_line.diagnosis_pointers`must contain at least one entry which should be
903
- # in bounds of the diagnoses list field.Request of type Array<ServiceLines::V2::ServiceLineCreate>, as a Hash
904
- # * :modifiers (Array<Commons::ProcedureModifier>)
1288
+ # `service_line.diagnosis_pointers`must contain at least one entry which should be
1289
+ # in bounds of the diagnoses list field.Request of type Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineCreate>, as a Hash
1290
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
905
1291
  # * :procedure_code (String)
906
- # * :quantity (Commons::DECIMAL)
907
- # * :units (Commons::ServiceLineUnits)
1292
+ # * :quantity (String)
1293
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
908
1294
  # * :charge_amount_cents (Integer)
909
1295
  # * :diagnosis_pointers (Array<Integer>)
910
1296
  # * :drug_identification (Hash)
911
- # * :service_id_qualifier (ServiceLines::V2::ServiceIdQualifier)
1297
+ # * :service_id_qualifier (CandidApiClient::ServiceLines::V2::Types::ServiceIdQualifier)
912
1298
  # * :national_drug_code (String)
913
1299
  # * :national_drug_unit_count (String)
914
- # * :measurement_unit_code (ServiceLines::V2::MeasurementUnitCode)
1300
+ # * :measurement_unit_code (CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode)
915
1301
  # * :link_sequence_number (String)
916
1302
  # * :pharmacy_prescription_number (String)
917
- # * :place_of_service_code (Commons::FacilityTypeCode)
1303
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
918
1304
  # * :description (String)
919
1305
  # * :date_of_service (Date)
920
1306
  # * :end_date_of_service (Date)
921
- # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type Guarantor::V1::GuarantorCreate, as a Hash
922
- # * :phone_numbers (Array<Commons::PhoneNumber>)
1307
+ # * :referring_provider (Hash)
1308
+ # * :npi (String)
1309
+ # * :taxonomy_code (String)
1310
+ # * :address (Hash)
1311
+ # * :zip_plus_four_code (String)
1312
+ # * :address_1 (String)
1313
+ # * :address_2 (String)
1314
+ # * :city (String)
1315
+ # * :state (CandidApiClient::Commons::Types::State)
1316
+ # * :zip_code (String)
1317
+ # * :first_name (String)
1318
+ # * :last_name (String)
1319
+ # * :organization_name (String)
1320
+ # * :initial_referring_provider (Hash)
1321
+ # * :npi (String)
1322
+ # * :taxonomy_code (String)
1323
+ # * :address (Hash)
1324
+ # * :zip_plus_four_code (String)
1325
+ # * :address_1 (String)
1326
+ # * :address_2 (String)
1327
+ # * :city (String)
1328
+ # * :state (CandidApiClient::Commons::Types::State)
1329
+ # * :zip_code (String)
1330
+ # * :qualifier (CandidApiClient::Commons::Types::QualifierCode)
1331
+ # * :first_name (String)
1332
+ # * :last_name (String)
1333
+ # * :organization_name (String)
1334
+ # * :supervising_provider (Hash)
1335
+ # * :npi (String)
1336
+ # * :taxonomy_code (String)
1337
+ # * :address (Hash)
1338
+ # * :zip_plus_four_code (String)
1339
+ # * :address_1 (String)
1340
+ # * :address_2 (String)
1341
+ # * :city (String)
1342
+ # * :state (CandidApiClient::Commons::Types::State)
1343
+ # * :zip_code (String)
1344
+ # * :first_name (String)
1345
+ # * :last_name (String)
1346
+ # * :organization_name (String)
1347
+ # * :ordering_provider (Hash)
1348
+ # * :npi (String)
1349
+ # * :taxonomy_code (String)
1350
+ # * :address (Hash)
1351
+ # * :zip_plus_four_code (String)
1352
+ # * :address_1 (String)
1353
+ # * :address_2 (String)
1354
+ # * :city (String)
1355
+ # * :state (CandidApiClient::Commons::Types::State)
1356
+ # * :zip_code (String)
1357
+ # * :first_name (String)
1358
+ # * :last_name (String)
1359
+ # * :organization_name (String)
1360
+ # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type CandidApiClient::Guarantor::V1::Types::GuarantorCreate, as a Hash
1361
+ # * :phone_numbers (Array<CandidApiClient::Commons::Types::PhoneNumber>)
923
1362
  # * :phone_consent (Boolean)
924
- # * :email (Commons::EMAIL)
1363
+ # * :email (String)
925
1364
  # * :email_consent (Boolean)
926
1365
  # * :first_name (String)
927
1366
  # * :last_name (String)
@@ -932,24 +1371,53 @@ module CandidApiClient
932
1371
  # * :address_1 (String)
933
1372
  # * :address_2 (String)
934
1373
  # * :city (String)
935
- # * :state (Commons::State)
1374
+ # * :state (CandidApiClient::Commons::Types::State)
936
1375
  # * :zip_code (String)
937
1376
  # @param external_claim_submission [Hash] ***This field is in beta.***
938
- # To be included for claims that have been submitted outside of Candid.
939
- # Candid supports posting remits and payments to these claims and working them in-platform (e.g. editing, resubmitting).Request of type ClaimSubmission::V1::ExternalClaimSubmissionCreate, as a Hash
1377
+ # To be included for claims that have been submitted outside of Candid.
1378
+ # Candid supports posting remits and payments to these claims and working them
1379
+ # in-platform (e.g. editing, resubmitting).Request of type CandidApiClient::ClaimSubmission::V1::Types::ExternalClaimSubmissionCreate, as a Hash
940
1380
  # * :claim_created_at (DateTime)
941
1381
  # * :patient_control_number (String)
942
- # * :submission_records (Array<ClaimSubmission::V1::ClaimSubmissionRecordCreate>)
943
- # @param tag_ids [Array<Tags::TAG_ID>] Names of tags that should be on the encounter.
944
- # @param request_options [RequestOptions]
945
- # @return [Encounters::V4::Encounter]
1382
+ # * :submission_records (Array<CandidApiClient::ClaimSubmission::V1::Types::ClaimSubmissionRecordCreate>)
1383
+ # @param tag_ids [Array<String>] Names of tags that should be on the encounter.
1384
+ # @param request_options [CandidApiClient::RequestOptions]
1385
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
1386
+ # @example
1387
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
1388
+ # api.encounters.v_4.create(
1389
+ # date_of_service: DateTime.parse(2023-01-15),
1390
+ # end_date_of_service: DateTime.parse(2023-01-15),
1391
+ # patient: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "johndoe@joincandidhealth.com", email_consent: true, external_id: "string", date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
1392
+ # billing_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, tax_id: "string", npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
1393
+ # rendering_provider: { address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, npi: "string", taxonomy_code: "string", first_name: "string", last_name: "string", organization_name: "string" },
1394
+ # referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
1395
+ # initial_referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, qualifier: DQ, first_name: "string", last_name: "string", organization_name: "string" },
1396
+ # supervising_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" },
1397
+ # service_facility: { organization_name: "string", npi: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } },
1398
+ # subscriber_primary: { insurance_card: { member_id: "string", payer_name: "string", payer_id: "string", rx_bin: "string", rx_pcn: "string", image_url_front: "string", image_url_back: "string", emr_payer_crosswalk: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
1399
+ # subscriber_secondary: { insurance_card: { member_id: "string", payer_name: "string", payer_id: "string", rx_bin: "string", rx_pcn: "string", image_url_front: "string", image_url_back: "string", emr_payer_crosswalk: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
1400
+ # diagnoses: [{ name: "string", code_type: ABF, code: "string" }],
1401
+ # clinical_notes: [{ category: CLINICAL, notes: [{ }] }],
1402
+ # billing_notes: [{ text: "string" }],
1403
+ # place_of_service_code: PHARMACY,
1404
+ # patient_histories: [{ category: PRESENT_ILLNESS, questions: [{ id: "6E7FBCE4-A8EA-46D0-A8D8-FF83CA3BB176", text: "Do you have any allergies?", responses: [{ response: "No allergies", follow_ups: [{ id: "4F3D57F9-AC94-49D6-87E4-E804B709917A", text: "Do you have any allergies?", response: "No allergies" }] }] }] }],
1405
+ # service_lines: [{ modifiers: [TWENTY_TWO], procedure_code: "string", quantity: "string", units: MJ, charge_amount_cents: 1, diagnosis_pointers: [1], drug_identification: { }, place_of_service_code: PHARMACY, description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15), referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" }, initial_referring_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, qualifier: DQ, first_name: "string", last_name: "string", organization_name: "string" }, supervising_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" }, ordering_provider: { npi: "string", taxonomy_code: "string", address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", organization_name: "string" } }],
1406
+ # guarantor: { phone_numbers: [{ number: "1234567890", type: HOME }], phone_consent: true, email: "johndoe@joincandidhealth.com", email_consent: true, first_name: "string", last_name: "string", external_id: "string", date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" } },
1407
+ # external_claim_submission: { claim_created_at: DateTime.parse(2023-01-01T12:00:00.000Z), patient_control_number: "PATIENT_CONTROL_NUMBER", submission_records: [{ submitted_at: DateTime.parse(2023-01-01T13:00:00.000Z), claim_frequency_code: ORIGINAL, payer_responsibility: PRIMARY, intended_submission_medium: ELECTRONIC }, { submitted_at: DateTime.parse(2023-01-04T12:00:00.000Z), claim_frequency_code: REPLACEMENT, payer_responsibility: PRIMARY, intended_submission_medium: PAPER }] },
1408
+ # tag_ids: ["string"]
1409
+ # )
946
1410
  def create(external_id:, patient_authorized_release:, benefits_assigned_to_provider:,
947
- provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, 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, date_of_service: nil, end_date_of_service: nil, referring_provider: nil, service_facility: nil, subscriber_primary: nil, subscriber_secondary: nil, clinical_notes: nil, billing_notes: nil, patient_histories: nil, service_lines: nil, guarantor: nil, external_claim_submission: nil, tag_ids: nil, request_options: nil)
1411
+ provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, 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, _field_set: nil, date_of_service: nil, end_date_of_service: nil, referring_provider: nil, initial_referring_provider: nil, supervising_provider: nil, service_facility: nil, subscriber_primary: nil, subscriber_secondary: nil, clinical_notes: nil, billing_notes: nil, patient_histories: nil, service_lines: nil, guarantor: nil, external_claim_submission: nil, tag_ids: nil, request_options: nil)
948
1412
  Async do
949
- response = @request_client.conn.post("/api/encounters/v4") do |req|
1413
+ response = @request_client.conn.post do |req|
950
1414
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
951
1415
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
952
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
1416
+ req.headers = {
1417
+ **(req.headers || {}),
1418
+ **@request_client.get_headers,
1419
+ **(request_options&.additional_headers || {})
1420
+ }.compact
953
1421
  req.body = {
954
1422
  **(request_options&.additional_body_parameters || {}),
955
1423
  external_id: external_id,
@@ -973,12 +1441,15 @@ module CandidApiClient
973
1441
  last_menstrual_period_date: last_menstrual_period_date,
974
1442
  delay_reason_code: delay_reason_code,
975
1443
  additional_properties: additional_properties,
1444
+ _field_set: _field_set,
976
1445
  date_of_service: date_of_service,
977
1446
  end_date_of_service: end_date_of_service,
978
1447
  patient: patient,
979
1448
  billing_provider: billing_provider,
980
1449
  rendering_provider: rendering_provider,
981
1450
  referring_provider: referring_provider,
1451
+ initial_referring_provider: initial_referring_provider,
1452
+ supervising_provider: supervising_provider,
982
1453
  service_facility: service_facility,
983
1454
  subscriber_primary: subscriber_primary,
984
1455
  subscriber_secondary: subscriber_secondary,
@@ -992,48 +1463,77 @@ module CandidApiClient
992
1463
  external_claim_submission: external_claim_submission,
993
1464
  tag_ids: tag_ids
994
1465
  }.compact
1466
+ req.url "#{@request_client.get_url(environment: CandidApi,
1467
+ request_options: request_options)}/api/encounters/v4"
995
1468
  end
996
- Encounters::V4::Encounter.from_json(json_object: response.body)
1469
+ CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
997
1470
  end
998
1471
  end
999
1472
 
1000
- # @param encounter_id [Commons::ENCOUNTER_ID]
1001
- # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
1002
- # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
1003
- # for example, your internal encounter ID or a Dr. Chrono encounter ID.
1004
- # This field should not contain PHI.
1005
- # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
1006
- # This date must be the local date in the timezone where the service occurred.
1007
- # Box 24a on the CMS-1500 claim form.
1008
- # If service occurred over a range of dates, this should be the start date.
1009
- # If service lines have distinct date_of_service values, updating the encounter's date_of_service will fail. If all service line date_of_service values are the same, updating the encounter's date_of_service will update all service line date_of_service values.
1010
- # @param diagnosis_ids [Array<Diagnoses::DIAGNOSIS_ID>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
1011
- # may be submitted at this time, and coders will later prioritize the 12 that will be
1012
- # submitted to the payor.
1013
- # @param tag_ids [Array<Tags::TAG_ID>] Names of tags that should be on the encounter. Note all tags on encounter will be overriden with this list.
1014
- # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during patient encounters.Request of type Array<Encounters::V4::ClinicalNoteCategoryCreate>, as a Hash
1015
- # * :category (Encounters::V4::NoteCategory)
1016
- # * :notes (Array<Encounters::V4::ClinicalNote>)
1017
- # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type Commons::StreetAddressLongZip, as a Hash
1473
+ # @param encounter_id [String]
1474
+ # @param prior_authorization_number [String] Box 23 on the CMS-1500 claim form.
1475
+ # @param external_id [String] A client-specified unique ID to associate with this encounter;
1476
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
1477
+ # This field should not contain PHI.
1478
+ # @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
1479
+ # This date must be the local date in the timezone where the service occurred.
1480
+ # Box 24a on the CMS-1500 claim form.
1481
+ # If service occurred over a range of dates, this should be the start date.
1482
+ # If service lines have distinct date_of_service values, updating the encounter's
1483
+ # date_of_service will fail. If all service line date_of_service values are the
1484
+ # same, updating the encounter's date_of_service will update all service line
1485
+ # date_of_service values.
1486
+ # @param diagnosis_ids [Array<String>] Ideally, this field should contain no more than 12 diagnoses. However, more
1487
+ # diagnoses
1488
+ # may be submitted at this time, and coders will later prioritize the 12 that will
1489
+ # be
1490
+ # submitted to the payor.
1491
+ # @param tag_ids [Array<String>] Names of tags that should be on the encounter. Note all tags on encounter will
1492
+ # be overriden with this list.
1493
+ # @param clinical_notes [Array<Hash>] Holds a collection of clinical observations made by healthcare providers during
1494
+ # patient encounters.Request of type Array<CandidApiClient::Encounters::V4::Types::ClinicalNoteCategoryCreate>, as a Hash
1495
+ # * :category (CandidApiClient::Encounters::V4::Types::NoteCategory)
1496
+ # * :notes (Array<CandidApiClient::Encounters::V4::Types::ClinicalNote>)
1497
+ # @param pay_to_address [Hash] Specifies the address to which payments for the claim should be sent.Request of type CandidApiClient::Commons::Types::StreetAddressLongZip, as a Hash
1018
1498
  # * :zip_plus_four_code (String)
1019
1499
  # * :address_1 (String)
1020
1500
  # * :address_2 (String)
1021
1501
  # * :city (String)
1022
- # * :state (Commons::State)
1502
+ # * :state (CandidApiClient::Commons::Types::State)
1023
1503
  # * :zip_code (String)
1024
- # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party. Examples for when this should be set to NOT_BILLABLE include if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
1025
- # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use SELF_PAY if you intend to bill self pay/cash pay.
1026
- # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments to be made to you, not them. Box 27 on the CMS-1500 claim form.
1027
- # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you, not them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim form.
1028
- # @param synchronicity [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter. Asynchronous encounters occur when providers and patients communicate online using forms, instant messaging, or other pre-recorded digital mediums. Synchronous encounters occur in live, real-time settings where the patient interacts directly with the provider, such as over video or a phone call.
1029
- # @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).
1030
- # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
1031
- # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1032
- # This date must be the local date in the timezone where the service occurred.
1033
- # If omitted, the Encounter is assumed to be for a single day.
1034
- # Must not be temporally before the date_of_service field.
1035
- # If service lines have distinct end_date_of_service values, updating the encounter's end_date_of_service will fail. If all service line end_date_of_service values are the same, updating the encounter's end_date_of_service will update all service line date_of_service values.
1036
- # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
1504
+ # @param billable_status [CandidApiClient::Encounters::V4::Types::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
1505
+ # Examples for when this should be set to NOT_BILLABLE include if the Encounter
1506
+ # has not occurred yet or if there is no intention of ever billing the
1507
+ # responsible_party.
1508
+ # @param responsible_party [CandidApiClient::Encounters::V4::Types::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim. Use
1509
+ # SELF_PAY if you intend to bill self pay/cash pay.
1510
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments to
1511
+ # be made to you, not them. Box 27 on the CMS-1500 claim form.
1512
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you, not
1513
+ # them. If false, patient may receive reimbursement. Box 13 on the CMS-1500 claim
1514
+ # form.
1515
+ # @param synchronicity [CandidApiClient::Encounters::V4::Types::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter. Asynchronous
1516
+ # encounters occur when providers and patients communicate online using forms,
1517
+ # instant messaging, or other pre-recorded digital mediums. Synchronous encounters
1518
+ # occur in live, real-time settings where the patient interacts directly with the
1519
+ # provider, such as over video or a phone call.
1520
+ # @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
1521
+ # supported. 02 for telemedicine, 11 for in-person. Full list
1522
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
1523
+ # @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
1524
+ # supported. 02 for telemedicine, 11 for in-person. Full list
1525
+ # //www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
1526
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture -
1527
+ # Headaches").
1528
+ # @param end_date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1529
+ # This date must be the local date in the timezone where the service occurred.
1530
+ # If omitted, the Encounter is assumed to be for a single day.
1531
+ # Must not be temporally before the date_of_service field.
1532
+ # If service lines have distinct end_date_of_service values, updating the
1533
+ # encounter's end_date_of_service will fail. If all service line
1534
+ # end_date_of_service values are the same, updating the encounter's
1535
+ # end_date_of_service will update all service line date_of_service values.
1536
+ # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
1037
1537
  # * :insurance_card (Hash)
1038
1538
  # * :member_id (String)
1039
1539
  # * :payer_name (String)
@@ -1042,24 +1542,24 @@ module CandidApiClient
1042
1542
  # * :rx_pcn (String)
1043
1543
  # * :image_url_front (String)
1044
1544
  # * :image_url_back (String)
1045
- # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
1545
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
1046
1546
  # * :group_number (String)
1047
1547
  # * :plan_name (String)
1048
- # * :plan_type (Commons::SourceOfPaymentCode)
1049
- # * :insurance_type (Commons::InsuranceTypeCode)
1050
- # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
1051
- # * :date_of_birth (Commons::DATE)
1548
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1549
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1550
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1551
+ # * :date_of_birth (Date)
1052
1552
  # * :address (Hash)
1053
1553
  # * :zip_plus_four_code (String)
1054
1554
  # * :address_1 (String)
1055
1555
  # * :address_2 (String)
1056
1556
  # * :city (String)
1057
- # * :state (Commons::State)
1557
+ # * :state (CandidApiClient::Commons::Types::State)
1058
1558
  # * :zip_code (String)
1059
1559
  # * :first_name (String)
1060
1560
  # * :last_name (String)
1061
- # * :gender (Individual::Gender)
1062
- # @param subscriber_secondary [Hash] Contains details of the secondary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
1561
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1562
+ # @param subscriber_secondary [Hash] Contains details of the secondary insurance subscriber.Request of type CandidApiClient::Individual::Types::SubscriberCreate, as a Hash
1063
1563
  # * :insurance_card (Hash)
1064
1564
  # * :member_id (String)
1065
1565
  # * :payer_name (String)
@@ -1068,55 +1568,97 @@ module CandidApiClient
1068
1568
  # * :rx_pcn (String)
1069
1569
  # * :image_url_front (String)
1070
1570
  # * :image_url_back (String)
1071
- # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
1571
+ # * :emr_payer_crosswalk (CandidApiClient::Commons::Types::EmrPayerCrosswalk)
1072
1572
  # * :group_number (String)
1073
1573
  # * :plan_name (String)
1074
- # * :plan_type (Commons::SourceOfPaymentCode)
1075
- # * :insurance_type (Commons::InsuranceTypeCode)
1076
- # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
1077
- # * :date_of_birth (Commons::DATE)
1574
+ # * :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)
1575
+ # * :insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode)
1576
+ # * :patient_relationship_to_subscriber_code (CandidApiClient::Commons::Types::PatientRelationshipToInsuredCodeAll)
1577
+ # * :date_of_birth (Date)
1078
1578
  # * :address (Hash)
1079
1579
  # * :zip_plus_four_code (String)
1080
1580
  # * :address_1 (String)
1081
1581
  # * :address_2 (String)
1082
1582
  # * :city (String)
1083
- # * :state (Commons::State)
1583
+ # * :state (CandidApiClient::Commons::Types::State)
1084
1584
  # * :zip_code (String)
1085
1585
  # * :first_name (String)
1086
1586
  # * :last_name (String)
1087
- # * :gender (Individual::Gender)
1587
+ # * :gender (CandidApiClient::Individual::Types::Gender)
1088
1588
  # @param additional_information [String] Defines additional information on the claim needed by the payer.
1089
- # Box 19 on the CMS-1500 claim form.
1090
- # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
1091
- # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
1092
- # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
1093
- # obtaining the authorization.
1094
- # @param admission_date [Commons::DATE] 837p Loop2300 DTP*435, CMS-1500 Box 18
1095
- # Required on all ambulance claims when the patient was known to be admitted to the hospital.
1096
- # OR
1097
- # Required on all claims involving inpatient medical visits.
1098
- # @param discharge_date [Commons::DATE] 837p Loop2300 DTP*096, CMS-1500 Box 18
1099
- # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
1100
- # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP*431, CMS-1500 Box 14
1101
- # 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.
1102
- # OR
1103
- # This date is the onset of acute symptoms for the current illness or condition.
1104
- # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP*484, CMS-1500 Box 14
1105
- # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
1106
- # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
1107
- # Code indicating the reason why a request was delayed
1589
+ # Box 19 on the CMS-1500 claim form.
1590
+ # @param service_authorization_exception_code [CandidApiClient::Encounters::V4::Types::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
1591
+ # Required when mandated by government law or regulation to obtain authorization
1592
+ # for specific service(s) but, for the
1593
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode,
1594
+ # the service was performed without
1595
+ # obtaining the authorization.
1596
+ # @param admission_date [Date] 837p Loop2300 DTP*435, CMS-1500 Box 18
1597
+ # Required on all ambulance claims when the patient was known to be admitted to
1598
+ # the hospital.
1599
+ # OR
1600
+ # Required on all claims involving inpatient medical visits.
1601
+ # @param discharge_date [Date] 837p Loop2300 DTP*096, CMS-1500 Box 18
1602
+ # Required for inpatient claims when the patient was discharged from the facility
1603
+ # and the discharge date is known.
1604
+ # @param onset_of_current_illness_or_symptom_date [Date] 837p Loop2300 DTP*431, CMS-1500 Box 14
1605
+ # Required for the initial medical service or visit performed in response to a
1606
+ # medical emergency when the date is available and is different than the date of
1607
+ # service.
1608
+ # OR
1609
+ # This date is the onset of acute symptoms for the current illness or condition.
1610
+ # @param last_menstrual_period_date [Date] 837p Loop2300 DTP*484, CMS-1500 Box 14
1611
+ # Required when, in the judgment of the provider, the services on this claim are
1612
+ # related to the patient's pregnancy.
1613
+ # @param delay_reason_code [CandidApiClient::Commons::Types::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
1614
+ # Code indicating the reason why a request was delayed
1108
1615
  # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
1109
- # for billing purpose.
1110
- # Box 12 on the CMS-1500 claim form.
1111
- # @param request_options [RequestOptions]
1112
- # @return [Encounters::V4::Encounter]
1616
+ # for billing purpose.
1617
+ # Box 12 on the CMS-1500 claim form.
1618
+ # @param request_options [CandidApiClient::RequestOptions]
1619
+ # @return [CandidApiClient::Encounters::V4::Types::Encounter]
1620
+ # @example
1621
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
1622
+ # api.encounters.v_4.update(
1623
+ # encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
1624
+ # prior_authorization_number: "string",
1625
+ # external_id: "string",
1626
+ # date_of_service: DateTime.parse(2023-01-15),
1627
+ # diagnosis_ids: ["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"],
1628
+ # tag_ids: ["string"],
1629
+ # clinical_notes: [{ category: CLINICAL, notes: [{ }] }],
1630
+ # pay_to_address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" },
1631
+ # billable_status: BILLABLE,
1632
+ # responsible_party: INSURANCE_PAY,
1633
+ # provider_accepts_assignment: true,
1634
+ # benefits_assigned_to_provider: true,
1635
+ # synchronicity: SYNCHRONOUS,
1636
+ # place_of_service_code: PHARMACY,
1637
+ # place_of_service_code_as_submitted: PHARMACY,
1638
+ # appointment_type: "string",
1639
+ # end_date_of_service: DateTime.parse(2023-01-15),
1640
+ # subscriber_primary: { insurance_card: { member_id: "string", payer_name: "string", payer_id: "string", rx_bin: "string", rx_pcn: "string", image_url_front: "string", image_url_back: "string", emr_payer_crosswalk: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
1641
+ # subscriber_secondary: { insurance_card: { member_id: "string", payer_name: "string", payer_id: "string", rx_bin: "string", rx_pcn: "string", image_url_front: "string", image_url_back: "string", emr_payer_crosswalk: HEALTHIE, group_number: "string", plan_name: "string", plan_type: SELF_PAY, insurance_type: C_01 }, patient_relationship_to_subscriber_code: SPOUSE, date_of_birth: DateTime.parse(2023-01-15), address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }, first_name: "string", last_name: "string", gender: MALE },
1642
+ # additional_information: "string",
1643
+ # service_authorization_exception_code: C_1,
1644
+ # admission_date: DateTime.parse(2023-01-15),
1645
+ # discharge_date: DateTime.parse(2023-01-15),
1646
+ # onset_of_current_illness_or_symptom_date: DateTime.parse(2023-01-15),
1647
+ # last_menstrual_period_date: DateTime.parse(2023-01-15),
1648
+ # delay_reason_code: C_1,
1649
+ # patient_authorized_release: true
1650
+ # )
1113
1651
  def update(encounter_id:, prior_authorization_number: nil, external_id: nil, date_of_service: nil,
1114
- diagnosis_ids: nil, tag_ids: nil, clinical_notes: nil, pay_to_address: nil, billable_status: nil, responsible_party: nil, provider_accepts_assignment: nil, benefits_assigned_to_provider: nil, synchronicity: nil, place_of_service_code: nil, appointment_type: nil, end_date_of_service: nil, subscriber_primary: nil, subscriber_secondary: 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, patient_authorized_release: nil, request_options: nil)
1652
+ diagnosis_ids: nil, tag_ids: nil, clinical_notes: nil, pay_to_address: nil, billable_status: nil, responsible_party: nil, provider_accepts_assignment: nil, benefits_assigned_to_provider: nil, synchronicity: nil, place_of_service_code: nil, place_of_service_code_as_submitted: nil, appointment_type: nil, end_date_of_service: nil, subscriber_primary: nil, subscriber_secondary: 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, patient_authorized_release: nil, request_options: nil)
1115
1653
  Async do
1116
- response = @request_client.conn.patch("/api/encounters/v4/#{encounter_id}") do |req|
1654
+ response = @request_client.conn.patch do |req|
1117
1655
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
1118
1656
  req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
1119
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
1657
+ req.headers = {
1658
+ **(req.headers || {}),
1659
+ **@request_client.get_headers,
1660
+ **(request_options&.additional_headers || {})
1661
+ }.compact
1120
1662
  req.body = {
1121
1663
  **(request_options&.additional_body_parameters || {}),
1122
1664
  prior_authorization_number: prior_authorization_number,
@@ -1132,6 +1674,7 @@ module CandidApiClient
1132
1674
  benefits_assigned_to_provider: benefits_assigned_to_provider,
1133
1675
  synchronicity: synchronicity,
1134
1676
  place_of_service_code: place_of_service_code,
1677
+ place_of_service_code_as_submitted: place_of_service_code_as_submitted,
1135
1678
  appointment_type: appointment_type,
1136
1679
  end_date_of_service: end_date_of_service,
1137
1680
  subscriber_primary: subscriber_primary,
@@ -1145,8 +1688,10 @@ module CandidApiClient
1145
1688
  delay_reason_code: delay_reason_code,
1146
1689
  patient_authorized_release: patient_authorized_release
1147
1690
  }.compact
1691
+ req.url "#{@request_client.get_url(environment: CandidApi,
1692
+ request_options: request_options)}/api/encounters/v4/#{encounter_id}"
1148
1693
  end
1149
- Encounters::V4::Encounter.from_json(json_object: response.body)
1694
+ CandidApiClient::Encounters::V4::Types::Encounter.from_json(json_object: response.body)
1150
1695
  end
1151
1696
  end
1152
1697
  end