Class: CandidApiClient::PatientPayments::V4::V4Client
- Inherits:
-
Object
- Object
- CandidApiClient::PatientPayments::V4::V4Client
- Defined in:
- lib/candidhealth/patient_payments/v_4/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(amount_cents:, patient_external_id:, allocations:, payment_timestamp: nil, payment_note: nil, invoice: nil, request_options: nil) ⇒ CandidApiClient::PatientPayments::V4::Types::PatientPayment
Creates a new patient payment record and returns the newly created PatientPayment object.
-
#delete(patient_payment_id:, request_options: nil) ⇒ Void
Deletes the patient payment record matching the provided patient_payment_id.
-
#get(patient_payment_id:, request_options: nil) ⇒ CandidApiClient::PatientPayments::V4::Types::PatientPayment
Retrieves a previously created patient payment by its ‘patient_payment_id`.
-
#get_multi(limit: nil, patient_external_id: nil, claim_id: nil, service_line_id: nil, billing_provider_id: nil, unattributed: nil, invoice_id: nil, sources: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::PatientPayments::V4::Types::PatientPaymentsPage
Returns all patient payments satisfying the search criteria AND whose organization_id matches the current organization_id of the authenticated user.
- #initialize(request_client:) ⇒ CandidApiClient::PatientPayments::V4::V4Client constructor
-
#update(patient_payment_id:, payment_timestamp: nil, payment_note: nil, invoice: nil, request_options: nil) ⇒ CandidApiClient::PatientPayments::V4::Types::PatientPayment
Updates the patient payment record matching the provided patient_payment_id.
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::PatientPayments::V4::V4Client
24 25 26 |
# File 'lib/candidhealth/patient_payments/v_4/client.rb', line 24 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::RequestClient (readonly)
20 21 22 |
# File 'lib/candidhealth/patient_payments/v_4/client.rb', line 20 def request_client @request_client end |
Instance Method Details
#create(amount_cents:, patient_external_id:, allocations:, payment_timestamp: nil, payment_note: nil, invoice: nil, request_options: nil) ⇒ CandidApiClient::PatientPayments::V4::Types::PatientPayment
Creates a new patient payment record and returns the newly created
PatientPayment object.
The allocations can describe whether the payment is being applied toward a
specific service line,
claim, or billing provider.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/candidhealth/patient_payments/v_4/client.rb', line 139 def create(amount_cents:, patient_external_id:, allocations:, payment_timestamp: nil, payment_note: nil, invoice: nil, request_options: nil) response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(&.additional_body_parameters || {}), amount_cents: amount_cents, payment_timestamp: , payment_note: payment_note, patient_external_id: patient_external_id, allocations: allocations, invoice: invoice }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/patient-payments/v4" end CandidApiClient::PatientPayments::V4::Types::PatientPayment.from_json(json_object: response.body) end |
#delete(patient_payment_id:, request_options: nil) ⇒ Void
Deletes the patient payment record matching the provided patient_payment_id.
204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/candidhealth/patient_payments/v_4/client.rb', line 204 def delete(patient_payment_id:, request_options: nil) @request_client.conn.delete do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/patient-payments/v4/#{patient_payment_id}" end end |
#get(patient_payment_id:, request_options: nil) ⇒ CandidApiClient::PatientPayments::V4::Types::PatientPayment
Retrieves a previously created patient payment by its ‘patient_payment_id`.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/candidhealth/patient_payments/v_4/client.rb', line 98 def get(patient_payment_id:, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/patient-payments/v4/#{patient_payment_id}" end CandidApiClient::PatientPayments::V4::Types::PatientPayment.from_json(json_object: response.body) end |
#get_multi(limit: nil, patient_external_id: nil, claim_id: nil, service_line_id: nil, billing_provider_id: nil, unattributed: nil, invoice_id: nil, sources: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::PatientPayments::V4::Types::PatientPaymentsPage
Returns all patient payments satisfying the search criteria AND whose
organization_id matches
the current organization_id of the authenticated user.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/candidhealth/patient_payments/v_4/client.rb', line 60 def get_multi(limit: nil, patient_external_id: nil, claim_id: nil, service_line_id: nil, billing_provider_id: nil, unattributed: nil, invoice_id: nil, sources: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "limit": limit, "patient_external_id": patient_external_id, "claim_id": claim_id, "service_line_id": service_line_id, "billing_provider_id": billing_provider_id, "unattributed": unattributed, "invoice_id": invoice_id, "sources": sources, "sort": sort, "sort_direction": sort_direction, "page_token": page_token }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/patient-payments/v4" end CandidApiClient::PatientPayments::V4::Types::PatientPaymentsPage.from_json(json_object: response.body) end |
#update(patient_payment_id:, payment_timestamp: nil, payment_note: nil, invoice: nil, request_options: nil) ⇒ CandidApiClient::PatientPayments::V4::Types::PatientPayment
Updates the patient payment record matching the provided patient_payment_id.
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/candidhealth/patient_payments/v_4/client.rb', line 175 def update(patient_payment_id:, payment_timestamp: nil, payment_note: nil, invoice: nil, request_options: nil) response = @request_client.conn.patch do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(&.additional_body_parameters || {}), payment_timestamp: , payment_note: payment_note, invoice: invoice }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/patient-payments/v4/#{patient_payment_id}" end CandidApiClient::PatientPayments::V4::Types::PatientPayment.from_json(json_object: response.body) end |