candidhealth 0.24.2 → 0.24.4
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/commons/types/primitive.rb +17 -0
- data/lib/candidhealth/custom_schemas/client.rb +30 -0
- data/lib/candidhealth/custom_schemas/v_1/client.rb +291 -0
- data/lib/candidhealth/custom_schemas/v_1/types/key_with_name_already_exists_error.rb +71 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema.rb +91 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_field.rb +71 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_get_multi_response.rb +65 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_instance.rb +76 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_validation_error.rb +100 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_validation_failure.rb +65 -0
- data/lib/candidhealth/custom_schemas/v_1/types/schema_with_name_already_exists_error.rb +70 -0
- data/lib/candidhealth/encounters/v_4/client.rb +49 -12
- data/lib/candidhealth/encounters/v_4/types/encounter.rb +17 -1
- data/lib/candidhealth/encounters/v_4/types/key_does_not_exist_error.rb +70 -0
- data/lib/candidhealth/encounters/v_4/types/multiple_instances_for_schema_error.rb +60 -0
- data/lib/candidhealth/encounters/v_4/types/schema_does_not_exist_error.rb +60 -0
- data/lib/candidhealth/encounters/v_4/types/schema_instance_validation_error.rb +139 -0
- data/lib/candidhealth/encounters/v_4/types/schema_instance_validation_failure.rb +65 -0
- data/lib/candidhealth/encounters/v_4/types/schema_unauthorized_access_error.rb +60 -0
- data/lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb +90 -0
- data/lib/candidhealth/pre_encounter/common/types/disability_status.rb +14 -0
- data/lib/candidhealth/pre_encounter/common/types/ethnicity.rb +16 -0
- data/lib/candidhealth/pre_encounter/common/types/gender.rb +5 -2
- data/lib/candidhealth/pre_encounter/common/types/race.rb +21 -0
- data/lib/candidhealth/pre_encounter/common/types/sex.rb +16 -0
- data/lib/candidhealth/pre_encounter/common/types/sexual_orientation.rb +19 -0
- data/lib/candidhealth/pre_encounter/coverages/client.rb +6 -6
- data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +464 -11
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +183 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_status.rb +20 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb +134 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb +129 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/network_type.rb +33 -0
- data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +88 -0
- data/lib/candidhealth/pre_encounter/patients/client.rb +6 -6
- data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +607 -11
- data/lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb +133 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provenance.rb +73 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provider.rb +122 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/filing_order.rb +63 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/marital_status.rb +26 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +325 -0
- data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +389 -0
- data/lib/candidhealth.rb +14 -7
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +34 -12
- metadata +38 -16
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/client.rb +0 -487
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage.rb +0 -185
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_status.rb +0 -22
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_type.rb +0 -18
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/insurance_plan.rb +0 -136
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/mutable_coverage.rb +0 -131
- data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/subscriber.rb +0 -90
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/client.rb +0 -590
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/contact.rb +0 -135
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provenance.rb +0 -75
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provider.rb +0 -116
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/marital_status.rb +0 -28
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/mutable_patient.rb +0 -242
- data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/patient.rb +0 -294
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Encounters
|
8
|
+
module V4
|
9
|
+
module Types
|
10
|
+
class MultipleInstancesForSchemaError
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :schema_id
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param schema_id [String]
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [CandidApiClient::Encounters::V4::Types::MultipleInstancesForSchemaError]
|
24
|
+
def initialize(schema_id:, additional_properties: nil)
|
25
|
+
@schema_id = schema_id
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
@_field_set = { "schema_id": schema_id }
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of MultipleInstancesForSchemaError
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [CandidApiClient::Encounters::V4::Types::MultipleInstancesForSchemaError]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
schema_id = struct["schema_id"]
|
37
|
+
new(schema_id: schema_id, additional_properties: struct)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Serialize an instance of MultipleInstancesForSchemaError to a JSON object
|
41
|
+
#
|
42
|
+
# @return [String]
|
43
|
+
def to_json(*_args)
|
44
|
+
@_field_set&.to_json
|
45
|
+
end
|
46
|
+
|
47
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
48
|
+
# hash and check each fields type against the current object's property
|
49
|
+
# definitions.
|
50
|
+
#
|
51
|
+
# @param obj [Object]
|
52
|
+
# @return [Void]
|
53
|
+
def self.validate_raw(obj:)
|
54
|
+
obj.schema_id.is_a?(String) != false || raise("Passed value for field obj.schema_id is not the expected type, validation failed.")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Encounters
|
8
|
+
module V4
|
9
|
+
module Types
|
10
|
+
class SchemaDoesNotExistError
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :schema_id
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param schema_id [String]
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaDoesNotExistError]
|
24
|
+
def initialize(schema_id:, additional_properties: nil)
|
25
|
+
@schema_id = schema_id
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
@_field_set = { "schema_id": schema_id }
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of SchemaDoesNotExistError
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaDoesNotExistError]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
schema_id = struct["schema_id"]
|
37
|
+
new(schema_id: schema_id, additional_properties: struct)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Serialize an instance of SchemaDoesNotExistError to a JSON object
|
41
|
+
#
|
42
|
+
# @return [String]
|
43
|
+
def to_json(*_args)
|
44
|
+
@_field_set&.to_json
|
45
|
+
end
|
46
|
+
|
47
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
48
|
+
# hash and check each fields type against the current object's property
|
49
|
+
# definitions.
|
50
|
+
#
|
51
|
+
# @param obj [Object]
|
52
|
+
# @return [Void]
|
53
|
+
def self.validate_raw(obj:)
|
54
|
+
obj.schema_id.is_a?(String) != false || raise("Passed value for field obj.schema_id is not the expected type, validation failed.")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "multiple_instances_for_schema_error"
|
5
|
+
require_relative "value_does_not_match_key_type_error"
|
6
|
+
require_relative "key_does_not_exist_error"
|
7
|
+
require_relative "schema_does_not_exist_error"
|
8
|
+
require_relative "schema_unauthorized_access_error"
|
9
|
+
|
10
|
+
module CandidApiClient
|
11
|
+
module Encounters
|
12
|
+
module V4
|
13
|
+
module Types
|
14
|
+
class SchemaInstanceValidationError
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :member
|
17
|
+
# @return [String]
|
18
|
+
attr_reader :discriminant
|
19
|
+
|
20
|
+
private_class_method :new
|
21
|
+
alias kind_of? is_a?
|
22
|
+
|
23
|
+
# @param member [Object]
|
24
|
+
# @param discriminant [String]
|
25
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError]
|
26
|
+
def initialize(member:, discriminant:)
|
27
|
+
@member = member
|
28
|
+
@discriminant = discriminant
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deserialize a JSON object to an instance of SchemaInstanceValidationError
|
32
|
+
#
|
33
|
+
# @param json_object [String]
|
34
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError]
|
35
|
+
def self.from_json(json_object:)
|
36
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
37
|
+
member = case struct.type
|
38
|
+
when "multiple_instances_for_schema"
|
39
|
+
CandidApiClient::Encounters::V4::Types::MultipleInstancesForSchemaError.from_json(json_object: json_object)
|
40
|
+
when "value_does_not_match_key_type"
|
41
|
+
CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError.from_json(json_object: json_object)
|
42
|
+
when "key_does_not_exist"
|
43
|
+
CandidApiClient::Encounters::V4::Types::KeyDoesNotExistError.from_json(json_object: json_object)
|
44
|
+
when "schema_does_not_exist"
|
45
|
+
CandidApiClient::Encounters::V4::Types::SchemaDoesNotExistError.from_json(json_object: json_object)
|
46
|
+
when "schema_unauthorized_access"
|
47
|
+
CandidApiClient::Encounters::V4::Types::SchemaUnauthorizedAccessError.from_json(json_object: json_object)
|
48
|
+
else
|
49
|
+
CandidApiClient::Encounters::V4::Types::MultipleInstancesForSchemaError.from_json(json_object: json_object)
|
50
|
+
end
|
51
|
+
new(member: member, discriminant: struct.type)
|
52
|
+
end
|
53
|
+
|
54
|
+
# For Union Types, to_json functionality is delegated to the wrapped member.
|
55
|
+
#
|
56
|
+
# @return [String]
|
57
|
+
def to_json(*_args)
|
58
|
+
case @discriminant
|
59
|
+
when "multiple_instances_for_schema"
|
60
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
61
|
+
when "value_does_not_match_key_type"
|
62
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
63
|
+
when "key_does_not_exist"
|
64
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
65
|
+
when "schema_does_not_exist"
|
66
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
67
|
+
when "schema_unauthorized_access"
|
68
|
+
{ **@member.to_json, type: @discriminant }.to_json
|
69
|
+
else
|
70
|
+
{ "type": @discriminant, value: @member }.to_json
|
71
|
+
end
|
72
|
+
@member.to_json
|
73
|
+
end
|
74
|
+
|
75
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
76
|
+
# hash and check each fields type against the current object's property
|
77
|
+
# definitions.
|
78
|
+
#
|
79
|
+
# @param obj [Object]
|
80
|
+
# @return [Void]
|
81
|
+
def self.validate_raw(obj:)
|
82
|
+
case obj.type
|
83
|
+
when "multiple_instances_for_schema"
|
84
|
+
CandidApiClient::Encounters::V4::Types::MultipleInstancesForSchemaError.validate_raw(obj: obj)
|
85
|
+
when "value_does_not_match_key_type"
|
86
|
+
CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError.validate_raw(obj: obj)
|
87
|
+
when "key_does_not_exist"
|
88
|
+
CandidApiClient::Encounters::V4::Types::KeyDoesNotExistError.validate_raw(obj: obj)
|
89
|
+
when "schema_does_not_exist"
|
90
|
+
CandidApiClient::Encounters::V4::Types::SchemaDoesNotExistError.validate_raw(obj: obj)
|
91
|
+
when "schema_unauthorized_access"
|
92
|
+
CandidApiClient::Encounters::V4::Types::SchemaUnauthorizedAccessError.validate_raw(obj: obj)
|
93
|
+
else
|
94
|
+
raise("Passed value matched no type within the union, validation failed.")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# For Union Types, is_a? functionality is delegated to the wrapped member.
|
99
|
+
#
|
100
|
+
# @param obj [Object]
|
101
|
+
# @return [Boolean]
|
102
|
+
def is_a?(obj)
|
103
|
+
@member.is_a?(obj)
|
104
|
+
end
|
105
|
+
|
106
|
+
# @param member [CandidApiClient::Encounters::V4::Types::MultipleInstancesForSchemaError]
|
107
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError]
|
108
|
+
def self.multiple_instances_for_schema(member:)
|
109
|
+
new(member: member, discriminant: "multiple_instances_for_schema")
|
110
|
+
end
|
111
|
+
|
112
|
+
# @param member [CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError]
|
113
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError]
|
114
|
+
def self.value_does_not_match_key_type(member:)
|
115
|
+
new(member: member, discriminant: "value_does_not_match_key_type")
|
116
|
+
end
|
117
|
+
|
118
|
+
# @param member [CandidApiClient::Encounters::V4::Types::KeyDoesNotExistError]
|
119
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError]
|
120
|
+
def self.key_does_not_exist(member:)
|
121
|
+
new(member: member, discriminant: "key_does_not_exist")
|
122
|
+
end
|
123
|
+
|
124
|
+
# @param member [CandidApiClient::Encounters::V4::Types::SchemaDoesNotExistError]
|
125
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError]
|
126
|
+
def self.schema_does_not_exist(member:)
|
127
|
+
new(member: member, discriminant: "schema_does_not_exist")
|
128
|
+
end
|
129
|
+
|
130
|
+
# @param member [CandidApiClient::Encounters::V4::Types::SchemaUnauthorizedAccessError]
|
131
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError]
|
132
|
+
def self.schema_unauthorized_access(member:)
|
133
|
+
new(member: member, discriminant: "schema_unauthorized_access")
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "schema_instance_validation_error"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module Encounters
|
9
|
+
module V4
|
10
|
+
module Types
|
11
|
+
class SchemaInstanceValidationFailure
|
12
|
+
# @return [Array<CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError>]
|
13
|
+
attr_reader :errors
|
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 errors [Array<CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError>]
|
23
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationFailure]
|
25
|
+
def initialize(errors:, additional_properties: nil)
|
26
|
+
@errors = errors
|
27
|
+
@additional_properties = additional_properties
|
28
|
+
@_field_set = { "errors": errors }
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deserialize a JSON object to an instance of SchemaInstanceValidationFailure
|
32
|
+
#
|
33
|
+
# @param json_object [String]
|
34
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationFailure]
|
35
|
+
def self.from_json(json_object:)
|
36
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
37
|
+
parsed_json = JSON.parse(json_object)
|
38
|
+
errors = parsed_json["errors"]&.map do |item|
|
39
|
+
item = item.to_json
|
40
|
+
CandidApiClient::Encounters::V4::Types::SchemaInstanceValidationError.from_json(json_object: item)
|
41
|
+
end
|
42
|
+
new(errors: errors, additional_properties: struct)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Serialize an instance of SchemaInstanceValidationFailure to a JSON object
|
46
|
+
#
|
47
|
+
# @return [String]
|
48
|
+
def to_json(*_args)
|
49
|
+
@_field_set&.to_json
|
50
|
+
end
|
51
|
+
|
52
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
53
|
+
# hash and check each fields type against the current object's property
|
54
|
+
# definitions.
|
55
|
+
#
|
56
|
+
# @param obj [Object]
|
57
|
+
# @return [Void]
|
58
|
+
def self.validate_raw(obj:)
|
59
|
+
obj.errors.is_a?(Array) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module CandidApiClient
|
7
|
+
module Encounters
|
8
|
+
module V4
|
9
|
+
module Types
|
10
|
+
class SchemaUnauthorizedAccessError
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :schema_id
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param schema_id [String]
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaUnauthorizedAccessError]
|
24
|
+
def initialize(schema_id:, additional_properties: nil)
|
25
|
+
@schema_id = schema_id
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
@_field_set = { "schema_id": schema_id }
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deserialize a JSON object to an instance of SchemaUnauthorizedAccessError
|
31
|
+
#
|
32
|
+
# @param json_object [String]
|
33
|
+
# @return [CandidApiClient::Encounters::V4::Types::SchemaUnauthorizedAccessError]
|
34
|
+
def self.from_json(json_object:)
|
35
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
36
|
+
schema_id = struct["schema_id"]
|
37
|
+
new(schema_id: schema_id, additional_properties: struct)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Serialize an instance of SchemaUnauthorizedAccessError to a JSON object
|
41
|
+
#
|
42
|
+
# @return [String]
|
43
|
+
def to_json(*_args)
|
44
|
+
@_field_set&.to_json
|
45
|
+
end
|
46
|
+
|
47
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
48
|
+
# hash and check each fields type against the current object's property
|
49
|
+
# definitions.
|
50
|
+
#
|
51
|
+
# @param obj [Object]
|
52
|
+
# @return [Void]
|
53
|
+
def self.validate_raw(obj:)
|
54
|
+
obj.schema_id.is_a?(String) != false || raise("Passed value for field obj.schema_id is not the expected type, validation failed.")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../commons/types/primitive"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module CandidApiClient
|
8
|
+
module Encounters
|
9
|
+
module V4
|
10
|
+
module Types
|
11
|
+
class ValueDoesNotMatchKeyTypeError
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :schema_id
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :key
|
16
|
+
# @return [CandidApiClient::Commons::Types::Primitive]
|
17
|
+
attr_reader :expected_value_type
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :value
|
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 schema_id [String]
|
29
|
+
# @param key [String]
|
30
|
+
# @param expected_value_type [CandidApiClient::Commons::Types::Primitive]
|
31
|
+
# @param value [Object]
|
32
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
33
|
+
# @return [CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError]
|
34
|
+
def initialize(schema_id:, key:, expected_value_type:, value:, additional_properties: nil)
|
35
|
+
@schema_id = schema_id
|
36
|
+
@key = key
|
37
|
+
@expected_value_type = expected_value_type
|
38
|
+
@value = value
|
39
|
+
@additional_properties = additional_properties
|
40
|
+
@_field_set = {
|
41
|
+
"schema_id": schema_id,
|
42
|
+
"key": key,
|
43
|
+
"expected_value_type": expected_value_type,
|
44
|
+
"value": value
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Deserialize a JSON object to an instance of ValueDoesNotMatchKeyTypeError
|
49
|
+
#
|
50
|
+
# @param json_object [String]
|
51
|
+
# @return [CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError]
|
52
|
+
def self.from_json(json_object:)
|
53
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
54
|
+
schema_id = struct["schema_id"]
|
55
|
+
key = struct["key"]
|
56
|
+
expected_value_type = struct["expected_value_type"]
|
57
|
+
value = struct["value"]
|
58
|
+
new(
|
59
|
+
schema_id: schema_id,
|
60
|
+
key: key,
|
61
|
+
expected_value_type: expected_value_type,
|
62
|
+
value: value,
|
63
|
+
additional_properties: struct
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Serialize an instance of ValueDoesNotMatchKeyTypeError to a JSON object
|
68
|
+
#
|
69
|
+
# @return [String]
|
70
|
+
def to_json(*_args)
|
71
|
+
@_field_set&.to_json
|
72
|
+
end
|
73
|
+
|
74
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
75
|
+
# hash and check each fields type against the current object's property
|
76
|
+
# definitions.
|
77
|
+
#
|
78
|
+
# @param obj [Object]
|
79
|
+
# @return [Void]
|
80
|
+
def self.validate_raw(obj:)
|
81
|
+
obj.schema_id.is_a?(String) != false || raise("Passed value for field obj.schema_id is not the expected type, validation failed.")
|
82
|
+
obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.")
|
83
|
+
obj.expected_value_type.is_a?(CandidApiClient::Commons::Types::Primitive) != false || raise("Passed value for field obj.expected_value_type is not the expected type, validation failed.")
|
84
|
+
obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CandidApiClient
|
4
|
+
module PreEncounter
|
5
|
+
module Common
|
6
|
+
module Types
|
7
|
+
class Ethnicity
|
8
|
+
HISPANIC_OR_LATINO = "HISPANIC_OR_LATINO"
|
9
|
+
NOT_HISPANIC_OR_LATINO = "NOT_HISPANIC_OR_LATINO"
|
10
|
+
UNKNOWN = "UNKNOWN"
|
11
|
+
REFUSED = "REFUSED"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -5,10 +5,13 @@ module CandidApiClient
|
|
5
5
|
module Common
|
6
6
|
module Types
|
7
7
|
class Gender
|
8
|
-
|
9
|
-
|
8
|
+
MAN = "MAN"
|
9
|
+
WOMAN = "WOMAN"
|
10
|
+
NON_BINARY = "NON_BINARY"
|
11
|
+
TWO_SPIRIT = "TWO_SPIRIT"
|
10
12
|
OTHER = "OTHER"
|
11
13
|
UNKNOWN = "UNKNOWN"
|
14
|
+
REFUSED = "REFUSED"
|
12
15
|
end
|
13
16
|
end
|
14
17
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CandidApiClient
|
4
|
+
module PreEncounter
|
5
|
+
module Common
|
6
|
+
module Types
|
7
|
+
class Race
|
8
|
+
AMERICAN_INDIAN_OR_ALASKA_NATIVE = "AMERICAN_INDIAN_OR_ALASKA_NATIVE"
|
9
|
+
WHITE = "WHITE"
|
10
|
+
BLACK = "BLACK"
|
11
|
+
ASIAN = "ASIAN"
|
12
|
+
NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER = "NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER"
|
13
|
+
MIDDLE_EASTERN_OR_NORTH_AFRICAN = "MIDDLE_EASTERN_OR_NORTH_AFRICAN"
|
14
|
+
OTHER = "OTHER"
|
15
|
+
UNKNOWN = "UNKNOWN"
|
16
|
+
REFUSED = "REFUSED"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CandidApiClient
|
4
|
+
module PreEncounter
|
5
|
+
module Common
|
6
|
+
module Types
|
7
|
+
class SexualOrientation
|
8
|
+
HETEROSEXUAL = "HETEROSEXUAL"
|
9
|
+
HOMOSEXUAL = "HOMOSEXUAL"
|
10
|
+
BISEXUAL = "BISEXUAL"
|
11
|
+
TWO_SPIRIT = "TWO_SPIRIT"
|
12
|
+
OTHER = "OTHER"
|
13
|
+
UNKNOWN = "UNKNOWN"
|
14
|
+
REFUSED = "REFUSED"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -7,24 +7,24 @@ module CandidApiClient
|
|
7
7
|
module PreEncounter
|
8
8
|
module Coverages
|
9
9
|
class Client
|
10
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::
|
11
|
-
attr_reader :
|
10
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::V1Client]
|
11
|
+
attr_reader :v_1
|
12
12
|
|
13
13
|
# @param request_client [CandidApiClient::RequestClient]
|
14
14
|
# @return [CandidApiClient::PreEncounter::Coverages::Client]
|
15
15
|
def initialize(request_client:)
|
16
|
-
@
|
16
|
+
@v_1 = CandidApiClient::PreEncounter::Coverages::V1::V1Client.new(request_client: request_client)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
class AsyncClient
|
21
|
-
# @return [CandidApiClient::PreEncounter::Coverages::V1::
|
22
|
-
attr_reader :
|
21
|
+
# @return [CandidApiClient::PreEncounter::Coverages::V1::AsyncV1Client]
|
22
|
+
attr_reader :v_1
|
23
23
|
|
24
24
|
# @param request_client [CandidApiClient::AsyncRequestClient]
|
25
25
|
# @return [CandidApiClient::PreEncounter::Coverages::AsyncClient]
|
26
26
|
def initialize(request_client:)
|
27
|
-
@
|
27
|
+
@v_1 = CandidApiClient::PreEncounter::Coverages::V1::AsyncV1Client.new(request_client: request_client)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|