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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66cacbf9ad5b8a9b03edfdb6f3cc1cd700c1ce334ab18c6d2d995110ea926673
4
- data.tar.gz: 47c042b7f6ecd15abd96eb6ebb491a00017ab7fa4656f7302f81bdca3e88b7c8
3
+ metadata.gz: 4b53feca220d040d6be48d229853df8783efbfabbf1b403f71e7b162e39a0585
4
+ data.tar.gz: aac2f2a803035bec99d2ff1b05aaec6e750c5ed33384ebbf2c07ef18f7304ad2
5
5
  SHA512:
6
- metadata.gz: c6d5a5060d9f7fee6b88180a63c2629a0591bb29500d7e2380f7f23234b04d59cf29e192f15f329283a9f175f68448247b568dc5ec21fb531a5687f4182411b9
7
- data.tar.gz: dfc69be27297ba2d031f5787861e62c05899ce66b01847407dd8cba6a54948288b39e99f909486d053951230952f06ffdd6ca637c02218c3dfc6fbfbb0e10a4f
6
+ metadata.gz: 4065d136f50e44143ba7e6ffb145653c1dc72b89c74b896b64561539dfd59a2f1a8f98401cac0e7790a0733f6469eeb1da96f26f17f09ca87f7cee938217ad7c
7
+ data.tar.gz: 64e15cb9346707b3ae514c875472914b44d35b49d48e9c26788b0dfdcf3c0761e0a670a601e63a5f33b22baf7273f9d5a88b63b2dd1e15613c83bf76eb17784b
@@ -4,6 +4,7 @@ require "json"
4
4
  require_relative "service_line_allocation_target"
5
5
  require_relative "claim_allocation_target"
6
6
  require_relative "billing_provider_allocation_target"
7
+ require_relative "appointment_allocation_target"
7
8
 
8
9
  module CandidApiClient
9
10
  module Financials
@@ -41,6 +42,8 @@ module CandidApiClient
41
42
  CandidApiClient::Financials::Types::ClaimAllocationTarget.from_json(json_object: json_object)
42
43
  when "billing_provider_id"
43
44
  CandidApiClient::Financials::Types::BillingProviderAllocationTarget.from_json(json_object: json_object)
45
+ when "appointment"
46
+ CandidApiClient::Financials::Types::AppointmentAllocationTarget.from_json(json_object: json_object)
44
47
  when "unattributed"
45
48
  nil
46
49
  else
@@ -60,6 +63,8 @@ module CandidApiClient
60
63
  { **@member.to_json, type: @discriminant }.to_json
61
64
  when "billing_provider_id"
62
65
  { **@member.to_json, type: @discriminant }.to_json
66
+ when "appointment"
67
+ { **@member.to_json, type: @discriminant }.to_json
63
68
  when "unattributed"
64
69
  { type: @discriminant }.to_json
65
70
  else
@@ -82,6 +87,8 @@ module CandidApiClient
82
87
  CandidApiClient::Financials::Types::ClaimAllocationTarget.validate_raw(obj: obj)
83
88
  when "billing_provider_id"
84
89
  CandidApiClient::Financials::Types::BillingProviderAllocationTarget.validate_raw(obj: obj)
90
+ when "appointment"
91
+ CandidApiClient::Financials::Types::AppointmentAllocationTarget.validate_raw(obj: obj)
85
92
  when "unattributed"
86
93
  # noop
87
94
  else
@@ -115,6 +122,12 @@ module CandidApiClient
115
122
  new(member: member, discriminant: "billing_provider_id")
116
123
  end
117
124
 
125
+ # @param member [CandidApiClient::Financials::Types::AppointmentAllocationTarget]
126
+ # @return [CandidApiClient::Financials::Types::AllocationTarget]
127
+ def self.appointment(member:)
128
+ new(member: member, discriminant: "appointment")
129
+ end
130
+
118
131
  # @return [CandidApiClient::Financials::Types::AllocationTarget]
119
132
  def self.unattributed
120
133
  new(member: nil, discriminant: "unattributed")
@@ -40,6 +40,8 @@ module CandidApiClient
40
40
  json_object.value
41
41
  when "billing_provider_by_id"
42
42
  json_object.value
43
+ when "appointment_by_id"
44
+ json_object.value
43
45
  when "unattributed"
44
46
  nil
45
47
  else
@@ -61,6 +63,8 @@ module CandidApiClient
61
63
  { "type": @discriminant, "value": @member }.to_json
62
64
  when "billing_provider_by_id"
63
65
  { "type": @discriminant, "value": @member }.to_json
66
+ when "appointment_by_id"
67
+ { "type": @discriminant, "value": @member }.to_json
64
68
  when "unattributed"
65
69
  { type: @discriminant }.to_json
66
70
  else
@@ -85,6 +89,8 @@ module CandidApiClient
85
89
  obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
86
90
  when "billing_provider_by_id"
87
91
  obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
92
+ when "appointment_by_id"
93
+ obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
88
94
  when "unattributed"
89
95
  # noop
90
96
  else
@@ -124,6 +130,12 @@ module CandidApiClient
124
130
  new(member: member, discriminant: "billing_provider_by_id")
125
131
  end
126
132
 
133
+ # @param member [String]
134
+ # @return [CandidApiClient::Financials::Types::AllocationTargetCreate]
135
+ def self.appointment_by_id(member:)
136
+ new(member: member, discriminant: "appointment_by_id")
137
+ end
138
+
127
139
  # @return [CandidApiClient::Financials::Types::AllocationTargetCreate]
128
140
  def self.unattributed
129
141
  new(member: nil, discriminant: "unattributed")
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module CandidApiClient
7
+ module Financials
8
+ module Types
9
+ class AppointmentAllocationTarget
10
+ # @return [String]
11
+ attr_reader :appointment_id
12
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
13
+ attr_reader :additional_properties
14
+ # @return [Object]
15
+ attr_reader :_field_set
16
+ protected :_field_set
17
+
18
+ OMIT = Object.new
19
+
20
+ # @param appointment_id [String]
21
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
22
+ # @return [CandidApiClient::Financials::Types::AppointmentAllocationTarget]
23
+ def initialize(appointment_id:, additional_properties: nil)
24
+ @appointment_id = appointment_id
25
+ @additional_properties = additional_properties
26
+ @_field_set = { "appointment_id": appointment_id }
27
+ end
28
+
29
+ # Deserialize a JSON object to an instance of AppointmentAllocationTarget
30
+ #
31
+ # @param json_object [String]
32
+ # @return [CandidApiClient::Financials::Types::AppointmentAllocationTarget]
33
+ def self.from_json(json_object:)
34
+ struct = JSON.parse(json_object, object_class: OpenStruct)
35
+ appointment_id = struct["appointment_id"]
36
+ new(appointment_id: appointment_id, additional_properties: struct)
37
+ end
38
+
39
+ # Serialize an instance of AppointmentAllocationTarget to a JSON object
40
+ #
41
+ # @return [String]
42
+ def to_json(*_args)
43
+ @_field_set&.to_json
44
+ end
45
+
46
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
47
+ # hash and check each fields type against the current object's property
48
+ # definitions.
49
+ #
50
+ # @param obj [Object]
51
+ # @return [Void]
52
+ def self.validate_raw(obj:)
53
+ obj.appointment_id.is_a?(String) != false || raise("Passed value for field obj.appointment_id is not the expected type, validation failed.")
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../requests"
4
+ require_relative "v_2/client"
5
+
6
+ module CandidApiClient
7
+ module ServiceLines
8
+ class Client
9
+ # @return [CandidApiClient::ServiceLines::V2::V2Client]
10
+ attr_reader :v_2
11
+
12
+ # @param request_client [CandidApiClient::RequestClient]
13
+ # @return [CandidApiClient::ServiceLines::Client]
14
+ def initialize(request_client:)
15
+ @v_2 = CandidApiClient::ServiceLines::V2::V2Client.new(request_client: request_client)
16
+ end
17
+ end
18
+
19
+ class AsyncClient
20
+ # @return [CandidApiClient::ServiceLines::V2::AsyncV2Client]
21
+ attr_reader :v_2
22
+
23
+ # @param request_client [CandidApiClient::AsyncRequestClient]
24
+ # @return [CandidApiClient::ServiceLines::AsyncClient]
25
+ def initialize(request_client:)
26
+ @v_2 = CandidApiClient::ServiceLines::V2::AsyncV2Client.new(request_client: request_client)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,229 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../requests"
4
+ require_relative "types/service_line_create_standalone"
5
+ require_relative "types/service_line"
6
+ require_relative "types/service_line_update"
7
+ require "async"
8
+
9
+ module CandidApiClient
10
+ module ServiceLines
11
+ module V2
12
+ class V2Client
13
+ # @return [CandidApiClient::RequestClient]
14
+ attr_reader :request_client
15
+
16
+ # @param request_client [CandidApiClient::RequestClient]
17
+ # @return [CandidApiClient::ServiceLines::V2::V2Client]
18
+ def initialize(request_client:)
19
+ @request_client = request_client
20
+ end
21
+
22
+ # @param request [Hash] Request of type CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateStandalone, as a Hash
23
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
24
+ # * :charge_amount_cents (Integer)
25
+ # * :allowed_amount_cents (Integer)
26
+ # * :insurance_balance_cents (Integer)
27
+ # * :patient_balance_cents (Integer)
28
+ # * :primary_paid_amount_cents (Integer)
29
+ # * :secondary_paid_amount_cents (Integer)
30
+ # * :tertiary_paid_amount_cents (Integer)
31
+ # * :patient_responsibility_cents (Integer)
32
+ # * :diagnosis_id_zero (String)
33
+ # * :diagnosis_id_one (String)
34
+ # * :diagnosis_id_two (String)
35
+ # * :diagnosis_id_three (String)
36
+ # * :service_line_manual_adjustments (Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>)
37
+ # * :denial_reason (Hash)
38
+ # * :reason (CandidApiClient::ServiceLines::V2::Types::DenialReasonContent)
39
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
40
+ # * :place_of_service_code_as_submitted (CandidApiClient::Commons::Types::FacilityTypeCode)
41
+ # * :procedure_code (String)
42
+ # * :quantity (String)
43
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
44
+ # * :claim_id (String)
45
+ # * :description (String)
46
+ # * :date_of_service (Date)
47
+ # * :end_date_of_service (Date)
48
+ # @param request_options [CandidApiClient::RequestOptions]
49
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
50
+ # @example
51
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
52
+ # api.service_lines.v_2.create(request: { modifiers: [TWENTY_TWO], charge_amount_cents: 1, allowed_amount_cents: 1, insurance_balance_cents: 1, patient_balance_cents: 1, primary_paid_amount_cents: 1, secondary_paid_amount_cents: 1, tertiary_paid_amount_cents: 1, patient_responsibility_cents: 1, diagnosis_id_zero: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_one: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_two: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_three: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", service_line_manual_adjustments: [{ }], denial_reason: { }, place_of_service_code: PHARMACY, place_of_service_code_as_submitted: PHARMACY, procedure_code: "string", quantity: "string", units: MJ, claim_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15) })
53
+ def create(request:, request_options: nil)
54
+ response = @request_client.conn.post do |req|
55
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
56
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
57
+ req.headers = {
58
+ **(req.headers || {}),
59
+ **@request_client.get_headers,
60
+ **(request_options&.additional_headers || {})
61
+ }.compact
62
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
63
+ req.url "#{@request_client.get_url(environment: CandidApi,
64
+ request_options: request_options)}/api/service-lines/v2"
65
+ end
66
+ CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
67
+ end
68
+
69
+ # @param service_line_id [String]
70
+ # @param request [Hash] Request of type CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate, as a Hash
71
+ # * :edit_reason (String)
72
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
73
+ # * :charge_amount_cents (Integer)
74
+ # * :allowed_amount_cents (Integer)
75
+ # * :insurance_balance_cents (Integer)
76
+ # * :patient_balance_cents (Integer)
77
+ # * :primary_paid_amount_cents (Integer)
78
+ # * :secondary_paid_amount_cents (Integer)
79
+ # * :tertiary_paid_amount_cents (Integer)
80
+ # * :patient_responsibility_cents (Integer)
81
+ # * :diagnosis_id_zero (String)
82
+ # * :diagnosis_id_one (String)
83
+ # * :diagnosis_id_two (String)
84
+ # * :diagnosis_id_three (String)
85
+ # * :service_line_manual_adjustments (Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>)
86
+ # * :denial_reason (Hash)
87
+ # * :reason (CandidApiClient::ServiceLines::V2::Types::DenialReasonContent)
88
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
89
+ # * :place_of_service_code_as_submitted (CandidApiClient::Commons::Types::FacilityTypeCode)
90
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
91
+ # * :procedure_code (String)
92
+ # * :quantity (String)
93
+ # * :description (String)
94
+ # * :date_of_service (Date)
95
+ # * :end_date_of_service (Date)
96
+ # @param request_options [CandidApiClient::RequestOptions]
97
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
98
+ # @example
99
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
100
+ # api.service_lines.v_2.update(service_line_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { edit_reason: "string", modifiers: [TWENTY_TWO], charge_amount_cents: 1, allowed_amount_cents: 1, insurance_balance_cents: 1, patient_balance_cents: 1, primary_paid_amount_cents: 1, secondary_paid_amount_cents: 1, tertiary_paid_amount_cents: 1, patient_responsibility_cents: 1, diagnosis_id_zero: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_one: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_two: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_three: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", service_line_manual_adjustments: [{ }], denial_reason: { }, place_of_service_code: PHARMACY, place_of_service_code_as_submitted: PHARMACY, units: MJ, procedure_code: "string", quantity: "string", description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15) })
101
+ def update(service_line_id:, request:, request_options: nil)
102
+ response = @request_client.conn.patch do |req|
103
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
104
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
105
+ req.headers = {
106
+ **(req.headers || {}),
107
+ **@request_client.get_headers,
108
+ **(request_options&.additional_headers || {})
109
+ }.compact
110
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
111
+ req.url "#{@request_client.get_url(environment: CandidApi,
112
+ request_options: request_options)}/api/service-lines/v2/#{service_line_id}"
113
+ end
114
+ CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
115
+ end
116
+ end
117
+
118
+ class AsyncV2Client
119
+ # @return [CandidApiClient::AsyncRequestClient]
120
+ attr_reader :request_client
121
+
122
+ # @param request_client [CandidApiClient::AsyncRequestClient]
123
+ # @return [CandidApiClient::ServiceLines::V2::AsyncV2Client]
124
+ def initialize(request_client:)
125
+ @request_client = request_client
126
+ end
127
+
128
+ # @param request [Hash] Request of type CandidApiClient::ServiceLines::V2::Types::ServiceLineCreateStandalone, as a Hash
129
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
130
+ # * :charge_amount_cents (Integer)
131
+ # * :allowed_amount_cents (Integer)
132
+ # * :insurance_balance_cents (Integer)
133
+ # * :patient_balance_cents (Integer)
134
+ # * :primary_paid_amount_cents (Integer)
135
+ # * :secondary_paid_amount_cents (Integer)
136
+ # * :tertiary_paid_amount_cents (Integer)
137
+ # * :patient_responsibility_cents (Integer)
138
+ # * :diagnosis_id_zero (String)
139
+ # * :diagnosis_id_one (String)
140
+ # * :diagnosis_id_two (String)
141
+ # * :diagnosis_id_three (String)
142
+ # * :service_line_manual_adjustments (Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>)
143
+ # * :denial_reason (Hash)
144
+ # * :reason (CandidApiClient::ServiceLines::V2::Types::DenialReasonContent)
145
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
146
+ # * :place_of_service_code_as_submitted (CandidApiClient::Commons::Types::FacilityTypeCode)
147
+ # * :procedure_code (String)
148
+ # * :quantity (String)
149
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
150
+ # * :claim_id (String)
151
+ # * :description (String)
152
+ # * :date_of_service (Date)
153
+ # * :end_date_of_service (Date)
154
+ # @param request_options [CandidApiClient::RequestOptions]
155
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
156
+ # @example
157
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
158
+ # api.service_lines.v_2.create(request: { modifiers: [TWENTY_TWO], charge_amount_cents: 1, allowed_amount_cents: 1, insurance_balance_cents: 1, patient_balance_cents: 1, primary_paid_amount_cents: 1, secondary_paid_amount_cents: 1, tertiary_paid_amount_cents: 1, patient_responsibility_cents: 1, diagnosis_id_zero: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_one: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_two: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_three: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", service_line_manual_adjustments: [{ }], denial_reason: { }, place_of_service_code: PHARMACY, place_of_service_code_as_submitted: PHARMACY, procedure_code: "string", quantity: "string", units: MJ, claim_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15) })
159
+ def create(request:, request_options: nil)
160
+ Async do
161
+ response = @request_client.conn.post do |req|
162
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
163
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
164
+ req.headers = {
165
+ **(req.headers || {}),
166
+ **@request_client.get_headers,
167
+ **(request_options&.additional_headers || {})
168
+ }.compact
169
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
170
+ req.url "#{@request_client.get_url(environment: CandidApi,
171
+ request_options: request_options)}/api/service-lines/v2"
172
+ end
173
+ CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
174
+ end
175
+ end
176
+
177
+ # @param service_line_id [String]
178
+ # @param request [Hash] Request of type CandidApiClient::ServiceLines::V2::Types::ServiceLineUpdate, as a Hash
179
+ # * :edit_reason (String)
180
+ # * :modifiers (Array<CandidApiClient::Commons::Types::ProcedureModifier>)
181
+ # * :charge_amount_cents (Integer)
182
+ # * :allowed_amount_cents (Integer)
183
+ # * :insurance_balance_cents (Integer)
184
+ # * :patient_balance_cents (Integer)
185
+ # * :primary_paid_amount_cents (Integer)
186
+ # * :secondary_paid_amount_cents (Integer)
187
+ # * :tertiary_paid_amount_cents (Integer)
188
+ # * :patient_responsibility_cents (Integer)
189
+ # * :diagnosis_id_zero (String)
190
+ # * :diagnosis_id_one (String)
191
+ # * :diagnosis_id_two (String)
192
+ # * :diagnosis_id_three (String)
193
+ # * :service_line_manual_adjustments (Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>)
194
+ # * :denial_reason (Hash)
195
+ # * :reason (CandidApiClient::ServiceLines::V2::Types::DenialReasonContent)
196
+ # * :place_of_service_code (CandidApiClient::Commons::Types::FacilityTypeCode)
197
+ # * :place_of_service_code_as_submitted (CandidApiClient::Commons::Types::FacilityTypeCode)
198
+ # * :units (CandidApiClient::Commons::Types::ServiceLineUnits)
199
+ # * :procedure_code (String)
200
+ # * :quantity (String)
201
+ # * :description (String)
202
+ # * :date_of_service (Date)
203
+ # * :end_date_of_service (Date)
204
+ # @param request_options [CandidApiClient::RequestOptions]
205
+ # @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
206
+ # @example
207
+ # api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
208
+ # api.service_lines.v_2.update(service_line_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { edit_reason: "string", modifiers: [TWENTY_TWO], charge_amount_cents: 1, allowed_amount_cents: 1, insurance_balance_cents: 1, patient_balance_cents: 1, primary_paid_amount_cents: 1, secondary_paid_amount_cents: 1, tertiary_paid_amount_cents: 1, patient_responsibility_cents: 1, diagnosis_id_zero: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_one: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_two: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", diagnosis_id_three: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", service_line_manual_adjustments: [{ }], denial_reason: { }, place_of_service_code: PHARMACY, place_of_service_code_as_submitted: PHARMACY, units: MJ, procedure_code: "string", quantity: "string", description: "string", date_of_service: DateTime.parse(2023-01-15), end_date_of_service: DateTime.parse(2023-01-15) })
209
+ def update(service_line_id:, request:, request_options: nil)
210
+ Async do
211
+ response = @request_client.conn.patch do |req|
212
+ req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
213
+ req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
214
+ req.headers = {
215
+ **(req.headers || {}),
216
+ **@request_client.get_headers,
217
+ **(request_options&.additional_headers || {})
218
+ }.compact
219
+ req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
220
+ req.url "#{@request_client.get_url(environment: CandidApi,
221
+ request_options: request_options)}/api/service-lines/v2/#{service_line_id}"
222
+ end
223
+ CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
224
+ end
225
+ end
226
+ end
227
+ end
228
+ end
229
+ end