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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/lib/candidhealth/commons/types/primitive.rb +17 -0
  3. data/lib/candidhealth/custom_schemas/client.rb +30 -0
  4. data/lib/candidhealth/custom_schemas/v_1/client.rb +291 -0
  5. data/lib/candidhealth/custom_schemas/v_1/types/key_with_name_already_exists_error.rb +71 -0
  6. data/lib/candidhealth/custom_schemas/v_1/types/schema.rb +91 -0
  7. data/lib/candidhealth/custom_schemas/v_1/types/schema_field.rb +71 -0
  8. data/lib/candidhealth/custom_schemas/v_1/types/schema_get_multi_response.rb +65 -0
  9. data/lib/candidhealth/custom_schemas/v_1/types/schema_instance.rb +76 -0
  10. data/lib/candidhealth/custom_schemas/v_1/types/schema_validation_error.rb +100 -0
  11. data/lib/candidhealth/custom_schemas/v_1/types/schema_validation_failure.rb +65 -0
  12. data/lib/candidhealth/custom_schemas/v_1/types/schema_with_name_already_exists_error.rb +70 -0
  13. data/lib/candidhealth/encounters/v_4/client.rb +49 -12
  14. data/lib/candidhealth/encounters/v_4/types/encounter.rb +17 -1
  15. data/lib/candidhealth/encounters/v_4/types/key_does_not_exist_error.rb +70 -0
  16. data/lib/candidhealth/encounters/v_4/types/multiple_instances_for_schema_error.rb +60 -0
  17. data/lib/candidhealth/encounters/v_4/types/schema_does_not_exist_error.rb +60 -0
  18. data/lib/candidhealth/encounters/v_4/types/schema_instance_validation_error.rb +139 -0
  19. data/lib/candidhealth/encounters/v_4/types/schema_instance_validation_failure.rb +65 -0
  20. data/lib/candidhealth/encounters/v_4/types/schema_unauthorized_access_error.rb +60 -0
  21. data/lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb +90 -0
  22. data/lib/candidhealth/pre_encounter/common/types/disability_status.rb +14 -0
  23. data/lib/candidhealth/pre_encounter/common/types/ethnicity.rb +16 -0
  24. data/lib/candidhealth/pre_encounter/common/types/gender.rb +5 -2
  25. data/lib/candidhealth/pre_encounter/common/types/race.rb +21 -0
  26. data/lib/candidhealth/pre_encounter/common/types/sex.rb +16 -0
  27. data/lib/candidhealth/pre_encounter/common/types/sexual_orientation.rb +19 -0
  28. data/lib/candidhealth/pre_encounter/coverages/client.rb +6 -6
  29. data/lib/candidhealth/pre_encounter/coverages/v_1/client.rb +464 -11
  30. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage.rb +183 -0
  31. data/lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_status.rb +20 -0
  32. data/lib/candidhealth/pre_encounter/coverages/v_1/types/insurance_plan.rb +134 -0
  33. data/lib/candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage.rb +129 -0
  34. data/lib/candidhealth/pre_encounter/coverages/v_1/types/network_type.rb +33 -0
  35. data/lib/candidhealth/pre_encounter/coverages/v_1/types/subscriber.rb +88 -0
  36. data/lib/candidhealth/pre_encounter/patients/client.rb +6 -6
  37. data/lib/candidhealth/pre_encounter/patients/v_1/client.rb +607 -11
  38. data/lib/candidhealth/pre_encounter/patients/v_1/types/contact.rb +133 -0
  39. data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provenance.rb +73 -0
  40. data/lib/candidhealth/pre_encounter/patients/v_1/types/external_provider.rb +122 -0
  41. data/lib/candidhealth/pre_encounter/patients/v_1/types/filing_order.rb +63 -0
  42. data/lib/candidhealth/pre_encounter/patients/v_1/types/marital_status.rb +26 -0
  43. data/lib/candidhealth/pre_encounter/patients/v_1/types/mutable_patient.rb +325 -0
  44. data/lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb +389 -0
  45. data/lib/candidhealth.rb +14 -7
  46. data/lib/requests.rb +2 -2
  47. data/lib/types_export.rb +34 -12
  48. metadata +38 -16
  49. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/client.rb +0 -487
  50. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage.rb +0 -185
  51. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_status.rb +0 -22
  52. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_type.rb +0 -18
  53. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/insurance_plan.rb +0 -136
  54. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/mutable_coverage.rb +0 -131
  55. data/lib/candidhealth/pre_encounter/coverages/v_1/coverages/types/subscriber.rb +0 -90
  56. data/lib/candidhealth/pre_encounter/patients/v_1/patients/client.rb +0 -590
  57. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/contact.rb +0 -135
  58. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provenance.rb +0 -75
  59. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/external_provider.rb +0 -116
  60. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/marital_status.rb +0 -28
  61. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/mutable_patient.rb +0 -242
  62. data/lib/candidhealth/pre_encounter/patients/v_1/patients/types/patient.rb +0 -294
@@ -0,0 +1,389 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require_relative "../../../common/types/human_name"
5
+ require_relative "../../../common/types/gender"
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
+ # A patient object with immutable server-owned properties.
27
+ class Patient
28
+ # @return [String] The unique UUID identifier for a Patient. Patient ID is used in machine
29
+ # contexts.
30
+ attr_reader :id
31
+ # @return [String] The medical record number for the patient. Human-friendly Candid generated MRNs
32
+ # are of the form JCH + 8 alphanumeric characters. MRNs are not case-sensitive.
33
+ attr_reader :mrn
34
+ # @return [String] The organization that owns this patient.
35
+ attr_reader :organization_id
36
+ # @return [Boolean] True if the patient is deactivated. Deactivated patients are not returned in
37
+ # search results but are returned in all other endpoints including scan.
38
+ attr_reader :deactivated
39
+ # @return [Integer] The version of the patient. Any update to any property of a patient object will
40
+ # create a new version.
41
+ attr_reader :version
42
+ # @return [DateTime]
43
+ attr_reader :updated_at
44
+ # @return [String] The user ID of the user who last updated the patient.
45
+ attr_reader :updating_user_id
46
+ # @return [CandidApiClient::PreEncounter::Common::Types::HumanName]
47
+ attr_reader :name
48
+ # @return [Array<CandidApiClient::PreEncounter::Common::Types::HumanName>] Other names for the patient.
49
+ attr_reader :other_names
50
+ # @return [CandidApiClient::PreEncounter::Common::Types::Gender]
51
+ attr_reader :gender
52
+ # @return [Date]
53
+ attr_reader :birth_date
54
+ # @return [String]
55
+ attr_reader :social_security_number
56
+ # @return [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient.
57
+ attr_reader :biological_sex
58
+ # @return [CandidApiClient::PreEncounter::Common::Types::SexualOrientation] The sexual orientation of the patient.
59
+ attr_reader :sexual_orientation
60
+ # @return [CandidApiClient::PreEncounter::Common::Types::Race]
61
+ attr_reader :race
62
+ # @return [CandidApiClient::PreEncounter::Common::Types::Ethnicity]
63
+ attr_reader :ethnicity
64
+ # @return [CandidApiClient::PreEncounter::Common::Types::DisabilityStatus]
65
+ attr_reader :disability_status
66
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::MaritalStatus]
67
+ attr_reader :marital_status
68
+ # @return [DateTime] Time of death for the patient. Leave unset if the patient is not deceased.
69
+ attr_reader :deceased
70
+ # @return [Integer] The number of siblings the patient was born with. Leave unset if the patient was
71
+ # not part of a multiple birth.
72
+ attr_reader :multiple_birth
73
+ # @return [CandidApiClient::PreEncounter::Common::Types::Address] The primary address for the patient.
74
+ attr_reader :primary_address
75
+ # @return [Array<CandidApiClient::PreEncounter::Common::Types::Address>] Other addresses for the patient.
76
+ attr_reader :other_addresses
77
+ # @return [CandidApiClient::PreEncounter::Common::Types::ContactPoint] The primary phone number for the patient.
78
+ attr_reader :primary_telecom
79
+ # @return [Array<CandidApiClient::PreEncounter::Common::Types::ContactPoint>] Other phone numbers for the patient.
80
+ attr_reader :other_telecoms
81
+ # @return [String]
82
+ attr_reader :email
83
+ # @return [Boolean]
84
+ attr_reader :electronic_communication_opt_in
85
+ # @return [String]
86
+ attr_reader :photo
87
+ # @return [String]
88
+ attr_reader :language
89
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance] Information about the upstream system that owns this patient data. Leave unset
90
+ # if Candid owns patient data.
91
+ attr_reader :external_provenance
92
+ # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Types::Contact>] Contacts for the patient.
93
+ attr_reader :contacts
94
+ # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider>]
95
+ attr_reader :general_practitioners
96
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder]
97
+ attr_reader :filing_order
98
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
99
+ attr_reader :additional_properties
100
+ # @return [Object]
101
+ attr_reader :_field_set
102
+ protected :_field_set
103
+
104
+ OMIT = Object.new
105
+
106
+ # @param id [String] The unique UUID identifier for a Patient. Patient ID is used in machine
107
+ # contexts.
108
+ # @param mrn [String] The medical record number for the patient. Human-friendly Candid generated MRNs
109
+ # are of the form JCH + 8 alphanumeric characters. MRNs are not case-sensitive.
110
+ # @param organization_id [String] The organization that owns this patient.
111
+ # @param deactivated [Boolean] True if the patient is deactivated. Deactivated patients are not returned in
112
+ # search results but are returned in all other endpoints including scan.
113
+ # @param version [Integer] The version of the patient. Any update to any property of a patient object will
114
+ # create a new version.
115
+ # @param updated_at [DateTime]
116
+ # @param updating_user_id [String] The user ID of the user who last updated the patient.
117
+ # @param name [CandidApiClient::PreEncounter::Common::Types::HumanName]
118
+ # @param other_names [Array<CandidApiClient::PreEncounter::Common::Types::HumanName>] Other names for the patient.
119
+ # @param gender [CandidApiClient::PreEncounter::Common::Types::Gender]
120
+ # @param birth_date [Date]
121
+ # @param social_security_number [String]
122
+ # @param biological_sex [CandidApiClient::PreEncounter::Common::Types::Sex] The biological sex of the patient.
123
+ # @param sexual_orientation [CandidApiClient::PreEncounter::Common::Types::SexualOrientation] The sexual orientation of the patient.
124
+ # @param race [CandidApiClient::PreEncounter::Common::Types::Race]
125
+ # @param ethnicity [CandidApiClient::PreEncounter::Common::Types::Ethnicity]
126
+ # @param disability_status [CandidApiClient::PreEncounter::Common::Types::DisabilityStatus]
127
+ # @param marital_status [CandidApiClient::PreEncounter::Patients::V1::Types::MaritalStatus]
128
+ # @param deceased [DateTime] Time of death for the patient. Leave unset if the patient is not deceased.
129
+ # @param multiple_birth [Integer] The number of siblings the patient was born with. Leave unset if the patient was
130
+ # not part of a multiple birth.
131
+ # @param primary_address [CandidApiClient::PreEncounter::Common::Types::Address] The primary address for the patient.
132
+ # @param other_addresses [Array<CandidApiClient::PreEncounter::Common::Types::Address>] Other addresses for the patient.
133
+ # @param primary_telecom [CandidApiClient::PreEncounter::Common::Types::ContactPoint] The primary phone number for the patient.
134
+ # @param other_telecoms [Array<CandidApiClient::PreEncounter::Common::Types::ContactPoint>] Other phone numbers for the patient.
135
+ # @param email [String]
136
+ # @param electronic_communication_opt_in [Boolean]
137
+ # @param photo [String]
138
+ # @param language [String]
139
+ # @param external_provenance [CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance] Information about the upstream system that owns this patient data. Leave unset
140
+ # if Candid owns patient data.
141
+ # @param contacts [Array<CandidApiClient::PreEncounter::Patients::V1::Types::Contact>] Contacts for the patient.
142
+ # @param general_practitioners [Array<CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider>]
143
+ # @param filing_order [CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder]
144
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
145
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::Patient]
146
+ def initialize(id:, mrn:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, name:,
147
+ other_names:, gender:, birth_date:, primary_address:, other_addresses:, primary_telecom:, other_telecoms:, contacts:, general_practitioners:, filing_order:, social_security_number: OMIT, 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)
148
+ @id = id
149
+ @mrn = mrn
150
+ @organization_id = organization_id
151
+ @deactivated = deactivated
152
+ @version = version
153
+ @updated_at = updated_at
154
+ @updating_user_id = updating_user_id
155
+ @name = name
156
+ @other_names = other_names
157
+ @gender = gender
158
+ @birth_date = birth_date
159
+ @social_security_number = social_security_number if social_security_number != OMIT
160
+ @biological_sex = biological_sex if biological_sex != OMIT
161
+ @sexual_orientation = sexual_orientation if sexual_orientation != OMIT
162
+ @race = race if race != OMIT
163
+ @ethnicity = ethnicity if ethnicity != OMIT
164
+ @disability_status = disability_status if disability_status != OMIT
165
+ @marital_status = marital_status if marital_status != OMIT
166
+ @deceased = deceased if deceased != OMIT
167
+ @multiple_birth = multiple_birth if multiple_birth != OMIT
168
+ @primary_address = primary_address
169
+ @other_addresses = other_addresses
170
+ @primary_telecom = primary_telecom
171
+ @other_telecoms = other_telecoms
172
+ @email = email if email != OMIT
173
+ if electronic_communication_opt_in != OMIT
174
+ @electronic_communication_opt_in = electronic_communication_opt_in
175
+ end
176
+ @photo = photo if photo != OMIT
177
+ @language = language if language != OMIT
178
+ @external_provenance = external_provenance if external_provenance != OMIT
179
+ @contacts = contacts
180
+ @general_practitioners = general_practitioners
181
+ @filing_order = filing_order
182
+ @additional_properties = additional_properties
183
+ @_field_set = {
184
+ "id": id,
185
+ "mrn": mrn,
186
+ "organization_id": organization_id,
187
+ "deactivated": deactivated,
188
+ "version": version,
189
+ "updated_at": updated_at,
190
+ "updating_user_id": updating_user_id,
191
+ "name": name,
192
+ "other_names": other_names,
193
+ "gender": gender,
194
+ "birth_date": birth_date,
195
+ "social_security_number": social_security_number,
196
+ "biological_sex": biological_sex,
197
+ "sexual_orientation": sexual_orientation,
198
+ "race": race,
199
+ "ethnicity": ethnicity,
200
+ "disability_status": disability_status,
201
+ "marital_status": marital_status,
202
+ "deceased": deceased,
203
+ "multiple_birth": multiple_birth,
204
+ "primary_address": primary_address,
205
+ "other_addresses": other_addresses,
206
+ "primary_telecom": primary_telecom,
207
+ "other_telecoms": other_telecoms,
208
+ "email": email,
209
+ "electronic_communication_opt_in": electronic_communication_opt_in,
210
+ "photo": photo,
211
+ "language": language,
212
+ "external_provenance": external_provenance,
213
+ "contacts": contacts,
214
+ "general_practitioners": general_practitioners,
215
+ "filing_order": filing_order
216
+ }.reject do |_k, v|
217
+ v == OMIT
218
+ end
219
+ end
220
+
221
+ # Deserialize a JSON object to an instance of Patient
222
+ #
223
+ # @param json_object [String]
224
+ # @return [CandidApiClient::PreEncounter::Patients::V1::Types::Patient]
225
+ def self.from_json(json_object:)
226
+ struct = JSON.parse(json_object, object_class: OpenStruct)
227
+ parsed_json = JSON.parse(json_object)
228
+ id = struct["id"]
229
+ mrn = struct["mrn"]
230
+ organization_id = struct["organization_id"]
231
+ deactivated = struct["deactivated"]
232
+ version = struct["version"]
233
+ updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
234
+ updating_user_id = struct["updating_user_id"]
235
+ if parsed_json["name"].nil?
236
+ name = nil
237
+ else
238
+ name = parsed_json["name"].to_json
239
+ name = CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: name)
240
+ end
241
+ other_names = parsed_json["other_names"]&.map do |item|
242
+ item = item.to_json
243
+ CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: item)
244
+ end
245
+ gender = struct["gender"]
246
+ birth_date = (Date.parse(parsed_json["birth_date"]) unless parsed_json["birth_date"].nil?)
247
+ social_security_number = struct["social_security_number"]
248
+ biological_sex = struct["biological_sex"]
249
+ sexual_orientation = struct["sexual_orientation"]
250
+ race = struct["race"]
251
+ ethnicity = struct["ethnicity"]
252
+ disability_status = struct["disability_status"]
253
+ marital_status = struct["marital_status"]
254
+ deceased = (DateTime.parse(parsed_json["deceased"]) unless parsed_json["deceased"].nil?)
255
+ multiple_birth = struct["multiple_birth"]
256
+ if parsed_json["primary_address"].nil?
257
+ primary_address = nil
258
+ else
259
+ primary_address = parsed_json["primary_address"].to_json
260
+ primary_address = CandidApiClient::PreEncounter::Common::Types::Address.from_json(json_object: primary_address)
261
+ end
262
+ other_addresses = parsed_json["other_addresses"]&.map do |item|
263
+ item = item.to_json
264
+ CandidApiClient::PreEncounter::Common::Types::Address.from_json(json_object: item)
265
+ end
266
+ if parsed_json["primary_telecom"].nil?
267
+ primary_telecom = nil
268
+ else
269
+ primary_telecom = parsed_json["primary_telecom"].to_json
270
+ primary_telecom = CandidApiClient::PreEncounter::Common::Types::ContactPoint.from_json(json_object: primary_telecom)
271
+ end
272
+ other_telecoms = parsed_json["other_telecoms"]&.map do |item|
273
+ item = item.to_json
274
+ CandidApiClient::PreEncounter::Common::Types::ContactPoint.from_json(json_object: item)
275
+ end
276
+ email = struct["email"]
277
+ electronic_communication_opt_in = struct["electronic_communication_opt_in"]
278
+ photo = struct["photo"]
279
+ language = struct["language"]
280
+ if parsed_json["external_provenance"].nil?
281
+ external_provenance = nil
282
+ else
283
+ external_provenance = parsed_json["external_provenance"].to_json
284
+ external_provenance = CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance.from_json(json_object: external_provenance)
285
+ end
286
+ contacts = parsed_json["contacts"]&.map do |item|
287
+ item = item.to_json
288
+ CandidApiClient::PreEncounter::Patients::V1::Types::Contact.from_json(json_object: item)
289
+ end
290
+ general_practitioners = parsed_json["general_practitioners"]&.map do |item|
291
+ item = item.to_json
292
+ CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvider.from_json(json_object: item)
293
+ end
294
+ if parsed_json["filing_order"].nil?
295
+ filing_order = nil
296
+ else
297
+ filing_order = parsed_json["filing_order"].to_json
298
+ filing_order = CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder.from_json(json_object: filing_order)
299
+ end
300
+ new(
301
+ id: id,
302
+ mrn: mrn,
303
+ organization_id: organization_id,
304
+ deactivated: deactivated,
305
+ version: version,
306
+ updated_at: updated_at,
307
+ updating_user_id: updating_user_id,
308
+ name: name,
309
+ other_names: other_names,
310
+ gender: gender,
311
+ birth_date: birth_date,
312
+ social_security_number: social_security_number,
313
+ biological_sex: biological_sex,
314
+ sexual_orientation: sexual_orientation,
315
+ race: race,
316
+ ethnicity: ethnicity,
317
+ disability_status: disability_status,
318
+ marital_status: marital_status,
319
+ deceased: deceased,
320
+ multiple_birth: multiple_birth,
321
+ primary_address: primary_address,
322
+ other_addresses: other_addresses,
323
+ primary_telecom: primary_telecom,
324
+ other_telecoms: other_telecoms,
325
+ email: email,
326
+ electronic_communication_opt_in: electronic_communication_opt_in,
327
+ photo: photo,
328
+ language: language,
329
+ external_provenance: external_provenance,
330
+ contacts: contacts,
331
+ general_practitioners: general_practitioners,
332
+ filing_order: filing_order,
333
+ additional_properties: struct
334
+ )
335
+ end
336
+
337
+ # Serialize an instance of Patient to a JSON object
338
+ #
339
+ # @return [String]
340
+ def to_json(*_args)
341
+ @_field_set&.to_json
342
+ end
343
+
344
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
345
+ # hash and check each fields type against the current object's property
346
+ # definitions.
347
+ #
348
+ # @param obj [Object]
349
+ # @return [Void]
350
+ def self.validate_raw(obj:)
351
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
352
+ obj.mrn.is_a?(String) != false || raise("Passed value for field obj.mrn is not the expected type, validation failed.")
353
+ obj.organization_id.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
354
+ obj.deactivated.is_a?(Boolean) != false || raise("Passed value for field obj.deactivated is not the expected type, validation failed.")
355
+ obj.version.is_a?(Integer) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
356
+ obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
357
+ obj.updating_user_id.is_a?(String) != false || raise("Passed value for field obj.updating_user_id is not the expected type, validation failed.")
358
+ CandidApiClient::PreEncounter::Common::Types::HumanName.validate_raw(obj: obj.name)
359
+ obj.other_names.is_a?(Array) != false || raise("Passed value for field obj.other_names is not the expected type, validation failed.")
360
+ obj.gender.is_a?(CandidApiClient::PreEncounter::Common::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
361
+ obj.birth_date.is_a?(Date) != false || raise("Passed value for field obj.birth_date is not the expected type, validation failed.")
362
+ obj.social_security_number&.is_a?(String) != false || raise("Passed value for field obj.social_security_number is not the expected type, validation failed.")
363
+ 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.")
364
+ 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.")
365
+ obj.race&.is_a?(CandidApiClient::PreEncounter::Common::Types::Race) != false || raise("Passed value for field obj.race is not the expected type, validation failed.")
366
+ obj.ethnicity&.is_a?(CandidApiClient::PreEncounter::Common::Types::Ethnicity) != false || raise("Passed value for field obj.ethnicity is not the expected type, validation failed.")
367
+ 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.")
368
+ 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.")
369
+ obj.deceased&.is_a?(DateTime) != false || raise("Passed value for field obj.deceased is not the expected type, validation failed.")
370
+ obj.multiple_birth&.is_a?(Integer) != false || raise("Passed value for field obj.multiple_birth is not the expected type, validation failed.")
371
+ CandidApiClient::PreEncounter::Common::Types::Address.validate_raw(obj: obj.primary_address)
372
+ obj.other_addresses.is_a?(Array) != false || raise("Passed value for field obj.other_addresses is not the expected type, validation failed.")
373
+ CandidApiClient::PreEncounter::Common::Types::ContactPoint.validate_raw(obj: obj.primary_telecom)
374
+ obj.other_telecoms.is_a?(Array) != false || raise("Passed value for field obj.other_telecoms is not the expected type, validation failed.")
375
+ obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
376
+ 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.")
377
+ obj.photo&.is_a?(String) != false || raise("Passed value for field obj.photo is not the expected type, validation failed.")
378
+ obj.language&.is_a?(String) != false || raise("Passed value for field obj.language is not the expected type, validation failed.")
379
+ obj.external_provenance.nil? || CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance.validate_raw(obj: obj.external_provenance)
380
+ obj.contacts.is_a?(Array) != false || raise("Passed value for field obj.contacts is not the expected type, validation failed.")
381
+ obj.general_practitioners.is_a?(Array) != false || raise("Passed value for field obj.general_practitioners is not the expected type, validation failed.")
382
+ CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder.validate_raw(obj: obj.filing_order)
383
+ end
384
+ end
385
+ end
386
+ end
387
+ end
388
+ end
389
+ end
data/lib/candidhealth.rb CHANGED
@@ -7,6 +7,7 @@ require_relative "requests"
7
7
  require_relative "candidhealth/auth/client"
8
8
  require_relative "candidhealth/billing_notes/client"
9
9
  require_relative "candidhealth/contracts/client"
10
+ require_relative "candidhealth/custom_schemas/client"
10
11
  require_relative "candidhealth/eligibility/client"
11
12
  require_relative "candidhealth/encounters/client"
12
13
  require_relative "candidhealth/expected_network_status/client"
@@ -25,8 +26,8 @@ require_relative "candidhealth/patient_refunds/client"
25
26
  require_relative "candidhealth/payers/client"
26
27
  require_relative "candidhealth/tasks/client"
27
28
  require_relative "candidhealth/write_offs/client"
28
- require_relative "candidhealth/service_facility/client"
29
29
  require_relative "candidhealth/pre_encounter/client"
30
+ require_relative "candidhealth/service_facility/client"
30
31
 
31
32
  module CandidApiClient
32
33
  class Client
@@ -36,6 +37,8 @@ module CandidApiClient
36
37
  attr_reader :billing_notes
37
38
  # @return [CandidApiClient::Contracts::Client]
38
39
  attr_reader :contracts
40
+ # @return [CandidApiClient::CustomSchemas::Client]
41
+ attr_reader :custom_schemas
39
42
  # @return [CandidApiClient::Eligibility::Client]
40
43
  attr_reader :eligibility
41
44
  # @return [CandidApiClient::Encounters::Client]
@@ -72,10 +75,10 @@ module CandidApiClient
72
75
  attr_reader :tasks
73
76
  # @return [CandidApiClient::WriteOffs::Client]
74
77
  attr_reader :write_offs
75
- # @return [CandidApiClient::ServiceFacilityClient]
76
- attr_reader :service_facility
77
78
  # @return [CandidApiClient::PreEncounter::Client]
78
79
  attr_reader :pre_encounter
80
+ # @return [CandidApiClient::ServiceFacilityClient]
81
+ attr_reader :service_facility
79
82
 
80
83
  # @param base_url [String]
81
84
  # @param environment [CandidApiClient::Environment]
@@ -106,6 +109,7 @@ module CandidApiClient
106
109
  @auth = CandidApiClient::Auth::Client.new(request_client: @request_client)
107
110
  @billing_notes = CandidApiClient::BillingNotes::Client.new(request_client: @request_client)
108
111
  @contracts = CandidApiClient::Contracts::Client.new(request_client: @request_client)
112
+ @custom_schemas = CandidApiClient::CustomSchemas::Client.new(request_client: @request_client)
109
113
  @eligibility = CandidApiClient::Eligibility::Client.new(request_client: @request_client)
110
114
  @encounters = CandidApiClient::Encounters::Client.new(request_client: @request_client)
111
115
  @expected_network_status = CandidApiClient::ExpectedNetworkStatus::Client.new(request_client: @request_client)
@@ -124,8 +128,8 @@ module CandidApiClient
124
128
  @payers = CandidApiClient::Payers::Client.new(request_client: @request_client)
125
129
  @tasks = CandidApiClient::Tasks::Client.new(request_client: @request_client)
126
130
  @write_offs = CandidApiClient::WriteOffs::Client.new(request_client: @request_client)
127
- @service_facility = CandidApiClient::ServiceFacilityClient.new(request_client: @request_client)
128
131
  @pre_encounter = CandidApiClient::PreEncounter::Client.new(request_client: @request_client)
132
+ @service_facility = CandidApiClient::ServiceFacilityClient.new(request_client: @request_client)
129
133
  end
130
134
  end
131
135
 
@@ -136,6 +140,8 @@ module CandidApiClient
136
140
  attr_reader :billing_notes
137
141
  # @return [CandidApiClient::Contracts::AsyncClient]
138
142
  attr_reader :contracts
143
+ # @return [CandidApiClient::CustomSchemas::AsyncClient]
144
+ attr_reader :custom_schemas
139
145
  # @return [CandidApiClient::Eligibility::AsyncClient]
140
146
  attr_reader :eligibility
141
147
  # @return [CandidApiClient::Encounters::AsyncClient]
@@ -172,10 +178,10 @@ module CandidApiClient
172
178
  attr_reader :tasks
173
179
  # @return [CandidApiClient::WriteOffs::AsyncClient]
174
180
  attr_reader :write_offs
175
- # @return [CandidApiClient::AsyncServiceFacilityClient]
176
- attr_reader :service_facility
177
181
  # @return [CandidApiClient::PreEncounter::AsyncClient]
178
182
  attr_reader :pre_encounter
183
+ # @return [CandidApiClient::AsyncServiceFacilityClient]
184
+ attr_reader :service_facility
179
185
 
180
186
  # @param base_url [String]
181
187
  # @param environment [CandidApiClient::Environment]
@@ -206,6 +212,7 @@ module CandidApiClient
206
212
  @auth = CandidApiClient::Auth::AsyncClient.new(request_client: @async_request_client)
207
213
  @billing_notes = CandidApiClient::BillingNotes::AsyncClient.new(request_client: @async_request_client)
208
214
  @contracts = CandidApiClient::Contracts::AsyncClient.new(request_client: @async_request_client)
215
+ @custom_schemas = CandidApiClient::CustomSchemas::AsyncClient.new(request_client: @async_request_client)
209
216
  @eligibility = CandidApiClient::Eligibility::AsyncClient.new(request_client: @async_request_client)
210
217
  @encounters = CandidApiClient::Encounters::AsyncClient.new(request_client: @async_request_client)
211
218
  @expected_network_status = CandidApiClient::ExpectedNetworkStatus::AsyncClient.new(request_client: @async_request_client)
@@ -224,8 +231,8 @@ module CandidApiClient
224
231
  @payers = CandidApiClient::Payers::AsyncClient.new(request_client: @async_request_client)
225
232
  @tasks = CandidApiClient::Tasks::AsyncClient.new(request_client: @async_request_client)
226
233
  @write_offs = CandidApiClient::WriteOffs::AsyncClient.new(request_client: @async_request_client)
227
- @service_facility = CandidApiClient::AsyncServiceFacilityClient.new(request_client: @async_request_client)
228
234
  @pre_encounter = CandidApiClient::PreEncounter::AsyncClient.new(request_client: @async_request_client)
235
+ @service_facility = CandidApiClient::AsyncServiceFacilityClient.new(request_client: @async_request_client)
229
236
  end
230
237
  end
231
238
  end
data/lib/requests.rb CHANGED
@@ -43,7 +43,7 @@ module CandidApiClient
43
43
 
44
44
  # @return [Hash{String => String}]
45
45
  def get_headers
46
- headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.24.2" }
46
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.24.4" }
47
47
  headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless token.nil?
48
48
  headers
49
49
  end
@@ -87,7 +87,7 @@ module CandidApiClient
87
87
 
88
88
  # @return [Hash{String => String}]
89
89
  def get_headers
90
- headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.24.2" }
90
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "candidhealth", "X-Fern-SDK-Version": "0.24.4" }
91
91
  headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless token.nil?
92
92
  headers
93
93
  end
data/lib/types_export.rb CHANGED
@@ -18,6 +18,14 @@ require_relative "candidhealth/contracts/v_2/types/contract_with_providers"
18
18
  require_relative "candidhealth/contracts/v_2/types/contracts_page"
19
19
  require_relative "candidhealth/contracts/v_2/types/contract_status"
20
20
  require_relative "candidhealth/contracts/v_2/types/authorized_signatory"
21
+ require_relative "candidhealth/custom_schemas/v_1/types/schema"
22
+ require_relative "candidhealth/custom_schemas/v_1/types/schema_instance"
23
+ require_relative "candidhealth/custom_schemas/v_1/types/schema_field"
24
+ require_relative "candidhealth/custom_schemas/v_1/types/schema_get_multi_response"
25
+ require_relative "candidhealth/custom_schemas/v_1/types/schema_with_name_already_exists_error"
26
+ require_relative "candidhealth/custom_schemas/v_1/types/key_with_name_already_exists_error"
27
+ require_relative "candidhealth/custom_schemas/v_1/types/schema_validation_failure"
28
+ require_relative "candidhealth/custom_schemas/v_1/types/schema_validation_error"
21
29
  require_relative "candidhealth/encounter_providers/v_2/types/encounter_provider_base"
22
30
  require_relative "candidhealth/encounter_providers/v_2/types/rendering_provider"
23
31
  require_relative "candidhealth/encounter_providers/v_2/types/referring_provider"
@@ -56,6 +64,13 @@ require_relative "candidhealth/encounters/v_4/types/encounter_patient_control_nu
56
64
  require_relative "candidhealth/encounters/v_4/types/encounter_guarantor_missing_contact_info_error_type"
57
65
  require_relative "candidhealth/encounters/v_4/types/cash_pay_payer_error_message"
58
66
  require_relative "candidhealth/encounters/v_4/types/service_authorization_exception_code"
67
+ require_relative "candidhealth/encounters/v_4/types/schema_instance_validation_failure"
68
+ require_relative "candidhealth/encounters/v_4/types/key_does_not_exist_error"
69
+ require_relative "candidhealth/encounters/v_4/types/schema_does_not_exist_error"
70
+ require_relative "candidhealth/encounters/v_4/types/schema_unauthorized_access_error"
71
+ require_relative "candidhealth/encounters/v_4/types/value_does_not_match_key_type_error"
72
+ require_relative "candidhealth/encounters/v_4/types/multiple_instances_for_schema_error"
73
+ require_relative "candidhealth/encounters/v_4/types/schema_instance_validation_error"
59
74
  require_relative "candidhealth/expected_network_status/v_1/types/expected_network_status"
60
75
  require_relative "candidhealth/expected_network_status/v_1/types/expected_network_status_response"
61
76
  require_relative "candidhealth/expected_network_status/v_2/types/line_of_business"
@@ -219,8 +234,22 @@ require_relative "candidhealth/x_12/v_1/types/claim_adjustment_reason_code"
219
234
  require_relative "candidhealth/x_12/v_1/types/remittance_advice_remark_code"
220
235
  require_relative "candidhealth/x_12/v_1/types/carc"
221
236
  require_relative "candidhealth/x_12/v_1/types/rarc"
237
+ require_relative "candidhealth/pre_encounter/coverages/v_1/types/subscriber"
238
+ require_relative "candidhealth/pre_encounter/coverages/v_1/types/coverage_status"
239
+ require_relative "candidhealth/pre_encounter/coverages/v_1/types/network_type"
240
+ require_relative "candidhealth/pre_encounter/coverages/v_1/types/insurance_plan"
241
+ require_relative "candidhealth/pre_encounter/coverages/v_1/types/mutable_coverage"
242
+ require_relative "candidhealth/pre_encounter/coverages/v_1/types/coverage"
243
+ require_relative "candidhealth/pre_encounter/patients/v_1/types/marital_status"
244
+ require_relative "candidhealth/pre_encounter/patients/v_1/types/external_provenance"
245
+ require_relative "candidhealth/pre_encounter/patients/v_1/types/contact"
246
+ require_relative "candidhealth/pre_encounter/patients/v_1/types/external_provider"
247
+ require_relative "candidhealth/pre_encounter/patients/v_1/types/filing_order"
248
+ require_relative "candidhealth/pre_encounter/patients/v_1/types/mutable_patient"
249
+ require_relative "candidhealth/pre_encounter/patients/v_1/types/patient"
222
250
  require_relative "candidhealth/claims/types/claim"
223
251
  require_relative "candidhealth/claims/types/claim_status"
252
+ require_relative "candidhealth/commons/types/primitive"
224
253
  require_relative "candidhealth/commons/types/sort_direction"
225
254
  require_relative "candidhealth/commons/types/qualifier_code"
226
255
  require_relative "candidhealth/commons/types/date_range_optional_end"
@@ -306,6 +335,11 @@ require_relative "candidhealth/tasks/commons/types/task_type"
306
335
  require_relative "candidhealth/tasks/commons/types/task_category"
307
336
  require_relative "candidhealth/pre_encounter/common/types/relationship"
308
337
  require_relative "candidhealth/pre_encounter/common/types/gender"
338
+ require_relative "candidhealth/pre_encounter/common/types/sex"
339
+ require_relative "candidhealth/pre_encounter/common/types/sexual_orientation"
340
+ require_relative "candidhealth/pre_encounter/common/types/race"
341
+ require_relative "candidhealth/pre_encounter/common/types/ethnicity"
342
+ require_relative "candidhealth/pre_encounter/common/types/disability_status"
309
343
  require_relative "candidhealth/pre_encounter/common/types/name_use"
310
344
  require_relative "candidhealth/pre_encounter/common/types/human_name"
311
345
  require_relative "candidhealth/pre_encounter/common/types/address_use"
@@ -316,15 +350,3 @@ require_relative "candidhealth/pre_encounter/common/types/contact_point"
316
350
  require_relative "candidhealth/pre_encounter/common/types/error_base"
317
351
  require_relative "candidhealth/pre_encounter/common/types/not_found_error_body"
318
352
  require_relative "candidhealth/pre_encounter/common/types/version_conflict_error_body"
319
- require_relative "candidhealth/pre_encounter/coverages/v_1/coverages/types/subscriber"
320
- require_relative "candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_status"
321
- require_relative "candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage_type"
322
- require_relative "candidhealth/pre_encounter/coverages/v_1/coverages/types/insurance_plan"
323
- require_relative "candidhealth/pre_encounter/coverages/v_1/coverages/types/mutable_coverage"
324
- require_relative "candidhealth/pre_encounter/coverages/v_1/coverages/types/coverage"
325
- require_relative "candidhealth/pre_encounter/patients/v_1/patients/types/marital_status"
326
- require_relative "candidhealth/pre_encounter/patients/v_1/patients/types/external_provenance"
327
- require_relative "candidhealth/pre_encounter/patients/v_1/patients/types/contact"
328
- require_relative "candidhealth/pre_encounter/patients/v_1/patients/types/external_provider"
329
- require_relative "candidhealth/pre_encounter/patients/v_1/patients/types/mutable_patient"
330
- require_relative "candidhealth/pre_encounter/patients/v_1/patients/types/patient"