primary_connect_client 0.8.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +74 -20
  4. data/docs/Address.md +32 -0
  5. data/docs/CodedValue.md +22 -0
  6. data/docs/DefaultApi.md +637 -0
  7. data/docs/Demographics.md +52 -0
  8. data/docs/Device.md +30 -0
  9. data/docs/Dosage.md +30 -0
  10. data/docs/Error.md +18 -0
  11. data/docs/Event.md +26 -0
  12. data/docs/Events.md +18 -0
  13. data/docs/Identifier.md +20 -0
  14. data/docs/Location.md +28 -0
  15. data/docs/Medication.md +22 -0
  16. data/docs/MedicationAdministration.md +32 -0
  17. data/docs/Meta.md +34 -0
  18. data/docs/MetaDestinations.md +22 -0
  19. data/docs/MetaMessage.md +20 -0
  20. data/docs/MetaSource.md +20 -0
  21. data/docs/MetaTransmission.md +18 -0
  22. data/docs/Name.md +22 -0
  23. data/docs/Order.md +26 -0
  24. data/docs/OrderIds.md +18 -0
  25. data/docs/OrderOrder.md +62 -0
  26. data/docs/OrderOrderClinicalInfo.md +26 -0
  27. data/docs/OrderOrderDiagnoses.md +22 -0
  28. data/docs/OrderOrderOrderingFacility.md +22 -0
  29. data/docs/OrderOrderSpecimen.md +22 -0
  30. data/docs/OrderWithEventErrors.md +20 -0
  31. data/docs/Orders.md +18 -0
  32. data/docs/OrdersOrders.md +22 -0
  33. data/docs/Patient.md +24 -0
  34. data/docs/PatientContacts.md +28 -0
  35. data/docs/PatientDemographics.md +52 -0
  36. data/docs/PhoneNumber.md +20 -0
  37. data/docs/Provider.md +32 -0
  38. data/docs/Result.md +52 -0
  39. data/docs/ResultIds.md +18 -0
  40. data/docs/ResultReferenceRange.md +22 -0
  41. data/docs/ResultReport.md +22 -0
  42. data/docs/ResultSpecimen.md +22 -0
  43. data/docs/Results.md +20 -0
  44. data/docs/Specimen.md +22 -0
  45. data/docs/Subject.md +49 -0
  46. data/docs/SubjectOneOf.md +18 -0
  47. data/docs/SubjectOneOf1.md +18 -0
  48. data/docs/V2Device.md +30 -0
  49. data/docs/V2Dosage.md +30 -0
  50. data/docs/V2Medication.md +22 -0
  51. data/docs/V2MedicationAdministration.md +32 -0
  52. data/docs/Visit.md +36 -0
  53. data/docs/VisitCompany.md +24 -0
  54. data/docs/VisitGuarantor.md +40 -0
  55. data/docs/VisitGuarantorEmployer.md +22 -0
  56. data/docs/VisitInsurances.md +40 -0
  57. data/docs/VisitInsured.md +30 -0
  58. data/docs/VisitPlan.md +22 -0
  59. data/git_push.sh +5 -6
  60. data/lib/primary_connect_client/api/default_api.rb +207 -67
  61. data/lib/primary_connect_client/api_client.rb +5 -6
  62. data/lib/primary_connect_client/api_error.rb +1 -1
  63. data/lib/primary_connect_client/configuration.rb +3 -2
  64. data/lib/primary_connect_client/models/address.rb +281 -0
  65. data/lib/primary_connect_client/models/coded_value.rb +238 -0
  66. data/lib/primary_connect_client/models/demographics.rb +466 -0
  67. data/lib/primary_connect_client/models/device.rb +276 -0
  68. data/lib/primary_connect_client/models/dosage.rb +275 -0
  69. data/lib/primary_connect_client/models/error.rb +218 -0
  70. data/lib/primary_connect_client/models/event.rb +254 -0
  71. data/lib/primary_connect_client/models/events.rb +221 -0
  72. data/lib/primary_connect_client/models/identifier.rb +228 -0
  73. data/lib/primary_connect_client/models/location.rb +264 -0
  74. data/lib/primary_connect_client/models/medication.rb +238 -0
  75. data/lib/primary_connect_client/models/medication_administration.rb +286 -0
  76. data/lib/primary_connect_client/models/meta.rb +327 -0
  77. data/lib/primary_connect_client/models/meta_destinations.rb +242 -0
  78. data/lib/primary_connect_client/models/meta_message.rb +227 -0
  79. data/lib/primary_connect_client/models/meta_source.rb +227 -0
  80. data/lib/primary_connect_client/models/meta_transmission.rb +218 -0
  81. data/lib/primary_connect_client/models/name.rb +237 -0
  82. data/lib/primary_connect_client/models/order.rb +255 -0
  83. data/lib/primary_connect_client/models/order_ids.rb +221 -0
  84. data/lib/primary_connect_client/models/order_order.rb +518 -0
  85. data/lib/primary_connect_client/models/order_order_clinical_info.rb +260 -0
  86. data/lib/primary_connect_client/models/order_order_diagnoses.rb +272 -0
  87. data/lib/primary_connect_client/models/order_order_ordering_facility.rb +239 -0
  88. data/lib/primary_connect_client/models/order_order_specimen.rb +239 -0
  89. data/lib/primary_connect_client/models/order_with_event_errors.rb +229 -0
  90. data/lib/primary_connect_client/models/orders.rb +221 -0
  91. data/lib/primary_connect_client/models/orders_orders.rb +236 -0
  92. data/lib/primary_connect_client/models/patient.rb +253 -0
  93. data/lib/primary_connect_client/models/patient_contacts.rb +305 -0
  94. data/lib/primary_connect_client/models/patient_demographics.rb +466 -0
  95. data/lib/primary_connect_client/models/phone_number.rb +262 -0
  96. data/lib/primary_connect_client/models/provider.rb +288 -0
  97. data/lib/primary_connect_client/models/result.rb +443 -0
  98. data/lib/primary_connect_client/models/result_ids.rb +221 -0
  99. data/lib/primary_connect_client/models/result_reference_range.rb +240 -0
  100. data/lib/primary_connect_client/models/result_report.rb +240 -0
  101. data/lib/primary_connect_client/models/result_specimen.rb +239 -0
  102. data/lib/primary_connect_client/models/results.rb +230 -0
  103. data/lib/primary_connect_client/models/specimen.rb +239 -0
  104. data/lib/primary_connect_client/models/subject.rb +105 -0
  105. data/lib/primary_connect_client/models/subject_one_of.rb +218 -0
  106. data/lib/primary_connect_client/models/subject_one_of1.rb +218 -0
  107. data/lib/primary_connect_client/models/v2_device.rb +276 -0
  108. data/lib/primary_connect_client/models/v2_dosage.rb +275 -0
  109. data/lib/primary_connect_client/models/v2_medication.rb +238 -0
  110. data/lib/primary_connect_client/models/v2_medication_administration.rb +286 -0
  111. data/lib/primary_connect_client/models/visit.rb +306 -0
  112. data/lib/primary_connect_client/models/visit_company.rb +248 -0
  113. data/lib/primary_connect_client/models/visit_guarantor.rb +358 -0
  114. data/lib/primary_connect_client/models/visit_guarantor_employer.rb +238 -0
  115. data/lib/primary_connect_client/models/visit_insurances.rb +386 -0
  116. data/lib/primary_connect_client/models/visit_insured.rb +322 -0
  117. data/lib/primary_connect_client/models/visit_plan.rb +238 -0
  118. data/lib/primary_connect_client/version.rb +12 -2
  119. data/lib/primary_connect_client.rb +56 -3
  120. data/primary_connect_client.gemspec +8 -5
  121. data/spec/api/default_api_spec.rb +56 -41
  122. data/spec/api_client_spec.rb +3 -3
  123. data/spec/configuration_spec.rb +1 -1
  124. data/spec/models/address_spec.rb +76 -0
  125. data/spec/models/coded_value_spec.rb +46 -0
  126. data/spec/models/demographics_spec.rb +168 -0
  127. data/spec/models/device_spec.rb +70 -0
  128. data/spec/models/dosage_spec.rb +70 -0
  129. data/spec/models/error_spec.rb +34 -0
  130. data/spec/models/event_spec.rb +58 -0
  131. data/spec/models/events_spec.rb +34 -0
  132. data/spec/models/identifier_spec.rb +40 -0
  133. data/spec/models/location_spec.rb +64 -0
  134. data/spec/models/medication_administration_spec.rb +76 -0
  135. data/spec/models/medication_spec.rb +46 -0
  136. data/spec/models/meta_destinations_spec.rb +46 -0
  137. data/spec/models/meta_message_spec.rb +40 -0
  138. data/spec/models/meta_source_spec.rb +40 -0
  139. data/spec/models/meta_spec.rb +86 -0
  140. data/spec/models/meta_transmission_spec.rb +34 -0
  141. data/spec/models/name_spec.rb +46 -0
  142. data/spec/models/order_ids_spec.rb +34 -0
  143. data/spec/models/order_order_clinical_info_spec.rb +58 -0
  144. data/spec/models/order_order_diagnoses_spec.rb +50 -0
  145. data/spec/models/order_order_ordering_facility_spec.rb +46 -0
  146. data/spec/models/order_order_spec.rb +182 -0
  147. data/spec/models/order_order_specimen_spec.rb +46 -0
  148. data/spec/models/order_spec.rb +58 -0
  149. data/spec/models/order_with_event_errors_spec.rb +40 -0
  150. data/spec/models/orders_orders_spec.rb +46 -0
  151. data/spec/models/orders_spec.rb +34 -0
  152. data/spec/models/patient_contacts_spec.rb +68 -0
  153. data/spec/models/patient_demographics_spec.rb +168 -0
  154. data/spec/models/patient_spec.rb +52 -0
  155. data/spec/models/phone_number_spec.rb +44 -0
  156. data/spec/models/provider_spec.rb +76 -0
  157. data/spec/models/result_ids_spec.rb +34 -0
  158. data/spec/models/result_reference_range_spec.rb +46 -0
  159. data/spec/models/result_report_spec.rb +46 -0
  160. data/spec/models/result_spec.rb +148 -0
  161. data/spec/models/result_specimen_spec.rb +46 -0
  162. data/spec/models/results_spec.rb +40 -0
  163. data/spec/models/specimen_spec.rb +46 -0
  164. data/spec/models/subject_one_of1_spec.rb +34 -0
  165. data/spec/models/subject_one_of_spec.rb +34 -0
  166. data/spec/models/subject_spec.rb +31 -0
  167. data/spec/models/v2_device_spec.rb +70 -0
  168. data/spec/models/v2_dosage_spec.rb +70 -0
  169. data/spec/models/v2_medication_administration_spec.rb +76 -0
  170. data/spec/models/v2_medication_spec.rb +46 -0
  171. data/spec/models/visit_company_spec.rb +52 -0
  172. data/spec/models/visit_guarantor_employer_spec.rb +46 -0
  173. data/spec/models/visit_guarantor_spec.rb +104 -0
  174. data/spec/models/visit_insurances_spec.rb +112 -0
  175. data/spec/models/visit_insured_spec.rb +78 -0
  176. data/spec/models/visit_plan_spec.rb +46 -0
  177. data/spec/models/visit_spec.rb +88 -0
  178. data/spec/spec_helper.rb +1 -1
  179. metadata +228 -7
  180. data/Gemfile.lock +0 -74
@@ -0,0 +1,518 @@
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 OrderOrder
18
+ # ID of the order assigned by the placing system
19
+ attr_accessor :id
20
+
21
+ # ID assigned by the application fulfilling the order
22
+ attr_accessor :application_order_id
23
+
24
+ # The status of an order.
25
+ attr_accessor :status
26
+
27
+ # Timestamp when the order was placed
28
+ attr_accessor :transaction_date_time
29
+
30
+ # Timestamp when the specimen was collected
31
+ attr_accessor :collection_date_time
32
+
33
+ # Timestamp when the specimen was collected
34
+ attr_accessor :collection_start_date_time
35
+
36
+ # Timestamp when the results were composed into a report and released.
37
+ attr_accessor :completion_date_time
38
+
39
+ # YYYY-MM-DD, Date when the order becomes invalid
40
+ attr_accessor :expiration_date
41
+
42
+ attr_accessor :specimen
43
+
44
+ # Array of medications administered to the subject
45
+ attr_accessor :medication_administrations
46
+
47
+ attr_accessor :procedure
48
+
49
+ attr_accessor :ordering_provider
50
+
51
+ # Array of providers to be copied on the results
52
+ attr_accessor :result_copy_providers
53
+
54
+ attr_accessor :ordering_facility
55
+
56
+ # Priority of the order
57
+ attr_accessor :priority
58
+
59
+ # List of diagnoses associated with this order
60
+ attr_accessor :diagnoses
61
+
62
+ # Clinically relevant comments regarding the order
63
+ attr_accessor :clinical_comments
64
+
65
+ # Order-level notes
66
+ attr_accessor :notes
67
+
68
+ # List of supplementary clinical information associated with the order. Often these are answers to Ask at Order Entry (AOE) questions.
69
+ attr_accessor :clinical_info
70
+
71
+ # Current overall status of the order
72
+ attr_accessor :results_status
73
+
74
+ # Specificity of the response requested from the receiving system
75
+ attr_accessor :response_flag
76
+
77
+ attr_accessor :external_ids
78
+
79
+ # List of result components
80
+ attr_accessor :results
81
+
82
+ class EnumAttributeValidator
83
+ attr_reader :datatype
84
+ attr_reader :allowable_values
85
+
86
+ def initialize(datatype, allowable_values)
87
+ @allowable_values = allowable_values.map do |value|
88
+ case datatype.to_s
89
+ when /Integer/i
90
+ value.to_i
91
+ when /Float/i
92
+ value.to_f
93
+ else
94
+ value
95
+ end
96
+ end
97
+ end
98
+
99
+ def valid?(value)
100
+ !value || allowable_values.include?(value)
101
+ end
102
+ end
103
+
104
+ # Attribute mapping from ruby-style variable name to JSON key.
105
+ def self.attribute_map
106
+ {
107
+ :'id' => :'id',
108
+ :'application_order_id' => :'applicationOrderId',
109
+ :'status' => :'status',
110
+ :'transaction_date_time' => :'transactionDateTime',
111
+ :'collection_date_time' => :'collectionDateTime',
112
+ :'collection_start_date_time' => :'collectionStartDateTime',
113
+ :'completion_date_time' => :'completionDateTime',
114
+ :'expiration_date' => :'expirationDate',
115
+ :'specimen' => :'specimen',
116
+ :'medication_administrations' => :'medicationAdministrations',
117
+ :'procedure' => :'procedure',
118
+ :'ordering_provider' => :'orderingProvider',
119
+ :'result_copy_providers' => :'resultCopyProviders',
120
+ :'ordering_facility' => :'orderingFacility',
121
+ :'priority' => :'priority',
122
+ :'diagnoses' => :'diagnoses',
123
+ :'clinical_comments' => :'clinicalComments',
124
+ :'notes' => :'notes',
125
+ :'clinical_info' => :'clinicalInfo',
126
+ :'results_status' => :'resultsStatus',
127
+ :'response_flag' => :'responseFlag',
128
+ :'external_ids' => :'externalIds',
129
+ :'results' => :'results'
130
+ }
131
+ end
132
+
133
+ # Returns all the JSON keys this model knows about
134
+ def self.acceptable_attributes
135
+ attribute_map.values
136
+ end
137
+
138
+ # Attribute type mapping.
139
+ def self.openapi_types
140
+ {
141
+ :'id' => :'String',
142
+ :'application_order_id' => :'String',
143
+ :'status' => :'String',
144
+ :'transaction_date_time' => :'Time',
145
+ :'collection_date_time' => :'Time',
146
+ :'collection_start_date_time' => :'Time',
147
+ :'completion_date_time' => :'Time',
148
+ :'expiration_date' => :'String',
149
+ :'specimen' => :'Specimen',
150
+ :'medication_administrations' => :'Array<MedicationAdministration>',
151
+ :'procedure' => :'CodedValue',
152
+ :'ordering_provider' => :'Provider',
153
+ :'result_copy_providers' => :'Array<Provider>',
154
+ :'ordering_facility' => :'OrderOrderOrderingFacility',
155
+ :'priority' => :'String',
156
+ :'diagnoses' => :'Array<OrderOrderDiagnoses>',
157
+ :'clinical_comments' => :'String',
158
+ :'notes' => :'Array<String>',
159
+ :'clinical_info' => :'Array<OrderOrderClinicalInfo>',
160
+ :'results_status' => :'String',
161
+ :'response_flag' => :'String',
162
+ :'external_ids' => :'Array<Identifier>',
163
+ :'results' => :'Array<Result>'
164
+ }
165
+ end
166
+
167
+ # List of attributes with nullable: true
168
+ def self.openapi_nullable
169
+ Set.new([
170
+ ])
171
+ end
172
+
173
+ # Initializes the object
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ def initialize(attributes = {})
176
+ if (!attributes.is_a?(Hash))
177
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::OrderOrder` initialize method"
178
+ end
179
+
180
+ # check to see if the attribute exists and convert string to symbol for hash key
181
+ attributes = attributes.each_with_object({}) { |(k, v), h|
182
+ if (!self.class.attribute_map.key?(k.to_sym))
183
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::OrderOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
184
+ end
185
+ h[k.to_sym] = v
186
+ }
187
+
188
+ if attributes.key?(:'id')
189
+ self.id = attributes[:'id']
190
+ end
191
+
192
+ if attributes.key?(:'application_order_id')
193
+ self.application_order_id = attributes[:'application_order_id']
194
+ end
195
+
196
+ if attributes.key?(:'status')
197
+ self.status = attributes[:'status']
198
+ end
199
+
200
+ if attributes.key?(:'transaction_date_time')
201
+ self.transaction_date_time = attributes[:'transaction_date_time']
202
+ end
203
+
204
+ if attributes.key?(:'collection_date_time')
205
+ self.collection_date_time = attributes[:'collection_date_time']
206
+ end
207
+
208
+ if attributes.key?(:'collection_start_date_time')
209
+ self.collection_start_date_time = attributes[:'collection_start_date_time']
210
+ end
211
+
212
+ if attributes.key?(:'completion_date_time')
213
+ self.completion_date_time = attributes[:'completion_date_time']
214
+ end
215
+
216
+ if attributes.key?(:'expiration_date')
217
+ self.expiration_date = attributes[:'expiration_date']
218
+ end
219
+
220
+ if attributes.key?(:'specimen')
221
+ self.specimen = attributes[:'specimen']
222
+ end
223
+
224
+ if attributes.key?(:'medication_administrations')
225
+ if (value = attributes[:'medication_administrations']).is_a?(Array)
226
+ self.medication_administrations = value
227
+ end
228
+ end
229
+
230
+ if attributes.key?(:'procedure')
231
+ self.procedure = attributes[:'procedure']
232
+ end
233
+
234
+ if attributes.key?(:'ordering_provider')
235
+ self.ordering_provider = attributes[:'ordering_provider']
236
+ end
237
+
238
+ if attributes.key?(:'result_copy_providers')
239
+ if (value = attributes[:'result_copy_providers']).is_a?(Array)
240
+ self.result_copy_providers = value
241
+ end
242
+ end
243
+
244
+ if attributes.key?(:'ordering_facility')
245
+ self.ordering_facility = attributes[:'ordering_facility']
246
+ end
247
+
248
+ if attributes.key?(:'priority')
249
+ self.priority = attributes[:'priority']
250
+ end
251
+
252
+ if attributes.key?(:'diagnoses')
253
+ if (value = attributes[:'diagnoses']).is_a?(Array)
254
+ self.diagnoses = value
255
+ end
256
+ end
257
+
258
+ if attributes.key?(:'clinical_comments')
259
+ self.clinical_comments = attributes[:'clinical_comments']
260
+ end
261
+
262
+ if attributes.key?(:'notes')
263
+ if (value = attributes[:'notes']).is_a?(Array)
264
+ self.notes = value
265
+ end
266
+ end
267
+
268
+ if attributes.key?(:'clinical_info')
269
+ if (value = attributes[:'clinical_info']).is_a?(Array)
270
+ self.clinical_info = value
271
+ end
272
+ end
273
+
274
+ if attributes.key?(:'results_status')
275
+ self.results_status = attributes[:'results_status']
276
+ end
277
+
278
+ if attributes.key?(:'response_flag')
279
+ self.response_flag = attributes[:'response_flag']
280
+ end
281
+
282
+ if attributes.key?(:'external_ids')
283
+ if (value = attributes[:'external_ids']).is_a?(Array)
284
+ self.external_ids = value
285
+ end
286
+ end
287
+
288
+ if attributes.key?(:'results')
289
+ if (value = attributes[:'results']).is_a?(Array)
290
+ self.results = value
291
+ end
292
+ end
293
+ end
294
+
295
+ # Show invalid properties with the reasons. Usually used together with valid?
296
+ # @return Array for valid properties with the reasons
297
+ def list_invalid_properties
298
+ invalid_properties = Array.new
299
+ invalid_properties
300
+ end
301
+
302
+ # Check to see if the all the properties in the model are valid
303
+ # @return true if the model is valid
304
+ def valid?
305
+ status_validator = EnumAttributeValidator.new('String', ["STATUS_UNKNOWN", "STATUS_UPDATE", "STATUS_CANCEL", "STATUS_RESULTED", "STATUS_NEW", "STATUS_REPORTED"])
306
+ return false unless status_validator.valid?(@status)
307
+ priority_validator = EnumAttributeValidator.new('String', ["PRIORITY_UNKNOWN", "PRIORITY_ASAP", "PRIORITY_ROUTINE", "PRIORITY_PREOPERATIVE", "PRIORITY_TIMING_CRITICAL", "PRIORITY_STAT"])
308
+ return false unless priority_validator.valid?(@priority)
309
+ results_status_validator = EnumAttributeValidator.new('String', ["UNAVAILABLE", "PRELIMINARY", "IN_PROCESS", "CORRECTED", "CANCELED", "FINAL"])
310
+ return false unless results_status_validator.valid?(@results_status)
311
+ response_flag_validator = EnumAttributeValidator.new('String', ["UNKNOWN", "EXCEPTIONS", "REPLACEMENTS", "ASSOCIATED_SEGMENTS", "CONFIRMATIONS", "ACKNOWLEDGEMENT"])
312
+ return false unless response_flag_validator.valid?(@response_flag)
313
+ true
314
+ end
315
+
316
+ # Custom attribute writer method checking allowed values (enum).
317
+ # @param [Object] status Object to be assigned
318
+ def status=(status)
319
+ validator = EnumAttributeValidator.new('String', ["STATUS_UNKNOWN", "STATUS_UPDATE", "STATUS_CANCEL", "STATUS_RESULTED", "STATUS_NEW", "STATUS_REPORTED"])
320
+ unless validator.valid?(status)
321
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
322
+ end
323
+ @status = status
324
+ end
325
+
326
+ # Custom attribute writer method checking allowed values (enum).
327
+ # @param [Object] priority Object to be assigned
328
+ def priority=(priority)
329
+ validator = EnumAttributeValidator.new('String', ["PRIORITY_UNKNOWN", "PRIORITY_ASAP", "PRIORITY_ROUTINE", "PRIORITY_PREOPERATIVE", "PRIORITY_TIMING_CRITICAL", "PRIORITY_STAT"])
330
+ unless validator.valid?(priority)
331
+ fail ArgumentError, "invalid value for \"priority\", must be one of #{validator.allowable_values}."
332
+ end
333
+ @priority = priority
334
+ end
335
+
336
+ # Custom attribute writer method checking allowed values (enum).
337
+ # @param [Object] results_status Object to be assigned
338
+ def results_status=(results_status)
339
+ validator = EnumAttributeValidator.new('String', ["UNAVAILABLE", "PRELIMINARY", "IN_PROCESS", "CORRECTED", "CANCELED", "FINAL"])
340
+ unless validator.valid?(results_status)
341
+ fail ArgumentError, "invalid value for \"results_status\", must be one of #{validator.allowable_values}."
342
+ end
343
+ @results_status = results_status
344
+ end
345
+
346
+ # Custom attribute writer method checking allowed values (enum).
347
+ # @param [Object] response_flag Object to be assigned
348
+ def response_flag=(response_flag)
349
+ validator = EnumAttributeValidator.new('String', ["UNKNOWN", "EXCEPTIONS", "REPLACEMENTS", "ASSOCIATED_SEGMENTS", "CONFIRMATIONS", "ACKNOWLEDGEMENT"])
350
+ unless validator.valid?(response_flag)
351
+ fail ArgumentError, "invalid value for \"response_flag\", must be one of #{validator.allowable_values}."
352
+ end
353
+ @response_flag = response_flag
354
+ end
355
+
356
+ # Checks equality by comparing each attribute.
357
+ # @param [Object] Object to be compared
358
+ def ==(o)
359
+ return true if self.equal?(o)
360
+ self.class == o.class &&
361
+ id == o.id &&
362
+ application_order_id == o.application_order_id &&
363
+ status == o.status &&
364
+ transaction_date_time == o.transaction_date_time &&
365
+ collection_date_time == o.collection_date_time &&
366
+ collection_start_date_time == o.collection_start_date_time &&
367
+ completion_date_time == o.completion_date_time &&
368
+ expiration_date == o.expiration_date &&
369
+ specimen == o.specimen &&
370
+ medication_administrations == o.medication_administrations &&
371
+ procedure == o.procedure &&
372
+ ordering_provider == o.ordering_provider &&
373
+ result_copy_providers == o.result_copy_providers &&
374
+ ordering_facility == o.ordering_facility &&
375
+ priority == o.priority &&
376
+ diagnoses == o.diagnoses &&
377
+ clinical_comments == o.clinical_comments &&
378
+ notes == o.notes &&
379
+ clinical_info == o.clinical_info &&
380
+ results_status == o.results_status &&
381
+ response_flag == o.response_flag &&
382
+ external_ids == o.external_ids &&
383
+ results == o.results
384
+ end
385
+
386
+ # @see the `==` method
387
+ # @param [Object] Object to be compared
388
+ def eql?(o)
389
+ self == o
390
+ end
391
+
392
+ # Calculates hash code according to all attributes.
393
+ # @return [Integer] Hash code
394
+ def hash
395
+ [id, application_order_id, status, transaction_date_time, collection_date_time, collection_start_date_time, completion_date_time, expiration_date, specimen, medication_administrations, procedure, ordering_provider, result_copy_providers, ordering_facility, priority, diagnoses, clinical_comments, notes, clinical_info, results_status, response_flag, external_ids, results].hash
396
+ end
397
+
398
+ # Builds the object from hash
399
+ # @param [Hash] attributes Model attributes in the form of hash
400
+ # @return [Object] Returns the model itself
401
+ def self.build_from_hash(attributes)
402
+ new.build_from_hash(attributes)
403
+ end
404
+
405
+ # Builds the object from hash
406
+ # @param [Hash] attributes Model attributes in the form of hash
407
+ # @return [Object] Returns the model itself
408
+ def build_from_hash(attributes)
409
+ return nil unless attributes.is_a?(Hash)
410
+ self.class.openapi_types.each_pair do |key, type|
411
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
412
+ self.send("#{key}=", nil)
413
+ elsif type =~ /\AArray<(.*)>/i
414
+ # check to ensure the input is an array given that the attribute
415
+ # is documented as an array but the input is not
416
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
417
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
418
+ end
419
+ elsif !attributes[self.class.attribute_map[key]].nil?
420
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
421
+ end
422
+ end
423
+
424
+ self
425
+ end
426
+
427
+ # Deserializes the data based on type
428
+ # @param string type Data type
429
+ # @param string value Value to be deserialized
430
+ # @return [Object] Deserialized data
431
+ def _deserialize(type, value)
432
+ case type.to_sym
433
+ when :Time
434
+ Time.parse(value)
435
+ when :Date
436
+ Date.parse(value)
437
+ when :String
438
+ value.to_s
439
+ when :Integer
440
+ value.to_i
441
+ when :Float
442
+ value.to_f
443
+ when :Boolean
444
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
445
+ true
446
+ else
447
+ false
448
+ end
449
+ when :Object
450
+ # generic object (usually a Hash), return directly
451
+ value
452
+ when /\AArray<(?<inner_type>.+)>\z/
453
+ inner_type = Regexp.last_match[:inner_type]
454
+ value.map { |v| _deserialize(inner_type, v) }
455
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
456
+ k_type = Regexp.last_match[:k_type]
457
+ v_type = Regexp.last_match[:v_type]
458
+ {}.tap do |hash|
459
+ value.each do |k, v|
460
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
461
+ end
462
+ end
463
+ else # model
464
+ # models (e.g. Pet) or oneOf
465
+ klass = PrimaryConnectClient.const_get(type)
466
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
467
+ end
468
+ end
469
+
470
+ # Returns the string representation of the object
471
+ # @return [String] String presentation of the object
472
+ def to_s
473
+ to_hash.to_s
474
+ end
475
+
476
+ # to_body is an alias to to_hash (backward compatibility)
477
+ # @return [Hash] Returns the object in the form of hash
478
+ def to_body
479
+ to_hash
480
+ end
481
+
482
+ # Returns the object in the form of hash
483
+ # @return [Hash] Returns the object in the form of hash
484
+ def to_hash
485
+ hash = {}
486
+ self.class.attribute_map.each_pair do |attr, param|
487
+ value = self.send(attr)
488
+ if value.nil?
489
+ is_nullable = self.class.openapi_nullable.include?(attr)
490
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
491
+ end
492
+
493
+ hash[param] = _to_hash(value)
494
+ end
495
+ hash
496
+ end
497
+
498
+ # Outputs non-array value in the form of hash
499
+ # For object, use to_hash. Otherwise, just return the value
500
+ # @param [Object] value Any valid value
501
+ # @return [Hash] Returns the value in the form of hash
502
+ def _to_hash(value)
503
+ if value.is_a?(Array)
504
+ value.compact.map { |v| _to_hash(v) }
505
+ elsif value.is_a?(Hash)
506
+ {}.tap do |hash|
507
+ value.each { |k, v| hash[k] = _to_hash(v) }
508
+ end
509
+ elsif value.respond_to? :to_hash
510
+ value.to_hash
511
+ else
512
+ value
513
+ end
514
+ end
515
+
516
+ end
517
+
518
+ end