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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/README.md +74 -20
- data/docs/Address.md +32 -0
- data/docs/CodedValue.md +22 -0
- data/docs/DefaultApi.md +637 -0
- data/docs/Demographics.md +52 -0
- data/docs/Device.md +30 -0
- data/docs/Dosage.md +30 -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 +28 -0
- data/docs/Medication.md +22 -0
- data/docs/MedicationAdministration.md +32 -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 +26 -0
- data/docs/OrderIds.md +18 -0
- data/docs/OrderOrder.md +62 -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/Subject.md +49 -0
- data/docs/SubjectOneOf.md +18 -0
- data/docs/SubjectOneOf1.md +18 -0
- data/docs/V2Device.md +30 -0
- data/docs/V2Dosage.md +30 -0
- data/docs/V2Medication.md +22 -0
- data/docs/V2MedicationAdministration.md +32 -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 +207 -67
- 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 +3 -2
- 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/device.rb +276 -0
- data/lib/primary_connect_client/models/dosage.rb +275 -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 +264 -0
- data/lib/primary_connect_client/models/medication.rb +238 -0
- data/lib/primary_connect_client/models/medication_administration.rb +286 -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 +255 -0
- data/lib/primary_connect_client/models/order_ids.rb +221 -0
- data/lib/primary_connect_client/models/order_order.rb +518 -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/subject.rb +105 -0
- data/lib/primary_connect_client/models/subject_one_of.rb +218 -0
- data/lib/primary_connect_client/models/subject_one_of1.rb +218 -0
- data/lib/primary_connect_client/models/v2_device.rb +276 -0
- data/lib/primary_connect_client/models/v2_dosage.rb +275 -0
- data/lib/primary_connect_client/models/v2_medication.rb +238 -0
- data/lib/primary_connect_client/models/v2_medication_administration.rb +286 -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 +56 -3
- data/primary_connect_client.gemspec +8 -5
- data/spec/api/default_api_spec.rb +56 -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/device_spec.rb +70 -0
- data/spec/models/dosage_spec.rb +70 -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 +64 -0
- data/spec/models/medication_administration_spec.rb +76 -0
- data/spec/models/medication_spec.rb +46 -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 +182 -0
- data/spec/models/order_order_specimen_spec.rb +46 -0
- data/spec/models/order_spec.rb +58 -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/subject_one_of1_spec.rb +34 -0
- data/spec/models/subject_one_of_spec.rb +34 -0
- data/spec/models/subject_spec.rb +31 -0
- data/spec/models/v2_device_spec.rb +70 -0
- data/spec/models/v2_dosage_spec.rb +70 -0
- data/spec/models/v2_medication_administration_spec.rb +76 -0
- data/spec/models/v2_medication_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 +228 -7
- data/Gemfile.lock +0 -74
@@ -0,0 +1,286 @@
|
|
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 V2MedicationAdministration
|
18
|
+
attr_accessor :identifier
|
19
|
+
|
20
|
+
# Codes for the medication administration
|
21
|
+
attr_accessor :administration_codes
|
22
|
+
|
23
|
+
# Administration start date of medication
|
24
|
+
attr_accessor :administration_start_time
|
25
|
+
|
26
|
+
# Administration end date of medication
|
27
|
+
attr_accessor :administration_end_time
|
28
|
+
|
29
|
+
attr_accessor :medication
|
30
|
+
|
31
|
+
attr_accessor :dosage
|
32
|
+
|
33
|
+
attr_accessor :refusal_reason
|
34
|
+
|
35
|
+
attr_accessor :administering_provider
|
36
|
+
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
+
def self.attribute_map
|
39
|
+
{
|
40
|
+
:'identifier' => :'identifier',
|
41
|
+
:'administration_codes' => :'administration_codes',
|
42
|
+
:'administration_start_time' => :'administration_start_time',
|
43
|
+
:'administration_end_time' => :'administration_end_time',
|
44
|
+
:'medication' => :'medication',
|
45
|
+
:'dosage' => :'dosage',
|
46
|
+
:'refusal_reason' => :'refusal_reason',
|
47
|
+
:'administering_provider' => :'administering_provider'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Returns all the JSON keys this model knows about
|
52
|
+
def self.acceptable_attributes
|
53
|
+
attribute_map.values
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute type mapping.
|
57
|
+
def self.openapi_types
|
58
|
+
{
|
59
|
+
:'identifier' => :'Identifier',
|
60
|
+
:'administration_codes' => :'Array<CodedValue>',
|
61
|
+
:'administration_start_time' => :'Time',
|
62
|
+
:'administration_end_time' => :'Time',
|
63
|
+
:'medication' => :'Medication',
|
64
|
+
:'dosage' => :'Dosage',
|
65
|
+
:'refusal_reason' => :'CodedValue',
|
66
|
+
:'administering_provider' => :'Provider'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# List of attributes with nullable: true
|
71
|
+
def self.openapi_nullable
|
72
|
+
Set.new([
|
73
|
+
])
|
74
|
+
end
|
75
|
+
|
76
|
+
# Initializes the object
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
78
|
+
def initialize(attributes = {})
|
79
|
+
if (!attributes.is_a?(Hash))
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::V2MedicationAdministration` initialize method"
|
81
|
+
end
|
82
|
+
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
84
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
85
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::V2MedicationAdministration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
|
+
end
|
88
|
+
h[k.to_sym] = v
|
89
|
+
}
|
90
|
+
|
91
|
+
if attributes.key?(:'identifier')
|
92
|
+
self.identifier = attributes[:'identifier']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'administration_codes')
|
96
|
+
if (value = attributes[:'administration_codes']).is_a?(Array)
|
97
|
+
self.administration_codes = value
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'administration_start_time')
|
102
|
+
self.administration_start_time = attributes[:'administration_start_time']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'administration_end_time')
|
106
|
+
self.administration_end_time = attributes[:'administration_end_time']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'medication')
|
110
|
+
self.medication = attributes[:'medication']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'dosage')
|
114
|
+
self.dosage = attributes[:'dosage']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'refusal_reason')
|
118
|
+
self.refusal_reason = attributes[:'refusal_reason']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'administering_provider')
|
122
|
+
self.administering_provider = attributes[:'administering_provider']
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
127
|
+
# @return Array for valid properties with the reasons
|
128
|
+
def list_invalid_properties
|
129
|
+
invalid_properties = Array.new
|
130
|
+
invalid_properties
|
131
|
+
end
|
132
|
+
|
133
|
+
# Check to see if the all the properties in the model are valid
|
134
|
+
# @return true if the model is valid
|
135
|
+
def valid?
|
136
|
+
true
|
137
|
+
end
|
138
|
+
|
139
|
+
# Checks equality by comparing each attribute.
|
140
|
+
# @param [Object] Object to be compared
|
141
|
+
def ==(o)
|
142
|
+
return true if self.equal?(o)
|
143
|
+
self.class == o.class &&
|
144
|
+
identifier == o.identifier &&
|
145
|
+
administration_codes == o.administration_codes &&
|
146
|
+
administration_start_time == o.administration_start_time &&
|
147
|
+
administration_end_time == o.administration_end_time &&
|
148
|
+
medication == o.medication &&
|
149
|
+
dosage == o.dosage &&
|
150
|
+
refusal_reason == o.refusal_reason &&
|
151
|
+
administering_provider == o.administering_provider
|
152
|
+
end
|
153
|
+
|
154
|
+
# @see the `==` method
|
155
|
+
# @param [Object] Object to be compared
|
156
|
+
def eql?(o)
|
157
|
+
self == o
|
158
|
+
end
|
159
|
+
|
160
|
+
# Calculates hash code according to all attributes.
|
161
|
+
# @return [Integer] Hash code
|
162
|
+
def hash
|
163
|
+
[identifier, administration_codes, administration_start_time, administration_end_time, medication, dosage, refusal_reason, administering_provider].hash
|
164
|
+
end
|
165
|
+
|
166
|
+
# Builds the object from hash
|
167
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
168
|
+
# @return [Object] Returns the model itself
|
169
|
+
def self.build_from_hash(attributes)
|
170
|
+
new.build_from_hash(attributes)
|
171
|
+
end
|
172
|
+
|
173
|
+
# Builds the object from hash
|
174
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
175
|
+
# @return [Object] Returns the model itself
|
176
|
+
def build_from_hash(attributes)
|
177
|
+
return nil unless attributes.is_a?(Hash)
|
178
|
+
self.class.openapi_types.each_pair do |key, type|
|
179
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
180
|
+
self.send("#{key}=", nil)
|
181
|
+
elsif type =~ /\AArray<(.*)>/i
|
182
|
+
# check to ensure the input is an array given that the attribute
|
183
|
+
# is documented as an array but the input is not
|
184
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
185
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
186
|
+
end
|
187
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
188
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
self
|
193
|
+
end
|
194
|
+
|
195
|
+
# Deserializes the data based on type
|
196
|
+
# @param string type Data type
|
197
|
+
# @param string value Value to be deserialized
|
198
|
+
# @return [Object] Deserialized data
|
199
|
+
def _deserialize(type, value)
|
200
|
+
case type.to_sym
|
201
|
+
when :Time
|
202
|
+
Time.parse(value)
|
203
|
+
when :Date
|
204
|
+
Date.parse(value)
|
205
|
+
when :String
|
206
|
+
value.to_s
|
207
|
+
when :Integer
|
208
|
+
value.to_i
|
209
|
+
when :Float
|
210
|
+
value.to_f
|
211
|
+
when :Boolean
|
212
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
213
|
+
true
|
214
|
+
else
|
215
|
+
false
|
216
|
+
end
|
217
|
+
when :Object
|
218
|
+
# generic object (usually a Hash), return directly
|
219
|
+
value
|
220
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
221
|
+
inner_type = Regexp.last_match[:inner_type]
|
222
|
+
value.map { |v| _deserialize(inner_type, v) }
|
223
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
224
|
+
k_type = Regexp.last_match[:k_type]
|
225
|
+
v_type = Regexp.last_match[:v_type]
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each do |k, v|
|
228
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
else # model
|
232
|
+
# models (e.g. Pet) or oneOf
|
233
|
+
klass = PrimaryConnectClient.const_get(type)
|
234
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
# Returns the string representation of the object
|
239
|
+
# @return [String] String presentation of the object
|
240
|
+
def to_s
|
241
|
+
to_hash.to_s
|
242
|
+
end
|
243
|
+
|
244
|
+
# to_body is an alias to to_hash (backward compatibility)
|
245
|
+
# @return [Hash] Returns the object in the form of hash
|
246
|
+
def to_body
|
247
|
+
to_hash
|
248
|
+
end
|
249
|
+
|
250
|
+
# Returns the object in the form of hash
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
252
|
+
def to_hash
|
253
|
+
hash = {}
|
254
|
+
self.class.attribute_map.each_pair do |attr, param|
|
255
|
+
value = self.send(attr)
|
256
|
+
if value.nil?
|
257
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
258
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
259
|
+
end
|
260
|
+
|
261
|
+
hash[param] = _to_hash(value)
|
262
|
+
end
|
263
|
+
hash
|
264
|
+
end
|
265
|
+
|
266
|
+
# Outputs non-array value in the form of hash
|
267
|
+
# For object, use to_hash. Otherwise, just return the value
|
268
|
+
# @param [Object] value Any valid value
|
269
|
+
# @return [Hash] Returns the value in the form of hash
|
270
|
+
def _to_hash(value)
|
271
|
+
if value.is_a?(Array)
|
272
|
+
value.compact.map { |v| _to_hash(v) }
|
273
|
+
elsif value.is_a?(Hash)
|
274
|
+
{}.tap do |hash|
|
275
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
276
|
+
end
|
277
|
+
elsif value.respond_to? :to_hash
|
278
|
+
value.to_hash
|
279
|
+
else
|
280
|
+
value
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
end
|
285
|
+
|
286
|
+
end
|
@@ -0,0 +1,306 @@
|
|
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 Visit
|
18
|
+
# Unique ID of a single visit
|
19
|
+
attr_accessor :visit_number
|
20
|
+
|
21
|
+
# An ID that can span several visits often related to the same issue - pregnancy, surgeries, research study, etc.
|
22
|
+
attr_accessor :account_number
|
23
|
+
|
24
|
+
# Patient class is used in many EHRs to determine where to put the patient. E.g. Inpatient, Outpatient, Emergency
|
25
|
+
attr_accessor :patient_class
|
26
|
+
|
27
|
+
# Timestamp of visit or the arrival time of the visit or admission.
|
28
|
+
attr_accessor :visit_date_time
|
29
|
+
|
30
|
+
attr_accessor :attending_provider
|
31
|
+
|
32
|
+
attr_accessor :consulting_provider
|
33
|
+
|
34
|
+
attr_accessor :referring_provider
|
35
|
+
|
36
|
+
attr_accessor :guarantor
|
37
|
+
|
38
|
+
# List of insurance coverages for the patient
|
39
|
+
attr_accessor :insurances
|
40
|
+
|
41
|
+
attr_accessor :location
|
42
|
+
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
44
|
+
def self.attribute_map
|
45
|
+
{
|
46
|
+
:'visit_number' => :'visitNumber',
|
47
|
+
:'account_number' => :'accountNumber',
|
48
|
+
:'patient_class' => :'patientClass',
|
49
|
+
:'visit_date_time' => :'visitDateTime',
|
50
|
+
:'attending_provider' => :'attendingProvider',
|
51
|
+
:'consulting_provider' => :'consultingProvider',
|
52
|
+
:'referring_provider' => :'referringProvider',
|
53
|
+
:'guarantor' => :'guarantor',
|
54
|
+
:'insurances' => :'insurances',
|
55
|
+
:'location' => :'location'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Returns all the JSON keys this model knows about
|
60
|
+
def self.acceptable_attributes
|
61
|
+
attribute_map.values
|
62
|
+
end
|
63
|
+
|
64
|
+
# Attribute type mapping.
|
65
|
+
def self.openapi_types
|
66
|
+
{
|
67
|
+
:'visit_number' => :'String',
|
68
|
+
:'account_number' => :'String',
|
69
|
+
:'patient_class' => :'String',
|
70
|
+
:'visit_date_time' => :'Time',
|
71
|
+
:'attending_provider' => :'Provider',
|
72
|
+
:'consulting_provider' => :'Provider',
|
73
|
+
:'referring_provider' => :'Provider',
|
74
|
+
:'guarantor' => :'VisitGuarantor',
|
75
|
+
:'insurances' => :'Array<VisitInsurances>',
|
76
|
+
:'location' => :'Location'
|
77
|
+
}
|
78
|
+
end
|
79
|
+
|
80
|
+
# List of attributes with nullable: true
|
81
|
+
def self.openapi_nullable
|
82
|
+
Set.new([
|
83
|
+
])
|
84
|
+
end
|
85
|
+
|
86
|
+
# Initializes the object
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
def initialize(attributes = {})
|
89
|
+
if (!attributes.is_a?(Hash))
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::Visit` initialize method"
|
91
|
+
end
|
92
|
+
|
93
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
94
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
95
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
96
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::Visit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
97
|
+
end
|
98
|
+
h[k.to_sym] = v
|
99
|
+
}
|
100
|
+
|
101
|
+
if attributes.key?(:'visit_number')
|
102
|
+
self.visit_number = attributes[:'visit_number']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'account_number')
|
106
|
+
self.account_number = attributes[:'account_number']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'patient_class')
|
110
|
+
self.patient_class = attributes[:'patient_class']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'visit_date_time')
|
114
|
+
self.visit_date_time = attributes[:'visit_date_time']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'attending_provider')
|
118
|
+
self.attending_provider = attributes[:'attending_provider']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'consulting_provider')
|
122
|
+
self.consulting_provider = attributes[:'consulting_provider']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'referring_provider')
|
126
|
+
self.referring_provider = attributes[:'referring_provider']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'guarantor')
|
130
|
+
self.guarantor = attributes[:'guarantor']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'insurances')
|
134
|
+
if (value = attributes[:'insurances']).is_a?(Array)
|
135
|
+
self.insurances = value
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'location')
|
140
|
+
self.location = attributes[:'location']
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
145
|
+
# @return Array for valid properties with the reasons
|
146
|
+
def list_invalid_properties
|
147
|
+
invalid_properties = Array.new
|
148
|
+
invalid_properties
|
149
|
+
end
|
150
|
+
|
151
|
+
# Check to see if the all the properties in the model are valid
|
152
|
+
# @return true if the model is valid
|
153
|
+
def valid?
|
154
|
+
true
|
155
|
+
end
|
156
|
+
|
157
|
+
# Checks equality by comparing each attribute.
|
158
|
+
# @param [Object] Object to be compared
|
159
|
+
def ==(o)
|
160
|
+
return true if self.equal?(o)
|
161
|
+
self.class == o.class &&
|
162
|
+
visit_number == o.visit_number &&
|
163
|
+
account_number == o.account_number &&
|
164
|
+
patient_class == o.patient_class &&
|
165
|
+
visit_date_time == o.visit_date_time &&
|
166
|
+
attending_provider == o.attending_provider &&
|
167
|
+
consulting_provider == o.consulting_provider &&
|
168
|
+
referring_provider == o.referring_provider &&
|
169
|
+
guarantor == o.guarantor &&
|
170
|
+
insurances == o.insurances &&
|
171
|
+
location == o.location
|
172
|
+
end
|
173
|
+
|
174
|
+
# @see the `==` method
|
175
|
+
# @param [Object] Object to be compared
|
176
|
+
def eql?(o)
|
177
|
+
self == o
|
178
|
+
end
|
179
|
+
|
180
|
+
# Calculates hash code according to all attributes.
|
181
|
+
# @return [Integer] Hash code
|
182
|
+
def hash
|
183
|
+
[visit_number, account_number, patient_class, visit_date_time, attending_provider, consulting_provider, referring_provider, guarantor, insurances, location].hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Builds the object from hash
|
187
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
188
|
+
# @return [Object] Returns the model itself
|
189
|
+
def self.build_from_hash(attributes)
|
190
|
+
new.build_from_hash(attributes)
|
191
|
+
end
|
192
|
+
|
193
|
+
# Builds the object from hash
|
194
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
195
|
+
# @return [Object] Returns the model itself
|
196
|
+
def build_from_hash(attributes)
|
197
|
+
return nil unless attributes.is_a?(Hash)
|
198
|
+
self.class.openapi_types.each_pair do |key, type|
|
199
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
200
|
+
self.send("#{key}=", nil)
|
201
|
+
elsif type =~ /\AArray<(.*)>/i
|
202
|
+
# check to ensure the input is an array given that the attribute
|
203
|
+
# is documented as an array but the input is not
|
204
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
205
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
206
|
+
end
|
207
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
208
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
self
|
213
|
+
end
|
214
|
+
|
215
|
+
# Deserializes the data based on type
|
216
|
+
# @param string type Data type
|
217
|
+
# @param string value Value to be deserialized
|
218
|
+
# @return [Object] Deserialized data
|
219
|
+
def _deserialize(type, value)
|
220
|
+
case type.to_sym
|
221
|
+
when :Time
|
222
|
+
Time.parse(value)
|
223
|
+
when :Date
|
224
|
+
Date.parse(value)
|
225
|
+
when :String
|
226
|
+
value.to_s
|
227
|
+
when :Integer
|
228
|
+
value.to_i
|
229
|
+
when :Float
|
230
|
+
value.to_f
|
231
|
+
when :Boolean
|
232
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
233
|
+
true
|
234
|
+
else
|
235
|
+
false
|
236
|
+
end
|
237
|
+
when :Object
|
238
|
+
# generic object (usually a Hash), return directly
|
239
|
+
value
|
240
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
241
|
+
inner_type = Regexp.last_match[:inner_type]
|
242
|
+
value.map { |v| _deserialize(inner_type, v) }
|
243
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
244
|
+
k_type = Regexp.last_match[:k_type]
|
245
|
+
v_type = Regexp.last_match[:v_type]
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each do |k, v|
|
248
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
else # model
|
252
|
+
# models (e.g. Pet) or oneOf
|
253
|
+
klass = PrimaryConnectClient.const_get(type)
|
254
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
# Returns the string representation of the object
|
259
|
+
# @return [String] String presentation of the object
|
260
|
+
def to_s
|
261
|
+
to_hash.to_s
|
262
|
+
end
|
263
|
+
|
264
|
+
# to_body is an alias to to_hash (backward compatibility)
|
265
|
+
# @return [Hash] Returns the object in the form of hash
|
266
|
+
def to_body
|
267
|
+
to_hash
|
268
|
+
end
|
269
|
+
|
270
|
+
# Returns the object in the form of hash
|
271
|
+
# @return [Hash] Returns the object in the form of hash
|
272
|
+
def to_hash
|
273
|
+
hash = {}
|
274
|
+
self.class.attribute_map.each_pair do |attr, param|
|
275
|
+
value = self.send(attr)
|
276
|
+
if value.nil?
|
277
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
278
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
279
|
+
end
|
280
|
+
|
281
|
+
hash[param] = _to_hash(value)
|
282
|
+
end
|
283
|
+
hash
|
284
|
+
end
|
285
|
+
|
286
|
+
# Outputs non-array value in the form of hash
|
287
|
+
# For object, use to_hash. Otherwise, just return the value
|
288
|
+
# @param [Object] value Any valid value
|
289
|
+
# @return [Hash] Returns the value in the form of hash
|
290
|
+
def _to_hash(value)
|
291
|
+
if value.is_a?(Array)
|
292
|
+
value.compact.map { |v| _to_hash(v) }
|
293
|
+
elsif value.is_a?(Hash)
|
294
|
+
{}.tap do |hash|
|
295
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
296
|
+
end
|
297
|
+
elsif value.respond_to? :to_hash
|
298
|
+
value.to_hash
|
299
|
+
else
|
300
|
+
value
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
end
|
305
|
+
|
306
|
+
end
|