candidhealth 0.27.0 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/candidhealth/pre_encounter/appointments/client.rb +32 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/client.rb +607 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment.rb +257 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment_reason.rb +19 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment_sort_field.rb +16 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment_type.rb +17 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/appointment_work_queue.rb +17 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/mutable_appointment.rb +203 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb +82 -0
- data/lib/candidhealth/pre_encounter/appointments/v_1/types/universal_service_identifier.rb +18 -0
- data/lib/candidhealth/pre_encounter/common/types/external_provider.rb +11 -2
- data/lib/candidhealth/pre_encounter/common/types/external_provider_type.rb +1 -0
- data/lib/candidhealth/pre_encounter/common/types/resource_page.rb +72 -0
- data/lib/candidhealth/pre_encounter/common/types/sort_direction.rb +14 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +267 -8
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +31 -3
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_benefits.rb +88 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb +94 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb +74 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/eligibility_check.rb +62 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/eligibility_check_metadata.rb +103 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/eligibility_check_status.rb +19 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_type_code.rb +0 -1
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb +31 -3
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/plan_coverage.rb +86 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/plan_coverage_details.rb +124 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/service_coverage.rb +98 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/service_coverage_details.rb +124 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/service_type_code.rb +203 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +108 -24
- data/lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb +11 -2
- data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +4 -2
- data/lib/candidhealth/pre_encounter/patients/v_1/types/patient_page.rb +90 -0
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +22 -0
- metadata +26 -2
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "plan_coverage"
|
4
|
+
require_relative "service_coverage"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module CandidApiClient
|
9
|
+
module PreEncounter
|
10
|
+
module Coverages
|
11
|
+
module V1
|
12
|
+
module Types
|
13
|
+
class CoverageBenefits
|
14
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage]
|
15
|
+
attr_reader :plan_coverage
|
16
|
+
# @return [Array<CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverage>]
|
17
|
+
attr_reader :service_specific_coverage
|
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 plan_coverage [CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage]
|
27
|
+
# @param service_specific_coverage [Array<CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverage>]
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits]
|
30
|
+
def initialize(plan_coverage: OMIT, service_specific_coverage: OMIT, additional_properties: nil)
|
31
|
+
@plan_coverage = plan_coverage if plan_coverage != OMIT
|
32
|
+
@service_specific_coverage = service_specific_coverage if service_specific_coverage != OMIT
|
33
|
+
@additional_properties = additional_properties
|
34
|
+
@_field_set = {
|
35
|
+
"plan_coverage": plan_coverage,
|
36
|
+
"service_specific_coverage": service_specific_coverage
|
37
|
+
}.reject do |_k, v|
|
38
|
+
v == OMIT
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Deserialize a JSON object to an instance of CoverageBenefits
|
43
|
+
#
|
44
|
+
# @param json_object [String]
|
45
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits]
|
46
|
+
def self.from_json(json_object:)
|
47
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
48
|
+
parsed_json = JSON.parse(json_object)
|
49
|
+
if parsed_json["plan_coverage"].nil?
|
50
|
+
plan_coverage = nil
|
51
|
+
else
|
52
|
+
plan_coverage = parsed_json["plan_coverage"].to_json
|
53
|
+
plan_coverage = CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage.from_json(json_object: plan_coverage)
|
54
|
+
end
|
55
|
+
service_specific_coverage = parsed_json["service_specific_coverage"]&.map do |item|
|
56
|
+
item = item.to_json
|
57
|
+
CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceCoverage.from_json(json_object: item)
|
58
|
+
end
|
59
|
+
new(
|
60
|
+
plan_coverage: plan_coverage,
|
61
|
+
service_specific_coverage: service_specific_coverage,
|
62
|
+
additional_properties: struct
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Serialize an instance of CoverageBenefits to a JSON object
|
67
|
+
#
|
68
|
+
# @return [String]
|
69
|
+
def to_json(*_args)
|
70
|
+
@_field_set&.to_json
|
71
|
+
end
|
72
|
+
|
73
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
74
|
+
# hash and check each fields type against the current object's property
|
75
|
+
# definitions.
|
76
|
+
#
|
77
|
+
# @param obj [Object]
|
78
|
+
# @return [Void]
|
79
|
+
def self.validate_raw(obj:)
|
80
|
+
obj.plan_coverage.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage.validate_raw(obj: obj.plan_coverage)
|
81
|
+
obj.service_specific_coverage&.is_a?(Array) != false || raise("Passed value for field obj.service_specific_coverage is not the expected type, validation failed.")
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_eligibility_check_response.rb
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "eligibility_check_metadata"
|
4
|
+
require_relative "eligibility_check"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module CandidApiClient
|
9
|
+
module PreEncounter
|
10
|
+
module Coverages
|
11
|
+
module V1
|
12
|
+
module Types
|
13
|
+
class CoverageEligibilityCheckResponse
|
14
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata]
|
15
|
+
attr_reader :metadata
|
16
|
+
# @return [String]
|
17
|
+
attr_reader :error
|
18
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheck]
|
19
|
+
attr_reader :check
|
20
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
attr_reader :additional_properties
|
22
|
+
# @return [Object]
|
23
|
+
attr_reader :_field_set
|
24
|
+
protected :_field_set
|
25
|
+
|
26
|
+
OMIT = Object.new
|
27
|
+
|
28
|
+
# @param metadata [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata]
|
29
|
+
# @param error [String]
|
30
|
+
# @param check [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheck]
|
31
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
32
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageEligibilityCheckResponse]
|
33
|
+
def initialize(metadata:, error: OMIT, check: OMIT, additional_properties: nil)
|
34
|
+
@metadata = metadata
|
35
|
+
@error = error if error != OMIT
|
36
|
+
@check = check if check != OMIT
|
37
|
+
@additional_properties = additional_properties
|
38
|
+
@_field_set = { "metadata": metadata, "error": error, "check": check }.reject do |_k, v|
|
39
|
+
v == OMIT
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Deserialize a JSON object to an instance of CoverageEligibilityCheckResponse
|
44
|
+
#
|
45
|
+
# @param json_object [String]
|
46
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageEligibilityCheckResponse]
|
47
|
+
def self.from_json(json_object:)
|
48
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
49
|
+
parsed_json = JSON.parse(json_object)
|
50
|
+
if parsed_json["metadata"].nil?
|
51
|
+
metadata = nil
|
52
|
+
else
|
53
|
+
metadata = parsed_json["metadata"].to_json
|
54
|
+
metadata = CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata.from_json(json_object: metadata)
|
55
|
+
end
|
56
|
+
error = struct["error"]
|
57
|
+
if parsed_json["check"].nil?
|
58
|
+
check = nil
|
59
|
+
else
|
60
|
+
check = parsed_json["check"].to_json
|
61
|
+
check = CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheck.from_json(json_object: check)
|
62
|
+
end
|
63
|
+
new(
|
64
|
+
metadata: metadata,
|
65
|
+
error: error,
|
66
|
+
check: check,
|
67
|
+
additional_properties: struct
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Serialize an instance of CoverageEligibilityCheckResponse to a JSON object
|
72
|
+
#
|
73
|
+
# @return [String]
|
74
|
+
def to_json(*_args)
|
75
|
+
@_field_set&.to_json
|
76
|
+
end
|
77
|
+
|
78
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
79
|
+
# hash and check each fields type against the current object's property
|
80
|
+
# definitions.
|
81
|
+
#
|
82
|
+
# @param obj [Object]
|
83
|
+
# @return [Void]
|
84
|
+
def self.validate_raw(obj:)
|
85
|
+
CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata.validate_raw(obj: obj.metadata)
|
86
|
+
obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
|
87
|
+
obj.check.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheck.validate_raw(obj: obj.check)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
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 Coverages
|
9
|
+
module V1
|
10
|
+
module Types
|
11
|
+
class CoverageValue
|
12
|
+
# @return [Integer]
|
13
|
+
attr_reader :family
|
14
|
+
# @return [Integer]
|
15
|
+
attr_reader :individual
|
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 family [Integer]
|
25
|
+
# @param individual [Integer]
|
26
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
27
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue]
|
28
|
+
def initialize(family: OMIT, individual: OMIT, additional_properties: nil)
|
29
|
+
@family = family if family != OMIT
|
30
|
+
@individual = individual if individual != OMIT
|
31
|
+
@additional_properties = additional_properties
|
32
|
+
@_field_set = { "family": family, "individual": individual }.reject do |_k, v|
|
33
|
+
v == OMIT
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# Deserialize a JSON object to an instance of CoverageValue
|
38
|
+
#
|
39
|
+
# @param json_object [String]
|
40
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue]
|
41
|
+
def self.from_json(json_object:)
|
42
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
|
+
family = struct["family"]
|
44
|
+
individual = struct["individual"]
|
45
|
+
new(
|
46
|
+
family: family,
|
47
|
+
individual: individual,
|
48
|
+
additional_properties: struct
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Serialize an instance of CoverageValue 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.family&.is_a?(Integer) != false || raise("Passed value for field obj.family is not the expected type, validation failed.")
|
67
|
+
obj.individual&.is_a?(Integer) != false || raise("Passed value for field obj.individual is not the expected type, validation failed.")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module PreEncounter
|
8
|
+
module Coverages
|
9
|
+
module V1
|
10
|
+
module Types
|
11
|
+
class EligibilityCheck
|
12
|
+
# @return [Object]
|
13
|
+
attr_reader :raw_json
|
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 raw_json [Object]
|
23
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheck]
|
25
|
+
def initialize(raw_json:, additional_properties: nil)
|
26
|
+
@raw_json = raw_json
|
27
|
+
@additional_properties = additional_properties
|
28
|
+
@_field_set = { "raw_json": raw_json }
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deserialize a JSON object to an instance of EligibilityCheck
|
32
|
+
#
|
33
|
+
# @param json_object [String]
|
34
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheck]
|
35
|
+
def self.from_json(json_object:)
|
36
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
37
|
+
raw_json = struct["raw_json"]
|
38
|
+
new(raw_json: raw_json, additional_properties: struct)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Serialize an instance of EligibilityCheck to a JSON object
|
42
|
+
#
|
43
|
+
# @return [String]
|
44
|
+
def to_json(*_args)
|
45
|
+
@_field_set&.to_json
|
46
|
+
end
|
47
|
+
|
48
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
49
|
+
# hash and check each fields type against the current object's property
|
50
|
+
# definitions.
|
51
|
+
#
|
52
|
+
# @param obj [Object]
|
53
|
+
# @return [Void]
|
54
|
+
def self.validate_raw(obj:)
|
55
|
+
obj.raw_json.is_a?(Object) != false || raise("Passed value for field obj.raw_json is not the expected type, validation failed.")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "service_type_code"
|
4
|
+
require_relative "eligibility_check_status"
|
5
|
+
require "date"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module CandidApiClient
|
10
|
+
module PreEncounter
|
11
|
+
module Coverages
|
12
|
+
module V1
|
13
|
+
module Types
|
14
|
+
class EligibilityCheckMetadata
|
15
|
+
# @return [String]
|
16
|
+
attr_reader :check_id
|
17
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceTypeCode]
|
18
|
+
attr_reader :service_code
|
19
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckStatus]
|
20
|
+
attr_reader :status
|
21
|
+
# @return [String]
|
22
|
+
attr_reader :initiated_by
|
23
|
+
# @return [DateTime]
|
24
|
+
attr_reader :initiated_at
|
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 check_id [String]
|
34
|
+
# @param service_code [CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceTypeCode]
|
35
|
+
# @param status [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckStatus]
|
36
|
+
# @param initiated_by [String]
|
37
|
+
# @param initiated_at [DateTime]
|
38
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata]
|
40
|
+
def initialize(check_id:, service_code:, status:, initiated_by:, initiated_at:, additional_properties: nil)
|
41
|
+
@check_id = check_id
|
42
|
+
@service_code = service_code
|
43
|
+
@status = status
|
44
|
+
@initiated_by = initiated_by
|
45
|
+
@initiated_at = initiated_at
|
46
|
+
@additional_properties = additional_properties
|
47
|
+
@_field_set = {
|
48
|
+
"check_id": check_id,
|
49
|
+
"service_code": service_code,
|
50
|
+
"status": status,
|
51
|
+
"initiated_by": initiated_by,
|
52
|
+
"initiated_at": initiated_at
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Deserialize a JSON object to an instance of EligibilityCheckMetadata
|
57
|
+
#
|
58
|
+
# @param json_object [String]
|
59
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata]
|
60
|
+
def self.from_json(json_object:)
|
61
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
62
|
+
parsed_json = JSON.parse(json_object)
|
63
|
+
check_id = struct["check_id"]
|
64
|
+
service_code = struct["service_code"]
|
65
|
+
status = struct["status"]
|
66
|
+
initiated_by = struct["initiated_by"]
|
67
|
+
initiated_at = (DateTime.parse(parsed_json["initiated_at"]) unless parsed_json["initiated_at"].nil?)
|
68
|
+
new(
|
69
|
+
check_id: check_id,
|
70
|
+
service_code: service_code,
|
71
|
+
status: status,
|
72
|
+
initiated_by: initiated_by,
|
73
|
+
initiated_at: initiated_at,
|
74
|
+
additional_properties: struct
|
75
|
+
)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Serialize an instance of EligibilityCheckMetadata to a JSON object
|
79
|
+
#
|
80
|
+
# @return [String]
|
81
|
+
def to_json(*_args)
|
82
|
+
@_field_set&.to_json
|
83
|
+
end
|
84
|
+
|
85
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
86
|
+
# hash and check each fields type against the current object's property
|
87
|
+
# definitions.
|
88
|
+
#
|
89
|
+
# @param obj [Object]
|
90
|
+
# @return [Void]
|
91
|
+
def self.validate_raw(obj:)
|
92
|
+
obj.check_id.is_a?(String) != false || raise("Passed value for field obj.check_id is not the expected type, validation failed.")
|
93
|
+
obj.service_code.is_a?(CandidApiClient::PreEncounter::Coverages::V1::Types::ServiceTypeCode) != false || raise("Passed value for field obj.service_code is not the expected type, validation failed.")
|
94
|
+
obj.status.is_a?(CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
95
|
+
obj.initiated_by.is_a?(String) != false || raise("Passed value for field obj.initiated_by is not the expected type, validation failed.")
|
96
|
+
obj.initiated_at.is_a?(DateTime) != false || raise("Passed value for field obj.initiated_at is not the expected type, validation failed.")
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CandidApiClient
|
4
|
+
module PreEncounter
|
5
|
+
module Coverages
|
6
|
+
module V1
|
7
|
+
module Types
|
8
|
+
# enum to represent the statuses of eligibility checks
|
9
|
+
class EligibilityCheckStatus
|
10
|
+
CREATED = "CREATED"
|
11
|
+
COMPLETED = "COMPLETED"
|
12
|
+
FAILED = "FAILED"
|
13
|
+
PENDING = "PENDING"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -4,6 +4,8 @@ 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"
|
8
|
+
require_relative "coverage_benefits"
|
7
9
|
require "ostruct"
|
8
10
|
require "json"
|
9
11
|
|
@@ -28,6 +30,10 @@ module CandidApiClient
|
|
28
30
|
attr_reader :insurance_plan
|
29
31
|
# @return [Boolean] A boolean indicating if the coverage has been verified by a user.
|
30
32
|
attr_reader :verified
|
33
|
+
# @return [Array<CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata>] A list of eligibility check metadata that have been initiated on this coverage.
|
34
|
+
attr_reader :eligibility_checks
|
35
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits] The eligibility of the patient for the coverage, manually verified by users.
|
36
|
+
attr_reader :benefits
|
31
37
|
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
32
38
|
attr_reader :additional_properties
|
33
39
|
# @return [Object]
|
@@ -45,16 +51,20 @@ module CandidApiClient
|
|
45
51
|
# @param patient [String] The patient who benefits from the insurance coverage
|
46
52
|
# @param insurance_plan [CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan]
|
47
53
|
# @param verified [Boolean] A boolean indicating if the coverage has been verified by a user.
|
54
|
+
# @param eligibility_checks [Array<CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata>] A list of eligibility check metadata that have been initiated on this coverage.
|
55
|
+
# @param benefits [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits] The eligibility of the patient for the coverage, manually verified by users.
|
48
56
|
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
49
57
|
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::MutableCoverage]
|
50
58
|
def initialize(status:, subscriber:, relationship:, patient:, insurance_plan:, verified:,
|
51
|
-
additional_properties: nil)
|
59
|
+
eligibility_checks: OMIT, benefits: OMIT, additional_properties: nil)
|
52
60
|
@status = status
|
53
61
|
@subscriber = subscriber
|
54
62
|
@relationship = relationship
|
55
63
|
@patient = patient
|
56
64
|
@insurance_plan = insurance_plan
|
57
65
|
@verified = verified
|
66
|
+
@eligibility_checks = eligibility_checks if eligibility_checks != OMIT
|
67
|
+
@benefits = benefits if benefits != OMIT
|
58
68
|
@additional_properties = additional_properties
|
59
69
|
@_field_set = {
|
60
70
|
"status": status,
|
@@ -62,8 +72,12 @@ module CandidApiClient
|
|
62
72
|
"relationship": relationship,
|
63
73
|
"patient": patient,
|
64
74
|
"insurance_plan": insurance_plan,
|
65
|
-
"verified": verified
|
66
|
-
|
75
|
+
"verified": verified,
|
76
|
+
"eligibility_checks": eligibility_checks,
|
77
|
+
"benefits": benefits
|
78
|
+
}.reject do |_k, v|
|
79
|
+
v == OMIT
|
80
|
+
end
|
67
81
|
end
|
68
82
|
|
69
83
|
# Deserialize a JSON object to an instance of MutableCoverage
|
@@ -89,6 +103,16 @@ module CandidApiClient
|
|
89
103
|
insurance_plan = CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan.from_json(json_object: insurance_plan)
|
90
104
|
end
|
91
105
|
verified = struct["verified"]
|
106
|
+
eligibility_checks = parsed_json["eligibility_checks"]&.map do |item|
|
107
|
+
item = item.to_json
|
108
|
+
CandidApiClient::PreEncounter::Coverages::V1::Types::EligibilityCheckMetadata.from_json(json_object: item)
|
109
|
+
end
|
110
|
+
if parsed_json["benefits"].nil?
|
111
|
+
benefits = nil
|
112
|
+
else
|
113
|
+
benefits = parsed_json["benefits"].to_json
|
114
|
+
benefits = CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits.from_json(json_object: benefits)
|
115
|
+
end
|
92
116
|
new(
|
93
117
|
status: status,
|
94
118
|
subscriber: subscriber,
|
@@ -96,6 +120,8 @@ module CandidApiClient
|
|
96
120
|
patient: patient,
|
97
121
|
insurance_plan: insurance_plan,
|
98
122
|
verified: verified,
|
123
|
+
eligibility_checks: eligibility_checks,
|
124
|
+
benefits: benefits,
|
99
125
|
additional_properties: struct
|
100
126
|
)
|
101
127
|
end
|
@@ -120,6 +146,8 @@ module CandidApiClient
|
|
120
146
|
obj.patient.is_a?(String) != false || raise("Passed value for field obj.patient is not the expected type, validation failed.")
|
121
147
|
CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan.validate_raw(obj: obj.insurance_plan)
|
122
148
|
obj.verified.is_a?(Boolean) != false || raise("Passed value for field obj.verified is not the expected type, validation failed.")
|
149
|
+
obj.eligibility_checks&.is_a?(Array) != false || raise("Passed value for field obj.eligibility_checks is not the expected type, validation failed.")
|
150
|
+
obj.benefits.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageBenefits.validate_raw(obj: obj.benefits)
|
123
151
|
end
|
124
152
|
end
|
125
153
|
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "plan_coverage_details"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module PreEncounter
|
9
|
+
module Coverages
|
10
|
+
module V1
|
11
|
+
module Types
|
12
|
+
class PlanCoverage
|
13
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverageDetails]
|
14
|
+
attr_reader :in_network
|
15
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverageDetails]
|
16
|
+
attr_reader :out_of_network
|
17
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
18
|
+
attr_reader :additional_properties
|
19
|
+
# @return [Object]
|
20
|
+
attr_reader :_field_set
|
21
|
+
protected :_field_set
|
22
|
+
|
23
|
+
OMIT = Object.new
|
24
|
+
|
25
|
+
# @param in_network [CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverageDetails]
|
26
|
+
# @param out_of_network [CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverageDetails]
|
27
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
28
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage]
|
29
|
+
def initialize(in_network: OMIT, out_of_network: OMIT, additional_properties: nil)
|
30
|
+
@in_network = in_network if in_network != OMIT
|
31
|
+
@out_of_network = out_of_network if out_of_network != OMIT
|
32
|
+
@additional_properties = additional_properties
|
33
|
+
@_field_set = { "in_network": in_network, "out_of_network": out_of_network }.reject do |_k, v|
|
34
|
+
v == OMIT
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# Deserialize a JSON object to an instance of PlanCoverage
|
39
|
+
#
|
40
|
+
# @param json_object [String]
|
41
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverage]
|
42
|
+
def self.from_json(json_object:)
|
43
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
44
|
+
parsed_json = JSON.parse(json_object)
|
45
|
+
if parsed_json["in_network"].nil?
|
46
|
+
in_network = nil
|
47
|
+
else
|
48
|
+
in_network = parsed_json["in_network"].to_json
|
49
|
+
in_network = CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverageDetails.from_json(json_object: in_network)
|
50
|
+
end
|
51
|
+
if parsed_json["out_of_network"].nil?
|
52
|
+
out_of_network = nil
|
53
|
+
else
|
54
|
+
out_of_network = parsed_json["out_of_network"].to_json
|
55
|
+
out_of_network = CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverageDetails.from_json(json_object: out_of_network)
|
56
|
+
end
|
57
|
+
new(
|
58
|
+
in_network: in_network,
|
59
|
+
out_of_network: out_of_network,
|
60
|
+
additional_properties: struct
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
# Serialize an instance of PlanCoverage to a JSON object
|
65
|
+
#
|
66
|
+
# @return [String]
|
67
|
+
def to_json(*_args)
|
68
|
+
@_field_set&.to_json
|
69
|
+
end
|
70
|
+
|
71
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
72
|
+
# hash and check each fields type against the current object's property
|
73
|
+
# definitions.
|
74
|
+
#
|
75
|
+
# @param obj [Object]
|
76
|
+
# @return [Void]
|
77
|
+
def self.validate_raw(obj:)
|
78
|
+
obj.in_network.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverageDetails.validate_raw(obj: obj.in_network)
|
79
|
+
obj.out_of_network.nil? || CandidApiClient::PreEncounter::Coverages::V1::Types::PlanCoverageDetails.validate_raw(obj: obj.out_of_network)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|