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,515 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/encounter_id"
4
+ require_relative "../../../claims/types/claim"
5
+ require_relative "../../../individual/types/patient"
6
+ require_relative "../../../guarantor/v_1/types/guarantor"
7
+ require_relative "../../../encounter_providers/v_2/types/encounter_provider"
8
+ require_relative "../../../service_facility/types/encounter_service_facility"
9
+ require_relative "../../../individual/types/subscriber"
10
+ require_relative "../../../commons/types/link_url"
11
+ require_relative "../../../diagnoses/types/diagnosis"
12
+ require_relative "clinical_note_category"
13
+ require_relative "../../../billing_notes/v_2/types/billing_note"
14
+ require_relative "../../../commons/types/facility_type_code"
15
+ require_relative "patient_history_category"
16
+ require_relative "../../../patient_payments/v_3/types/patient_payment"
17
+ require_relative "../../../tags/types/tag"
18
+ require_relative "coding_attribution_type"
19
+ require_relative "../../../commons/types/work_queue_id"
20
+ require "date"
21
+ require_relative "encounter_owner_of_next_action_type"
22
+ require_relative "encounter_submission_origin_type"
23
+ require_relative "../../../commons/types/encounter_external_id"
24
+ require_relative "../../../commons/types/date"
25
+ require_relative "prior_authorization_number"
26
+ require_relative "medication"
27
+ require_relative "vitals"
28
+ require_relative "intervention"
29
+ require_relative "../../../commons/types/street_address_long_zip"
30
+ require_relative "synchronicity_type"
31
+ require_relative "billable_status_type"
32
+ require_relative "responsible_party_type"
33
+ require_relative "service_authorization_exception_code"
34
+ require_relative "../../../commons/types/delay_reason_code"
35
+ require "json"
36
+
37
+ module CandidApiClient
38
+ module Encounters
39
+ module V4
40
+ class Encounter
41
+ attr_reader :encounter_id, :claims, :patient, :guarantor, :billing_provider, :rendering_provider,
42
+ :referring_provider, :service_facility, :subscriber_primary, :subscriber_secondary, :url, :diagnoses, :clinical_notes, :billing_notes, :place_of_service_code, :place_of_service_code_as_submitted, :patient_histories, :patient_payments, :tags, :coding_attribution, :work_queue_id, :work_queue_membership_activated_at, :owner_of_next_action, :submission_origin, :external_id, :date_of_service, :end_date_of_service, :prior_authorization_number, :patient_authorized_release, :benefits_assigned_to_provider, :provider_accepts_assignment, :appointment_type, :existing_medications, :vitals, :interventions, :pay_to_address, :synchronicity, :billable_status, :responsible_party, :additional_information, :service_authorization_exception_code, :admission_date, :discharge_date, :onset_of_current_illness_or_symptom_date, :last_menstrual_period_date, :delay_reason_code, :additional_properties
43
+
44
+ # @param encounter_id [Commons::ENCOUNTER_ID]
45
+ # @param claims [Array<Claims::Claim>]
46
+ # @param patient [Individual::Patient] Contains the identification information of the individual receiving medical services.
47
+ # @param guarantor [Guarantor::V1::Guarantor] Personal and contact info for the guarantor of the patient responsibility.
48
+ # @param billing_provider [EncounterProviders::V2::EncounterProvider] The billing provider is the provider or business entity submitting the claim. Billing provider may be, but is not necessarily, the same person/NPI as the rendering provider. From a payer's perspective, this represents the person or entity being reimbursed. When a contract exists with the target payer, the billing provider should be the entity contracted with the payer. In some circumstances, this will be an individual provider. In that case, submit that provider's NPI and the tax ID (TIN) that the provider gave to the payer during contracting. In other cases, the billing entity will be a medical group. If so, submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.
49
+ # @param rendering_provider [EncounterProviders::V2::EncounterProvider] The rendering provider is the practitioner -- physician, nurse practitioner, etc. -- performing the service.
50
+ # 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.
51
+ # @param referring_provider [EncounterProviders::V2::EncounterProvider]
52
+ # @param service_facility [ServiceFacility::EncounterServiceFacility] Encounter Service facility is typically the location a medical service was rendered, such as a provider office or hospital. For telehealth, service facility can represent the provider's location when the service was delivered (e.g., home), or the location where an in-person visit would have taken place, whichever is easier to identify. If the provider is in-network, service facility may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that for an in-network claim to be successfully adjudicated, the service facility address listed on claims must match what was provided to the payer during the credentialing process.
53
+ # @param subscriber_primary [Individual::Subscriber] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e. when the claim should be billed to insurance).
54
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the claim should be billed to the patient).
55
+ # However, if you collect this for patients, even self-pay, we recommend including it when sending encounters to Candid.
56
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party to define self-pay claims.
57
+ # @param subscriber_secondary [Individual::Subscriber] Contains details of the secondary insurance subscriber.
58
+ # @param url [Commons::LINK_URL] URL that links directly to the claim created in Candid.
59
+ # @param diagnoses [Array<Diagnoses::Diagnosis>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses may be submitted at this time, and coders will later prioritize the 12 that will be submitted to the payor.
60
+ # @param clinical_notes [Array<Encounters::V4::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during patient encounters.
61
+ # @param billing_notes [Array<BillingNotes::V2::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
62
+ # used in the billing process.
63
+ # @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).
64
+ # @param place_of_service_code_as_submitted [Commons::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently supported. 02 for telemedicine, 11 for in-person. Full list [here](https://www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
65
+ # @param patient_histories [Array<Encounters::V4::PatientHistoryCategory>]
66
+ # @param patient_payments [Array<PatientPayments::V3::PatientPayment>]
67
+ # @param tags [Array<Tags::Tag>]
68
+ # @param coding_attribution [Encounters::V4::CodingAttributionType] The entity that performed the coding of medical services for the claim.
69
+ # @param work_queue_id [Commons::WORK_QUEUE_ID]
70
+ # @param work_queue_membership_activated_at [DateTime]
71
+ # @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.
72
+ # @param submission_origin [Encounters::V4::EncounterSubmissionOriginType] The party who originally submitted the Claim.
73
+ # For Claims originating in Candid, this will be EncounterSubmissionOriginType.CANDID.
74
+ # For Encounters created with an external_claim_submission object, this will be EncounterSubmissionOriginType.EXTERNAL.
75
+ # @param external_id [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
76
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
77
+ # This field should not contain PHI.
78
+ # @param date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
79
+ # This date must be the local date in the timezone where the service occurred.
80
+ # Box 24a on the CMS-1500 claim form.
81
+ # If service occurred over a range of dates, this should be the start date.
82
+ # @param end_date_of_service [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
83
+ # This date must be the local date in the timezone where the service occurred.
84
+ # If omitted, the Encounter is assumed to be for a single day.
85
+ # Must not be temporally before the date_of_service field.
86
+ # @param prior_authorization_number [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
87
+ # @param patient_authorized_release [Boolean] Whether this patient has authorized the release of medical information
88
+ # for billing purpose.
89
+ # Box 12 on the CMS-1500 claim form.
90
+ # @param benefits_assigned_to_provider [Boolean] Whether this patient has authorized insurance payments to be made to you,
91
+ # not them. If false, patient may receive reimbursement.
92
+ # Box 13 on the CMS-1500 claim form.
93
+ # @param provider_accepts_assignment [Boolean] Whether you have accepted the patient's authorization for insurance payments
94
+ # to be made to you, not them.
95
+ # Box 27 on the CMS-1500 claim form.
96
+ # @param appointment_type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
97
+ # @param existing_medications [Array<Encounters::V4::Medication>]
98
+ # @param vitals [Encounters::V4::Vitals]
99
+ # @param interventions [Array<Encounters::V4::Intervention>]
100
+ # @param pay_to_address [Commons::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
101
+ # @param synchronicity [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
102
+ # Asynchronous encounters occur when providers and patients communicate online using
103
+ # forms, instant messaging, or other pre-recorded digital mediums.
104
+ # Synchronous encounters occur in live, real-time settings where the patient interacts
105
+ # directly with the provider, such as over video or a phone call.
106
+ # @param billable_status [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
107
+ # Examples for when this should be set to NOT_BILLABLE include
108
+ # if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
109
+ # @param responsible_party [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
110
+ # @param additional_information [String] Defines additional information on the claim needed by the payer.
111
+ # Box 19 on the CMS-1500 claim form.
112
+ # @param service_authorization_exception_code [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
113
+ # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
114
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
115
+ # obtaining the authorization.
116
+ # @param admission_date [Commons::DATE] 837p Loop2300 DTP\*435, CMS-1500 Box 18
117
+ # Required on all ambulance claims when the patient was known to be admitted to the hospital.
118
+ # OR
119
+ # Required on all claims involving inpatient medical visits.
120
+ # @param discharge_date [Commons::DATE] 837p Loop2300 DTP\*096, CMS-1500 Box 18
121
+ # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
122
+ # @param onset_of_current_illness_or_symptom_date [Commons::DATE] 837p Loop2300 DTP\*431, CMS-1500 Box 14
123
+ # 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.
124
+ # OR
125
+ # This date is the onset of acute symptoms for the current illness or condition.
126
+ # @param last_menstrual_period_date [Commons::DATE] 837p Loop2300 DTP\*484, CMS-1500 Box 14
127
+ # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
128
+ # @param delay_reason_code [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
129
+ # Code indicating the reason why a request was delayed
130
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
131
+ # @return [Encounters::V4::Encounter]
132
+ def initialize(encounter_id:, claims:, patient:, billing_provider:, rendering_provider:, service_facility:, url:, diagnoses:, clinical_notes:, patient_histories:, patient_payments:, tags:, owner_of_next_action:, submission_origin:, external_id:, date_of_service:, patient_authorized_release:, benefits_assigned_to_provider:, provider_accepts_assignment:, billable_status:, responsible_party:, guarantor: nil,
133
+ referring_provider: nil, subscriber_primary: nil, subscriber_secondary: nil, billing_notes: nil, place_of_service_code: nil, place_of_service_code_as_submitted: nil, coding_attribution: nil, work_queue_id: nil, work_queue_membership_activated_at: nil, 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)
134
+ # @type [Commons::ENCOUNTER_ID]
135
+ @encounter_id = encounter_id
136
+ # @type [Array<Claims::Claim>]
137
+ @claims = claims
138
+ # @type [Individual::Patient] Contains the identification information of the individual receiving medical services.
139
+ @patient = patient
140
+ # @type [Guarantor::V1::Guarantor] Personal and contact info for the guarantor of the patient responsibility.
141
+ @guarantor = guarantor
142
+ # @type [EncounterProviders::V2::EncounterProvider] The billing provider is the provider or business entity submitting the claim. Billing provider may be, but is not necessarily, the same person/NPI as the rendering provider. From a payer's perspective, this represents the person or entity being reimbursed. When a contract exists with the target payer, the billing provider should be the entity contracted with the payer. In some circumstances, this will be an individual provider. In that case, submit that provider's NPI and the tax ID (TIN) that the provider gave to the payer during contracting. In other cases, the billing entity will be a medical group. If so, submit the group NPI and the group's tax ID. Box 33 on the CMS-1500 claim form.
143
+ @billing_provider = billing_provider
144
+ # @type [EncounterProviders::V2::EncounterProvider] The rendering provider is the practitioner -- physician, nurse practitioner, etc. -- performing the service.
145
+ # 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.
146
+ @rendering_provider = rendering_provider
147
+ # @type [EncounterProviders::V2::EncounterProvider]
148
+ @referring_provider = referring_provider
149
+ # @type [ServiceFacility::EncounterServiceFacility] Encounter Service facility is typically the location a medical service was rendered, such as a provider office or hospital. For telehealth, service facility can represent the provider's location when the service was delivered (e.g., home), or the location where an in-person visit would have taken place, whichever is easier to identify. If the provider is in-network, service facility may be defined in payer contracts. Box 32 on the CMS-1500 claim form. Note that for an in-network claim to be successfully adjudicated, the service facility address listed on claims must match what was provided to the payer during the credentialing process.
150
+ @service_facility = service_facility
151
+ # @type [Individual::Subscriber] Subscriber_primary is required when responsible_party is INSURANCE_PAY (i.e. when the claim should be billed to insurance).
152
+ # These are not required fields when responsible_party is SELF_PAY (i.e. when the claim should be billed to the patient).
153
+ # However, if you collect this for patients, even self-pay, we recommend including it when sending encounters to Candid.
154
+ # Note: Cash Pay is no longer a valid payer_id in v4, please use responsible party to define self-pay claims.
155
+ @subscriber_primary = subscriber_primary
156
+ # @type [Individual::Subscriber] Contains details of the secondary insurance subscriber.
157
+ @subscriber_secondary = subscriber_secondary
158
+ # @type [Commons::LINK_URL] URL that links directly to the claim created in Candid.
159
+ @url = url
160
+ # @type [Array<Diagnoses::Diagnosis>] Ideally, this field should contain no more than 12 diagnoses. However, more diagnoses may be submitted at this time, and coders will later prioritize the 12 that will be submitted to the payor.
161
+ @diagnoses = diagnoses
162
+ # @type [Array<Encounters::V4::ClinicalNoteCategory>] Holds a collection of clinical observations made by healthcare providers during patient encounters.
163
+ @clinical_notes = clinical_notes
164
+ # @type [Array<BillingNotes::V2::BillingNote>] Spot to store misc, human-readable, notes about this encounter to be
165
+ # used in the billing process.
166
+ @billing_notes = billing_notes
167
+ # @type [Commons::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently supported. 02 for telemedicine, 11 for in-person. Full list [here](https://www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
168
+ @place_of_service_code = place_of_service_code
169
+ # @type [Commons::FacilityTypeCode] Box 24B on the CMS-1500 claim form. Line-level place of service is not currently supported. 02 for telemedicine, 11 for in-person. Full list [here](https://www.cms.gov/Medicare/Coding/place-of-service-codes/Place_of_Service_Code_Set).
170
+ @place_of_service_code_as_submitted = place_of_service_code_as_submitted
171
+ # @type [Array<Encounters::V4::PatientHistoryCategory>]
172
+ @patient_histories = patient_histories
173
+ # @type [Array<PatientPayments::V3::PatientPayment>]
174
+ @patient_payments = patient_payments
175
+ # @type [Array<Tags::Tag>]
176
+ @tags = tags
177
+ # @type [Encounters::V4::CodingAttributionType] The entity that performed the coding of medical services for the claim.
178
+ @coding_attribution = coding_attribution
179
+ # @type [Commons::WORK_QUEUE_ID]
180
+ @work_queue_id = work_queue_id
181
+ # @type [DateTime]
182
+ @work_queue_membership_activated_at = work_queue_membership_activated_at
183
+ # @type [Encounters::V4::EncounterOwnerOfNextActionType] The party who is responsible for taking the next action on an Encounter, as defined by ownership of open Tasks.
184
+ @owner_of_next_action = owner_of_next_action
185
+ # @type [Encounters::V4::EncounterSubmissionOriginType] The party who originally submitted the Claim.
186
+ # For Claims originating in Candid, this will be EncounterSubmissionOriginType.CANDID.
187
+ # For Encounters created with an external_claim_submission object, this will be EncounterSubmissionOriginType.EXTERNAL.
188
+ @submission_origin = submission_origin
189
+ # @type [Commons::ENCOUNTER_EXTERNAL_ID] A client-specified unique ID to associate with this encounter;
190
+ # for example, your internal encounter ID or a Dr. Chrono encounter ID.
191
+ # This field should not contain PHI.
192
+ @external_id = external_id
193
+ # @type [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
194
+ # This date must be the local date in the timezone where the service occurred.
195
+ # Box 24a on the CMS-1500 claim form.
196
+ # If service occurred over a range of dates, this should be the start date.
197
+ @date_of_service = date_of_service
198
+ # @type [Commons::DATE] Date formatted as YYYY-MM-DD; eg: 2019-08-25.
199
+ # This date must be the local date in the timezone where the service occurred.
200
+ # If omitted, the Encounter is assumed to be for a single day.
201
+ # Must not be temporally before the date_of_service field.
202
+ @end_date_of_service = end_date_of_service
203
+ # @type [Encounters::V4::PRIOR_AUTHORIZATION_NUMBER] Box 23 on the CMS-1500 claim form.
204
+ @prior_authorization_number = prior_authorization_number
205
+ # @type [Boolean] Whether this patient has authorized the release of medical information
206
+ # for billing purpose.
207
+ # Box 12 on the CMS-1500 claim form.
208
+ @patient_authorized_release = patient_authorized_release
209
+ # @type [Boolean] Whether this patient has authorized insurance payments to be made to you,
210
+ # not them. If false, patient may receive reimbursement.
211
+ # Box 13 on the CMS-1500 claim form.
212
+ @benefits_assigned_to_provider = benefits_assigned_to_provider
213
+ # @type [Boolean] Whether you have accepted the patient's authorization for insurance payments
214
+ # to be made to you, not them.
215
+ # Box 27 on the CMS-1500 claim form.
216
+ @provider_accepts_assignment = provider_accepts_assignment
217
+ # @type [String] Human-readable description of the appointment type (ex: "Acupuncture - Headaches").
218
+ @appointment_type = appointment_type
219
+ # @type [Array<Encounters::V4::Medication>]
220
+ @existing_medications = existing_medications
221
+ # @type [Encounters::V4::Vitals]
222
+ @vitals = vitals
223
+ # @type [Array<Encounters::V4::Intervention>]
224
+ @interventions = interventions
225
+ # @type [Commons::StreetAddressLongZip] Specifies the address to which payments for the claim should be sent.
226
+ @pay_to_address = pay_to_address
227
+ # @type [Encounters::V4::SynchronicityType] Whether or not this was a synchronous or asynchronous encounter.
228
+ # Asynchronous encounters occur when providers and patients communicate online using
229
+ # forms, instant messaging, or other pre-recorded digital mediums.
230
+ # Synchronous encounters occur in live, real-time settings where the patient interacts
231
+ # directly with the provider, such as over video or a phone call.
232
+ @synchronicity = synchronicity
233
+ # @type [Encounters::V4::BillableStatusType] Defines if the Encounter is to be billed by Candid to the responsible_party.
234
+ # Examples for when this should be set to NOT_BILLABLE include
235
+ # if the Encounter has not occurred yet or if there is no intention of ever billing the responsible_party.
236
+ @billable_status = billable_status
237
+ # @type [Encounters::V4::ResponsiblePartyType] Defines the party to be billed with the initial balance owed on the claim.
238
+ @responsible_party = responsible_party
239
+ # @type [String] Defines additional information on the claim needed by the payer.
240
+ # Box 19 on the CMS-1500 claim form.
241
+ @additional_information = additional_information
242
+ # @type [Encounters::V4::ServiceAuthorizationExceptionCode] 837p Loop2300 REF\*4N
243
+ # Required when mandated by government law or regulation to obtain authorization for specific service(s) but, for the
244
+ # reasons listed in one of the enum values of ServiceAuthorizationExceptionCode, the service was performed without
245
+ # obtaining the authorization.
246
+ @service_authorization_exception_code = service_authorization_exception_code
247
+ # @type [Commons::DATE] 837p Loop2300 DTP\*435, CMS-1500 Box 18
248
+ # Required on all ambulance claims when the patient was known to be admitted to the hospital.
249
+ # OR
250
+ # Required on all claims involving inpatient medical visits.
251
+ @admission_date = admission_date
252
+ # @type [Commons::DATE] 837p Loop2300 DTP\*096, CMS-1500 Box 18
253
+ # Required for inpatient claims when the patient was discharged from the facility and the discharge date is known.
254
+ @discharge_date = discharge_date
255
+ # @type [Commons::DATE] 837p Loop2300 DTP\*431, CMS-1500 Box 14
256
+ # 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.
257
+ # OR
258
+ # This date is the onset of acute symptoms for the current illness or condition.
259
+ @onset_of_current_illness_or_symptom_date = onset_of_current_illness_or_symptom_date
260
+ # @type [Commons::DATE] 837p Loop2300 DTP\*484, CMS-1500 Box 14
261
+ # Required when, in the judgment of the provider, the services on this claim are related to the patient's pregnancy.
262
+ @last_menstrual_period_date = last_menstrual_period_date
263
+ # @type [Commons::DelayReasonCode] 837i Loop2300, CLM-1300 Box 20
264
+ # Code indicating the reason why a request was delayed
265
+ @delay_reason_code = delay_reason_code
266
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
267
+ @additional_properties = additional_properties
268
+ end
269
+
270
+ # Deserialize a JSON object to an instance of Encounter
271
+ #
272
+ # @param json_object [JSON]
273
+ # @return [Encounters::V4::Encounter]
274
+ def self.from_json(json_object:)
275
+ struct = JSON.parse(json_object, object_class: OpenStruct)
276
+ parsed_json = JSON.parse(json_object)
277
+ encounter_id = struct.encounter_id
278
+ claims = parsed_json["claims"]&.map do |v|
279
+ v = v.to_json
280
+ Claims::Claim.from_json(json_object: v)
281
+ end
282
+ if parsed_json["patient"].nil?
283
+ patient = nil
284
+ else
285
+ patient = parsed_json["patient"].to_json
286
+ patient = Individual::Patient.from_json(json_object: patient)
287
+ end
288
+ if parsed_json["guarantor"].nil?
289
+ guarantor = nil
290
+ else
291
+ guarantor = parsed_json["guarantor"].to_json
292
+ guarantor = Guarantor::V1::Guarantor.from_json(json_object: guarantor)
293
+ end
294
+ if parsed_json["billing_provider"].nil?
295
+ billing_provider = nil
296
+ else
297
+ billing_provider = parsed_json["billing_provider"].to_json
298
+ billing_provider = EncounterProviders::V2::EncounterProvider.from_json(json_object: billing_provider)
299
+ end
300
+ if parsed_json["rendering_provider"].nil?
301
+ rendering_provider = nil
302
+ else
303
+ rendering_provider = parsed_json["rendering_provider"].to_json
304
+ rendering_provider = EncounterProviders::V2::EncounterProvider.from_json(json_object: rendering_provider)
305
+ end
306
+ if parsed_json["referring_provider"].nil?
307
+ referring_provider = nil
308
+ else
309
+ referring_provider = parsed_json["referring_provider"].to_json
310
+ referring_provider = EncounterProviders::V2::EncounterProvider.from_json(json_object: referring_provider)
311
+ end
312
+ if parsed_json["service_facility"].nil?
313
+ service_facility = nil
314
+ else
315
+ service_facility = parsed_json["service_facility"].to_json
316
+ service_facility = ServiceFacility::EncounterServiceFacility.from_json(json_object: service_facility)
317
+ end
318
+ if parsed_json["subscriber_primary"].nil?
319
+ subscriber_primary = nil
320
+ else
321
+ subscriber_primary = parsed_json["subscriber_primary"].to_json
322
+ subscriber_primary = Individual::Subscriber.from_json(json_object: subscriber_primary)
323
+ end
324
+ if parsed_json["subscriber_secondary"].nil?
325
+ subscriber_secondary = nil
326
+ else
327
+ subscriber_secondary = parsed_json["subscriber_secondary"].to_json
328
+ subscriber_secondary = Individual::Subscriber.from_json(json_object: subscriber_secondary)
329
+ end
330
+ url = struct.url
331
+ diagnoses = parsed_json["diagnoses"]&.map do |v|
332
+ v = v.to_json
333
+ Diagnoses::Diagnosis.from_json(json_object: v)
334
+ end
335
+ clinical_notes = parsed_json["clinical_notes"]&.map do |v|
336
+ v = v.to_json
337
+ Encounters::V4::ClinicalNoteCategory.from_json(json_object: v)
338
+ end
339
+ billing_notes = parsed_json["billing_notes"]&.map do |v|
340
+ v = v.to_json
341
+ BillingNotes::V2::BillingNote.from_json(json_object: v)
342
+ end
343
+ place_of_service_code = struct.place_of_service_code
344
+ place_of_service_code_as_submitted = struct.place_of_service_code_as_submitted
345
+ patient_histories = parsed_json["patient_histories"]&.map do |v|
346
+ v = v.to_json
347
+ Encounters::V4::PatientHistoryCategory.from_json(json_object: v)
348
+ end
349
+ patient_payments = parsed_json["patient_payments"]&.map do |v|
350
+ v = v.to_json
351
+ PatientPayments::V3::PatientPayment.from_json(json_object: v)
352
+ end
353
+ tags = parsed_json["tags"]&.map do |v|
354
+ v = v.to_json
355
+ Tags::Tag.from_json(json_object: v)
356
+ end
357
+ coding_attribution = struct.coding_attribution
358
+ work_queue_id = struct.work_queue_id
359
+ work_queue_membership_activated_at = unless parsed_json["work_queue_membership_activated_at"].nil?
360
+ DateTime.parse(parsed_json["work_queue_membership_activated_at"])
361
+ end
362
+ owner_of_next_action = struct.owner_of_next_action
363
+ submission_origin = struct.submission_origin
364
+ external_id = struct.external_id
365
+ date_of_service = struct.date_of_service
366
+ end_date_of_service = struct.end_date_of_service
367
+ prior_authorization_number = struct.prior_authorization_number
368
+ patient_authorized_release = struct.patient_authorized_release
369
+ benefits_assigned_to_provider = struct.benefits_assigned_to_provider
370
+ provider_accepts_assignment = struct.provider_accepts_assignment
371
+ appointment_type = struct.appointment_type
372
+ existing_medications = parsed_json["existing_medications"]&.map do |v|
373
+ v = v.to_json
374
+ Encounters::V4::Medication.from_json(json_object: v)
375
+ end
376
+ if parsed_json["vitals"].nil?
377
+ vitals = nil
378
+ else
379
+ vitals = parsed_json["vitals"].to_json
380
+ vitals = Encounters::V4::Vitals.from_json(json_object: vitals)
381
+ end
382
+ interventions = parsed_json["interventions"]&.map do |v|
383
+ v = v.to_json
384
+ Encounters::V4::Intervention.from_json(json_object: v)
385
+ end
386
+ if parsed_json["pay_to_address"].nil?
387
+ pay_to_address = nil
388
+ else
389
+ pay_to_address = parsed_json["pay_to_address"].to_json
390
+ pay_to_address = Commons::StreetAddressLongZip.from_json(json_object: pay_to_address)
391
+ end
392
+ synchronicity = struct.synchronicity
393
+ billable_status = struct.billable_status
394
+ responsible_party = struct.responsible_party
395
+ additional_information = struct.additional_information
396
+ service_authorization_exception_code = struct.service_authorization_exception_code
397
+ admission_date = struct.admission_date
398
+ discharge_date = struct.discharge_date
399
+ onset_of_current_illness_or_symptom_date = struct.onset_of_current_illness_or_symptom_date
400
+ last_menstrual_period_date = struct.last_menstrual_period_date
401
+ delay_reason_code = struct.delay_reason_code
402
+ new(encounter_id: encounter_id, claims: claims, patient: patient, guarantor: guarantor,
403
+ billing_provider: billing_provider, rendering_provider: rendering_provider, referring_provider: referring_provider, service_facility: service_facility, subscriber_primary: subscriber_primary, subscriber_secondary: subscriber_secondary, url: url, diagnoses: diagnoses, clinical_notes: clinical_notes, billing_notes: billing_notes, place_of_service_code: place_of_service_code, place_of_service_code_as_submitted: place_of_service_code_as_submitted, patient_histories: patient_histories, patient_payments: patient_payments, tags: tags, coding_attribution: coding_attribution, work_queue_id: work_queue_id, work_queue_membership_activated_at: work_queue_membership_activated_at, owner_of_next_action: owner_of_next_action, submission_origin: submission_origin, external_id: external_id, date_of_service: date_of_service, end_date_of_service: end_date_of_service, prior_authorization_number: prior_authorization_number, patient_authorized_release: patient_authorized_release, benefits_assigned_to_provider: benefits_assigned_to_provider, provider_accepts_assignment: provider_accepts_assignment, appointment_type: appointment_type, existing_medications: existing_medications, vitals: vitals, interventions: interventions, pay_to_address: pay_to_address, synchronicity: synchronicity, billable_status: billable_status, responsible_party: responsible_party, additional_information: additional_information, service_authorization_exception_code: service_authorization_exception_code, admission_date: admission_date, discharge_date: discharge_date, onset_of_current_illness_or_symptom_date: onset_of_current_illness_or_symptom_date, last_menstrual_period_date: last_menstrual_period_date, delay_reason_code: delay_reason_code, additional_properties: struct)
404
+ end
405
+
406
+ # Serialize an instance of Encounter to a JSON object
407
+ #
408
+ # @return [JSON]
409
+ def to_json(*_args)
410
+ {
411
+ "encounter_id": @encounter_id,
412
+ "claims": @claims,
413
+ "patient": @patient,
414
+ "guarantor": @guarantor,
415
+ "billing_provider": @billing_provider,
416
+ "rendering_provider": @rendering_provider,
417
+ "referring_provider": @referring_provider,
418
+ "service_facility": @service_facility,
419
+ "subscriber_primary": @subscriber_primary,
420
+ "subscriber_secondary": @subscriber_secondary,
421
+ "url": @url,
422
+ "diagnoses": @diagnoses,
423
+ "clinical_notes": @clinical_notes,
424
+ "billing_notes": @billing_notes,
425
+ "place_of_service_code": @place_of_service_code,
426
+ "place_of_service_code_as_submitted": @place_of_service_code_as_submitted,
427
+ "patient_histories": @patient_histories,
428
+ "patient_payments": @patient_payments,
429
+ "tags": @tags,
430
+ "coding_attribution": @coding_attribution,
431
+ "work_queue_id": @work_queue_id,
432
+ "work_queue_membership_activated_at": @work_queue_membership_activated_at,
433
+ "owner_of_next_action": @owner_of_next_action,
434
+ "submission_origin": @submission_origin,
435
+ "external_id": @external_id,
436
+ "date_of_service": @date_of_service,
437
+ "end_date_of_service": @end_date_of_service,
438
+ "prior_authorization_number": @prior_authorization_number,
439
+ "patient_authorized_release": @patient_authorized_release,
440
+ "benefits_assigned_to_provider": @benefits_assigned_to_provider,
441
+ "provider_accepts_assignment": @provider_accepts_assignment,
442
+ "appointment_type": @appointment_type,
443
+ "existing_medications": @existing_medications,
444
+ "vitals": @vitals,
445
+ "interventions": @interventions,
446
+ "pay_to_address": @pay_to_address,
447
+ "synchronicity": @synchronicity,
448
+ "billable_status": @billable_status,
449
+ "responsible_party": @responsible_party,
450
+ "additional_information": @additional_information,
451
+ "service_authorization_exception_code": @service_authorization_exception_code,
452
+ "admission_date": @admission_date,
453
+ "discharge_date": @discharge_date,
454
+ "onset_of_current_illness_or_symptom_date": @onset_of_current_illness_or_symptom_date,
455
+ "last_menstrual_period_date": @last_menstrual_period_date,
456
+ "delay_reason_code": @delay_reason_code
457
+ }.to_json
458
+ end
459
+
460
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
461
+ #
462
+ # @param obj [Object]
463
+ # @return [Void]
464
+ def self.validate_raw(obj:)
465
+ obj.encounter_id.is_a?(String) != false || raise("Passed value for field obj.encounter_id is not the expected type, validation failed.")
466
+ obj.claims.is_a?(Array) != false || raise("Passed value for field obj.claims is not the expected type, validation failed.")
467
+ Individual::Patient.validate_raw(obj: obj.patient)
468
+ obj.guarantor.nil? || Guarantor::V1::Guarantor.validate_raw(obj: obj.guarantor)
469
+ EncounterProviders::V2::EncounterProvider.validate_raw(obj: obj.billing_provider)
470
+ EncounterProviders::V2::EncounterProvider.validate_raw(obj: obj.rendering_provider)
471
+ obj.referring_provider.nil? || EncounterProviders::V2::EncounterProvider.validate_raw(obj: obj.referring_provider)
472
+ ServiceFacility::EncounterServiceFacility.validate_raw(obj: obj.service_facility)
473
+ obj.subscriber_primary.nil? || Individual::Subscriber.validate_raw(obj: obj.subscriber_primary)
474
+ obj.subscriber_secondary.nil? || Individual::Subscriber.validate_raw(obj: obj.subscriber_secondary)
475
+ obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
476
+ obj.diagnoses.is_a?(Array) != false || raise("Passed value for field obj.diagnoses is not the expected type, validation failed.")
477
+ obj.clinical_notes.is_a?(Array) != false || raise("Passed value for field obj.clinical_notes is not the expected type, validation failed.")
478
+ obj.billing_notes&.is_a?(Array) != false || raise("Passed value for field obj.billing_notes is not the expected type, validation failed.")
479
+ obj.place_of_service_code&.is_a?(Commons::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code is not the expected type, validation failed.")
480
+ obj.place_of_service_code_as_submitted&.is_a?(Commons::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code_as_submitted is not the expected type, validation failed.")
481
+ obj.patient_histories.is_a?(Array) != false || raise("Passed value for field obj.patient_histories is not the expected type, validation failed.")
482
+ obj.patient_payments.is_a?(Array) != false || raise("Passed value for field obj.patient_payments is not the expected type, validation failed.")
483
+ obj.tags.is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.")
484
+ obj.coding_attribution&.is_a?(Encounters::V4::CodingAttributionType) != false || raise("Passed value for field obj.coding_attribution is not the expected type, validation failed.")
485
+ obj.work_queue_id&.is_a?(String) != false || raise("Passed value for field obj.work_queue_id is not the expected type, validation failed.")
486
+ obj.work_queue_membership_activated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.work_queue_membership_activated_at is not the expected type, validation failed.")
487
+ obj.owner_of_next_action.is_a?(Encounters::V4::EncounterOwnerOfNextActionType) != false || raise("Passed value for field obj.owner_of_next_action is not the expected type, validation failed.")
488
+ obj.submission_origin.is_a?(Encounters::V4::EncounterSubmissionOriginType) != false || raise("Passed value for field obj.submission_origin is not the expected type, validation failed.")
489
+ obj.external_id.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
490
+ obj.date_of_service.is_a?(String) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
491
+ obj.end_date_of_service&.is_a?(String) != false || raise("Passed value for field obj.end_date_of_service is not the expected type, validation failed.")
492
+ obj.prior_authorization_number&.is_a?(String) != false || raise("Passed value for field obj.prior_authorization_number is not the expected type, validation failed.")
493
+ obj.patient_authorized_release.is_a?(Boolean) != false || raise("Passed value for field obj.patient_authorized_release is not the expected type, validation failed.")
494
+ obj.benefits_assigned_to_provider.is_a?(Boolean) != false || raise("Passed value for field obj.benefits_assigned_to_provider is not the expected type, validation failed.")
495
+ obj.provider_accepts_assignment.is_a?(Boolean) != false || raise("Passed value for field obj.provider_accepts_assignment is not the expected type, validation failed.")
496
+ obj.appointment_type&.is_a?(String) != false || raise("Passed value for field obj.appointment_type is not the expected type, validation failed.")
497
+ obj.existing_medications&.is_a?(Array) != false || raise("Passed value for field obj.existing_medications is not the expected type, validation failed.")
498
+ obj.vitals.nil? || Encounters::V4::Vitals.validate_raw(obj: obj.vitals)
499
+ obj.interventions&.is_a?(Array) != false || raise("Passed value for field obj.interventions is not the expected type, validation failed.")
500
+ obj.pay_to_address.nil? || Commons::StreetAddressLongZip.validate_raw(obj: obj.pay_to_address)
501
+ obj.synchronicity&.is_a?(Encounters::V4::SynchronicityType) != false || raise("Passed value for field obj.synchronicity is not the expected type, validation failed.")
502
+ obj.billable_status.is_a?(Encounters::V4::BillableStatusType) != false || raise("Passed value for field obj.billable_status is not the expected type, validation failed.")
503
+ obj.responsible_party.is_a?(Encounters::V4::ResponsiblePartyType) != false || raise("Passed value for field obj.responsible_party is not the expected type, validation failed.")
504
+ obj.additional_information&.is_a?(String) != false || raise("Passed value for field obj.additional_information is not the expected type, validation failed.")
505
+ obj.service_authorization_exception_code&.is_a?(Encounters::V4::ServiceAuthorizationExceptionCode) != false || raise("Passed value for field obj.service_authorization_exception_code is not the expected type, validation failed.")
506
+ obj.admission_date&.is_a?(String) != false || raise("Passed value for field obj.admission_date is not the expected type, validation failed.")
507
+ obj.discharge_date&.is_a?(String) != false || raise("Passed value for field obj.discharge_date is not the expected type, validation failed.")
508
+ obj.onset_of_current_illness_or_symptom_date&.is_a?(String) != false || raise("Passed value for field obj.onset_of_current_illness_or_symptom_date is not the expected type, validation failed.")
509
+ obj.last_menstrual_period_date&.is_a?(String) != false || raise("Passed value for field obj.last_menstrual_period_date is not the expected type, validation failed.")
510
+ obj.delay_reason_code&.is_a?(Commons::DelayReasonCode) != false || raise("Passed value for field obj.delay_reason_code is not the expected type, validation failed.")
511
+ end
512
+ end
513
+ end
514
+ end
515
+ end