candidhealth 0.46.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/candidhealth/auth/client.rb +7 -7
- data/lib/candidhealth/auth/{v_2 → default}/client.rb +39 -13
- data/lib/candidhealth/auth/{v_2 → default}/types/auth_get_token_response.rb +3 -3
- data/lib/candidhealth/auth/default/types/invalid_content_type_error_type.rb +60 -0
- data/lib/candidhealth/auth/{v_2 → default}/types/too_many_requests_error_type.rb +3 -3
- data/lib/candidhealth/billing_notes/v_2/types/billing_note_base_optional.rb +62 -0
- data/lib/candidhealth/charge_capture/v_1/client.rb +504 -524
- data/lib/candidhealth/charge_capture/v_1/types/charge_capture.rb +17 -1
- data/lib/candidhealth/charge_capture/v_1/types/charge_capture_data.rb +173 -173
- data/lib/candidhealth/charge_capture/v_1/types/charge_capture_error.rb +26 -2
- data/lib/candidhealth/charge_capture_bundles/v_1/client.rb +58 -0
- data/lib/candidhealth/claim_submission/v_1/types/claim_submission_record_create_optional.rb +100 -0
- data/lib/candidhealth/claim_submission/v_1/types/external_claim_submission_create_optional.rb +101 -0
- data/lib/candidhealth/commons/types/phone_number_optional.rb +71 -0
- data/lib/candidhealth/commons/types/procedure_modifier.rb +2 -0
- data/lib/candidhealth/commons/types/street_address_long_zip_optional.rb +107 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_instance_optional.rb +78 -0
- data/lib/candidhealth/diagnoses/client.rb +23 -4
- data/lib/candidhealth/diagnoses/types/diagnosis.rb +21 -2
- data/lib/candidhealth/diagnoses/types/diagnosis_create.rb +25 -2
- data/lib/candidhealth/diagnoses/types/diagnosis_create_optional.rb +126 -0
- data/lib/candidhealth/diagnoses/types/standalone_diagnosis_create.rb +22 -2
- data/lib/candidhealth/encounter_providers/v_2/types/ordering_provider_optional.rb +123 -0
- data/lib/candidhealth/encounters/v_4/client.rb +214 -208
- data/lib/candidhealth/encounters/v_4/types/claim_supplemental_information_optional.rb +86 -0
- data/lib/candidhealth/encounters/v_4/types/clinical_note_category_create_optional.rb +78 -0
- data/lib/candidhealth/encounters/v_4/types/clinical_note_optional.rb +93 -0
- data/lib/candidhealth/encounters/v_4/types/encounter.rb +16 -4
- data/lib/candidhealth/encounters/v_4/types/encounter_create_from_pre_encounter.rb +4 -2
- data/lib/candidhealth/encounters/v_4/types/encounter_deep_optional.rb +780 -0
- data/lib/candidhealth/encounters/v_4/types/encounter_optional.rb +1 -139
- data/lib/candidhealth/encounters/v_4/types/epsdt_referral_optional.rb +85 -0
- data/lib/candidhealth/encounters/v_4/types/intake_question_optional.rb +84 -0
- data/lib/candidhealth/encounters/v_4/types/intervention_optional.rb +114 -0
- data/lib/candidhealth/encounters/v_4/types/lab_optional.rb +80 -0
- data/lib/candidhealth/encounters/v_4/types/medication_optional.rb +108 -0
- data/lib/candidhealth/encounters/v_4/types/patient_history_category_optional.rb +78 -0
- data/lib/candidhealth/guarantor/v_1/types/guarantor_optional.rb +144 -0
- data/lib/candidhealth/individual/types/individual_base_optional.rb +78 -0
- data/lib/candidhealth/individual/types/patient_non_insurance_payer_info_create_optional.rb +89 -0
- data/lib/candidhealth/individual/types/patient_update_with_optional_address.rb +8 -8
- data/lib/candidhealth/individual/types/subscriber_base_optional.rb +118 -0
- data/lib/candidhealth/individual/types/subscriber_create_optional.rb +132 -0
- data/lib/candidhealth/insurance_adjudications/v_1/client.rb +2 -0
- data/lib/candidhealth/insurance_adjudications/v_1/types/insurance_adjudication_create.rb +9 -1
- data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_create_optional.rb +167 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +13 -13
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +4 -4
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb +10 -10
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/latest_eligibility_check.rb +4 -4
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb +4 -4
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb +140 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/batch_eligibility_response.rb +75 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_check.rb +18 -6
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_check_error.rb +80 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_check_error_details.rb +112 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_check_error_source.rb +17 -0
- data/lib/candidhealth/pre_encounter/{coverages → eligibility_checks}/v_1/types/eligibility_check_metadata.rb +7 -7
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_check_page.rb +98 -0
- data/lib/candidhealth/pre_encounter/{coverages → eligibility_checks}/v_1/types/eligibility_check_status.rb +2 -2
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_request.rb +18 -2
- data/lib/candidhealth/pre_encounter/{coverages → eligibility_checks}/v_1/types/eligibility_status.rb +2 -1
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/parsed_response.rb +4 -4
- data/lib/candidhealth/pre_encounter/patients/v_1/types/authorization.rb +13 -1
- data/lib/candidhealth/service_lines/v_2/types/denial_reason_content.rb +1 -0
- data/lib/candidhealth/service_lines/v_2/types/drug_identification_optional.rb +126 -0
- data/lib/candidhealth/service_lines/v_2/types/service_line_create_optional.rb +239 -0
- data/lib/candidhealth/service_lines/v_2/types/test_result_optional.rb +73 -0
- data/lib/candidhealth/write_offs/v_1/types/insurance_write_off_reason.rb +1 -0
- data/lib/candidhealth/write_offs/v_1/types/patient_write_off_reason.rb +1 -0
- data/lib/candidhealth/yes_no_indicator/types/yes_no_indicator.rb +14 -0
- data/lib/core/oauth.rb +2 -2
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +41 -8
- metadata +42 -9
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/eligibility_check.rb +0 -116
data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "eligibility_check_metadata"
|
4
|
-
require_relative "eligibility_check"
|
3
|
+
require_relative "../../../eligibility_checks/v_1/types/eligibility_check_metadata"
|
4
|
+
require_relative "../../../eligibility_checks/v_1/types/eligibility_check"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
7
7
|
|
@@ -11,9 +11,9 @@ module CandidApiClient
|
|
11
11
|
module V1
|
12
12
|
module Types
|
13
13
|
class CoverageEligibilityCheckResponse
|
14
|
-
# @return [CandidApiClient::PreEncounter::
|
14
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata]
|
15
15
|
attr_reader :metadata
|
16
|
-
# @return [CandidApiClient::PreEncounter::
|
16
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck]
|
17
17
|
attr_reader :check
|
18
18
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
19
|
attr_reader :additional_properties
|
@@ -23,8 +23,8 @@ module CandidApiClient
|
|
23
23
|
|
24
24
|
OMIT = Object.new
|
25
25
|
|
26
|
-
# @param metadata [CandidApiClient::PreEncounter::
|
27
|
-
# @param check [CandidApiClient::PreEncounter::
|
26
|
+
# @param metadata [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata]
|
27
|
+
# @param check [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck]
|
28
28
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
29
|
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageEligibilityCheckResponse]
|
30
30
|
def initialize(metadata:, check: OMIT, additional_properties: nil)
|
@@ -47,13 +47,13 @@ module CandidApiClient
|
|
47
47
|
metadata = nil
|
48
48
|
else
|
49
49
|
metadata = parsed_json["metadata"].to_json
|
50
|
-
metadata = CandidApiClient::PreEncounter::
|
50
|
+
metadata = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata.from_json(json_object: metadata)
|
51
51
|
end
|
52
52
|
if parsed_json["check"].nil?
|
53
53
|
check = nil
|
54
54
|
else
|
55
55
|
check = parsed_json["check"].to_json
|
56
|
-
check = CandidApiClient::PreEncounter::
|
56
|
+
check = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck.from_json(json_object: check)
|
57
57
|
end
|
58
58
|
new(
|
59
59
|
metadata: metadata,
|
@@ -76,8 +76,8 @@ module CandidApiClient
|
|
76
76
|
# @param obj [Object]
|
77
77
|
# @return [Void]
|
78
78
|
def self.validate_raw(obj:)
|
79
|
-
CandidApiClient::PreEncounter::
|
80
|
-
obj.check.nil? || CandidApiClient::PreEncounter::
|
79
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata.validate_raw(obj: obj.metadata)
|
80
|
+
obj.check.nil? || CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck.validate_raw(obj: obj.check)
|
81
81
|
end
|
82
82
|
end
|
83
83
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "eligibility_status"
|
3
|
+
require_relative "../../../eligibility_checks/v_1/types/eligibility_status"
|
4
4
|
require "date"
|
5
5
|
require "ostruct"
|
6
6
|
require "json"
|
@@ -14,7 +14,7 @@ module CandidApiClient
|
|
14
14
|
class LatestEligibilityCheck
|
15
15
|
# @return [String]
|
16
16
|
attr_reader :check_id
|
17
|
-
# @return [CandidApiClient::PreEncounter::
|
17
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityStatus]
|
18
18
|
attr_reader :status
|
19
19
|
# @return [DateTime]
|
20
20
|
attr_reader :initiated_at
|
@@ -27,7 +27,7 @@ module CandidApiClient
|
|
27
27
|
OMIT = Object.new
|
28
28
|
|
29
29
|
# @param check_id [String]
|
30
|
-
# @param status [CandidApiClient::PreEncounter::
|
30
|
+
# @param status [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityStatus]
|
31
31
|
# @param initiated_at [DateTime]
|
32
32
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
33
33
|
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck]
|
@@ -72,7 +72,7 @@ module CandidApiClient
|
|
72
72
|
# @return [Void]
|
73
73
|
def self.validate_raw(obj:)
|
74
74
|
obj.check_id.is_a?(String) != false || raise("Passed value for field obj.check_id is not the expected type, validation failed.")
|
75
|
-
obj.status.is_a?(CandidApiClient::PreEncounter::
|
75
|
+
obj.status.is_a?(CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
76
76
|
obj.initiated_at.is_a?(DateTime) != false || raise("Passed value for field obj.initiated_at is not the expected type, validation failed.")
|
77
77
|
end
|
78
78
|
end
|
@@ -4,7 +4,7 @@ require_relative "coverage_status"
|
|
4
4
|
require_relative "subscriber"
|
5
5
|
require_relative "../../../common/types/relationship"
|
6
6
|
require_relative "insurance_plan"
|
7
|
-
require_relative "eligibility_check_metadata"
|
7
|
+
require_relative "../../../eligibility_checks/v_1/types/eligibility_check_metadata"
|
8
8
|
require_relative "latest_eligibility_check"
|
9
9
|
require_relative "coverage_benefits"
|
10
10
|
require "ostruct"
|
@@ -31,7 +31,7 @@ module CandidApiClient
|
|
31
31
|
attr_reader :insurance_plan
|
32
32
|
# @return [Boolean] A boolean indicating if the coverage has been verified by a user.
|
33
33
|
attr_reader :verified
|
34
|
-
# @return [Array<CandidApiClient::PreEncounter::
|
34
|
+
# @return [Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata>] A list of eligibility check metadata that have been initiated on this coverage.
|
35
35
|
attr_reader :eligibility_checks
|
36
36
|
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck] The latest eligibility check metadata that has been initiated on this coverage.
|
37
37
|
attr_reader :latest_eligibility_check
|
@@ -54,7 +54,7 @@ module CandidApiClient
|
|
54
54
|
# @param patient [String] The patient who benefits from the insurance coverage
|
55
55
|
# @param insurance_plan [CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan]
|
56
56
|
# @param verified [Boolean] A boolean indicating if the coverage has been verified by a user.
|
57
|
-
# @param eligibility_checks [Array<CandidApiClient::PreEncounter::
|
57
|
+
# @param eligibility_checks [Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata>] A list of eligibility check metadata that have been initiated on this coverage.
|
58
58
|
# @param latest_eligibility_check [CandidApiClient::PreEncounter::Coverages::V1::Types::LatestEligibilityCheck] The latest eligibility check metadata that has been initiated on this coverage.
|
59
59
|
# @param benefits [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits] The eligibility of the patient for the coverage, manually verified by users.
|
60
60
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
@@ -111,7 +111,7 @@ module CandidApiClient
|
|
111
111
|
verified = struct["verified"]
|
112
112
|
eligibility_checks = parsed_json["eligibility_checks"]&.map do |item|
|
113
113
|
item = item.to_json
|
114
|
-
CandidApiClient::PreEncounter::
|
114
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckMetadata.from_json(json_object: item)
|
115
115
|
end
|
116
116
|
if parsed_json["latest_eligibility_check"].nil?
|
117
117
|
latest_eligibility_check = nil
|
@@ -3,6 +3,8 @@
|
|
3
3
|
require_relative "../../../../requests"
|
4
4
|
require_relative "types/eligibility_request"
|
5
5
|
require_relative "types/eligibility_response"
|
6
|
+
require_relative "types/batch_eligibility_response"
|
7
|
+
require_relative "types/eligibility_check_page"
|
6
8
|
require "async"
|
7
9
|
|
8
10
|
module CandidApiClient
|
@@ -26,6 +28,7 @@ module CandidApiClient
|
|
26
28
|
# for more information.</Warning>
|
27
29
|
#
|
28
30
|
# @param request [Hash] Request of type CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest, as a Hash
|
31
|
+
# * :submitter_transaction_identifier (String)
|
29
32
|
# * :payer_id (String)
|
30
33
|
# * :provider (Hash)
|
31
34
|
# * :subscriber (Hash)
|
@@ -61,6 +64,72 @@ module CandidApiClient
|
|
61
64
|
end
|
62
65
|
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck.from_json(json_object: response.body)
|
63
66
|
end
|
67
|
+
|
68
|
+
# Sends a batch of eligibility checks to payers through Stedi.
|
69
|
+
#
|
70
|
+
# @param request [Array<Hash>] Request of type Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest>, as a Hash
|
71
|
+
# * :submitter_transaction_identifier (String)
|
72
|
+
# * :payer_id (String)
|
73
|
+
# * :provider (Hash)
|
74
|
+
# * :subscriber (Hash)
|
75
|
+
# * :member_id (String)
|
76
|
+
# * :first_name (String)
|
77
|
+
# * :last_name (String)
|
78
|
+
# * :date_of_birth (Date)
|
79
|
+
# * :dependent (Hash)
|
80
|
+
# * :member_id (String)
|
81
|
+
# * :first_name (String)
|
82
|
+
# * :last_name (String)
|
83
|
+
# * :date_of_birth (Date)
|
84
|
+
# * :encounter (Hash)
|
85
|
+
# * :date_of_service (Date)
|
86
|
+
# * :service_type_codes (Array<String>)
|
87
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
88
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse]
|
89
|
+
# @example
|
90
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
91
|
+
# api.pre_encounter.eligibility_checks.v_1.batch(request: [{ payer_id: "payer_id", provider: { npi: "npi" }, subscriber: { first_name: "first_name", last_name: "last_name" } }, { payer_id: "payer_id", provider: { npi: "npi" }, subscriber: { first_name: "first_name", last_name: "last_name" } }])
|
92
|
+
def batch(request:, request_options: nil)
|
93
|
+
response = @request_client.conn.post do |req|
|
94
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
95
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
96
|
+
req.headers = {
|
97
|
+
**(req.headers || {}),
|
98
|
+
**@request_client.get_headers,
|
99
|
+
**(request_options&.additional_headers || {})
|
100
|
+
}.compact
|
101
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
102
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
103
|
+
request_options: request_options)}/eligibility-checks/v1/batch"
|
104
|
+
end
|
105
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse.from_json(json_object: response.body)
|
106
|
+
end
|
107
|
+
|
108
|
+
# Polls the status of a batch eligibility check.
|
109
|
+
# <Note>Batch eligibility checks are not yet available. Please reach out to the
|
110
|
+
# Candid team for more information.</Note>
|
111
|
+
# path-parameters:
|
112
|
+
#
|
113
|
+
# @param batch_id [String]
|
114
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
115
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage]
|
116
|
+
# @example
|
117
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
118
|
+
# api.pre_encounter.eligibility_checks.v_1.poll_batch(batch_id: "batch_id")
|
119
|
+
def poll_batch(batch_id:, request_options: nil)
|
120
|
+
response = @request_client.conn.get do |req|
|
121
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
122
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
123
|
+
req.headers = {
|
124
|
+
**(req.headers || {}),
|
125
|
+
**@request_client.get_headers,
|
126
|
+
**(request_options&.additional_headers || {})
|
127
|
+
}.compact
|
128
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
129
|
+
request_options: request_options)}/eligibility-checks/v1/batch/#{batch_id}"
|
130
|
+
end
|
131
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage.from_json(json_object: response.body)
|
132
|
+
end
|
64
133
|
end
|
65
134
|
|
66
135
|
class AsyncV1Client
|
@@ -80,6 +149,7 @@ module CandidApiClient
|
|
80
149
|
# for more information.</Warning>
|
81
150
|
#
|
82
151
|
# @param request [Hash] Request of type CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest, as a Hash
|
152
|
+
# * :submitter_transaction_identifier (String)
|
83
153
|
# * :payer_id (String)
|
84
154
|
# * :provider (Hash)
|
85
155
|
# * :subscriber (Hash)
|
@@ -117,6 +187,76 @@ module CandidApiClient
|
|
117
187
|
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck.from_json(json_object: response.body)
|
118
188
|
end
|
119
189
|
end
|
190
|
+
|
191
|
+
# Sends a batch of eligibility checks to payers through Stedi.
|
192
|
+
#
|
193
|
+
# @param request [Array<Hash>] Request of type Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest>, as a Hash
|
194
|
+
# * :submitter_transaction_identifier (String)
|
195
|
+
# * :payer_id (String)
|
196
|
+
# * :provider (Hash)
|
197
|
+
# * :subscriber (Hash)
|
198
|
+
# * :member_id (String)
|
199
|
+
# * :first_name (String)
|
200
|
+
# * :last_name (String)
|
201
|
+
# * :date_of_birth (Date)
|
202
|
+
# * :dependent (Hash)
|
203
|
+
# * :member_id (String)
|
204
|
+
# * :first_name (String)
|
205
|
+
# * :last_name (String)
|
206
|
+
# * :date_of_birth (Date)
|
207
|
+
# * :encounter (Hash)
|
208
|
+
# * :date_of_service (Date)
|
209
|
+
# * :service_type_codes (Array<String>)
|
210
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
211
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse]
|
212
|
+
# @example
|
213
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
214
|
+
# api.pre_encounter.eligibility_checks.v_1.batch(request: [{ payer_id: "payer_id", provider: { npi: "npi" }, subscriber: { first_name: "first_name", last_name: "last_name" } }, { payer_id: "payer_id", provider: { npi: "npi" }, subscriber: { first_name: "first_name", last_name: "last_name" } }])
|
215
|
+
def batch(request:, request_options: nil)
|
216
|
+
Async do
|
217
|
+
response = @request_client.conn.post do |req|
|
218
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
219
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
220
|
+
req.headers = {
|
221
|
+
**(req.headers || {}),
|
222
|
+
**@request_client.get_headers,
|
223
|
+
**(request_options&.additional_headers || {})
|
224
|
+
}.compact
|
225
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
226
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
227
|
+
request_options: request_options)}/eligibility-checks/v1/batch"
|
228
|
+
end
|
229
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse.from_json(json_object: response.body)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
# Polls the status of a batch eligibility check.
|
234
|
+
# <Note>Batch eligibility checks are not yet available. Please reach out to the
|
235
|
+
# Candid team for more information.</Note>
|
236
|
+
# path-parameters:
|
237
|
+
#
|
238
|
+
# @param batch_id [String]
|
239
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
240
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage]
|
241
|
+
# @example
|
242
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
243
|
+
# api.pre_encounter.eligibility_checks.v_1.poll_batch(batch_id: "batch_id")
|
244
|
+
def poll_batch(batch_id:, request_options: nil)
|
245
|
+
Async do
|
246
|
+
response = @request_client.conn.get do |req|
|
247
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
248
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
249
|
+
req.headers = {
|
250
|
+
**(req.headers || {}),
|
251
|
+
**@request_client.get_headers,
|
252
|
+
**(request_options&.additional_headers || {})
|
253
|
+
}.compact
|
254
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
255
|
+
request_options: request_options)}/eligibility-checks/v1/batch/#{batch_id}"
|
256
|
+
end
|
257
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage.from_json(json_object: response.body)
|
258
|
+
end
|
259
|
+
end
|
120
260
|
end
|
121
261
|
end
|
122
262
|
end
|
data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/batch_eligibility_response.rb
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module PreEncounter
|
9
|
+
module EligibilityChecks
|
10
|
+
module V1
|
11
|
+
module Types
|
12
|
+
# An object representing the data for a batch eligibility response.
|
13
|
+
class BatchEligibilityResponse
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :batch_id
|
16
|
+
# @return [DateTime]
|
17
|
+
attr_reader :submitted_at
|
18
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
attr_reader :additional_properties
|
20
|
+
# @return [Object]
|
21
|
+
attr_reader :_field_set
|
22
|
+
protected :_field_set
|
23
|
+
|
24
|
+
OMIT = Object.new
|
25
|
+
|
26
|
+
# @param batch_id [String]
|
27
|
+
# @param submitted_at [DateTime]
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse]
|
30
|
+
def initialize(batch_id:, submitted_at:, additional_properties: nil)
|
31
|
+
@batch_id = batch_id
|
32
|
+
@submitted_at = submitted_at
|
33
|
+
@additional_properties = additional_properties
|
34
|
+
@_field_set = { "batch_id": batch_id, "submitted_at": submitted_at }
|
35
|
+
end
|
36
|
+
|
37
|
+
# Deserialize a JSON object to an instance of BatchEligibilityResponse
|
38
|
+
#
|
39
|
+
# @param json_object [String]
|
40
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse]
|
41
|
+
def self.from_json(json_object:)
|
42
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
|
+
parsed_json = JSON.parse(json_object)
|
44
|
+
batch_id = struct["batch_id"]
|
45
|
+
submitted_at = (DateTime.parse(parsed_json["submitted_at"]) unless parsed_json["submitted_at"].nil?)
|
46
|
+
new(
|
47
|
+
batch_id: batch_id,
|
48
|
+
submitted_at: submitted_at,
|
49
|
+
additional_properties: struct
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Serialize an instance of BatchEligibilityResponse to a JSON object
|
54
|
+
#
|
55
|
+
# @return [String]
|
56
|
+
def to_json(*_args)
|
57
|
+
@_field_set&.to_json
|
58
|
+
end
|
59
|
+
|
60
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
61
|
+
# hash and check each fields type against the current object's property
|
62
|
+
# definitions.
|
63
|
+
#
|
64
|
+
# @param obj [Object]
|
65
|
+
# @return [Void]
|
66
|
+
def self.validate_raw(obj:)
|
67
|
+
obj.batch_id.is_a?(String) != false || raise("Passed value for field obj.batch_id is not the expected type, validation failed.")
|
68
|
+
obj.submitted_at.is_a?(DateTime) != false || raise("Passed value for field obj.submitted_at is not the expected type, validation failed.")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "eligibility_check_error"
|
3
4
|
require_relative "eligibility_request"
|
4
5
|
require_relative "parsed_response"
|
5
6
|
require_relative "request_correction"
|
@@ -12,7 +13,9 @@ module CandidApiClient
|
|
12
13
|
module V1
|
13
14
|
module Types
|
14
15
|
class EligibilityCheck
|
15
|
-
# @return [
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :batch_id
|
18
|
+
# @return [Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckError>]
|
16
19
|
attr_reader :errors
|
17
20
|
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest]
|
18
21
|
attr_reader :request
|
@@ -30,15 +33,17 @@ module CandidApiClient
|
|
30
33
|
|
31
34
|
OMIT = Object.new
|
32
35
|
|
33
|
-
# @param
|
36
|
+
# @param batch_id [String]
|
37
|
+
# @param errors [Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckError>]
|
34
38
|
# @param request [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest]
|
35
39
|
# @param response [Object]
|
36
40
|
# @param parsed_response [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ParsedResponse]
|
37
41
|
# @param request_corrections [Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::RequestCorrection>]
|
38
42
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
43
|
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck]
|
40
|
-
def initialize(response:,
|
41
|
-
additional_properties: nil)
|
44
|
+
def initialize(response:, batch_id: OMIT, errors: OMIT, request: OMIT, parsed_response: OMIT,
|
45
|
+
request_corrections: OMIT, additional_properties: nil)
|
46
|
+
@batch_id = batch_id if batch_id != OMIT
|
42
47
|
@errors = errors if errors != OMIT
|
43
48
|
@request = request if request != OMIT
|
44
49
|
@response = response
|
@@ -46,6 +51,7 @@ module CandidApiClient
|
|
46
51
|
@request_corrections = request_corrections if request_corrections != OMIT
|
47
52
|
@additional_properties = additional_properties
|
48
53
|
@_field_set = {
|
54
|
+
"batch_id": batch_id,
|
49
55
|
"errors": errors,
|
50
56
|
"request": request,
|
51
57
|
"response": response,
|
@@ -63,7 +69,11 @@ module CandidApiClient
|
|
63
69
|
def self.from_json(json_object:)
|
64
70
|
struct = JSON.parse(json_object, object_class: OpenStruct)
|
65
71
|
parsed_json = JSON.parse(json_object)
|
66
|
-
|
72
|
+
batch_id = struct["batch_id"]
|
73
|
+
errors = parsed_json["errors"]&.map do |item|
|
74
|
+
item = item.to_json
|
75
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckError.from_json(json_object: item)
|
76
|
+
end
|
67
77
|
if parsed_json["request"].nil?
|
68
78
|
request = nil
|
69
79
|
else
|
@@ -82,6 +92,7 @@ module CandidApiClient
|
|
82
92
|
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::RequestCorrection.from_json(json_object: item)
|
83
93
|
end
|
84
94
|
new(
|
95
|
+
batch_id: batch_id,
|
85
96
|
errors: errors,
|
86
97
|
request: request,
|
87
98
|
response: response,
|
@@ -105,7 +116,8 @@ module CandidApiClient
|
|
105
116
|
# @param obj [Object]
|
106
117
|
# @return [Void]
|
107
118
|
def self.validate_raw(obj:)
|
108
|
-
obj.
|
119
|
+
obj.batch_id&.is_a?(String) != false || raise("Passed value for field obj.batch_id is not the expected type, validation failed.")
|
120
|
+
obj.errors&.is_a?(Array) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
|
109
121
|
obj.request.nil? || CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest.validate_raw(obj: obj.request)
|
110
122
|
obj.response.is_a?(Object) != false || raise("Passed value for field obj.response is not the expected type, validation failed.")
|
111
123
|
obj.parsed_response.nil? || CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ParsedResponse.validate_raw(obj: obj.parsed_response)
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "eligibility_check_error_source"
|
4
|
+
require_relative "eligibility_check_error_details"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module CandidApiClient
|
9
|
+
module PreEncounter
|
10
|
+
module EligibilityChecks
|
11
|
+
module V1
|
12
|
+
module Types
|
13
|
+
class EligibilityCheckError
|
14
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorSource]
|
15
|
+
attr_reader :source
|
16
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorDetails]
|
17
|
+
attr_reader :error_details
|
18
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
attr_reader :additional_properties
|
20
|
+
# @return [Object]
|
21
|
+
attr_reader :_field_set
|
22
|
+
protected :_field_set
|
23
|
+
|
24
|
+
OMIT = Object.new
|
25
|
+
|
26
|
+
# @param source [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorSource]
|
27
|
+
# @param error_details [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorDetails]
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckError]
|
30
|
+
def initialize(source:, error_details:, additional_properties: nil)
|
31
|
+
@source = source
|
32
|
+
@error_details = error_details
|
33
|
+
@additional_properties = additional_properties
|
34
|
+
@_field_set = { "source": source, "errorDetails": error_details }
|
35
|
+
end
|
36
|
+
|
37
|
+
# Deserialize a JSON object to an instance of EligibilityCheckError
|
38
|
+
#
|
39
|
+
# @param json_object [String]
|
40
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckError]
|
41
|
+
def self.from_json(json_object:)
|
42
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
|
+
parsed_json = JSON.parse(json_object)
|
44
|
+
source = struct["source"]
|
45
|
+
if parsed_json["errorDetails"].nil?
|
46
|
+
error_details = nil
|
47
|
+
else
|
48
|
+
error_details = parsed_json["errorDetails"].to_json
|
49
|
+
error_details = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorDetails.from_json(json_object: error_details)
|
50
|
+
end
|
51
|
+
new(
|
52
|
+
source: source,
|
53
|
+
error_details: error_details,
|
54
|
+
additional_properties: struct
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Serialize an instance of EligibilityCheckError to a JSON object
|
59
|
+
#
|
60
|
+
# @return [String]
|
61
|
+
def to_json(*_args)
|
62
|
+
@_field_set&.to_json
|
63
|
+
end
|
64
|
+
|
65
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
66
|
+
# hash and check each fields type against the current object's property
|
67
|
+
# definitions.
|
68
|
+
#
|
69
|
+
# @param obj [Object]
|
70
|
+
# @return [Void]
|
71
|
+
def self.validate_raw(obj:)
|
72
|
+
obj.source.is_a?(CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorSource) != false || raise("Passed value for field obj.source is not the expected type, validation failed.")
|
73
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorDetails.validate_raw(obj: obj.error_details)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_check_error_details.rb
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module PreEncounter
|
8
|
+
module EligibilityChecks
|
9
|
+
module V1
|
10
|
+
module Types
|
11
|
+
# This object is our fern representation of Stedi's EligbilityCheckError object
|
12
|
+
# from their API.
|
13
|
+
class EligibilityCheckErrorDetails
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :field
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :description
|
18
|
+
# @return [String]
|
19
|
+
attr_reader :location
|
20
|
+
# @return [String]
|
21
|
+
attr_reader :possible_resolutions
|
22
|
+
# @return [String]
|
23
|
+
attr_reader :code
|
24
|
+
# @return [String]
|
25
|
+
attr_reader :followup_action
|
26
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
27
|
+
attr_reader :additional_properties
|
28
|
+
# @return [Object]
|
29
|
+
attr_reader :_field_set
|
30
|
+
protected :_field_set
|
31
|
+
|
32
|
+
OMIT = Object.new
|
33
|
+
|
34
|
+
# @param field [String]
|
35
|
+
# @param description [String]
|
36
|
+
# @param location [String]
|
37
|
+
# @param possible_resolutions [String]
|
38
|
+
# @param code [String]
|
39
|
+
# @param followup_action [String]
|
40
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
41
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorDetails]
|
42
|
+
def initialize(field: OMIT, description: OMIT, location: OMIT, possible_resolutions: OMIT, code: OMIT,
|
43
|
+
followup_action: OMIT, additional_properties: nil)
|
44
|
+
@field = field if field != OMIT
|
45
|
+
@description = description if description != OMIT
|
46
|
+
@location = location if location != OMIT
|
47
|
+
@possible_resolutions = possible_resolutions if possible_resolutions != OMIT
|
48
|
+
@code = code if code != OMIT
|
49
|
+
@followup_action = followup_action if followup_action != OMIT
|
50
|
+
@additional_properties = additional_properties
|
51
|
+
@_field_set = {
|
52
|
+
"field?": field,
|
53
|
+
"description?": description,
|
54
|
+
"location?": location,
|
55
|
+
"possibleResolutions?": possible_resolutions,
|
56
|
+
"code?": code,
|
57
|
+
"followupAction?": followup_action
|
58
|
+
}.reject do |_k, v|
|
59
|
+
v == OMIT
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Deserialize a JSON object to an instance of EligibilityCheckErrorDetails
|
64
|
+
#
|
65
|
+
# @param json_object [String]
|
66
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckErrorDetails]
|
67
|
+
def self.from_json(json_object:)
|
68
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
69
|
+
field = struct["field?"]
|
70
|
+
description = struct["description?"]
|
71
|
+
location = struct["location?"]
|
72
|
+
possible_resolutions = struct["possibleResolutions?"]
|
73
|
+
code = struct["code?"]
|
74
|
+
followup_action = struct["followupAction?"]
|
75
|
+
new(
|
76
|
+
field: field,
|
77
|
+
description: description,
|
78
|
+
location: location,
|
79
|
+
possible_resolutions: possible_resolutions,
|
80
|
+
code: code,
|
81
|
+
followup_action: followup_action,
|
82
|
+
additional_properties: struct
|
83
|
+
)
|
84
|
+
end
|
85
|
+
|
86
|
+
# Serialize an instance of EligibilityCheckErrorDetails to a JSON object
|
87
|
+
#
|
88
|
+
# @return [String]
|
89
|
+
def to_json(*_args)
|
90
|
+
@_field_set&.to_json
|
91
|
+
end
|
92
|
+
|
93
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
94
|
+
# hash and check each fields type against the current object's property
|
95
|
+
# definitions.
|
96
|
+
#
|
97
|
+
# @param obj [Object]
|
98
|
+
# @return [Void]
|
99
|
+
def self.validate_raw(obj:)
|
100
|
+
obj.field&.is_a?(String) != false || raise("Passed value for field obj.field is not the expected type, validation failed.")
|
101
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
102
|
+
obj.location&.is_a?(String) != false || raise("Passed value for field obj.location is not the expected type, validation failed.")
|
103
|
+
obj.possible_resolutions&.is_a?(String) != false || raise("Passed value for field obj.possible_resolutions is not the expected type, validation failed.")
|
104
|
+
obj.code&.is_a?(String) != false || raise("Passed value for field obj.code is not the expected type, validation failed.")
|
105
|
+
obj.followup_action&.is_a?(String) != false || raise("Passed value for field obj.followup_action is not the expected type, validation failed.")
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|