candidhealth 0.24.7 → 0.26.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/financials/types/allocation_target.rb +13 -0
  3. data/lib/candidhealth/financials/types/allocation_target_create.rb +12 -0
  4. data/lib/candidhealth/financials/types/appointment_allocation_target.rb +58 -0
  5. data/lib/candidhealth/service_lines/client.rb +30 -0
  6. data/lib/candidhealth/service_lines/v_2/client.rb +229 -0
  7. data/lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb +279 -0
  8. data/lib/candidhealth/service_lines/v_2/types/service_line_update.rb +281 -0
  9. data/lib/candidhealth/third_party_payer_payments/client.rb +30 -0
  10. data/lib/candidhealth/third_party_payer_payments/v_1/client.rb +360 -0
  11. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment.rb +138 -0
  12. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_create.rb +124 -0
  13. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payment_sort_field.rb +14 -0
  14. data/lib/candidhealth/third_party_payer_payments/v_1/types/third_party_payer_payments_page.rb +88 -0
  15. data/lib/candidhealth/third_party_payer_refunds/client.rb +30 -0
  16. data/lib/candidhealth/third_party_payer_refunds/v_1/client.rb +385 -0
  17. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund.rb +139 -0
  18. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_create.rb +125 -0
  19. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refund_sort_field.rb +14 -0
  20. data/lib/candidhealth/third_party_payer_refunds/v_1/types/third_party_payer_refunds_page.rb +88 -0
  21. data/lib/candidhealth/third_party_payers/client.rb +30 -0
  22. data/lib/candidhealth/third_party_payers/v_1/client.rb +375 -0
  23. data/lib/candidhealth/third_party_payers/v_1/types/create_third_party_payer_request.rb +79 -0
  24. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer.rb +100 -0
  25. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_category_update.rb +97 -0
  26. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_description_update.rb +97 -0
  27. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_page.rb +88 -0
  28. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_sort_field.rb +16 -0
  29. data/lib/candidhealth/third_party_payers/v_1/types/third_party_payer_update_request.rb +92 -0
  30. data/lib/candidhealth/third_party_payers/v_1/types/toggle_third_party_payer_enablement_request.rb +61 -0
  31. data/lib/candidhealth/write_offs/v_1/types/patient_write_off.rb +18 -2
  32. data/lib/candidhealth.rb +28 -0
  33. data/lib/requests.rb +2 -2
  34. data/lib/types_export.rb +19 -0
  35. metadata +29 -2
@@ -0,0 +1,279 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/procedure_modifier"
4
+ require_relative "service_line_adjustment"
5
+ require_relative "service_line_denial_reason"
6
+ require_relative "../../../commons/types/facility_type_code"
7
+ require_relative "../../../commons/types/service_line_units"
8
+ require "date"
9
+ require "ostruct"
10
+ require "json"
11
+
12
+ module CandidApiClient
13
+ module ServiceLines
14
+ module V2
15
+ module Types
16
+ class ServiceLineCreateStandalone
17
+ # @return [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
18
+ attr_reader :modifiers
19
+ # @return [Integer]
20
+ attr_reader :charge_amount_cents
21
+ # @return [Integer]
22
+ attr_reader :allowed_amount_cents
23
+ # @return [Integer]
24
+ attr_reader :insurance_balance_cents
25
+ # @return [Integer]
26
+ attr_reader :patient_balance_cents
27
+ # @return [Integer]
28
+ attr_reader :primary_paid_amount_cents
29
+ # @return [Integer]
30
+ attr_reader :secondary_paid_amount_cents
31
+ # @return [Integer]
32
+ attr_reader :tertiary_paid_amount_cents
33
+ # @return [Integer]
34
+ attr_reader :patient_responsibility_cents
35
+ # @return [String]
36
+ attr_reader :diagnosis_id_zero
37
+ # @return [String]
38
+ attr_reader :diagnosis_id_one
39
+ # @return [String]
40
+ attr_reader :diagnosis_id_two
41
+ # @return [String]
42
+ attr_reader :diagnosis_id_three
43
+ # @return [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
44
+ attr_reader :service_line_manual_adjustments
45
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
46
+ attr_reader :denial_reason
47
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode]
48
+ attr_reader :place_of_service_code
49
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode]
50
+ attr_reader :place_of_service_code_as_submitted
51
+ # @return [String]
52
+ attr_reader :procedure_code
53
+ # @return [String] String representation of a Decimal that can be parsed by most libraries.
54
+ # A ServiceLine quantity cannot contain more than one digit of precision.
55
+ # Example: 1.1 is valid, 1.11 is not.
56
+ attr_reader :quantity
57
+ # @return [CandidApiClient::Commons::Types::ServiceLineUnits]
58
+ attr_reader :units
59
+ # @return [String]
60
+ attr_reader :claim_id
61
+ # @return [String] A free-form description to clarify the related data elements and their content.
62
+ # Maps to SV1-01, C003-07 on the 837-P.
63
+ attr_reader :description
64
+ # @return [Date]
65
+ attr_reader :date_of_service
66
+ # @return [Date]
67
+ attr_reader :end_date_of_service
68
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
69
+ attr_reader :additional_properties
70
+ # @return [Object]
71
+ attr_reader :_field_set
72
+ protected :_field_set
73
+
74
+ OMIT = Object.new
75
+
76
+ # @param modifiers [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
77
+ # @param charge_amount_cents [Integer]
78
+ # @param allowed_amount_cents [Integer]
79
+ # @param insurance_balance_cents [Integer]
80
+ # @param patient_balance_cents [Integer]
81
+ # @param primary_paid_amount_cents [Integer]
82
+ # @param secondary_paid_amount_cents [Integer]
83
+ # @param tertiary_paid_amount_cents [Integer]
84
+ # @param patient_responsibility_cents [Integer]
85
+ # @param diagnosis_id_zero [String]
86
+ # @param diagnosis_id_one [String]
87
+ # @param diagnosis_id_two [String]
88
+ # @param diagnosis_id_three [String]
89
+ # @param service_line_manual_adjustments [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
90
+ # @param denial_reason [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
91
+ # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode]
92
+ # @param place_of_service_code_as_submitted [CandidApiClient::Commons::Types::FacilityTypeCode]
93
+ # @param procedure_code [String]
94
+ # @param quantity [String] String representation of a Decimal that can be parsed by most libraries.
95
+ # A ServiceLine quantity cannot contain more than one digit of precision.
96
+ # Example: 1.1 is valid, 1.11 is not.
97
+ # @param units [CandidApiClient::Commons::Types::ServiceLineUnits]
98
+ # @param claim_id [String]
99
+ # @param description [String] A free-form description to clarify the related data elements and their content.
100
+ # Maps to SV1-01, C003-07 on the 837-P.
101
+ # @param date_of_service [Date]
102
+ # @param end_date_of_service [Date]
103
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
104
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateStandalone]
105
+ def initialize(procedure_code:, quantity:, units:, claim_id:, modifiers: OMIT, charge_amount_cents: OMIT, allowed_amount_cents: OMIT,
106
+ insurance_balance_cents: OMIT, patient_balance_cents: OMIT, primary_paid_amount_cents: OMIT, secondary_paid_amount_cents: OMIT, tertiary_paid_amount_cents: OMIT, patient_responsibility_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, service_line_manual_adjustments: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, additional_properties: nil)
107
+ @modifiers = modifiers if modifiers != OMIT
108
+ @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
109
+ @allowed_amount_cents = allowed_amount_cents if allowed_amount_cents != OMIT
110
+ @insurance_balance_cents = insurance_balance_cents if insurance_balance_cents != OMIT
111
+ @patient_balance_cents = patient_balance_cents if patient_balance_cents != OMIT
112
+ @primary_paid_amount_cents = primary_paid_amount_cents if primary_paid_amount_cents != OMIT
113
+ @secondary_paid_amount_cents = secondary_paid_amount_cents if secondary_paid_amount_cents != OMIT
114
+ @tertiary_paid_amount_cents = tertiary_paid_amount_cents if tertiary_paid_amount_cents != OMIT
115
+ @patient_responsibility_cents = patient_responsibility_cents if patient_responsibility_cents != OMIT
116
+ @diagnosis_id_zero = diagnosis_id_zero if diagnosis_id_zero != OMIT
117
+ @diagnosis_id_one = diagnosis_id_one if diagnosis_id_one != OMIT
118
+ @diagnosis_id_two = diagnosis_id_two if diagnosis_id_two != OMIT
119
+ @diagnosis_id_three = diagnosis_id_three if diagnosis_id_three != OMIT
120
+ if service_line_manual_adjustments != OMIT
121
+ @service_line_manual_adjustments = service_line_manual_adjustments
122
+ end
123
+ @denial_reason = denial_reason if denial_reason != OMIT
124
+ @place_of_service_code = place_of_service_code if place_of_service_code != OMIT
125
+ if place_of_service_code_as_submitted != OMIT
126
+ @place_of_service_code_as_submitted = place_of_service_code_as_submitted
127
+ end
128
+ @procedure_code = procedure_code
129
+ @quantity = quantity
130
+ @units = units
131
+ @claim_id = claim_id
132
+ @description = description if description != OMIT
133
+ @date_of_service = date_of_service if date_of_service != OMIT
134
+ @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
135
+ @additional_properties = additional_properties
136
+ @_field_set = {
137
+ "modifiers": modifiers,
138
+ "charge_amount_cents": charge_amount_cents,
139
+ "allowed_amount_cents": allowed_amount_cents,
140
+ "insurance_balance_cents": insurance_balance_cents,
141
+ "patient_balance_cents": patient_balance_cents,
142
+ "primary_paid_amount_cents": primary_paid_amount_cents,
143
+ "secondary_paid_amount_cents": secondary_paid_amount_cents,
144
+ "tertiary_paid_amount_cents": tertiary_paid_amount_cents,
145
+ "patient_responsibility_cents": patient_responsibility_cents,
146
+ "diagnosis_id_zero": diagnosis_id_zero,
147
+ "diagnosis_id_one": diagnosis_id_one,
148
+ "diagnosis_id_two": diagnosis_id_two,
149
+ "diagnosis_id_three": diagnosis_id_three,
150
+ "service_line_manual_adjustments": service_line_manual_adjustments,
151
+ "denial_reason": denial_reason,
152
+ "place_of_service_code": place_of_service_code,
153
+ "place_of_service_code_as_submitted": place_of_service_code_as_submitted,
154
+ "procedure_code": procedure_code,
155
+ "quantity": quantity,
156
+ "units": units,
157
+ "claim_id": claim_id,
158
+ "description": description,
159
+ "date_of_service": date_of_service,
160
+ "end_date_of_service": end_date_of_service
161
+ }.reject do |_k, v|
162
+ v == OMIT
163
+ end
164
+ end
165
+
166
+ # Deserialize a JSON object to an instance of ServiceLineCreateStandalone
167
+ #
168
+ # @param json_object [String]
169
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateStandalone]
170
+ def self.from_json(json_object:)
171
+ struct = JSON.parse(json_object, object_class: OpenStruct)
172
+ parsed_json = JSON.parse(json_object)
173
+ modifiers = struct["modifiers"]
174
+ charge_amount_cents = struct["charge_amount_cents"]
175
+ allowed_amount_cents = struct["allowed_amount_cents"]
176
+ insurance_balance_cents = struct["insurance_balance_cents"]
177
+ patient_balance_cents = struct["patient_balance_cents"]
178
+ primary_paid_amount_cents = struct["primary_paid_amount_cents"]
179
+ secondary_paid_amount_cents = struct["secondary_paid_amount_cents"]
180
+ tertiary_paid_amount_cents = struct["tertiary_paid_amount_cents"]
181
+ patient_responsibility_cents = struct["patient_responsibility_cents"]
182
+ diagnosis_id_zero = struct["diagnosis_id_zero"]
183
+ diagnosis_id_one = struct["diagnosis_id_one"]
184
+ diagnosis_id_two = struct["diagnosis_id_two"]
185
+ diagnosis_id_three = struct["diagnosis_id_three"]
186
+ service_line_manual_adjustments = parsed_json["service_line_manual_adjustments"]&.map do |item|
187
+ item = item.to_json
188
+ CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment.from_json(json_object: item)
189
+ end
190
+ if parsed_json["denial_reason"].nil?
191
+ denial_reason = nil
192
+ else
193
+ denial_reason = parsed_json["denial_reason"].to_json
194
+ denial_reason = CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.from_json(json_object: denial_reason)
195
+ end
196
+ place_of_service_code = struct["place_of_service_code"]
197
+ place_of_service_code_as_submitted = struct["place_of_service_code_as_submitted"]
198
+ procedure_code = struct["procedure_code"]
199
+ quantity = struct["quantity"]
200
+ units = struct["units"]
201
+ claim_id = struct["claim_id"]
202
+ description = struct["description"]
203
+ date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
204
+ end_date_of_service = unless parsed_json["end_date_of_service"].nil?
205
+ Date.parse(parsed_json["end_date_of_service"])
206
+ end
207
+ new(
208
+ modifiers: modifiers,
209
+ charge_amount_cents: charge_amount_cents,
210
+ allowed_amount_cents: allowed_amount_cents,
211
+ insurance_balance_cents: insurance_balance_cents,
212
+ patient_balance_cents: patient_balance_cents,
213
+ primary_paid_amount_cents: primary_paid_amount_cents,
214
+ secondary_paid_amount_cents: secondary_paid_amount_cents,
215
+ tertiary_paid_amount_cents: tertiary_paid_amount_cents,
216
+ patient_responsibility_cents: patient_responsibility_cents,
217
+ diagnosis_id_zero: diagnosis_id_zero,
218
+ diagnosis_id_one: diagnosis_id_one,
219
+ diagnosis_id_two: diagnosis_id_two,
220
+ diagnosis_id_three: diagnosis_id_three,
221
+ service_line_manual_adjustments: service_line_manual_adjustments,
222
+ denial_reason: denial_reason,
223
+ place_of_service_code: place_of_service_code,
224
+ place_of_service_code_as_submitted: place_of_service_code_as_submitted,
225
+ procedure_code: procedure_code,
226
+ quantity: quantity,
227
+ units: units,
228
+ claim_id: claim_id,
229
+ description: description,
230
+ date_of_service: date_of_service,
231
+ end_date_of_service: end_date_of_service,
232
+ additional_properties: struct
233
+ )
234
+ end
235
+
236
+ # Serialize an instance of ServiceLineCreateStandalone to a JSON object
237
+ #
238
+ # @return [String]
239
+ def to_json(*_args)
240
+ @_field_set&.to_json
241
+ end
242
+
243
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
244
+ # hash and check each fields type against the current object's property
245
+ # definitions.
246
+ #
247
+ # @param obj [Object]
248
+ # @return [Void]
249
+ def self.validate_raw(obj:)
250
+ obj.modifiers&.is_a?(Array) != false || raise("Passed value for field obj.modifiers is not the expected type, validation failed.")
251
+ obj.charge_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.charge_amount_cents is not the expected type, validation failed.")
252
+ obj.allowed_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.allowed_amount_cents is not the expected type, validation failed.")
253
+ obj.insurance_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.insurance_balance_cents is not the expected type, validation failed.")
254
+ obj.patient_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_balance_cents is not the expected type, validation failed.")
255
+ obj.primary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.primary_paid_amount_cents is not the expected type, validation failed.")
256
+ obj.secondary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.secondary_paid_amount_cents is not the expected type, validation failed.")
257
+ obj.tertiary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.tertiary_paid_amount_cents is not the expected type, validation failed.")
258
+ obj.patient_responsibility_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_responsibility_cents is not the expected type, validation failed.")
259
+ obj.diagnosis_id_zero&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_zero is not the expected type, validation failed.")
260
+ obj.diagnosis_id_one&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_one is not the expected type, validation failed.")
261
+ obj.diagnosis_id_two&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_two is not the expected type, validation failed.")
262
+ obj.diagnosis_id_three&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_three is not the expected type, validation failed.")
263
+ obj.service_line_manual_adjustments&.is_a?(Array) != false || raise("Passed value for field obj.service_line_manual_adjustments is not the expected type, validation failed.")
264
+ obj.denial_reason.nil? || CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.validate_raw(obj: obj.denial_reason)
265
+ obj.place_of_service_code&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code is not the expected type, validation failed.")
266
+ obj.place_of_service_code_as_submitted&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code_as_submitted is not the expected type, validation failed.")
267
+ obj.procedure_code.is_a?(String) != false || raise("Passed value for field obj.procedure_code is not the expected type, validation failed.")
268
+ obj.quantity.is_a?(String) != false || raise("Passed value for field obj.quantity is not the expected type, validation failed.")
269
+ obj.units.is_a?(CandidApiClient::Commons::Types::ServiceLineUnits) != false || raise("Passed value for field obj.units is not the expected type, validation failed.")
270
+ obj.claim_id.is_a?(String) != false || raise("Passed value for field obj.claim_id is not the expected type, validation failed.")
271
+ obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
272
+ obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
273
+ obj.end_date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.end_date_of_service is not the expected type, validation failed.")
274
+ end
275
+ end
276
+ end
277
+ end
278
+ end
279
+ end
@@ -0,0 +1,281 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../commons/types/procedure_modifier"
4
+ require_relative "service_line_adjustment"
5
+ require_relative "service_line_denial_reason"
6
+ require_relative "../../../commons/types/facility_type_code"
7
+ require_relative "../../../commons/types/service_line_units"
8
+ require "date"
9
+ require "ostruct"
10
+ require "json"
11
+
12
+ module CandidApiClient
13
+ module ServiceLines
14
+ module V2
15
+ module Types
16
+ class ServiceLineUpdate
17
+ # @return [String]
18
+ attr_reader :edit_reason
19
+ # @return [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
20
+ attr_reader :modifiers
21
+ # @return [Integer]
22
+ attr_reader :charge_amount_cents
23
+ # @return [Integer]
24
+ attr_reader :allowed_amount_cents
25
+ # @return [Integer]
26
+ attr_reader :insurance_balance_cents
27
+ # @return [Integer]
28
+ attr_reader :patient_balance_cents
29
+ # @return [Integer]
30
+ attr_reader :primary_paid_amount_cents
31
+ # @return [Integer]
32
+ attr_reader :secondary_paid_amount_cents
33
+ # @return [Integer]
34
+ attr_reader :tertiary_paid_amount_cents
35
+ # @return [Integer]
36
+ attr_reader :patient_responsibility_cents
37
+ # @return [String]
38
+ attr_reader :diagnosis_id_zero
39
+ # @return [String]
40
+ attr_reader :diagnosis_id_one
41
+ # @return [String]
42
+ attr_reader :diagnosis_id_two
43
+ # @return [String]
44
+ attr_reader :diagnosis_id_three
45
+ # @return [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
46
+ attr_reader :service_line_manual_adjustments
47
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
48
+ attr_reader :denial_reason
49
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode]
50
+ attr_reader :place_of_service_code
51
+ # @return [CandidApiClient::Commons::Types::FacilityTypeCode]
52
+ attr_reader :place_of_service_code_as_submitted
53
+ # @return [CandidApiClient::Commons::Types::ServiceLineUnits]
54
+ attr_reader :units
55
+ # @return [String]
56
+ attr_reader :procedure_code
57
+ # @return [String] String representation of a Decimal that can be parsed by most libraries.
58
+ # A ServiceLine quantity cannot contain more than one digit of precision.
59
+ # Example: 1.1 is valid, 1.11 is not.
60
+ attr_reader :quantity
61
+ # @return [String] A free-form description to clarify the related data elements and their content.
62
+ # Maps to SV1-01, C003-07 on the 837-P.
63
+ attr_reader :description
64
+ # @return [Date] date_of_service must be defined on either the encounter or the service lines but
65
+ # not both.
66
+ attr_reader :date_of_service
67
+ # @return [Date]
68
+ attr_reader :end_date_of_service
69
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
70
+ attr_reader :additional_properties
71
+ # @return [Object]
72
+ attr_reader :_field_set
73
+ protected :_field_set
74
+
75
+ OMIT = Object.new
76
+
77
+ # @param edit_reason [String]
78
+ # @param modifiers [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
79
+ # @param charge_amount_cents [Integer]
80
+ # @param allowed_amount_cents [Integer]
81
+ # @param insurance_balance_cents [Integer]
82
+ # @param patient_balance_cents [Integer]
83
+ # @param primary_paid_amount_cents [Integer]
84
+ # @param secondary_paid_amount_cents [Integer]
85
+ # @param tertiary_paid_amount_cents [Integer]
86
+ # @param patient_responsibility_cents [Integer]
87
+ # @param diagnosis_id_zero [String]
88
+ # @param diagnosis_id_one [String]
89
+ # @param diagnosis_id_two [String]
90
+ # @param diagnosis_id_three [String]
91
+ # @param service_line_manual_adjustments [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
92
+ # @param denial_reason [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
93
+ # @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode]
94
+ # @param place_of_service_code_as_submitted [CandidApiClient::Commons::Types::FacilityTypeCode]
95
+ # @param units [CandidApiClient::Commons::Types::ServiceLineUnits]
96
+ # @param procedure_code [String]
97
+ # @param quantity [String] String representation of a Decimal that can be parsed by most libraries.
98
+ # A ServiceLine quantity cannot contain more than one digit of precision.
99
+ # Example: 1.1 is valid, 1.11 is not.
100
+ # @param description [String] A free-form description to clarify the related data elements and their content.
101
+ # Maps to SV1-01, C003-07 on the 837-P.
102
+ # @param date_of_service [Date] date_of_service must be defined on either the encounter or the service lines but
103
+ # not both.
104
+ # @param end_date_of_service [Date]
105
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
106
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate]
107
+ def initialize(edit_reason: OMIT, modifiers: OMIT, charge_amount_cents: OMIT, allowed_amount_cents: OMIT,
108
+ insurance_balance_cents: OMIT, patient_balance_cents: OMIT, primary_paid_amount_cents: OMIT, secondary_paid_amount_cents: OMIT, tertiary_paid_amount_cents: OMIT, patient_responsibility_cents: OMIT, diagnosis_id_zero: OMIT, diagnosis_id_one: OMIT, diagnosis_id_two: OMIT, diagnosis_id_three: OMIT, service_line_manual_adjustments: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, units: OMIT, procedure_code: OMIT, quantity: OMIT, description: OMIT, date_of_service: OMIT, end_date_of_service: OMIT, additional_properties: nil)
109
+ @edit_reason = edit_reason if edit_reason != OMIT
110
+ @modifiers = modifiers if modifiers != OMIT
111
+ @charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
112
+ @allowed_amount_cents = allowed_amount_cents if allowed_amount_cents != OMIT
113
+ @insurance_balance_cents = insurance_balance_cents if insurance_balance_cents != OMIT
114
+ @patient_balance_cents = patient_balance_cents if patient_balance_cents != OMIT
115
+ @primary_paid_amount_cents = primary_paid_amount_cents if primary_paid_amount_cents != OMIT
116
+ @secondary_paid_amount_cents = secondary_paid_amount_cents if secondary_paid_amount_cents != OMIT
117
+ @tertiary_paid_amount_cents = tertiary_paid_amount_cents if tertiary_paid_amount_cents != OMIT
118
+ @patient_responsibility_cents = patient_responsibility_cents if patient_responsibility_cents != OMIT
119
+ @diagnosis_id_zero = diagnosis_id_zero if diagnosis_id_zero != OMIT
120
+ @diagnosis_id_one = diagnosis_id_one if diagnosis_id_one != OMIT
121
+ @diagnosis_id_two = diagnosis_id_two if diagnosis_id_two != OMIT
122
+ @diagnosis_id_three = diagnosis_id_three if diagnosis_id_three != OMIT
123
+ if service_line_manual_adjustments != OMIT
124
+ @service_line_manual_adjustments = service_line_manual_adjustments
125
+ end
126
+ @denial_reason = denial_reason if denial_reason != OMIT
127
+ @place_of_service_code = place_of_service_code if place_of_service_code != OMIT
128
+ if place_of_service_code_as_submitted != OMIT
129
+ @place_of_service_code_as_submitted = place_of_service_code_as_submitted
130
+ end
131
+ @units = units if units != OMIT
132
+ @procedure_code = procedure_code if procedure_code != OMIT
133
+ @quantity = quantity if quantity != OMIT
134
+ @description = description if description != OMIT
135
+ @date_of_service = date_of_service if date_of_service != OMIT
136
+ @end_date_of_service = end_date_of_service if end_date_of_service != OMIT
137
+ @additional_properties = additional_properties
138
+ @_field_set = {
139
+ "edit_reason": edit_reason,
140
+ "modifiers": modifiers,
141
+ "charge_amount_cents": charge_amount_cents,
142
+ "allowed_amount_cents": allowed_amount_cents,
143
+ "insurance_balance_cents": insurance_balance_cents,
144
+ "patient_balance_cents": patient_balance_cents,
145
+ "primary_paid_amount_cents": primary_paid_amount_cents,
146
+ "secondary_paid_amount_cents": secondary_paid_amount_cents,
147
+ "tertiary_paid_amount_cents": tertiary_paid_amount_cents,
148
+ "patient_responsibility_cents": patient_responsibility_cents,
149
+ "diagnosis_id_zero": diagnosis_id_zero,
150
+ "diagnosis_id_one": diagnosis_id_one,
151
+ "diagnosis_id_two": diagnosis_id_two,
152
+ "diagnosis_id_three": diagnosis_id_three,
153
+ "service_line_manual_adjustments": service_line_manual_adjustments,
154
+ "denial_reason": denial_reason,
155
+ "place_of_service_code": place_of_service_code,
156
+ "place_of_service_code_as_submitted": place_of_service_code_as_submitted,
157
+ "units": units,
158
+ "procedure_code": procedure_code,
159
+ "quantity": quantity,
160
+ "description": description,
161
+ "date_of_service": date_of_service,
162
+ "end_date_of_service": end_date_of_service
163
+ }.reject do |_k, v|
164
+ v == OMIT
165
+ end
166
+ end
167
+
168
+ # Deserialize a JSON object to an instance of ServiceLineUpdate
169
+ #
170
+ # @param json_object [String]
171
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate]
172
+ def self.from_json(json_object:)
173
+ struct = JSON.parse(json_object, object_class: OpenStruct)
174
+ parsed_json = JSON.parse(json_object)
175
+ edit_reason = struct["edit_reason"]
176
+ modifiers = struct["modifiers"]
177
+ charge_amount_cents = struct["charge_amount_cents"]
178
+ allowed_amount_cents = struct["allowed_amount_cents"]
179
+ insurance_balance_cents = struct["insurance_balance_cents"]
180
+ patient_balance_cents = struct["patient_balance_cents"]
181
+ primary_paid_amount_cents = struct["primary_paid_amount_cents"]
182
+ secondary_paid_amount_cents = struct["secondary_paid_amount_cents"]
183
+ tertiary_paid_amount_cents = struct["tertiary_paid_amount_cents"]
184
+ patient_responsibility_cents = struct["patient_responsibility_cents"]
185
+ diagnosis_id_zero = struct["diagnosis_id_zero"]
186
+ diagnosis_id_one = struct["diagnosis_id_one"]
187
+ diagnosis_id_two = struct["diagnosis_id_two"]
188
+ diagnosis_id_three = struct["diagnosis_id_three"]
189
+ service_line_manual_adjustments = parsed_json["service_line_manual_adjustments"]&.map do |item|
190
+ item = item.to_json
191
+ CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment.from_json(json_object: item)
192
+ end
193
+ if parsed_json["denial_reason"].nil?
194
+ denial_reason = nil
195
+ else
196
+ denial_reason = parsed_json["denial_reason"].to_json
197
+ denial_reason = CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.from_json(json_object: denial_reason)
198
+ end
199
+ place_of_service_code = struct["place_of_service_code"]
200
+ place_of_service_code_as_submitted = struct["place_of_service_code_as_submitted"]
201
+ units = struct["units"]
202
+ procedure_code = struct["procedure_code"]
203
+ quantity = struct["quantity"]
204
+ description = struct["description"]
205
+ date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
206
+ end_date_of_service = unless parsed_json["end_date_of_service"].nil?
207
+ Date.parse(parsed_json["end_date_of_service"])
208
+ end
209
+ new(
210
+ edit_reason: edit_reason,
211
+ modifiers: modifiers,
212
+ charge_amount_cents: charge_amount_cents,
213
+ allowed_amount_cents: allowed_amount_cents,
214
+ insurance_balance_cents: insurance_balance_cents,
215
+ patient_balance_cents: patient_balance_cents,
216
+ primary_paid_amount_cents: primary_paid_amount_cents,
217
+ secondary_paid_amount_cents: secondary_paid_amount_cents,
218
+ tertiary_paid_amount_cents: tertiary_paid_amount_cents,
219
+ patient_responsibility_cents: patient_responsibility_cents,
220
+ diagnosis_id_zero: diagnosis_id_zero,
221
+ diagnosis_id_one: diagnosis_id_one,
222
+ diagnosis_id_two: diagnosis_id_two,
223
+ diagnosis_id_three: diagnosis_id_three,
224
+ service_line_manual_adjustments: service_line_manual_adjustments,
225
+ denial_reason: denial_reason,
226
+ place_of_service_code: place_of_service_code,
227
+ place_of_service_code_as_submitted: place_of_service_code_as_submitted,
228
+ units: units,
229
+ procedure_code: procedure_code,
230
+ quantity: quantity,
231
+ description: description,
232
+ date_of_service: date_of_service,
233
+ end_date_of_service: end_date_of_service,
234
+ additional_properties: struct
235
+ )
236
+ end
237
+
238
+ # Serialize an instance of ServiceLineUpdate to a JSON object
239
+ #
240
+ # @return [String]
241
+ def to_json(*_args)
242
+ @_field_set&.to_json
243
+ end
244
+
245
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
246
+ # hash and check each fields type against the current object's property
247
+ # definitions.
248
+ #
249
+ # @param obj [Object]
250
+ # @return [Void]
251
+ def self.validate_raw(obj:)
252
+ obj.edit_reason&.is_a?(String) != false || raise("Passed value for field obj.edit_reason is not the expected type, validation failed.")
253
+ obj.modifiers&.is_a?(Array) != false || raise("Passed value for field obj.modifiers is not the expected type, validation failed.")
254
+ obj.charge_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.charge_amount_cents is not the expected type, validation failed.")
255
+ obj.allowed_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.allowed_amount_cents is not the expected type, validation failed.")
256
+ obj.insurance_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.insurance_balance_cents is not the expected type, validation failed.")
257
+ obj.patient_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_balance_cents is not the expected type, validation failed.")
258
+ obj.primary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.primary_paid_amount_cents is not the expected type, validation failed.")
259
+ obj.secondary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.secondary_paid_amount_cents is not the expected type, validation failed.")
260
+ obj.tertiary_paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.tertiary_paid_amount_cents is not the expected type, validation failed.")
261
+ obj.patient_responsibility_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_responsibility_cents is not the expected type, validation failed.")
262
+ obj.diagnosis_id_zero&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_zero is not the expected type, validation failed.")
263
+ obj.diagnosis_id_one&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_one is not the expected type, validation failed.")
264
+ obj.diagnosis_id_two&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_two is not the expected type, validation failed.")
265
+ obj.diagnosis_id_three&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_three is not the expected type, validation failed.")
266
+ obj.service_line_manual_adjustments&.is_a?(Array) != false || raise("Passed value for field obj.service_line_manual_adjustments is not the expected type, validation failed.")
267
+ obj.denial_reason.nil? || CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.validate_raw(obj: obj.denial_reason)
268
+ obj.place_of_service_code&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code is not the expected type, validation failed.")
269
+ obj.place_of_service_code_as_submitted&.is_a?(CandidApiClient::Commons::Types::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code_as_submitted is not the expected type, validation failed.")
270
+ obj.units&.is_a?(CandidApiClient::Commons::Types::ServiceLineUnits) != false || raise("Passed value for field obj.units is not the expected type, validation failed.")
271
+ obj.procedure_code&.is_a?(String) != false || raise("Passed value for field obj.procedure_code is not the expected type, validation failed.")
272
+ obj.quantity&.is_a?(String) != false || raise("Passed value for field obj.quantity is not the expected type, validation failed.")
273
+ obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
274
+ obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
275
+ obj.end_date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.end_date_of_service is not the expected type, validation failed.")
276
+ end
277
+ end
278
+ end
279
+ end
280
+ end
281
+ 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 ThirdPartyPayerPayments
8
+ class Client
9
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::V1Client]
10
+ attr_reader :v_1
11
+
12
+ # @param request_client [CandidApiClient::RequestClient]
13
+ # @return [CandidApiClient::ThirdPartyPayerPayments::Client]
14
+ def initialize(request_client:)
15
+ @v_1 = CandidApiClient::ThirdPartyPayerPayments::V1::V1Client.new(request_client: request_client)
16
+ end
17
+ end
18
+
19
+ class AsyncClient
20
+ # @return [CandidApiClient::ThirdPartyPayerPayments::V1::AsyncV1Client]
21
+ attr_reader :v_1
22
+
23
+ # @param request_client [CandidApiClient::AsyncRequestClient]
24
+ # @return [CandidApiClient::ThirdPartyPayerPayments::AsyncClient]
25
+ def initialize(request_client:)
26
+ @v_1 = CandidApiClient::ThirdPartyPayerPayments::V1::AsyncV1Client.new(request_client: request_client)
27
+ end
28
+ end
29
+ end
30
+ end