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,322 @@
|
|
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
|
+
# Individual who has the agreement with the insurance company for the related policy
|
18
|
+
class VisitInsured
|
19
|
+
attr_accessor :identifiers
|
20
|
+
|
21
|
+
attr_accessor :name
|
22
|
+
|
23
|
+
attr_accessor :ssn
|
24
|
+
|
25
|
+
attr_accessor :relationship
|
26
|
+
|
27
|
+
# Date of Birth
|
28
|
+
attr_accessor :dob
|
29
|
+
|
30
|
+
attr_accessor :sex
|
31
|
+
|
32
|
+
attr_accessor :address
|
33
|
+
|
34
|
+
class EnumAttributeValidator
|
35
|
+
attr_reader :datatype
|
36
|
+
attr_reader :allowable_values
|
37
|
+
|
38
|
+
def initialize(datatype, allowable_values)
|
39
|
+
@allowable_values = allowable_values.map do |value|
|
40
|
+
case datatype.to_s
|
41
|
+
when /Integer/i
|
42
|
+
value.to_i
|
43
|
+
when /Float/i
|
44
|
+
value.to_f
|
45
|
+
else
|
46
|
+
value
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def valid?(value)
|
52
|
+
!value || allowable_values.include?(value)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
57
|
+
def self.attribute_map
|
58
|
+
{
|
59
|
+
:'identifiers' => :'identifiers',
|
60
|
+
:'name' => :'name',
|
61
|
+
:'ssn' => :'ssn',
|
62
|
+
:'relationship' => :'relationship',
|
63
|
+
:'dob' => :'dob',
|
64
|
+
:'sex' => :'sex',
|
65
|
+
:'address' => :'address'
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# Returns all the JSON keys this model knows about
|
70
|
+
def self.acceptable_attributes
|
71
|
+
attribute_map.values
|
72
|
+
end
|
73
|
+
|
74
|
+
# Attribute type mapping.
|
75
|
+
def self.openapi_types
|
76
|
+
{
|
77
|
+
:'identifiers' => :'Array<Identifier>',
|
78
|
+
:'name' => :'Name',
|
79
|
+
:'ssn' => :'String',
|
80
|
+
:'relationship' => :'String',
|
81
|
+
:'dob' => :'String',
|
82
|
+
:'sex' => :'String',
|
83
|
+
:'address' => :'Address'
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
# List of attributes with nullable: true
|
88
|
+
def self.openapi_nullable
|
89
|
+
Set.new([
|
90
|
+
])
|
91
|
+
end
|
92
|
+
|
93
|
+
# Initializes the object
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
def initialize(attributes = {})
|
96
|
+
if (!attributes.is_a?(Hash))
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::VisitInsured` initialize method"
|
98
|
+
end
|
99
|
+
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
102
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::VisitInsured`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
104
|
+
end
|
105
|
+
h[k.to_sym] = v
|
106
|
+
}
|
107
|
+
|
108
|
+
if attributes.key?(:'identifiers')
|
109
|
+
if (value = attributes[:'identifiers']).is_a?(Array)
|
110
|
+
self.identifiers = value
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'name')
|
115
|
+
self.name = attributes[:'name']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'ssn')
|
119
|
+
self.ssn = attributes[:'ssn']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'relationship')
|
123
|
+
self.relationship = attributes[:'relationship']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'dob')
|
127
|
+
self.dob = attributes[:'dob']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'sex')
|
131
|
+
self.sex = attributes[:'sex']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'address')
|
135
|
+
self.address = attributes[:'address']
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
140
|
+
# @return Array for valid properties with the reasons
|
141
|
+
def list_invalid_properties
|
142
|
+
invalid_properties = Array.new
|
143
|
+
invalid_properties
|
144
|
+
end
|
145
|
+
|
146
|
+
# Check to see if the all the properties in the model are valid
|
147
|
+
# @return true if the model is valid
|
148
|
+
def valid?
|
149
|
+
relationship_validator = EnumAttributeValidator.new('String', ["RELATIONSHIP_UNKNOWN", "RELATIONSHIP_OTHER", "RELATIONSHIP_SELF", "RELATIONSHIP_SPOUSE", "RELATIONSHIP_LIFE_PARTNER", "RELATIONSHIP_CHILD", "RELATIONSHIP_FATHER", "RELATIONSHIP_MOTHER", "RELATIONSHIP_GUARDIAN", "RELATIONSHIP_PARENT", "RELATIONSHIP_GRANDPARENT", "RELATIONSHIP_GRANDCHILD", "RELATIONSHIP_SIBLING", "RELATIONSHIP_EMPLOYER"])
|
150
|
+
return false unless relationship_validator.valid?(@relationship)
|
151
|
+
sex_validator = EnumAttributeValidator.new('String', ["SEX_UNKNOWN", "SEX_FEMALE", "SEX_MALE", "SEX_OTHER", "SEX_NON_BINARY", "SEX_PREFER_NOT_TO_DISCLOSE"])
|
152
|
+
return false unless sex_validator.valid?(@sex)
|
153
|
+
true
|
154
|
+
end
|
155
|
+
|
156
|
+
# Custom attribute writer method checking allowed values (enum).
|
157
|
+
# @param [Object] relationship Object to be assigned
|
158
|
+
def relationship=(relationship)
|
159
|
+
validator = EnumAttributeValidator.new('String', ["RELATIONSHIP_UNKNOWN", "RELATIONSHIP_OTHER", "RELATIONSHIP_SELF", "RELATIONSHIP_SPOUSE", "RELATIONSHIP_LIFE_PARTNER", "RELATIONSHIP_CHILD", "RELATIONSHIP_FATHER", "RELATIONSHIP_MOTHER", "RELATIONSHIP_GUARDIAN", "RELATIONSHIP_PARENT", "RELATIONSHIP_GRANDPARENT", "RELATIONSHIP_GRANDCHILD", "RELATIONSHIP_SIBLING", "RELATIONSHIP_EMPLOYER"])
|
160
|
+
unless validator.valid?(relationship)
|
161
|
+
fail ArgumentError, "invalid value for \"relationship\", must be one of #{validator.allowable_values}."
|
162
|
+
end
|
163
|
+
@relationship = relationship
|
164
|
+
end
|
165
|
+
|
166
|
+
# Custom attribute writer method checking allowed values (enum).
|
167
|
+
# @param [Object] sex Object to be assigned
|
168
|
+
def sex=(sex)
|
169
|
+
validator = EnumAttributeValidator.new('String', ["SEX_UNKNOWN", "SEX_FEMALE", "SEX_MALE", "SEX_OTHER", "SEX_NON_BINARY", "SEX_PREFER_NOT_TO_DISCLOSE"])
|
170
|
+
unless validator.valid?(sex)
|
171
|
+
fail ArgumentError, "invalid value for \"sex\", must be one of #{validator.allowable_values}."
|
172
|
+
end
|
173
|
+
@sex = sex
|
174
|
+
end
|
175
|
+
|
176
|
+
# Checks equality by comparing each attribute.
|
177
|
+
# @param [Object] Object to be compared
|
178
|
+
def ==(o)
|
179
|
+
return true if self.equal?(o)
|
180
|
+
self.class == o.class &&
|
181
|
+
identifiers == o.identifiers &&
|
182
|
+
name == o.name &&
|
183
|
+
ssn == o.ssn &&
|
184
|
+
relationship == o.relationship &&
|
185
|
+
dob == o.dob &&
|
186
|
+
sex == o.sex &&
|
187
|
+
address == o.address
|
188
|
+
end
|
189
|
+
|
190
|
+
# @see the `==` method
|
191
|
+
# @param [Object] Object to be compared
|
192
|
+
def eql?(o)
|
193
|
+
self == o
|
194
|
+
end
|
195
|
+
|
196
|
+
# Calculates hash code according to all attributes.
|
197
|
+
# @return [Integer] Hash code
|
198
|
+
def hash
|
199
|
+
[identifiers, name, ssn, relationship, dob, sex, address].hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Builds the object from hash
|
203
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
204
|
+
# @return [Object] Returns the model itself
|
205
|
+
def self.build_from_hash(attributes)
|
206
|
+
new.build_from_hash(attributes)
|
207
|
+
end
|
208
|
+
|
209
|
+
# Builds the object from hash
|
210
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
211
|
+
# @return [Object] Returns the model itself
|
212
|
+
def build_from_hash(attributes)
|
213
|
+
return nil unless attributes.is_a?(Hash)
|
214
|
+
self.class.openapi_types.each_pair do |key, type|
|
215
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
216
|
+
self.send("#{key}=", nil)
|
217
|
+
elsif type =~ /\AArray<(.*)>/i
|
218
|
+
# check to ensure the input is an array given that the attribute
|
219
|
+
# is documented as an array but the input is not
|
220
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
221
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
222
|
+
end
|
223
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
224
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
self
|
229
|
+
end
|
230
|
+
|
231
|
+
# Deserializes the data based on type
|
232
|
+
# @param string type Data type
|
233
|
+
# @param string value Value to be deserialized
|
234
|
+
# @return [Object] Deserialized data
|
235
|
+
def _deserialize(type, value)
|
236
|
+
case type.to_sym
|
237
|
+
when :Time
|
238
|
+
Time.parse(value)
|
239
|
+
when :Date
|
240
|
+
Date.parse(value)
|
241
|
+
when :String
|
242
|
+
value.to_s
|
243
|
+
when :Integer
|
244
|
+
value.to_i
|
245
|
+
when :Float
|
246
|
+
value.to_f
|
247
|
+
when :Boolean
|
248
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
249
|
+
true
|
250
|
+
else
|
251
|
+
false
|
252
|
+
end
|
253
|
+
when :Object
|
254
|
+
# generic object (usually a Hash), return directly
|
255
|
+
value
|
256
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
257
|
+
inner_type = Regexp.last_match[:inner_type]
|
258
|
+
value.map { |v| _deserialize(inner_type, v) }
|
259
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
260
|
+
k_type = Regexp.last_match[:k_type]
|
261
|
+
v_type = Regexp.last_match[:v_type]
|
262
|
+
{}.tap do |hash|
|
263
|
+
value.each do |k, v|
|
264
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
else # model
|
268
|
+
# models (e.g. Pet) or oneOf
|
269
|
+
klass = PrimaryConnectClient.const_get(type)
|
270
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
# Returns the string representation of the object
|
275
|
+
# @return [String] String presentation of the object
|
276
|
+
def to_s
|
277
|
+
to_hash.to_s
|
278
|
+
end
|
279
|
+
|
280
|
+
# to_body is an alias to to_hash (backward compatibility)
|
281
|
+
# @return [Hash] Returns the object in the form of hash
|
282
|
+
def to_body
|
283
|
+
to_hash
|
284
|
+
end
|
285
|
+
|
286
|
+
# Returns the object in the form of hash
|
287
|
+
# @return [Hash] Returns the object in the form of hash
|
288
|
+
def to_hash
|
289
|
+
hash = {}
|
290
|
+
self.class.attribute_map.each_pair do |attr, param|
|
291
|
+
value = self.send(attr)
|
292
|
+
if value.nil?
|
293
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
294
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
295
|
+
end
|
296
|
+
|
297
|
+
hash[param] = _to_hash(value)
|
298
|
+
end
|
299
|
+
hash
|
300
|
+
end
|
301
|
+
|
302
|
+
# Outputs non-array value in the form of hash
|
303
|
+
# For object, use to_hash. Otherwise, just return the value
|
304
|
+
# @param [Object] value Any valid value
|
305
|
+
# @return [Hash] Returns the value in the form of hash
|
306
|
+
def _to_hash(value)
|
307
|
+
if value.is_a?(Array)
|
308
|
+
value.compact.map { |v| _to_hash(v) }
|
309
|
+
elsif value.is_a?(Hash)
|
310
|
+
{}.tap do |hash|
|
311
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
312
|
+
end
|
313
|
+
elsif value.respond_to? :to_hash
|
314
|
+
value.to_hash
|
315
|
+
else
|
316
|
+
value
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
end
|
321
|
+
|
322
|
+
end
|
@@ -0,0 +1,238 @@
|
|
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 VisitPlan
|
18
|
+
attr_accessor :identifier
|
19
|
+
|
20
|
+
# Name of insurance plan
|
21
|
+
attr_accessor :name
|
22
|
+
|
23
|
+
# Type of insurance plan
|
24
|
+
attr_accessor :type
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'identifier' => :'identifier',
|
30
|
+
:'name' => :'name',
|
31
|
+
:'type' => :'type'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Returns all the JSON keys this model knows about
|
36
|
+
def self.acceptable_attributes
|
37
|
+
attribute_map.values
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.openapi_types
|
42
|
+
{
|
43
|
+
:'identifier' => :'Identifier',
|
44
|
+
:'name' => :'String',
|
45
|
+
:'type' => :'String'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# List of attributes with nullable: true
|
50
|
+
def self.openapi_nullable
|
51
|
+
Set.new([
|
52
|
+
])
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
if (!attributes.is_a?(Hash))
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::VisitPlan` initialize method"
|
60
|
+
end
|
61
|
+
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
64
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::VisitPlan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
66
|
+
end
|
67
|
+
h[k.to_sym] = v
|
68
|
+
}
|
69
|
+
|
70
|
+
if attributes.key?(:'identifier')
|
71
|
+
self.identifier = attributes[:'identifier']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'name')
|
75
|
+
self.name = attributes[:'name']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'type')
|
79
|
+
self.type = attributes[:'type']
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
84
|
+
# @return Array for valid properties with the reasons
|
85
|
+
def list_invalid_properties
|
86
|
+
invalid_properties = Array.new
|
87
|
+
invalid_properties
|
88
|
+
end
|
89
|
+
|
90
|
+
# Check to see if the all the properties in the model are valid
|
91
|
+
# @return true if the model is valid
|
92
|
+
def valid?
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
identifier == o.identifier &&
|
102
|
+
name == o.name &&
|
103
|
+
type == o.type
|
104
|
+
end
|
105
|
+
|
106
|
+
# @see the `==` method
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def eql?(o)
|
109
|
+
self == o
|
110
|
+
end
|
111
|
+
|
112
|
+
# Calculates hash code according to all attributes.
|
113
|
+
# @return [Integer] Hash code
|
114
|
+
def hash
|
115
|
+
[identifier, name, type].hash
|
116
|
+
end
|
117
|
+
|
118
|
+
# Builds the object from hash
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
# @return [Object] Returns the model itself
|
121
|
+
def self.build_from_hash(attributes)
|
122
|
+
new.build_from_hash(attributes)
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def build_from_hash(attributes)
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
130
|
+
self.class.openapi_types.each_pair do |key, type|
|
131
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
132
|
+
self.send("#{key}=", nil)
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
134
|
+
# check to ensure the input is an array given that the attribute
|
135
|
+
# is documented as an array but the input is not
|
136
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
137
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
138
|
+
end
|
139
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
140
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
self
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def _deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :Time
|
154
|
+
Time.parse(value)
|
155
|
+
when :Date
|
156
|
+
Date.parse(value)
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :Boolean
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else # model
|
184
|
+
# models (e.g. Pet) or oneOf
|
185
|
+
klass = PrimaryConnectClient.const_get(type)
|
186
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the string representation of the object
|
191
|
+
# @return [String] String presentation of the object
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_body
|
199
|
+
to_hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the object in the form of hash
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_hash
|
205
|
+
hash = {}
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
207
|
+
value = self.send(attr)
|
208
|
+
if value.nil?
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
211
|
+
end
|
212
|
+
|
213
|
+
hash[param] = _to_hash(value)
|
214
|
+
end
|
215
|
+
hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Outputs non-array value in the form of hash
|
219
|
+
# For object, use to_hash. Otherwise, just return the value
|
220
|
+
# @param [Object] value Any valid value
|
221
|
+
# @return [Hash] Returns the value in the form of hash
|
222
|
+
def _to_hash(value)
|
223
|
+
if value.is_a?(Array)
|
224
|
+
value.compact.map { |v| _to_hash(v) }
|
225
|
+
elsif value.is_a?(Hash)
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
228
|
+
end
|
229
|
+
elsif value.respond_to? :to_hash
|
230
|
+
value.to_hash
|
231
|
+
else
|
232
|
+
value
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
@@ -1,5 +1,15 @@
|
|
1
|
-
|
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
|
2
12
|
|
3
13
|
module PrimaryConnectClient
|
4
|
-
VERSION = '
|
14
|
+
VERSION = '1.2.0'
|
5
15
|
end
|
@@ -5,6 +5,9 @@
|
|
5
5
|
|
6
6
|
The version of the OpenAPI document: v1
|
7
7
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.3.0
|
10
|
+
|
8
11
|
=end
|
9
12
|
|
10
13
|
# Common files
|
@@ -13,12 +16,62 @@ require 'primary_connect_client/api_error'
|
|
13
16
|
require 'primary_connect_client/version'
|
14
17
|
require 'primary_connect_client/configuration'
|
15
18
|
|
19
|
+
# Models
|
20
|
+
require 'primary_connect_client/models/address'
|
21
|
+
require 'primary_connect_client/models/coded_value'
|
22
|
+
require 'primary_connect_client/models/demographics'
|
23
|
+
require 'primary_connect_client/models/device'
|
24
|
+
require 'primary_connect_client/models/dosage'
|
25
|
+
require 'primary_connect_client/models/error'
|
26
|
+
require 'primary_connect_client/models/event'
|
27
|
+
require 'primary_connect_client/models/events'
|
28
|
+
require 'primary_connect_client/models/identifier'
|
29
|
+
require 'primary_connect_client/models/location'
|
30
|
+
require 'primary_connect_client/models/medication'
|
31
|
+
require 'primary_connect_client/models/medication_administration'
|
32
|
+
require 'primary_connect_client/models/meta'
|
33
|
+
require 'primary_connect_client/models/meta_destinations'
|
34
|
+
require 'primary_connect_client/models/meta_message'
|
35
|
+
require 'primary_connect_client/models/meta_source'
|
36
|
+
require 'primary_connect_client/models/meta_transmission'
|
37
|
+
require 'primary_connect_client/models/name'
|
38
|
+
require 'primary_connect_client/models/order'
|
39
|
+
require 'primary_connect_client/models/order_ids'
|
40
|
+
require 'primary_connect_client/models/order_order'
|
41
|
+
require 'primary_connect_client/models/order_order_clinical_info'
|
42
|
+
require 'primary_connect_client/models/order_order_diagnoses'
|
43
|
+
require 'primary_connect_client/models/order_order_ordering_facility'
|
44
|
+
require 'primary_connect_client/models/order_with_event_errors'
|
45
|
+
require 'primary_connect_client/models/orders'
|
46
|
+
require 'primary_connect_client/models/orders_orders'
|
47
|
+
require 'primary_connect_client/models/patient'
|
48
|
+
require 'primary_connect_client/models/patient_contacts'
|
49
|
+
require 'primary_connect_client/models/phone_number'
|
50
|
+
require 'primary_connect_client/models/provider'
|
51
|
+
require 'primary_connect_client/models/result'
|
52
|
+
require 'primary_connect_client/models/result_ids'
|
53
|
+
require 'primary_connect_client/models/result_reference_range'
|
54
|
+
require 'primary_connect_client/models/result_report'
|
55
|
+
require 'primary_connect_client/models/results'
|
56
|
+
require 'primary_connect_client/models/specimen'
|
57
|
+
require 'primary_connect_client/models/subject'
|
58
|
+
require 'primary_connect_client/models/subject_one_of'
|
59
|
+
require 'primary_connect_client/models/subject_one_of1'
|
60
|
+
require 'primary_connect_client/models/v2_device'
|
61
|
+
require 'primary_connect_client/models/v2_dosage'
|
62
|
+
require 'primary_connect_client/models/v2_medication'
|
63
|
+
require 'primary_connect_client/models/v2_medication_administration'
|
64
|
+
require 'primary_connect_client/models/visit'
|
65
|
+
require 'primary_connect_client/models/visit_company'
|
66
|
+
require 'primary_connect_client/models/visit_guarantor'
|
67
|
+
require 'primary_connect_client/models/visit_guarantor_employer'
|
68
|
+
require 'primary_connect_client/models/visit_insurances'
|
69
|
+
require 'primary_connect_client/models/visit_insured'
|
70
|
+
require 'primary_connect_client/models/visit_plan'
|
71
|
+
|
16
72
|
# APIs
|
17
73
|
require 'primary_connect_client/api/default_api'
|
18
74
|
|
19
|
-
# Protobufs
|
20
|
-
require 'primary_connect_proto'
|
21
|
-
|
22
75
|
module PrimaryConnectClient
|
23
76
|
class << self
|
24
77
|
# Customize default settings for the SDK using block.
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
# -*- encoding: utf-8 -*-
|
4
2
|
|
5
3
|
=begin
|
@@ -7,6 +5,11 @@
|
|
7
5
|
|
8
6
|
#Client Library to interface with Primary Connect
|
9
7
|
|
8
|
+
The version of the OpenAPI document: v1
|
9
|
+
|
10
|
+
Generated by: https://openapi-generator.tech
|
11
|
+
OpenAPI Generator version: 5.3.0
|
12
|
+
|
10
13
|
=end
|
11
14
|
|
12
15
|
$:.push File.expand_path("../lib", __FILE__)
|
@@ -16,7 +19,7 @@ Gem::Specification.new do |s|
|
|
16
19
|
s.name = "primary_connect_client"
|
17
20
|
s.version = PrimaryConnectClient::VERSION
|
18
21
|
s.platform = Gem::Platform::RUBY
|
19
|
-
s.authors = [""]
|
22
|
+
s.authors = ["OpenAPI-Generator"]
|
20
23
|
s.email = [""]
|
21
24
|
s.homepage = "https://openapi-generator.tech"
|
22
25
|
s.summary = "Primary Connect API V1 Ruby Gem"
|
@@ -25,12 +28,12 @@ Gem::Specification.new do |s|
|
|
25
28
|
s.required_ruby_version = ">= 2.4"
|
26
29
|
|
27
30
|
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
28
|
-
s.add_runtime_dependency 'primary_connect_proto', '~> 0.
|
31
|
+
s.add_runtime_dependency 'primary_connect_proto', '~> 0.12.0', '>= 0.12.0'
|
29
32
|
|
30
33
|
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
31
34
|
|
32
35
|
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
33
36
|
s.test_files = `find spec/*`.split("\n")
|
34
37
|
s.executables = []
|
35
|
-
s.require_paths = ["lib"
|
38
|
+
s.require_paths = ["lib"]
|
36
39
|
end
|