candidhealth 0.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (346) hide show
  1. checksums.yaml +7 -0
  2. data/lib/candidhealth/auth/client.rb +28 -0
  3. data/lib/candidhealth/auth/v_2/client.rb +90 -0
  4. data/lib/candidhealth/auth/v_2/types/auth_get_token_request.rb +54 -0
  5. data/lib/candidhealth/auth/v_2/types/auth_get_token_response.rb +59 -0
  6. data/lib/candidhealth/auth/v_2/types/too_many_requests_error_type.rb +49 -0
  7. data/lib/candidhealth/billing_notes/client.rb +28 -0
  8. data/lib/candidhealth/billing_notes/v_2/client.rb +76 -0
  9. data/lib/candidhealth/billing_notes/v_2/types/billing_note.rb +89 -0
  10. data/lib/candidhealth/billing_notes/v_2/types/billing_note_base.rb +49 -0
  11. data/lib/candidhealth/billing_notes/v_2/types/billing_note_id.rb +9 -0
  12. data/lib/candidhealth/claim_submission/v_1/types/claim_frequency_type_code.rb +14 -0
  13. data/lib/candidhealth/claim_submission/v_1/types/claim_submission_record_create.rb +68 -0
  14. data/lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create.rb +75 -0
  15. data/lib/candidhealth/claims/types/claim.rb +98 -0
  16. data/lib/candidhealth/claims/types/claim_status.rb +23 -0
  17. data/lib/candidhealth/commons/types/claim_adjustment_group_codes.rb +17 -0
  18. data/lib/candidhealth/commons/types/claim_id.rb +7 -0
  19. data/lib/candidhealth/commons/types/claim_submission_payer_responsibility_type.rb +10 -0
  20. data/lib/candidhealth/commons/types/date.rb +7 -0
  21. data/lib/candidhealth/commons/types/date_range_optional_end.rb +53 -0
  22. data/lib/candidhealth/commons/types/decimal.rb +7 -0
  23. data/lib/candidhealth/commons/types/delay_reason_code.rb +23 -0
  24. data/lib/candidhealth/commons/types/email.rb +7 -0
  25. data/lib/candidhealth/commons/types/emr_payer_crosswalk.rb +10 -0
  26. data/lib/candidhealth/commons/types/encounter_external_id.rb +7 -0
  27. data/lib/candidhealth/commons/types/encounter_id.rb +7 -0
  28. data/lib/candidhealth/commons/types/entity_not_found_error_message.rb +47 -0
  29. data/lib/candidhealth/commons/types/error_message.rb +7 -0
  30. data/lib/candidhealth/commons/types/facility_type_code.rb +61 -0
  31. data/lib/candidhealth/commons/types/http_service_unavailable_error_message.rb +47 -0
  32. data/lib/candidhealth/commons/types/insurance_type_code.rb +79 -0
  33. data/lib/candidhealth/commons/types/invoice_id.rb +7 -0
  34. data/lib/candidhealth/commons/types/link_url.rb +7 -0
  35. data/lib/candidhealth/commons/types/npi.rb +7 -0
  36. data/lib/candidhealth/commons/types/organization_id.rb +7 -0
  37. data/lib/candidhealth/commons/types/organization_not_authorized_error_message.rb +47 -0
  38. data/lib/candidhealth/commons/types/page_token.rb +7 -0
  39. data/lib/candidhealth/commons/types/patient_external_id.rb +7 -0
  40. data/lib/candidhealth/commons/types/patient_relationship_to_insured_code_all.rb +32 -0
  41. data/lib/candidhealth/commons/types/phone_number.rb +53 -0
  42. data/lib/candidhealth/commons/types/phone_number_type.rb +11 -0
  43. data/lib/candidhealth/commons/types/procedure_modifier.rb +395 -0
  44. data/lib/candidhealth/commons/types/provider_id.rb +7 -0
  45. data/lib/candidhealth/commons/types/region_national.rb +41 -0
  46. data/lib/candidhealth/commons/types/region_states.rb +48 -0
  47. data/lib/candidhealth/commons/types/regions.rb +92 -0
  48. data/lib/candidhealth/commons/types/removable_date_range_optional_end.rb +90 -0
  49. data/lib/candidhealth/commons/types/request_validation_error.rb +52 -0
  50. data/lib/candidhealth/commons/types/resource_page.rb +53 -0
  51. data/lib/candidhealth/commons/types/service_line_id.rb +7 -0
  52. data/lib/candidhealth/commons/types/service_line_units.rb +10 -0
  53. data/lib/candidhealth/commons/types/sort_direction.rb +10 -0
  54. data/lib/candidhealth/commons/types/source_of_payment_code.rb +31 -0
  55. data/lib/candidhealth/commons/types/state.rb +70 -0
  56. data/lib/candidhealth/commons/types/street_address_base.rb +75 -0
  57. data/lib/candidhealth/commons/types/street_address_long_zip.rb +82 -0
  58. data/lib/candidhealth/commons/types/street_address_short_zip.rb +82 -0
  59. data/lib/candidhealth/commons/types/task_assignment_id.rb +7 -0
  60. data/lib/candidhealth/commons/types/task_id.rb +7 -0
  61. data/lib/candidhealth/commons/types/task_note_id.rb +7 -0
  62. data/lib/candidhealth/commons/types/tax_id.rb +7 -0
  63. data/lib/candidhealth/commons/types/unauthorized_error_message.rb +47 -0
  64. data/lib/candidhealth/commons/types/unprocessable_entity_error_message.rb +47 -0
  65. data/lib/candidhealth/commons/types/updates_disabled_due_to_external_system_integration_error_message.rb +47 -0
  66. data/lib/candidhealth/commons/types/user_id.rb +7 -0
  67. data/lib/candidhealth/commons/types/work_queue_id.rb +7 -0
  68. data/lib/candidhealth/contracts/client.rb +28 -0
  69. data/lib/candidhealth/contracts/v_2/client.rb +336 -0
  70. data/lib/candidhealth/contracts/v_2/types/authorized_signatory.rb +83 -0
  71. data/lib/candidhealth/contracts/v_2/types/authorized_signatory_update.rb +92 -0
  72. data/lib/candidhealth/contracts/v_2/types/contract.rb +165 -0
  73. data/lib/candidhealth/contracts/v_2/types/contract_base.rb +128 -0
  74. data/lib/candidhealth/contracts/v_2/types/contract_id.rb +9 -0
  75. data/lib/candidhealth/contracts/v_2/types/contract_is_linked_to_fee_schedule_error.rb +49 -0
  76. data/lib/candidhealth/contracts/v_2/types/contract_status.rb +13 -0
  77. data/lib/candidhealth/contracts/v_2/types/contract_with_providers.rb +177 -0
  78. data/lib/candidhealth/contracts/v_2/types/contracting_provider_id.rb +9 -0
  79. data/lib/candidhealth/contracts/v_2/types/contracts_page.rb +65 -0
  80. data/lib/candidhealth/contracts/v_2/types/date_update.rb +92 -0
  81. data/lib/candidhealth/contracts/v_2/types/insurance_types.rb +103 -0
  82. data/lib/candidhealth/contracts/v_2/types/regions_update.rb +92 -0
  83. data/lib/candidhealth/contracts/v_2/types/rendering_providerid.rb +9 -0
  84. data/lib/candidhealth/diagnoses/types/diagnosis.rb +106 -0
  85. data/lib/candidhealth/diagnoses/types/diagnosis_create.rb +72 -0
  86. data/lib/candidhealth/diagnoses/types/diagnosis_id.rb +7 -0
  87. data/lib/candidhealth/diagnoses/types/diagnosis_type_code.rb +18 -0
  88. data/lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb +78 -0
  89. data/lib/candidhealth/eligibility/client.rb +28 -0
  90. data/lib/candidhealth/eligibility/v_2/client.rb +136 -0
  91. data/lib/candidhealth/encounter_providers/v_2/types/billing_provider.rb +104 -0
  92. data/lib/candidhealth/encounter_providers/v_2/types/encounter_provider.rb +103 -0
  93. data/lib/candidhealth/encounter_providers/v_2/types/encounter_provider_base.rb +60 -0
  94. data/lib/candidhealth/encounter_providers/v_2/types/provider_id.rb +9 -0
  95. data/lib/candidhealth/encounter_providers/v_2/types/referring_provider.rb +91 -0
  96. data/lib/candidhealth/encounter_providers/v_2/types/rendering_provider.rb +91 -0
  97. data/lib/candidhealth/encounters/client.rb +28 -0
  98. data/lib/candidhealth/encounters/v_4/client.rb +1125 -0
  99. data/lib/candidhealth/encounters/v_4/types/billable_status_type.rb +12 -0
  100. data/lib/candidhealth/encounters/v_4/types/cash_pay_payer_error_message.rb +49 -0
  101. data/lib/candidhealth/encounters/v_4/types/clinical_note.rb +67 -0
  102. data/lib/candidhealth/encounters/v_4/types/clinical_note_category.rb +64 -0
  103. data/lib/candidhealth/encounters/v_4/types/clinical_note_category_create.rb +59 -0
  104. data/lib/candidhealth/encounters/v_4/types/coding_attribution_type.rb +14 -0
  105. data/lib/candidhealth/encounters/v_4/types/encounter.rb +515 -0
  106. data/lib/candidhealth/encounters/v_4/types/encounter_base.rb +274 -0
  107. data/lib/candidhealth/encounters/v_4/types/encounter_external_id_uniqueness_error_type.rb +50 -0
  108. data/lib/candidhealth/encounters/v_4/types/encounter_guarantor_missing_contact_info_error_type.rb +49 -0
  109. data/lib/candidhealth/encounters/v_4/types/encounter_owner_of_next_action_type.rb +14 -0
  110. data/lib/candidhealth/encounters/v_4/types/encounter_page.rb +65 -0
  111. data/lib/candidhealth/encounters/v_4/types/encounter_patient_control_number_uniqueness_error_type.rb +49 -0
  112. data/lib/candidhealth/encounters/v_4/types/encounter_sort_options.rb +14 -0
  113. data/lib/candidhealth/encounters/v_4/types/encounter_submission_origin_type.rb +12 -0
  114. data/lib/candidhealth/encounters/v_4/types/intake_follow_up.rb +60 -0
  115. data/lib/candidhealth/encounters/v_4/types/intake_follow_up_id.rb +9 -0
  116. data/lib/candidhealth/encounters/v_4/types/intake_question.rb +64 -0
  117. data/lib/candidhealth/encounters/v_4/types/intake_question_id.rb +9 -0
  118. data/lib/candidhealth/encounters/v_4/types/intake_response_and_follow_ups.rb +58 -0
  119. data/lib/candidhealth/encounters/v_4/types/intervention.rb +87 -0
  120. data/lib/candidhealth/encounters/v_4/types/intervention_category.rb +14 -0
  121. data/lib/candidhealth/encounters/v_4/types/lab.rb +60 -0
  122. data/lib/candidhealth/encounters/v_4/types/lab_code_type.rb +12 -0
  123. data/lib/candidhealth/encounters/v_4/types/medication.rb +84 -0
  124. data/lib/candidhealth/encounters/v_4/types/note_category.rb +24 -0
  125. data/lib/candidhealth/encounters/v_4/types/patient_history_category.rb +59 -0
  126. data/lib/candidhealth/encounters/v_4/types/patient_history_category_enum.rb +14 -0
  127. data/lib/candidhealth/encounters/v_4/types/prior_authorization_number.rb +9 -0
  128. data/lib/candidhealth/encounters/v_4/types/responsible_party_type.rb +13 -0
  129. data/lib/candidhealth/encounters/v_4/types/rx_cui.rb +9 -0
  130. data/lib/candidhealth/encounters/v_4/types/service_authorization_exception_code.rb +19 -0
  131. data/lib/candidhealth/encounters/v_4/types/synchronicity_type.rb +12 -0
  132. data/lib/candidhealth/encounters/v_4/types/vitals.rb +78 -0
  133. data/lib/candidhealth/era/types/era.rb +59 -0
  134. data/lib/candidhealth/era/types/era_base.rb +53 -0
  135. data/lib/candidhealth/era/types/era_id.rb +7 -0
  136. data/lib/candidhealth/era/types/era_not_fully_processed_error_message.rb +53 -0
  137. data/lib/candidhealth/era_commons/types/claim_status_code_create.rb +18 -0
  138. data/lib/candidhealth/expected_network_status/client.rb +31 -0
  139. data/lib/candidhealth/expected_network_status/v_1/client.rb +112 -0
  140. data/lib/candidhealth/expected_network_status/v_1/types/expected_network_status.rb +13 -0
  141. data/lib/candidhealth/expected_network_status/v_1/types/expected_network_status_response.rb +66 -0
  142. data/lib/candidhealth/expected_network_status/v_2/client.rb +183 -0
  143. data/lib/candidhealth/expected_network_status/v_2/types/compute_all_in_network_providers_request.rb +119 -0
  144. data/lib/candidhealth/expected_network_status/v_2/types/compute_all_in_network_providers_response.rb +65 -0
  145. data/lib/candidhealth/expected_network_status/v_2/types/compute_all_in_network_rendering_providers_result.rb +107 -0
  146. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_check_error_message.rb +49 -0
  147. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_request_v_2.rb +119 -0
  148. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_response_v_2.rb +62 -0
  149. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_subscriber_information.rb +67 -0
  150. data/lib/candidhealth/expected_network_status/v_2/types/expected_network_status_v_2.rb +107 -0
  151. data/lib/candidhealth/expected_network_status/v_2/types/explanation.rb +18 -0
  152. data/lib/candidhealth/expected_network_status/v_2/types/in_network_rendering_providers_detail.rb +67 -0
  153. data/lib/candidhealth/expected_network_status/v_2/types/in_network_status.rb +57 -0
  154. data/lib/candidhealth/expected_network_status/v_2/types/indeterminate_network_status.rb +74 -0
  155. data/lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb +62 -0
  156. data/lib/candidhealth/expected_network_status/v_2/types/insurance_type_codes.rb +103 -0
  157. data/lib/candidhealth/expected_network_status/v_2/types/line_of_business.rb +13 -0
  158. data/lib/candidhealth/expected_network_status/v_2/types/network_status_check_id.rb +9 -0
  159. data/lib/candidhealth/expected_network_status/v_2/types/out_of_network_status.rb +67 -0
  160. data/lib/candidhealth/expected_network_status/v_2/types/service_type.rb +51 -0
  161. data/lib/candidhealth/exports/client.rb +28 -0
  162. data/lib/candidhealth/exports/v_3/client.rb +102 -0
  163. data/lib/candidhealth/exports/v_3/types/get_exports_response.rb +75 -0
  164. data/lib/candidhealth/financials/types/account_type.rb +10 -0
  165. data/lib/candidhealth/financials/types/allocation.rb +58 -0
  166. data/lib/candidhealth/financials/types/allocation_create.rb +60 -0
  167. data/lib/candidhealth/financials/types/allocation_target.rb +118 -0
  168. data/lib/candidhealth/financials/types/allocation_target_create.rb +118 -0
  169. data/lib/candidhealth/financials/types/billing_provider_allocation_target.rb +48 -0
  170. data/lib/candidhealth/financials/types/claim_allocation_target.rb +54 -0
  171. data/lib/candidhealth/financials/types/invoice_update.rb +90 -0
  172. data/lib/candidhealth/financials/types/note_update.rb +89 -0
  173. data/lib/candidhealth/financials/types/patient_transaction_source.rb +15 -0
  174. data/lib/candidhealth/financials/types/refund_reason.rb +9 -0
  175. data/lib/candidhealth/financials/types/refund_reason_update.rb +90 -0
  176. data/lib/candidhealth/financials/types/service_line_allocation_target.rb +61 -0
  177. data/lib/candidhealth/guarantor/client.rb +28 -0
  178. data/lib/candidhealth/guarantor/v_1/client.rb +224 -0
  179. data/lib/candidhealth/guarantor/v_1/types/encounter_has_existing_guarantor_error_type.rb +49 -0
  180. data/lib/candidhealth/guarantor/v_1/types/guarantor.rb +121 -0
  181. data/lib/candidhealth/guarantor/v_1/types/guarantor_base.rb +84 -0
  182. data/lib/candidhealth/guarantor/v_1/types/guarantor_create.rb +114 -0
  183. data/lib/candidhealth/guarantor/v_1/types/guarantor_id.rb +9 -0
  184. data/lib/candidhealth/identifiers/types/identifier.rb +82 -0
  185. data/lib/candidhealth/identifiers/types/identifier_base.rb +71 -0
  186. data/lib/candidhealth/identifiers/types/identifier_code.rb +10 -0
  187. data/lib/candidhealth/identifiers/types/identifier_create.rb +71 -0
  188. data/lib/candidhealth/identifiers/types/identifier_id.rb +7 -0
  189. data/lib/candidhealth/identifiers/types/identifier_update.rb +83 -0
  190. data/lib/candidhealth/identifiers/types/identifier_value.rb +92 -0
  191. data/lib/candidhealth/identifiers/types/medicaid_provider_identifier.rb +53 -0
  192. data/lib/candidhealth/identifiers/types/medicare_provider_identifier.rb +53 -0
  193. data/lib/candidhealth/identifiers/types/updatable_identifier.rb +105 -0
  194. data/lib/candidhealth/individual/types/gender.rb +13 -0
  195. data/lib/candidhealth/individual/types/individual_base.rb +58 -0
  196. data/lib/candidhealth/individual/types/individual_id.rb +7 -0
  197. data/lib/candidhealth/individual/types/patient.rb +126 -0
  198. data/lib/candidhealth/individual/types/patient_base.rb +89 -0
  199. data/lib/candidhealth/individual/types/patient_create.rb +119 -0
  200. data/lib/candidhealth/individual/types/subscriber.rb +110 -0
  201. data/lib/candidhealth/individual/types/subscriber_base.rb +91 -0
  202. data/lib/candidhealth/individual/types/subscriber_create.rb +103 -0
  203. data/lib/candidhealth/insurance_adjudications/client.rb +28 -0
  204. data/lib/candidhealth/insurance_adjudications/v_1/client.rb +143 -0
  205. data/lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication.rb +101 -0
  206. data/lib/candidhealth/insurance_adjudications/v_1/types/claim_adjudication_create.rb +95 -0
  207. data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication.rb +99 -0
  208. data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb +109 -0
  209. data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_id.rb +9 -0
  210. data/lib/candidhealth/insurance_adjudications/v_1/types/service_line_adjudication.rb +112 -0
  211. data/lib/candidhealth/insurance_adjudications/v_1/types/service_line_adjudication_create.rb +105 -0
  212. data/lib/candidhealth/insurance_adjudications/v_1/types/service_line_adjudication_id.rb +9 -0
  213. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb +123 -0
  214. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb +73 -0
  215. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_create.rb +123 -0
  216. data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_id.rb +9 -0
  217. data/lib/candidhealth/insurance_payments/client.rb +28 -0
  218. data/lib/candidhealth/insurance_payments/v_1/client.rb +269 -0
  219. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payment.rb +98 -0
  220. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payment_create.rb +91 -0
  221. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payment_id.rb +9 -0
  222. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payment_sort_field.rb +13 -0
  223. data/lib/candidhealth/insurance_payments/v_1/types/insurance_payments_page.rb +65 -0
  224. data/lib/candidhealth/insurance_refunds/client.rb +28 -0
  225. data/lib/candidhealth/insurance_refunds/v_1/client.rb +280 -0
  226. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refund.rb +105 -0
  227. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refund_create.rb +98 -0
  228. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refund_id.rb +9 -0
  229. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refund_sort_field.rb +14 -0
  230. data/lib/candidhealth/insurance_refunds/v_1/types/insurance_refunds_page.rb +65 -0
  231. data/lib/candidhealth/invoices/types/invoice.rb +134 -0
  232. data/lib/candidhealth/invoices/types/invoice_item.rb +53 -0
  233. data/lib/candidhealth/invoices/types/invoice_status.rb +13 -0
  234. data/lib/candidhealth/organization_providers/client.rb +28 -0
  235. data/lib/candidhealth/organization_providers/v_2/types/address_type.rb +11 -0
  236. data/lib/candidhealth/organization_providers/v_2/types/employment_status.rb +12 -0
  237. data/lib/candidhealth/organization_providers/v_2/types/license_type.rb +78 -0
  238. data/lib/candidhealth/organization_providers/v_2/types/organization_provider.rb +159 -0
  239. data/lib/candidhealth/organization_providers/v_2/types/organization_provider_address.rb +61 -0
  240. data/lib/candidhealth/organization_providers/v_2/types/organization_provider_base.rb +132 -0
  241. data/lib/candidhealth/organization_providers/v_2/types/organization_provider_id.rb +9 -0
  242. data/lib/candidhealth/organization_providers/v_2/types/organization_provider_sort_options.rb +14 -0
  243. data/lib/candidhealth/organization_providers/v_2/types/provider_type.rb +12 -0
  244. data/lib/candidhealth/organization_providers/v_3/client.rb +239 -0
  245. data/lib/candidhealth/organization_providers/v_3/types/organization_provider_create_v_2.rb +147 -0
  246. data/lib/candidhealth/organization_providers/v_3/types/organization_provider_page_v_2.rb +65 -0
  247. data/lib/candidhealth/organization_providers/v_3/types/organization_provider_update_v_2.rb +143 -0
  248. data/lib/candidhealth/organization_providers/v_3/types/organization_provider_v_2.rb +154 -0
  249. data/lib/candidhealth/organization_service_facilities/client.rb +28 -0
  250. data/lib/candidhealth/organization_service_facilities/v_2/client.rb +256 -0
  251. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility.rb +134 -0
  252. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_create.rb +127 -0
  253. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_id.rb +9 -0
  254. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_page.rb +65 -0
  255. data/lib/candidhealth/organization_service_facilities/v_2/types/organization_service_facility_update.rb +127 -0
  256. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_mode.rb +12 -0
  257. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_operational_status.rb +16 -0
  258. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_physical_type.rb +24 -0
  259. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_status.rb +13 -0
  260. data/lib/candidhealth/organization_service_facilities/v_2/types/service_facility_type.rb +133 -0
  261. data/lib/candidhealth/patient_payments/client.rb +28 -0
  262. data/lib/candidhealth/patient_payments/v_3/types/patient_payment.rb +130 -0
  263. data/lib/candidhealth/patient_payments/v_3/types/patient_payment_id.rb +9 -0
  264. data/lib/candidhealth/patient_payments/v_3/types/patient_payment_source.rb +19 -0
  265. data/lib/candidhealth/patient_payments/v_3/types/patient_payment_status.rb +21 -0
  266. data/lib/candidhealth/patient_payments/v_4/client.rb +304 -0
  267. data/lib/candidhealth/patient_payments/v_4/types/patient_payment.rb +120 -0
  268. data/lib/candidhealth/patient_payments/v_4/types/patient_payment_id.rb +9 -0
  269. data/lib/candidhealth/patient_payments/v_4/types/patient_payment_sort_field.rb +14 -0
  270. data/lib/candidhealth/patient_payments/v_4/types/patient_payments_page.rb +65 -0
  271. data/lib/candidhealth/patient_refunds/client.rb +28 -0
  272. data/lib/candidhealth/patient_refunds/v_1/client.rb +316 -0
  273. data/lib/candidhealth/patient_refunds/v_1/types/patient_refund.rb +127 -0
  274. data/lib/candidhealth/patient_refunds/v_1/types/patient_refund_id.rb +9 -0
  275. data/lib/candidhealth/patient_refunds/v_1/types/patient_refund_sort_field.rb +15 -0
  276. data/lib/candidhealth/patient_refunds/v_1/types/patient_refunds_page.rb +65 -0
  277. data/lib/candidhealth/payers/client.rb +28 -0
  278. data/lib/candidhealth/payers/v_3/client.rb +104 -0
  279. data/lib/candidhealth/payers/v_3/types/payer.rb +60 -0
  280. data/lib/candidhealth/payers/v_3/types/payer_id.rb +9 -0
  281. data/lib/candidhealth/payers/v_3/types/payer_identifier.rb +94 -0
  282. data/lib/candidhealth/payers/v_3/types/payer_info.rb +56 -0
  283. data/lib/candidhealth/payers/v_3/types/payer_name.rb +9 -0
  284. data/lib/candidhealth/payers/v_3/types/payer_page.rb +65 -0
  285. data/lib/candidhealth/payers/v_3/types/payer_uuid.rb +9 -0
  286. data/lib/candidhealth/remits/v_1/types/payee.rb +60 -0
  287. data/lib/candidhealth/remits/v_1/types/payee_identifier.rb +102 -0
  288. data/lib/candidhealth/service_facility/client.rb +89 -0
  289. data/lib/candidhealth/service_facility/types/encounter_service_facility.rb +77 -0
  290. data/lib/candidhealth/service_facility/types/encounter_service_facility_base.rb +72 -0
  291. data/lib/candidhealth/service_facility/types/service_facility_id.rb +7 -0
  292. data/lib/candidhealth/service_lines/v_2/types/denial_reason_content.rb +40 -0
  293. data/lib/candidhealth/service_lines/v_2/types/drug_identification.rb +86 -0
  294. data/lib/candidhealth/service_lines/v_2/types/measurement_unit_code.rb +15 -0
  295. data/lib/candidhealth/service_lines/v_2/types/service_id_qualifier.rb +17 -0
  296. data/lib/candidhealth/service_lines/v_2/types/service_line.rb +225 -0
  297. data/lib/candidhealth/service_lines/v_2/types/service_line_adjustment.rb +79 -0
  298. data/lib/candidhealth/service_lines/v_2/types/service_line_create.rb +120 -0
  299. data/lib/candidhealth/service_lines/v_2/types/service_line_denial_reason.rb +52 -0
  300. data/lib/candidhealth/service_lines/v_2/types/service_line_era_data.rb +62 -0
  301. data/lib/candidhealth/tags/types/tag.rb +65 -0
  302. data/lib/candidhealth/tags/types/tag_color_enum.rb +18 -0
  303. data/lib/candidhealth/tags/types/tag_create.rb +59 -0
  304. data/lib/candidhealth/tags/types/tag_id.rb +7 -0
  305. data/lib/candidhealth/tasks/client.rb +28 -0
  306. data/lib/candidhealth/tasks/commons/types/task_category.rb +50 -0
  307. data/lib/candidhealth/tasks/commons/types/task_status.rb +17 -0
  308. data/lib/candidhealth/tasks/commons/types/task_type.rb +22 -0
  309. data/lib/candidhealth/tasks/v_3/client.rb +259 -0
  310. data/lib/candidhealth/tasks/v_3/types/task.rb +170 -0
  311. data/lib/candidhealth/tasks/v_3/types/task_action.rb +66 -0
  312. data/lib/candidhealth/tasks/v_3/types/task_action_execution_method.rb +79 -0
  313. data/lib/candidhealth/tasks/v_3/types/task_action_type.rb +12 -0
  314. data/lib/candidhealth/tasks/v_3/types/task_actions.rb +53 -0
  315. data/lib/candidhealth/tasks/v_3/types/task_assignment.rb +56 -0
  316. data/lib/candidhealth/tasks/v_3/types/task_create_v_3.rb +95 -0
  317. data/lib/candidhealth/tasks/v_3/types/task_note.rb +79 -0
  318. data/lib/candidhealth/tasks/v_3/types/task_page.rb +65 -0
  319. data/lib/candidhealth/tasks/v_3/types/task_sort_options.rb +32 -0
  320. data/lib/candidhealth/tasks/v_3/types/task_update_v_3.rb +66 -0
  321. data/lib/candidhealth/tasks/v_3/types/task_updated_to_deprecated_status_error_type.rb +50 -0
  322. data/lib/candidhealth/write_offs/client.rb +28 -0
  323. data/lib/candidhealth/write_offs/v_1/client.rb +218 -0
  324. data/lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb +53 -0
  325. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off.rb +119 -0
  326. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_create.rb +100 -0
  327. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_reason.rb +25 -0
  328. data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_target.rb +103 -0
  329. data/lib/candidhealth/write_offs/v_1/types/patient_write_off.rb +102 -0
  330. data/lib/candidhealth/write_offs/v_1/types/patient_write_off_create.rb +83 -0
  331. data/lib/candidhealth/write_offs/v_1/types/patient_write_off_reason.rb +19 -0
  332. data/lib/candidhealth/write_offs/v_1/types/write_off.rb +94 -0
  333. data/lib/candidhealth/write_offs/v_1/types/write_off_create.rb +94 -0
  334. data/lib/candidhealth/write_offs/v_1/types/write_off_id.rb +9 -0
  335. data/lib/candidhealth/write_offs/v_1/types/write_off_sort_field.rb +13 -0
  336. data/lib/candidhealth/write_offs/v_1/types/write_offs_page.rb +65 -0
  337. data/lib/candidhealth/x_12/v_1/types/carc.rb +412 -0
  338. data/lib/candidhealth/x_12/v_1/types/claim_adjustment_reason_code.rb +62 -0
  339. data/lib/candidhealth/x_12/v_1/types/rarc.rb +1070 -0
  340. data/lib/candidhealth/x_12/v_1/types/remittance_advice_remark_code.rb +50 -0
  341. data/lib/candidhealth.rb +129 -0
  342. data/lib/environment.rb +8 -0
  343. data/lib/gemconfig.rb +14 -0
  344. data/lib/requests.rb +113 -0
  345. data/lib/types_export.rb +303 -0
  346. metadata +468 -0
@@ -0,0 +1,1125 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "../../claims/types/claim_status"
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
+ require "date"
10
+ require_relative "../../tags/types/tag_id"
11
+ require_relative "../../commons/types/work_queue_id"
12
+ require_relative "types/billable_status_type"
13
+ require_relative "types/responsible_party_type"
14
+ require_relative "types/encounter_owner_of_next_action_type"
15
+ require_relative "types/encounter_page"
16
+ require_relative "../../commons/types/encounter_id"
17
+ require_relative "types/encounter"
18
+ require_relative "types/prior_authorization_number"
19
+ require_relative "types/medication"
20
+ require_relative "types/vitals"
21
+ require_relative "types/intervention"
22
+ require_relative "../../commons/types/street_address_long_zip"
23
+ require_relative "types/synchronicity_type"
24
+ require_relative "types/service_authorization_exception_code"
25
+ require_relative "../../commons/types/delay_reason_code"
26
+ require_relative "../../individual/types/patient_create"
27
+ require_relative "../../encounter_providers/v_2/types/billing_provider"
28
+ require_relative "../../encounter_providers/v_2/types/rendering_provider"
29
+ require_relative "../../encounter_providers/v_2/types/referring_provider"
30
+ require_relative "../../service_facility/types/encounter_service_facility_base"
31
+ require_relative "../../individual/types/subscriber_create"
32
+ require_relative "../../diagnoses/types/diagnosis_create"
33
+ require_relative "types/clinical_note_category_create"
34
+ require_relative "../../billing_notes/v_2/types/billing_note_base"
35
+ require_relative "../../commons/types/facility_type_code"
36
+ require_relative "types/patient_history_category"
37
+ require_relative "../../service_lines/v_2/types/service_line_create"
38
+ require_relative "../../guarantor/v_1/types/guarantor_create"
39
+ require_relative "../../claim_submission/v_1/types/external_claim_submission_create"
40
+ require_relative "../../diagnoses/types/diagnosis_id"
41
+ require "async"
42
+
43
+ module CandidApiClient
44
+ module Encounters
45
+ module V4
46
+ class V4Client
47
+ attr_reader :request_client
48
+
49
+ # @param request_client [RequestClient]
50
+ # @return [Encounters::V4::V4Client]
51
+ def initialize(request_client:)
52
+ # @type [RequestClient]
53
+ @request_client = request_client
54
+ end
55
+
56
+ # @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.
62
+ # @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.
73
+ # @param request_options [RequestOptions]
74
+ # @return [Encounters::V4::EncounterPage]
75
+ def get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil,
76
+ 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, request_options: nil)
77
+ response = @request_client.conn.get("/api/encounters/v4") do |req|
78
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
79
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
80
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
81
+ req.params = {
82
+ **(request_options&.additional_query_parameters || {}),
83
+ "limit": limit,
84
+ "claim_status": claim_status,
85
+ "sort": sort,
86
+ "page_token": page_token,
87
+ "date_of_service_min": date_of_service_min,
88
+ "date_of_service_max": date_of_service_max,
89
+ "primary_payer_names": primary_payer_names,
90
+ "search_term": search_term,
91
+ "external_id": external_id,
92
+ "diagnoses_updated_since": diagnoses_updated_since,
93
+ "tag_ids": tag_ids,
94
+ "work_queue_id": work_queue_id,
95
+ "billable_status": billable_status,
96
+ "responsible_party": responsible_party,
97
+ "owner_of_next_action": owner_of_next_action
98
+ }.compact
99
+ end
100
+ Encounters::V4::EncounterPage.from_json(json_object: response.body)
101
+ end
102
+
103
+ # @param encounter_id [Commons::ENCOUNTER_ID]
104
+ # @param request_options [RequestOptions]
105
+ # @return [Encounters::V4::Encounter]
106
+ def get(encounter_id:, request_options: nil)
107
+ response = @request_client.conn.get("/api/encounters/v4/#{encounter_id}") do |req|
108
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
109
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
110
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
111
+ end
112
+ Encounters::V4::Encounter.from_json(json_object: response.body)
113
+ end
114
+
115
+ # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
116
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
117
+ # This field should not contain PHI.
118
+ # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
119
+ # This date must be the local date in the timezone where the service occurred.
120
+ # Box 24a on the CMS-1500 claim form.
121
+ # If service occurred over a range of dates, this should be the start date.
122
+ # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
123
+ # This date must be the local date in the timezone where the service occurred.
124
+ # If omitted, the Encounter is assumed to be for a single day.
125
+ # Must not be temporally before the date_of_service field.
126
+ # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
127
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
128
+ # for billing purpose.
129
+ # Box 12 on the CMS-1500 claim form.
130
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
131
+ # not them. If false, patient may receive reimbursement.
132
+ # Box 13 on the CMS-1500 claim form.
133
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
134
+ # to be made to you, not them.
135
+ # Box 27 on the CMS-1500 claim form.
136
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
137
+ # @param existing_medications [Array<Hash>] Request of type Array<Encounters::V4::Medication>, as a Hash
138
+ # * :name (String)
139
+ # * :rx_cui (Encounters::V4::RX_CUI)
140
+ # * :dosage (String)
141
+ # * :dosage_form (String)
142
+ # * :frequency (String)
143
+ # * :as_needed (Boolean)
144
+ # @param vitals [Hash] Request of type Encounters::V4::Vitals, as a Hash
145
+ # * :height_in (Integer)
146
+ # * :weight_lbs (Integer)
147
+ # * :blood_pressure_systolic_mmhg (Integer)
148
+ # * :blood_pressure_diastolic_mmhg (Integer)
149
+ # * :body_temperature_f (Float)
150
+ # @param interventions [Array<Hash>] Request of type Array<Encounters::V4::Intervention>, as a Hash
151
+ # * :name (String)
152
+ # * :category (Encounters::V4::InterventionCategory)
153
+ # * :description (String)
154
+ # * :medication (Hash)
155
+ # * :name (String)
156
+ # * :rx_cui (Encounters::V4::RX_CUI)
157
+ # * :dosage (String)
158
+ # * :dosage_form (String)
159
+ # * :frequency (String)
160
+ # * :as_needed (Boolean)
161
+ # * :labs (Array<Encounters::V4::Lab>)
162
+ # @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
163
+ # * :zip_plus_four_code (String)
164
+ # * :address_1 (String)
165
+ # * :address_2 (String)
166
+ # * :city (String)
167
+ # * :state (Commons::State)
168
+ # * :zip_code (String)
169
+ # @param synchronicity [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
170
+ # Asynchronous encounters occur when providers and patients communicate online using
171
+ # forms, instant messaging, or other pre-recorded digital mediums.
172
+ # Synchronous encounters occur in live, real-time settings where the patient interacts
173
+ # directly with the provider, such as over video or a phone call.
174
+ # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
175
+ # Examples for when this should be set to NOT_BILLABLE include
176
+ # if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
177
+ # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
178
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
179
+ # Box 19 on the CMS-1500 claim form.
180
+ # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
181
+ # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
182
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
183
+ # obtaining the authorization.
184
+ # @param admission_date [Commons::DATE] 837p Loop2300 DTP\*435, CMS-1500 Box 18
185
+ # Required on all ambulance claims when the patient was known to be admitted to the hospital.
186
+ # OR
187
+ # Required on all claims involving inpatient medical visits.
188
+ # @param discharge_date [Commons::DATE] 837p Loop2300 DTP\*096, CMS-1500 Box 18
189
+ # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
190
+ # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP\*431, CMS-1500 Box 14
191
+ # 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.
192
+ # OR
193
+ # This date is the onset of acute symptoms for the current illness or condition.
194
+ # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP\*484, CMS-1500 Box 14
195
+ # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
196
+ # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
197
+ # Code indicating the reason why a request was delayed
198
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
199
+ # @param patient [Hash] Contains the identification information of the individual receiving medical services.Request of type Individual::PatientCreate, as a Hash
200
+ # * :phone_numbers (Array<Commons::PhoneNumber>)
201
+ # * :phone_consent (Boolean)
202
+ # * :email (Commons::EMAIL)
203
+ # * :email_consent (Boolean)
204
+ # * :external_id (String)
205
+ # * :date_of_birth (Commons::DATE)
206
+ # * :address (Hash)
207
+ # * :zip_plus_four_code (String)
208
+ # * :address_1 (String)
209
+ # * :address_2 (String)
210
+ # * :city (String)
211
+ # * :state (Commons::State)
212
+ # * :zip_code (String)
213
+ # * :first_name (String)
214
+ # * :last_name (String)
215
+ # * :gender (Individual::Gender)
216
+ # @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
217
+ # * :address (Hash)
218
+ # * :zip_plus_four_code (String)
219
+ # * :address_1 (String)
220
+ # * :address_2 (String)
221
+ # * :city (String)
222
+ # * :state (Commons::State)
223
+ # * :zip_code (String)
224
+ # * :tax_id (String)
225
+ # * :npi (String)
226
+ # * :taxonomy_code (String)
227
+ # * :first_name (String)
228
+ # * :last_name (String)
229
+ # * :organization_name (String)
230
+ # @param rendering_provider [Hash] The rendering provider is the practitioner -- physician, nurse practitioner, etc. -- performing the service.
231
+ # 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
232
+ # * :address (Hash)
233
+ # * :zip_plus_four_code (String)
234
+ # * :address_1 (String)
235
+ # * :address_2 (String)
236
+ # * :city (String)
237
+ # * :state (Commons::State)
238
+ # * :zip_code (String)
239
+ # * :npi (String)
240
+ # * :taxonomy_code (String)
241
+ # * :first_name (String)
242
+ # * :last_name (String)
243
+ # * :organization_name (String)
244
+ # @param referring_provider [Hash] The provider who referred the services that were rendered.
245
+ # All physicians who order services or refer Medicare beneficiaries must
246
+ # report this data.
247
+ # If a claim involves multiple referring physicians, create a separate
248
+ # encounter for each physician.Request of type EncounterProviders::V2::ReferringProvider, as a Hash
249
+ # * :npi (String)
250
+ # * :taxonomy_code (String)
251
+ # * :address (Hash)
252
+ # * :zip_plus_four_code (String)
253
+ # * :address_1 (String)
254
+ # * :address_2 (String)
255
+ # * :city (String)
256
+ # * :state (Commons::State)
257
+ # * :zip_code (String)
258
+ # * :first_name (String)
259
+ # * :last_name (String)
260
+ # * :organization_name (String)
261
+ # @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
262
+ # * :organization_name (String)
263
+ # * :npi (String)
264
+ # * :address (Hash)
265
+ # * :zip_plus_four_code (String)
266
+ # * :address_1 (String)
267
+ # * :address_2 (String)
268
+ # * :city (String)
269
+ # * :state (Commons::State)
270
+ # * :zip_code (String)
271
+ # @param subscriber_primary [Hash] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e. when the claim should be billed to insurance).
272
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the claim should be billed to the patient).
273
+ # However, if you collect this for patients, even self-pay, we recommend including it when sending encounters to Candid.
274
+ # 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
275
+ # * :insurance_card (Hash)
276
+ # * :member_id (String)
277
+ # * :payer_name (String)
278
+ # * :payer_id (String)
279
+ # * :rx_bin (String)
280
+ # * :rx_pcn (String)
281
+ # * :image_url_front (String)
282
+ # * :image_url_back (String)
283
+ # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
284
+ # * :group_number (String)
285
+ # * :plan_name (String)
286
+ # * :plan_type (Commons::SourceOfPaymentCode)
287
+ # * :insurance_type (Commons::InsuranceTypeCode)
288
+ # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
289
+ # * :date_of_birth (Commons::DATE)
290
+ # * :address (Hash)
291
+ # * :zip_plus_four_code (String)
292
+ # * :address_1 (String)
293
+ # * :address_2 (String)
294
+ # * :city (String)
295
+ # * :state (Commons::State)
296
+ # * :zip_code (String)
297
+ # * :first_name (String)
298
+ # * :last_name (String)
299
+ # * :gender (Individual::Gender)
300
+ # @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
301
+ # * :insurance_card (Hash)
302
+ # * :member_id (String)
303
+ # * :payer_name (String)
304
+ # * :payer_id (String)
305
+ # * :rx_bin (String)
306
+ # * :rx_pcn (String)
307
+ # * :image_url_front (String)
308
+ # * :image_url_back (String)
309
+ # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
310
+ # * :group_number (String)
311
+ # * :plan_name (String)
312
+ # * :plan_type (Commons::SourceOfPaymentCode)
313
+ # * :insurance_type (Commons::InsuranceTypeCode)
314
+ # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
315
+ # * :date_of_birth (Commons::DATE)
316
+ # * :address (Hash)
317
+ # * :zip_plus_four_code (String)
318
+ # * :address_1 (String)
319
+ # * :address_2 (String)
320
+ # * :city (String)
321
+ # * :state (Commons::State)
322
+ # * :zip_code (String)
323
+ # * :first_name (String)
324
+ # * :last_name (String)
325
+ # * :gender (Individual::Gender)
326
+ # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
327
+ # may be submitted at this time, and coders will later prioritize the 12 that will be
328
+ # submitted to the payor.Request of type Array<Diagnoses::DiagnosisCreate>, as a Hash
329
+ # * :name (String)
330
+ # * :code_type (Diagnoses::DiagnosisTypeCode)
331
+ # * :code (String)
332
+ # @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
333
+ # * :category (Encounters::V4::NoteCategory)
334
+ # * :notes (Array<Encounters::V4::ClinicalNote>)
335
+ # @param billing_notes [Array<Hash>] Spot to store misc, human-readable, notes about this encounter to be used
336
+ # in the billing process.Request of type Array<BillingNotes::V2::BillingNoteBase>, as a Hash
337
+ # * :text (String)
338
+ # @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).
339
+ # @param patient_histories [Array<Hash>] Request of type Array<Encounters::V4::PatientHistoryCategory>, as a Hash
340
+ # * :category (Encounters::V4::PatientHistoryCategoryEnum)
341
+ # * :questions (Array<Encounters::V4::IntakeQuestion>)
342
+ # @param service_lines [Array<Hash>] Each service line must be linked to a diagnosis. Concretely,
343
+ # `service_line.diagnosis_pointers`must contain at least one entry which should be
344
+ # in bounds of the diagnoses list field.Request of type Array<ServiceLines::V2::ServiceLineCreate>, as a Hash
345
+ # * :modifiers (Array<Commons::ProcedureModifier>)
346
+ # * :procedure_code (String)
347
+ # * :quantity (Commons::DECIMAL)
348
+ # * :units (Commons::ServiceLineUnits)
349
+ # * :charge_amount_cents (Integer)
350
+ # * :diagnosis_pointers (Array<Integer>)
351
+ # * :drug_identification (Hash)
352
+ # * :service_id_qualifier (ServiceLines::V2::ServiceIdQualifier)
353
+ # * :national_drug_code (String)
354
+ # * :national_drug_unit_count (String)
355
+ # * :measurement_unit_code (ServiceLines::V2::MeasurementUnitCode)
356
+ # * :link_sequence_number (String)
357
+ # * :pharmacy_prescription_number (String)
358
+ # * :place_of_service_code (Commons::FacilityTypeCode)
359
+ # * :description (String)
360
+ # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type Guarantor::V1::GuarantorCreate, as a Hash
361
+ # * :phone_numbers (Array<Commons::PhoneNumber>)
362
+ # * :phone_consent (Boolean)
363
+ # * :email (Commons::EMAIL)
364
+ # * :email_consent (Boolean)
365
+ # * :first_name (String)
366
+ # * :last_name (String)
367
+ # * :external_id (String)
368
+ # * :date_of_birth (Date)
369
+ # * :address (Hash)
370
+ # * :zip_plus_four_code (String)
371
+ # * :address_1 (String)
372
+ # * :address_2 (String)
373
+ # * :city (String)
374
+ # * :state (Commons::State)
375
+ # * :zip_code (String)
376
+ # @param external_claim_submission [Hash] ***This field is in beta.***
377
+ # To be included for claims that have been submitted outside of Candid.
378
+ # 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
379
+ # * :claim_created_at (DateTime)
380
+ # * :patient_control_number (String)
381
+ # * :submission_records (Array<ClaimSubmission::V1::ClaimSubmissionRecordCreate>)
382
+ # @param request_options [RequestOptions]
383
+ # @return [Encounters::V4::Encounter]
384
+ def create(external_id:, date_of_service:, patient_authorized_release:, benefits_assigned_to_provider:,
385
+ provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, end_date_of_service: nil, prior_authorization_number: nil, appointment_type: nil, existing_medications: nil, vitals: nil, interventions: nil, pay_to_address: nil, synchronicity: nil, additional_information: nil, service_authorization_exception_code: nil, admission_date: nil, discharge_date: nil, onset_of_current_illness_or_symptom_date: nil, last_menstrual_period_date: nil, delay_reason_code: nil, additional_properties: nil, 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, request_options: nil)
386
+ response = @request_client.conn.post("/api/encounters/v4") do |req|
387
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
388
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
389
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
390
+ req.body = {
391
+ **(request_options&.additional_body_parameters || {}),
392
+ external_id: external_id,
393
+ date_of_service: date_of_service,
394
+ end_date_of_service: end_date_of_service,
395
+ prior_authorization_number: prior_authorization_number,
396
+ patient_authorized_release: patient_authorized_release,
397
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
398
+ provider_accepts_assignment: provider_accepts_assignment,
399
+ appointment_type: appointment_type,
400
+ existing_medications: existing_medications,
401
+ vitals: vitals,
402
+ interventions: interventions,
403
+ pay_to_address: pay_to_address,
404
+ synchronicity: synchronicity,
405
+ billable_status: billable_status,
406
+ responsible_party: responsible_party,
407
+ additional_information: additional_information,
408
+ service_authorization_exception_code: service_authorization_exception_code,
409
+ admission_date: admission_date,
410
+ discharge_date: discharge_date,
411
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
412
+ last_menstrual_period_date: last_menstrual_period_date,
413
+ delay_reason_code: delay_reason_code,
414
+ additional_properties: additional_properties,
415
+ patient: patient,
416
+ billing_provider: billing_provider,
417
+ rendering_provider: rendering_provider,
418
+ referring_provider: referring_provider,
419
+ service_facility: service_facility,
420
+ subscriber_primary: subscriber_primary,
421
+ subscriber_secondary: subscriber_secondary,
422
+ diagnoses: diagnoses,
423
+ clinical_notes: clinical_notes,
424
+ billing_notes: billing_notes,
425
+ place_of_service_code: place_of_service_code,
426
+ patient_histories: patient_histories,
427
+ service_lines: service_lines,
428
+ guarantor: guarantor,
429
+ external_claim_submission: external_claim_submission
430
+ }.compact
431
+ end
432
+ Encounters::V4::Encounter.from_json(json_object: response.body)
433
+ end
434
+
435
+ # @param encounter_id [Commons::ENCOUNTER_ID]
436
+ # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
437
+ # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
438
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
439
+ # This field should not contain PHI.
440
+ # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
441
+ # This date must be the local date in the timezone where the service occurred.
442
+ # Box 24a on the CMS-1500 claim form.
443
+ # If service occurred over a range of dates, this should be the start date.
444
+ # @param diagnosis_ids [Array<Diagnoses::DIAGNOSIS_ID>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
445
+ # may be submitted at this time, and coders will later prioritize the 12 that will be
446
+ # submitted to the payor.
447
+ # @param tag_ids [Array<Tags::TAG_ID>] Names of tags that should be on the encounter.
448
+ # @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
449
+ # * :category (Encounters::V4::NoteCategory)
450
+ # * :notes (Array<Encounters::V4::ClinicalNote>)
451
+ # @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
452
+ # * :zip_plus_four_code (String)
453
+ # * :address_1 (String)
454
+ # * :address_2 (String)
455
+ # * :city (String)
456
+ # * :state (Commons::State)
457
+ # * :zip_code (String)
458
+ # @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.
459
+ # @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.
460
+ # @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.
461
+ # @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.
462
+ # @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.
463
+ # @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).
464
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
465
+ # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
466
+ # This date must be the local date in the timezone where the service occurred.
467
+ # If omitted, the Encounter is assumed to be for a single day.
468
+ # Must not be temporally before the date_of_service field.
469
+ # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
470
+ # * :insurance_card (Hash)
471
+ # * :member_id (String)
472
+ # * :payer_name (String)
473
+ # * :payer_id (String)
474
+ # * :rx_bin (String)
475
+ # * :rx_pcn (String)
476
+ # * :image_url_front (String)
477
+ # * :image_url_back (String)
478
+ # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
479
+ # * :group_number (String)
480
+ # * :plan_name (String)
481
+ # * :plan_type (Commons::SourceOfPaymentCode)
482
+ # * :insurance_type (Commons::InsuranceTypeCode)
483
+ # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
484
+ # * :date_of_birth (Commons::DATE)
485
+ # * :address (Hash)
486
+ # * :zip_plus_four_code (String)
487
+ # * :address_1 (String)
488
+ # * :address_2 (String)
489
+ # * :city (String)
490
+ # * :state (Commons::State)
491
+ # * :zip_code (String)
492
+ # * :first_name (String)
493
+ # * :last_name (String)
494
+ # * :gender (Individual::Gender)
495
+ # @param subscriber_secondary [Hash] Contains details of the secondary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
496
+ # * :insurance_card (Hash)
497
+ # * :member_id (String)
498
+ # * :payer_name (String)
499
+ # * :payer_id (String)
500
+ # * :rx_bin (String)
501
+ # * :rx_pcn (String)
502
+ # * :image_url_front (String)
503
+ # * :image_url_back (String)
504
+ # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
505
+ # * :group_number (String)
506
+ # * :plan_name (String)
507
+ # * :plan_type (Commons::SourceOfPaymentCode)
508
+ # * :insurance_type (Commons::InsuranceTypeCode)
509
+ # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
510
+ # * :date_of_birth (Commons::DATE)
511
+ # * :address (Hash)
512
+ # * :zip_plus_four_code (String)
513
+ # * :address_1 (String)
514
+ # * :address_2 (String)
515
+ # * :city (String)
516
+ # * :state (Commons::State)
517
+ # * :zip_code (String)
518
+ # * :first_name (String)
519
+ # * :last_name (String)
520
+ # * :gender (Individual::Gender)
521
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
522
+ # Box 19 on the CMS-1500 claim form.
523
+ # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
524
+ # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
525
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
526
+ # obtaining the authorization.
527
+ # @param admission_date [Commons::DATE] 837p Loop2300 DTP*435, CMS-1500 Box 18
528
+ # Required on all ambulance claims when the patient was known to be admitted to the hospital.
529
+ # OR
530
+ # Required on all claims involving inpatient medical visits.
531
+ # @param discharge_date [Commons::DATE] 837p Loop2300 DTP*096, CMS-1500 Box 18
532
+ # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
533
+ # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP*431, CMS-1500 Box 14
534
+ # 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.
535
+ # OR
536
+ # This date is the onset of acute symptoms for the current illness or condition.
537
+ # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP*484, CMS-1500 Box 14
538
+ # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
539
+ # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
540
+ # Code indicating the reason why a request was delayed
541
+ # @param request_options [RequestOptions]
542
+ # @return [Encounters::V4::Encounter]
543
+ def update(encounter_id:, prior_authorization_number: nil, external_id: nil, date_of_service: nil,
544
+ 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, request_options: nil)
545
+ response = @request_client.conn.patch("/api/encounters/v4/#{encounter_id}") do |req|
546
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
547
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
548
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
549
+ req.body = {
550
+ **(request_options&.additional_body_parameters || {}),
551
+ prior_authorization_number: prior_authorization_number,
552
+ external_id: external_id,
553
+ date_of_service: date_of_service,
554
+ diagnosis_ids: diagnosis_ids,
555
+ tag_ids: tag_ids,
556
+ clinical_notes: clinical_notes,
557
+ pay_to_address: pay_to_address,
558
+ billable_status: billable_status,
559
+ responsible_party: responsible_party,
560
+ provider_accepts_assignment: provider_accepts_assignment,
561
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
562
+ synchronicity: synchronicity,
563
+ place_of_service_code: place_of_service_code,
564
+ appointment_type: appointment_type,
565
+ end_date_of_service: end_date_of_service,
566
+ subscriber_primary: subscriber_primary,
567
+ subscriber_secondary: subscriber_secondary,
568
+ additional_information: additional_information,
569
+ service_authorization_exception_code: service_authorization_exception_code,
570
+ admission_date: admission_date,
571
+ discharge_date: discharge_date,
572
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
573
+ last_menstrual_period_date: last_menstrual_period_date,
574
+ delay_reason_code: delay_reason_code
575
+ }.compact
576
+ end
577
+ Encounters::V4::Encounter.from_json(json_object: response.body)
578
+ end
579
+ end
580
+
581
+ class AsyncV4Client
582
+ attr_reader :request_client
583
+
584
+ # @param request_client [AsyncRequestClient]
585
+ # @return [Encounters::V4::AsyncV4Client]
586
+ def initialize(request_client:)
587
+ # @type [AsyncRequestClient]
588
+ @request_client = request_client
589
+ end
590
+
591
+ # @param limit [Integer] Maximum number of entities per page, defaults to 100.
592
+ # @param claim_status [Claims::ClaimStatus] Indicates the current status of an insurance claim within the billing process.
593
+ # @param sort [Encounters::V4::EncounterSortOptions] Defaults to created_at:desc.
594
+ # @param page_token [Commons::PAGE_TOKEN]
595
+ # @param date_of_service_min [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
596
+ # @param date_of_service_max [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
597
+ # @param primary_payer_names [String] Comma delimited string.
598
+ # @param search_term [String] Filter by any of the following fields: encounter_id, claim_id, patient external_id,
599
+ # patient date of birth, patient first name, patient last name,
600
+ # or encounter external id.
601
+ # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] Filter to an exact match on encounter external_id, if one exists.
602
+ # @param diagnoses_updated_since [DateTime] ISO 8601 timestamp; ideally in UTC (although not required): 2019-08-24T14:15:22Z.
603
+ # @param tag_ids [Tags::TAG_ID] Filter by name of tags on encounters.
604
+ # @param work_queue_id [Commons::WORK_QUEUE_ID]
605
+ # @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.
606
+ # @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.
607
+ # @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.
608
+ # @param request_options [RequestOptions]
609
+ # @return [Encounters::V4::EncounterPage]
610
+ def get_all(limit: nil, claim_status: nil, sort: nil, page_token: nil, date_of_service_min: nil,
611
+ 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, request_options: nil)
612
+ Async do
613
+ response = @request_client.conn.get("/api/encounters/v4") do |req|
614
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
615
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
616
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
617
+ req.params = {
618
+ **(request_options&.additional_query_parameters || {}),
619
+ "limit": limit,
620
+ "claim_status": claim_status,
621
+ "sort": sort,
622
+ "page_token": page_token,
623
+ "date_of_service_min": date_of_service_min,
624
+ "date_of_service_max": date_of_service_max,
625
+ "primary_payer_names": primary_payer_names,
626
+ "search_term": search_term,
627
+ "external_id": external_id,
628
+ "diagnoses_updated_since": diagnoses_updated_since,
629
+ "tag_ids": tag_ids,
630
+ "work_queue_id": work_queue_id,
631
+ "billable_status": billable_status,
632
+ "responsible_party": responsible_party,
633
+ "owner_of_next_action": owner_of_next_action
634
+ }.compact
635
+ end
636
+ Encounters::V4::EncounterPage.from_json(json_object: response.body)
637
+ end
638
+ end
639
+
640
+ # @param encounter_id [Commons::ENCOUNTER_ID]
641
+ # @param request_options [RequestOptions]
642
+ # @return [Encounters::V4::Encounter]
643
+ def get(encounter_id:, request_options: nil)
644
+ Async do
645
+ response = @request_client.conn.get("/api/encounters/v4/#{encounter_id}") do |req|
646
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
647
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
648
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
649
+ end
650
+ Encounters::V4::Encounter.from_json(json_object: response.body)
651
+ end
652
+ end
653
+
654
+ # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
655
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
656
+ # This field should not contain PHI.
657
+ # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
658
+ # This date must be the local date in the timezone where the service occurred.
659
+ # Box 24a on the CMS-1500 claim form.
660
+ # If service occurred over a range of dates, this should be the start date.
661
+ # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
662
+ # This date must be the local date in the timezone where the service occurred.
663
+ # If omitted, the Encounter is assumed to be for a single day.
664
+ # Must not be temporally before the date_of_service field.
665
+ # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
666
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
667
+ # for billing purpose.
668
+ # Box 12 on the CMS-1500 claim form.
669
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
670
+ # not them. If false, patient may receive reimbursement.
671
+ # Box 13 on the CMS-1500 claim form.
672
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
673
+ # to be made to you, not them.
674
+ # Box 27 on the CMS-1500 claim form.
675
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
676
+ # @param existing_medications [Array<Hash>] Request of type Array<Encounters::V4::Medication>, as a Hash
677
+ # * :name (String)
678
+ # * :rx_cui (Encounters::V4::RX_CUI)
679
+ # * :dosage (String)
680
+ # * :dosage_form (String)
681
+ # * :frequency (String)
682
+ # * :as_needed (Boolean)
683
+ # @param vitals [Hash] Request of type Encounters::V4::Vitals, as a Hash
684
+ # * :height_in (Integer)
685
+ # * :weight_lbs (Integer)
686
+ # * :blood_pressure_systolic_mmhg (Integer)
687
+ # * :blood_pressure_diastolic_mmhg (Integer)
688
+ # * :body_temperature_f (Float)
689
+ # @param interventions [Array<Hash>] Request of type Array<Encounters::V4::Intervention>, as a Hash
690
+ # * :name (String)
691
+ # * :category (Encounters::V4::InterventionCategory)
692
+ # * :description (String)
693
+ # * :medication (Hash)
694
+ # * :name (String)
695
+ # * :rx_cui (Encounters::V4::RX_CUI)
696
+ # * :dosage (String)
697
+ # * :dosage_form (String)
698
+ # * :frequency (String)
699
+ # * :as_needed (Boolean)
700
+ # * :labs (Array<Encounters::V4::Lab>)
701
+ # @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
702
+ # * :zip_plus_four_code (String)
703
+ # * :address_1 (String)
704
+ # * :address_2 (String)
705
+ # * :city (String)
706
+ # * :state (Commons::State)
707
+ # * :zip_code (String)
708
+ # @param synchronicity [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
709
+ # Asynchronous encounters occur when providers and patients communicate online using
710
+ # forms, instant messaging, or other pre-recorded digital mediums.
711
+ # Synchronous encounters occur in live, real-time settings where the patient interacts
712
+ # directly with the provider, such as over video or a phone call.
713
+ # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
714
+ # Examples for when this should be set to NOT_BILLABLE include
715
+ # if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
716
+ # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
717
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
718
+ # Box 19 on the CMS-1500 claim form.
719
+ # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
720
+ # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
721
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
722
+ # obtaining the authorization.
723
+ # @param admission_date [Commons::DATE] 837p Loop2300 DTP\*435, CMS-1500 Box 18
724
+ # Required on all ambulance claims when the patient was known to be admitted to the hospital.
725
+ # OR
726
+ # Required on all claims involving inpatient medical visits.
727
+ # @param discharge_date [Commons::DATE] 837p Loop2300 DTP\*096, CMS-1500 Box 18
728
+ # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
729
+ # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP\*431, CMS-1500 Box 14
730
+ # 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.
731
+ # OR
732
+ # This date is the onset of acute symptoms for the current illness or condition.
733
+ # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP\*484, CMS-1500 Box 14
734
+ # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
735
+ # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
736
+ # Code indicating the reason why a request was delayed
737
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
738
+ # @param patient [Hash] Contains the identification information of the individual receiving medical services.Request of type Individual::PatientCreate, as a Hash
739
+ # * :phone_numbers (Array<Commons::PhoneNumber>)
740
+ # * :phone_consent (Boolean)
741
+ # * :email (Commons::EMAIL)
742
+ # * :email_consent (Boolean)
743
+ # * :external_id (String)
744
+ # * :date_of_birth (Commons::DATE)
745
+ # * :address (Hash)
746
+ # * :zip_plus_four_code (String)
747
+ # * :address_1 (String)
748
+ # * :address_2 (String)
749
+ # * :city (String)
750
+ # * :state (Commons::State)
751
+ # * :zip_code (String)
752
+ # * :first_name (String)
753
+ # * :last_name (String)
754
+ # * :gender (Individual::Gender)
755
+ # @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
756
+ # * :address (Hash)
757
+ # * :zip_plus_four_code (String)
758
+ # * :address_1 (String)
759
+ # * :address_2 (String)
760
+ # * :city (String)
761
+ # * :state (Commons::State)
762
+ # * :zip_code (String)
763
+ # * :tax_id (String)
764
+ # * :npi (String)
765
+ # * :taxonomy_code (String)
766
+ # * :first_name (String)
767
+ # * :last_name (String)
768
+ # * :organization_name (String)
769
+ # @param rendering_provider [Hash] The rendering provider is the practitioner -- physician, nurse practitioner, etc. -- performing the service.
770
+ # 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
771
+ # * :address (Hash)
772
+ # * :zip_plus_four_code (String)
773
+ # * :address_1 (String)
774
+ # * :address_2 (String)
775
+ # * :city (String)
776
+ # * :state (Commons::State)
777
+ # * :zip_code (String)
778
+ # * :npi (String)
779
+ # * :taxonomy_code (String)
780
+ # * :first_name (String)
781
+ # * :last_name (String)
782
+ # * :organization_name (String)
783
+ # @param referring_provider [Hash] The provider who referred the services that were rendered.
784
+ # All physicians who order services or refer Medicare beneficiaries must
785
+ # report this data.
786
+ # If a claim involves multiple referring physicians, create a separate
787
+ # encounter for each physician.Request of type EncounterProviders::V2::ReferringProvider, as a Hash
788
+ # * :npi (String)
789
+ # * :taxonomy_code (String)
790
+ # * :address (Hash)
791
+ # * :zip_plus_four_code (String)
792
+ # * :address_1 (String)
793
+ # * :address_2 (String)
794
+ # * :city (String)
795
+ # * :state (Commons::State)
796
+ # * :zip_code (String)
797
+ # * :first_name (String)
798
+ # * :last_name (String)
799
+ # * :organization_name (String)
800
+ # @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
801
+ # * :organization_name (String)
802
+ # * :npi (String)
803
+ # * :address (Hash)
804
+ # * :zip_plus_four_code (String)
805
+ # * :address_1 (String)
806
+ # * :address_2 (String)
807
+ # * :city (String)
808
+ # * :state (Commons::State)
809
+ # * :zip_code (String)
810
+ # @param subscriber_primary [Hash] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e. when the claim should be billed to insurance).
811
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the claim should be billed to the patient).
812
+ # However, if you collect this for patients, even self-pay, we recommend including it when sending encounters to Candid.
813
+ # 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
814
+ # * :insurance_card (Hash)
815
+ # * :member_id (String)
816
+ # * :payer_name (String)
817
+ # * :payer_id (String)
818
+ # * :rx_bin (String)
819
+ # * :rx_pcn (String)
820
+ # * :image_url_front (String)
821
+ # * :image_url_back (String)
822
+ # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
823
+ # * :group_number (String)
824
+ # * :plan_name (String)
825
+ # * :plan_type (Commons::SourceOfPaymentCode)
826
+ # * :insurance_type (Commons::InsuranceTypeCode)
827
+ # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
828
+ # * :date_of_birth (Commons::DATE)
829
+ # * :address (Hash)
830
+ # * :zip_plus_four_code (String)
831
+ # * :address_1 (String)
832
+ # * :address_2 (String)
833
+ # * :city (String)
834
+ # * :state (Commons::State)
835
+ # * :zip_code (String)
836
+ # * :first_name (String)
837
+ # * :last_name (String)
838
+ # * :gender (Individual::Gender)
839
+ # @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
840
+ # * :insurance_card (Hash)
841
+ # * :member_id (String)
842
+ # * :payer_name (String)
843
+ # * :payer_id (String)
844
+ # * :rx_bin (String)
845
+ # * :rx_pcn (String)
846
+ # * :image_url_front (String)
847
+ # * :image_url_back (String)
848
+ # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
849
+ # * :group_number (String)
850
+ # * :plan_name (String)
851
+ # * :plan_type (Commons::SourceOfPaymentCode)
852
+ # * :insurance_type (Commons::InsuranceTypeCode)
853
+ # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
854
+ # * :date_of_birth (Commons::DATE)
855
+ # * :address (Hash)
856
+ # * :zip_plus_four_code (String)
857
+ # * :address_1 (String)
858
+ # * :address_2 (String)
859
+ # * :city (String)
860
+ # * :state (Commons::State)
861
+ # * :zip_code (String)
862
+ # * :first_name (String)
863
+ # * :last_name (String)
864
+ # * :gender (Individual::Gender)
865
+ # @param diagnoses [Array<Hash>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
866
+ # may be submitted at this time, and coders will later prioritize the 12 that will be
867
+ # submitted to the payor.Request of type Array<Diagnoses::DiagnosisCreate>, as a Hash
868
+ # * :name (String)
869
+ # * :code_type (Diagnoses::DiagnosisTypeCode)
870
+ # * :code (String)
871
+ # @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
872
+ # * :category (Encounters::V4::NoteCategory)
873
+ # * :notes (Array<Encounters::V4::ClinicalNote>)
874
+ # @param billing_notes [Array<Hash>] Spot to store misc, human-readable, notes about this encounter to be used
875
+ # in the billing process.Request of type Array<BillingNotes::V2::BillingNoteBase>, as a Hash
876
+ # * :text (String)
877
+ # @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).
878
+ # @param patient_histories [Array<Hash>] Request of type Array<Encounters::V4::PatientHistoryCategory>, as a Hash
879
+ # * :category (Encounters::V4::PatientHistoryCategoryEnum)
880
+ # * :questions (Array<Encounters::V4::IntakeQuestion>)
881
+ # @param service_lines [Array<Hash>] Each service line must be linked to a diagnosis. Concretely,
882
+ # `service_line.diagnosis_pointers`must contain at least one entry which should be
883
+ # in bounds of the diagnoses list field.Request of type Array<ServiceLines::V2::ServiceLineCreate>, as a Hash
884
+ # * :modifiers (Array<Commons::ProcedureModifier>)
885
+ # * :procedure_code (String)
886
+ # * :quantity (Commons::DECIMAL)
887
+ # * :units (Commons::ServiceLineUnits)
888
+ # * :charge_amount_cents (Integer)
889
+ # * :diagnosis_pointers (Array<Integer>)
890
+ # * :drug_identification (Hash)
891
+ # * :service_id_qualifier (ServiceLines::V2::ServiceIdQualifier)
892
+ # * :national_drug_code (String)
893
+ # * :national_drug_unit_count (String)
894
+ # * :measurement_unit_code (ServiceLines::V2::MeasurementUnitCode)
895
+ # * :link_sequence_number (String)
896
+ # * :pharmacy_prescription_number (String)
897
+ # * :place_of_service_code (Commons::FacilityTypeCode)
898
+ # * :description (String)
899
+ # @param guarantor [Hash] Personal and contact info for the guarantor of the patient responsibility.Request of type Guarantor::V1::GuarantorCreate, as a Hash
900
+ # * :phone_numbers (Array<Commons::PhoneNumber>)
901
+ # * :phone_consent (Boolean)
902
+ # * :email (Commons::EMAIL)
903
+ # * :email_consent (Boolean)
904
+ # * :first_name (String)
905
+ # * :last_name (String)
906
+ # * :external_id (String)
907
+ # * :date_of_birth (Date)
908
+ # * :address (Hash)
909
+ # * :zip_plus_four_code (String)
910
+ # * :address_1 (String)
911
+ # * :address_2 (String)
912
+ # * :city (String)
913
+ # * :state (Commons::State)
914
+ # * :zip_code (String)
915
+ # @param external_claim_submission [Hash] ***This field is in beta.***
916
+ # To be included for claims that have been submitted outside of Candid.
917
+ # 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
918
+ # * :claim_created_at (DateTime)
919
+ # * :patient_control_number (String)
920
+ # * :submission_records (Array<ClaimSubmission::V1::ClaimSubmissionRecordCreate>)
921
+ # @param request_options [RequestOptions]
922
+ # @return [Encounters::V4::Encounter]
923
+ def create(external_id:, date_of_service:, patient_authorized_release:, benefits_assigned_to_provider:,
924
+ provider_accepts_assignment:, billable_status:, responsible_party:, patient:, billing_provider:, rendering_provider:, diagnoses:, place_of_service_code:, end_date_of_service: nil, prior_authorization_number: nil, appointment_type: nil, existing_medications: nil, vitals: nil, interventions: nil, pay_to_address: nil, synchronicity: nil, additional_information: nil, service_authorization_exception_code: nil, admission_date: nil, discharge_date: nil, onset_of_current_illness_or_symptom_date: nil, last_menstrual_period_date: nil, delay_reason_code: nil, additional_properties: nil, 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, request_options: nil)
925
+ Async do
926
+ response = @request_client.conn.post("/api/encounters/v4") do |req|
927
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
928
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
929
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
930
+ req.body = {
931
+ **(request_options&.additional_body_parameters || {}),
932
+ external_id: external_id,
933
+ date_of_service: date_of_service,
934
+ end_date_of_service: end_date_of_service,
935
+ prior_authorization_number: prior_authorization_number,
936
+ patient_authorized_release: patient_authorized_release,
937
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
938
+ provider_accepts_assignment: provider_accepts_assignment,
939
+ appointment_type: appointment_type,
940
+ existing_medications: existing_medications,
941
+ vitals: vitals,
942
+ interventions: interventions,
943
+ pay_to_address: pay_to_address,
944
+ synchronicity: synchronicity,
945
+ billable_status: billable_status,
946
+ responsible_party: responsible_party,
947
+ additional_information: additional_information,
948
+ service_authorization_exception_code: service_authorization_exception_code,
949
+ admission_date: admission_date,
950
+ discharge_date: discharge_date,
951
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
952
+ last_menstrual_period_date: last_menstrual_period_date,
953
+ delay_reason_code: delay_reason_code,
954
+ additional_properties: additional_properties,
955
+ patient: patient,
956
+ billing_provider: billing_provider,
957
+ rendering_provider: rendering_provider,
958
+ referring_provider: referring_provider,
959
+ service_facility: service_facility,
960
+ subscriber_primary: subscriber_primary,
961
+ subscriber_secondary: subscriber_secondary,
962
+ diagnoses: diagnoses,
963
+ clinical_notes: clinical_notes,
964
+ billing_notes: billing_notes,
965
+ place_of_service_code: place_of_service_code,
966
+ patient_histories: patient_histories,
967
+ service_lines: service_lines,
968
+ guarantor: guarantor,
969
+ external_claim_submission: external_claim_submission
970
+ }.compact
971
+ end
972
+ Encounters::V4::Encounter.from_json(json_object: response.body)
973
+ end
974
+ end
975
+
976
+ # @param encounter_id [Commons::ENCOUNTER_ID]
977
+ # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
978
+ # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
979
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
980
+ # This field should not contain PHI.
981
+ # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
982
+ # This date must be the local date in the timezone where the service occurred.
983
+ # Box 24a on the CMS-1500 claim form.
984
+ # If service occurred over a range of dates, this should be the start date.
985
+ # @param diagnosis_ids [Array<Diagnoses::DIAGNOSIS_ID>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses
986
+ # may be submitted at this time, and coders will later prioritize the 12 that will be
987
+ # submitted to the payor.
988
+ # @param tag_ids [Array<Tags::TAG_ID>] Names of tags that should be on the encounter.
989
+ # @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
990
+ # * :category (Encounters::V4::NoteCategory)
991
+ # * :notes (Array<Encounters::V4::ClinicalNote>)
992
+ # @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
993
+ # * :zip_plus_four_code (String)
994
+ # * :address_1 (String)
995
+ # * :address_2 (String)
996
+ # * :city (String)
997
+ # * :state (Commons::State)
998
+ # * :zip_code (String)
999
+ # @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.
1000
+ # @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.
1001
+ # @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.
1002
+ # @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.
1003
+ # @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.
1004
+ # @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).
1005
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
1006
+ # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
1007
+ # This date must be the local date in the timezone where the service occurred.
1008
+ # If omitted, the Encounter is assumed to be for a single day.
1009
+ # Must not be temporally before the date_of_service field.
1010
+ # @param subscriber_primary [Hash] Contains details of the primary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
1011
+ # * :insurance_card (Hash)
1012
+ # * :member_id (String)
1013
+ # * :payer_name (String)
1014
+ # * :payer_id (String)
1015
+ # * :rx_bin (String)
1016
+ # * :rx_pcn (String)
1017
+ # * :image_url_front (String)
1018
+ # * :image_url_back (String)
1019
+ # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
1020
+ # * :group_number (String)
1021
+ # * :plan_name (String)
1022
+ # * :plan_type (Commons::SourceOfPaymentCode)
1023
+ # * :insurance_type (Commons::InsuranceTypeCode)
1024
+ # * :patient_relationship_to_subscriber_code (Commons::PatientRelationshipToInsuredCodeAll)
1025
+ # * :date_of_birth (Commons::DATE)
1026
+ # * :address (Hash)
1027
+ # * :zip_plus_four_code (String)
1028
+ # * :address_1 (String)
1029
+ # * :address_2 (String)
1030
+ # * :city (String)
1031
+ # * :state (Commons::State)
1032
+ # * :zip_code (String)
1033
+ # * :first_name (String)
1034
+ # * :last_name (String)
1035
+ # * :gender (Individual::Gender)
1036
+ # @param subscriber_secondary [Hash] Contains details of the secondary insurance subscriber.Request of type Individual::SubscriberCreate, as a Hash
1037
+ # * :insurance_card (Hash)
1038
+ # * :member_id (String)
1039
+ # * :payer_name (String)
1040
+ # * :payer_id (String)
1041
+ # * :rx_bin (String)
1042
+ # * :rx_pcn (String)
1043
+ # * :image_url_front (String)
1044
+ # * :image_url_back (String)
1045
+ # * :emr_payer_crosswalk (Commons::EmrPayerCrosswalk)
1046
+ # * :group_number (String)
1047
+ # * :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)
1052
+ # * :address (Hash)
1053
+ # * :zip_plus_four_code (String)
1054
+ # * :address_1 (String)
1055
+ # * :address_2 (String)
1056
+ # * :city (String)
1057
+ # * :state (Commons::State)
1058
+ # * :zip_code (String)
1059
+ # * :first_name (String)
1060
+ # * :last_name (String)
1061
+ # * :gender (Individual::Gender)
1062
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
1063
+ # Box 19 on the CMS-1500 claim form.
1064
+ # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF*4N
1065
+ # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
1066
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
1067
+ # obtaining the authorization.
1068
+ # @param admission_date [Commons::DATE] 837p Loop2300 DTP*435, CMS-1500 Box 18
1069
+ # Required on all ambulance claims when the patient was known to be admitted to the hospital.
1070
+ # OR
1071
+ # Required on all claims involving inpatient medical visits.
1072
+ # @param discharge_date [Commons::DATE] 837p Loop2300 DTP*096, CMS-1500 Box 18
1073
+ # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
1074
+ # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP*431, CMS-1500 Box 14
1075
+ # 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.
1076
+ # OR
1077
+ # This date is the onset of acute symptoms for the current illness or condition.
1078
+ # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP*484, CMS-1500 Box 14
1079
+ # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
1080
+ # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
1081
+ # Code indicating the reason why a request was delayed
1082
+ # @param request_options [RequestOptions]
1083
+ # @return [Encounters::V4::Encounter]
1084
+ def update(encounter_id:, prior_authorization_number: nil, external_id: nil, date_of_service: nil,
1085
+ 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, request_options: nil)
1086
+ Async do
1087
+ response = @request_client.conn.patch("/api/encounters/v4/#{encounter_id}") do |req|
1088
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
1089
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
1090
+ req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
1091
+ req.body = {
1092
+ **(request_options&.additional_body_parameters || {}),
1093
+ prior_authorization_number: prior_authorization_number,
1094
+ external_id: external_id,
1095
+ date_of_service: date_of_service,
1096
+ diagnosis_ids: diagnosis_ids,
1097
+ tag_ids: tag_ids,
1098
+ clinical_notes: clinical_notes,
1099
+ pay_to_address: pay_to_address,
1100
+ billable_status: billable_status,
1101
+ responsible_party: responsible_party,
1102
+ provider_accepts_assignment: provider_accepts_assignment,
1103
+ benefits_assigned_to_provider: benefits_assigned_to_provider,
1104
+ synchronicity: synchronicity,
1105
+ place_of_service_code: place_of_service_code,
1106
+ appointment_type: appointment_type,
1107
+ end_date_of_service: end_date_of_service,
1108
+ subscriber_primary: subscriber_primary,
1109
+ subscriber_secondary: subscriber_secondary,
1110
+ additional_information: additional_information,
1111
+ service_authorization_exception_code: service_authorization_exception_code,
1112
+ admission_date: admission_date,
1113
+ discharge_date: discharge_date,
1114
+ onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date,
1115
+ last_menstrual_period_date: last_menstrual_period_date,
1116
+ delay_reason_code: delay_reason_code
1117
+ }.compact
1118
+ end
1119
+ Encounters::V4::Encounter.from_json(json_object: response.body)
1120
+ end
1121
+ end
1122
+ end
1123
+ end
1124
+ end
1125
+ end