candidhealth 0.18.2 → 0.19.1.pre.6de2b0d
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/auth/v_2/client.rb +16 -11
- data/lib/candidhealth/claims/types/claim.rb +11 -5
- data/lib/candidhealth/eligibility/v_2/client.rb +58 -0
- data/lib/candidhealth/financials/types/allocation_target_create.rb +13 -0
- data/lib/candidhealth/invoices/v_2/types/claim_invoice_item.rb +55 -0
- data/lib/candidhealth/invoices/v_2/types/claim_invoice_item_info.rb +67 -0
- data/lib/candidhealth/invoices/v_2/types/invoice.rb +136 -0
- data/lib/candidhealth/invoices/v_2/types/invoice_destination.rb +14 -0
- data/lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb +72 -0
- data/lib/candidhealth/invoices/v_2/types/invoice_info.rb +67 -0
- data/lib/candidhealth/invoices/v_2/types/invoice_item_info.rb +62 -0
- data/lib/candidhealth/invoices/v_2/types/invoice_status.rb +16 -0
- data/lib/candidhealth/invoices/v_2/types/service_line_invoice_item.rb +55 -0
- data/lib/candidhealth/invoices/v_2/types/unattributed_invoice_item.rb +49 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line.rb +13 -3
- data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_reason.rb +1 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +10 -1
- metadata +14 -5
- data/lib/candidhealth/auth/v_2/types/auth_get_token_request.rb +0 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 793252ca4daa7586c13132c62e5c8358ba764bccd9c7f0c58119abacf116bfa7
|
4
|
+
data.tar.gz: 90ad15dad0a9f420ffbb36d422e9448f15c2df6702c2b0b0ac19339225ced3d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f67737e90de29e05858644ed7ffb54663d6dbb23dac2dcab896c3b6c9b31db00387616d006209dce5aa4dea924d72fac4859bb15468b3b840b51000708c2e7f8
|
7
|
+
data.tar.gz: f64c9440c49927a37caddf29cd567184c6ed92a806500300545680eecba0059fec8b59045ba215196b106851e6b946a885bb674b7d9dc4b382632979a0e61205
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "../../../requests"
|
4
|
-
require_relative "types/auth_get_token_request"
|
5
4
|
require_relative "types/auth_get_token_response"
|
6
5
|
require "async"
|
7
6
|
|
@@ -30,17 +29,20 @@ module CandidApiClient
|
|
30
29
|
# The bearer token expires 5 hours after it has been created. After it has expired, the client will receive an "HTTP 401
|
31
30
|
# Unauthorized" error, at which point the client should generate a new token. It is important that tokens be reused between requests; if the client attempts to generate a token too often, it will be rate-limited and will receive an "HTTP 429 Too Many Requests" error.
|
32
31
|
#
|
33
|
-
# @param
|
34
|
-
#
|
35
|
-
# * :client_secret (String)
|
32
|
+
# @param client_id [String] Your application's Client ID.
|
33
|
+
# @param client_secret [String] Your application's Client Secret.
|
36
34
|
# @param request_options [RequestOptions]
|
37
35
|
# @return [Auth::V2::AuthGetTokenResponse]
|
38
|
-
def get_token(
|
36
|
+
def get_token(client_id:, client_secret:, request_options: nil)
|
39
37
|
response = @request_client.conn.post("/api/auth/v2/token") do |req|
|
40
38
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
41
39
|
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
42
40
|
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
43
|
-
req.body = {
|
41
|
+
req.body = {
|
42
|
+
**(request_options&.additional_body_parameters || {}),
|
43
|
+
client_id: client_id,
|
44
|
+
client_secret: client_secret
|
45
|
+
}.compact
|
44
46
|
end
|
45
47
|
Auth::V2::AuthGetTokenResponse.from_json(json_object: response.body)
|
46
48
|
end
|
@@ -68,18 +70,21 @@ module CandidApiClient
|
|
68
70
|
# The bearer token expires 5 hours after it has been created. After it has expired, the client will receive an "HTTP 401
|
69
71
|
# Unauthorized" error, at which point the client should generate a new token. It is important that tokens be reused between requests; if the client attempts to generate a token too often, it will be rate-limited and will receive an "HTTP 429 Too Many Requests" error.
|
70
72
|
#
|
71
|
-
# @param
|
72
|
-
#
|
73
|
-
# * :client_secret (String)
|
73
|
+
# @param client_id [String] Your application's Client ID.
|
74
|
+
# @param client_secret [String] Your application's Client Secret.
|
74
75
|
# @param request_options [RequestOptions]
|
75
76
|
# @return [Auth::V2::AuthGetTokenResponse]
|
76
|
-
def get_token(
|
77
|
+
def get_token(client_id:, client_secret:, request_options: nil)
|
77
78
|
Async do
|
78
79
|
response = @request_client.conn.post("/api/auth/v2/token") do |req|
|
79
80
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
80
81
|
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
81
82
|
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
82
|
-
req.body = {
|
83
|
+
req.body = {
|
84
|
+
**(request_options&.additional_body_parameters || {}),
|
85
|
+
client_id: client_id,
|
86
|
+
client_secret: client_secret
|
87
|
+
}.compact
|
83
88
|
end
|
84
89
|
Auth::V2::AuthGetTokenResponse.from_json(json_object: response.body)
|
85
90
|
end
|
@@ -9,20 +9,21 @@ require "json"
|
|
9
9
|
module CandidApiClient
|
10
10
|
class Claims
|
11
11
|
class Claim
|
12
|
-
attr_reader :claim_id, :status, :clearinghouse, :clearinghouse_claim_id, :payer_claim_id, :
|
13
|
-
:additional_properties
|
12
|
+
attr_reader :claim_id, :status, :clearinghouse, :clearinghouse_claim_id, :payer_claim_id, :clia_number,
|
13
|
+
:service_lines, :eras, :additional_properties
|
14
14
|
|
15
15
|
# @param claim_id [Commons::CLAIM_ID]
|
16
16
|
# @param status [Claims::ClaimStatus]
|
17
17
|
# @param clearinghouse [String]
|
18
18
|
# @param clearinghouse_claim_id [String]
|
19
19
|
# @param payer_claim_id [String]
|
20
|
+
# @param clia_number [String]
|
20
21
|
# @param service_lines [Array<ServiceLines::V2::ServiceLine>]
|
21
22
|
# @param eras [Array<Era::Era>]
|
22
23
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
24
|
# @return [Claims::Claim]
|
24
|
-
def initialize(claim_id:, status:, service_lines:, eras:, clearinghouse: nil, clearinghouse_claim_id: nil,
|
25
|
-
|
25
|
+
def initialize(claim_id:, status:, service_lines:, eras:, clearinghouse: nil, clearinghouse_claim_id: nil, payer_claim_id: nil,
|
26
|
+
clia_number: nil, additional_properties: nil)
|
26
27
|
# @type [Commons::CLAIM_ID]
|
27
28
|
@claim_id = claim_id
|
28
29
|
# @type [Claims::ClaimStatus]
|
@@ -33,6 +34,8 @@ module CandidApiClient
|
|
33
34
|
@clearinghouse_claim_id = clearinghouse_claim_id
|
34
35
|
# @type [String]
|
35
36
|
@payer_claim_id = payer_claim_id
|
37
|
+
# @type [String]
|
38
|
+
@clia_number = clia_number
|
36
39
|
# @type [Array<ServiceLines::V2::ServiceLine>]
|
37
40
|
@service_lines = service_lines
|
38
41
|
# @type [Array<Era::Era>]
|
@@ -53,6 +56,7 @@ module CandidApiClient
|
|
53
56
|
clearinghouse = struct.clearinghouse
|
54
57
|
clearinghouse_claim_id = struct.clearinghouse_claim_id
|
55
58
|
payer_claim_id = struct.payer_claim_id
|
59
|
+
clia_number = struct.clia_number
|
56
60
|
service_lines = parsed_json["service_lines"]&.map do |v|
|
57
61
|
v = v.to_json
|
58
62
|
ServiceLines::V2::ServiceLine.from_json(json_object: v)
|
@@ -62,7 +66,7 @@ module CandidApiClient
|
|
62
66
|
Era::Era.from_json(json_object: v)
|
63
67
|
end
|
64
68
|
new(claim_id: claim_id, status: status, clearinghouse: clearinghouse,
|
65
|
-
clearinghouse_claim_id: clearinghouse_claim_id, payer_claim_id: payer_claim_id, service_lines: service_lines, eras: eras, additional_properties: struct)
|
69
|
+
clearinghouse_claim_id: clearinghouse_claim_id, payer_claim_id: payer_claim_id, clia_number: clia_number, service_lines: service_lines, eras: eras, additional_properties: struct)
|
66
70
|
end
|
67
71
|
|
68
72
|
# Serialize an instance of Claim to a JSON object
|
@@ -75,6 +79,7 @@ module CandidApiClient
|
|
75
79
|
"clearinghouse": @clearinghouse,
|
76
80
|
"clearinghouse_claim_id": @clearinghouse_claim_id,
|
77
81
|
"payer_claim_id": @payer_claim_id,
|
82
|
+
"clia_number": @clia_number,
|
78
83
|
"service_lines": @service_lines,
|
79
84
|
"eras": @eras
|
80
85
|
}.to_json
|
@@ -90,6 +95,7 @@ module CandidApiClient
|
|
90
95
|
obj.clearinghouse&.is_a?(String) != false || raise("Passed value for field obj.clearinghouse is not the expected type, validation failed.")
|
91
96
|
obj.clearinghouse_claim_id&.is_a?(String) != false || raise("Passed value for field obj.clearinghouse_claim_id is not the expected type, validation failed.")
|
92
97
|
obj.payer_claim_id&.is_a?(String) != false || raise("Passed value for field obj.payer_claim_id is not the expected type, validation failed.")
|
98
|
+
obj.clia_number&.is_a?(String) != false || raise("Passed value for field obj.clia_number is not the expected type, validation failed.")
|
93
99
|
obj.service_lines.is_a?(Array) != false || raise("Passed value for field obj.service_lines is not the expected type, validation failed.")
|
94
100
|
obj.eras.is_a?(Array) != false || raise("Passed value for field obj.eras is not the expected type, validation failed.")
|
95
101
|
end
|
@@ -69,6 +69,34 @@ module CandidApiClient
|
|
69
69
|
end
|
70
70
|
response.body
|
71
71
|
end
|
72
|
+
|
73
|
+
# If you'd like access to this endpoint, please reach out to support@joincandidhealth.com with the subject line "Action: Activate Availity Eligibility API Endpoint
|
74
|
+
#
|
75
|
+
# This API is a wrapper around Availity's coverages API. Below are some helpful documentation links:
|
76
|
+
#
|
77
|
+
# - [Availity - Coverages 1.0.0 API](https://developer.availity.com/partner/documentation#c_coverages_references)
|
78
|
+
# - [Candid Availity Eligibility Integration Guide](https://support.joincandidhealth.com/hc/en-us/articles/24218441631892--Availity-Eligibility-Integration-Guide)
|
79
|
+
#
|
80
|
+
# A schema of the response object can be found here: [Availity Docs](https://developer.availity.com/partner/product/191210/api/190898#/Coverages_100/operation/%2Fcoverages%2F{id}/get)
|
81
|
+
#
|
82
|
+
# - Note Availity requires a free developer account to access this documentation.
|
83
|
+
#
|
84
|
+
# Check connection status of Availity API and partners here:
|
85
|
+
#
|
86
|
+
# - [Availity Trading Partner Connection Status](https://www.availity.com/status/)
|
87
|
+
#
|
88
|
+
# @param request [Object]
|
89
|
+
# @param request_options [RequestOptions]
|
90
|
+
# @return [Object]
|
91
|
+
def submit_eligibility_check_availity_post(request: nil, request_options: nil)
|
92
|
+
response = @request_client.conn.post("/api/eligibility/v2/availity") do |req|
|
93
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
94
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
95
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
96
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
97
|
+
end
|
98
|
+
response.body
|
99
|
+
end
|
72
100
|
end
|
73
101
|
|
74
102
|
class AsyncV2Client
|
@@ -138,6 +166,36 @@ module CandidApiClient
|
|
138
166
|
response.body
|
139
167
|
end
|
140
168
|
end
|
169
|
+
|
170
|
+
# If you'd like access to this endpoint, please reach out to support@joincandidhealth.com with the subject line "Action: Activate Availity Eligibility API Endpoint
|
171
|
+
#
|
172
|
+
# This API is a wrapper around Availity's coverages API. Below are some helpful documentation links:
|
173
|
+
#
|
174
|
+
# - [Availity - Coverages 1.0.0 API](https://developer.availity.com/partner/documentation#c_coverages_references)
|
175
|
+
# - [Candid Availity Eligibility Integration Guide](https://support.joincandidhealth.com/hc/en-us/articles/24218441631892--Availity-Eligibility-Integration-Guide)
|
176
|
+
#
|
177
|
+
# A schema of the response object can be found here: [Availity Docs](https://developer.availity.com/partner/product/191210/api/190898#/Coverages_100/operation/%2Fcoverages%2F{id}/get)
|
178
|
+
#
|
179
|
+
# - Note Availity requires a free developer account to access this documentation.
|
180
|
+
#
|
181
|
+
# Check connection status of Availity API and partners here:
|
182
|
+
#
|
183
|
+
# - [Availity Trading Partner Connection Status](https://www.availity.com/status/)
|
184
|
+
#
|
185
|
+
# @param request [Object]
|
186
|
+
# @param request_options [RequestOptions]
|
187
|
+
# @return [Object]
|
188
|
+
def submit_eligibility_check_availity_post(request: nil, request_options: nil)
|
189
|
+
Async do
|
190
|
+
response = @request_client.conn.post("/api/eligibility/v2/availity") do |req|
|
191
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
192
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
193
|
+
req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
|
194
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
195
|
+
end
|
196
|
+
response.body
|
197
|
+
end
|
198
|
+
end
|
141
199
|
end
|
142
200
|
end
|
143
201
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "json"
|
4
4
|
require_relative "../../commons/types/service_line_id"
|
5
5
|
require_relative "../../commons/types/claim_id"
|
6
|
+
require_relative "../../commons/types/encounter_external_id"
|
6
7
|
require_relative "../../commons/types/provider_id"
|
7
8
|
|
8
9
|
module CandidApiClient
|
@@ -35,6 +36,8 @@ module CandidApiClient
|
|
35
36
|
json_object.value
|
36
37
|
when "claim_by_id"
|
37
38
|
json_object.value
|
39
|
+
when "claim_by_encounter_external_id"
|
40
|
+
json_object.value
|
38
41
|
when "billing_provider_by_id"
|
39
42
|
json_object.value
|
40
43
|
when "unattributed"
|
@@ -54,6 +57,8 @@ module CandidApiClient
|
|
54
57
|
{ "type": @discriminant, "value": @member }.to_json
|
55
58
|
when "claim_by_id"
|
56
59
|
{ "type": @discriminant, "value": @member }.to_json
|
60
|
+
when "claim_by_encounter_external_id"
|
61
|
+
{ "type": @discriminant, "value": @member }.to_json
|
57
62
|
when "billing_provider_by_id"
|
58
63
|
{ "type": @discriminant, "value": @member }.to_json
|
59
64
|
when "unattributed"
|
@@ -74,6 +79,8 @@ module CandidApiClient
|
|
74
79
|
obj.is_a?(UUID) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
75
80
|
when "claim_by_id"
|
76
81
|
obj.is_a?(UUID) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
82
|
+
when "claim_by_encounter_external_id"
|
83
|
+
obj.is_a?(String) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
77
84
|
when "billing_provider_by_id"
|
78
85
|
obj.is_a?(UUID) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
79
86
|
when "unattributed"
|
@@ -103,6 +110,12 @@ module CandidApiClient
|
|
103
110
|
new(member: member, discriminant: "claim_by_id")
|
104
111
|
end
|
105
112
|
|
113
|
+
# @param member [Commons::ENCOUNTER_EXTERNAL_ID]
|
114
|
+
# @return [Financials::AllocationTargetCreate]
|
115
|
+
def self.claim_by_encounter_external_id(member:)
|
116
|
+
new(member: member, discriminant: "claim_by_encounter_external_id")
|
117
|
+
end
|
118
|
+
|
106
119
|
# @param member [Commons::PROVIDER_ID]
|
107
120
|
# @return [Financials::AllocationTargetCreate]
|
108
121
|
def self.billing_provider_by_id(member:)
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../commons/types/claim_id"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Invoices
|
8
|
+
module V2
|
9
|
+
class ClaimInvoiceItem
|
10
|
+
attr_reader :claim_id, :amount_cents, :additional_properties
|
11
|
+
|
12
|
+
# @param claim_id [Commons::CLAIM_ID]
|
13
|
+
# @param amount_cents [Integer]
|
14
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
# @return [Invoices::V2::ClaimInvoiceItem]
|
16
|
+
def initialize(claim_id:, amount_cents:, additional_properties: nil)
|
17
|
+
# @type [Commons::CLAIM_ID]
|
18
|
+
@claim_id = claim_id
|
19
|
+
# @type [Integer]
|
20
|
+
@amount_cents = amount_cents
|
21
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
+
@additional_properties = additional_properties
|
23
|
+
end
|
24
|
+
|
25
|
+
# Deserialize a JSON object to an instance of ClaimInvoiceItem
|
26
|
+
#
|
27
|
+
# @param json_object [JSON]
|
28
|
+
# @return [Invoices::V2::ClaimInvoiceItem]
|
29
|
+
def self.from_json(json_object:)
|
30
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
31
|
+
JSON.parse(json_object)
|
32
|
+
claim_id = struct.claim_id
|
33
|
+
amount_cents = struct.amount_cents
|
34
|
+
new(claim_id: claim_id, amount_cents: amount_cents, additional_properties: struct)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Serialize an instance of ClaimInvoiceItem to a JSON object
|
38
|
+
#
|
39
|
+
# @return [JSON]
|
40
|
+
def to_json(*_args)
|
41
|
+
{ "claim_id": @claim_id, "amount_cents": @amount_cents }.to_json
|
42
|
+
end
|
43
|
+
|
44
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
|
45
|
+
#
|
46
|
+
# @param obj [Object]
|
47
|
+
# @return [Void]
|
48
|
+
def self.validate_raw(obj:)
|
49
|
+
obj.claim_id.is_a?(UUID) != false || raise("Passed value for field obj.claim_id is not the expected type, validation failed.")
|
50
|
+
obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "claim_invoice_item"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Invoices
|
8
|
+
module V2
|
9
|
+
class ClaimInvoiceItemInfo
|
10
|
+
attr_reader :claim_invoice_item, :service_line_invoice_items, :additional_properties
|
11
|
+
|
12
|
+
# @param claim_invoice_item [Invoices::V2::ClaimInvoiceItem]
|
13
|
+
# @param service_line_invoice_items [Hash{Commons::SERVICE_LINE_ID => Invoices::V2::ServiceLineInvoiceItem}]
|
14
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
# @return [Invoices::V2::ClaimInvoiceItemInfo]
|
16
|
+
def initialize(service_line_invoice_items:, claim_invoice_item: nil, additional_properties: nil)
|
17
|
+
# @type [Invoices::V2::ClaimInvoiceItem]
|
18
|
+
@claim_invoice_item = claim_invoice_item
|
19
|
+
# @type [Hash{Commons::SERVICE_LINE_ID => Invoices::V2::ServiceLineInvoiceItem}]
|
20
|
+
@service_line_invoice_items = service_line_invoice_items
|
21
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
+
@additional_properties = additional_properties
|
23
|
+
end
|
24
|
+
|
25
|
+
# Deserialize a JSON object to an instance of ClaimInvoiceItemInfo
|
26
|
+
#
|
27
|
+
# @param json_object [JSON]
|
28
|
+
# @return [Invoices::V2::ClaimInvoiceItemInfo]
|
29
|
+
def self.from_json(json_object:)
|
30
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
31
|
+
parsed_json = JSON.parse(json_object)
|
32
|
+
if parsed_json["claim_invoice_item"].nil?
|
33
|
+
claim_invoice_item = nil
|
34
|
+
else
|
35
|
+
claim_invoice_item = parsed_json["claim_invoice_item"].to_json
|
36
|
+
claim_invoice_item = Invoices::V2::ClaimInvoiceItem.from_json(json_object: claim_invoice_item)
|
37
|
+
end
|
38
|
+
service_line_invoice_items = parsed_json["service_line_invoice_items"]&.transform_values do |_k, v|
|
39
|
+
v = v.to_json
|
40
|
+
Invoices::V2::ServiceLineInvoiceItem.from_json(json_object: v)
|
41
|
+
end
|
42
|
+
new(claim_invoice_item: claim_invoice_item, service_line_invoice_items: service_line_invoice_items,
|
43
|
+
additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of ClaimInvoiceItemInfo to a JSON object
|
47
|
+
#
|
48
|
+
# @return [JSON]
|
49
|
+
def to_json(*_args)
|
50
|
+
{
|
51
|
+
"claim_invoice_item": @claim_invoice_item,
|
52
|
+
"service_line_invoice_items": @service_line_invoice_items
|
53
|
+
}.to_json
|
54
|
+
end
|
55
|
+
|
56
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
|
57
|
+
#
|
58
|
+
# @param obj [Object]
|
59
|
+
# @return [Void]
|
60
|
+
def self.validate_raw(obj:)
|
61
|
+
obj.claim_invoice_item.nil? || Invoices::V2::ClaimInvoiceItem.validate_raw(obj: obj.claim_invoice_item)
|
62
|
+
obj.service_line_invoice_items.is_a?(Hash) != false || raise("Passed value for field obj.service_line_invoice_items is not the expected type, validation failed.")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require_relative "../../../commons/types/organization_id"
|
5
|
+
require_relative "invoice_destination_metadata"
|
6
|
+
require_relative "../../../commons/types/patient_external_id"
|
7
|
+
require_relative "invoice_status"
|
8
|
+
require_relative "invoice_item_info"
|
9
|
+
require "json"
|
10
|
+
|
11
|
+
module CandidApiClient
|
12
|
+
module Invoices
|
13
|
+
module V2
|
14
|
+
class Invoice
|
15
|
+
attr_reader :amount_cents, :created_at, :updated_at, :organization_id, :invoice_destination_metadata,
|
16
|
+
:patient_external_id, :note, :due_date, :status, :url, :customer_invoice_url, :items, :additional_properties
|
17
|
+
|
18
|
+
# @param amount_cents [Integer] Total monetary amount (in cents) of all Invoice Items
|
19
|
+
# @param created_at [DateTime]
|
20
|
+
# @param updated_at [DateTime]
|
21
|
+
# @param organization_id [Commons::ORGANIZATION_ID]
|
22
|
+
# @param invoice_destination_metadata [Invoices::V2::InvoiceDestinationMetadata] Contains all relevant information from the third-party service this invoice was created in
|
23
|
+
# @param patient_external_id [Commons::PATIENT_EXTERNAL_ID]
|
24
|
+
# @param note [String]
|
25
|
+
# @param due_date [Date]
|
26
|
+
# @param status [Invoices::V2::InvoiceStatus]
|
27
|
+
# @param url [String] Link to the admin view of the invoice in the third-party service
|
28
|
+
# @param customer_invoice_url [String] Link to the patient view of the invoice in the third-party service
|
29
|
+
# @param items [Invoices::V2::InvoiceItemInfo] The InvoiceItem rollup which contains all claim and service line invoice items
|
30
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
31
|
+
# @return [Invoices::V2::Invoice]
|
32
|
+
def initialize(amount_cents:, created_at:, updated_at:, organization_id:, invoice_destination_metadata:,
|
33
|
+
patient_external_id:, due_date:, status:, items:, note: nil, url: nil, customer_invoice_url: nil, additional_properties: nil)
|
34
|
+
# @type [Integer] Total monetary amount (in cents) of all Invoice Items
|
35
|
+
@amount_cents = amount_cents
|
36
|
+
# @type [DateTime]
|
37
|
+
@created_at = created_at
|
38
|
+
# @type [DateTime]
|
39
|
+
@updated_at = updated_at
|
40
|
+
# @type [Commons::ORGANIZATION_ID]
|
41
|
+
@organization_id = organization_id
|
42
|
+
# @type [Invoices::V2::InvoiceDestinationMetadata] Contains all relevant information from the third-party service this invoice was created in
|
43
|
+
@invoice_destination_metadata = invoice_destination_metadata
|
44
|
+
# @type [Commons::PATIENT_EXTERNAL_ID]
|
45
|
+
@patient_external_id = patient_external_id
|
46
|
+
# @type [String]
|
47
|
+
@note = note
|
48
|
+
# @type [Date]
|
49
|
+
@due_date = due_date
|
50
|
+
# @type [Invoices::V2::InvoiceStatus]
|
51
|
+
@status = status
|
52
|
+
# @type [String] Link to the admin view of the invoice in the third-party service
|
53
|
+
@url = url
|
54
|
+
# @type [String] Link to the patient view of the invoice in the third-party service
|
55
|
+
@customer_invoice_url = customer_invoice_url
|
56
|
+
# @type [Invoices::V2::InvoiceItemInfo] The InvoiceItem rollup which contains all claim and service line invoice items
|
57
|
+
@items = items
|
58
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
59
|
+
@additional_properties = additional_properties
|
60
|
+
end
|
61
|
+
|
62
|
+
# Deserialize a JSON object to an instance of Invoice
|
63
|
+
#
|
64
|
+
# @param json_object [JSON]
|
65
|
+
# @return [Invoices::V2::Invoice]
|
66
|
+
def self.from_json(json_object:)
|
67
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
68
|
+
parsed_json = JSON.parse(json_object)
|
69
|
+
amount_cents = struct.amount_cents
|
70
|
+
created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?)
|
71
|
+
updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
|
72
|
+
organization_id = struct.organization_id
|
73
|
+
if parsed_json["invoice_destination_metadata"].nil?
|
74
|
+
invoice_destination_metadata = nil
|
75
|
+
else
|
76
|
+
invoice_destination_metadata = parsed_json["invoice_destination_metadata"].to_json
|
77
|
+
invoice_destination_metadata = Invoices::V2::InvoiceDestinationMetadata.from_json(json_object: invoice_destination_metadata)
|
78
|
+
end
|
79
|
+
patient_external_id = struct.patient_external_id
|
80
|
+
note = struct.note
|
81
|
+
due_date = (Date.parse(parsed_json["due_date"]) unless parsed_json["due_date"].nil?)
|
82
|
+
status = struct.status
|
83
|
+
url = struct.url
|
84
|
+
customer_invoice_url = struct.customer_invoice_url
|
85
|
+
if parsed_json["items"].nil?
|
86
|
+
items = nil
|
87
|
+
else
|
88
|
+
items = parsed_json["items"].to_json
|
89
|
+
items = Invoices::V2::InvoiceItemInfo.from_json(json_object: items)
|
90
|
+
end
|
91
|
+
new(amount_cents: amount_cents, created_at: created_at, updated_at: updated_at,
|
92
|
+
organization_id: organization_id, invoice_destination_metadata: invoice_destination_metadata, patient_external_id: patient_external_id, note: note, due_date: due_date, status: status, url: url, customer_invoice_url: customer_invoice_url, items: items, additional_properties: struct)
|
93
|
+
end
|
94
|
+
|
95
|
+
# Serialize an instance of Invoice to a JSON object
|
96
|
+
#
|
97
|
+
# @return [JSON]
|
98
|
+
def to_json(*_args)
|
99
|
+
{
|
100
|
+
"amount_cents": @amount_cents,
|
101
|
+
"created_at": @created_at,
|
102
|
+
"updated_at": @updated_at,
|
103
|
+
"organization_id": @organization_id,
|
104
|
+
"invoice_destination_metadata": @invoice_destination_metadata,
|
105
|
+
"patient_external_id": @patient_external_id,
|
106
|
+
"note": @note,
|
107
|
+
"due_date": @due_date,
|
108
|
+
"status": @status,
|
109
|
+
"url": @url,
|
110
|
+
"customer_invoice_url": @customer_invoice_url,
|
111
|
+
"items": @items
|
112
|
+
}.to_json
|
113
|
+
end
|
114
|
+
|
115
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
|
116
|
+
#
|
117
|
+
# @param obj [Object]
|
118
|
+
# @return [Void]
|
119
|
+
def self.validate_raw(obj:)
|
120
|
+
obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.")
|
121
|
+
obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
122
|
+
obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
123
|
+
obj.organization_id.is_a?(UUID) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
|
124
|
+
Invoices::V2::InvoiceDestinationMetadata.validate_raw(obj: obj.invoice_destination_metadata)
|
125
|
+
obj.patient_external_id.is_a?(String) != false || raise("Passed value for field obj.patient_external_id is not the expected type, validation failed.")
|
126
|
+
obj.note&.is_a?(String) != false || raise("Passed value for field obj.note is not the expected type, validation failed.")
|
127
|
+
obj.due_date.is_a?(Date) != false || raise("Passed value for field obj.due_date is not the expected type, validation failed.")
|
128
|
+
obj.status.is_a?(Invoices::V2::InvoiceStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
129
|
+
obj.url&.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
|
130
|
+
obj.customer_invoice_url&.is_a?(String) != false || raise("Passed value for field obj.customer_invoice_url is not the expected type, validation failed.")
|
131
|
+
Invoices::V2::InvoiceItemInfo.validate_raw(obj: obj.items)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "invoice_destination"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Invoices
|
8
|
+
module V2
|
9
|
+
class InvoiceDestinationMetadata
|
10
|
+
attr_reader :invoice_destination, :source_id, :source_customer_id, :destination_status, :additional_properties
|
11
|
+
|
12
|
+
# @param invoice_destination [Invoices::V2::InvoiceDestination] Defines which third-party service this invoice was created in
|
13
|
+
# @param source_id [String] The id of the invoice in the third-party service
|
14
|
+
# @param source_customer_id [String] The id of the customer that the invoice is attributed to in the third-party service
|
15
|
+
# @param destination_status [String] The status of the invoice in the third-party service
|
16
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
# @return [Invoices::V2::InvoiceDestinationMetadata]
|
18
|
+
def initialize(invoice_destination:, source_id:, source_customer_id:, destination_status: nil,
|
19
|
+
additional_properties: nil)
|
20
|
+
# @type [Invoices::V2::InvoiceDestination] Defines which third-party service this invoice was created in
|
21
|
+
@invoice_destination = invoice_destination
|
22
|
+
# @type [String] The id of the invoice in the third-party service
|
23
|
+
@source_id = source_id
|
24
|
+
# @type [String] The id of the customer that the invoice is attributed to in the third-party service
|
25
|
+
@source_customer_id = source_customer_id
|
26
|
+
# @type [String] The status of the invoice in the third-party service
|
27
|
+
@destination_status = destination_status
|
28
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deserialize a JSON object to an instance of InvoiceDestinationMetadata
|
33
|
+
#
|
34
|
+
# @param json_object [JSON]
|
35
|
+
# @return [Invoices::V2::InvoiceDestinationMetadata]
|
36
|
+
def self.from_json(json_object:)
|
37
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
38
|
+
JSON.parse(json_object)
|
39
|
+
invoice_destination = struct.invoice_destination
|
40
|
+
source_id = struct.source_id
|
41
|
+
source_customer_id = struct.source_customer_id
|
42
|
+
destination_status = struct.destination_status
|
43
|
+
new(invoice_destination: invoice_destination, source_id: source_id, source_customer_id: source_customer_id,
|
44
|
+
destination_status: destination_status, additional_properties: struct)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Serialize an instance of InvoiceDestinationMetadata to a JSON object
|
48
|
+
#
|
49
|
+
# @return [JSON]
|
50
|
+
def to_json(*_args)
|
51
|
+
{
|
52
|
+
"invoice_destination": @invoice_destination,
|
53
|
+
"source_id": @source_id,
|
54
|
+
"source_customer_id": @source_customer_id,
|
55
|
+
"destination_status": @destination_status
|
56
|
+
}.to_json
|
57
|
+
end
|
58
|
+
|
59
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
|
60
|
+
#
|
61
|
+
# @param obj [Object]
|
62
|
+
# @return [Void]
|
63
|
+
def self.validate_raw(obj:)
|
64
|
+
obj.invoice_destination.is_a?(Invoices::V2::InvoiceDestination) != false || raise("Passed value for field obj.invoice_destination is not the expected type, validation failed.")
|
65
|
+
obj.source_id.is_a?(String) != false || raise("Passed value for field obj.source_id is not the expected type, validation failed.")
|
66
|
+
obj.source_customer_id.is_a?(String) != false || raise("Passed value for field obj.source_customer_id is not the expected type, validation failed.")
|
67
|
+
obj.destination_status&.is_a?(String) != false || raise("Passed value for field obj.destination_status is not the expected type, validation failed.")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../commons/types/invoice_id"
|
4
|
+
require_relative "invoice"
|
5
|
+
require_relative "invoice_destination"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module CandidApiClient
|
9
|
+
module Invoices
|
10
|
+
module V2
|
11
|
+
class InvoiceInfo
|
12
|
+
attr_reader :id, :invoice, :invoice_type, :additional_properties
|
13
|
+
|
14
|
+
# @param id [Commons::INVOICE_ID]
|
15
|
+
# @param invoice [Invoices::V2::Invoice]
|
16
|
+
# @param invoice_type [Invoices::V2::InvoiceDestination]
|
17
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
18
|
+
# @return [Invoices::V2::InvoiceInfo]
|
19
|
+
def initialize(id:, invoice:, invoice_type:, additional_properties: nil)
|
20
|
+
# @type [Commons::INVOICE_ID]
|
21
|
+
@id = id
|
22
|
+
# @type [Invoices::V2::Invoice]
|
23
|
+
@invoice = invoice
|
24
|
+
# @type [Invoices::V2::InvoiceDestination]
|
25
|
+
@invoice_type = invoice_type
|
26
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
27
|
+
@additional_properties = additional_properties
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of InvoiceInfo
|
31
|
+
#
|
32
|
+
# @param json_object [JSON]
|
33
|
+
# @return [Invoices::V2::InvoiceInfo]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
parsed_json = JSON.parse(json_object)
|
37
|
+
id = struct.id
|
38
|
+
if parsed_json["invoice"].nil?
|
39
|
+
invoice = nil
|
40
|
+
else
|
41
|
+
invoice = parsed_json["invoice"].to_json
|
42
|
+
invoice = Invoices::V2::Invoice.from_json(json_object: invoice)
|
43
|
+
end
|
44
|
+
invoice_type = struct.invoice_type
|
45
|
+
new(id: id, invoice: invoice, invoice_type: invoice_type, additional_properties: struct)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Serialize an instance of InvoiceInfo to a JSON object
|
49
|
+
#
|
50
|
+
# @return [JSON]
|
51
|
+
def to_json(*_args)
|
52
|
+
{ "id": @id, "invoice": @invoice, "invoice_type": @invoice_type }.to_json
|
53
|
+
end
|
54
|
+
|
55
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
obj.id.is_a?(UUID) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
61
|
+
Invoices::V2::Invoice.validate_raw(obj: obj.invoice)
|
62
|
+
obj.invoice_type.is_a?(Invoices::V2::InvoiceDestination) != false || raise("Passed value for field obj.invoice_type is not the expected type, validation failed.")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "unattributed_invoice_item"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Invoices
|
8
|
+
module V2
|
9
|
+
class InvoiceItemInfo
|
10
|
+
attr_reader :claim_invoice_items, :unattributed_items, :additional_properties
|
11
|
+
|
12
|
+
# @param claim_invoice_items [Hash{Commons::CLAIM_ID => Invoices::V2::ClaimInvoiceItemInfo}]
|
13
|
+
# @param unattributed_items [Array<Invoices::V2::UnattributedInvoiceItem>]
|
14
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
# @return [Invoices::V2::InvoiceItemInfo]
|
16
|
+
def initialize(claim_invoice_items:, unattributed_items:, additional_properties: nil)
|
17
|
+
# @type [Hash{Commons::CLAIM_ID => Invoices::V2::ClaimInvoiceItemInfo}]
|
18
|
+
@claim_invoice_items = claim_invoice_items
|
19
|
+
# @type [Array<Invoices::V2::UnattributedInvoiceItem>]
|
20
|
+
@unattributed_items = unattributed_items
|
21
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
+
@additional_properties = additional_properties
|
23
|
+
end
|
24
|
+
|
25
|
+
# Deserialize a JSON object to an instance of InvoiceItemInfo
|
26
|
+
#
|
27
|
+
# @param json_object [JSON]
|
28
|
+
# @return [Invoices::V2::InvoiceItemInfo]
|
29
|
+
def self.from_json(json_object:)
|
30
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
31
|
+
parsed_json = JSON.parse(json_object)
|
32
|
+
claim_invoice_items = parsed_json["claim_invoice_items"]&.transform_values do |_k, v|
|
33
|
+
v = v.to_json
|
34
|
+
Invoices::V2::ClaimInvoiceItemInfo.from_json(json_object: v)
|
35
|
+
end
|
36
|
+
unattributed_items = parsed_json["unattributed_items"]&.map do |v|
|
37
|
+
v = v.to_json
|
38
|
+
Invoices::V2::UnattributedInvoiceItem.from_json(json_object: v)
|
39
|
+
end
|
40
|
+
new(claim_invoice_items: claim_invoice_items, unattributed_items: unattributed_items,
|
41
|
+
additional_properties: struct)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Serialize an instance of InvoiceItemInfo to a JSON object
|
45
|
+
#
|
46
|
+
# @return [JSON]
|
47
|
+
def to_json(*_args)
|
48
|
+
{ "claim_invoice_items": @claim_invoice_items, "unattributed_items": @unattributed_items }.to_json
|
49
|
+
end
|
50
|
+
|
51
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
|
52
|
+
#
|
53
|
+
# @param obj [Object]
|
54
|
+
# @return [Void]
|
55
|
+
def self.validate_raw(obj:)
|
56
|
+
obj.claim_invoice_items.is_a?(Hash) != false || raise("Passed value for field obj.claim_invoice_items is not the expected type, validation failed.")
|
57
|
+
obj.unattributed_items.is_a?(Array) != false || raise("Passed value for field obj.unattributed_items is not the expected type, validation failed.")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CandidApiClient
|
4
|
+
module Invoices
|
5
|
+
module V2
|
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
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../commons/types/service_line_id"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Invoices
|
8
|
+
module V2
|
9
|
+
class ServiceLineInvoiceItem
|
10
|
+
attr_reader :service_line_id, :amount_cents, :additional_properties
|
11
|
+
|
12
|
+
# @param service_line_id [Commons::SERVICE_LINE_ID]
|
13
|
+
# @param amount_cents [Integer]
|
14
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
# @return [Invoices::V2::ServiceLineInvoiceItem]
|
16
|
+
def initialize(service_line_id:, amount_cents:, additional_properties: nil)
|
17
|
+
# @type [Commons::SERVICE_LINE_ID]
|
18
|
+
@service_line_id = service_line_id
|
19
|
+
# @type [Integer]
|
20
|
+
@amount_cents = amount_cents
|
21
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
+
@additional_properties = additional_properties
|
23
|
+
end
|
24
|
+
|
25
|
+
# Deserialize a JSON object to an instance of ServiceLineInvoiceItem
|
26
|
+
#
|
27
|
+
# @param json_object [JSON]
|
28
|
+
# @return [Invoices::V2::ServiceLineInvoiceItem]
|
29
|
+
def self.from_json(json_object:)
|
30
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
31
|
+
JSON.parse(json_object)
|
32
|
+
service_line_id = struct.service_line_id
|
33
|
+
amount_cents = struct.amount_cents
|
34
|
+
new(service_line_id: service_line_id, amount_cents: amount_cents, additional_properties: struct)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Serialize an instance of ServiceLineInvoiceItem to a JSON object
|
38
|
+
#
|
39
|
+
# @return [JSON]
|
40
|
+
def to_json(*_args)
|
41
|
+
{ "service_line_id": @service_line_id, "amount_cents": @amount_cents }.to_json
|
42
|
+
end
|
43
|
+
|
44
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
|
45
|
+
#
|
46
|
+
# @param obj [Object]
|
47
|
+
# @return [Void]
|
48
|
+
def self.validate_raw(obj:)
|
49
|
+
obj.service_line_id.is_a?(UUID) != false || raise("Passed value for field obj.service_line_id is not the expected type, validation failed.")
|
50
|
+
obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module CandidApiClient
|
6
|
+
module Invoices
|
7
|
+
module V2
|
8
|
+
class UnattributedInvoiceItem
|
9
|
+
attr_reader :amount_cents, :additional_properties
|
10
|
+
|
11
|
+
# @param amount_cents [Integer]
|
12
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
+
# @return [Invoices::V2::UnattributedInvoiceItem]
|
14
|
+
def initialize(amount_cents:, additional_properties: nil)
|
15
|
+
# @type [Integer]
|
16
|
+
@amount_cents = amount_cents
|
17
|
+
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
18
|
+
@additional_properties = additional_properties
|
19
|
+
end
|
20
|
+
|
21
|
+
# Deserialize a JSON object to an instance of UnattributedInvoiceItem
|
22
|
+
#
|
23
|
+
# @param json_object [JSON]
|
24
|
+
# @return [Invoices::V2::UnattributedInvoiceItem]
|
25
|
+
def self.from_json(json_object:)
|
26
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
27
|
+
JSON.parse(json_object)
|
28
|
+
amount_cents = struct.amount_cents
|
29
|
+
new(amount_cents: amount_cents, additional_properties: struct)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Serialize an instance of UnattributedInvoiceItem to a JSON object
|
33
|
+
#
|
34
|
+
# @return [JSON]
|
35
|
+
def to_json(*_args)
|
36
|
+
{ "amount_cents": @amount_cents }.to_json
|
37
|
+
end
|
38
|
+
|
39
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
|
40
|
+
#
|
41
|
+
# @param obj [Object]
|
42
|
+
# @return [Void]
|
43
|
+
def self.validate_raw(obj:)
|
44
|
+
obj.amount_cents.is_a?(Integer) != false || raise("Passed value for field obj.amount_cents is not the expected type, validation failed.")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -5,6 +5,7 @@ require_relative "../../../diagnoses/types/diagnosis_id"
|
|
5
5
|
require_relative "service_line_era_data"
|
6
6
|
require_relative "service_line_adjustment"
|
7
7
|
require_relative "../../../invoices/types/invoice"
|
8
|
+
require_relative "../../../invoices/v_2/types/invoice_info"
|
8
9
|
require_relative "service_line_denial_reason"
|
9
10
|
require_relative "../../../commons/types/facility_type_code"
|
10
11
|
require_relative "../../../commons/types/service_line_id"
|
@@ -20,7 +21,7 @@ module CandidApiClient
|
|
20
21
|
module V2
|
21
22
|
class ServiceLine
|
22
23
|
attr_reader :modifiers, :charge_amount_cents, :allowed_amount_cents, :insurance_balance_cents,
|
23
|
-
:patient_balance_cents, :paid_amount_cents, :patient_responsibility_cents, :diagnosis_id_zero, :diagnosis_id_one, :diagnosis_id_two, :diagnosis_id_three, :service_line_era_data, :service_line_manual_adjustments, :related_invoices, :denial_reason, :place_of_service_code, :service_line_id, :procedure_code, :quantity, :units, :claim_id, :date_of_service_range, :description, :date_of_service, :end_date_of_service, :additional_properties
|
24
|
+
:patient_balance_cents, :paid_amount_cents, :patient_responsibility_cents, :diagnosis_id_zero, :diagnosis_id_one, :diagnosis_id_two, :diagnosis_id_three, :service_line_era_data, :service_line_manual_adjustments, :related_invoices, :related_invoice_info, :denial_reason, :place_of_service_code, :service_line_id, :procedure_code, :quantity, :units, :claim_id, :date_of_service_range, :description, :date_of_service, :end_date_of_service, :additional_properties
|
24
25
|
|
25
26
|
# @param modifiers [Array<Commons::ProcedureModifier>]
|
26
27
|
# @param charge_amount_cents [Integer]
|
@@ -36,6 +37,7 @@ module CandidApiClient
|
|
36
37
|
# @param service_line_era_data [ServiceLines::V2::ServiceLineEraData]
|
37
38
|
# @param service_line_manual_adjustments [Array<ServiceLines::V2::ServiceLineAdjustment>]
|
38
39
|
# @param related_invoices [Array<Invoices::Invoice>]
|
40
|
+
# @param related_invoice_info [Array<Invoices::V2::InvoiceInfo>]
|
39
41
|
# @param denial_reason [ServiceLines::V2::ServiceLineDenialReason]
|
40
42
|
# @param place_of_service_code [Commons::FacilityTypeCode]
|
41
43
|
# @param service_line_id [Commons::SERVICE_LINE_ID]
|
@@ -53,7 +55,7 @@ module CandidApiClient
|
|
53
55
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
54
56
|
# @return [ServiceLines::V2::ServiceLine]
|
55
57
|
def initialize(service_line_id:, procedure_code:, quantity:, units:, claim_id:, date_of_service_range:, date_of_service:, modifiers: nil, charge_amount_cents: nil, allowed_amount_cents: nil,
|
56
|
-
insurance_balance_cents: nil, patient_balance_cents: nil, paid_amount_cents: nil, patient_responsibility_cents: nil, diagnosis_id_zero: nil, diagnosis_id_one: nil, diagnosis_id_two: nil, diagnosis_id_three: nil, service_line_era_data: nil, service_line_manual_adjustments: nil, related_invoices: nil, denial_reason: nil, place_of_service_code: nil, description: nil, end_date_of_service: nil, additional_properties: nil)
|
58
|
+
insurance_balance_cents: nil, patient_balance_cents: nil, paid_amount_cents: nil, patient_responsibility_cents: nil, diagnosis_id_zero: nil, diagnosis_id_one: nil, diagnosis_id_two: nil, diagnosis_id_three: nil, service_line_era_data: nil, service_line_manual_adjustments: nil, related_invoices: nil, related_invoice_info: nil, denial_reason: nil, place_of_service_code: nil, description: nil, end_date_of_service: nil, additional_properties: nil)
|
57
59
|
# @type [Array<Commons::ProcedureModifier>]
|
58
60
|
@modifiers = modifiers
|
59
61
|
# @type [Integer]
|
@@ -82,6 +84,8 @@ module CandidApiClient
|
|
82
84
|
@service_line_manual_adjustments = service_line_manual_adjustments
|
83
85
|
# @type [Array<Invoices::Invoice>]
|
84
86
|
@related_invoices = related_invoices
|
87
|
+
# @type [Array<Invoices::V2::InvoiceInfo>]
|
88
|
+
@related_invoice_info = related_invoice_info
|
85
89
|
# @type [ServiceLines::V2::ServiceLineDenialReason]
|
86
90
|
@denial_reason = denial_reason
|
87
91
|
# @type [Commons::FacilityTypeCode]
|
@@ -143,6 +147,10 @@ module CandidApiClient
|
|
143
147
|
v = v.to_json
|
144
148
|
Invoices::Invoice.from_json(json_object: v)
|
145
149
|
end
|
150
|
+
related_invoice_info = parsed_json["related_invoice_info"]&.map do |v|
|
151
|
+
v = v.to_json
|
152
|
+
Invoices::V2::InvoiceInfo.from_json(json_object: v)
|
153
|
+
end
|
146
154
|
if parsed_json["denial_reason"].nil?
|
147
155
|
denial_reason = nil
|
148
156
|
else
|
@@ -167,7 +175,7 @@ module CandidApiClient
|
|
167
175
|
Date.parse(parsed_json["end_date_of_service"])
|
168
176
|
end
|
169
177
|
new(modifiers: modifiers, charge_amount_cents: charge_amount_cents,
|
170
|
-
allowed_amount_cents: allowed_amount_cents, insurance_balance_cents: insurance_balance_cents, patient_balance_cents: patient_balance_cents, paid_amount_cents: paid_amount_cents, patient_responsibility_cents: patient_responsibility_cents, diagnosis_id_zero: diagnosis_id_zero, diagnosis_id_one: diagnosis_id_one, diagnosis_id_two: diagnosis_id_two, diagnosis_id_three: diagnosis_id_three, service_line_era_data: service_line_era_data, service_line_manual_adjustments: service_line_manual_adjustments, related_invoices: related_invoices, denial_reason: denial_reason, place_of_service_code: place_of_service_code, service_line_id: service_line_id, procedure_code: procedure_code, quantity: quantity, units: units, claim_id: claim_id, date_of_service_range: date_of_service_range, description: description, date_of_service: date_of_service, end_date_of_service: end_date_of_service, additional_properties: struct)
|
178
|
+
allowed_amount_cents: allowed_amount_cents, insurance_balance_cents: insurance_balance_cents, patient_balance_cents: patient_balance_cents, paid_amount_cents: paid_amount_cents, patient_responsibility_cents: patient_responsibility_cents, diagnosis_id_zero: diagnosis_id_zero, diagnosis_id_one: diagnosis_id_one, diagnosis_id_two: diagnosis_id_two, diagnosis_id_three: diagnosis_id_three, service_line_era_data: service_line_era_data, service_line_manual_adjustments: service_line_manual_adjustments, related_invoices: related_invoices, related_invoice_info: related_invoice_info, denial_reason: denial_reason, place_of_service_code: place_of_service_code, service_line_id: service_line_id, procedure_code: procedure_code, quantity: quantity, units: units, claim_id: claim_id, date_of_service_range: date_of_service_range, description: description, date_of_service: date_of_service, end_date_of_service: end_date_of_service, additional_properties: struct)
|
171
179
|
end
|
172
180
|
|
173
181
|
# Serialize an instance of ServiceLine to a JSON object
|
@@ -189,6 +197,7 @@ module CandidApiClient
|
|
189
197
|
"service_line_era_data": @service_line_era_data,
|
190
198
|
"service_line_manual_adjustments": @service_line_manual_adjustments,
|
191
199
|
"related_invoices": @related_invoices,
|
200
|
+
"related_invoice_info": @related_invoice_info,
|
192
201
|
"denial_reason": @denial_reason,
|
193
202
|
"place_of_service_code": @place_of_service_code,
|
194
203
|
"service_line_id": @service_line_id,
|
@@ -222,6 +231,7 @@ module CandidApiClient
|
|
222
231
|
obj.service_line_era_data.nil? || ServiceLines::V2::ServiceLineEraData.validate_raw(obj: obj.service_line_era_data)
|
223
232
|
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.")
|
224
233
|
obj.related_invoices&.is_a?(Array) != false || raise("Passed value for field obj.related_invoices is not the expected type, validation failed.")
|
234
|
+
obj.related_invoice_info&.is_a?(Array) != false || raise("Passed value for field obj.related_invoice_info is not the expected type, validation failed.")
|
225
235
|
obj.denial_reason.nil? || ServiceLines::V2::ServiceLineDenialReason.validate_raw(obj: obj.denial_reason)
|
226
236
|
obj.place_of_service_code&.is_a?(Commons::FacilityTypeCode) != false || raise("Passed value for field obj.place_of_service_code is not the expected type, validation failed.")
|
227
237
|
obj.service_line_id.is_a?(UUID) != false || raise("Passed value for field obj.service_line_id is not the expected type, validation failed.")
|
data/lib/requests.rb
CHANGED
@@ -20,7 +20,7 @@ module CandidApiClient
|
|
20
20
|
@headers = {
|
21
21
|
"X-Fern-Language": "Ruby",
|
22
22
|
"X-Fern-SDK-Name": "candidhealth",
|
23
|
-
"X-Fern-SDK-Version": "0.
|
23
|
+
"X-Fern-SDK-Version": "0.19.1-6de2b0d",
|
24
24
|
"Authorization": "Bearer #{token}"
|
25
25
|
}
|
26
26
|
@conn = Faraday.new(@base_url, headers: @headers) do |faraday|
|
@@ -46,7 +46,7 @@ module CandidApiClient
|
|
46
46
|
@headers = {
|
47
47
|
"X-Fern-Language": "Ruby",
|
48
48
|
"X-Fern-SDK-Name": "candidhealth",
|
49
|
-
"X-Fern-SDK-Version": "0.
|
49
|
+
"X-Fern-SDK-Version": "0.19.1-6de2b0d",
|
50
50
|
"Authorization": "Bearer #{token}"
|
51
51
|
}
|
52
52
|
@conn = Faraday.new(@base_url, headers: @headers) do |faraday|
|
data/lib/types_export.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "candidhealth/auth/v_2/types/auth_get_token_request"
|
4
3
|
require_relative "candidhealth/auth/v_2/types/auth_get_token_response"
|
5
4
|
require_relative "candidhealth/auth/v_2/types/too_many_requests_error_type"
|
6
5
|
require_relative "candidhealth/billing_notes/v_2/types/billing_note_id"
|
@@ -139,6 +138,16 @@ require_relative "candidhealth/insurance_refunds/v_1/types/insurance_refund"
|
|
139
138
|
require_relative "candidhealth/insurance_refunds/v_1/types/insurance_refund_create"
|
140
139
|
require_relative "candidhealth/insurance_refunds/v_1/types/insurance_refunds_page"
|
141
140
|
require_relative "candidhealth/insurance_refunds/v_1/types/insurance_refund_sort_field"
|
141
|
+
require_relative "candidhealth/invoices/v_2/types/invoice_destination"
|
142
|
+
require_relative "candidhealth/invoices/v_2/types/invoice_status"
|
143
|
+
require_relative "candidhealth/invoices/v_2/types/invoice_destination_metadata"
|
144
|
+
require_relative "candidhealth/invoices/v_2/types/invoice"
|
145
|
+
require_relative "candidhealth/invoices/v_2/types/invoice_info"
|
146
|
+
require_relative "candidhealth/invoices/v_2/types/service_line_invoice_item"
|
147
|
+
require_relative "candidhealth/invoices/v_2/types/claim_invoice_item"
|
148
|
+
require_relative "candidhealth/invoices/v_2/types/claim_invoice_item_info"
|
149
|
+
require_relative "candidhealth/invoices/v_2/types/unattributed_invoice_item"
|
150
|
+
require_relative "candidhealth/invoices/v_2/types/invoice_item_info"
|
142
151
|
require_relative "candidhealth/organization_service_facilities/v_2/types/service_facility_status"
|
143
152
|
require_relative "candidhealth/organization_service_facilities/v_2/types/service_facility_operational_status"
|
144
153
|
require_relative "candidhealth/organization_service_facilities/v_2/types/service_facility_mode"
|
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.19.1.pre.6de2b0d
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -99,7 +99,6 @@ files:
|
|
99
99
|
- lib/candidhealth.rb
|
100
100
|
- lib/candidhealth/auth/client.rb
|
101
101
|
- lib/candidhealth/auth/v_2/client.rb
|
102
|
-
- lib/candidhealth/auth/v_2/types/auth_get_token_request.rb
|
103
102
|
- lib/candidhealth/auth/v_2/types/auth_get_token_response.rb
|
104
103
|
- lib/candidhealth/auth/v_2/types/too_many_requests_error_type.rb
|
105
104
|
- lib/candidhealth/billing_notes/client.rb
|
@@ -363,6 +362,16 @@ files:
|
|
363
362
|
- lib/candidhealth/invoices/types/invoice.rb
|
364
363
|
- lib/candidhealth/invoices/types/invoice_item.rb
|
365
364
|
- lib/candidhealth/invoices/types/invoice_status.rb
|
365
|
+
- lib/candidhealth/invoices/v_2/types/claim_invoice_item.rb
|
366
|
+
- lib/candidhealth/invoices/v_2/types/claim_invoice_item_info.rb
|
367
|
+
- lib/candidhealth/invoices/v_2/types/invoice.rb
|
368
|
+
- lib/candidhealth/invoices/v_2/types/invoice_destination.rb
|
369
|
+
- lib/candidhealth/invoices/v_2/types/invoice_destination_metadata.rb
|
370
|
+
- lib/candidhealth/invoices/v_2/types/invoice_info.rb
|
371
|
+
- lib/candidhealth/invoices/v_2/types/invoice_item_info.rb
|
372
|
+
- lib/candidhealth/invoices/v_2/types/invoice_status.rb
|
373
|
+
- lib/candidhealth/invoices/v_2/types/service_line_invoice_item.rb
|
374
|
+
- lib/candidhealth/invoices/v_2/types/unattributed_invoice_item.rb
|
366
375
|
- lib/candidhealth/organization_providers/client.rb
|
367
376
|
- lib/candidhealth/organization_providers/v_2/types/address_type.rb
|
368
377
|
- lib/candidhealth/organization_providers/v_2/types/employment_status.rb
|
@@ -491,9 +500,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
491
500
|
version: 2.7.0
|
492
501
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
493
502
|
requirements:
|
494
|
-
- - "
|
503
|
+
- - ">"
|
495
504
|
- !ruby/object:Gem::Version
|
496
|
-
version:
|
505
|
+
version: 1.3.1
|
497
506
|
requirements: []
|
498
507
|
rubygems_version: 3.1.6
|
499
508
|
signing_key:
|
@@ -1,54 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "json"
|
4
|
-
|
5
|
-
module CandidApiClient
|
6
|
-
module Auth
|
7
|
-
module V2
|
8
|
-
class AuthGetTokenRequest
|
9
|
-
attr_reader :client_id, :client_secret, :additional_properties
|
10
|
-
|
11
|
-
# @param client_id [String] Your application's Client ID.
|
12
|
-
# @param client_secret [String] Your application's Client Secret.
|
13
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
-
# @return [Auth::V2::AuthGetTokenRequest]
|
15
|
-
def initialize(client_id:, client_secret:, additional_properties: nil)
|
16
|
-
# @type [String] Your application's Client ID.
|
17
|
-
@client_id = client_id
|
18
|
-
# @type [String] Your application's Client Secret.
|
19
|
-
@client_secret = client_secret
|
20
|
-
# @type [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
-
@additional_properties = additional_properties
|
22
|
-
end
|
23
|
-
|
24
|
-
# Deserialize a JSON object to an instance of AuthGetTokenRequest
|
25
|
-
#
|
26
|
-
# @param json_object [JSON]
|
27
|
-
# @return [Auth::V2::AuthGetTokenRequest]
|
28
|
-
def self.from_json(json_object:)
|
29
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
30
|
-
JSON.parse(json_object)
|
31
|
-
client_id = struct.client_id
|
32
|
-
client_secret = struct.client_secret
|
33
|
-
new(client_id: client_id, client_secret: client_secret, additional_properties: struct)
|
34
|
-
end
|
35
|
-
|
36
|
-
# Serialize an instance of AuthGetTokenRequest to a JSON object
|
37
|
-
#
|
38
|
-
# @return [JSON]
|
39
|
-
def to_json(*_args)
|
40
|
-
{ "client_id": @client_id, "client_secret": @client_secret }.to_json
|
41
|
-
end
|
42
|
-
|
43
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
|
44
|
-
#
|
45
|
-
# @param obj [Object]
|
46
|
-
# @return [Void]
|
47
|
-
def self.validate_raw(obj:)
|
48
|
-
obj.client_id.is_a?(String) != false || raise("Passed value for field obj.client_id is not the expected type, validation failed.")
|
49
|
-
obj.client_secret.is_a?(String) != false || raise("Passed value for field obj.client_secret is not the expected type, validation failed.")
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|