candidhealth 0.24.3 → 0.24.5

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/commons/types/procedure_modifier.rb +1 -0
  3. data/lib/candidhealth/custom_schemas/v_1/client.rb +20 -20
  4. data/lib/candidhealth/financials/types/account_type.rb +1 -0
  5. data/lib/candidhealth/pre_encounter/common/types/disability_status.rb +14 -0
  6. data/lib/candidhealth/pre_encounter/common/types/ethnicity.rb +16 -0
  7. data/lib/candidhealth/pre_encounter/common/types/gender.rb +5 -2
  8. data/lib/candidhealth/pre_encounter/common/types/race.rb +21 -0
  9. data/lib/candidhealth/pre_encounter/common/types/sex.rb +16 -0
  10. data/lib/candidhealth/pre_encounter/common/types/sexual_orientation.rb +19 -0
  11. data/lib/candidhealth/pre_encounter/coverages/client.rb +6 -6
  12. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +464 -11
  13. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +183 -0
  14. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_status.rb +20 -0
  15. data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb +134 -0
  16. data/lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb +129 -0
  17. data/lib/candidhealth/pre_encounter/coverages/v_1/types/network_type.rb +33 -0
  18. data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +88 -0
  19. data/lib/candidhealth/pre_encounter/patients/client.rb +6 -6
  20. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +607 -11
  21. data/lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb +133 -0
  22. data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provenance.rb +73 -0
  23. data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provider.rb +122 -0
  24. data/lib/candidhealth/pre_encounter/patients/v_1/types/filing_order.rb +63 -0
  25. data/lib/candidhealth/pre_encounter/patients/v_1/types/marital_status.rb +26 -0
  26. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +325 -0
  27. data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +389 -0
  28. data/lib/candidhealth/service_lines/v_2/types/service_line.rb +25 -1
  29. data/lib/candidhealth.rb +7 -7
  30. data/lib/requests.rb +2 -2
  31. data/lib/types_export.rb +18 -12
  32. metadata +20 -16
  33. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/client.rb +0 -487
  34. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage.rb +0 -185
  35. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_status.rb +0 -22
  36. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_type.rb +0 -18
  37. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/insurance_plan.rb +0 -136
  38. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/mutable_coverage.rb +0 -131
  39. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/subscriber.rb +0 -90
  40. data/lib/candidhealth/pre_encounter/patients/v_1/patients/client.rb +0 -590
  41. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/contact.rb +0 -135
  42. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provenance.rb +0 -75
  43. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provider.rb +0 -116
  44. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/marital_status.rb +0 -28
  45. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/mutable_patient.rb +0 -242
  46. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/patient.rb +0 -294
@@ -0,0 +1,325 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../common/types/human_name"
4
+ require_relative "../../../common/types/gender"
5
+ require "date"
6
+ require_relative "../../../common/types/sex"
7
+ require_relative "../../../common/types/sexual_orientation"
8
+ require_relative "../../../common/types/race"
9
+ require_relative "../../../common/types/ethnicity"
10
+ require_relative "../../../common/types/disability_status"
11
+ require_relative "marital_status"
12
+ require_relative "../../../common/types/address"
13
+ require_relative "../../../common/types/contact_point"
14
+ require_relative "external_provenance"
15
+ require_relative "contact"
16
+ require_relative "external_provider"
17
+ require_relative "filing_order"
18
+ require "ostruct"
19
+ require "json"
20
+
21
+ module CandidApiClient
22
+ module PreEncounter
23
+ module Patients
24
+ module V1
25
+ module Types
26
+ # An object representing patient demographics information.
27
+ class MutablePatient
28
+ # @return [CandidApiClient::PreEncounter::Common::Types::HumanName]
29
+ attr_reader :name
30
+ # @return [Array<CandidApiClient::PreEncounter::Common::Types::HumanName>] Other names for the patient.
31
+ attr_reader :other_names
32
+ # @return [CandidApiClient::PreEncounter::Common::Types::Gender]
33
+ attr_reader :gender
34
+ # @return [Date]
35
+ attr_reader :birth_date
36
+ # @return [String]
37
+ attr_reader :social_security_number
38
+ # @return [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient.
39
+ attr_reader :biological_sex
40
+ # @return [CandidApiClient::PreEncounter::Common::Types::SexualOrientation] The sexual orientation of the patient.
41
+ attr_reader :sexual_orientation
42
+ # @return [CandidApiClient::PreEncounter::Common::Types::Race]
43
+ attr_reader :race
44
+ # @return [CandidApiClient::PreEncounter::Common::Types::Ethnicity]
45
+ attr_reader :ethnicity
46
+ # @return [CandidApiClient::PreEncounter::Common::Types::DisabilityStatus]
47
+ attr_reader :disability_status
48
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::MaritalStatus]
49
+ attr_reader :marital_status
50
+ # @return [DateTime] Time of death for the patient. Leave unset if the patient is not deceased.
51
+ attr_reader :deceased
52
+ # @return [Integer] The number of siblings the patient was born with. Leave unset if the patient was
53
+ # not part of a multiple birth.
54
+ attr_reader :multiple_birth
55
+ # @return [CandidApiClient::PreEncounter::Common::Types::Address] The primary address for the patient.
56
+ attr_reader :primary_address
57
+ # @return [Array<CandidApiClient::PreEncounter::Common::Types::Address>] Other addresses for the patient.
58
+ attr_reader :other_addresses
59
+ # @return [CandidApiClient::PreEncounter::Common::Types::ContactPoint] The primary phone number for the patient.
60
+ attr_reader :primary_telecom
61
+ # @return [Array<CandidApiClient::PreEncounter::Common::Types::ContactPoint>] Other phone numbers for the patient.
62
+ attr_reader :other_telecoms
63
+ # @return [String]
64
+ attr_reader :email
65
+ # @return [Boolean]
66
+ attr_reader :electronic_communication_opt_in
67
+ # @return [String]
68
+ attr_reader :photo
69
+ # @return [String]
70
+ attr_reader :language
71
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance] Information about the upstream system that owns this patient data. Leave unset
72
+ # if Candid owns patient data.
73
+ attr_reader :external_provenance
74
+ # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Types::Contact>] Contacts for the patient.
75
+ attr_reader :contacts
76
+ # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider>]
77
+ attr_reader :general_practitioners
78
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder]
79
+ attr_reader :filing_order
80
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
81
+ attr_reader :additional_properties
82
+ # @return [Object]
83
+ attr_reader :_field_set
84
+ protected :_field_set
85
+
86
+ OMIT = Object.new
87
+
88
+ # @param name [CandidApiClient::PreEncounter::Common::Types::HumanName]
89
+ # @param other_names [Array<CandidApiClient::PreEncounter::Common::Types::HumanName>] Other names for the patient.
90
+ # @param gender [CandidApiClient::PreEncounter::Common::Types::Gender]
91
+ # @param birth_date [Date]
92
+ # @param social_security_number [String]
93
+ # @param biological_sex [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient.
94
+ # @param sexual_orientation [CandidApiClient::PreEncounter::Common::Types::SexualOrientation] The sexual orientation of the patient.
95
+ # @param race [CandidApiClient::PreEncounter::Common::Types::Race]
96
+ # @param ethnicity [CandidApiClient::PreEncounter::Common::Types::Ethnicity]
97
+ # @param disability_status [CandidApiClient::PreEncounter::Common::Types::DisabilityStatus]
98
+ # @param marital_status [CandidApiClient::PreEncounter::Patients::V1::Types::MaritalStatus]
99
+ # @param deceased [DateTime] Time of death for the patient. Leave unset if the patient is not deceased.
100
+ # @param multiple_birth [Integer] The number of siblings the patient was born with. Leave unset if the patient was
101
+ # not part of a multiple birth.
102
+ # @param primary_address [CandidApiClient::PreEncounter::Common::Types::Address] The primary address for the patient.
103
+ # @param other_addresses [Array<CandidApiClient::PreEncounter::Common::Types::Address>] Other addresses for the patient.
104
+ # @param primary_telecom [CandidApiClient::PreEncounter::Common::Types::ContactPoint] The primary phone number for the patient.
105
+ # @param other_telecoms [Array<CandidApiClient::PreEncounter::Common::Types::ContactPoint>] Other phone numbers for the patient.
106
+ # @param email [String]
107
+ # @param electronic_communication_opt_in [Boolean]
108
+ # @param photo [String]
109
+ # @param language [String]
110
+ # @param external_provenance [CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance] Information about the upstream system that owns this patient data. Leave unset
111
+ # if Candid owns patient data.
112
+ # @param contacts [Array<CandidApiClient::PreEncounter::Patients::V1::Types::Contact>] Contacts for the patient.
113
+ # @param general_practitioners [Array<CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider>]
114
+ # @param filing_order [CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder]
115
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
116
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::MutablePatient]
117
+ def initialize(name:, other_names:, gender:, birth_date:, primary_address:, other_addresses:, primary_telecom:, other_telecoms:, contacts:, general_practitioners:, filing_order:, social_security_number: OMIT,
118
+ biological_sex: OMIT, sexual_orientation: OMIT, race: OMIT, ethnicity: OMIT, disability_status: OMIT, marital_status: OMIT, deceased: OMIT, multiple_birth: OMIT, email: OMIT, electronic_communication_opt_in: OMIT, photo: OMIT, language: OMIT, external_provenance: OMIT, additional_properties: nil)
119
+ @name = name
120
+ @other_names = other_names
121
+ @gender = gender
122
+ @birth_date = birth_date
123
+ @social_security_number = social_security_number if social_security_number != OMIT
124
+ @biological_sex = biological_sex if biological_sex != OMIT
125
+ @sexual_orientation = sexual_orientation if sexual_orientation != OMIT
126
+ @race = race if race != OMIT
127
+ @ethnicity = ethnicity if ethnicity != OMIT
128
+ @disability_status = disability_status if disability_status != OMIT
129
+ @marital_status = marital_status if marital_status != OMIT
130
+ @deceased = deceased if deceased != OMIT
131
+ @multiple_birth = multiple_birth if multiple_birth != OMIT
132
+ @primary_address = primary_address
133
+ @other_addresses = other_addresses
134
+ @primary_telecom = primary_telecom
135
+ @other_telecoms = other_telecoms
136
+ @email = email if email != OMIT
137
+ if electronic_communication_opt_in != OMIT
138
+ @electronic_communication_opt_in = electronic_communication_opt_in
139
+ end
140
+ @photo = photo if photo != OMIT
141
+ @language = language if language != OMIT
142
+ @external_provenance = external_provenance if external_provenance != OMIT
143
+ @contacts = contacts
144
+ @general_practitioners = general_practitioners
145
+ @filing_order = filing_order
146
+ @additional_properties = additional_properties
147
+ @_field_set = {
148
+ "name": name,
149
+ "other_names": other_names,
150
+ "gender": gender,
151
+ "birth_date": birth_date,
152
+ "social_security_number": social_security_number,
153
+ "biological_sex": biological_sex,
154
+ "sexual_orientation": sexual_orientation,
155
+ "race": race,
156
+ "ethnicity": ethnicity,
157
+ "disability_status": disability_status,
158
+ "marital_status": marital_status,
159
+ "deceased": deceased,
160
+ "multiple_birth": multiple_birth,
161
+ "primary_address": primary_address,
162
+ "other_addresses": other_addresses,
163
+ "primary_telecom": primary_telecom,
164
+ "other_telecoms": other_telecoms,
165
+ "email": email,
166
+ "electronic_communication_opt_in": electronic_communication_opt_in,
167
+ "photo": photo,
168
+ "language": language,
169
+ "external_provenance": external_provenance,
170
+ "contacts": contacts,
171
+ "general_practitioners": general_practitioners,
172
+ "filing_order": filing_order
173
+ }.reject do |_k, v|
174
+ v == OMIT
175
+ end
176
+ end
177
+
178
+ # Deserialize a JSON object to an instance of MutablePatient
179
+ #
180
+ # @param json_object [String]
181
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::MutablePatient]
182
+ def self.from_json(json_object:)
183
+ struct = JSON.parse(json_object, object_class: OpenStruct)
184
+ parsed_json = JSON.parse(json_object)
185
+ if parsed_json["name"].nil?
186
+ name = nil
187
+ else
188
+ name = parsed_json["name"].to_json
189
+ name = CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: name)
190
+ end
191
+ other_names = parsed_json["other_names"]&.map do |item|
192
+ item = item.to_json
193
+ CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: item)
194
+ end
195
+ gender = struct["gender"]
196
+ birth_date = (Date.parse(parsed_json["birth_date"]) unless parsed_json["birth_date"].nil?)
197
+ social_security_number = struct["social_security_number"]
198
+ biological_sex = struct["biological_sex"]
199
+ sexual_orientation = struct["sexual_orientation"]
200
+ race = struct["race"]
201
+ ethnicity = struct["ethnicity"]
202
+ disability_status = struct["disability_status"]
203
+ marital_status = struct["marital_status"]
204
+ deceased = (DateTime.parse(parsed_json["deceased"]) unless parsed_json["deceased"].nil?)
205
+ multiple_birth = struct["multiple_birth"]
206
+ if parsed_json["primary_address"].nil?
207
+ primary_address = nil
208
+ else
209
+ primary_address = parsed_json["primary_address"].to_json
210
+ primary_address = CandidApiClient::PreEncounter::Common::Types::Address.from_json(json_object: primary_address)
211
+ end
212
+ other_addresses = parsed_json["other_addresses"]&.map do |item|
213
+ item = item.to_json
214
+ CandidApiClient::PreEncounter::Common::Types::Address.from_json(json_object: item)
215
+ end
216
+ if parsed_json["primary_telecom"].nil?
217
+ primary_telecom = nil
218
+ else
219
+ primary_telecom = parsed_json["primary_telecom"].to_json
220
+ primary_telecom = CandidApiClient::PreEncounter::Common::Types::ContactPoint.from_json(json_object: primary_telecom)
221
+ end
222
+ other_telecoms = parsed_json["other_telecoms"]&.map do |item|
223
+ item = item.to_json
224
+ CandidApiClient::PreEncounter::Common::Types::ContactPoint.from_json(json_object: item)
225
+ end
226
+ email = struct["email"]
227
+ electronic_communication_opt_in = struct["electronic_communication_opt_in"]
228
+ photo = struct["photo"]
229
+ language = struct["language"]
230
+ if parsed_json["external_provenance"].nil?
231
+ external_provenance = nil
232
+ else
233
+ external_provenance = parsed_json["external_provenance"].to_json
234
+ external_provenance = CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance.from_json(json_object: external_provenance)
235
+ end
236
+ contacts = parsed_json["contacts"]&.map do |item|
237
+ item = item.to_json
238
+ CandidApiClient::PreEncounter::Patients::V1::Types::Contact.from_json(json_object: item)
239
+ end
240
+ general_practitioners = parsed_json["general_practitioners"]&.map do |item|
241
+ item = item.to_json
242
+ CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider.from_json(json_object: item)
243
+ end
244
+ if parsed_json["filing_order"].nil?
245
+ filing_order = nil
246
+ else
247
+ filing_order = parsed_json["filing_order"].to_json
248
+ filing_order = CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder.from_json(json_object: filing_order)
249
+ end
250
+ new(
251
+ name: name,
252
+ other_names: other_names,
253
+ gender: gender,
254
+ birth_date: birth_date,
255
+ social_security_number: social_security_number,
256
+ biological_sex: biological_sex,
257
+ sexual_orientation: sexual_orientation,
258
+ race: race,
259
+ ethnicity: ethnicity,
260
+ disability_status: disability_status,
261
+ marital_status: marital_status,
262
+ deceased: deceased,
263
+ multiple_birth: multiple_birth,
264
+ primary_address: primary_address,
265
+ other_addresses: other_addresses,
266
+ primary_telecom: primary_telecom,
267
+ other_telecoms: other_telecoms,
268
+ email: email,
269
+ electronic_communication_opt_in: electronic_communication_opt_in,
270
+ photo: photo,
271
+ language: language,
272
+ external_provenance: external_provenance,
273
+ contacts: contacts,
274
+ general_practitioners: general_practitioners,
275
+ filing_order: filing_order,
276
+ additional_properties: struct
277
+ )
278
+ end
279
+
280
+ # Serialize an instance of MutablePatient to a JSON object
281
+ #
282
+ # @return [String]
283
+ def to_json(*_args)
284
+ @_field_set&.to_json
285
+ end
286
+
287
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
288
+ # hash and check each fields type against the current object's property
289
+ # definitions.
290
+ #
291
+ # @param obj [Object]
292
+ # @return [Void]
293
+ def self.validate_raw(obj:)
294
+ CandidApiClient::PreEncounter::Common::Types::HumanName.validate_raw(obj: obj.name)
295
+ obj.other_names.is_a?(Array) != false || raise("Passed value for field obj.other_names is not the expected type, validation failed.")
296
+ obj.gender.is_a?(CandidApiClient::PreEncounter::Common::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
297
+ obj.birth_date.is_a?(Date) != false || raise("Passed value for field obj.birth_date is not the expected type, validation failed.")
298
+ obj.social_security_number&.is_a?(String) != false || raise("Passed value for field obj.social_security_number is not the expected type, validation failed.")
299
+ obj.biological_sex&.is_a?(CandidApiClient::PreEncounter::Common::Types::Sex) != false || raise("Passed value for field obj.biological_sex is not the expected type, validation failed.")
300
+ obj.sexual_orientation&.is_a?(CandidApiClient::PreEncounter::Common::Types::SexualOrientation) != false || raise("Passed value for field obj.sexual_orientation is not the expected type, validation failed.")
301
+ obj.race&.is_a?(CandidApiClient::PreEncounter::Common::Types::Race) != false || raise("Passed value for field obj.race is not the expected type, validation failed.")
302
+ obj.ethnicity&.is_a?(CandidApiClient::PreEncounter::Common::Types::Ethnicity) != false || raise("Passed value for field obj.ethnicity is not the expected type, validation failed.")
303
+ obj.disability_status&.is_a?(CandidApiClient::PreEncounter::Common::Types::DisabilityStatus) != false || raise("Passed value for field obj.disability_status is not the expected type, validation failed.")
304
+ obj.marital_status&.is_a?(CandidApiClient::PreEncounter::Patients::V1::Types::MaritalStatus) != false || raise("Passed value for field obj.marital_status is not the expected type, validation failed.")
305
+ obj.deceased&.is_a?(DateTime) != false || raise("Passed value for field obj.deceased is not the expected type, validation failed.")
306
+ obj.multiple_birth&.is_a?(Integer) != false || raise("Passed value for field obj.multiple_birth is not the expected type, validation failed.")
307
+ CandidApiClient::PreEncounter::Common::Types::Address.validate_raw(obj: obj.primary_address)
308
+ obj.other_addresses.is_a?(Array) != false || raise("Passed value for field obj.other_addresses is not the expected type, validation failed.")
309
+ CandidApiClient::PreEncounter::Common::Types::ContactPoint.validate_raw(obj: obj.primary_telecom)
310
+ obj.other_telecoms.is_a?(Array) != false || raise("Passed value for field obj.other_telecoms is not the expected type, validation failed.")
311
+ obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
312
+ obj.electronic_communication_opt_in&.is_a?(Boolean) != false || raise("Passed value for field obj.electronic_communication_opt_in is not the expected type, validation failed.")
313
+ obj.photo&.is_a?(String) != false || raise("Passed value for field obj.photo is not the expected type, validation failed.")
314
+ obj.language&.is_a?(String) != false || raise("Passed value for field obj.language is not the expected type, validation failed.")
315
+ obj.external_provenance.nil? || CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance.validate_raw(obj: obj.external_provenance)
316
+ obj.contacts.is_a?(Array) != false || raise("Passed value for field obj.contacts is not the expected type, validation failed.")
317
+ obj.general_practitioners.is_a?(Array) != false || raise("Passed value for field obj.general_practitioners is not the expected type, validation failed.")
318
+ CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder.validate_raw(obj: obj.filing_order)
319
+ end
320
+ end
321
+ end
322
+ end
323
+ end
324
+ end
325
+ end