primary_connect_client 0.7.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +61 -16
- data/docs/Address.md +32 -0
- data/docs/CodedValue.md +22 -0
- data/docs/DefaultApi.md +568 -0
- data/docs/Demographics.md +52 -0
- data/docs/Error.md +18 -0
- data/docs/Event.md +26 -0
- data/docs/Events.md +18 -0
- data/docs/Identifier.md +20 -0
- data/docs/Location.md +26 -0
- data/docs/Meta.md +34 -0
- data/docs/MetaDestinations.md +22 -0
- data/docs/MetaMessage.md +20 -0
- data/docs/MetaSource.md +20 -0
- data/docs/MetaTransmission.md +18 -0
- data/docs/Name.md +22 -0
- data/docs/Order.md +24 -0
- data/docs/OrderIds.md +18 -0
- data/docs/OrderOrder.md +58 -0
- data/docs/OrderOrderClinicalInfo.md +26 -0
- data/docs/OrderOrderDiagnoses.md +22 -0
- data/docs/OrderOrderOrderingFacility.md +22 -0
- data/docs/OrderOrderSpecimen.md +22 -0
- data/docs/OrderWithEventErrors.md +20 -0
- data/docs/Orders.md +18 -0
- data/docs/OrdersOrders.md +22 -0
- data/docs/Patient.md +24 -0
- data/docs/PatientContacts.md +28 -0
- data/docs/PatientDemographics.md +52 -0
- data/docs/PhoneNumber.md +20 -0
- data/docs/Provider.md +32 -0
- data/docs/Result.md +52 -0
- data/docs/ResultIds.md +18 -0
- data/docs/ResultReferenceRange.md +22 -0
- data/docs/ResultReport.md +22 -0
- data/docs/ResultSpecimen.md +22 -0
- data/docs/Results.md +20 -0
- data/docs/Specimen.md +22 -0
- data/docs/Visit.md +36 -0
- data/docs/VisitCompany.md +24 -0
- data/docs/VisitGuarantor.md +40 -0
- data/docs/VisitGuarantorEmployer.md +22 -0
- data/docs/VisitInsurances.md +40 -0
- data/docs/VisitInsured.md +30 -0
- data/docs/VisitPlan.md +22 -0
- data/git_push.sh +5 -6
- data/lib/primary_connect_client/api/default_api.rb +143 -66
- data/lib/primary_connect_client/api_client.rb +5 -6
- data/lib/primary_connect_client/api_error.rb +1 -1
- data/lib/primary_connect_client/configuration.rb +4 -3
- data/lib/primary_connect_client/models/address.rb +281 -0
- data/lib/primary_connect_client/models/coded_value.rb +238 -0
- data/lib/primary_connect_client/models/demographics.rb +466 -0
- data/lib/primary_connect_client/models/error.rb +218 -0
- data/lib/primary_connect_client/models/event.rb +254 -0
- data/lib/primary_connect_client/models/events.rb +221 -0
- data/lib/primary_connect_client/models/identifier.rb +228 -0
- data/lib/primary_connect_client/models/location.rb +255 -0
- data/lib/primary_connect_client/models/meta.rb +327 -0
- data/lib/primary_connect_client/models/meta_destinations.rb +242 -0
- data/lib/primary_connect_client/models/meta_message.rb +227 -0
- data/lib/primary_connect_client/models/meta_source.rb +227 -0
- data/lib/primary_connect_client/models/meta_transmission.rb +218 -0
- data/lib/primary_connect_client/models/name.rb +237 -0
- data/lib/primary_connect_client/models/order.rb +245 -0
- data/lib/primary_connect_client/models/order_ids.rb +221 -0
- data/lib/primary_connect_client/models/order_order.rb +496 -0
- data/lib/primary_connect_client/models/order_order_clinical_info.rb +260 -0
- data/lib/primary_connect_client/models/order_order_diagnoses.rb +272 -0
- data/lib/primary_connect_client/models/order_order_ordering_facility.rb +239 -0
- data/lib/primary_connect_client/models/order_order_specimen.rb +239 -0
- data/lib/primary_connect_client/models/order_with_event_errors.rb +229 -0
- data/lib/primary_connect_client/models/orders.rb +221 -0
- data/lib/primary_connect_client/models/orders_orders.rb +236 -0
- data/lib/primary_connect_client/models/patient.rb +253 -0
- data/lib/primary_connect_client/models/patient_contacts.rb +305 -0
- data/lib/primary_connect_client/models/patient_demographics.rb +466 -0
- data/lib/primary_connect_client/models/phone_number.rb +262 -0
- data/lib/primary_connect_client/models/provider.rb +288 -0
- data/lib/primary_connect_client/models/result.rb +443 -0
- data/lib/primary_connect_client/models/result_ids.rb +221 -0
- data/lib/primary_connect_client/models/result_reference_range.rb +240 -0
- data/lib/primary_connect_client/models/result_report.rb +240 -0
- data/lib/primary_connect_client/models/result_specimen.rb +239 -0
- data/lib/primary_connect_client/models/results.rb +230 -0
- data/lib/primary_connect_client/models/specimen.rb +239 -0
- data/lib/primary_connect_client/models/visit.rb +306 -0
- data/lib/primary_connect_client/models/visit_company.rb +248 -0
- data/lib/primary_connect_client/models/visit_guarantor.rb +358 -0
- data/lib/primary_connect_client/models/visit_guarantor_employer.rb +238 -0
- data/lib/primary_connect_client/models/visit_insurances.rb +386 -0
- data/lib/primary_connect_client/models/visit_insured.rb +322 -0
- data/lib/primary_connect_client/models/visit_plan.rb +238 -0
- data/lib/primary_connect_client/version.rb +12 -2
- data/lib/primary_connect_client.rb +45 -3
- data/primary_connect_client.gemspec +7 -5
- data/spec/api/default_api_spec.rb +44 -41
- data/spec/api_client_spec.rb +3 -3
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/address_spec.rb +76 -0
- data/spec/models/coded_value_spec.rb +46 -0
- data/spec/models/demographics_spec.rb +168 -0
- data/spec/models/error_spec.rb +34 -0
- data/spec/models/event_spec.rb +58 -0
- data/spec/models/events_spec.rb +34 -0
- data/spec/models/identifier_spec.rb +40 -0
- data/spec/models/location_spec.rb +58 -0
- data/spec/models/meta_destinations_spec.rb +46 -0
- data/spec/models/meta_message_spec.rb +40 -0
- data/spec/models/meta_source_spec.rb +40 -0
- data/spec/models/meta_spec.rb +86 -0
- data/spec/models/meta_transmission_spec.rb +34 -0
- data/spec/models/name_spec.rb +46 -0
- data/spec/models/order_ids_spec.rb +34 -0
- data/spec/models/order_order_clinical_info_spec.rb +58 -0
- data/spec/models/order_order_diagnoses_spec.rb +50 -0
- data/spec/models/order_order_ordering_facility_spec.rb +46 -0
- data/spec/models/order_order_spec.rb +170 -0
- data/spec/models/order_order_specimen_spec.rb +46 -0
- data/spec/models/order_spec.rb +52 -0
- data/spec/models/order_with_event_errors_spec.rb +40 -0
- data/spec/models/orders_orders_spec.rb +46 -0
- data/spec/models/orders_spec.rb +34 -0
- data/spec/models/patient_contacts_spec.rb +68 -0
- data/spec/models/patient_demographics_spec.rb +168 -0
- data/spec/models/patient_spec.rb +52 -0
- data/spec/models/phone_number_spec.rb +44 -0
- data/spec/models/provider_spec.rb +76 -0
- data/spec/models/result_ids_spec.rb +34 -0
- data/spec/models/result_reference_range_spec.rb +46 -0
- data/spec/models/result_report_spec.rb +46 -0
- data/spec/models/result_spec.rb +148 -0
- data/spec/models/result_specimen_spec.rb +46 -0
- data/spec/models/results_spec.rb +40 -0
- data/spec/models/specimen_spec.rb +46 -0
- data/spec/models/visit_company_spec.rb +52 -0
- data/spec/models/visit_guarantor_employer_spec.rb +46 -0
- data/spec/models/visit_guarantor_spec.rb +104 -0
- data/spec/models/visit_insurances_spec.rb +112 -0
- data/spec/models/visit_insured_spec.rb +78 -0
- data/spec/models/visit_plan_spec.rb +46 -0
- data/spec/models/visit_spec.rb +88 -0
- data/spec/spec_helper.rb +1 -1
- metadata +177 -20
- data/Gemfile.lock +0 -74
@@ -0,0 +1,466 @@
|
|
1
|
+
=begin
|
2
|
+
#Primary Connect API V1
|
3
|
+
|
4
|
+
#Client Library to interface with Primary Connect
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.3.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module PrimaryConnectClient
|
17
|
+
class PatientDemographics
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
attr_accessor :dob
|
21
|
+
|
22
|
+
attr_accessor :ssn
|
23
|
+
|
24
|
+
attr_accessor :sex
|
25
|
+
|
26
|
+
attr_accessor :gender
|
27
|
+
|
28
|
+
attr_accessor :sexual_orientation
|
29
|
+
|
30
|
+
attr_accessor :races
|
31
|
+
|
32
|
+
attr_accessor :race_details
|
33
|
+
|
34
|
+
attr_accessor :ethnicity
|
35
|
+
|
36
|
+
attr_accessor :ethnicity_detail
|
37
|
+
|
38
|
+
attr_accessor :marital_status
|
39
|
+
|
40
|
+
attr_accessor :is_deceased
|
41
|
+
|
42
|
+
# ISO 8601
|
43
|
+
attr_accessor :death_date_time
|
44
|
+
|
45
|
+
attr_accessor :phone_numbers
|
46
|
+
|
47
|
+
attr_accessor :email_addresses
|
48
|
+
|
49
|
+
attr_accessor :language_code
|
50
|
+
|
51
|
+
attr_accessor :citizenships
|
52
|
+
|
53
|
+
attr_accessor :address
|
54
|
+
|
55
|
+
class EnumAttributeValidator
|
56
|
+
attr_reader :datatype
|
57
|
+
attr_reader :allowable_values
|
58
|
+
|
59
|
+
def initialize(datatype, allowable_values)
|
60
|
+
@allowable_values = allowable_values.map do |value|
|
61
|
+
case datatype.to_s
|
62
|
+
when /Integer/i
|
63
|
+
value.to_i
|
64
|
+
when /Float/i
|
65
|
+
value.to_f
|
66
|
+
else
|
67
|
+
value
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def valid?(value)
|
73
|
+
!value || allowable_values.include?(value)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
78
|
+
def self.attribute_map
|
79
|
+
{
|
80
|
+
:'name' => :'name',
|
81
|
+
:'dob' => :'dob',
|
82
|
+
:'ssn' => :'ssn',
|
83
|
+
:'sex' => :'sex',
|
84
|
+
:'gender' => :'gender',
|
85
|
+
:'sexual_orientation' => :'sexual_orientation',
|
86
|
+
:'races' => :'races',
|
87
|
+
:'race_details' => :'race_details',
|
88
|
+
:'ethnicity' => :'ethnicity',
|
89
|
+
:'ethnicity_detail' => :'ethnicity_detail',
|
90
|
+
:'marital_status' => :'marital_status',
|
91
|
+
:'is_deceased' => :'is_deceased',
|
92
|
+
:'death_date_time' => :'death_date_time',
|
93
|
+
:'phone_numbers' => :'phone_numbers',
|
94
|
+
:'email_addresses' => :'email_addresses',
|
95
|
+
:'language_code' => :'language_code',
|
96
|
+
:'citizenships' => :'citizenships',
|
97
|
+
:'address' => :'address'
|
98
|
+
}
|
99
|
+
end
|
100
|
+
|
101
|
+
# Returns all the JSON keys this model knows about
|
102
|
+
def self.acceptable_attributes
|
103
|
+
attribute_map.values
|
104
|
+
end
|
105
|
+
|
106
|
+
# Attribute type mapping.
|
107
|
+
def self.openapi_types
|
108
|
+
{
|
109
|
+
:'name' => :'Name',
|
110
|
+
:'dob' => :'String',
|
111
|
+
:'ssn' => :'String',
|
112
|
+
:'sex' => :'String',
|
113
|
+
:'gender' => :'String',
|
114
|
+
:'sexual_orientation' => :'String',
|
115
|
+
:'races' => :'Array<String>',
|
116
|
+
:'race_details' => :'Array<String>',
|
117
|
+
:'ethnicity' => :'String',
|
118
|
+
:'ethnicity_detail' => :'Array<String>',
|
119
|
+
:'marital_status' => :'String',
|
120
|
+
:'is_deceased' => :'Boolean',
|
121
|
+
:'death_date_time' => :'Time',
|
122
|
+
:'phone_numbers' => :'Array<PhoneNumber>',
|
123
|
+
:'email_addresses' => :'Array<String>',
|
124
|
+
:'language_code' => :'String',
|
125
|
+
:'citizenships' => :'Array<String>',
|
126
|
+
:'address' => :'Address'
|
127
|
+
}
|
128
|
+
end
|
129
|
+
|
130
|
+
# List of attributes with nullable: true
|
131
|
+
def self.openapi_nullable
|
132
|
+
Set.new([
|
133
|
+
])
|
134
|
+
end
|
135
|
+
|
136
|
+
# Initializes the object
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
def initialize(attributes = {})
|
139
|
+
if (!attributes.is_a?(Hash))
|
140
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::PatientDemographics` initialize method"
|
141
|
+
end
|
142
|
+
|
143
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
144
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
145
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
146
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::PatientDemographics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
147
|
+
end
|
148
|
+
h[k.to_sym] = v
|
149
|
+
}
|
150
|
+
|
151
|
+
if attributes.key?(:'name')
|
152
|
+
self.name = attributes[:'name']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.key?(:'dob')
|
156
|
+
self.dob = attributes[:'dob']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.key?(:'ssn')
|
160
|
+
self.ssn = attributes[:'ssn']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'sex')
|
164
|
+
self.sex = attributes[:'sex']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'gender')
|
168
|
+
self.gender = attributes[:'gender']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'sexual_orientation')
|
172
|
+
self.sexual_orientation = attributes[:'sexual_orientation']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'races')
|
176
|
+
if (value = attributes[:'races']).is_a?(Array)
|
177
|
+
self.races = value
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.key?(:'race_details')
|
182
|
+
if (value = attributes[:'race_details']).is_a?(Array)
|
183
|
+
self.race_details = value
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'ethnicity')
|
188
|
+
self.ethnicity = attributes[:'ethnicity']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'ethnicity_detail')
|
192
|
+
if (value = attributes[:'ethnicity_detail']).is_a?(Array)
|
193
|
+
self.ethnicity_detail = value
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.key?(:'marital_status')
|
198
|
+
self.marital_status = attributes[:'marital_status']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.key?(:'is_deceased')
|
202
|
+
self.is_deceased = attributes[:'is_deceased']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.key?(:'death_date_time')
|
206
|
+
self.death_date_time = attributes[:'death_date_time']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.key?(:'phone_numbers')
|
210
|
+
if (value = attributes[:'phone_numbers']).is_a?(Array)
|
211
|
+
self.phone_numbers = value
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
if attributes.key?(:'email_addresses')
|
216
|
+
if (value = attributes[:'email_addresses']).is_a?(Array)
|
217
|
+
self.email_addresses = value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'language_code')
|
222
|
+
self.language_code = attributes[:'language_code']
|
223
|
+
end
|
224
|
+
|
225
|
+
if attributes.key?(:'citizenships')
|
226
|
+
if (value = attributes[:'citizenships']).is_a?(Array)
|
227
|
+
self.citizenships = value
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
if attributes.key?(:'address')
|
232
|
+
self.address = attributes[:'address']
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
237
|
+
# @return Array for valid properties with the reasons
|
238
|
+
def list_invalid_properties
|
239
|
+
invalid_properties = Array.new
|
240
|
+
invalid_properties
|
241
|
+
end
|
242
|
+
|
243
|
+
# Check to see if the all the properties in the model are valid
|
244
|
+
# @return true if the model is valid
|
245
|
+
def valid?
|
246
|
+
sex_validator = EnumAttributeValidator.new('String', ["SEX_UNKNOWN", "SEX_FEMALE", "SEX_MALE", "SEX_OTHER", "SEX_NON_BINARY", "SEX_PREFER_NOT_TO_DISCLOSE"])
|
247
|
+
return false unless sex_validator.valid?(@sex)
|
248
|
+
gender_validator = EnumAttributeValidator.new('String', ["GENDER_UNKNOWN", "GENDER_FEMALE", "GENDER_MALE", "GENDER_OTHER", "GENDER_NON_BINARY", "GENDER_TRANSGENDER_MALE", "GENDER_TRANSGENDER_FEMALE", "GENDER_PREFER_NOT_TO_DISCLOSE"])
|
249
|
+
return false unless gender_validator.valid?(@gender)
|
250
|
+
sexual_orientation_validator = EnumAttributeValidator.new('String', ["ORIENTATION_UNKNOWN", "ORIENTATION_HOMOSEXUAL", "ORIENTATION_HETEROSEXUAL", "ORIENTATION_BISEXUAL", "ORIENTATION_QUESTIONING", "ORIENTATION_OTHER", "ORIENTATION_PREFER_NOT_TO_DISCLOSE"])
|
251
|
+
return false unless sexual_orientation_validator.valid?(@sexual_orientation)
|
252
|
+
ethnicity_validator = EnumAttributeValidator.new('String', ["ETHNICITY_UNKNOWN", "ETHNICITY_HISPANIC", "ETHNICITY_NON_HISPANIC", "ETHNICITY_PREFER_NOT_TO_DISCLOSE"])
|
253
|
+
return false unless ethnicity_validator.valid?(@ethnicity)
|
254
|
+
marital_status_validator = EnumAttributeValidator.new('String', ["MARITAL_STATUS_UNKNOWN", "MARITAL_STATUS_SEPARATED", "MARITAL_STATUS_UNMARRIED", "MARITAL_STATUS_COMMON_LAW", "MARITAL_STATUS_DIVORCED", "MARITAL_STATUS_LEGALLY_SEPARATED", "MARITAL_STATUS_LIVING_TOGETHER", "MARITAL_STATUS_INTERLOCUTORY", "MARITAL_STATUS_MARRIED", "MARITAL_STATUS_ANNULLED", "MARITAL_STATUS_OTHER", "MARITAL_STATUS_DOMESTIC_PARTNER", "MARITAL_STATUS_REGISTERED_DOMESTIC_PARTNER", "MARITAL_STATUS_SINGLE", "MARITAL_STATUS_UNREPORTED", "MARITAL_STATUS_WIDOWED"])
|
255
|
+
return false unless marital_status_validator.valid?(@marital_status)
|
256
|
+
true
|
257
|
+
end
|
258
|
+
|
259
|
+
# Custom attribute writer method checking allowed values (enum).
|
260
|
+
# @param [Object] sex Object to be assigned
|
261
|
+
def sex=(sex)
|
262
|
+
validator = EnumAttributeValidator.new('String', ["SEX_UNKNOWN", "SEX_FEMALE", "SEX_MALE", "SEX_OTHER", "SEX_NON_BINARY", "SEX_PREFER_NOT_TO_DISCLOSE"])
|
263
|
+
unless validator.valid?(sex)
|
264
|
+
fail ArgumentError, "invalid value for \"sex\", must be one of #{validator.allowable_values}."
|
265
|
+
end
|
266
|
+
@sex = sex
|
267
|
+
end
|
268
|
+
|
269
|
+
# Custom attribute writer method checking allowed values (enum).
|
270
|
+
# @param [Object] gender Object to be assigned
|
271
|
+
def gender=(gender)
|
272
|
+
validator = EnumAttributeValidator.new('String', ["GENDER_UNKNOWN", "GENDER_FEMALE", "GENDER_MALE", "GENDER_OTHER", "GENDER_NON_BINARY", "GENDER_TRANSGENDER_MALE", "GENDER_TRANSGENDER_FEMALE", "GENDER_PREFER_NOT_TO_DISCLOSE"])
|
273
|
+
unless validator.valid?(gender)
|
274
|
+
fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}."
|
275
|
+
end
|
276
|
+
@gender = gender
|
277
|
+
end
|
278
|
+
|
279
|
+
# Custom attribute writer method checking allowed values (enum).
|
280
|
+
# @param [Object] sexual_orientation Object to be assigned
|
281
|
+
def sexual_orientation=(sexual_orientation)
|
282
|
+
validator = EnumAttributeValidator.new('String', ["ORIENTATION_UNKNOWN", "ORIENTATION_HOMOSEXUAL", "ORIENTATION_HETEROSEXUAL", "ORIENTATION_BISEXUAL", "ORIENTATION_QUESTIONING", "ORIENTATION_OTHER", "ORIENTATION_PREFER_NOT_TO_DISCLOSE"])
|
283
|
+
unless validator.valid?(sexual_orientation)
|
284
|
+
fail ArgumentError, "invalid value for \"sexual_orientation\", must be one of #{validator.allowable_values}."
|
285
|
+
end
|
286
|
+
@sexual_orientation = sexual_orientation
|
287
|
+
end
|
288
|
+
|
289
|
+
# Custom attribute writer method checking allowed values (enum).
|
290
|
+
# @param [Object] ethnicity Object to be assigned
|
291
|
+
def ethnicity=(ethnicity)
|
292
|
+
validator = EnumAttributeValidator.new('String', ["ETHNICITY_UNKNOWN", "ETHNICITY_HISPANIC", "ETHNICITY_NON_HISPANIC", "ETHNICITY_PREFER_NOT_TO_DISCLOSE"])
|
293
|
+
unless validator.valid?(ethnicity)
|
294
|
+
fail ArgumentError, "invalid value for \"ethnicity\", must be one of #{validator.allowable_values}."
|
295
|
+
end
|
296
|
+
@ethnicity = ethnicity
|
297
|
+
end
|
298
|
+
|
299
|
+
# Custom attribute writer method checking allowed values (enum).
|
300
|
+
# @param [Object] marital_status Object to be assigned
|
301
|
+
def marital_status=(marital_status)
|
302
|
+
validator = EnumAttributeValidator.new('String', ["MARITAL_STATUS_UNKNOWN", "MARITAL_STATUS_SEPARATED", "MARITAL_STATUS_UNMARRIED", "MARITAL_STATUS_COMMON_LAW", "MARITAL_STATUS_DIVORCED", "MARITAL_STATUS_LEGALLY_SEPARATED", "MARITAL_STATUS_LIVING_TOGETHER", "MARITAL_STATUS_INTERLOCUTORY", "MARITAL_STATUS_MARRIED", "MARITAL_STATUS_ANNULLED", "MARITAL_STATUS_OTHER", "MARITAL_STATUS_DOMESTIC_PARTNER", "MARITAL_STATUS_REGISTERED_DOMESTIC_PARTNER", "MARITAL_STATUS_SINGLE", "MARITAL_STATUS_UNREPORTED", "MARITAL_STATUS_WIDOWED"])
|
303
|
+
unless validator.valid?(marital_status)
|
304
|
+
fail ArgumentError, "invalid value for \"marital_status\", must be one of #{validator.allowable_values}."
|
305
|
+
end
|
306
|
+
@marital_status = marital_status
|
307
|
+
end
|
308
|
+
|
309
|
+
# Checks equality by comparing each attribute.
|
310
|
+
# @param [Object] Object to be compared
|
311
|
+
def ==(o)
|
312
|
+
return true if self.equal?(o)
|
313
|
+
self.class == o.class &&
|
314
|
+
name == o.name &&
|
315
|
+
dob == o.dob &&
|
316
|
+
ssn == o.ssn &&
|
317
|
+
sex == o.sex &&
|
318
|
+
gender == o.gender &&
|
319
|
+
sexual_orientation == o.sexual_orientation &&
|
320
|
+
races == o.races &&
|
321
|
+
race_details == o.race_details &&
|
322
|
+
ethnicity == o.ethnicity &&
|
323
|
+
ethnicity_detail == o.ethnicity_detail &&
|
324
|
+
marital_status == o.marital_status &&
|
325
|
+
is_deceased == o.is_deceased &&
|
326
|
+
death_date_time == o.death_date_time &&
|
327
|
+
phone_numbers == o.phone_numbers &&
|
328
|
+
email_addresses == o.email_addresses &&
|
329
|
+
language_code == o.language_code &&
|
330
|
+
citizenships == o.citizenships &&
|
331
|
+
address == o.address
|
332
|
+
end
|
333
|
+
|
334
|
+
# @see the `==` method
|
335
|
+
# @param [Object] Object to be compared
|
336
|
+
def eql?(o)
|
337
|
+
self == o
|
338
|
+
end
|
339
|
+
|
340
|
+
# Calculates hash code according to all attributes.
|
341
|
+
# @return [Integer] Hash code
|
342
|
+
def hash
|
343
|
+
[name, dob, ssn, sex, gender, sexual_orientation, races, race_details, ethnicity, ethnicity_detail, marital_status, is_deceased, death_date_time, phone_numbers, email_addresses, language_code, citizenships, address].hash
|
344
|
+
end
|
345
|
+
|
346
|
+
# Builds the object from hash
|
347
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
348
|
+
# @return [Object] Returns the model itself
|
349
|
+
def self.build_from_hash(attributes)
|
350
|
+
new.build_from_hash(attributes)
|
351
|
+
end
|
352
|
+
|
353
|
+
# Builds the object from hash
|
354
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
355
|
+
# @return [Object] Returns the model itself
|
356
|
+
def build_from_hash(attributes)
|
357
|
+
return nil unless attributes.is_a?(Hash)
|
358
|
+
self.class.openapi_types.each_pair do |key, type|
|
359
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
360
|
+
self.send("#{key}=", nil)
|
361
|
+
elsif type =~ /\AArray<(.*)>/i
|
362
|
+
# check to ensure the input is an array given that the attribute
|
363
|
+
# is documented as an array but the input is not
|
364
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
365
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
366
|
+
end
|
367
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
368
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
self
|
373
|
+
end
|
374
|
+
|
375
|
+
# Deserializes the data based on type
|
376
|
+
# @param string type Data type
|
377
|
+
# @param string value Value to be deserialized
|
378
|
+
# @return [Object] Deserialized data
|
379
|
+
def _deserialize(type, value)
|
380
|
+
case type.to_sym
|
381
|
+
when :Time
|
382
|
+
Time.parse(value)
|
383
|
+
when :Date
|
384
|
+
Date.parse(value)
|
385
|
+
when :String
|
386
|
+
value.to_s
|
387
|
+
when :Integer
|
388
|
+
value.to_i
|
389
|
+
when :Float
|
390
|
+
value.to_f
|
391
|
+
when :Boolean
|
392
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
393
|
+
true
|
394
|
+
else
|
395
|
+
false
|
396
|
+
end
|
397
|
+
when :Object
|
398
|
+
# generic object (usually a Hash), return directly
|
399
|
+
value
|
400
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
401
|
+
inner_type = Regexp.last_match[:inner_type]
|
402
|
+
value.map { |v| _deserialize(inner_type, v) }
|
403
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
404
|
+
k_type = Regexp.last_match[:k_type]
|
405
|
+
v_type = Regexp.last_match[:v_type]
|
406
|
+
{}.tap do |hash|
|
407
|
+
value.each do |k, v|
|
408
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
409
|
+
end
|
410
|
+
end
|
411
|
+
else # model
|
412
|
+
# models (e.g. Pet) or oneOf
|
413
|
+
klass = PrimaryConnectClient.const_get(type)
|
414
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
415
|
+
end
|
416
|
+
end
|
417
|
+
|
418
|
+
# Returns the string representation of the object
|
419
|
+
# @return [String] String presentation of the object
|
420
|
+
def to_s
|
421
|
+
to_hash.to_s
|
422
|
+
end
|
423
|
+
|
424
|
+
# to_body is an alias to to_hash (backward compatibility)
|
425
|
+
# @return [Hash] Returns the object in the form of hash
|
426
|
+
def to_body
|
427
|
+
to_hash
|
428
|
+
end
|
429
|
+
|
430
|
+
# Returns the object in the form of hash
|
431
|
+
# @return [Hash] Returns the object in the form of hash
|
432
|
+
def to_hash
|
433
|
+
hash = {}
|
434
|
+
self.class.attribute_map.each_pair do |attr, param|
|
435
|
+
value = self.send(attr)
|
436
|
+
if value.nil?
|
437
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
438
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
439
|
+
end
|
440
|
+
|
441
|
+
hash[param] = _to_hash(value)
|
442
|
+
end
|
443
|
+
hash
|
444
|
+
end
|
445
|
+
|
446
|
+
# Outputs non-array value in the form of hash
|
447
|
+
# For object, use to_hash. Otherwise, just return the value
|
448
|
+
# @param [Object] value Any valid value
|
449
|
+
# @return [Hash] Returns the value in the form of hash
|
450
|
+
def _to_hash(value)
|
451
|
+
if value.is_a?(Array)
|
452
|
+
value.compact.map { |v| _to_hash(v) }
|
453
|
+
elsif value.is_a?(Hash)
|
454
|
+
{}.tap do |hash|
|
455
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
456
|
+
end
|
457
|
+
elsif value.respond_to? :to_hash
|
458
|
+
value.to_hash
|
459
|
+
else
|
460
|
+
value
|
461
|
+
end
|
462
|
+
end
|
463
|
+
|
464
|
+
end
|
465
|
+
|
466
|
+
end
|