candidhealth 0.39.5 → 0.39.7
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 +8 -0
- data/lib/candidhealth/commons/types/procedure_modifier.rb +1 -0
- data/lib/candidhealth/encounters/v_4/client.rb +12 -4
- data/lib/candidhealth/encounters/v_4/types/payer_plan_group_payer_does_not_match_insurance_card_error.rb +77 -0
- data/lib/candidhealth/fee_schedules/v_3/client.rb +16 -4
- data/lib/candidhealth/fee_schedules/v_3/types/dimension_match.rb +16 -2
- data/lib/candidhealth/fee_schedules/v_3/types/dimensions.rb +16 -2
- data/lib/candidhealth/fee_schedules/v_3/types/match_payer_plan_groups.rb +85 -0
- data/lib/candidhealth/fee_schedules/v_3/types/optional_dimensions.rb +15 -2
- data/lib/candidhealth/fee_schedules/v_3/types/payer_plan_group_does_not_match_rate_payer_error.rb +75 -0
- data/lib/candidhealth/fee_schedules/v_3/types/validation_error.rb +39 -14
- data/lib/candidhealth/insurance_cards/v_2/types/insurance_card.rb +10 -2
- data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_base.rb +10 -2
- data/lib/candidhealth/insurance_cards/v_2/types/insurance_card_create.rb +10 -2
- data/lib/candidhealth/organization_providers/v_2/types/license_type.rb +27 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/client.rb +98 -4
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb +2 -2
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb +2 -2
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/visit.rb +96 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/visits_page.rb +98 -0
- data/lib/candidhealth/pre_encounter/common/types/external_identifier.rb +87 -0
- data/lib/candidhealth/pre_encounter/common/types/external_provider.rb +10 -2
- data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +89 -4
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/address.rb +118 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/benefits_related_entity.rb +11 -2
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverages_page.rb +98 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/expanded_member_info.rb +133 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb +10 -2
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_type_code.rb +1 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/member_info.rb +93 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/plan_metadata.rb +38 -3
- data/lib/candidhealth/pre_encounter/eligibility_checks/client.rb +32 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb +116 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_check.rb +119 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_request.rb +135 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/eligibility_response.rb +15 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/encounter.rb +83 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/individual_provider.rb +81 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/organization_provider.rb +74 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/parsed_response.rb +99 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/provider.rb +66 -0
- data/lib/candidhealth/pre_encounter/eligibility_checks/v_1/types/request_correction.rb +79 -0
- data/lib/candidhealth/pre_encounter/lists/v_1/types/appointment_list_item.rb +5 -5
- data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +70 -14
- data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +14 -2
- data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient_with_mrn.rb +14 -2
- data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +13 -1
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +19 -0
- metadata +23 -2
@@ -0,0 +1,116 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../../requests"
|
4
|
+
require_relative "types/eligibility_request"
|
5
|
+
require_relative "types/eligibility_response"
|
6
|
+
require "async"
|
7
|
+
|
8
|
+
module CandidApiClient
|
9
|
+
module PreEncounter
|
10
|
+
module EligibilityChecks
|
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::PreEncounter::EligibilityChecks::V1::V1Client]
|
18
|
+
def initialize(request_client:)
|
19
|
+
@request_client = request_client
|
20
|
+
end
|
21
|
+
|
22
|
+
# Sends real-time eligibility checks to payers through Stedi.
|
23
|
+
#
|
24
|
+
# @param request [Hash] Request of type CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest, as a Hash
|
25
|
+
# * :payer_id (String)
|
26
|
+
# * :provider (Hash)
|
27
|
+
# * :subscriber (Hash)
|
28
|
+
# * :member_id (String)
|
29
|
+
# * :first_name (String)
|
30
|
+
# * :last_name (String)
|
31
|
+
# * :date_of_birth (Date)
|
32
|
+
# * :dependent (Hash)
|
33
|
+
# * :member_id (String)
|
34
|
+
# * :first_name (String)
|
35
|
+
# * :last_name (String)
|
36
|
+
# * :date_of_birth (Date)
|
37
|
+
# * :encounter (Hash)
|
38
|
+
# * :date_of_service (Date)
|
39
|
+
# * :service_type_codes (Array<String>)
|
40
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
41
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ELIGIBILITY_RESPONSE]
|
42
|
+
# @example
|
43
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
44
|
+
# api.pre_encounter.eligibility_checks.v_1.post(request: { payer_id: "string", provider: { first_name: "string", last_name: "string", npi: "string" }, subscriber: { member_id: "string", first_name: "string", last_name: "string", date_of_birth: DateTime.parse(2023-01-15) }, dependent: { member_id: "string", first_name: "string", last_name: "string", date_of_birth: DateTime.parse(2023-01-15) }, encounter: { date_of_service: DateTime.parse(2023-01-15), service_type_codes: ["string"] } })
|
45
|
+
def post(request:, request_options: nil)
|
46
|
+
response = @request_client.conn.post do |req|
|
47
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
48
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
49
|
+
req.headers = {
|
50
|
+
**(req.headers || {}),
|
51
|
+
**@request_client.get_headers,
|
52
|
+
**(request_options&.additional_headers || {})
|
53
|
+
}.compact
|
54
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
55
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
56
|
+
request_options: request_options)}/eligibility-checks/v1"
|
57
|
+
end
|
58
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck.from_json(json_object: response.body)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class AsyncV1Client
|
63
|
+
# @return [CandidApiClient::AsyncRequestClient]
|
64
|
+
attr_reader :request_client
|
65
|
+
|
66
|
+
# @param request_client [CandidApiClient::AsyncRequestClient]
|
67
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::AsyncV1Client]
|
68
|
+
def initialize(request_client:)
|
69
|
+
@request_client = request_client
|
70
|
+
end
|
71
|
+
|
72
|
+
# Sends real-time eligibility checks to payers through Stedi.
|
73
|
+
#
|
74
|
+
# @param request [Hash] Request of type CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest, as a Hash
|
75
|
+
# * :payer_id (String)
|
76
|
+
# * :provider (Hash)
|
77
|
+
# * :subscriber (Hash)
|
78
|
+
# * :member_id (String)
|
79
|
+
# * :first_name (String)
|
80
|
+
# * :last_name (String)
|
81
|
+
# * :date_of_birth (Date)
|
82
|
+
# * :dependent (Hash)
|
83
|
+
# * :member_id (String)
|
84
|
+
# * :first_name (String)
|
85
|
+
# * :last_name (String)
|
86
|
+
# * :date_of_birth (Date)
|
87
|
+
# * :encounter (Hash)
|
88
|
+
# * :date_of_service (Date)
|
89
|
+
# * :service_type_codes (Array<String>)
|
90
|
+
# @param request_options [CandidApiClient::RequestOptions]
|
91
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ELIGIBILITY_RESPONSE]
|
92
|
+
# @example
|
93
|
+
# api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
|
94
|
+
# api.pre_encounter.eligibility_checks.v_1.post(request: { payer_id: "string", provider: { first_name: "string", last_name: "string", npi: "string" }, subscriber: { member_id: "string", first_name: "string", last_name: "string", date_of_birth: DateTime.parse(2023-01-15) }, dependent: { member_id: "string", first_name: "string", last_name: "string", date_of_birth: DateTime.parse(2023-01-15) }, encounter: { date_of_service: DateTime.parse(2023-01-15), service_type_codes: ["string"] } })
|
95
|
+
def post(request:, request_options: nil)
|
96
|
+
Async do
|
97
|
+
response = @request_client.conn.post do |req|
|
98
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
99
|
+
req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
|
100
|
+
req.headers = {
|
101
|
+
**(req.headers || {}),
|
102
|
+
**@request_client.get_headers,
|
103
|
+
**(request_options&.additional_headers || {})
|
104
|
+
}.compact
|
105
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
106
|
+
req.url "#{@request_client.get_url(environment: PreEncounter,
|
107
|
+
request_options: request_options)}/eligibility-checks/v1"
|
108
|
+
end
|
109
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck.from_json(json_object: response.body)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "eligibility_request"
|
4
|
+
require_relative "parsed_response"
|
5
|
+
require_relative "request_correction"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module CandidApiClient
|
10
|
+
module PreEncounter
|
11
|
+
module EligibilityChecks
|
12
|
+
module V1
|
13
|
+
module Types
|
14
|
+
class EligibilityCheck
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :errors
|
17
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest]
|
18
|
+
attr_reader :request
|
19
|
+
# @return [Object]
|
20
|
+
attr_reader :response
|
21
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ParsedResponse]
|
22
|
+
attr_reader :parsed_response
|
23
|
+
# @return [Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::RequestCorrection>]
|
24
|
+
attr_reader :request_corrections
|
25
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
attr_reader :additional_properties
|
27
|
+
# @return [Object]
|
28
|
+
attr_reader :_field_set
|
29
|
+
protected :_field_set
|
30
|
+
|
31
|
+
OMIT = Object.new
|
32
|
+
|
33
|
+
# @param errors [Object]
|
34
|
+
# @param request [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest]
|
35
|
+
# @param response [Object]
|
36
|
+
# @param parsed_response [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ParsedResponse]
|
37
|
+
# @param request_corrections [Array<CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::RequestCorrection>]
|
38
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck]
|
40
|
+
def initialize(response:, errors: OMIT, request: OMIT, parsed_response: OMIT, request_corrections: OMIT,
|
41
|
+
additional_properties: nil)
|
42
|
+
@errors = errors if errors != OMIT
|
43
|
+
@request = request if request != OMIT
|
44
|
+
@response = response
|
45
|
+
@parsed_response = parsed_response if parsed_response != OMIT
|
46
|
+
@request_corrections = request_corrections if request_corrections != OMIT
|
47
|
+
@additional_properties = additional_properties
|
48
|
+
@_field_set = {
|
49
|
+
"errors": errors,
|
50
|
+
"request": request,
|
51
|
+
"response": response,
|
52
|
+
"parsed_response": parsed_response,
|
53
|
+
"request_corrections": request_corrections
|
54
|
+
}.reject do |_k, v|
|
55
|
+
v == OMIT
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Deserialize a JSON object to an instance of EligibilityCheck
|
60
|
+
#
|
61
|
+
# @param json_object [String]
|
62
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck]
|
63
|
+
def self.from_json(json_object:)
|
64
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
65
|
+
parsed_json = JSON.parse(json_object)
|
66
|
+
errors = struct["errors"]
|
67
|
+
if parsed_json["request"].nil?
|
68
|
+
request = nil
|
69
|
+
else
|
70
|
+
request = parsed_json["request"].to_json
|
71
|
+
request = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest.from_json(json_object: request)
|
72
|
+
end
|
73
|
+
response = struct["response"]
|
74
|
+
if parsed_json["parsed_response"].nil?
|
75
|
+
parsed_response = nil
|
76
|
+
else
|
77
|
+
parsed_response = parsed_json["parsed_response"].to_json
|
78
|
+
parsed_response = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ParsedResponse.from_json(json_object: parsed_response)
|
79
|
+
end
|
80
|
+
request_corrections = parsed_json["request_corrections"]&.map do |item|
|
81
|
+
item = item.to_json
|
82
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::RequestCorrection.from_json(json_object: item)
|
83
|
+
end
|
84
|
+
new(
|
85
|
+
errors: errors,
|
86
|
+
request: request,
|
87
|
+
response: response,
|
88
|
+
parsed_response: parsed_response,
|
89
|
+
request_corrections: request_corrections,
|
90
|
+
additional_properties: struct
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Serialize an instance of EligibilityCheck to a JSON object
|
95
|
+
#
|
96
|
+
# @return [String]
|
97
|
+
def to_json(*_args)
|
98
|
+
@_field_set&.to_json
|
99
|
+
end
|
100
|
+
|
101
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
102
|
+
# hash and check each fields type against the current object's property
|
103
|
+
# definitions.
|
104
|
+
#
|
105
|
+
# @param obj [Object]
|
106
|
+
# @return [Void]
|
107
|
+
def self.validate_raw(obj:)
|
108
|
+
obj.errors&.is_a?(Object) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
|
109
|
+
obj.request.nil? || CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest.validate_raw(obj: obj.request)
|
110
|
+
obj.response.is_a?(Object) != false || raise("Passed value for field obj.response is not the expected type, validation failed.")
|
111
|
+
obj.parsed_response.nil? || CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ParsedResponse.validate_raw(obj: obj.parsed_response)
|
112
|
+
obj.request_corrections&.is_a?(Array) != false || raise("Passed value for field obj.request_corrections is not the expected type, validation failed.")
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "provider"
|
4
|
+
require_relative "../../../coverages/v_1/types/member_info"
|
5
|
+
require_relative "encounter"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module CandidApiClient
|
10
|
+
module PreEncounter
|
11
|
+
module EligibilityChecks
|
12
|
+
module V1
|
13
|
+
module Types
|
14
|
+
# An object representing the data for an eligibility request.
|
15
|
+
class EligibilityRequest
|
16
|
+
# @return [String] Supported payer ID values can be found
|
17
|
+
# [here](https://www.stedi.com/healthcare/network).
|
18
|
+
attr_reader :payer_id
|
19
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Provider]
|
20
|
+
attr_reader :provider
|
21
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::MemberInfo] The primary policyholder for the insurance plan or a dependent with a unique
|
22
|
+
# member ID. <Note>If a dependent has a unique member ID, include their
|
23
|
+
# information here and leave dependent undefined.</Note>
|
24
|
+
attr_reader :subscriber
|
25
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::MemberInfo] <Note>If a dependent has a unique member ID, include their information as
|
26
|
+
# subscriber and leave this field undefined.</Note>
|
27
|
+
attr_reader :dependent
|
28
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Encounter]
|
29
|
+
attr_reader :encounter
|
30
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
31
|
+
attr_reader :additional_properties
|
32
|
+
# @return [Object]
|
33
|
+
attr_reader :_field_set
|
34
|
+
protected :_field_set
|
35
|
+
|
36
|
+
OMIT = Object.new
|
37
|
+
|
38
|
+
# @param payer_id [String] Supported payer ID values can be found
|
39
|
+
# [here](https://www.stedi.com/healthcare/network).
|
40
|
+
# @param provider [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Provider]
|
41
|
+
# @param subscriber [CandidApiClient::PreEncounter::Coverages::V1::Types::MemberInfo] The primary policyholder for the insurance plan or a dependent with a unique
|
42
|
+
# member ID. <Note>If a dependent has a unique member ID, include their
|
43
|
+
# information here and leave dependent undefined.</Note>
|
44
|
+
# @param dependent [CandidApiClient::PreEncounter::Coverages::V1::Types::MemberInfo] <Note>If a dependent has a unique member ID, include their information as
|
45
|
+
# subscriber and leave this field undefined.</Note>
|
46
|
+
# @param encounter [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Encounter]
|
47
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
48
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest]
|
49
|
+
def initialize(payer_id:, provider:, subscriber:, dependent: OMIT, encounter: OMIT,
|
50
|
+
additional_properties: nil)
|
51
|
+
@payer_id = payer_id
|
52
|
+
@provider = provider
|
53
|
+
@subscriber = subscriber
|
54
|
+
@dependent = dependent if dependent != OMIT
|
55
|
+
@encounter = encounter if encounter != OMIT
|
56
|
+
@additional_properties = additional_properties
|
57
|
+
@_field_set = {
|
58
|
+
"payer_id": payer_id,
|
59
|
+
"provider": provider,
|
60
|
+
"subscriber": subscriber,
|
61
|
+
"dependent": dependent,
|
62
|
+
"encounter": encounter
|
63
|
+
}.reject do |_k, v|
|
64
|
+
v == OMIT
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Deserialize a JSON object to an instance of EligibilityRequest
|
69
|
+
#
|
70
|
+
# @param json_object [String]
|
71
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest]
|
72
|
+
def self.from_json(json_object:)
|
73
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
74
|
+
parsed_json = JSON.parse(json_object)
|
75
|
+
payer_id = struct["payer_id"]
|
76
|
+
if parsed_json["provider"].nil?
|
77
|
+
provider = nil
|
78
|
+
else
|
79
|
+
provider = parsed_json["provider"].to_json
|
80
|
+
provider = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Provider.from_json(json_object: provider)
|
81
|
+
end
|
82
|
+
if parsed_json["subscriber"].nil?
|
83
|
+
subscriber = nil
|
84
|
+
else
|
85
|
+
subscriber = parsed_json["subscriber"].to_json
|
86
|
+
subscriber = CandidApiClient::PreEncounter::Coverages::V1::Types::MemberInfo.from_json(json_object: subscriber)
|
87
|
+
end
|
88
|
+
if parsed_json["dependent"].nil?
|
89
|
+
dependent = nil
|
90
|
+
else
|
91
|
+
dependent = parsed_json["dependent"].to_json
|
92
|
+
dependent = CandidApiClient::PreEncounter::Coverages::V1::Types::MemberInfo.from_json(json_object: dependent)
|
93
|
+
end
|
94
|
+
if parsed_json["encounter"].nil?
|
95
|
+
encounter = nil
|
96
|
+
else
|
97
|
+
encounter = parsed_json["encounter"].to_json
|
98
|
+
encounter = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Encounter.from_json(json_object: encounter)
|
99
|
+
end
|
100
|
+
new(
|
101
|
+
payer_id: payer_id,
|
102
|
+
provider: provider,
|
103
|
+
subscriber: subscriber,
|
104
|
+
dependent: dependent,
|
105
|
+
encounter: encounter,
|
106
|
+
additional_properties: struct
|
107
|
+
)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Serialize an instance of EligibilityRequest to a JSON object
|
111
|
+
#
|
112
|
+
# @return [String]
|
113
|
+
def to_json(*_args)
|
114
|
+
@_field_set&.to_json
|
115
|
+
end
|
116
|
+
|
117
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
118
|
+
# hash and check each fields type against the current object's property
|
119
|
+
# definitions.
|
120
|
+
#
|
121
|
+
# @param obj [Object]
|
122
|
+
# @return [Void]
|
123
|
+
def self.validate_raw(obj:)
|
124
|
+
obj.payer_id.is_a?(String) != false || raise("Passed value for field obj.payer_id is not the expected type, validation failed.")
|
125
|
+
CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Provider.validate_raw(obj: obj.provider)
|
126
|
+
CandidApiClient::PreEncounter::Coverages::V1::Types::MemberInfo.validate_raw(obj: obj.subscriber)
|
127
|
+
obj.dependent.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::MemberInfo.validate_raw(obj: obj.dependent)
|
128
|
+
obj.encounter.nil? || CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Encounter.validate_raw(obj: obj.encounter)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "eligibility_check"
|
4
|
+
|
5
|
+
module CandidApiClient
|
6
|
+
module PreEncounter
|
7
|
+
module EligibilityChecks
|
8
|
+
module V1
|
9
|
+
module Types
|
10
|
+
ELIGIBILITY_RESPONSE = CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,83 @@
|
|
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
|
+
class Encounter
|
13
|
+
# @return [Date] Defaults to the current date if not provided.
|
14
|
+
attr_reader :date_of_service
|
15
|
+
# @return [Array<String>] Defaults to HealthBenefitPlanCoverage (30) if not provided.
|
16
|
+
# <Note>Not all payers support multiple service type codes, so it is recommended
|
17
|
+
# to only include a single code per request.</Note>
|
18
|
+
attr_reader :service_type_codes
|
19
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
+
attr_reader :additional_properties
|
21
|
+
# @return [Object]
|
22
|
+
attr_reader :_field_set
|
23
|
+
protected :_field_set
|
24
|
+
|
25
|
+
OMIT = Object.new
|
26
|
+
|
27
|
+
# @param date_of_service [Date] Defaults to the current date if not provided.
|
28
|
+
# @param service_type_codes [Array<String>] Defaults to HealthBenefitPlanCoverage (30) if not provided.
|
29
|
+
# <Note>Not all payers support multiple service type codes, so it is recommended
|
30
|
+
# to only include a single code per request.</Note>
|
31
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
32
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Encounter]
|
33
|
+
def initialize(date_of_service: OMIT, service_type_codes: OMIT, additional_properties: nil)
|
34
|
+
@date_of_service = date_of_service if date_of_service != OMIT
|
35
|
+
@service_type_codes = service_type_codes if service_type_codes != OMIT
|
36
|
+
@additional_properties = additional_properties
|
37
|
+
@_field_set = {
|
38
|
+
"date_of_service": date_of_service,
|
39
|
+
"service_type_codes": service_type_codes
|
40
|
+
}.reject do |_k, v|
|
41
|
+
v == OMIT
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Deserialize a JSON object to an instance of Encounter
|
46
|
+
#
|
47
|
+
# @param json_object [String]
|
48
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::Encounter]
|
49
|
+
def self.from_json(json_object:)
|
50
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
51
|
+
parsed_json = JSON.parse(json_object)
|
52
|
+
date_of_service = (Date.parse(parsed_json["date_of_service"]) unless parsed_json["date_of_service"].nil?)
|
53
|
+
service_type_codes = struct["service_type_codes"]
|
54
|
+
new(
|
55
|
+
date_of_service: date_of_service,
|
56
|
+
service_type_codes: service_type_codes,
|
57
|
+
additional_properties: struct
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Serialize an instance of Encounter to a JSON object
|
62
|
+
#
|
63
|
+
# @return [String]
|
64
|
+
def to_json(*_args)
|
65
|
+
@_field_set&.to_json
|
66
|
+
end
|
67
|
+
|
68
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
69
|
+
# hash and check each fields type against the current object's property
|
70
|
+
# definitions.
|
71
|
+
#
|
72
|
+
# @param obj [Object]
|
73
|
+
# @return [Void]
|
74
|
+
def self.validate_raw(obj:)
|
75
|
+
obj.date_of_service&.is_a?(Date) != false || raise("Passed value for field obj.date_of_service is not the expected type, validation failed.")
|
76
|
+
obj.service_type_codes&.is_a?(Array) != false || raise("Passed value for field obj.service_type_codes is not the expected type, validation failed.")
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,81 @@
|
|
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
|
+
class IndividualProvider
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :first_name
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :last_name
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :npi
|
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 first_name [String]
|
27
|
+
# @param last_name [String]
|
28
|
+
# @param npi [String]
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::IndividualProvider]
|
31
|
+
def initialize(npi:, first_name: OMIT, last_name: OMIT, additional_properties: nil)
|
32
|
+
@first_name = first_name if first_name != OMIT
|
33
|
+
@last_name = last_name if last_name != OMIT
|
34
|
+
@npi = npi
|
35
|
+
@additional_properties = additional_properties
|
36
|
+
@_field_set = { "first_name": first_name, "last_name": last_name, "npi": npi }.reject do |_k, v|
|
37
|
+
v == OMIT
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# Deserialize a JSON object to an instance of IndividualProvider
|
42
|
+
#
|
43
|
+
# @param json_object [String]
|
44
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::IndividualProvider]
|
45
|
+
def self.from_json(json_object:)
|
46
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
47
|
+
first_name = struct["first_name"]
|
48
|
+
last_name = struct["last_name"]
|
49
|
+
npi = struct["npi"]
|
50
|
+
new(
|
51
|
+
first_name: first_name,
|
52
|
+
last_name: last_name,
|
53
|
+
npi: npi,
|
54
|
+
additional_properties: struct
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Serialize an instance of IndividualProvider 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.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
|
73
|
+
obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
|
74
|
+
obj.npi.is_a?(String) != false || raise("Passed value for field obj.npi is not the expected type, validation failed.")
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,74 @@
|
|
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
|
+
class OrganizationProvider
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :organization_name
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :npi
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param organization_name [String]
|
25
|
+
# @param npi [String]
|
26
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
27
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::OrganizationProvider]
|
28
|
+
def initialize(npi:, organization_name: OMIT, additional_properties: nil)
|
29
|
+
@organization_name = organization_name if organization_name != OMIT
|
30
|
+
@npi = npi
|
31
|
+
@additional_properties = additional_properties
|
32
|
+
@_field_set = { "organization_name": organization_name, "npi": npi }.reject do |_k, v|
|
33
|
+
v == OMIT
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# Deserialize a JSON object to an instance of OrganizationProvider
|
38
|
+
#
|
39
|
+
# @param json_object [String]
|
40
|
+
# @return [CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::OrganizationProvider]
|
41
|
+
def self.from_json(json_object:)
|
42
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
|
+
organization_name = struct["organization_name"]
|
44
|
+
npi = struct["npi"]
|
45
|
+
new(
|
46
|
+
organization_name: organization_name,
|
47
|
+
npi: npi,
|
48
|
+
additional_properties: struct
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Serialize an instance of OrganizationProvider to a JSON object
|
53
|
+
#
|
54
|
+
# @return [String]
|
55
|
+
def to_json(*_args)
|
56
|
+
@_field_set&.to_json
|
57
|
+
end
|
58
|
+
|
59
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
60
|
+
# hash and check each fields type against the current object's property
|
61
|
+
# definitions.
|
62
|
+
#
|
63
|
+
# @param obj [Object]
|
64
|
+
# @return [Void]
|
65
|
+
def self.validate_raw(obj:)
|
66
|
+
obj.organization_name&.is_a?(String) != false || raise("Passed value for field obj.organization_name is not the expected type, validation failed.")
|
67
|
+
obj.npi.is_a?(String) != false || raise("Passed value for field obj.npi is not the expected type, validation failed.")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|