candidhealth 0.24.3 → 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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/pre_encounter/common/types/disability_status.rb +14 -0
  3. data/lib/candidhealth/pre_encounter/common/types/ethnicity.rb +16 -0
  4. data/lib/candidhealth/pre_encounter/common/types/gender.rb +5 -2
  5. data/lib/candidhealth/pre_encounter/common/types/race.rb +21 -0
  6. data/lib/candidhealth/pre_encounter/common/types/sex.rb +16 -0
  7. data/lib/candidhealth/pre_encounter/common/types/sexual_orientation.rb +19 -0
  8. data/lib/candidhealth/pre_encounter/coverages/client.rb +6 -6
  9. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +464 -11
  10. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +183 -0
  11. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_status.rb +20 -0
  12. data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb +134 -0
  13. data/lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb +129 -0
  14. data/lib/candidhealth/pre_encounter/coverages/v_1/types/network_type.rb +33 -0
  15. data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +88 -0
  16. data/lib/candidhealth/pre_encounter/patients/client.rb +6 -6
  17. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +607 -11
  18. data/lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb +133 -0
  19. data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provenance.rb +73 -0
  20. data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provider.rb +122 -0
  21. data/lib/candidhealth/pre_encounter/patients/v_1/types/filing_order.rb +63 -0
  22. data/lib/candidhealth/pre_encounter/patients/v_1/types/marital_status.rb +26 -0
  23. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +325 -0
  24. data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +389 -0
  25. data/lib/candidhealth.rb +7 -7
  26. data/lib/requests.rb +2 -2
  27. data/lib/types_export.rb +18 -12
  28. metadata +20 -16
  29. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/client.rb +0 -487
  30. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage.rb +0 -185
  31. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_status.rb +0 -22
  32. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_type.rb +0 -18
  33. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/insurance_plan.rb +0 -136
  34. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/mutable_coverage.rb +0 -131
  35. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/subscriber.rb +0 -90
  36. data/lib/candidhealth/pre_encounter/patients/v_1/patients/client.rb +0 -590
  37. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/contact.rb +0 -135
  38. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provenance.rb +0 -75
  39. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provider.rb +0 -116
  40. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/marital_status.rb +0 -28
  41. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/mutable_patient.rb +0 -242
  42. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/patient.rb +0 -294
@@ -0,0 +1,183 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require_relative "coverage_status"
5
+ require_relative "subscriber"
6
+ require_relative "../../../common/types/relationship"
7
+ require_relative "insurance_plan"
8
+ require "ostruct"
9
+ require "json"
10
+
11
+ module CandidApiClient
12
+ module PreEncounter
13
+ module Coverages
14
+ module V1
15
+ module Types
16
+ # A coverage object with immutable server-owned properties.
17
+ class Coverage
18
+ # @return [String]
19
+ attr_reader :id
20
+ # @return [String] The organization that owns this coverage.
21
+ attr_reader :organization_id
22
+ # @return [Boolean] True if the coverage is deactivated. Deactivated coverages are not returned in
23
+ # search results but are returned in all other endpoints including scan.
24
+ attr_reader :deactivated
25
+ # @return [Integer] The version of the coverage. Any update to any property of a coverage object
26
+ # will create a new version.
27
+ attr_reader :version
28
+ # @return [DateTime]
29
+ attr_reader :updated_at
30
+ # @return [String] The user ID of the user who last updated the coverage.
31
+ attr_reader :updating_user_id
32
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageStatus] The status indiciating if the coverage is active or not.
33
+ attr_reader :status
34
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber] The party who has signed-up for or 'owns' the contractual relationship to the
35
+ # policy or to whom the benefit of the policy for services rendered to them or
36
+ # their family is due.
37
+ attr_reader :subscriber
38
+ # @return [CandidApiClient::PreEncounter::Common::Types::Relationship] The relationship of beneficiary (patient) to the subscriber.
39
+ # https://hl7.org/fhir/valueset-relationship.html
40
+ attr_reader :relationship
41
+ # @return [String] The patient who benefits from the insurance coverage
42
+ attr_reader :patient
43
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan]
44
+ attr_reader :insurance_plan
45
+ # @return [Boolean] A boolean indicating if the coverage has been verified by a user.
46
+ attr_reader :verified
47
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
48
+ attr_reader :additional_properties
49
+ # @return [Object]
50
+ attr_reader :_field_set
51
+ protected :_field_set
52
+
53
+ OMIT = Object.new
54
+
55
+ # @param id [String]
56
+ # @param organization_id [String] The organization that owns this coverage.
57
+ # @param deactivated [Boolean] True if the coverage is deactivated. Deactivated coverages are not returned in
58
+ # search results but are returned in all other endpoints including scan.
59
+ # @param version [Integer] The version of the coverage. Any update to any property of a coverage object
60
+ # will create a new version.
61
+ # @param updated_at [DateTime]
62
+ # @param updating_user_id [String] The user ID of the user who last updated the coverage.
63
+ # @param status [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageStatus] The status indiciating if the coverage is active or not.
64
+ # @param subscriber [CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber] The party who has signed-up for or 'owns' the contractual relationship to the
65
+ # policy or to whom the benefit of the policy for services rendered to them or
66
+ # their family is due.
67
+ # @param relationship [CandidApiClient::PreEncounter::Common::Types::Relationship] The relationship of beneficiary (patient) to the subscriber.
68
+ # https://hl7.org/fhir/valueset-relationship.html
69
+ # @param patient [String] The patient who benefits from the insurance coverage
70
+ # @param insurance_plan [CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan]
71
+ # @param verified [Boolean] A boolean indicating if the coverage has been verified by a user.
72
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
73
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage]
74
+ def initialize(id:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, status:,
75
+ subscriber:, relationship:, patient:, insurance_plan:, verified:, additional_properties: nil)
76
+ @id = id
77
+ @organization_id = organization_id
78
+ @deactivated = deactivated
79
+ @version = version
80
+ @updated_at = updated_at
81
+ @updating_user_id = updating_user_id
82
+ @status = status
83
+ @subscriber = subscriber
84
+ @relationship = relationship
85
+ @patient = patient
86
+ @insurance_plan = insurance_plan
87
+ @verified = verified
88
+ @additional_properties = additional_properties
89
+ @_field_set = {
90
+ "id": id,
91
+ "organization_id": organization_id,
92
+ "deactivated": deactivated,
93
+ "version": version,
94
+ "updated_at": updated_at,
95
+ "updating_user_id": updating_user_id,
96
+ "status": status,
97
+ "subscriber": subscriber,
98
+ "relationship": relationship,
99
+ "patient": patient,
100
+ "insurance_plan": insurance_plan,
101
+ "verified": verified
102
+ }
103
+ end
104
+
105
+ # Deserialize a JSON object to an instance of Coverage
106
+ #
107
+ # @param json_object [String]
108
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::Coverage]
109
+ def self.from_json(json_object:)
110
+ struct = JSON.parse(json_object, object_class: OpenStruct)
111
+ parsed_json = JSON.parse(json_object)
112
+ id = struct["id"]
113
+ organization_id = struct["organization_id"]
114
+ deactivated = struct["deactivated"]
115
+ version = struct["version"]
116
+ updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
117
+ updating_user_id = struct["updating_user_id"]
118
+ status = struct["status"]
119
+ if parsed_json["subscriber"].nil?
120
+ subscriber = nil
121
+ else
122
+ subscriber = parsed_json["subscriber"].to_json
123
+ subscriber = CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber.from_json(json_object: subscriber)
124
+ end
125
+ relationship = struct["relationship"]
126
+ patient = struct["patient"]
127
+ if parsed_json["insurance_plan"].nil?
128
+ insurance_plan = nil
129
+ else
130
+ insurance_plan = parsed_json["insurance_plan"].to_json
131
+ insurance_plan = CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan.from_json(json_object: insurance_plan)
132
+ end
133
+ verified = struct["verified"]
134
+ new(
135
+ id: id,
136
+ organization_id: organization_id,
137
+ deactivated: deactivated,
138
+ version: version,
139
+ updated_at: updated_at,
140
+ updating_user_id: updating_user_id,
141
+ status: status,
142
+ subscriber: subscriber,
143
+ relationship: relationship,
144
+ patient: patient,
145
+ insurance_plan: insurance_plan,
146
+ verified: verified,
147
+ additional_properties: struct
148
+ )
149
+ end
150
+
151
+ # Serialize an instance of Coverage to a JSON object
152
+ #
153
+ # @return [String]
154
+ def to_json(*_args)
155
+ @_field_set&.to_json
156
+ end
157
+
158
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
159
+ # hash and check each fields type against the current object's property
160
+ # definitions.
161
+ #
162
+ # @param obj [Object]
163
+ # @return [Void]
164
+ def self.validate_raw(obj:)
165
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
166
+ obj.organization_id.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
167
+ obj.deactivated.is_a?(Boolean) != false || raise("Passed value for field obj.deactivated is not the expected type, validation failed.")
168
+ obj.version.is_a?(Integer) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
169
+ obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
170
+ obj.updating_user_id.is_a?(String) != false || raise("Passed value for field obj.updating_user_id is not the expected type, validation failed.")
171
+ obj.status.is_a?(CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
172
+ CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber.validate_raw(obj: obj.subscriber)
173
+ obj.relationship.is_a?(CandidApiClient::PreEncounter::Common::Types::Relationship) != false || raise("Passed value for field obj.relationship is not the expected type, validation failed.")
174
+ obj.patient.is_a?(String) != false || raise("Passed value for field obj.patient is not the expected type, validation failed.")
175
+ CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan.validate_raw(obj: obj.insurance_plan)
176
+ obj.verified.is_a?(Boolean) != false || raise("Passed value for field obj.verified is not the expected type, validation failed.")
177
+ end
178
+ end
179
+ end
180
+ end
181
+ end
182
+ end
183
+ end
@@ -0,0 +1,20 @@
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 defined at
9
+ # https://build.fhir.org/valueset-fm-status.html
10
+ class CoverageStatus
11
+ ACTIVE = "ACTIVE"
12
+ CANCELLED = "CANCELLED"
13
+ DRAFT = "DRAFT"
14
+ ENTERED_IN_ERROR = "ENTERED_IN_ERROR"
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,134 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "network_type"
4
+ require_relative "../../../common/types/period"
5
+ require "ostruct"
6
+ require "json"
7
+
8
+ module CandidApiClient
9
+ module PreEncounter
10
+ module Coverages
11
+ module V1
12
+ module Types
13
+ class InsurancePlan
14
+ # @return [String]
15
+ attr_reader :member_id
16
+ # @return [String]
17
+ attr_reader :payer_id
18
+ # @return [String]
19
+ attr_reader :payer_name
20
+ # @return [String]
21
+ attr_reader :group_number
22
+ # @return [String]
23
+ attr_reader :name
24
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::NetworkType]
25
+ attr_reader :type
26
+ # @return [CandidApiClient::PreEncounter::Common::Types::Period]
27
+ attr_reader :period
28
+ # @return [String]
29
+ attr_reader :insurance_card_image_locator
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 member_id [String]
39
+ # @param payer_id [String]
40
+ # @param payer_name [String]
41
+ # @param group_number [String]
42
+ # @param name [String]
43
+ # @param type [CandidApiClient::PreEncounter::Coverages::V1::Types::NetworkType]
44
+ # @param period [CandidApiClient::PreEncounter::Common::Types::Period]
45
+ # @param insurance_card_image_locator [String]
46
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
47
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan]
48
+ def initialize(member_id:, payer_id:, payer_name:, group_number: OMIT, name: OMIT, type: OMIT,
49
+ period: OMIT, insurance_card_image_locator: OMIT, additional_properties: nil)
50
+ @member_id = member_id
51
+ @payer_id = payer_id
52
+ @payer_name = payer_name
53
+ @group_number = group_number if group_number != OMIT
54
+ @name = name if name != OMIT
55
+ @type = type if type != OMIT
56
+ @period = period if period != OMIT
57
+ @insurance_card_image_locator = insurance_card_image_locator if insurance_card_image_locator != OMIT
58
+ @additional_properties = additional_properties
59
+ @_field_set = {
60
+ "member_id": member_id,
61
+ "payer_id": payer_id,
62
+ "payer_name": payer_name,
63
+ "group_number": group_number,
64
+ "name": name,
65
+ "type": type,
66
+ "period": period,
67
+ "insurance_card_image_locator": insurance_card_image_locator
68
+ }.reject do |_k, v|
69
+ v == OMIT
70
+ end
71
+ end
72
+
73
+ # Deserialize a JSON object to an instance of InsurancePlan
74
+ #
75
+ # @param json_object [String]
76
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan]
77
+ def self.from_json(json_object:)
78
+ struct = JSON.parse(json_object, object_class: OpenStruct)
79
+ parsed_json = JSON.parse(json_object)
80
+ member_id = struct["member_id"]
81
+ payer_id = struct["payer_id"]
82
+ payer_name = struct["payer_name"]
83
+ group_number = struct["group_number"]
84
+ name = struct["name"]
85
+ type = struct["type"]
86
+ if parsed_json["period"].nil?
87
+ period = nil
88
+ else
89
+ period = parsed_json["period"].to_json
90
+ period = CandidApiClient::PreEncounter::Common::Types::Period.from_json(json_object: period)
91
+ end
92
+ insurance_card_image_locator = struct["insurance_card_image_locator"]
93
+ new(
94
+ member_id: member_id,
95
+ payer_id: payer_id,
96
+ payer_name: payer_name,
97
+ group_number: group_number,
98
+ name: name,
99
+ type: type,
100
+ period: period,
101
+ insurance_card_image_locator: insurance_card_image_locator,
102
+ additional_properties: struct
103
+ )
104
+ end
105
+
106
+ # Serialize an instance of InsurancePlan to a JSON object
107
+ #
108
+ # @return [String]
109
+ def to_json(*_args)
110
+ @_field_set&.to_json
111
+ end
112
+
113
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
114
+ # hash and check each fields type against the current object's property
115
+ # definitions.
116
+ #
117
+ # @param obj [Object]
118
+ # @return [Void]
119
+ def self.validate_raw(obj:)
120
+ obj.member_id.is_a?(String) != false || raise("Passed value for field obj.member_id is not the expected type, validation failed.")
121
+ obj.payer_id.is_a?(String) != false || raise("Passed value for field obj.payer_id is not the expected type, validation failed.")
122
+ obj.payer_name.is_a?(String) != false || raise("Passed value for field obj.payer_name is not the expected type, validation failed.")
123
+ obj.group_number&.is_a?(String) != false || raise("Passed value for field obj.group_number is not the expected type, validation failed.")
124
+ obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
125
+ obj.type&.is_a?(CandidApiClient::PreEncounter::Coverages::V1::Types::NetworkType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
126
+ obj.period.nil? || CandidApiClient::PreEncounter::Common::Types::Period.validate_raw(obj: obj.period)
127
+ obj.insurance_card_image_locator&.is_a?(String) != false || raise("Passed value for field obj.insurance_card_image_locator is not the expected type, validation failed.")
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
@@ -0,0 +1,129 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "coverage_status"
4
+ require_relative "subscriber"
5
+ require_relative "../../../common/types/relationship"
6
+ require_relative "insurance_plan"
7
+ require "ostruct"
8
+ require "json"
9
+
10
+ module CandidApiClient
11
+ module PreEncounter
12
+ module Coverages
13
+ module V1
14
+ module Types
15
+ class MutableCoverage
16
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageStatus] The status indiciating if the coverage is active or not.
17
+ attr_reader :status
18
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber] The party who has signed-up for or 'owns' the contractual relationship to the
19
+ # policy or to whom the benefit of the policy for services rendered to them or
20
+ # their family is due.
21
+ attr_reader :subscriber
22
+ # @return [CandidApiClient::PreEncounter::Common::Types::Relationship] The relationship of beneficiary (patient) to the subscriber.
23
+ # https://hl7.org/fhir/valueset-relationship.html
24
+ attr_reader :relationship
25
+ # @return [String] The patient who benefits from the insurance coverage
26
+ attr_reader :patient
27
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan]
28
+ attr_reader :insurance_plan
29
+ # @return [Boolean] A boolean indicating if the coverage has been verified by a user.
30
+ attr_reader :verified
31
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
32
+ attr_reader :additional_properties
33
+ # @return [Object]
34
+ attr_reader :_field_set
35
+ protected :_field_set
36
+
37
+ OMIT = Object.new
38
+
39
+ # @param status [CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageStatus] The status indiciating if the coverage is active or not.
40
+ # @param subscriber [CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber] The party who has signed-up for or 'owns' the contractual relationship to the
41
+ # policy or to whom the benefit of the policy for services rendered to them or
42
+ # their family is due.
43
+ # @param relationship [CandidApiClient::PreEncounter::Common::Types::Relationship] The relationship of beneficiary (patient) to the subscriber.
44
+ # https://hl7.org/fhir/valueset-relationship.html
45
+ # @param patient [String] The patient who benefits from the insurance coverage
46
+ # @param insurance_plan [CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan]
47
+ # @param verified [Boolean] A boolean indicating if the coverage has been verified by a user.
48
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
49
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::MutableCoverage]
50
+ def initialize(status:, subscriber:, relationship:, patient:, insurance_plan:, verified:,
51
+ additional_properties: nil)
52
+ @status = status
53
+ @subscriber = subscriber
54
+ @relationship = relationship
55
+ @patient = patient
56
+ @insurance_plan = insurance_plan
57
+ @verified = verified
58
+ @additional_properties = additional_properties
59
+ @_field_set = {
60
+ "status": status,
61
+ "subscriber": subscriber,
62
+ "relationship": relationship,
63
+ "patient": patient,
64
+ "insurance_plan": insurance_plan,
65
+ "verified": verified
66
+ }
67
+ end
68
+
69
+ # Deserialize a JSON object to an instance of MutableCoverage
70
+ #
71
+ # @param json_object [String]
72
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::MutableCoverage]
73
+ def self.from_json(json_object:)
74
+ struct = JSON.parse(json_object, object_class: OpenStruct)
75
+ parsed_json = JSON.parse(json_object)
76
+ status = struct["status"]
77
+ if parsed_json["subscriber"].nil?
78
+ subscriber = nil
79
+ else
80
+ subscriber = parsed_json["subscriber"].to_json
81
+ subscriber = CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber.from_json(json_object: subscriber)
82
+ end
83
+ relationship = struct["relationship"]
84
+ patient = struct["patient"]
85
+ if parsed_json["insurance_plan"].nil?
86
+ insurance_plan = nil
87
+ else
88
+ insurance_plan = parsed_json["insurance_plan"].to_json
89
+ insurance_plan = CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan.from_json(json_object: insurance_plan)
90
+ end
91
+ verified = struct["verified"]
92
+ new(
93
+ status: status,
94
+ subscriber: subscriber,
95
+ relationship: relationship,
96
+ patient: patient,
97
+ insurance_plan: insurance_plan,
98
+ verified: verified,
99
+ additional_properties: struct
100
+ )
101
+ end
102
+
103
+ # Serialize an instance of MutableCoverage to a JSON object
104
+ #
105
+ # @return [String]
106
+ def to_json(*_args)
107
+ @_field_set&.to_json
108
+ end
109
+
110
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
111
+ # hash and check each fields type against the current object's property
112
+ # definitions.
113
+ #
114
+ # @param obj [Object]
115
+ # @return [Void]
116
+ def self.validate_raw(obj:)
117
+ obj.status.is_a?(CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
118
+ CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber.validate_raw(obj: obj.subscriber)
119
+ obj.relationship.is_a?(CandidApiClient::PreEncounter::Common::Types::Relationship) != false || raise("Passed value for field obj.relationship is not the expected type, validation failed.")
120
+ obj.patient.is_a?(String) != false || raise("Passed value for field obj.patient is not the expected type, validation failed.")
121
+ CandidApiClient::PreEncounter::Coverages::V1::Types::InsurancePlan.validate_raw(obj: obj.insurance_plan)
122
+ obj.verified.is_a?(Boolean) != false || raise("Passed value for field obj.verified is not the expected type, validation failed.")
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CandidApiClient
4
+ module PreEncounter
5
+ module Coverages
6
+ module V1
7
+ module Types
8
+ class NetworkType
9
+ PPO = "12"
10
+ POS = "13"
11
+ EPO = "14"
12
+ INDEMNITY_INSURANCE = "15"
13
+ HMO_MEDICARE_RISK = "16"
14
+ DMO = "17"
15
+ AUTO = "AM"
16
+ CHAMPUS = "CH"
17
+ DISABILITY = "DS"
18
+ HMO = "HM"
19
+ LIABILITY = "LM"
20
+ MEDICARE_PART_A = "MA"
21
+ MEDICARE_PART_B = "MB"
22
+ MEDICAID = "MC"
23
+ OTHER_FEDERAL_PROGRAM = "OF"
24
+ TITLE_V = "TV"
25
+ VETERANS_AFFAIRS_PLAN = "VA"
26
+ WORKERS_COMP_HEALTH_CLAIM = "WC"
27
+ MUTUALLY_DEFINED = "ZZ"
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../common/types/human_name"
4
+ require "date"
5
+ require_relative "../../../common/types/gender"
6
+ require "ostruct"
7
+ require "json"
8
+
9
+ module CandidApiClient
10
+ module PreEncounter
11
+ module Coverages
12
+ module V1
13
+ module Types
14
+ class Subscriber
15
+ # @return [CandidApiClient::PreEncounter::Common::Types::HumanName]
16
+ attr_reader :name
17
+ # @return [Date]
18
+ attr_reader :date_of_birth
19
+ # @return [CandidApiClient::PreEncounter::Common::Types::Gender]
20
+ attr_reader :gender
21
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
22
+ attr_reader :additional_properties
23
+ # @return [Object]
24
+ attr_reader :_field_set
25
+ protected :_field_set
26
+
27
+ OMIT = Object.new
28
+
29
+ # @param name [CandidApiClient::PreEncounter::Common::Types::HumanName]
30
+ # @param date_of_birth [Date]
31
+ # @param gender [CandidApiClient::PreEncounter::Common::Types::Gender]
32
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
33
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber]
34
+ def initialize(name:, date_of_birth:, gender:, additional_properties: nil)
35
+ @name = name
36
+ @date_of_birth = date_of_birth
37
+ @gender = gender
38
+ @additional_properties = additional_properties
39
+ @_field_set = { "name": name, "date_of_birth": date_of_birth, "gender": gender }
40
+ end
41
+
42
+ # Deserialize a JSON object to an instance of Subscriber
43
+ #
44
+ # @param json_object [String]
45
+ # @return [CandidApiClient::PreEncounter::Coverages::V1::Types::Subscriber]
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["name"].nil?
50
+ name = nil
51
+ else
52
+ name = parsed_json["name"].to_json
53
+ name = CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: name)
54
+ end
55
+ date_of_birth = (Date.parse(parsed_json["date_of_birth"]) unless parsed_json["date_of_birth"].nil?)
56
+ gender = struct["gender"]
57
+ new(
58
+ name: name,
59
+ date_of_birth: date_of_birth,
60
+ gender: gender,
61
+ additional_properties: struct
62
+ )
63
+ end
64
+
65
+ # Serialize an instance of Subscriber to a JSON object
66
+ #
67
+ # @return [String]
68
+ def to_json(*_args)
69
+ @_field_set&.to_json
70
+ end
71
+
72
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
73
+ # hash and check each fields type against the current object's property
74
+ # definitions.
75
+ #
76
+ # @param obj [Object]
77
+ # @return [Void]
78
+ def self.validate_raw(obj:)
79
+ CandidApiClient::PreEncounter::Common::Types::HumanName.validate_raw(obj: obj.name)
80
+ obj.date_of_birth.is_a?(Date) != false || raise("Passed value for field obj.date_of_birth is not the expected type, validation failed.")
81
+ obj.gender.is_a?(CandidApiClient::PreEncounter::Common::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -7,24 +7,24 @@ module CandidApiClient
7
7
  module PreEncounter
8
8
  module Patients
9
9
  class Client
10
- # @return [CandidApiClient::PreEncounter::Patients::V1::Client]
11
- attr_reader :pre_encounter
10
+ # @return [CandidApiClient::PreEncounter::Patients::V1::V1Client]
11
+ attr_reader :v_1
12
12
 
13
13
  # @param request_client [CandidApiClient::RequestClient]
14
14
  # @return [CandidApiClient::PreEncounter::Patients::Client]
15
15
  def initialize(request_client:)
16
- @pre_encounter = CandidApiClient::PreEncounter::Patients::V1::Client.new(request_client: request_client)
16
+ @v_1 = CandidApiClient::PreEncounter::Patients::V1::V1Client.new(request_client: request_client)
17
17
  end
18
18
  end
19
19
 
20
20
  class AsyncClient
21
- # @return [CandidApiClient::PreEncounter::Patients::V1::AsyncClient]
22
- attr_reader :pre_encounter
21
+ # @return [CandidApiClient::PreEncounter::Patients::V1::AsyncV1Client]
22
+ attr_reader :v_1
23
23
 
24
24
  # @param request_client [CandidApiClient::AsyncRequestClient]
25
25
  # @return [CandidApiClient::PreEncounter::Patients::AsyncClient]
26
26
  def initialize(request_client:)
27
- @pre_encounter = CandidApiClient::PreEncounter::Patients::V1::AsyncClient.new(request_client: request_client)
27
+ @v_1 = CandidApiClient::PreEncounter::Patients::V1::AsyncV1Client.new(request_client: request_client)
28
28
  end
29
29
  end
30
30
  end