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
@@ -1,294 +0,0 @@
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 "marital_status"
7
- require_relative "../../../../common/types/address"
8
- require_relative "../../../../common/types/contact_point"
9
- require_relative "external_provenance"
10
- require_relative "contact"
11
- require_relative "external_provider"
12
- require "ostruct"
13
- require "json"
14
-
15
- module CandidApiClient
16
- module PreEncounter
17
- module Patients
18
- module V1
19
- module Patients
20
- module Types
21
- # A patient object with immutable server-owned properties.
22
- class Patient
23
- # @return [String]
24
- attr_reader :id
25
- # @return [String] The organization that owns this patient.
26
- attr_reader :organization_id
27
- # @return [Boolean] True if the patient is deactivated. Deactivated patients are not returned in
28
- # search results but are returned in all other endpoints including scan.
29
- attr_reader :deactivated
30
- # @return [Integer] The version of the patient. Any update to any property of a patient object will
31
- # create a new version.
32
- attr_reader :version
33
- # @return [DateTime]
34
- attr_reader :updated_at
35
- # @return [String] The user ID of the user who last updated the patient.
36
- attr_reader :updating_user_id
37
- # @return [CandidApiClient::PreEncounter::Common::Types::HumanName]
38
- attr_reader :name
39
- # @return [Array<CandidApiClient::PreEncounter::Common::Types::HumanName>] Other names for the patient.
40
- attr_reader :other_names
41
- # @return [CandidApiClient::PreEncounter::Common::Types::Gender]
42
- attr_reader :gender
43
- # @return [Date]
44
- attr_reader :birth_date
45
- # @return [CandidApiClient::PreEncounter::Patients::V1::Patients::Types::MaritalStatus]
46
- attr_reader :marital_status
47
- # @return [DateTime] Time of death for the patient. Leave unset if the patient is not deceased.
48
- attr_reader :deceased
49
- # @return [Integer] The number of siblings the patient was born with. Leave unset if the patient was
50
- # not part of a multiple birth.
51
- attr_reader :multiple_birth
52
- # @return [CandidApiClient::PreEncounter::Common::Types::Address] The primary address for the patient.
53
- attr_reader :primary_address
54
- # @return [Array<CandidApiClient::PreEncounter::Common::Types::Address>] Other addresses for the patient.
55
- attr_reader :other_addresses
56
- # @return [CandidApiClient::PreEncounter::Common::Types::ContactPoint] The primary phone number for the patient.
57
- attr_reader :primary_telecom
58
- # @return [Array<CandidApiClient::PreEncounter::Common::Types::ContactPoint>] Other phone numbers for the patient.
59
- attr_reader :other_telecoms
60
- # @return [String]
61
- attr_reader :photo
62
- # @return [String]
63
- attr_reader :language
64
- # @return [CandidApiClient::PreEncounter::Patients::V1::Patients::Types::ExternalProvenance] Information about the upstream system that owns this patient data. Leave unset
65
- # if Candid owns patient data.
66
- attr_reader :external_provenance
67
- # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Patients::Types::Contact>] Contacts for the patient.
68
- attr_reader :contacts
69
- # @return [Array<CandidApiClient::PreEncounter::Patients::V1::Patients::Types::ExternalProvider>]
70
- attr_reader :general_practitioners
71
- # @return [OpenStruct] Additional properties unmapped to the current class definition
72
- attr_reader :additional_properties
73
- # @return [Object]
74
- attr_reader :_field_set
75
- protected :_field_set
76
-
77
- OMIT = Object.new
78
-
79
- # @param id [String]
80
- # @param organization_id [String] The organization that owns this patient.
81
- # @param deactivated [Boolean] True if the patient is deactivated. Deactivated patients are not returned in
82
- # search results but are returned in all other endpoints including scan.
83
- # @param version [Integer] The version of the patient. Any update to any property of a patient object will
84
- # create a new version.
85
- # @param updated_at [DateTime]
86
- # @param updating_user_id [String] The user ID of the user who last updated the patient.
87
- # @param name [CandidApiClient::PreEncounter::Common::Types::HumanName]
88
- # @param other_names [Array<CandidApiClient::PreEncounter::Common::Types::HumanName>] Other names for the patient.
89
- # @param gender [CandidApiClient::PreEncounter::Common::Types::Gender]
90
- # @param birth_date [Date]
91
- # @param marital_status [CandidApiClient::PreEncounter::Patients::V1::Patients::Types::MaritalStatus]
92
- # @param deceased [DateTime] Time of death for the patient. Leave unset if the patient is not deceased.
93
- # @param multiple_birth [Integer] The number of siblings the patient was born with. Leave unset if the patient was
94
- # not part of a multiple birth.
95
- # @param primary_address [CandidApiClient::PreEncounter::Common::Types::Address] The primary address for the patient.
96
- # @param other_addresses [Array<CandidApiClient::PreEncounter::Common::Types::Address>] Other addresses for the patient.
97
- # @param primary_telecom [CandidApiClient::PreEncounter::Common::Types::ContactPoint] The primary phone number for the patient.
98
- # @param other_telecoms [Array<CandidApiClient::PreEncounter::Common::Types::ContactPoint>] Other phone numbers for the patient.
99
- # @param photo [String]
100
- # @param language [String]
101
- # @param external_provenance [CandidApiClient::PreEncounter::Patients::V1::Patients::Types::ExternalProvenance] Information about the upstream system that owns this patient data. Leave unset
102
- # if Candid owns patient data.
103
- # @param contacts [Array<CandidApiClient::PreEncounter::Patients::V1::Patients::Types::Contact>] Contacts for the patient.
104
- # @param general_practitioners [Array<CandidApiClient::PreEncounter::Patients::V1::Patients::Types::ExternalProvider>]
105
- # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
106
- # @return [CandidApiClient::PreEncounter::Patients::V1::Patients::Types::Patient]
107
- def initialize(id:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, name:,
108
- other_names:, gender:, birth_date:, primary_address:, other_addresses:, primary_telecom:, other_telecoms:, contacts:, general_practitioners:, marital_status: OMIT, deceased: OMIT, multiple_birth: OMIT, photo: OMIT, language: OMIT, external_provenance: OMIT, additional_properties: nil)
109
- @id = id
110
- @organization_id = organization_id
111
- @deactivated = deactivated
112
- @version = version
113
- @updated_at = updated_at
114
- @updating_user_id = updating_user_id
115
- @name = name
116
- @other_names = other_names
117
- @gender = gender
118
- @birth_date = birth_date
119
- @marital_status = marital_status if marital_status != OMIT
120
- @deceased = deceased if deceased != OMIT
121
- @multiple_birth = multiple_birth if multiple_birth != OMIT
122
- @primary_address = primary_address
123
- @other_addresses = other_addresses
124
- @primary_telecom = primary_telecom
125
- @other_telecoms = other_telecoms
126
- @photo = photo if photo != OMIT
127
- @language = language if language != OMIT
128
- @external_provenance = external_provenance if external_provenance != OMIT
129
- @contacts = contacts
130
- @general_practitioners = general_practitioners
131
- @additional_properties = additional_properties
132
- @_field_set = {
133
- "id": id,
134
- "organization_id": organization_id,
135
- "deactivated": deactivated,
136
- "version": version,
137
- "updated_at": updated_at,
138
- "updating_user_id": updating_user_id,
139
- "name": name,
140
- "other_names": other_names,
141
- "gender": gender,
142
- "birth_date": birth_date,
143
- "marital_status": marital_status,
144
- "deceased": deceased,
145
- "multiple_birth": multiple_birth,
146
- "primary_address": primary_address,
147
- "other_addresses": other_addresses,
148
- "primary_telecom": primary_telecom,
149
- "other_telecoms": other_telecoms,
150
- "photo": photo,
151
- "language": language,
152
- "external_provenance": external_provenance,
153
- "contacts": contacts,
154
- "general_practitioners": general_practitioners
155
- }.reject do |_k, v|
156
- v == OMIT
157
- end
158
- end
159
-
160
- # Deserialize a JSON object to an instance of Patient
161
- #
162
- # @param json_object [String]
163
- # @return [CandidApiClient::PreEncounter::Patients::V1::Patients::Types::Patient]
164
- def self.from_json(json_object:)
165
- struct = JSON.parse(json_object, object_class: OpenStruct)
166
- parsed_json = JSON.parse(json_object)
167
- id = struct["id"]
168
- organization_id = struct["organization_id"]
169
- deactivated = struct["deactivated"]
170
- version = struct["version"]
171
- updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
172
- updating_user_id = struct["updating_user_id"]
173
- if parsed_json["name"].nil?
174
- name = nil
175
- else
176
- name = parsed_json["name"].to_json
177
- name = CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: name)
178
- end
179
- other_names = parsed_json["other_names"]&.map do |item|
180
- item = item.to_json
181
- CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: item)
182
- end
183
- gender = struct["gender"]
184
- birth_date = (Date.parse(parsed_json["birth_date"]) unless parsed_json["birth_date"].nil?)
185
- marital_status = struct["marital_status"]
186
- deceased = (DateTime.parse(parsed_json["deceased"]) unless parsed_json["deceased"].nil?)
187
- multiple_birth = struct["multiple_birth"]
188
- if parsed_json["primary_address"].nil?
189
- primary_address = nil
190
- else
191
- primary_address = parsed_json["primary_address"].to_json
192
- primary_address = CandidApiClient::PreEncounter::Common::Types::Address.from_json(json_object: primary_address)
193
- end
194
- other_addresses = parsed_json["other_addresses"]&.map do |item|
195
- item = item.to_json
196
- CandidApiClient::PreEncounter::Common::Types::Address.from_json(json_object: item)
197
- end
198
- if parsed_json["primary_telecom"].nil?
199
- primary_telecom = nil
200
- else
201
- primary_telecom = parsed_json["primary_telecom"].to_json
202
- primary_telecom = CandidApiClient::PreEncounter::Common::Types::ContactPoint.from_json(json_object: primary_telecom)
203
- end
204
- other_telecoms = parsed_json["other_telecoms"]&.map do |item|
205
- item = item.to_json
206
- CandidApiClient::PreEncounter::Common::Types::ContactPoint.from_json(json_object: item)
207
- end
208
- photo = struct["photo"]
209
- language = struct["language"]
210
- if parsed_json["external_provenance"].nil?
211
- external_provenance = nil
212
- else
213
- external_provenance = parsed_json["external_provenance"].to_json
214
- external_provenance = CandidApiClient::PreEncounter::Patients::V1::Patients::Types::ExternalProvenance.from_json(json_object: external_provenance)
215
- end
216
- contacts = parsed_json["contacts"]&.map do |item|
217
- item = item.to_json
218
- CandidApiClient::PreEncounter::Patients::V1::Patients::Types::Contact.from_json(json_object: item)
219
- end
220
- general_practitioners = parsed_json["general_practitioners"]&.map do |item|
221
- item = item.to_json
222
- CandidApiClient::PreEncounter::Patients::V1::Patients::Types::ExternalProvider.from_json(json_object: item)
223
- end
224
- new(
225
- id: id,
226
- organization_id: organization_id,
227
- deactivated: deactivated,
228
- version: version,
229
- updated_at: updated_at,
230
- updating_user_id: updating_user_id,
231
- name: name,
232
- other_names: other_names,
233
- gender: gender,
234
- birth_date: birth_date,
235
- marital_status: marital_status,
236
- deceased: deceased,
237
- multiple_birth: multiple_birth,
238
- primary_address: primary_address,
239
- other_addresses: other_addresses,
240
- primary_telecom: primary_telecom,
241
- other_telecoms: other_telecoms,
242
- photo: photo,
243
- language: language,
244
- external_provenance: external_provenance,
245
- contacts: contacts,
246
- general_practitioners: general_practitioners,
247
- additional_properties: struct
248
- )
249
- end
250
-
251
- # Serialize an instance of Patient to a JSON object
252
- #
253
- # @return [String]
254
- def to_json(*_args)
255
- @_field_set&.to_json
256
- end
257
-
258
- # Leveraged for Union-type generation, validate_raw attempts to parse the given
259
- # hash and check each fields type against the current object's property
260
- # definitions.
261
- #
262
- # @param obj [Object]
263
- # @return [Void]
264
- def self.validate_raw(obj:)
265
- obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
266
- obj.organization_id.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
267
- obj.deactivated.is_a?(Boolean) != false || raise("Passed value for field obj.deactivated is not the expected type, validation failed.")
268
- obj.version.is_a?(Integer) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
269
- obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
270
- obj.updating_user_id.is_a?(String) != false || raise("Passed value for field obj.updating_user_id is not the expected type, validation failed.")
271
- CandidApiClient::PreEncounter::Common::Types::HumanName.validate_raw(obj: obj.name)
272
- obj.other_names.is_a?(Array) != false || raise("Passed value for field obj.other_names is not the expected type, validation failed.")
273
- obj.gender.is_a?(CandidApiClient::PreEncounter::Common::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
274
- obj.birth_date.is_a?(Date) != false || raise("Passed value for field obj.birth_date is not the expected type, validation failed.")
275
- obj.marital_status&.is_a?(CandidApiClient::PreEncounter::Patients::V1::Patients::Types::MaritalStatus) != false || raise("Passed value for field obj.marital_status is not the expected type, validation failed.")
276
- obj.deceased&.is_a?(DateTime) != false || raise("Passed value for field obj.deceased is not the expected type, validation failed.")
277
- obj.multiple_birth&.is_a?(Integer) != false || raise("Passed value for field obj.multiple_birth is not the expected type, validation failed.")
278
- CandidApiClient::PreEncounter::Common::Types::Address.validate_raw(obj: obj.primary_address)
279
- obj.other_addresses.is_a?(Array) != false || raise("Passed value for field obj.other_addresses is not the expected type, validation failed.")
280
- CandidApiClient::PreEncounter::Common::Types::ContactPoint.validate_raw(obj: obj.primary_telecom)
281
- obj.other_telecoms.is_a?(Array) != false || raise("Passed value for field obj.other_telecoms is not the expected type, validation failed.")
282
- obj.photo&.is_a?(String) != false || raise("Passed value for field obj.photo is not the expected type, validation failed.")
283
- obj.language&.is_a?(String) != false || raise("Passed value for field obj.language is not the expected type, validation failed.")
284
- obj.external_provenance.nil? || CandidApiClient::PreEncounter::Patients::V1::Patients::Types::ExternalProvenance.validate_raw(obj: obj.external_provenance)
285
- obj.contacts.is_a?(Array) != false || raise("Passed value for field obj.contacts is not the expected type, validation failed.")
286
- obj.general_practitioners.is_a?(Array) != false || raise("Passed value for field obj.general_practitioners is not the expected type, validation failed.")
287
- end
288
- end
289
- end
290
- end
291
- end
292
- end
293
- end
294
- end