candidhealth 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/auth/default/client.rb +34 -6
  3. data/lib/candidhealth/charge_capture/v_1/client.rb +48 -48
  4. data/lib/candidhealth/charge_capture/v_1/types/charge_capture_data.rb +70 -56
  5. data/lib/candidhealth/commons/types/clearinghouse.rb +18 -0
  6. data/lib/candidhealth/commons/types/procedure_modifier.rb +11 -0
  7. data/lib/candidhealth/encounter_providers/v_2/types/billing_provider.rb +1 -1
  8. data/lib/candidhealth/encounter_providers/v_2/types/billing_provider_update.rb +1 -1
  9. data/lib/candidhealth/encounter_providers/v_2/types/billing_provider_update_with_optional_address.rb +1 -1
  10. data/lib/candidhealth/encounters/v_4/client.rb +3253 -2040
  11. data/lib/candidhealth/encounters/v_4/types/encounter.rb +111 -86
  12. data/lib/candidhealth/encounters/v_4/types/encounter_base.rb +39 -33
  13. data/lib/candidhealth/encounters/v_4/types/encounter_create.rb +796 -0
  14. data/lib/candidhealth/encounters/v_4/types/encounter_create_from_pre_encounter.rb +131 -117
  15. data/lib/candidhealth/encounters/v_4/types/encounter_deep_optional.rb +70 -56
  16. data/lib/candidhealth/encounters/v_4/types/encounter_optional.rb +29 -39
  17. data/lib/candidhealth/encounters/v_4/types/encounter_rendering_or_attending_provider_required_error.rb +55 -0
  18. data/lib/candidhealth/encounters/v_4/types/encounter_update.rb +736 -0
  19. data/lib/candidhealth/encounters_universal/types/universal_encounter_create.rb +944 -0
  20. data/lib/candidhealth/encounters_universal/types/universal_encounter_create_base.rb +691 -0
  21. data/lib/candidhealth/encounters_universal/types/universal_encounter_create_from_pre_encounter.rb +791 -0
  22. data/lib/candidhealth/encounters_universal/types/universal_encounter_create_from_pre_encounter_base.rb +572 -0
  23. data/lib/candidhealth/encounters_universal/types/universal_encounter_update.rb +872 -0
  24. data/lib/candidhealth/encounters_universal/types/universal_encounter_update_base.rb +700 -0
  25. data/lib/candidhealth/fee_schedules/v_3/client.rb +57 -0
  26. data/lib/candidhealth/fee_schedules/v_3/types/validation_error.rb +12 -0
  27. data/lib/candidhealth/financials/types/patient_transaction_source.rb +1 -0
  28. data/lib/candidhealth/health_care_code_information/v_1/types/admitting_diagnosis_new.rb +206 -0
  29. data/lib/candidhealth/health_care_code_information/v_1/types/condition_information_new.rb +207 -0
  30. data/lib/candidhealth/health_care_code_information/v_1/types/diagnosis_related_group_new.rb +206 -0
  31. data/lib/candidhealth/health_care_code_information/v_1/types/external_cause_of_injury_new.rb +245 -0
  32. data/lib/candidhealth/health_care_code_information/v_1/types/health_care_code_information_create.rb +225 -0
  33. data/lib/candidhealth/health_care_code_information/v_1/types/occurrence_information_new.rb +219 -0
  34. data/lib/candidhealth/health_care_code_information/v_1/types/occurrence_span_information_new.rb +222 -0
  35. data/lib/candidhealth/health_care_code_information/v_1/types/other_diagnosis_information_new.rb +215 -0
  36. data/lib/candidhealth/health_care_code_information/v_1/types/other_procedure_information_new.rb +218 -0
  37. data/lib/candidhealth/health_care_code_information/v_1/types/patient_reason_for_visit_new.rb +206 -0
  38. data/lib/candidhealth/health_care_code_information/v_1/types/principal_diagnosis_new.rb +215 -0
  39. data/lib/candidhealth/health_care_code_information/v_1/types/principal_procedure_information_new.rb +216 -0
  40. data/lib/candidhealth/health_care_code_information/v_1/types/treatment_code_information_new.rb +206 -0
  41. data/lib/candidhealth/health_care_code_information/v_1/types/value_information_new.rb +215 -0
  42. data/lib/candidhealth/individual/types/patient.rb +6 -6
  43. data/lib/candidhealth/individual/types/patient_base.rb +6 -6
  44. data/lib/candidhealth/individual/types/patient_create.rb +6 -6
  45. data/lib/candidhealth/individual/types/patient_update.rb +6 -6
  46. data/lib/candidhealth/individual/types/patient_update_with_optional_address.rb +6 -6
  47. data/lib/candidhealth/organization_providers/v_2/types/license_type.rb +2 -0
  48. data/lib/candidhealth/payers/client.rb +7 -0
  49. data/lib/candidhealth/payers/v_4/client.rb +137 -0
  50. data/lib/candidhealth/payers/v_4/types/clearinghouse_payer_info.rb +93 -0
  51. data/lib/candidhealth/payers/v_4/types/payer.rb +116 -0
  52. data/lib/candidhealth/payers/v_4/types/payer_ids.rb +107 -0
  53. data/lib/candidhealth/payers/v_4/types/payer_page.rb +88 -0
  54. data/lib/candidhealth/payers/v_4/types/support_state.rb +15 -0
  55. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +4 -4
  56. data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +3 -3
  57. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +72 -6
  58. data/lib/candidhealth/pre_encounter/patients/v_1/types/guarantor.rb +3 -3
  59. data/lib/candidhealth/pre_encounter/patients/v_1/types/inferred_patient_metadata.rb +80 -0
  60. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +19 -5
  61. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient_with_mrn.rb +19 -5
  62. data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +18 -4
  63. data/lib/candidhealth/pre_encounter/patients/v_1/types/referral_type.rb +1 -0
  64. data/lib/candidhealth/service_lines/v_2/client.rb +252 -10
  65. data/lib/candidhealth/service_lines/v_2/types/service_line.rb +28 -10
  66. data/lib/candidhealth/service_lines/v_2/types/service_line_create.rb +52 -40
  67. data/lib/candidhealth/service_lines/v_2/types/service_line_create_base.rb +251 -0
  68. data/lib/candidhealth/service_lines/v_2/types/service_line_create_base_base.rb +243 -0
  69. data/lib/candidhealth/service_lines/v_2/types/service_line_create_optional.rb +48 -24
  70. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +58 -46
  71. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone_base.rb +273 -0
  72. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone_base_base.rb +265 -0
  73. data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +64 -54
  74. data/lib/candidhealth/service_lines/v_2/types/service_line_update_base.rb +263 -0
  75. data/lib/candidhealth/service_lines/v_2/types/universal_service_line_create.rb +271 -0
  76. data/lib/candidhealth/service_lines/v_2/types/universal_service_line_create_standalone.rb +317 -0
  77. data/lib/candidhealth/service_lines/v_2/types/universal_service_line_update.rb +307 -0
  78. data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite.rb +2 -2
  79. data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite_base.rb +90 -0
  80. data/lib/candidhealth/x_12/v_1/types/type_of_bill_composite_update.rb +112 -0
  81. data/lib/requests.rb +2 -2
  82. data/lib/types_export.rb +44 -4
  83. metadata +43 -2
@@ -30,10 +30,10 @@ module CandidApiClient
30
30
  # @return [String] The ID used to identify this individual in your system. For example, your
31
31
  # internal patient ID or an EHR patient ID.
32
32
  attr_reader :external_id
33
- # @return [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
34
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
33
+ # @return [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
34
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
35
35
  attr_reader :date_of_birth
36
- # @return [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form.
36
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
37
37
  attr_reader :address
38
38
  # @return [String]
39
39
  attr_reader :first_name
@@ -58,9 +58,9 @@ module CandidApiClient
58
58
  # @param non_insurance_payers_info [Array<CandidApiClient::Individual::Types::PatientNonInsurancePayerInfo>]
59
59
  # @param external_id [String] The ID used to identify this individual in your system. For example, your
60
60
  # internal patient ID or an EHR patient ID.
61
- # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
62
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
63
- # @param address [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form.
61
+ # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
62
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
63
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
64
64
  # @param first_name [String]
65
65
  # @param last_name [String]
66
66
  # @param gender [CandidApiClient::Individual::Types::Gender]
@@ -13,10 +13,10 @@ module CandidApiClient
13
13
  # @return [String] The ID used to identify this individual in your system. For example, your
14
14
  # internal patient ID or an EHR patient ID.
15
15
  attr_reader :external_id
16
- # @return [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
17
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
16
+ # @return [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
17
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
18
18
  attr_reader :date_of_birth
19
- # @return [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form.
19
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
20
20
  attr_reader :address
21
21
  # @return [String]
22
22
  attr_reader :first_name
@@ -34,9 +34,9 @@ module CandidApiClient
34
34
 
35
35
  # @param external_id [String] The ID used to identify this individual in your system. For example, your
36
36
  # internal patient ID or an EHR patient ID.
37
- # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
38
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
39
- # @param address [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form.
37
+ # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
38
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
39
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
40
40
  # @param first_name [String]
41
41
  # @param last_name [String]
42
42
  # @param gender [CandidApiClient::Individual::Types::Gender]
@@ -27,10 +27,10 @@ module CandidApiClient
27
27
  # @return [String] The ID used to identify this individual in your system. For example, your
28
28
  # internal patient ID or an EHR patient ID.
29
29
  attr_reader :external_id
30
- # @return [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
31
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
30
+ # @return [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
31
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
32
32
  attr_reader :date_of_birth
33
- # @return [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form.
33
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
34
34
  attr_reader :address
35
35
  # @return [String]
36
36
  attr_reader :first_name
@@ -54,9 +54,9 @@ module CandidApiClient
54
54
  # @param email_consent [Boolean] Defaults to false
55
55
  # @param external_id [String] The ID used to identify this individual in your system. For example, your
56
56
  # internal patient ID or an EHR patient ID.
57
- # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
58
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
59
- # @param address [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form.
57
+ # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
58
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
59
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
60
60
  # @param first_name [String]
61
61
  # @param last_name [String]
62
62
  # @param gender [CandidApiClient::Individual::Types::Gender]
@@ -21,10 +21,10 @@ module CandidApiClient
21
21
  # @return [String] The ID used to identify this individual in your system. For example, your
22
22
  # internal patient ID or an EHR patient ID.
23
23
  attr_reader :external_id
24
- # @return [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
25
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
24
+ # @return [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
25
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
26
26
  attr_reader :date_of_birth
27
- # @return [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form.
27
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
28
28
  attr_reader :address
29
29
  # @return [Array<CandidApiClient::Commons::Types::PhoneNumber>]
30
30
  attr_reader :phone_numbers
@@ -53,9 +53,9 @@ module CandidApiClient
53
53
  # @param gender [CandidApiClient::Individual::Types::Gender]
54
54
  # @param external_id [String] The ID used to identify this individual in your system. For example, your
55
55
  # internal patient ID or an EHR patient ID.
56
- # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
57
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
58
- # @param address [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form.
56
+ # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
57
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
58
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZip] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
59
59
  # @param phone_numbers [Array<CandidApiClient::Commons::Types::PhoneNumber>]
60
60
  # @param phone_consent [Boolean]
61
61
  # @param email [String]
@@ -21,10 +21,10 @@ module CandidApiClient
21
21
  # @return [String] The ID used to identify this individual in your system. For example, your
22
22
  # internal patient ID or an EHR patient ID.
23
23
  attr_reader :external_id
24
- # @return [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
25
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
24
+ # @return [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
25
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
26
26
  attr_reader :date_of_birth
27
- # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional] Box 5 on the CMS-1500 claim form.
27
+ # @return [CandidApiClient::Commons::Types::StreetAddressShortZipOptional] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
28
28
  attr_reader :address
29
29
  # @return [Array<CandidApiClient::Commons::Types::PhoneNumberOptional>]
30
30
  attr_reader :phone_numbers
@@ -53,9 +53,9 @@ module CandidApiClient
53
53
  # @param gender [CandidApiClient::Individual::Types::Gender]
54
54
  # @param external_id [String] The ID used to identify this individual in your system. For example, your
55
55
  # internal patient ID or an EHR patient ID.
56
- # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form. The date format should be in ISO 8601 date;
57
- # formatted YYYY-MM-DD (i.e. 2012-02-01)
58
- # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional] Box 5 on the CMS-1500 claim form.
56
+ # @param date_of_birth [Date] Box 3 on the CMS-1500 claim form or Form Locator 10 on a UB-04 claim form. The
57
+ # date format should be in ISO 8601 date; formatted YYYY-MM-DD (i.e. 2012-02-01)
58
+ # @param address [CandidApiClient::Commons::Types::StreetAddressShortZipOptional] Box 5 on the CMS-1500 claim form or Form Locator 9 on a UB-04 claim form.
59
59
  # @param phone_numbers [Array<CandidApiClient::Commons::Types::PhoneNumberOptional>]
60
60
  # @param phone_consent [Boolean]
61
61
  # @param email [String]
@@ -104,6 +104,8 @@ module CandidApiClient
104
104
  NP_C = "NP-C"
105
105
  PA_C = "PA-C"
106
106
  AMFT = "AMFT"
107
+ CDN = "CDN"
108
+ CNS = "CNS"
107
109
  end
108
110
  end
109
111
  end
@@ -2,28 +2,35 @@
2
2
 
3
3
  require_relative "../../requests"
4
4
  require_relative "v_3/client"
5
+ require_relative "v_4/client"
5
6
 
6
7
  module CandidApiClient
7
8
  module Payers
8
9
  class Client
9
10
  # @return [CandidApiClient::Payers::V3::V3Client]
10
11
  attr_reader :v_3
12
+ # @return [CandidApiClient::Payers::V4::V4Client]
13
+ attr_reader :v_4
11
14
 
12
15
  # @param request_client [CandidApiClient::RequestClient]
13
16
  # @return [CandidApiClient::Payers::Client]
14
17
  def initialize(request_client:)
15
18
  @v_3 = CandidApiClient::Payers::V3::V3Client.new(request_client: request_client)
19
+ @v_4 = CandidApiClient::Payers::V4::V4Client.new(request_client: request_client)
16
20
  end
17
21
  end
18
22
 
19
23
  class AsyncClient
20
24
  # @return [CandidApiClient::Payers::V3::AsyncV3Client]
21
25
  attr_reader :v_3
26
+ # @return [CandidApiClient::Payers::V4::AsyncV4Client]
27
+ attr_reader :v_4
22
28
 
23
29
  # @param request_client [CandidApiClient::AsyncRequestClient]
24
30
  # @return [CandidApiClient::Payers::AsyncClient]
25
31
  def initialize(request_client:)
26
32
  @v_3 = CandidApiClient::Payers::V3::AsyncV3Client.new(request_client: request_client)
33
+ @v_4 = CandidApiClient::Payers::V4::AsyncV4Client.new(request_client: request_client)
27
34
  end
28
35
  end
29
36
  end
@@ -0,0 +1,137 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "types/payer"
5
+ require_relative "types/payer_page"
6
+ require "async"
7
+
8
+ module CandidApiClient
9
+ module Payers
10
+ module V4
11
+ class V4Client
12
+ # @return [CandidApiClient::RequestClient]
13
+ attr_reader :request_client
14
+
15
+ # @param request_client [CandidApiClient::RequestClient]
16
+ # @return [CandidApiClient::Payers::V4::V4Client]
17
+ def initialize(request_client:)
18
+ @request_client = request_client
19
+ end
20
+
21
+ # @param payer_uuid [String]
22
+ # @param request_options [CandidApiClient::RequestOptions]
23
+ # @return [CandidApiClient::Payers::V4::Types::Payer]
24
+ # @example
25
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
26
+ # api.payers.v_4.get(payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
27
+ def get(payer_uuid:, request_options: nil)
28
+ response = @request_client.conn.get do |req|
29
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
30
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
31
+ req.headers = {
32
+ **(req.headers || {}),
33
+ **@request_client.get_headers,
34
+ **(request_options&.additional_headers || {})
35
+ }.compact
36
+ req.url "#{@request_client.get_url(environment: CandidApi,
37
+ request_options: request_options)}/api/payers/v4/#{payer_uuid}"
38
+ end
39
+ CandidApiClient::Payers::V4::Types::Payer.from_json(json_object: response.body)
40
+ end
41
+
42
+ # @param limit [Integer] Maximum number of entities per page, defaults to 100.
43
+ # @param search_term [String]
44
+ # @param page_token [String]
45
+ # @param request_options [CandidApiClient::RequestOptions]
46
+ # @return [CandidApiClient::Payers::V4::Types::PayerPage]
47
+ # @example
48
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
49
+ # api.payers.v_4.get_all
50
+ def get_all(limit: nil, search_term: nil, page_token: nil, request_options: nil)
51
+ response = @request_client.conn.get do |req|
52
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
53
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
54
+ req.headers = {
55
+ **(req.headers || {}),
56
+ **@request_client.get_headers,
57
+ **(request_options&.additional_headers || {})
58
+ }.compact
59
+ req.params = {
60
+ **(request_options&.additional_query_parameters || {}),
61
+ "limit": limit,
62
+ "search_term": search_term,
63
+ "page_token": page_token
64
+ }.compact
65
+ req.url "#{@request_client.get_url(environment: CandidApi, request_options: request_options)}/api/payers/v4"
66
+ end
67
+ CandidApiClient::Payers::V4::Types::PayerPage.from_json(json_object: response.body)
68
+ end
69
+ end
70
+
71
+ class AsyncV4Client
72
+ # @return [CandidApiClient::AsyncRequestClient]
73
+ attr_reader :request_client
74
+
75
+ # @param request_client [CandidApiClient::AsyncRequestClient]
76
+ # @return [CandidApiClient::Payers::V4::AsyncV4Client]
77
+ def initialize(request_client:)
78
+ @request_client = request_client
79
+ end
80
+
81
+ # @param payer_uuid [String]
82
+ # @param request_options [CandidApiClient::RequestOptions]
83
+ # @return [CandidApiClient::Payers::V4::Types::Payer]
84
+ # @example
85
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
86
+ # api.payers.v_4.get(payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
87
+ def get(payer_uuid:, request_options: nil)
88
+ Async do
89
+ response = @request_client.conn.get do |req|
90
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
91
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
92
+ req.headers = {
93
+ **(req.headers || {}),
94
+ **@request_client.get_headers,
95
+ **(request_options&.additional_headers || {})
96
+ }.compact
97
+ req.url "#{@request_client.get_url(environment: CandidApi,
98
+ request_options: request_options)}/api/payers/v4/#{payer_uuid}"
99
+ end
100
+ CandidApiClient::Payers::V4::Types::Payer.from_json(json_object: response.body)
101
+ end
102
+ end
103
+
104
+ # @param limit [Integer] Maximum number of entities per page, defaults to 100.
105
+ # @param search_term [String]
106
+ # @param page_token [String]
107
+ # @param request_options [CandidApiClient::RequestOptions]
108
+ # @return [CandidApiClient::Payers::V4::Types::PayerPage]
109
+ # @example
110
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
111
+ # api.payers.v_4.get_all
112
+ def get_all(limit: nil, search_term: nil, page_token: nil, request_options: nil)
113
+ Async do
114
+ response = @request_client.conn.get do |req|
115
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
116
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
117
+ req.headers = {
118
+ **(req.headers || {}),
119
+ **@request_client.get_headers,
120
+ **(request_options&.additional_headers || {})
121
+ }.compact
122
+ req.params = {
123
+ **(request_options&.additional_query_parameters || {}),
124
+ "limit": limit,
125
+ "search_term": search_term,
126
+ "page_token": page_token
127
+ }.compact
128
+ req.url "#{@request_client.get_url(environment: CandidApi,
129
+ request_options: request_options)}/api/payers/v4"
130
+ end
131
+ CandidApiClient::Payers::V4::Types::PayerPage.from_json(json_object: response.body)
132
+ end
133
+ end
134
+ end
135
+ end
136
+ end
137
+ end
@@ -0,0 +1,93 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "payer_ids"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module Payers
9
+ module V4
10
+ module Types
11
+ class ClearinghousePayerInfo
12
+ # @return [String] The clearinghouse display name of the payer.
13
+ attr_reader :payer_name
14
+ # @return [CandidApiClient::Payers::V4::Types::PayerIds] Payer IDs for professional claims
15
+ attr_reader :professional_payer_ids
16
+ # @return [CandidApiClient::Payers::V4::Types::PayerIds] Payer IDs for institutional claims
17
+ attr_reader :institutional_payer_ids
18
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
19
+ attr_reader :additional_properties
20
+ # @return [Object]
21
+ attr_reader :_field_set
22
+ protected :_field_set
23
+
24
+ OMIT = Object.new
25
+
26
+ # @param payer_name [String] The clearinghouse display name of the payer.
27
+ # @param professional_payer_ids [CandidApiClient::Payers::V4::Types::PayerIds] Payer IDs for professional claims
28
+ # @param institutional_payer_ids [CandidApiClient::Payers::V4::Types::PayerIds] Payer IDs for institutional claims
29
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
30
+ # @return [CandidApiClient::Payers::V4::Types::ClearinghousePayerInfo]
31
+ def initialize(payer_name:, professional_payer_ids:, institutional_payer_ids:, additional_properties: nil)
32
+ @payer_name = payer_name
33
+ @professional_payer_ids = professional_payer_ids
34
+ @institutional_payer_ids = institutional_payer_ids
35
+ @additional_properties = additional_properties
36
+ @_field_set = {
37
+ "payer_name": payer_name,
38
+ "professional_payer_ids": professional_payer_ids,
39
+ "institutional_payer_ids": institutional_payer_ids
40
+ }
41
+ end
42
+
43
+ # Deserialize a JSON object to an instance of ClearinghousePayerInfo
44
+ #
45
+ # @param json_object [String]
46
+ # @return [CandidApiClient::Payers::V4::Types::ClearinghousePayerInfo]
47
+ def self.from_json(json_object:)
48
+ struct = JSON.parse(json_object, object_class: OpenStruct)
49
+ parsed_json = JSON.parse(json_object)
50
+ payer_name = struct["payer_name"]
51
+ if parsed_json["professional_payer_ids"].nil?
52
+ professional_payer_ids = nil
53
+ else
54
+ professional_payer_ids = parsed_json["professional_payer_ids"].to_json
55
+ professional_payer_ids = CandidApiClient::Payers::V4::Types::PayerIds.from_json(json_object: professional_payer_ids)
56
+ end
57
+ if parsed_json["institutional_payer_ids"].nil?
58
+ institutional_payer_ids = nil
59
+ else
60
+ institutional_payer_ids = parsed_json["institutional_payer_ids"].to_json
61
+ institutional_payer_ids = CandidApiClient::Payers::V4::Types::PayerIds.from_json(json_object: institutional_payer_ids)
62
+ end
63
+ new(
64
+ payer_name: payer_name,
65
+ professional_payer_ids: professional_payer_ids,
66
+ institutional_payer_ids: institutional_payer_ids,
67
+ additional_properties: struct
68
+ )
69
+ end
70
+
71
+ # Serialize an instance of ClearinghousePayerInfo to a JSON object
72
+ #
73
+ # @return [String]
74
+ def to_json(*_args)
75
+ @_field_set&.to_json
76
+ end
77
+
78
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
79
+ # hash and check each fields type against the current object's property
80
+ # definitions.
81
+ #
82
+ # @param obj [Object]
83
+ # @return [Void]
84
+ def self.validate_raw(obj:)
85
+ obj.payer_name.is_a?(String) != false || raise("Passed value for field obj.payer_name is not the expected type, validation failed.")
86
+ CandidApiClient::Payers::V4::Types::PayerIds.validate_raw(obj: obj.professional_payer_ids)
87
+ CandidApiClient::Payers::V4::Types::PayerIds.validate_raw(obj: obj.institutional_payer_ids)
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,116 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "payer_ids"
4
+ require_relative "../../../commons/types/street_address_long_zip"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module CandidApiClient
9
+ module Payers
10
+ module V4
11
+ module Types
12
+ class Payer
13
+ # @return [String] Auto-generated ID set on creation.
14
+ attr_reader :payer_uuid
15
+ # @return [CandidApiClient::Payers::V4::Types::PayerIds] The primary national payer IDs of the payer.
16
+ attr_reader :payer_ids
17
+ # @return [String] The primary display name of the payer.
18
+ attr_reader :payer_name
19
+ # @return [Hash{CandidApiClient::Commons::Types::Clearinghouse => CandidApiClient::Payers::V4::Types::ClearinghousePayerInfo}]
20
+ attr_reader :clearinghouse_payer_info
21
+ # @return [CandidApiClient::Commons::Types::StreetAddressLongZip]
22
+ attr_reader :street_address
23
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
24
+ attr_reader :additional_properties
25
+ # @return [Object]
26
+ attr_reader :_field_set
27
+ protected :_field_set
28
+
29
+ OMIT = Object.new
30
+
31
+ # @param payer_uuid [String] Auto-generated ID set on creation.
32
+ # @param payer_ids [CandidApiClient::Payers::V4::Types::PayerIds] The primary national payer IDs of the payer.
33
+ # @param payer_name [String] The primary display name of the payer.
34
+ # @param clearinghouse_payer_info [Hash{CandidApiClient::Commons::Types::Clearinghouse => CandidApiClient::Payers::V4::Types::ClearinghousePayerInfo}]
35
+ # @param street_address [CandidApiClient::Commons::Types::StreetAddressLongZip]
36
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
37
+ # @return [CandidApiClient::Payers::V4::Types::Payer]
38
+ def initialize(payer_uuid:, payer_ids:, payer_name:, clearinghouse_payer_info:, street_address: OMIT,
39
+ additional_properties: nil)
40
+ @payer_uuid = payer_uuid
41
+ @payer_ids = payer_ids
42
+ @payer_name = payer_name
43
+ @clearinghouse_payer_info = clearinghouse_payer_info
44
+ @street_address = street_address if street_address != OMIT
45
+ @additional_properties = additional_properties
46
+ @_field_set = {
47
+ "payer_uuid": payer_uuid,
48
+ "payer_ids": payer_ids,
49
+ "payer_name": payer_name,
50
+ "clearinghouse_payer_info": clearinghouse_payer_info,
51
+ "street_address": street_address
52
+ }.reject do |_k, v|
53
+ v == OMIT
54
+ end
55
+ end
56
+
57
+ # Deserialize a JSON object to an instance of Payer
58
+ #
59
+ # @param json_object [String]
60
+ # @return [CandidApiClient::Payers::V4::Types::Payer]
61
+ def self.from_json(json_object:)
62
+ struct = JSON.parse(json_object, object_class: OpenStruct)
63
+ parsed_json = JSON.parse(json_object)
64
+ payer_uuid = struct["payer_uuid"]
65
+ if parsed_json["payer_ids"].nil?
66
+ payer_ids = nil
67
+ else
68
+ payer_ids = parsed_json["payer_ids"].to_json
69
+ payer_ids = CandidApiClient::Payers::V4::Types::PayerIds.from_json(json_object: payer_ids)
70
+ end
71
+ payer_name = struct["payer_name"]
72
+ clearinghouse_payer_info = parsed_json["clearinghouse_payer_info"]&.transform_values do |value|
73
+ value = value.to_json
74
+ CandidApiClient::Payers::V4::Types::ClearinghousePayerInfo.from_json(json_object: value)
75
+ end
76
+ if parsed_json["street_address"].nil?
77
+ street_address = nil
78
+ else
79
+ street_address = parsed_json["street_address"].to_json
80
+ street_address = CandidApiClient::Commons::Types::StreetAddressLongZip.from_json(json_object: street_address)
81
+ end
82
+ new(
83
+ payer_uuid: payer_uuid,
84
+ payer_ids: payer_ids,
85
+ payer_name: payer_name,
86
+ clearinghouse_payer_info: clearinghouse_payer_info,
87
+ street_address: street_address,
88
+ additional_properties: struct
89
+ )
90
+ end
91
+
92
+ # Serialize an instance of Payer to a JSON object
93
+ #
94
+ # @return [String]
95
+ def to_json(*_args)
96
+ @_field_set&.to_json
97
+ end
98
+
99
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
100
+ # hash and check each fields type against the current object's property
101
+ # definitions.
102
+ #
103
+ # @param obj [Object]
104
+ # @return [Void]
105
+ def self.validate_raw(obj:)
106
+ obj.payer_uuid.is_a?(String) != false || raise("Passed value for field obj.payer_uuid is not the expected type, validation failed.")
107
+ CandidApiClient::Payers::V4::Types::PayerIds.validate_raw(obj: obj.payer_ids)
108
+ obj.payer_name.is_a?(String) != false || raise("Passed value for field obj.payer_name is not the expected type, validation failed.")
109
+ obj.clearinghouse_payer_info.is_a?(Hash) != false || raise("Passed value for field obj.clearinghouse_payer_info is not the expected type, validation failed.")
110
+ obj.street_address.nil? || CandidApiClient::Commons::Types::StreetAddressLongZip.validate_raw(obj: obj.street_address)
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "support_state"
4
+ require "ostruct"
5
+ require "json"
6
+
7
+ module CandidApiClient
8
+ module Payers
9
+ module V4
10
+ module Types
11
+ class PayerIds
12
+ # @return [String] The payer ID for claim submission
13
+ attr_reader :claims_payer_id
14
+ # @return [String] The payer ID for eligibility
15
+ attr_reader :eligibility_payer_id
16
+ # @return [String] The payer ID for remittance
17
+ attr_reader :remittance_payer_id
18
+ # @return [CandidApiClient::Payers::V4::Types::SupportState] The support state for claims submission
19
+ attr_reader :claims_support
20
+ # @return [CandidApiClient::Payers::V4::Types::SupportState] The support state for eligibility
21
+ attr_reader :eligibility_support
22
+ # @return [CandidApiClient::Payers::V4::Types::SupportState] The support state for remittance
23
+ attr_reader :remittance_support
24
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
25
+ attr_reader :additional_properties
26
+ # @return [Object]
27
+ attr_reader :_field_set
28
+ protected :_field_set
29
+
30
+ OMIT = Object.new
31
+
32
+ # @param claims_payer_id [String] The payer ID for claim submission
33
+ # @param eligibility_payer_id [String] The payer ID for eligibility
34
+ # @param remittance_payer_id [String] The payer ID for remittance
35
+ # @param claims_support [CandidApiClient::Payers::V4::Types::SupportState] The support state for claims submission
36
+ # @param eligibility_support [CandidApiClient::Payers::V4::Types::SupportState] The support state for eligibility
37
+ # @param remittance_support [CandidApiClient::Payers::V4::Types::SupportState] The support state for remittance
38
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
39
+ # @return [CandidApiClient::Payers::V4::Types::PayerIds]
40
+ def initialize(claims_payer_id:, eligibility_payer_id:, remittance_payer_id:, claims_support:,
41
+ eligibility_support:, remittance_support:, additional_properties: nil)
42
+ @claims_payer_id = claims_payer_id
43
+ @eligibility_payer_id = eligibility_payer_id
44
+ @remittance_payer_id = remittance_payer_id
45
+ @claims_support = claims_support
46
+ @eligibility_support = eligibility_support
47
+ @remittance_support = remittance_support
48
+ @additional_properties = additional_properties
49
+ @_field_set = {
50
+ "claims_payer_id": claims_payer_id,
51
+ "eligibility_payer_id": eligibility_payer_id,
52
+ "remittance_payer_id": remittance_payer_id,
53
+ "claims_support": claims_support,
54
+ "eligibility_support": eligibility_support,
55
+ "remittance_support": remittance_support
56
+ }
57
+ end
58
+
59
+ # Deserialize a JSON object to an instance of PayerIds
60
+ #
61
+ # @param json_object [String]
62
+ # @return [CandidApiClient::Payers::V4::Types::PayerIds]
63
+ def self.from_json(json_object:)
64
+ struct = JSON.parse(json_object, object_class: OpenStruct)
65
+ claims_payer_id = struct["claims_payer_id"]
66
+ eligibility_payer_id = struct["eligibility_payer_id"]
67
+ remittance_payer_id = struct["remittance_payer_id"]
68
+ claims_support = struct["claims_support"]
69
+ eligibility_support = struct["eligibility_support"]
70
+ remittance_support = struct["remittance_support"]
71
+ new(
72
+ claims_payer_id: claims_payer_id,
73
+ eligibility_payer_id: eligibility_payer_id,
74
+ remittance_payer_id: remittance_payer_id,
75
+ claims_support: claims_support,
76
+ eligibility_support: eligibility_support,
77
+ remittance_support: remittance_support,
78
+ additional_properties: struct
79
+ )
80
+ end
81
+
82
+ # Serialize an instance of PayerIds to a JSON object
83
+ #
84
+ # @return [String]
85
+ def to_json(*_args)
86
+ @_field_set&.to_json
87
+ end
88
+
89
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
90
+ # hash and check each fields type against the current object's property
91
+ # definitions.
92
+ #
93
+ # @param obj [Object]
94
+ # @return [Void]
95
+ def self.validate_raw(obj:)
96
+ obj.claims_payer_id.is_a?(String) != false || raise("Passed value for field obj.claims_payer_id is not the expected type, validation failed.")
97
+ obj.eligibility_payer_id.is_a?(String) != false || raise("Passed value for field obj.eligibility_payer_id is not the expected type, validation failed.")
98
+ obj.remittance_payer_id.is_a?(String) != false || raise("Passed value for field obj.remittance_payer_id is not the expected type, validation failed.")
99
+ obj.claims_support.is_a?(CandidApiClient::Payers::V4::Types::SupportState) != false || raise("Passed value for field obj.claims_support is not the expected type, validation failed.")
100
+ obj.eligibility_support.is_a?(CandidApiClient::Payers::V4::Types::SupportState) != false || raise("Passed value for field obj.eligibility_support is not the expected type, validation failed.")
101
+ obj.remittance_support.is_a?(CandidApiClient::Payers::V4::Types::SupportState) != false || raise("Passed value for field obj.remittance_support is not the expected type, validation failed.")
102
+ end
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end