Class: CandidApiClient::PreEncounter::Patients::V1::Types::Patient

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb

Overview

A patient object with immutable server-owned properties.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, mrn:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, name:, other_names:, birth_date:, biological_sex:, primary_address:, other_addresses:, primary_telecom:, other_telecoms:, contacts:, general_practitioners:, filing_order:, gender: OMIT, social_security_number: 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, non_insurance_payers: OMIT, non_insurance_payer_associations: OMIT, guarantor: OMIT, self_pay: OMIT, authorizations: OMIT, referrals: OMIT, primary_service_facility_id: OMIT, do_not_invoice_reason: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Patients::V1::Types::Patient

Parameters:



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 181

def initialize(id:, mrn:, organization_id:, deactivated:, version:, updated_at:, updating_user_id:, name:,
               other_names:, birth_date:, biological_sex:, primary_address:, other_addresses:, primary_telecom:, other_telecoms:, contacts:, general_practitioners:, filing_order:, gender: OMIT, social_security_number: 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, non_insurance_payers: OMIT, non_insurance_payer_associations: OMIT, guarantor: OMIT, self_pay: OMIT, authorizations: OMIT, referrals: OMIT, primary_service_facility_id: OMIT, do_not_invoice_reason: OMIT, additional_properties: nil)
  @id = id
  @mrn = mrn
  @organization_id = organization_id
  @deactivated = deactivated
  @version = version
  @updated_at = updated_at
  @updating_user_id = updating_user_id
  @name = name
  @other_names = other_names
  @gender = gender if gender != OMIT
  @birth_date = birth_date
  @social_security_number = social_security_number if social_security_number != OMIT
  @biological_sex = biological_sex
  @sexual_orientation = sexual_orientation if sexual_orientation != OMIT
  @race = race if race != OMIT
  @ethnicity = ethnicity if ethnicity != OMIT
  @disability_status = disability_status if disability_status != OMIT
  @marital_status = marital_status if marital_status != OMIT
  @deceased = deceased if deceased != OMIT
  @multiple_birth = multiple_birth if multiple_birth != OMIT
  @primary_address = primary_address
  @other_addresses = other_addresses
  @primary_telecom = primary_telecom
  @other_telecoms = other_telecoms
  @email = email if email != OMIT
  if electronic_communication_opt_in != OMIT
    @electronic_communication_opt_in = electronic_communication_opt_in
  end
  @photo = photo if photo != OMIT
  @language = language if language != OMIT
  @external_provenance = external_provenance if external_provenance != OMIT
  @contacts = contacts
  @general_practitioners = general_practitioners
  @filing_order = filing_order
  @non_insurance_payers = non_insurance_payers if non_insurance_payers != OMIT
  if non_insurance_payer_associations != OMIT
    @non_insurance_payer_associations = non_insurance_payer_associations
  end
  @guarantor = guarantor if guarantor != OMIT
  @self_pay = self_pay if self_pay != OMIT
  @authorizations = authorizations if authorizations != OMIT
  @referrals = referrals if referrals != OMIT
  @primary_service_facility_id = primary_service_facility_id if primary_service_facility_id != OMIT
  @do_not_invoice_reason = do_not_invoice_reason if do_not_invoice_reason != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "mrn": mrn,
    "organization_id": organization_id,
    "deactivated": deactivated,
    "version": version,
    "updated_at": updated_at,
    "updating_user_id": updating_user_id,
    "name": name,
    "other_names": other_names,
    "gender": gender,
    "birth_date": birth_date,
    "social_security_number": social_security_number,
    "biological_sex": biological_sex,
    "sexual_orientation": sexual_orientation,
    "race": race,
    "ethnicity": ethnicity,
    "disability_status": disability_status,
    "marital_status": marital_status,
    "deceased": deceased,
    "multiple_birth": multiple_birth,
    "primary_address": primary_address,
    "other_addresses": other_addresses,
    "primary_telecom": primary_telecom,
    "other_telecoms": other_telecoms,
    "email": email,
    "electronic_communication_opt_in": electronic_communication_opt_in,
    "photo": photo,
    "language": language,
    "external_provenance": external_provenance,
    "contacts": contacts,
    "general_practitioners": general_practitioners,
    "filing_order": filing_order,
    "non_insurance_payers": non_insurance_payers,
    "non_insurance_payer_associations": non_insurance_payer_associations,
    "guarantor": guarantor,
    "self_pay": self_pay,
    "authorizations": authorizations,
    "referrals": referrals,
    "primary_service_facility_id": primary_service_facility_id,
    "do_not_invoice_reason": do_not_invoice_reason
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



123
124
125
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 123

def additional_properties
  @additional_properties
end

#authorizationsArray<CandidApiClient::PreEncounter::Patients::V1::Types::Authorization> (readonly)



115
116
117
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 115

def authorizations
  @authorizations
end

#biological_sexCandidApiClient::PreEncounter::Common::Types::Sex (readonly)

Returns The biological sex of the patient. This corresponds to the HL7 AdministrativeGender www.hl7.org/fhir/valueset-administrative-gender.html.

Returns:



65
66
67
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 65

def biological_sex
  @biological_sex
end

#birth_dateDate (readonly)

Returns:

  • (Date)


59
60
61
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 59

def birth_date
  @birth_date
end

#contactsArray<CandidApiClient::PreEncounter::Patients::V1::Types::Contact> (readonly)

Returns Contacts for the patient.

Returns:



101
102
103
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 101

def contacts
  @contacts
end

#deactivatedBoolean (readonly)

Returns True if the patient is deactivated. Deactivated patients are not returned in search results but are returned in all other endpoints including scan.

Returns:

  • (Boolean)

    True if the patient is deactivated. Deactivated patients are not returned in search results but are returned in all other endpoints including scan.



44
45
46
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 44

def deactivated
  @deactivated
end

#deceasedDateTime (readonly)

Returns Time of death for the patient. Leave unset if the patient is not deceased.

Returns:

  • (DateTime)

    Time of death for the patient. Leave unset if the patient is not deceased.



77
78
79
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 77

def deceased
  @deceased
end

#disability_statusCandidApiClient::PreEncounter::Common::Types::DisabilityStatus (readonly)



73
74
75
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 73

def disability_status
  @disability_status
end

#do_not_invoice_reasonCandidApiClient::PreEncounter::Patients::V1::Types::DoNotInvoiceReason (readonly)

Returns If this value is defined, the customer will not be invoiced.

Returns:



121
122
123
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 121

def do_not_invoice_reason
  @do_not_invoice_reason
end

#electronic_communication_opt_inBoolean (readonly)

Returns:

  • (Boolean)


92
93
94
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 92

def electronic_communication_opt_in
  @electronic_communication_opt_in
end

#emailString (readonly)

Returns:

  • (String)


90
91
92
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 90

def email
  @email
end

#ethnicityCandidApiClient::PreEncounter::Common::Types::Ethnicity (readonly)



71
72
73
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 71

def ethnicity
  @ethnicity
end

#external_provenanceCandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance (readonly)

Returns Information about the upstream system that owns this patient data. Leave unset if Candid owns patient data.

Returns:



99
100
101
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 99

def external_provenance
  @external_provenance
end

#filing_orderCandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder (readonly)



105
106
107
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 105

def filing_order
  @filing_order
end

#genderCandidApiClient::PreEncounter::Common::Types::Gender (readonly)



57
58
59
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 57

def gender
  @gender
end

#general_practitionersArray<CandidApiClient::PreEncounter::Common::Types::ExternalProvider> (readonly)



103
104
105
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 103

def general_practitioners
  @general_practitioners
end

#guarantorCandidApiClient::PreEncounter::Patients::V1::Types::Guarantor (readonly)



111
112
113
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 111

def guarantor
  @guarantor
end

#idString (readonly)

Returns The unique UUID identifier for a Patient. Patient ID is used in machine contexts.

Returns:

  • (String)

    The unique UUID identifier for a Patient. Patient ID is used in machine contexts.



35
36
37
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 35

def id
  @id
end

#languageString (readonly)

Returns:

  • (String)


96
97
98
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 96

def language
  @language
end

#marital_statusCandidApiClient::PreEncounter::Patients::V1::Types::MaritalStatus (readonly)



75
76
77
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 75

def marital_status
  @marital_status
end

#mrnString (readonly)

Returns The medical record number for the patient. Human-friendly Candid generated MRNs are of the form “YYMMDDXXXX”, where “YYYYMMDD” is the date of patient creation and “XXXX” is a zero-padded incrementing integer.

Returns:

  • (String)

    The medical record number for the patient. Human-friendly Candid generated MRNs are of the form “YYMMDDXXXX”, where “YYYYMMDD” is the date of patient creation and “XXXX” is a zero-padded incrementing integer.



39
40
41
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 39

def mrn
  @mrn
end

#multiple_birthInteger (readonly)

Returns The number of siblings the patient was born with. Leave unset if the patient was not part of a multiple birth.

Returns:

  • (Integer)

    The number of siblings the patient was born with. Leave unset if the patient was not part of a multiple birth.



80
81
82
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 80

def multiple_birth
  @multiple_birth
end

#nameCandidApiClient::PreEncounter::Common::Types::HumanName (readonly)



53
54
55
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 53

def name
  @name
end

#non_insurance_payer_associationsArray<CandidApiClient::PreEncounter::Common::Types::CanonicalNonInsurancePayerAssociation> (readonly)



109
110
111
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 109

def non_insurance_payer_associations
  @non_insurance_payer_associations
end

#non_insurance_payersArray<String> (readonly)

Returns:

  • (Array<String>)


107
108
109
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 107

def non_insurance_payers
  @non_insurance_payers
end

#organization_idString (readonly)

Returns The organization that owns this patient.

Returns:

  • (String)

    The organization that owns this patient.



41
42
43
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 41

def organization_id
  @organization_id
end

#other_addressesArray<CandidApiClient::PreEncounter::Common::Types::Address> (readonly)

Returns Other addresses for the patient.

Returns:



84
85
86
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 84

def other_addresses
  @other_addresses
end

#other_namesArray<CandidApiClient::PreEncounter::Common::Types::HumanName> (readonly)

Returns Other names for the patient.

Returns:



55
56
57
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 55

def other_names
  @other_names
end

#other_telecomsArray<CandidApiClient::PreEncounter::Common::Types::ContactPoint> (readonly)

Returns Other phone numbers for the patient.

Returns:



88
89
90
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 88

def other_telecoms
  @other_telecoms
end

#photoString (readonly)

Returns:

  • (String)


94
95
96
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 94

def photo
  @photo
end

#primary_addressCandidApiClient::PreEncounter::Common::Types::Address (readonly)

Returns The primary address for the patient.

Returns:



82
83
84
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 82

def primary_address
  @primary_address
end

#primary_service_facility_idString (readonly)

Returns:

  • (String)


119
120
121
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 119

def primary_service_facility_id
  @primary_service_facility_id
end

#primary_telecomCandidApiClient::PreEncounter::Common::Types::ContactPoint (readonly)

Returns The primary phone number for the patient.

Returns:



86
87
88
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 86

def primary_telecom
  @primary_telecom
end

#raceCandidApiClient::PreEncounter::Common::Types::Race (readonly)



69
70
71
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 69

def race
  @race
end

#referralsArray<CandidApiClient::PreEncounter::Patients::V1::Types::Referral> (readonly)



117
118
119
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 117

def referrals
  @referrals
end

#self_payBoolean (readonly)

Returns:

  • (Boolean)


113
114
115
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 113

def self_pay
  @self_pay
end

#sexual_orientationCandidApiClient::PreEncounter::Common::Types::SexualOrientation (readonly)

Returns The sexual orientation of the patient.

Returns:



67
68
69
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 67

def sexual_orientation
  @sexual_orientation
end

#social_security_numberString (readonly)

Returns:

  • (String)


61
62
63
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 61

def social_security_number
  @social_security_number
end

#updated_atDateTime (readonly)

Returns:

  • (DateTime)


49
50
51
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 49

def updated_at
  @updated_at
end

#updating_user_idString (readonly)

Returns The user ID of the user who last updated the patient.

Returns:

  • (String)

    The user ID of the user who last updated the patient.



51
52
53
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 51

def updating_user_id
  @updating_user_id
end

#versionInteger (readonly)

Returns The version of the patient. Any update to any property of a patient object will create a new version.

Returns:

  • (Integer)

    The version of the patient. Any update to any property of a patient object will create a new version.



47
48
49
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 47

def version
  @version
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Patients::V1::Types::Patient

Deserialize a JSON object to an instance of Patient

Parameters:

  • json_object (String)

Returns:



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 278

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = struct["id"]
  mrn = struct["mrn"]
  organization_id = struct["organization_id"]
  deactivated = struct["deactivated"]
  version = struct["version"]
  updated_at = (DateTime.parse(parsed_json["updated_at"]) unless parsed_json["updated_at"].nil?)
  updating_user_id = struct["updating_user_id"]
  if parsed_json["name"].nil?
    name = nil
  else
    name = parsed_json["name"].to_json
    name = CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: name)
  end
  other_names = parsed_json["other_names"]&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Common::Types::HumanName.from_json(json_object: item)
  end
  gender = struct["gender"]
  birth_date = (Date.parse(parsed_json["birth_date"]) unless parsed_json["birth_date"].nil?)
  social_security_number = struct["social_security_number"]
  biological_sex = struct["biological_sex"]
  sexual_orientation = struct["sexual_orientation"]
  race = struct["race"]
  ethnicity = struct["ethnicity"]
  disability_status = struct["disability_status"]
  marital_status = struct["marital_status"]
  deceased = (DateTime.parse(parsed_json["deceased"]) unless parsed_json["deceased"].nil?)
  multiple_birth = struct["multiple_birth"]
  if parsed_json["primary_address"].nil?
    primary_address = nil
  else
    primary_address = parsed_json["primary_address"].to_json
    primary_address = CandidApiClient::PreEncounter::Common::Types::Address.from_json(json_object: primary_address)
  end
  other_addresses = parsed_json["other_addresses"]&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Common::Types::Address.from_json(json_object: item)
  end
  if parsed_json["primary_telecom"].nil?
    primary_telecom = nil
  else
    primary_telecom = parsed_json["primary_telecom"].to_json
    primary_telecom = CandidApiClient::PreEncounter::Common::Types::ContactPoint.from_json(json_object: primary_telecom)
  end
  other_telecoms = parsed_json["other_telecoms"]&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Common::Types::ContactPoint.from_json(json_object: item)
  end
  email = struct["email"]
  electronic_communication_opt_in = struct["electronic_communication_opt_in"]
  photo = struct["photo"]
  language = struct["language"]
  if parsed_json["external_provenance"].nil?
    external_provenance = nil
  else
    external_provenance = parsed_json["external_provenance"].to_json
    external_provenance = CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance.from_json(json_object: external_provenance)
  end
  contacts = parsed_json["contacts"]&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Patients::V1::Types::Contact.from_json(json_object: item)
  end
  general_practitioners = parsed_json["general_practitioners"]&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Common::Types::ExternalProvider.from_json(json_object: item)
  end
  if parsed_json["filing_order"].nil?
    filing_order = nil
  else
    filing_order = parsed_json["filing_order"].to_json
    filing_order = CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder.from_json(json_object: filing_order)
  end
  non_insurance_payers = struct["non_insurance_payers"]
  non_insurance_payer_associations = parsed_json["non_insurance_payer_associations"]&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Common::Types::CanonicalNonInsurancePayerAssociation.from_json(json_object: item)
  end
  if parsed_json["guarantor"].nil?
    guarantor = nil
  else
    guarantor = parsed_json["guarantor"].to_json
    guarantor = CandidApiClient::PreEncounter::Patients::V1::Types::Guarantor.from_json(json_object: guarantor)
  end
  self_pay = struct["self_pay"]
  authorizations = parsed_json["authorizations"]&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Patients::V1::Types::Authorization.from_json(json_object: item)
  end
  referrals = parsed_json["referrals"]&.map do |item|
    item = item.to_json
    CandidApiClient::PreEncounter::Patients::V1::Types::Referral.from_json(json_object: item)
  end
  primary_service_facility_id = struct["primary_service_facility_id"]
  do_not_invoice_reason = struct["do_not_invoice_reason"]
  new(
    id: id,
    mrn: mrn,
    organization_id: organization_id,
    deactivated: deactivated,
    version: version,
    updated_at: updated_at,
    updating_user_id: updating_user_id,
    name: name,
    other_names: other_names,
    gender: gender,
    birth_date: birth_date,
    social_security_number: social_security_number,
    biological_sex: biological_sex,
    sexual_orientation: sexual_orientation,
    race: race,
    ethnicity: ethnicity,
    disability_status: disability_status,
    marital_status: marital_status,
    deceased: deceased,
    multiple_birth: multiple_birth,
    primary_address: primary_address,
    other_addresses: other_addresses,
    primary_telecom: primary_telecom,
    other_telecoms: other_telecoms,
    email: email,
    electronic_communication_opt_in: electronic_communication_opt_in,
    photo: photo,
    language: language,
    external_provenance: external_provenance,
    contacts: contacts,
    general_practitioners: general_practitioners,
    filing_order: filing_order,
    non_insurance_payers: non_insurance_payers,
    non_insurance_payer_associations: non_insurance_payer_associations,
    guarantor: guarantor,
    self_pay: self_pay,
    authorizations: authorizations,
    referrals: referrals,
    primary_service_facility_id: primary_service_facility_id,
    do_not_invoice_reason: do_not_invoice_reason,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 433

def self.validate_raw(obj:)
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.mrn.is_a?(String) != false || raise("Passed value for field obj.mrn is not the expected type, validation failed.")
  obj.organization_id.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
  obj.deactivated.is_a?(Boolean) != false || raise("Passed value for field obj.deactivated is not the expected type, validation failed.")
  obj.version.is_a?(Integer) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
  obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
  obj.updating_user_id.is_a?(String) != false || raise("Passed value for field obj.updating_user_id is not the expected type, validation failed.")
  CandidApiClient::PreEncounter::Common::Types::HumanName.validate_raw(obj: obj.name)
  obj.other_names.is_a?(Array) != false || raise("Passed value for field obj.other_names is not the expected type, validation failed.")
  obj.gender&.is_a?(CandidApiClient::PreEncounter::Common::Types::Gender) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.")
  obj.birth_date.is_a?(Date) != false || raise("Passed value for field obj.birth_date is not the expected type, validation failed.")
  obj.social_security_number&.is_a?(String) != false || raise("Passed value for field obj.social_security_number is not the expected type, validation failed.")
  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.")
  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.")
  obj.race&.is_a?(CandidApiClient::PreEncounter::Common::Types::Race) != false || raise("Passed value for field obj.race is not the expected type, validation failed.")
  obj.ethnicity&.is_a?(CandidApiClient::PreEncounter::Common::Types::Ethnicity) != false || raise("Passed value for field obj.ethnicity is not the expected type, validation failed.")
  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.")
  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.")
  obj.deceased&.is_a?(DateTime) != false || raise("Passed value for field obj.deceased is not the expected type, validation failed.")
  obj.multiple_birth&.is_a?(Integer) != false || raise("Passed value for field obj.multiple_birth is not the expected type, validation failed.")
  CandidApiClient::PreEncounter::Common::Types::Address.validate_raw(obj: obj.primary_address)
  obj.other_addresses.is_a?(Array) != false || raise("Passed value for field obj.other_addresses is not the expected type, validation failed.")
  CandidApiClient::PreEncounter::Common::Types::ContactPoint.validate_raw(obj: obj.primary_telecom)
  obj.other_telecoms.is_a?(Array) != false || raise("Passed value for field obj.other_telecoms is not the expected type, validation failed.")
  obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
  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.")
  obj.photo&.is_a?(String) != false || raise("Passed value for field obj.photo is not the expected type, validation failed.")
  obj.language&.is_a?(String) != false || raise("Passed value for field obj.language is not the expected type, validation failed.")
  obj.external_provenance.nil? || CandidApiClient::PreEncounter::Patients::V1::Types::ExternalProvenance.validate_raw(obj: obj.external_provenance)
  obj.contacts.is_a?(Array) != false || raise("Passed value for field obj.contacts is not the expected type, validation failed.")
  obj.general_practitioners.is_a?(Array) != false || raise("Passed value for field obj.general_practitioners is not the expected type, validation failed.")
  CandidApiClient::PreEncounter::Patients::V1::Types::FilingOrder.validate_raw(obj: obj.filing_order)
  obj.non_insurance_payers&.is_a?(Array) != false || raise("Passed value for field obj.non_insurance_payers is not the expected type, validation failed.")
  obj.non_insurance_payer_associations&.is_a?(Array) != false || raise("Passed value for field obj.non_insurance_payer_associations is not the expected type, validation failed.")
  obj.guarantor.nil? || CandidApiClient::PreEncounter::Patients::V1::Types::Guarantor.validate_raw(obj: obj.guarantor)
  obj.self_pay&.is_a?(Boolean) != false || raise("Passed value for field obj.self_pay is not the expected type, validation failed.")
  obj.authorizations&.is_a?(Array) != false || raise("Passed value for field obj.authorizations is not the expected type, validation failed.")
  obj.referrals&.is_a?(Array) != false || raise("Passed value for field obj.referrals is not the expected type, validation failed.")
  obj.primary_service_facility_id&.is_a?(String) != false || raise("Passed value for field obj.primary_service_facility_id is not the expected type, validation failed.")
  obj.do_not_invoice_reason&.is_a?(CandidApiClient::PreEncounter::Patients::V1::Types::DoNotInvoiceReason) != false || raise("Passed value for field obj.do_not_invoice_reason is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of Patient to a JSON object

Returns:

  • (String)


423
424
425
# File 'lib/candidhealth/pre_encounter/patients/v_1/types/patient.rb', line 423

def to_json(*_args)
  @_field_set&.to_json
end