candidhealth 0.41.2 → 0.41.5
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/charge_capture/v_1/client.rb +9 -27
- data/lib/candidhealth/charge_capture/v_1/types/charge_capture.rb +1 -12
- data/lib/candidhealth/charge_capture/v_1/types/charge_capture_status.rb +0 -2
- data/lib/candidhealth/charge_capture_bundles/v_1/types/charge_capture_bundle.rb +13 -1
- data/lib/candidhealth/charge_capture_bundles/v_1/types/charge_capture_bundle_status.rb +1 -1
- data/lib/candidhealth/superbills/client.rb +30 -0
- data/lib/candidhealth/superbills/v_1/client.rb +125 -0
- data/lib/candidhealth/superbills/v_1/types/superbill.rb +108 -0
- data/lib/candidhealth/superbills/v_1/types/superbill_response.rb +65 -0
- data/lib/candidhealth.rb +7 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +2 -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: be4c5cd730f0e512cc91aad03321e192751715d9266e41716532a60bd282b067
|
4
|
+
data.tar.gz: e816365693926d5d4caba7714a8f2b8b18ecc05154ba18ec69a447c23c976363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 462519820e6e0c3769bbb44f90cc2cc5f93278b7b6fcb212815207b94cd99cf0ee56ba27669a506d1b5156035b46494c2d5fbee85a81be7a0a5964fe9605813f
|
7
|
+
data.tar.gz: 8f0f17df316647ce78d8b58229f0bcc5806112b4adac66f15f1194aea6c8d4b651dd6fc5a227e5959a1b2e18cc351ef866d877fcfaeb1dbd73d3d58674330459
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
require_relative "../../../requests"
|
4
4
|
require_relative "types/charge_capture_data"
|
5
|
-
require "date"
|
6
5
|
require_relative "types/charge_capture_status"
|
7
6
|
require_relative "types/charge_capture"
|
8
7
|
require_relative "types/charge_capture_sort_field"
|
9
8
|
require_relative "../../commons/types/sort_direction"
|
9
|
+
require "date"
|
10
10
|
require_relative "types/charge_capture_page"
|
11
11
|
require_relative "types/charge_capture_post_billed_change"
|
12
12
|
require "async"
|
@@ -281,8 +281,6 @@ module CandidApiClient
|
|
281
281
|
# @param ehr_source_url [String] External URL reference that links to Charge Capture details within the external
|
282
282
|
# system (e.g. the EHR visit page). Send full URL format for the external link
|
283
283
|
# (e.g. https://emr_charge_capture_url.com/123).
|
284
|
-
# @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
|
285
|
-
# This date must be the local date in the timezone where the service occurred.
|
286
284
|
# @param patient_external_id [String] The patient ID from the external EMR platform for the patient
|
287
285
|
# @param status [CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureStatus] the status of the charge capture
|
288
286
|
# @param request_options [CandidApiClient::RequestOptions]
|
@@ -293,12 +291,10 @@ module CandidApiClient
|
|
293
291
|
# data: { },
|
294
292
|
# charge_external_id: "string",
|
295
293
|
# ehr_source_url: "string",
|
296
|
-
# date_of_service: DateTime.parse(2023-01-15),
|
297
294
|
# patient_external_id: "string",
|
298
295
|
# status: PLANNED
|
299
296
|
# )
|
300
|
-
def create(data:, charge_external_id:, patient_external_id:, status:, ehr_source_url: nil,
|
301
|
-
date_of_service: nil, request_options: nil)
|
297
|
+
def create(data:, charge_external_id:, patient_external_id:, status:, ehr_source_url: nil, request_options: nil)
|
302
298
|
response = @request_client.conn.post do |req|
|
303
299
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
304
300
|
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
@@ -312,7 +308,6 @@ module CandidApiClient
|
|
312
308
|
data: data,
|
313
309
|
charge_external_id: charge_external_id,
|
314
310
|
ehr_source_url: ehr_source_url,
|
315
|
-
date_of_service: date_of_service,
|
316
311
|
patient_external_id: patient_external_id,
|
317
312
|
status: status
|
318
313
|
}.compact
|
@@ -601,8 +596,6 @@ module CandidApiClient
|
|
601
596
|
# https://emr_charge_capture_url.com/123).
|
602
597
|
# @param patient_external_id [String] The patient ID from the external EMR platform for the patient
|
603
598
|
# @param status [CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureStatus] the status of the charge capture
|
604
|
-
# @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
|
605
|
-
# This date must be the local date in the timezone where the service occurred.
|
606
599
|
# @param request_options [CandidApiClient::RequestOptions]
|
607
600
|
# @return [CandidApiClient::ChargeCapture::V1::Types::ChargeCapture]
|
608
601
|
# @example
|
@@ -613,11 +606,10 @@ module CandidApiClient
|
|
613
606
|
# charge_external_id: "string",
|
614
607
|
# ehr_source_url: "string",
|
615
608
|
# patient_external_id: "string",
|
616
|
-
# status: PLANNED
|
617
|
-
# date_of_service: DateTime.parse(2023-01-15)
|
609
|
+
# status: PLANNED
|
618
610
|
# )
|
619
611
|
def update(charge_capture_id:, data: nil, charge_external_id: nil, ehr_source_url: nil,
|
620
|
-
patient_external_id: nil, status: nil,
|
612
|
+
patient_external_id: nil, status: nil, request_options: nil)
|
621
613
|
response = @request_client.conn.patch do |req|
|
622
614
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
623
615
|
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
@@ -632,8 +624,7 @@ module CandidApiClient
|
|
632
624
|
charge_external_id: charge_external_id,
|
633
625
|
ehr_source_url: ehr_source_url,
|
634
626
|
patient_external_id: patient_external_id,
|
635
|
-
status: status
|
636
|
-
date_of_service: date_of_service
|
627
|
+
status: status
|
637
628
|
}.compact
|
638
629
|
req.url "#{@request_client.get_url(environment: CandidApi,
|
639
630
|
request_options: request_options)}/api/charge_captures/v1/#{charge_capture_id}"
|
@@ -1014,8 +1005,6 @@ module CandidApiClient
|
|
1014
1005
|
# @param ehr_source_url [String] External URL reference that links to Charge Capture details within the external
|
1015
1006
|
# system (e.g. the EHR visit page). Send full URL format for the external link
|
1016
1007
|
# (e.g. https://emr_charge_capture_url.com/123).
|
1017
|
-
# @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
|
1018
|
-
# This date must be the local date in the timezone where the service occurred.
|
1019
1008
|
# @param patient_external_id [String] The patient ID from the external EMR platform for the patient
|
1020
1009
|
# @param status [CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureStatus] the status of the charge capture
|
1021
1010
|
# @param request_options [CandidApiClient::RequestOptions]
|
@@ -1026,12 +1015,10 @@ module CandidApiClient
|
|
1026
1015
|
# data: { },
|
1027
1016
|
# charge_external_id: "string",
|
1028
1017
|
# ehr_source_url: "string",
|
1029
|
-
# date_of_service: DateTime.parse(2023-01-15),
|
1030
1018
|
# patient_external_id: "string",
|
1031
1019
|
# status: PLANNED
|
1032
1020
|
# )
|
1033
|
-
def create(data:, charge_external_id:, patient_external_id:, status:, ehr_source_url: nil,
|
1034
|
-
date_of_service: nil, request_options: nil)
|
1021
|
+
def create(data:, charge_external_id:, patient_external_id:, status:, ehr_source_url: nil, request_options: nil)
|
1035
1022
|
Async do
|
1036
1023
|
response = @request_client.conn.post do |req|
|
1037
1024
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -1046,7 +1033,6 @@ module CandidApiClient
|
|
1046
1033
|
data: data,
|
1047
1034
|
charge_external_id: charge_external_id,
|
1048
1035
|
ehr_source_url: ehr_source_url,
|
1049
|
-
date_of_service: date_of_service,
|
1050
1036
|
patient_external_id: patient_external_id,
|
1051
1037
|
status: status
|
1052
1038
|
}.compact
|
@@ -1338,8 +1324,6 @@ module CandidApiClient
|
|
1338
1324
|
# https://emr_charge_capture_url.com/123).
|
1339
1325
|
# @param patient_external_id [String] The patient ID from the external EMR platform for the patient
|
1340
1326
|
# @param status [CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureStatus] the status of the charge capture
|
1341
|
-
# @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
|
1342
|
-
# This date must be the local date in the timezone where the service occurred.
|
1343
1327
|
# @param request_options [CandidApiClient::RequestOptions]
|
1344
1328
|
# @return [CandidApiClient::ChargeCapture::V1::Types::ChargeCapture]
|
1345
1329
|
# @example
|
@@ -1350,11 +1334,10 @@ module CandidApiClient
|
|
1350
1334
|
# charge_external_id: "string",
|
1351
1335
|
# ehr_source_url: "string",
|
1352
1336
|
# patient_external_id: "string",
|
1353
|
-
# status: PLANNED
|
1354
|
-
# date_of_service: DateTime.parse(2023-01-15)
|
1337
|
+
# status: PLANNED
|
1355
1338
|
# )
|
1356
1339
|
def update(charge_capture_id:, data: nil, charge_external_id: nil, ehr_source_url: nil,
|
1357
|
-
patient_external_id: nil, status: nil,
|
1340
|
+
patient_external_id: nil, status: nil, request_options: nil)
|
1358
1341
|
Async do
|
1359
1342
|
response = @request_client.conn.patch do |req|
|
1360
1343
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
@@ -1370,8 +1353,7 @@ module CandidApiClient
|
|
1370
1353
|
charge_external_id: charge_external_id,
|
1371
1354
|
ehr_source_url: ehr_source_url,
|
1372
1355
|
patient_external_id: patient_external_id,
|
1373
|
-
status: status
|
1374
|
-
date_of_service: date_of_service
|
1356
|
+
status: status
|
1375
1357
|
}.compact
|
1376
1358
|
req.url "#{@request_client.get_url(environment: CandidApi,
|
1377
1359
|
request_options: request_options)}/api/charge_captures/v1/#{charge_capture_id}"
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
require_relative "charge_capture_status"
|
4
4
|
require_relative "charge_capture_data"
|
5
|
-
require "date"
|
6
5
|
require_relative "charge_capture_error"
|
7
6
|
require_relative "charge_capture_post_billed_change"
|
8
7
|
require "ostruct"
|
@@ -25,9 +24,6 @@ module CandidApiClient
|
|
25
24
|
attr_reader :charge_external_id
|
26
25
|
# @return [String]
|
27
26
|
attr_reader :ehr_source_url
|
28
|
-
# @return [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
|
29
|
-
# This date must be the local date in the timezone where the service occurred.
|
30
|
-
attr_reader :date_of_service
|
31
27
|
# @return [CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureError]
|
32
28
|
attr_reader :error
|
33
29
|
# @return [Array<CandidApiClient::ChargeCapture::V1::Types::ChargeCapturePostBilledChange>]
|
@@ -48,22 +44,19 @@ module CandidApiClient
|
|
48
44
|
# @param patient_external_id [String]
|
49
45
|
# @param charge_external_id [String]
|
50
46
|
# @param ehr_source_url [String]
|
51
|
-
# @param date_of_service [Date] Date formatted as YYYY-MM-DD; eg: 2019-08-24.
|
52
|
-
# This date must be the local date in the timezone where the service occurred.
|
53
47
|
# @param error [CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureError]
|
54
48
|
# @param updates [Array<CandidApiClient::ChargeCapture::V1::Types::ChargeCapturePostBilledChange>]
|
55
49
|
# @param bundle_id [String]
|
56
50
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
57
51
|
# @return [CandidApiClient::ChargeCapture::V1::Types::ChargeCapture]
|
58
52
|
def initialize(id:, status:, charge_capture_data:, patient_external_id:, charge_external_id:, updates:,
|
59
|
-
ehr_source_url: OMIT,
|
53
|
+
ehr_source_url: OMIT, error: OMIT, bundle_id: OMIT, additional_properties: nil)
|
60
54
|
@id = id
|
61
55
|
@status = status
|
62
56
|
@charge_capture_data = charge_capture_data
|
63
57
|
@patient_external_id = patient_external_id
|
64
58
|
@charge_external_id = charge_external_id
|
65
59
|
@ehr_source_url = ehr_source_url if ehr_source_url != OMIT
|
66
|
-
@date_of_service = date_of_service if date_of_service != OMIT
|
67
60
|
@error = error if error != OMIT
|
68
61
|
@updates = updates
|
69
62
|
@bundle_id = bundle_id if bundle_id != OMIT
|
@@ -75,7 +68,6 @@ module CandidApiClient
|
|
75
68
|
"patient_external_id": patient_external_id,
|
76
69
|
"charge_external_id": charge_external_id,
|
77
70
|
"ehr_source_url": ehr_source_url,
|
78
|
-
"date_of_service": date_of_service,
|
79
71
|
"error": error,
|
80
72
|
"updates": updates,
|
81
73
|
"bundle_id": bundle_id
|
@@ -102,7 +94,6 @@ module CandidApiClient
|
|
102
94
|
patient_external_id = struct["patient_external_id"]
|
103
95
|
charge_external_id = struct["charge_external_id"]
|
104
96
|
ehr_source_url = struct["ehr_source_url"]
|
105
|
-
date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
|
106
97
|
if parsed_json["error"].nil?
|
107
98
|
error = nil
|
108
99
|
else
|
@@ -121,7 +112,6 @@ module CandidApiClient
|
|
121
112
|
patient_external_id: patient_external_id,
|
122
113
|
charge_external_id: charge_external_id,
|
123
114
|
ehr_source_url: ehr_source_url,
|
124
|
-
date_of_service: date_of_service,
|
125
115
|
error: error,
|
126
116
|
updates: updates,
|
127
117
|
bundle_id: bundle_id,
|
@@ -149,7 +139,6 @@ module CandidApiClient
|
|
149
139
|
obj.patient_external_id.is_a?(String) != false || raise("Passed value for field obj.patient_external_id is not the expected type, validation failed.")
|
150
140
|
obj.charge_external_id.is_a?(String) != false || raise("Passed value for field obj.charge_external_id is not the expected type, validation failed.")
|
151
141
|
obj.ehr_source_url&.is_a?(String) != false || raise("Passed value for field obj.ehr_source_url is not the expected type, validation failed.")
|
152
|
-
obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
|
153
142
|
obj.error.nil? || CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureError.validate_raw(obj: obj.error)
|
154
143
|
obj.updates.is_a?(Array) != false || raise("Passed value for field obj.updates is not the expected type, validation failed.")
|
155
144
|
obj.bundle_id&.is_a?(String) != false || raise("Passed value for field obj.bundle_id is not the expected type, validation failed.")
|
@@ -18,6 +18,10 @@ module CandidApiClient
|
|
18
18
|
# @return [CandidApiClient::ChargeCaptureBundles::V1::Types::ChargeCaptureBundleStatus] Status of the Bundle, Successful means that the Bundle created a corresponding
|
19
19
|
# Claim
|
20
20
|
attr_reader :status
|
21
|
+
# @return [Hash{String => String}] A dictionary of characteristics that are used to group charge captures together
|
22
|
+
# based on the bundling configuration.
|
23
|
+
# Example: {"service_facility.npi": "99999999", "date_of_service": "2023-01-01"}
|
24
|
+
attr_reader :characteristics
|
21
25
|
# @return [Array<CandidApiClient::ChargeCapture::V1::Types::ChargeCapture>] All the underlying ChargeCaptures that are present in a ChargeCaptureBundle.
|
22
26
|
attr_reader :charge_captures
|
23
27
|
# @return [Array<CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureError>] All errors that were found when the bundle was attempted to be created.
|
@@ -36,17 +40,21 @@ module CandidApiClient
|
|
36
40
|
# @param created_encounter_id [String]
|
37
41
|
# @param status [CandidApiClient::ChargeCaptureBundles::V1::Types::ChargeCaptureBundleStatus] Status of the Bundle, Successful means that the Bundle created a corresponding
|
38
42
|
# Claim
|
43
|
+
# @param characteristics [Hash{String => String}] A dictionary of characteristics that are used to group charge captures together
|
44
|
+
# based on the bundling configuration.
|
45
|
+
# Example: {"service_facility.npi": "99999999", "date_of_service": "2023-01-01"}
|
39
46
|
# @param charge_captures [Array<CandidApiClient::ChargeCapture::V1::Types::ChargeCapture>] All the underlying ChargeCaptures that are present in a ChargeCaptureBundle.
|
40
47
|
# @param errors [Array<CandidApiClient::ChargeCapture::V1::Types::ChargeCaptureError>] All errors that were found when the bundle was attempted to be created.
|
41
48
|
# Errors can correspond to the Bundle as a whole or specific underlying Charge
|
42
49
|
# Captures.
|
43
50
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
44
51
|
# @return [CandidApiClient::ChargeCaptureBundles::V1::Types::ChargeCaptureBundle]
|
45
|
-
def initialize(id:, status:, charge_captures:, errors:, created_encounter_id: OMIT,
|
52
|
+
def initialize(id:, status:, characteristics:, charge_captures:, errors:, created_encounter_id: OMIT,
|
46
53
|
additional_properties: nil)
|
47
54
|
@id = id
|
48
55
|
@created_encounter_id = created_encounter_id if created_encounter_id != OMIT
|
49
56
|
@status = status
|
57
|
+
@characteristics = characteristics
|
50
58
|
@charge_captures = charge_captures
|
51
59
|
@errors = errors
|
52
60
|
@additional_properties = additional_properties
|
@@ -54,6 +62,7 @@ module CandidApiClient
|
|
54
62
|
"id": id,
|
55
63
|
"created_encounter_id": created_encounter_id,
|
56
64
|
"status": status,
|
65
|
+
"characteristics": characteristics,
|
57
66
|
"charge_captures": charge_captures,
|
58
67
|
"errors": errors
|
59
68
|
}.reject do |_k, v|
|
@@ -71,6 +80,7 @@ module CandidApiClient
|
|
71
80
|
id = struct["id"]
|
72
81
|
created_encounter_id = struct["created_encounter_id"]
|
73
82
|
status = struct["status"]
|
83
|
+
characteristics = struct["characteristics"]
|
74
84
|
charge_captures = parsed_json["charge_captures"]&.map do |item|
|
75
85
|
item = item.to_json
|
76
86
|
CandidApiClient::ChargeCapture::V1::Types::ChargeCapture.from_json(json_object: item)
|
@@ -83,6 +93,7 @@ module CandidApiClient
|
|
83
93
|
id: id,
|
84
94
|
created_encounter_id: created_encounter_id,
|
85
95
|
status: status,
|
96
|
+
characteristics: characteristics,
|
86
97
|
charge_captures: charge_captures,
|
87
98
|
errors: errors,
|
88
99
|
additional_properties: struct
|
@@ -106,6 +117,7 @@ module CandidApiClient
|
|
106
117
|
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
107
118
|
obj.created_encounter_id&.is_a?(String) != false || raise("Passed value for field obj.created_encounter_id is not the expected type, validation failed.")
|
108
119
|
obj.status.is_a?(CandidApiClient::ChargeCaptureBundles::V1::Types::ChargeCaptureBundleStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
120
|
+
obj.characteristics.is_a?(Hash) != false || raise("Passed value for field obj.characteristics is not the expected type, validation failed.")
|
109
121
|
obj.charge_captures.is_a?(Array) != false || raise("Passed value for field obj.charge_captures is not the expected type, validation failed.")
|
110
122
|
obj.errors.is_a?(Array) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
|
111
123
|
end
|
@@ -6,11 +6,11 @@ module CandidApiClient
|
|
6
6
|
module Types
|
7
7
|
class ChargeCaptureBundleStatus
|
8
8
|
NOT_STARTED = "not-started"
|
9
|
-
IN_PROGRESS = "in-progress"
|
10
9
|
IN_ERROR = "in-error"
|
11
10
|
SUCCESSFUL = "successful"
|
12
11
|
SUCCESSFUL_DRY_RUN = "successful-dry-run"
|
13
12
|
ABORTED = "aborted"
|
13
|
+
HELD = "held"
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../requests"
|
4
|
+
require_relative "v_1/client"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Superbills
|
8
|
+
class Client
|
9
|
+
# @return [CandidApiClient::Superbills::V1::V1Client]
|
10
|
+
attr_reader :v_1
|
11
|
+
|
12
|
+
# @param request_client [CandidApiClient::RequestClient]
|
13
|
+
# @return [CandidApiClient::Superbills::Client]
|
14
|
+
def initialize(request_client:)
|
15
|
+
@v_1 = CandidApiClient::Superbills::V1::V1Client.new(request_client: request_client)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class AsyncClient
|
20
|
+
# @return [CandidApiClient::Superbills::V1::AsyncV1Client]
|
21
|
+
attr_reader :v_1
|
22
|
+
|
23
|
+
# @param request_client [CandidApiClient::AsyncRequestClient]
|
24
|
+
# @return [CandidApiClient::Superbills::AsyncClient]
|
25
|
+
def initialize(request_client:)
|
26
|
+
@v_1 = CandidApiClient::Superbills::V1::AsyncV1Client.new(request_client: request_client)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../requests"
|
4
|
+
require "date"
|
5
|
+
require_relative "../../commons/types/street_address_short_zip"
|
6
|
+
require_relative "types/superbill_response"
|
7
|
+
require "async"
|
8
|
+
|
9
|
+
module CandidApiClient
|
10
|
+
module Superbills
|
11
|
+
module V1
|
12
|
+
class V1Client
|
13
|
+
# @return [CandidApiClient::RequestClient]
|
14
|
+
attr_reader :request_client
|
15
|
+
|
16
|
+
# @param request_client [CandidApiClient::RequestClient]
|
17
|
+
# @return [CandidApiClient::Superbills::V1::V1Client]
|
18
|
+
def initialize(request_client:)
|
19
|
+
@request_client = request_client
|
20
|
+
end
|
21
|
+
|
22
|
+
# @param patient_external_id [String] Empty string not allowed
|
23
|
+
# @param date_range_min [Date] Minimum (inclusive) date selected for the superbill
|
24
|
+
# @param date_range_max [Date] Maximum (inclusive) date selected for the superbill
|
25
|
+
# @param pay_to_address [Hash] Address that will be displayed on the superbill as the 'Pay to' Address. If not
|
26
|
+
# provided this value will be set from available encounter data.Request of type CandidApiClient::Commons::Types::StreetAddressShortZip, as a Hash
|
27
|
+
# * :zip_plus_four_code (String)
|
28
|
+
# * :address_1 (String)
|
29
|
+
# * :address_2 (String)
|
30
|
+
# * :city (String)
|
31
|
+
# * :state (CandidApiClient::Commons::Types::State)
|
32
|
+
# * :zip_code (String)
|
33
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
34
|
+
# @return [CandidApiClient::Superbills::V1::Types::SuperbillResponse]
|
35
|
+
# @example
|
36
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
37
|
+
# api.superbills.v_1.create_superbill(
|
38
|
+
# patient_external_id: "string",
|
39
|
+
# date_range_min: DateTime.parse(2023-01-15),
|
40
|
+
# date_range_max: DateTime.parse(2023-01-15),
|
41
|
+
# pay_to_address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }
|
42
|
+
# )
|
43
|
+
def create_superbill(patient_external_id:, date_range_min:, date_range_max:, pay_to_address: nil,
|
44
|
+
request_options: nil)
|
45
|
+
response = @request_client.conn.post do |req|
|
46
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
47
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
48
|
+
req.headers = {
|
49
|
+
**(req.headers || {}),
|
50
|
+
**@request_client.get_headers,
|
51
|
+
**(request_options&.additional_headers || {})
|
52
|
+
}.compact
|
53
|
+
req.body = {
|
54
|
+
**(request_options&.additional_body_parameters || {}),
|
55
|
+
patient_external_id: patient_external_id,
|
56
|
+
date_range_min: date_range_min,
|
57
|
+
date_range_max: date_range_max,
|
58
|
+
pay_to_address: pay_to_address
|
59
|
+
}.compact
|
60
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
61
|
+
request_options: request_options)}/api/superbill/v1"
|
62
|
+
end
|
63
|
+
CandidApiClient::Superbills::V1::Types::SuperbillResponse.from_json(json_object: response.body)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class AsyncV1Client
|
68
|
+
# @return [CandidApiClient::AsyncRequestClient]
|
69
|
+
attr_reader :request_client
|
70
|
+
|
71
|
+
# @param request_client [CandidApiClient::AsyncRequestClient]
|
72
|
+
# @return [CandidApiClient::Superbills::V1::AsyncV1Client]
|
73
|
+
def initialize(request_client:)
|
74
|
+
@request_client = request_client
|
75
|
+
end
|
76
|
+
|
77
|
+
# @param patient_external_id [String] Empty string not allowed
|
78
|
+
# @param date_range_min [Date] Minimum (inclusive) date selected for the superbill
|
79
|
+
# @param date_range_max [Date] Maximum (inclusive) date selected for the superbill
|
80
|
+
# @param pay_to_address [Hash] Address that will be displayed on the superbill as the 'Pay to' Address. If not
|
81
|
+
# provided this value will be set from available encounter data.Request of type CandidApiClient::Commons::Types::StreetAddressShortZip, as a Hash
|
82
|
+
# * :zip_plus_four_code (String)
|
83
|
+
# * :address_1 (String)
|
84
|
+
# * :address_2 (String)
|
85
|
+
# * :city (String)
|
86
|
+
# * :state (CandidApiClient::Commons::Types::State)
|
87
|
+
# * :zip_code (String)
|
88
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
89
|
+
# @return [CandidApiClient::Superbills::V1::Types::SuperbillResponse]
|
90
|
+
# @example
|
91
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
92
|
+
# api.superbills.v_1.create_superbill(
|
93
|
+
# patient_external_id: "string",
|
94
|
+
# date_range_min: DateTime.parse(2023-01-15),
|
95
|
+
# date_range_max: DateTime.parse(2023-01-15),
|
96
|
+
# pay_to_address: { address_1: "123 Main St", address_2: "Apt 1", city: "New York", state: NY, zip_code: "10001", zip_plus_four_code: "1234" }
|
97
|
+
# )
|
98
|
+
def create_superbill(patient_external_id:, date_range_min:, date_range_max:, pay_to_address: nil,
|
99
|
+
request_options: nil)
|
100
|
+
Async do
|
101
|
+
response = @request_client.conn.post do |req|
|
102
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
103
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
104
|
+
req.headers = {
|
105
|
+
**(req.headers || {}),
|
106
|
+
**@request_client.get_headers,
|
107
|
+
**(request_options&.additional_headers || {})
|
108
|
+
}.compact
|
109
|
+
req.body = {
|
110
|
+
**(request_options&.additional_body_parameters || {}),
|
111
|
+
patient_external_id: patient_external_id,
|
112
|
+
date_range_min: date_range_min,
|
113
|
+
date_range_max: date_range_max,
|
114
|
+
pay_to_address: pay_to_address
|
115
|
+
}.compact
|
116
|
+
req.url "#{@request_client.get_url(environment: CandidApi,
|
117
|
+
request_options: request_options)}/api/superbill/v1"
|
118
|
+
end
|
119
|
+
CandidApiClient::Superbills::V1::Types::SuperbillResponse.from_json(json_object: response.body)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module Superbills
|
9
|
+
module V1
|
10
|
+
module Types
|
11
|
+
class Superbill
|
12
|
+
# @return [String] Primary id of the superbill.
|
13
|
+
attr_reader :superbill_id
|
14
|
+
# @return [String] external_id of the patient.
|
15
|
+
attr_reader :patient_external_id
|
16
|
+
# @return [String] Authenticated URL for downloading the generated superbill file.
|
17
|
+
attr_reader :authed_url
|
18
|
+
# @return [Date] Minimum (inclusive) date selected for this superbill.
|
19
|
+
attr_reader :date_range_min
|
20
|
+
# @return [Date] Maximum (inclusive) date selected for this superbill.
|
21
|
+
attr_reader :date_range_max
|
22
|
+
# @return [String] Original filename of the superbill.
|
23
|
+
attr_reader :file_name
|
24
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
+
attr_reader :additional_properties
|
26
|
+
# @return [Object]
|
27
|
+
attr_reader :_field_set
|
28
|
+
protected :_field_set
|
29
|
+
|
30
|
+
OMIT = Object.new
|
31
|
+
|
32
|
+
# @param superbill_id [String] Primary id of the superbill.
|
33
|
+
# @param patient_external_id [String] external_id of the patient.
|
34
|
+
# @param authed_url [String] Authenticated URL for downloading the generated superbill file.
|
35
|
+
# @param date_range_min [Date] Minimum (inclusive) date selected for this superbill.
|
36
|
+
# @param date_range_max [Date] Maximum (inclusive) date selected for this superbill.
|
37
|
+
# @param file_name [String] Original filename of the superbill.
|
38
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
|
+
# @return [CandidApiClient::Superbills::V1::Types::Superbill]
|
40
|
+
def initialize(superbill_id:, patient_external_id:, authed_url:, date_range_min:, date_range_max:,
|
41
|
+
file_name:, additional_properties: nil)
|
42
|
+
@superbill_id = superbill_id
|
43
|
+
@patient_external_id = patient_external_id
|
44
|
+
@authed_url = authed_url
|
45
|
+
@date_range_min = date_range_min
|
46
|
+
@date_range_max = date_range_max
|
47
|
+
@file_name = file_name
|
48
|
+
@additional_properties = additional_properties
|
49
|
+
@_field_set = {
|
50
|
+
"superbill_id": superbill_id,
|
51
|
+
"patient_external_id": patient_external_id,
|
52
|
+
"authed_url": authed_url,
|
53
|
+
"date_range_min": date_range_min,
|
54
|
+
"date_range_max": date_range_max,
|
55
|
+
"file_name": file_name
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Deserialize a JSON object to an instance of Superbill
|
60
|
+
#
|
61
|
+
# @param json_object [String]
|
62
|
+
# @return [CandidApiClient::Superbills::V1::Types::Superbill]
|
63
|
+
def self.from_json(json_object:)
|
64
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
65
|
+
parsed_json = JSON.parse(json_object)
|
66
|
+
superbill_id = struct["superbill_id"]
|
67
|
+
patient_external_id = struct["patient_external_id"]
|
68
|
+
authed_url = struct["authed_url"]
|
69
|
+
date_range_min = (Date.parse(parsed_json["date_range_min"]) unless parsed_json["date_range_min"].nil?)
|
70
|
+
date_range_max = (Date.parse(parsed_json["date_range_max"]) unless parsed_json["date_range_max"].nil?)
|
71
|
+
file_name = struct["file_name"]
|
72
|
+
new(
|
73
|
+
superbill_id: superbill_id,
|
74
|
+
patient_external_id: patient_external_id,
|
75
|
+
authed_url: authed_url,
|
76
|
+
date_range_min: date_range_min,
|
77
|
+
date_range_max: date_range_max,
|
78
|
+
file_name: file_name,
|
79
|
+
additional_properties: struct
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Serialize an instance of Superbill to a JSON object
|
84
|
+
#
|
85
|
+
# @return [String]
|
86
|
+
def to_json(*_args)
|
87
|
+
@_field_set&.to_json
|
88
|
+
end
|
89
|
+
|
90
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
91
|
+
# hash and check each fields type against the current object's property
|
92
|
+
# definitions.
|
93
|
+
#
|
94
|
+
# @param obj [Object]
|
95
|
+
# @return [Void]
|
96
|
+
def self.validate_raw(obj:)
|
97
|
+
obj.superbill_id.is_a?(String) != false || raise("Passed value for field obj.superbill_id is not the expected type, validation failed.")
|
98
|
+
obj.patient_external_id.is_a?(String) != false || raise("Passed value for field obj.patient_external_id is not the expected type, validation failed.")
|
99
|
+
obj.authed_url.is_a?(String) != false || raise("Passed value for field obj.authed_url is not the expected type, validation failed.")
|
100
|
+
obj.date_range_min.is_a?(Date) != false || raise("Passed value for field obj.date_range_min is not the expected type, validation failed.")
|
101
|
+
obj.date_range_max.is_a?(Date) != false || raise("Passed value for field obj.date_range_max is not the expected type, validation failed.")
|
102
|
+
obj.file_name.is_a?(String) != false || raise("Passed value for field obj.file_name is not the expected type, validation failed.")
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "superbill"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module Superbills
|
9
|
+
module V1
|
10
|
+
module Types
|
11
|
+
class SuperbillResponse
|
12
|
+
# @return [Array<CandidApiClient::Superbills::V1::Types::Superbill>] Each object represents a single Superbill for a single billing provider.
|
13
|
+
attr_reader :superbills
|
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 superbills [Array<CandidApiClient::Superbills::V1::Types::Superbill>] Each object represents a single Superbill for a single billing provider.
|
23
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
# @return [CandidApiClient::Superbills::V1::Types::SuperbillResponse]
|
25
|
+
def initialize(superbills:, additional_properties: nil)
|
26
|
+
@superbills = superbills
|
27
|
+
@additional_properties = additional_properties
|
28
|
+
@_field_set = { "superbills": superbills }
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deserialize a JSON object to an instance of SuperbillResponse
|
32
|
+
#
|
33
|
+
# @param json_object [String]
|
34
|
+
# @return [CandidApiClient::Superbills::V1::Types::SuperbillResponse]
|
35
|
+
def self.from_json(json_object:)
|
36
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
37
|
+
parsed_json = JSON.parse(json_object)
|
38
|
+
superbills = parsed_json["superbills"]&.map do |item|
|
39
|
+
item = item.to_json
|
40
|
+
CandidApiClient::Superbills::V1::Types::Superbill.from_json(json_object: item)
|
41
|
+
end
|
42
|
+
new(superbills: superbills, additional_properties: struct)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Serialize an instance of SuperbillResponse to a JSON object
|
46
|
+
#
|
47
|
+
# @return [String]
|
48
|
+
def to_json(*_args)
|
49
|
+
@_field_set&.to_json
|
50
|
+
end
|
51
|
+
|
52
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
53
|
+
# hash and check each fields type against the current object's property
|
54
|
+
# definitions.
|
55
|
+
#
|
56
|
+
# @param obj [Object]
|
57
|
+
# @return [Void]
|
58
|
+
def self.validate_raw(obj:)
|
59
|
+
obj.superbills.is_a?(Array) != false || raise("Passed value for field obj.superbills is not the expected type, validation failed.")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/lib/candidhealth.rb
CHANGED
@@ -34,6 +34,7 @@ require_relative "candidhealth/patient_refunds/client"
|
|
34
34
|
require_relative "candidhealth/payer_plan_groups/client"
|
35
35
|
require_relative "candidhealth/payers/client"
|
36
36
|
require_relative "candidhealth/service_lines/client"
|
37
|
+
require_relative "candidhealth/superbills/client"
|
37
38
|
require_relative "candidhealth/tasks/client"
|
38
39
|
require_relative "candidhealth/write_offs/client"
|
39
40
|
require_relative "candidhealth/pre_encounter/client"
|
@@ -102,6 +103,8 @@ module CandidApiClient
|
|
102
103
|
attr_reader :payers
|
103
104
|
# @return [CandidApiClient::ServiceLines::Client]
|
104
105
|
attr_reader :service_lines
|
106
|
+
# @return [CandidApiClient::Superbills::Client]
|
107
|
+
attr_reader :superbills
|
105
108
|
# @return [CandidApiClient::Tasks::Client]
|
106
109
|
attr_reader :tasks
|
107
110
|
# @return [CandidApiClient::WriteOffs::Client]
|
@@ -169,6 +172,7 @@ module CandidApiClient
|
|
169
172
|
@payer_plan_groups = CandidApiClient::PayerPlanGroups::Client.new(request_client: @request_client)
|
170
173
|
@payers = CandidApiClient::Payers::Client.new(request_client: @request_client)
|
171
174
|
@service_lines = CandidApiClient::ServiceLines::Client.new(request_client: @request_client)
|
175
|
+
@superbills = CandidApiClient::Superbills::Client.new(request_client: @request_client)
|
172
176
|
@tasks = CandidApiClient::Tasks::Client.new(request_client: @request_client)
|
173
177
|
@write_offs = CandidApiClient::WriteOffs::Client.new(request_client: @request_client)
|
174
178
|
@pre_encounter = CandidApiClient::PreEncounter::Client.new(request_client: @request_client)
|
@@ -238,6 +242,8 @@ module CandidApiClient
|
|
238
242
|
attr_reader :payers
|
239
243
|
# @return [CandidApiClient::ServiceLines::AsyncClient]
|
240
244
|
attr_reader :service_lines
|
245
|
+
# @return [CandidApiClient::Superbills::AsyncClient]
|
246
|
+
attr_reader :superbills
|
241
247
|
# @return [CandidApiClient::Tasks::AsyncClient]
|
242
248
|
attr_reader :tasks
|
243
249
|
# @return [CandidApiClient::WriteOffs::AsyncClient]
|
@@ -305,6 +311,7 @@ module CandidApiClient
|
|
305
311
|
@payer_plan_groups = CandidApiClient::PayerPlanGroups::AsyncClient.new(request_client: @async_request_client)
|
306
312
|
@payers = CandidApiClient::Payers::AsyncClient.new(request_client: @async_request_client)
|
307
313
|
@service_lines = CandidApiClient::ServiceLines::AsyncClient.new(request_client: @async_request_client)
|
314
|
+
@superbills = CandidApiClient::Superbills::AsyncClient.new(request_client: @async_request_client)
|
308
315
|
@tasks = CandidApiClient::Tasks::AsyncClient.new(request_client: @async_request_client)
|
309
316
|
@write_offs = CandidApiClient::WriteOffs::AsyncClient.new(request_client: @async_request_client)
|
310
317
|
@pre_encounter = CandidApiClient::PreEncounter::AsyncClient.new(request_client: @async_request_client)
|
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.41.
|
46
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.41.5" }
|
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.41.
|
90
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.41.5" }
|
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
@@ -269,6 +269,8 @@ require_relative "candidhealth/service_lines/v_2/types/test_result_type"
|
|
269
269
|
require_relative "candidhealth/service_lines/v_2/types/test_result"
|
270
270
|
require_relative "candidhealth/service_lines/v_2/types/service_id_qualifier"
|
271
271
|
require_relative "candidhealth/service_lines/v_2/types/measurement_unit_code"
|
272
|
+
require_relative "candidhealth/superbills/v_1/types/superbill"
|
273
|
+
require_relative "candidhealth/superbills/v_1/types/superbill_response"
|
272
274
|
require_relative "candidhealth/tasks/v_3/types/task"
|
273
275
|
require_relative "candidhealth/tasks/v_3/types/task_note"
|
274
276
|
require_relative "candidhealth/tasks/v_3/types/task_assignment"
|
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.41.
|
4
|
+
version: 0.41.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|
@@ -641,6 +641,10 @@ files:
|
|
641
641
|
- lib/candidhealth/service_lines/v_2/types/service_line_update.rb
|
642
642
|
- lib/candidhealth/service_lines/v_2/types/test_result.rb
|
643
643
|
- lib/candidhealth/service_lines/v_2/types/test_result_type.rb
|
644
|
+
- lib/candidhealth/superbills/client.rb
|
645
|
+
- lib/candidhealth/superbills/v_1/client.rb
|
646
|
+
- lib/candidhealth/superbills/v_1/types/superbill.rb
|
647
|
+
- lib/candidhealth/superbills/v_1/types/superbill_response.rb
|
644
648
|
- lib/candidhealth/tags/types/tag.rb
|
645
649
|
- lib/candidhealth/tags/types/tag_color_enum.rb
|
646
650
|
- lib/candidhealth/tags/types/tag_create.rb
|