candidhealth 0.29.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/encounters/v_4/client.rb +6 -0
  3. data/lib/candidhealth/encounters/v_4/types/vitals.rb +18 -2
  4. data/lib/candidhealth/non_insurance_payer_payments/client.rb +30 -0
  5. data/lib/candidhealth/non_insurance_payer_payments/v_1/client.rb +360 -0
  6. data/lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment.rb +138 -0
  7. data/lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_create.rb +124 -0
  8. data/lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payment_sort_field.rb +14 -0
  9. data/lib/candidhealth/non_insurance_payer_payments/v_1/types/non_insurance_payer_payments_page.rb +88 -0
  10. data/lib/candidhealth/non_insurance_payer_refunds/client.rb +30 -0
  11. data/lib/candidhealth/non_insurance_payer_refunds/v_1/client.rb +385 -0
  12. data/lib/candidhealth/non_insurance_payer_refunds/v_1/types/non_insurance_payer_refund.rb +139 -0
  13. data/lib/candidhealth/non_insurance_payer_refunds/v_1/types/non_insurance_payer_refund_create.rb +125 -0
  14. data/lib/candidhealth/non_insurance_payer_refunds/v_1/types/non_insurance_payer_refund_sort_field.rb +14 -0
  15. data/lib/candidhealth/non_insurance_payer_refunds/v_1/types/non_insurance_payer_refunds_page.rb +88 -0
  16. data/lib/candidhealth/non_insurance_payers/client.rb +30 -0
  17. data/lib/candidhealth/non_insurance_payers/v_1/client.rb +375 -0
  18. data/lib/candidhealth/non_insurance_payers/v_1/types/create_non_insurance_payer_request.rb +79 -0
  19. data/lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer.rb +100 -0
  20. data/lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_category_update.rb +97 -0
  21. data/lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_description_update.rb +97 -0
  22. data/lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_page.rb +88 -0
  23. data/lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_sort_field.rb +16 -0
  24. data/lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb +92 -0
  25. data/lib/candidhealth/non_insurance_payers/v_1/types/toggle_non_insurance_payer_enablement_request.rb +62 -0
  26. data/lib/candidhealth/service_lines/v_2/types/drug_identification.rb +10 -2
  27. data/lib/candidhealth.rb +21 -0
  28. data/lib/requests.rb +2 -2
  29. data/lib/types_export.rb +16 -0
  30. metadata +24 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e1976217c4d411194aa386a07af2c695c3331d42db1271de42bf0924a2621c5
4
- data.tar.gz: 78b2f8ef9cde9340e9a817d4f514d0f635a3bad608bd47b6153fc8c11a564ab7
3
+ metadata.gz: 7dc3837b0ca573016c14778b36c302ea879990bcdca8e98c50c240c3702d6a6d
4
+ data.tar.gz: 3c02048cb7203e632e1533d820827231784112d2f018950f473c5b015a5603a6
5
5
  SHA512:
6
- metadata.gz: 490000beb5c1830a75118814f1f530939d641e7cafc7613a31b98bac5d1bc4f995c513f457b2ba8e35bfe7aeb09146d16fc18e9dd6790c616892fce56b0545dd
7
- data.tar.gz: a7eb60aaf0f7f135dc8812237c9d8f45bbe35581d0611708a75d509f4887ff6f1f3b792beb68e2bc5ca0c625defa6800390fdebd109a3ada68f77b52c6274780
6
+ metadata.gz: 8c729973b43b11320ee00757d9bd2083d48d46da81f2655822c661b4f44aba2272671a7ac3f9d8d13f758952da625698f0f523e512bc7a3a09aac1b979bb7f02
7
+ data.tar.gz: d9d9c8b36d05ac029b0656b6f782b59da026a1af706433e1a061bd04d9bb6c965acb262e779fbd2d4ffeff3426d851fa5af87e6d3ac58094afdef90722c8ef32
@@ -174,6 +174,8 @@ module CandidApiClient
174
174
  # * :blood_pressure_systolic_mmhg (Integer)
175
175
  # * :blood_pressure_diastolic_mmhg (Integer)
176
176
  # * :body_temperature_f (Float)
177
+ # * :hemoglobin_gdl (Float)
178
+ # * :hematocrit_pct (Float)
177
179
  # @param interventions [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Intervention>, as a Hash
178
180
  # * :name (String)
179
181
  # * :category (CandidApiClient::Encounters::V4::Types::InterventionCategory)
@@ -472,6 +474,7 @@ module CandidApiClient
472
474
  # * :measurement_unit_code (CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode)
473
475
  # * :link_sequence_number (String)
474
476
  # * :pharmacy_prescription_number (String)
477
+ # * :conversion_formula (String)
475
478
  # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
476
479
  # * :description (String)
477
480
  # * :date_of_service (Date)
@@ -1021,6 +1024,8 @@ module CandidApiClient
1021
1024
  # * :blood_pressure_systolic_mmhg (Integer)
1022
1025
  # * :blood_pressure_diastolic_mmhg (Integer)
1023
1026
  # * :body_temperature_f (Float)
1027
+ # * :hemoglobin_gdl (Float)
1028
+ # * :hematocrit_pct (Float)
1024
1029
  # @param interventions [Array<Hash>] Request of type Array<CandidApiClient::Encounters::V4::Types::Intervention>, as a Hash
1025
1030
  # * :name (String)
1026
1031
  # * :category (CandidApiClient::Encounters::V4::Types::InterventionCategory)
@@ -1319,6 +1324,7 @@ module CandidApiClient
1319
1324
  # * :measurement_unit_code (CandidApiClient::ServiceLines::V2::Types::MeasurementUnitCode)
1320
1325
  # * :link_sequence_number (String)
1321
1326
  # * :pharmacy_prescription_number (String)
1327
+ # * :conversion_formula (String)
1322
1328
  # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
1323
1329
  # * :description (String)
1324
1330
  # * :date_of_service (Date)
@@ -18,6 +18,10 @@ module CandidApiClient
18
18
  attr_reader :blood_pressure_diastolic_mmhg
19
19
  # @return [Float]
20
20
  attr_reader :body_temperature_f
21
+ # @return [Float]
22
+ attr_reader :hemoglobin_gdl
23
+ # @return [Float]
24
+ attr_reader :hematocrit_pct
21
25
  # @return [OpenStruct] Additional properties unmapped to the current class definition
22
26
  attr_reader :additional_properties
23
27
  # @return [Object]
@@ -31,22 +35,28 @@ module CandidApiClient
31
35
  # @param blood_pressure_systolic_mmhg [Integer]
32
36
  # @param blood_pressure_diastolic_mmhg [Integer]
33
37
  # @param body_temperature_f [Float]
38
+ # @param hemoglobin_gdl [Float]
39
+ # @param hematocrit_pct [Float]
34
40
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
35
41
  # @return [CandidApiClient::Encounters::V4::Types::Vitals]
36
42
  def initialize(height_in: OMIT, weight_lbs: OMIT, blood_pressure_systolic_mmhg: OMIT,
37
- blood_pressure_diastolic_mmhg: OMIT, body_temperature_f: OMIT, additional_properties: nil)
43
+ blood_pressure_diastolic_mmhg: OMIT, body_temperature_f: OMIT, hemoglobin_gdl: OMIT, hematocrit_pct: OMIT, additional_properties: nil)
38
44
  @height_in = height_in if height_in != OMIT
39
45
  @weight_lbs = weight_lbs if weight_lbs != OMIT
40
46
  @blood_pressure_systolic_mmhg = blood_pressure_systolic_mmhg if blood_pressure_systolic_mmhg != OMIT
41
47
  @blood_pressure_diastolic_mmhg = blood_pressure_diastolic_mmhg if blood_pressure_diastolic_mmhg != OMIT
42
48
  @body_temperature_f = body_temperature_f if body_temperature_f != OMIT
49
+ @hemoglobin_gdl = hemoglobin_gdl if hemoglobin_gdl != OMIT
50
+ @hematocrit_pct = hematocrit_pct if hematocrit_pct != OMIT
43
51
  @additional_properties = additional_properties
44
52
  @_field_set = {
45
53
  "height_in": height_in,
46
54
  "weight_lbs": weight_lbs,
47
55
  "blood_pressure_systolic_mmhg": blood_pressure_systolic_mmhg,
48
56
  "blood_pressure_diastolic_mmhg": blood_pressure_diastolic_mmhg,
49
- "body_temperature_f": body_temperature_f
57
+ "body_temperature_f": body_temperature_f,
58
+ "hemoglobin_gdl": hemoglobin_gdl,
59
+ "hematocrit_pct": hematocrit_pct
50
60
  }.reject do |_k, v|
51
61
  v == OMIT
52
62
  end
@@ -63,12 +73,16 @@ module CandidApiClient
63
73
  blood_pressure_systolic_mmhg = struct["blood_pressure_systolic_mmhg"]
64
74
  blood_pressure_diastolic_mmhg = struct["blood_pressure_diastolic_mmhg"]
65
75
  body_temperature_f = struct["body_temperature_f"]
76
+ hemoglobin_gdl = struct["hemoglobin_gdl"]
77
+ hematocrit_pct = struct["hematocrit_pct"]
66
78
  new(
67
79
  height_in: height_in,
68
80
  weight_lbs: weight_lbs,
69
81
  blood_pressure_systolic_mmhg: blood_pressure_systolic_mmhg,
70
82
  blood_pressure_diastolic_mmhg: blood_pressure_diastolic_mmhg,
71
83
  body_temperature_f: body_temperature_f,
84
+ hemoglobin_gdl: hemoglobin_gdl,
85
+ hematocrit_pct: hematocrit_pct,
72
86
  additional_properties: struct
73
87
  )
74
88
  end
@@ -92,6 +106,8 @@ module CandidApiClient
92
106
  obj.blood_pressure_systolic_mmhg&.is_a?(Integer) != false || raise("Passed value for field obj.blood_pressure_systolic_mmhg is not the expected type, validation failed.")
93
107
  obj.blood_pressure_diastolic_mmhg&.is_a?(Integer) != false || raise("Passed value for field obj.blood_pressure_diastolic_mmhg is not the expected type, validation failed.")
94
108
  obj.body_temperature_f&.is_a?(Float) != false || raise("Passed value for field obj.body_temperature_f is not the expected type, validation failed.")
109
+ obj.hemoglobin_gdl&.is_a?(Float) != false || raise("Passed value for field obj.hemoglobin_gdl is not the expected type, validation failed.")
110
+ obj.hematocrit_pct&.is_a?(Float) != false || raise("Passed value for field obj.hematocrit_pct is not the expected type, validation failed.")
95
111
  end
96
112
  end
97
113
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../requests"
4
+ require_relative "v_1/client"
5
+
6
+ module CandidApiClient
7
+ module NonInsurancePayerPayments
8
+ class Client
9
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::V1Client]
10
+ attr_reader :v_1
11
+
12
+ # @param request_client [CandidApiClient::RequestClient]
13
+ # @return [CandidApiClient::NonInsurancePayerPayments::Client]
14
+ def initialize(request_client:)
15
+ @v_1 = CandidApiClient::NonInsurancePayerPayments::V1::V1Client.new(request_client: request_client)
16
+ end
17
+ end
18
+
19
+ class AsyncClient
20
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::AsyncV1Client]
21
+ attr_reader :v_1
22
+
23
+ # @param request_client [CandidApiClient::AsyncRequestClient]
24
+ # @return [CandidApiClient::NonInsurancePayerPayments::AsyncClient]
25
+ def initialize(request_client:)
26
+ @v_1 = CandidApiClient::NonInsurancePayerPayments::V1::AsyncV1Client.new(request_client: request_client)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,360 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "types/non_insurance_payer_payment_sort_field"
5
+ require_relative "../../commons/types/sort_direction"
6
+ require_relative "types/non_insurance_payer_payments_page"
7
+ require_relative "types/non_insurance_payer_payment"
8
+ require_relative "types/non_insurance_payer_payment_create"
9
+ require "date"
10
+ require_relative "../../financials/types/note_update"
11
+ require_relative "../../financials/types/invoice_update"
12
+ require "async"
13
+
14
+ module CandidApiClient
15
+ module NonInsurancePayerPayments
16
+ module V1
17
+ class V1Client
18
+ # @return [CandidApiClient::RequestClient]
19
+ attr_reader :request_client
20
+
21
+ # @param request_client [CandidApiClient::RequestClient]
22
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::V1Client]
23
+ def initialize(request_client:)
24
+ @request_client = request_client
25
+ end
26
+
27
+ # Returns all non-insurance payer payments
28
+ #
29
+ # @param limit [Integer] Defaults to 100. The value must be greater than 0 and less than 1000.
30
+ # @param non_insurance_payer_id [String]
31
+ # @param check_number [String]
32
+ # @param invoice_id [String]
33
+ # @param sort [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentSortField] Defaults to refund_timestamp
34
+ # @param sort_direction [CandidApiClient::Commons::Types::SortDirection] Sort direction. Defaults to descending order if not provided.
35
+ # @param page_token [String]
36
+ # @param request_options [CandidApiClient::RequestOptions]
37
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentsPage]
38
+ # @example
39
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
40
+ # api.non_insurance_payer_payments.v_1.get_multi(
41
+ # limit: 1,
42
+ # non_insurance_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
43
+ # check_number: "string",
44
+ # invoice_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
45
+ # sort: AMOUNT_CENTS,
46
+ # sort_direction: ASC,
47
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
48
+ # )
49
+ def get_multi(limit: nil, non_insurance_payer_id: nil, check_number: nil, invoice_id: nil, sort: nil,
50
+ sort_direction: 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
+ "non_insurance_payer_id": non_insurance_payer_id,
63
+ "check_number": check_number,
64
+ "invoice_id": invoice_id,
65
+ "sort": sort,
66
+ "sort_direction": sort_direction,
67
+ "page_token": page_token
68
+ }.compact
69
+ req.url "#{@request_client.get_url(environment: CandidApi,
70
+ request_options: request_options)}/api/non-insurance-payer-payments/v1"
71
+ end
72
+ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentsPage.from_json(json_object: response.body)
73
+ end
74
+
75
+ # Retrieves a previously created non-insurance payer payment by its
76
+ # `non_insurance_payer_payment_id`.
77
+ #
78
+ # @param non_insurance_payer_payment_id [String]
79
+ # @param request_options [CandidApiClient::RequestOptions]
80
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment]
81
+ # @example
82
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
83
+ # api.non_insurance_payer_payments.v_1.get(non_insurance_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
84
+ def get(non_insurance_payer_payment_id:, request_options: nil)
85
+ response = @request_client.conn.get do |req|
86
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
87
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
88
+ req.headers = {
89
+ **(req.headers || {}),
90
+ **@request_client.get_headers,
91
+ **(request_options&.additional_headers || {})
92
+ }.compact
93
+ req.url "#{@request_client.get_url(environment: CandidApi,
94
+ request_options: request_options)}/api/non-insurance-payer-payments/v1/#{non_insurance_payer_payment_id}"
95
+ end
96
+ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.from_json(json_object: response.body)
97
+ end
98
+
99
+ # @param request [Hash] Request of type CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate, as a Hash
100
+ # * :non_insurance_payer_id (String)
101
+ # * :amount_cents (Integer)
102
+ # * :payment_timestamp (DateTime)
103
+ # * :payment_note (String)
104
+ # * :check_number (String)
105
+ # * :allocations (Array<CandidApiClient::Financials::Types::AllocationCreate>)
106
+ # * :invoice_id (String)
107
+ # @param request_options [CandidApiClient::RequestOptions]
108
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment]
109
+ # @example
110
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
111
+ # api.non_insurance_payer_payments.v_1.create(request: { non_insurance_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", amount_cents: 1, payment_timestamp: DateTime.parse(2024-01-15T09:30:00.000Z), payment_note: "string", check_number: "string", allocations: [{ }], invoice_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32" })
112
+ def create(request:, request_options: nil)
113
+ response = @request_client.conn.post do |req|
114
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
115
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
116
+ req.headers = {
117
+ **(req.headers || {}),
118
+ **@request_client.get_headers,
119
+ **(request_options&.additional_headers || {})
120
+ }.compact
121
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
122
+ req.url "#{@request_client.get_url(environment: CandidApi,
123
+ request_options: request_options)}/api/non-insurance-payer-payments/v1"
124
+ end
125
+ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.from_json(json_object: response.body)
126
+ end
127
+
128
+ # @param non_insurance_payer_payment_id [String]
129
+ # @param payment_timestamp [DateTime]
130
+ # @param payment_note [CandidApiClient::Financials::Types::NoteUpdate]
131
+ # @param invoice_id [CandidApiClient::Financials::Types::InvoiceUpdate]
132
+ # @param request_options [CandidApiClient::RequestOptions]
133
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment]
134
+ # @example
135
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
136
+ # api.non_insurance_payer_payments.v_1.update(non_insurance_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", payment_timestamp: DateTime.parse(2024-01-15T09:30:00.000Z))
137
+ def update(non_insurance_payer_payment_id:, payment_timestamp: nil, payment_note: nil, invoice_id: nil,
138
+ request_options: nil)
139
+ response = @request_client.conn.patch do |req|
140
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
141
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
142
+ req.headers = {
143
+ **(req.headers || {}),
144
+ **@request_client.get_headers,
145
+ **(request_options&.additional_headers || {})
146
+ }.compact
147
+ req.body = {
148
+ **(request_options&.additional_body_parameters || {}),
149
+ payment_timestamp: payment_timestamp,
150
+ payment_note: payment_note,
151
+ invoice_id: invoice_id
152
+ }.compact
153
+ req.url "#{@request_client.get_url(environment: CandidApi,
154
+ request_options: request_options)}/api/non-insurance-payer-payments/v1/#{non_insurance_payer_payment_id}"
155
+ end
156
+ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.from_json(json_object: response.body)
157
+ end
158
+
159
+ # Deletes the non-insurance payer payment record matching the provided
160
+ # `non_insurance_payer_payment_id`.
161
+ #
162
+ # @param non_insurance_payer_payment_id [String]
163
+ # @param request_options [CandidApiClient::RequestOptions]
164
+ # @return [Void]
165
+ # @example
166
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
167
+ # api.non_insurance_payer_payments.v_1.delete(non_insurance_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
168
+ def delete(non_insurance_payer_payment_id:, request_options: nil)
169
+ @request_client.conn.delete do |req|
170
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
171
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
172
+ req.headers = {
173
+ **(req.headers || {}),
174
+ **@request_client.get_headers,
175
+ **(request_options&.additional_headers || {})
176
+ }.compact
177
+ req.url "#{@request_client.get_url(environment: CandidApi,
178
+ request_options: request_options)}/api/non-insurance-payer-payments/v1/#{non_insurance_payer_payment_id}"
179
+ end
180
+ end
181
+ end
182
+
183
+ class AsyncV1Client
184
+ # @return [CandidApiClient::AsyncRequestClient]
185
+ attr_reader :request_client
186
+
187
+ # @param request_client [CandidApiClient::AsyncRequestClient]
188
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::AsyncV1Client]
189
+ def initialize(request_client:)
190
+ @request_client = request_client
191
+ end
192
+
193
+ # Returns all non-insurance payer payments
194
+ #
195
+ # @param limit [Integer] Defaults to 100. The value must be greater than 0 and less than 1000.
196
+ # @param non_insurance_payer_id [String]
197
+ # @param check_number [String]
198
+ # @param invoice_id [String]
199
+ # @param sort [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentSortField] Defaults to refund_timestamp
200
+ # @param sort_direction [CandidApiClient::Commons::Types::SortDirection] Sort direction. Defaults to descending order if not provided.
201
+ # @param page_token [String]
202
+ # @param request_options [CandidApiClient::RequestOptions]
203
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentsPage]
204
+ # @example
205
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
206
+ # api.non_insurance_payer_payments.v_1.get_multi(
207
+ # limit: 1,
208
+ # non_insurance_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
209
+ # check_number: "string",
210
+ # invoice_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
211
+ # sort: AMOUNT_CENTS,
212
+ # sort_direction: ASC,
213
+ # page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9"
214
+ # )
215
+ def get_multi(limit: nil, non_insurance_payer_id: nil, check_number: nil, invoice_id: nil, sort: nil,
216
+ sort_direction: nil, page_token: nil, request_options: nil)
217
+ Async do
218
+ response = @request_client.conn.get do |req|
219
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
220
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
221
+ req.headers = {
222
+ **(req.headers || {}),
223
+ **@request_client.get_headers,
224
+ **(request_options&.additional_headers || {})
225
+ }.compact
226
+ req.params = {
227
+ **(request_options&.additional_query_parameters || {}),
228
+ "limit": limit,
229
+ "non_insurance_payer_id": non_insurance_payer_id,
230
+ "check_number": check_number,
231
+ "invoice_id": invoice_id,
232
+ "sort": sort,
233
+ "sort_direction": sort_direction,
234
+ "page_token": page_token
235
+ }.compact
236
+ req.url "#{@request_client.get_url(environment: CandidApi,
237
+ request_options: request_options)}/api/non-insurance-payer-payments/v1"
238
+ end
239
+ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentsPage.from_json(json_object: response.body)
240
+ end
241
+ end
242
+
243
+ # Retrieves a previously created non-insurance payer payment by its
244
+ # `non_insurance_payer_payment_id`.
245
+ #
246
+ # @param non_insurance_payer_payment_id [String]
247
+ # @param request_options [CandidApiClient::RequestOptions]
248
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment]
249
+ # @example
250
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
251
+ # api.non_insurance_payer_payments.v_1.get(non_insurance_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
252
+ def get(non_insurance_payer_payment_id:, request_options: nil)
253
+ Async do
254
+ response = @request_client.conn.get do |req|
255
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
256
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
257
+ req.headers = {
258
+ **(req.headers || {}),
259
+ **@request_client.get_headers,
260
+ **(request_options&.additional_headers || {})
261
+ }.compact
262
+ req.url "#{@request_client.get_url(environment: CandidApi,
263
+ request_options: request_options)}/api/non-insurance-payer-payments/v1/#{non_insurance_payer_payment_id}"
264
+ end
265
+ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.from_json(json_object: response.body)
266
+ end
267
+ end
268
+
269
+ # @param request [Hash] Request of type CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPaymentCreate, as a Hash
270
+ # * :non_insurance_payer_id (String)
271
+ # * :amount_cents (Integer)
272
+ # * :payment_timestamp (DateTime)
273
+ # * :payment_note (String)
274
+ # * :check_number (String)
275
+ # * :allocations (Array<CandidApiClient::Financials::Types::AllocationCreate>)
276
+ # * :invoice_id (String)
277
+ # @param request_options [CandidApiClient::RequestOptions]
278
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment]
279
+ # @example
280
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
281
+ # api.non_insurance_payer_payments.v_1.create(request: { non_insurance_payer_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", amount_cents: 1, payment_timestamp: DateTime.parse(2024-01-15T09:30:00.000Z), payment_note: "string", check_number: "string", allocations: [{ }], invoice_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32" })
282
+ def create(request:, request_options: nil)
283
+ Async do
284
+ response = @request_client.conn.post do |req|
285
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
286
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
287
+ req.headers = {
288
+ **(req.headers || {}),
289
+ **@request_client.get_headers,
290
+ **(request_options&.additional_headers || {})
291
+ }.compact
292
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
293
+ req.url "#{@request_client.get_url(environment: CandidApi,
294
+ request_options: request_options)}/api/non-insurance-payer-payments/v1"
295
+ end
296
+ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.from_json(json_object: response.body)
297
+ end
298
+ end
299
+
300
+ # @param non_insurance_payer_payment_id [String]
301
+ # @param payment_timestamp [DateTime]
302
+ # @param payment_note [CandidApiClient::Financials::Types::NoteUpdate]
303
+ # @param invoice_id [CandidApiClient::Financials::Types::InvoiceUpdate]
304
+ # @param request_options [CandidApiClient::RequestOptions]
305
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment]
306
+ # @example
307
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
308
+ # api.non_insurance_payer_payments.v_1.update(non_insurance_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", payment_timestamp: DateTime.parse(2024-01-15T09:30:00.000Z))
309
+ def update(non_insurance_payer_payment_id:, payment_timestamp: nil, payment_note: nil, invoice_id: nil,
310
+ request_options: nil)
311
+ Async do
312
+ response = @request_client.conn.patch do |req|
313
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
314
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
315
+ req.headers = {
316
+ **(req.headers || {}),
317
+ **@request_client.get_headers,
318
+ **(request_options&.additional_headers || {})
319
+ }.compact
320
+ req.body = {
321
+ **(request_options&.additional_body_parameters || {}),
322
+ payment_timestamp: payment_timestamp,
323
+ payment_note: payment_note,
324
+ invoice_id: invoice_id
325
+ }.compact
326
+ req.url "#{@request_client.get_url(environment: CandidApi,
327
+ request_options: request_options)}/api/non-insurance-payer-payments/v1/#{non_insurance_payer_payment_id}"
328
+ end
329
+ CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment.from_json(json_object: response.body)
330
+ end
331
+ end
332
+
333
+ # Deletes the non-insurance payer payment record matching the provided
334
+ # `non_insurance_payer_payment_id`.
335
+ #
336
+ # @param non_insurance_payer_payment_id [String]
337
+ # @param request_options [CandidApiClient::RequestOptions]
338
+ # @return [Void]
339
+ # @example
340
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
341
+ # api.non_insurance_payer_payments.v_1.delete(non_insurance_payer_payment_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
342
+ def delete(non_insurance_payer_payment_id:, request_options: nil)
343
+ Async do
344
+ @request_client.conn.delete do |req|
345
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
346
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
347
+ req.headers = {
348
+ **(req.headers || {}),
349
+ **@request_client.get_headers,
350
+ **(request_options&.additional_headers || {})
351
+ }.compact
352
+ req.url "#{@request_client.get_url(environment: CandidApi,
353
+ request_options: request_options)}/api/non-insurance-payer-payments/v1/#{non_insurance_payer_payment_id}"
354
+ end
355
+ end
356
+ end
357
+ end
358
+ end
359
+ end
360
+ end
@@ -0,0 +1,138 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../non_insurance_payers/v_1/types/non_insurance_payer"
4
+ require "date"
5
+ require_relative "../../../financials/types/allocation"
6
+ require "ostruct"
7
+ require "json"
8
+
9
+ module CandidApiClient
10
+ module NonInsurancePayerPayments
11
+ module V1
12
+ module Types
13
+ class NonInsurancePayerPayment
14
+ # @return [String]
15
+ attr_reader :non_insurance_payer_payment_id
16
+ # @return [CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer]
17
+ attr_reader :non_insurance_payer
18
+ # @return [Integer]
19
+ attr_reader :amount_cents
20
+ # @return [String]
21
+ attr_reader :check_number
22
+ # @return [DateTime]
23
+ attr_reader :payment_timestamp
24
+ # @return [String]
25
+ attr_reader :payment_note
26
+ # @return [Array<CandidApiClient::Financials::Types::Allocation>]
27
+ attr_reader :allocations
28
+ # @return [String]
29
+ attr_reader :invoice_id
30
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
31
+ attr_reader :additional_properties
32
+ # @return [Object]
33
+ attr_reader :_field_set
34
+ protected :_field_set
35
+
36
+ OMIT = Object.new
37
+
38
+ # @param non_insurance_payer_payment_id [String]
39
+ # @param non_insurance_payer [CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer]
40
+ # @param amount_cents [Integer]
41
+ # @param check_number [String]
42
+ # @param payment_timestamp [DateTime]
43
+ # @param payment_note [String]
44
+ # @param allocations [Array<CandidApiClient::Financials::Types::Allocation>]
45
+ # @param invoice_id [String]
46
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
47
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment]
48
+ def initialize(non_insurance_payer_payment_id:, non_insurance_payer:, amount_cents:, allocations:, check_number: OMIT,
49
+ payment_timestamp: OMIT, payment_note: OMIT, invoice_id: OMIT, additional_properties: nil)
50
+ @non_insurance_payer_payment_id = non_insurance_payer_payment_id
51
+ @non_insurance_payer = non_insurance_payer
52
+ @amount_cents = amount_cents
53
+ @check_number = check_number if check_number != OMIT
54
+ @payment_timestamp = payment_timestamp if payment_timestamp != OMIT
55
+ @payment_note = payment_note if payment_note != OMIT
56
+ @allocations = allocations
57
+ @invoice_id = invoice_id if invoice_id != OMIT
58
+ @additional_properties = additional_properties
59
+ @_field_set = {
60
+ "non_insurance_payer_payment_id": non_insurance_payer_payment_id,
61
+ "non_insurance_payer": non_insurance_payer,
62
+ "amount_cents": amount_cents,
63
+ "check_number": check_number,
64
+ "payment_timestamp": payment_timestamp,
65
+ "payment_note": payment_note,
66
+ "allocations": allocations,
67
+ "invoice_id": invoice_id
68
+ }.reject do |_k, v|
69
+ v == OMIT
70
+ end
71
+ end
72
+
73
+ # Deserialize a JSON object to an instance of NonInsurancePayerPayment
74
+ #
75
+ # @param json_object [String]
76
+ # @return [CandidApiClient::NonInsurancePayerPayments::V1::Types::NonInsurancePayerPayment]
77
+ def self.from_json(json_object:)
78
+ struct = JSON.parse(json_object, object_class: OpenStruct)
79
+ parsed_json = JSON.parse(json_object)
80
+ non_insurance_payer_payment_id = struct["non_insurance_payer_payment_id"]
81
+ if parsed_json["non_insurance_payer"].nil?
82
+ non_insurance_payer = nil
83
+ else
84
+ non_insurance_payer = parsed_json["non_insurance_payer"].to_json
85
+ non_insurance_payer = CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer.from_json(json_object: non_insurance_payer)
86
+ end
87
+ amount_cents = struct["amount_cents"]
88
+ check_number = struct["check_number"]
89
+ payment_timestamp = unless parsed_json["payment_timestamp"].nil?
90
+ DateTime.parse(parsed_json["payment_timestamp"])
91
+ end
92
+ payment_note = struct["payment_note"]
93
+ allocations = parsed_json["allocations"]&.map do |item|
94
+ item = item.to_json
95
+ CandidApiClient::Financials::Types::Allocation.from_json(json_object: item)
96
+ end
97
+ invoice_id = struct["invoice_id"]
98
+ new(
99
+ non_insurance_payer_payment_id: non_insurance_payer_payment_id,
100
+ non_insurance_payer: non_insurance_payer,
101
+ amount_cents: amount_cents,
102
+ check_number: check_number,
103
+ payment_timestamp: payment_timestamp,
104
+ payment_note: payment_note,
105
+ allocations: allocations,
106
+ invoice_id: invoice_id,
107
+ additional_properties: struct
108
+ )
109
+ end
110
+
111
+ # Serialize an instance of NonInsurancePayerPayment to a JSON object
112
+ #
113
+ # @return [String]
114
+ def to_json(*_args)
115
+ @_field_set&.to_json
116
+ end
117
+
118
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
119
+ # hash and check each fields type against the current object's property
120
+ # definitions.
121
+ #
122
+ # @param obj [Object]
123
+ # @return [Void]
124
+ def self.validate_raw(obj:)
125
+ obj.non_insurance_payer_payment_id.is_a?(String) != false || raise("Passed value for field obj.non_insurance_payer_payment_id is not the expected type, validation failed.")
126
+ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayer.validate_raw(obj: obj.non_insurance_payer)
127
+ obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.")
128
+ obj.check_number&.is_a?(String) != false || raise("Passed value for field obj.check_number is not the expected type, validation failed.")
129
+ obj.payment_timestamp&.is_a?(DateTime) != false || raise("Passed value for field obj.payment_timestamp is not the expected type, validation failed.")
130
+ obj.payment_note&.is_a?(String) != false || raise("Passed value for field obj.payment_note is not the expected type, validation failed.")
131
+ obj.allocations.is_a?(Array) != false || raise("Passed value for field obj.allocations is not the expected type, validation failed.")
132
+ obj.invoice_id&.is_a?(String) != false || raise("Passed value for field obj.invoice_id is not the expected type, validation failed.")
133
+ end
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end