candidhealth 0.26.1 → 0.27.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.
- checksums.yaml +4 -4
- data/lib/candidhealth/invoices/types/invoice.rb +169 -0
- data/lib/candidhealth/invoices/types/invoice_item.rb +68 -0
- data/lib/candidhealth/invoices/types/invoice_status.rb +16 -0
- data/lib/candidhealth/service_lines/v_2/client.rb +42 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line.rb +43 -1
- data/lib/candidhealth/service_lines/v_2/types/service_line_era_data.rb +78 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +4 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bfe3619e7a07bdbca9a9dd58eb5decad7a20df7c87b622b1a544215d8362ecc
|
4
|
+
data.tar.gz: 1e47e697d86803e556a636b369b8efd99a611e95fe072853ecb702dc5be8fe36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba0ae49f89efa8e55a71f40deac403a83574479a14bcb1c8d4b8f1d0baee4fb7cdbcdba34803710985e961031ef9d7a8e20dd48be413abba0741d99b2f730403
|
7
|
+
data.tar.gz: 5710f3dea04c0f09d8272fdeba38f59ac3c58770a174ce7912fa8d0ce99e7ddd17166cbe75642791f8dd59818412a2f901659cc0b057eb9b95b055d06a6187d6
|
@@ -0,0 +1,169 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require_relative "invoice_status"
|
5
|
+
require_relative "invoice_item"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module CandidApiClient
|
10
|
+
module Invoices
|
11
|
+
module Types
|
12
|
+
class Invoice
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :id
|
15
|
+
# @return [DateTime]
|
16
|
+
attr_reader :created_at
|
17
|
+
# @return [DateTime]
|
18
|
+
attr_reader :updated_at
|
19
|
+
# @return [String]
|
20
|
+
attr_reader :organzation_id
|
21
|
+
# @return [String]
|
22
|
+
attr_reader :source_id
|
23
|
+
# @return [String]
|
24
|
+
attr_reader :source_customer_id
|
25
|
+
# @return [String]
|
26
|
+
attr_reader :patient_external_id
|
27
|
+
# @return [String]
|
28
|
+
attr_reader :note
|
29
|
+
# @return [String]
|
30
|
+
attr_reader :due_date
|
31
|
+
# @return [CandidApiClient::Invoices::Types::InvoiceStatus]
|
32
|
+
attr_reader :status
|
33
|
+
# @return [String]
|
34
|
+
attr_reader :url
|
35
|
+
# @return [String]
|
36
|
+
attr_reader :customer_invoice_url
|
37
|
+
# @return [Array<CandidApiClient::Invoices::Types::InvoiceItem>]
|
38
|
+
attr_reader :items
|
39
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
40
|
+
attr_reader :additional_properties
|
41
|
+
# @return [Object]
|
42
|
+
attr_reader :_field_set
|
43
|
+
protected :_field_set
|
44
|
+
|
45
|
+
OMIT = Object.new
|
46
|
+
|
47
|
+
# @param id [String]
|
48
|
+
# @param created_at [DateTime]
|
49
|
+
# @param updated_at [DateTime]
|
50
|
+
# @param organzation_id [String]
|
51
|
+
# @param source_id [String]
|
52
|
+
# @param source_customer_id [String]
|
53
|
+
# @param patient_external_id [String]
|
54
|
+
# @param note [String]
|
55
|
+
# @param due_date [String]
|
56
|
+
# @param status [CandidApiClient::Invoices::Types::InvoiceStatus]
|
57
|
+
# @param url [String]
|
58
|
+
# @param customer_invoice_url [String]
|
59
|
+
# @param items [Array<CandidApiClient::Invoices::Types::InvoiceItem>]
|
60
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
61
|
+
# @return [CandidApiClient::Invoices::Types::Invoice]
|
62
|
+
def initialize(id:, created_at:, updated_at:, organzation_id:, source_id:, source_customer_id:,
|
63
|
+
patient_external_id:, due_date:, status:, items:, note: OMIT, url: OMIT, customer_invoice_url: OMIT, additional_properties: nil)
|
64
|
+
@id = id
|
65
|
+
@created_at = created_at
|
66
|
+
@updated_at = updated_at
|
67
|
+
@organzation_id = organzation_id
|
68
|
+
@source_id = source_id
|
69
|
+
@source_customer_id = source_customer_id
|
70
|
+
@patient_external_id = patient_external_id
|
71
|
+
@note = note if note != OMIT
|
72
|
+
@due_date = due_date
|
73
|
+
@status = status
|
74
|
+
@url = url if url != OMIT
|
75
|
+
@customer_invoice_url = customer_invoice_url if customer_invoice_url != OMIT
|
76
|
+
@items = items
|
77
|
+
@additional_properties = additional_properties
|
78
|
+
@_field_set = {
|
79
|
+
"id": id,
|
80
|
+
"created_at": created_at,
|
81
|
+
"updated_at": updated_at,
|
82
|
+
"organzation_id": organzation_id,
|
83
|
+
"source_id": source_id,
|
84
|
+
"source_customer_id": source_customer_id,
|
85
|
+
"patient_external_id": patient_external_id,
|
86
|
+
"note": note,
|
87
|
+
"due_date": due_date,
|
88
|
+
"status": status,
|
89
|
+
"url": url,
|
90
|
+
"customer_invoice_url": customer_invoice_url,
|
91
|
+
"items": items
|
92
|
+
}.reject do |_k, v|
|
93
|
+
v == OMIT
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Deserialize a JSON object to an instance of Invoice
|
98
|
+
#
|
99
|
+
# @param json_object [String]
|
100
|
+
# @return [CandidApiClient::Invoices::Types::Invoice]
|
101
|
+
def self.from_json(json_object:)
|
102
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
103
|
+
parsed_json = JSON.parse(json_object)
|
104
|
+
id = struct["id"]
|
105
|
+
created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
|
106
|
+
updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
|
107
|
+
organzation_id = struct["organzation_id"]
|
108
|
+
source_id = struct["source_id"]
|
109
|
+
source_customer_id = struct["source_customer_id"]
|
110
|
+
patient_external_id = struct["patient_external_id"]
|
111
|
+
note = struct["note"]
|
112
|
+
due_date = struct["due_date"]
|
113
|
+
status = struct["status"]
|
114
|
+
url = struct["url"]
|
115
|
+
customer_invoice_url = struct["customer_invoice_url"]
|
116
|
+
items = parsed_json["items"]&.map do |item|
|
117
|
+
item = item.to_json
|
118
|
+
CandidApiClient::Invoices::Types::InvoiceItem.from_json(json_object: item)
|
119
|
+
end
|
120
|
+
new(
|
121
|
+
id: id,
|
122
|
+
created_at: created_at,
|
123
|
+
updated_at: updated_at,
|
124
|
+
organzation_id: organzation_id,
|
125
|
+
source_id: source_id,
|
126
|
+
source_customer_id: source_customer_id,
|
127
|
+
patient_external_id: patient_external_id,
|
128
|
+
note: note,
|
129
|
+
due_date: due_date,
|
130
|
+
status: status,
|
131
|
+
url: url,
|
132
|
+
customer_invoice_url: customer_invoice_url,
|
133
|
+
items: items,
|
134
|
+
additional_properties: struct
|
135
|
+
)
|
136
|
+
end
|
137
|
+
|
138
|
+
# Serialize an instance of Invoice to a JSON object
|
139
|
+
#
|
140
|
+
# @return [String]
|
141
|
+
def to_json(*_args)
|
142
|
+
@_field_set&.to_json
|
143
|
+
end
|
144
|
+
|
145
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
146
|
+
# hash and check each fields type against the current object's property
|
147
|
+
# definitions.
|
148
|
+
#
|
149
|
+
# @param obj [Object]
|
150
|
+
# @return [Void]
|
151
|
+
def self.validate_raw(obj:)
|
152
|
+
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
153
|
+
obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
154
|
+
obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
155
|
+
obj.organzation_id.is_a?(String) != false || raise("Passed value for field obj.organzation_id is not the expected type, validation failed.")
|
156
|
+
obj.source_id.is_a?(String) != false || raise("Passed value for field obj.source_id is not the expected type, validation failed.")
|
157
|
+
obj.source_customer_id.is_a?(String) != false || raise("Passed value for field obj.source_customer_id is not the expected type, validation failed.")
|
158
|
+
obj.patient_external_id.is_a?(String) != false || raise("Passed value for field obj.patient_external_id is not the expected type, validation failed.")
|
159
|
+
obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.")
|
160
|
+
obj.due_date.is_a?(String) != false || raise("Passed value for field obj.due_date is not the expected type, validation failed.")
|
161
|
+
obj.status.is_a?(CandidApiClient::Invoices::Types::InvoiceStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
162
|
+
obj.url&.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
|
163
|
+
obj.customer_invoice_url&.is_a?(String) != false || raise("Passed value for field obj.customer_invoice_url is not the expected type, validation failed.")
|
164
|
+
obj.items.is_a?(Array) != false || raise("Passed value for field obj.items is not the expected type, validation failed.")
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Invoices
|
8
|
+
module Types
|
9
|
+
class InvoiceItem
|
10
|
+
# @return [String]
|
11
|
+
attr_reader :service_line_id
|
12
|
+
# @return [Integer]
|
13
|
+
attr_reader :amount_cents
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param service_line_id [String]
|
23
|
+
# @param amount_cents [Integer]
|
24
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
# @return [CandidApiClient::Invoices::Types::InvoiceItem]
|
26
|
+
def initialize(service_line_id:, amount_cents:, additional_properties: nil)
|
27
|
+
@service_line_id = service_line_id
|
28
|
+
@amount_cents = amount_cents
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "service_line_id": service_line_id, "amount_cents": amount_cents }
|
31
|
+
end
|
32
|
+
|
33
|
+
# Deserialize a JSON object to an instance of InvoiceItem
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [CandidApiClient::Invoices::Types::InvoiceItem]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
service_line_id = struct["service_line_id"]
|
40
|
+
amount_cents = struct["amount_cents"]
|
41
|
+
new(
|
42
|
+
service_line_id: service_line_id,
|
43
|
+
amount_cents: amount_cents,
|
44
|
+
additional_properties: struct
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Serialize an instance of InvoiceItem to a JSON object
|
49
|
+
#
|
50
|
+
# @return [String]
|
51
|
+
def to_json(*_args)
|
52
|
+
@_field_set&.to_json
|
53
|
+
end
|
54
|
+
|
55
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
56
|
+
# hash and check each fields type against the current object's property
|
57
|
+
# definitions.
|
58
|
+
#
|
59
|
+
# @param obj [Object]
|
60
|
+
# @return [Void]
|
61
|
+
def self.validate_raw(obj:)
|
62
|
+
obj.service_line_id.is_a?(String) != false || raise("Passed value for field obj.service_line_id is not the expected type, validation failed.")
|
63
|
+
obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CandidApiClient
|
4
|
+
module Invoices
|
5
|
+
module Types
|
6
|
+
class InvoiceStatus
|
7
|
+
DRAFT = "draft"
|
8
|
+
OPEN = "open"
|
9
|
+
PAID = "paid"
|
10
|
+
VOID = "void"
|
11
|
+
UNCOLLECTIBLE = "uncollectible"
|
12
|
+
HELD = "held"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -95,6 +95,26 @@ module CandidApiClient
|
|
95
95
|
end
|
96
96
|
CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
|
97
97
|
end
|
98
|
+
|
99
|
+
# @param service_line_id [String]
|
100
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
101
|
+
# @return [Void]
|
102
|
+
# @example
|
103
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
104
|
+
# api.service_lines.v_2.delete(service_line_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
105
|
+
def delete(service_line_id:, request_options: nil)
|
106
|
+
@request_client.conn.delete do |req|
|
107
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
108
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
109
|
+
req.headers = {
|
110
|
+
**(req.headers || {}),
|
111
|
+
**@request_client.get_headers,
|
112
|
+
**(request_options&.additional_headers || {})
|
113
|
+
}.compact
|
114
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
115
|
+
request_options: request_options)}/api/service-lines/v2/#{service_line_id}"
|
116
|
+
end
|
117
|
+
end
|
98
118
|
end
|
99
119
|
|
100
120
|
class AsyncV2Client
|
@@ -187,6 +207,28 @@ module CandidApiClient
|
|
187
207
|
CandidApiClient::ServiceLines::V2::Types::ServiceLine.from_json(json_object: response.body)
|
188
208
|
end
|
189
209
|
end
|
210
|
+
|
211
|
+
# @param service_line_id [String]
|
212
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
213
|
+
# @return [Void]
|
214
|
+
# @example
|
215
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
216
|
+
# api.service_lines.v_2.delete(service_line_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
217
|
+
def delete(service_line_id:, request_options: nil)
|
218
|
+
Async do
|
219
|
+
@request_client.conn.delete do |req|
|
220
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
221
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
222
|
+
req.headers = {
|
223
|
+
**(req.headers || {}),
|
224
|
+
**@request_client.get_headers,
|
225
|
+
**(request_options&.additional_headers || {})
|
226
|
+
}.compact
|
227
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
228
|
+
request_options: request_options)}/api/service-lines/v2/#{service_line_id}"
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
190
232
|
end
|
191
233
|
end
|
192
234
|
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../../../commons/types/procedure_modifier"
|
4
|
+
require_relative "service_line_era_data"
|
4
5
|
require_relative "service_line_adjustment"
|
6
|
+
require_relative "../../../invoices/types/invoice"
|
5
7
|
require_relative "../../../invoices/v_2/types/invoice_info"
|
6
8
|
require_relative "service_line_denial_reason"
|
7
9
|
require_relative "../../../commons/types/facility_type_code"
|
@@ -24,6 +26,10 @@ module CandidApiClient
|
|
24
26
|
# @return [Integer]
|
25
27
|
attr_reader :allowed_amount_cents
|
26
28
|
# @return [Integer]
|
29
|
+
attr_reader :insurance_balance_cents
|
30
|
+
# @return [Integer]
|
31
|
+
attr_reader :patient_balance_cents
|
32
|
+
# @return [Integer]
|
27
33
|
attr_reader :paid_amount_cents
|
28
34
|
# @return [Integer]
|
29
35
|
attr_reader :primary_paid_amount_cents
|
@@ -41,8 +47,12 @@ module CandidApiClient
|
|
41
47
|
attr_reader :diagnosis_id_two
|
42
48
|
# @return [String]
|
43
49
|
attr_reader :diagnosis_id_three
|
50
|
+
# @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData]
|
51
|
+
attr_reader :service_line_era_data
|
44
52
|
# @return [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
|
45
53
|
attr_reader :service_line_manual_adjustments
|
54
|
+
# @return [Array<CandidApiClient::Invoices::Types::Invoice>]
|
55
|
+
attr_reader :related_invoices
|
46
56
|
# @return [Array<CandidApiClient::Invoices::V2::Types::InvoiceInfo>]
|
47
57
|
attr_reader :related_invoice_info
|
48
58
|
# @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
|
@@ -93,6 +103,8 @@ module CandidApiClient
|
|
93
103
|
# @param modifiers [Array<CandidApiClient::Commons::Types::ProcedureModifier>]
|
94
104
|
# @param charge_amount_cents [Integer]
|
95
105
|
# @param allowed_amount_cents [Integer]
|
106
|
+
# @param insurance_balance_cents [Integer]
|
107
|
+
# @param patient_balance_cents [Integer]
|
96
108
|
# @param paid_amount_cents [Integer]
|
97
109
|
# @param primary_paid_amount_cents [Integer]
|
98
110
|
# @param secondary_paid_amount_cents [Integer]
|
@@ -102,7 +114,9 @@ module CandidApiClient
|
|
102
114
|
# @param diagnosis_id_one [String]
|
103
115
|
# @param diagnosis_id_two [String]
|
104
116
|
# @param diagnosis_id_three [String]
|
117
|
+
# @param service_line_era_data [CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData]
|
105
118
|
# @param service_line_manual_adjustments [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
|
119
|
+
# @param related_invoices [Array<CandidApiClient::Invoices::Types::Invoice>]
|
106
120
|
# @param related_invoice_info [Array<CandidApiClient::Invoices::V2::Types::InvoiceInfo>]
|
107
121
|
# @param denial_reason [CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason]
|
108
122
|
# @param place_of_service_code [CandidApiClient::Commons::Types::FacilityTypeCode]
|
@@ -128,10 +142,12 @@ module CandidApiClient
|
|
128
142
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
129
143
|
# @return [CandidApiClient::ServiceLines::V2::Types::ServiceLine]
|
130
144
|
def initialize(service_line_id:, procedure_code:, quantity:, units:, claim_id:, date_of_service_range:, date_of_service:, modifiers: OMIT, charge_amount_cents: OMIT, allowed_amount_cents: OMIT,
|
131
|
-
paid_amount_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, related_invoice_info: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, referring_provider: OMIT, initial_referring_provider: OMIT, supervising_provider: OMIT, ordering_provider: OMIT, description: OMIT, end_date_of_service: OMIT, additional_properties: nil)
|
145
|
+
insurance_balance_cents: OMIT, patient_balance_cents: OMIT, paid_amount_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_era_data: OMIT, service_line_manual_adjustments: OMIT, related_invoices: OMIT, related_invoice_info: OMIT, denial_reason: OMIT, place_of_service_code: OMIT, place_of_service_code_as_submitted: OMIT, referring_provider: OMIT, initial_referring_provider: OMIT, supervising_provider: OMIT, ordering_provider: OMIT, description: OMIT, end_date_of_service: OMIT, additional_properties: nil)
|
132
146
|
@modifiers = modifiers if modifiers != OMIT
|
133
147
|
@charge_amount_cents = charge_amount_cents if charge_amount_cents != OMIT
|
134
148
|
@allowed_amount_cents = allowed_amount_cents if allowed_amount_cents != OMIT
|
149
|
+
@insurance_balance_cents = insurance_balance_cents if insurance_balance_cents != OMIT
|
150
|
+
@patient_balance_cents = patient_balance_cents if patient_balance_cents != OMIT
|
135
151
|
@paid_amount_cents = paid_amount_cents if paid_amount_cents != OMIT
|
136
152
|
@primary_paid_amount_cents = primary_paid_amount_cents if primary_paid_amount_cents != OMIT
|
137
153
|
@secondary_paid_amount_cents = secondary_paid_amount_cents if secondary_paid_amount_cents != OMIT
|
@@ -141,9 +157,11 @@ module CandidApiClient
|
|
141
157
|
@diagnosis_id_one = diagnosis_id_one if diagnosis_id_one != OMIT
|
142
158
|
@diagnosis_id_two = diagnosis_id_two if diagnosis_id_two != OMIT
|
143
159
|
@diagnosis_id_three = diagnosis_id_three if diagnosis_id_three != OMIT
|
160
|
+
@service_line_era_data = service_line_era_data if service_line_era_data != OMIT
|
144
161
|
if service_line_manual_adjustments != OMIT
|
145
162
|
@service_line_manual_adjustments = service_line_manual_adjustments
|
146
163
|
end
|
164
|
+
@related_invoices = related_invoices if related_invoices != OMIT
|
147
165
|
@related_invoice_info = related_invoice_info if related_invoice_info != OMIT
|
148
166
|
@denial_reason = denial_reason if denial_reason != OMIT
|
149
167
|
@place_of_service_code = place_of_service_code if place_of_service_code != OMIT
|
@@ -168,6 +186,8 @@ module CandidApiClient
|
|
168
186
|
"modifiers": modifiers,
|
169
187
|
"charge_amount_cents": charge_amount_cents,
|
170
188
|
"allowed_amount_cents": allowed_amount_cents,
|
189
|
+
"insurance_balance_cents": insurance_balance_cents,
|
190
|
+
"patient_balance_cents": patient_balance_cents,
|
171
191
|
"paid_amount_cents": paid_amount_cents,
|
172
192
|
"primary_paid_amount_cents": primary_paid_amount_cents,
|
173
193
|
"secondary_paid_amount_cents": secondary_paid_amount_cents,
|
@@ -177,7 +197,9 @@ module CandidApiClient
|
|
177
197
|
"diagnosis_id_one": diagnosis_id_one,
|
178
198
|
"diagnosis_id_two": diagnosis_id_two,
|
179
199
|
"diagnosis_id_three": diagnosis_id_three,
|
200
|
+
"service_line_era_data": service_line_era_data,
|
180
201
|
"service_line_manual_adjustments": service_line_manual_adjustments,
|
202
|
+
"related_invoices": related_invoices,
|
181
203
|
"related_invoice_info": related_invoice_info,
|
182
204
|
"denial_reason": denial_reason,
|
183
205
|
"place_of_service_code": place_of_service_code,
|
@@ -210,6 +232,8 @@ module CandidApiClient
|
|
210
232
|
modifiers = struct["modifiers"]
|
211
233
|
charge_amount_cents = struct["charge_amount_cents"]
|
212
234
|
allowed_amount_cents = struct["allowed_amount_cents"]
|
235
|
+
insurance_balance_cents = struct["insurance_balance_cents"]
|
236
|
+
patient_balance_cents = struct["patient_balance_cents"]
|
213
237
|
paid_amount_cents = struct["paid_amount_cents"]
|
214
238
|
primary_paid_amount_cents = struct["primary_paid_amount_cents"]
|
215
239
|
secondary_paid_amount_cents = struct["secondary_paid_amount_cents"]
|
@@ -219,10 +243,20 @@ module CandidApiClient
|
|
219
243
|
diagnosis_id_one = struct["diagnosis_id_one"]
|
220
244
|
diagnosis_id_two = struct["diagnosis_id_two"]
|
221
245
|
diagnosis_id_three = struct["diagnosis_id_three"]
|
246
|
+
if parsed_json["service_line_era_data"].nil?
|
247
|
+
service_line_era_data = nil
|
248
|
+
else
|
249
|
+
service_line_era_data = parsed_json["service_line_era_data"].to_json
|
250
|
+
service_line_era_data = CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData.from_json(json_object: service_line_era_data)
|
251
|
+
end
|
222
252
|
service_line_manual_adjustments = parsed_json["service_line_manual_adjustments"]&.map do |item|
|
223
253
|
item = item.to_json
|
224
254
|
CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment.from_json(json_object: item)
|
225
255
|
end
|
256
|
+
related_invoices = parsed_json["related_invoices"]&.map do |item|
|
257
|
+
item = item.to_json
|
258
|
+
CandidApiClient::Invoices::Types::Invoice.from_json(json_object: item)
|
259
|
+
end
|
226
260
|
related_invoice_info = parsed_json["related_invoice_info"]&.map do |item|
|
227
261
|
item = item.to_json
|
228
262
|
CandidApiClient::Invoices::V2::Types::InvoiceInfo.from_json(json_object: item)
|
@@ -279,6 +313,8 @@ module CandidApiClient
|
|
279
313
|
modifiers: modifiers,
|
280
314
|
charge_amount_cents: charge_amount_cents,
|
281
315
|
allowed_amount_cents: allowed_amount_cents,
|
316
|
+
insurance_balance_cents: insurance_balance_cents,
|
317
|
+
patient_balance_cents: patient_balance_cents,
|
282
318
|
paid_amount_cents: paid_amount_cents,
|
283
319
|
primary_paid_amount_cents: primary_paid_amount_cents,
|
284
320
|
secondary_paid_amount_cents: secondary_paid_amount_cents,
|
@@ -288,7 +324,9 @@ module CandidApiClient
|
|
288
324
|
diagnosis_id_one: diagnosis_id_one,
|
289
325
|
diagnosis_id_two: diagnosis_id_two,
|
290
326
|
diagnosis_id_three: diagnosis_id_three,
|
327
|
+
service_line_era_data: service_line_era_data,
|
291
328
|
service_line_manual_adjustments: service_line_manual_adjustments,
|
329
|
+
related_invoices: related_invoices,
|
292
330
|
related_invoice_info: related_invoice_info,
|
293
331
|
denial_reason: denial_reason,
|
294
332
|
place_of_service_code: place_of_service_code,
|
@@ -327,6 +365,8 @@ module CandidApiClient
|
|
327
365
|
obj.modifiers&.is_a?(Array) != false || raise("Passed value for field obj.modifiers is not the expected type, validation failed.")
|
328
366
|
obj.charge_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.charge_amount_cents is not the expected type, validation failed.")
|
329
367
|
obj.allowed_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.allowed_amount_cents is not the expected type, validation failed.")
|
368
|
+
obj.insurance_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.insurance_balance_cents is not the expected type, validation failed.")
|
369
|
+
obj.patient_balance_cents&.is_a?(Integer) != false || raise("Passed value for field obj.patient_balance_cents is not the expected type, validation failed.")
|
330
370
|
obj.paid_amount_cents&.is_a?(Integer) != false || raise("Passed value for field obj.paid_amount_cents is not the expected type, validation failed.")
|
331
371
|
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.")
|
332
372
|
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.")
|
@@ -336,7 +376,9 @@ module CandidApiClient
|
|
336
376
|
obj.diagnosis_id_one&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_one is not the expected type, validation failed.")
|
337
377
|
obj.diagnosis_id_two&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_two is not the expected type, validation failed.")
|
338
378
|
obj.diagnosis_id_three&.is_a?(String) != false || raise("Passed value for field obj.diagnosis_id_three is not the expected type, validation failed.")
|
379
|
+
obj.service_line_era_data.nil? || CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData.validate_raw(obj: obj.service_line_era_data)
|
339
380
|
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.")
|
381
|
+
obj.related_invoices&.is_a?(Array) != false || raise("Passed value for field obj.related_invoices is not the expected type, validation failed.")
|
340
382
|
obj.related_invoice_info&.is_a?(Array) != false || raise("Passed value for field obj.related_invoice_info is not the expected type, validation failed.")
|
341
383
|
obj.denial_reason.nil? || CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason.validate_raw(obj: obj.denial_reason)
|
342
384
|
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.")
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "service_line_adjustment"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module ServiceLines
|
9
|
+
module V2
|
10
|
+
module Types
|
11
|
+
class ServiceLineEraData
|
12
|
+
# @return [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
|
13
|
+
attr_reader :service_line_adjustments
|
14
|
+
# @return [Array<String>]
|
15
|
+
attr_reader :remittance_advice_remark_codes
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param service_line_adjustments [Array<CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment>]
|
25
|
+
# @param remittance_advice_remark_codes [Array<String>]
|
26
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
27
|
+
# @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData]
|
28
|
+
def initialize(service_line_adjustments:, remittance_advice_remark_codes:, additional_properties: nil)
|
29
|
+
@service_line_adjustments = service_line_adjustments
|
30
|
+
@remittance_advice_remark_codes = remittance_advice_remark_codes
|
31
|
+
@additional_properties = additional_properties
|
32
|
+
@_field_set = {
|
33
|
+
"service_line_adjustments": service_line_adjustments,
|
34
|
+
"remittance_advice_remark_codes": remittance_advice_remark_codes
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Deserialize a JSON object to an instance of ServiceLineEraData
|
39
|
+
#
|
40
|
+
# @param json_object [String]
|
41
|
+
# @return [CandidApiClient::ServiceLines::V2::Types::ServiceLineEraData]
|
42
|
+
def self.from_json(json_object:)
|
43
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
44
|
+
parsed_json = JSON.parse(json_object)
|
45
|
+
service_line_adjustments = parsed_json["service_line_adjustments"]&.map do |item|
|
46
|
+
item = item.to_json
|
47
|
+
CandidApiClient::ServiceLines::V2::Types::ServiceLineAdjustment.from_json(json_object: item)
|
48
|
+
end
|
49
|
+
remittance_advice_remark_codes = struct["remittance_advice_remark_codes"]
|
50
|
+
new(
|
51
|
+
service_line_adjustments: service_line_adjustments,
|
52
|
+
remittance_advice_remark_codes: remittance_advice_remark_codes,
|
53
|
+
additional_properties: struct
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Serialize an instance of ServiceLineEraData to a JSON object
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
def to_json(*_args)
|
61
|
+
@_field_set&.to_json
|
62
|
+
end
|
63
|
+
|
64
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
65
|
+
# hash and check each fields type against the current object's property
|
66
|
+
# definitions.
|
67
|
+
#
|
68
|
+
# @param obj [Object]
|
69
|
+
# @return [Void]
|
70
|
+
def self.validate_raw(obj:)
|
71
|
+
obj.service_line_adjustments.is_a?(Array) != false || raise("Passed value for field obj.service_line_adjustments is not the expected type, validation failed.")
|
72
|
+
obj.remittance_advice_remark_codes.is_a?(Array) != false || raise("Passed value for field obj.remittance_advice_remark_codes is not the expected type, validation failed.")
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
data/lib/requests.rb
CHANGED
@@ -43,7 +43,7 @@ module CandidApiClient
|
|
43
43
|
|
44
44
|
# @return [Hash{String => String}]
|
45
45
|
def get_headers
|
46
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.
|
46
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.27.0" }
|
47
47
|
headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless token.nil?
|
48
48
|
headers
|
49
49
|
end
|
@@ -87,7 +87,7 @@ module CandidApiClient
|
|
87
87
|
|
88
88
|
# @return [Hash{String => String}]
|
89
89
|
def get_headers
|
90
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.
|
90
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.27.0" }
|
91
91
|
headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless token.nil?
|
92
92
|
headers
|
93
93
|
end
|
data/lib/types_export.rb
CHANGED
@@ -201,6 +201,7 @@ require_relative "candidhealth/service_lines/v_2/types/service_line_create"
|
|
201
201
|
require_relative "candidhealth/service_lines/v_2/types/service_line_create_standalone"
|
202
202
|
require_relative "candidhealth/service_lines/v_2/types/service_line_update"
|
203
203
|
require_relative "candidhealth/service_lines/v_2/types/service_line"
|
204
|
+
require_relative "candidhealth/service_lines/v_2/types/service_line_era_data"
|
204
205
|
require_relative "candidhealth/service_lines/v_2/types/service_line_adjustment"
|
205
206
|
require_relative "candidhealth/service_lines/v_2/types/service_line_denial_reason"
|
206
207
|
require_relative "candidhealth/service_lines/v_2/types/denial_reason_content"
|
@@ -340,6 +341,9 @@ require_relative "candidhealth/individual/types/patient_create"
|
|
340
341
|
require_relative "candidhealth/individual/types/patient_base"
|
341
342
|
require_relative "candidhealth/individual/types/patient"
|
342
343
|
require_relative "candidhealth/individual/types/gender"
|
344
|
+
require_relative "candidhealth/invoices/types/invoice"
|
345
|
+
require_relative "candidhealth/invoices/types/invoice_item"
|
346
|
+
require_relative "candidhealth/invoices/types/invoice_status"
|
343
347
|
require_relative "candidhealth/service_facility/types/encounter_service_facility_base"
|
344
348
|
require_relative "candidhealth/service_facility/types/encounter_service_facility"
|
345
349
|
require_relative "candidhealth/tags/types/tag_create"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: candidhealth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -352,6 +352,9 @@ files:
|
|
352
352
|
- lib/candidhealth/insurance_refunds/v_1/types/insurance_refund_create.rb
|
353
353
|
- lib/candidhealth/insurance_refunds/v_1/types/insurance_refund_sort_field.rb
|
354
354
|
- lib/candidhealth/insurance_refunds/v_1/types/insurance_refunds_page.rb
|
355
|
+
- lib/candidhealth/invoices/types/invoice.rb
|
356
|
+
- lib/candidhealth/invoices/types/invoice_item.rb
|
357
|
+
- lib/candidhealth/invoices/types/invoice_status.rb
|
355
358
|
- lib/candidhealth/invoices/v_2/types/claim_invoice_item.rb
|
356
359
|
- lib/candidhealth/invoices/v_2/types/claim_invoice_item_info.rb
|
357
360
|
- lib/candidhealth/invoices/v_2/types/invoice.rb
|
@@ -462,6 +465,7 @@ files:
|
|
462
465
|
- lib/candidhealth/service_lines/v_2/types/service_line_create.rb
|
463
466
|
- lib/candidhealth/service_lines/v_2/types/service_line_create_standalone.rb
|
464
467
|
- lib/candidhealth/service_lines/v_2/types/service_line_denial_reason.rb
|
468
|
+
- lib/candidhealth/service_lines/v_2/types/service_line_era_data.rb
|
465
469
|
- lib/candidhealth/service_lines/v_2/types/service_line_update.rb
|
466
470
|
- lib/candidhealth/tags/types/tag.rb
|
467
471
|
- lib/candidhealth/tags/types/tag_color_enum.rb
|