primary_connect_client 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +18 -7
- data/docs/Accession.md +18 -0
- data/docs/AccessionOrder.md +18 -0
- data/docs/DefaultApi.md +275 -0
- data/docs/Device.md +5 -3
- data/docs/Ids.md +18 -0
- data/docs/Measurement.md +22 -0
- data/docs/OrderOrder.md +4 -0
- data/docs/Result.md +3 -1
- data/docs/V2Device.md +5 -3
- data/lib/primary_connect_client/api/default_api.rb +249 -0
- data/lib/primary_connect_client/models/accession.rb +218 -0
- data/lib/primary_connect_client/models/accession_order.rb +219 -0
- data/lib/primary_connect_client/models/demographics.rb +2 -2
- data/lib/primary_connect_client/models/device.rb +21 -12
- data/lib/primary_connect_client/models/ids.rb +221 -0
- data/lib/primary_connect_client/models/measurement.rb +240 -0
- data/lib/primary_connect_client/models/order_order.rb +23 -1
- data/lib/primary_connect_client/models/result.rb +13 -4
- data/lib/primary_connect_client/models/v2_device.rb +21 -12
- data/lib/primary_connect_client/version.rb +1 -1
- data/lib/primary_connect_client.rb +4 -0
- data/primary_connect_client.gemspec +1 -1
- data/spec/api/default_api_spec.rb +45 -0
- data/spec/models/accession_order_spec.rb +34 -0
- data/spec/models/accession_spec.rb +34 -0
- data/spec/models/demographics_spec.rb +1 -1
- data/spec/models/device_spec.rb +7 -1
- data/spec/models/ids_spec.rb +34 -0
- data/spec/models/measurement_spec.rb +46 -0
- data/spec/models/order_order_spec.rb +12 -0
- data/spec/models/result_spec.rb +6 -0
- data/spec/models/v2_device_spec.rb +7 -1
- metadata +22 -6
@@ -245,7 +245,7 @@ module PrimaryConnectClient
|
|
245
245
|
def valid?
|
246
246
|
sex_validator = EnumAttributeValidator.new('String', ["SEX_UNKNOWN", "SEX_FEMALE", "SEX_MALE", "SEX_OTHER", "SEX_NON_BINARY", "SEX_PREFER_NOT_TO_DISCLOSE"])
|
247
247
|
return false unless sex_validator.valid?(@sex)
|
248
|
-
gender_validator = EnumAttributeValidator.new('String', ["GENDER_UNKNOWN", "GENDER_FEMALE", "GENDER_MALE", "GENDER_OTHER", "GENDER_NON_BINARY", "GENDER_TRANSGENDER_MALE", "GENDER_TRANSGENDER_FEMALE", "GENDER_PREFER_NOT_TO_DISCLOSE"])
|
248
|
+
gender_validator = EnumAttributeValidator.new('String', ["GENDER_UNKNOWN", "GENDER_FEMALE", "GENDER_MALE", "GENDER_OTHER", "GENDER_NON_BINARY", "GENDER_TRANSGENDER_MALE", "GENDER_TRANSGENDER_FEMALE", "GENDER_PREFER_NOT_TO_DISCLOSE", "GENDER_INTERSEX"])
|
249
249
|
return false unless gender_validator.valid?(@gender)
|
250
250
|
sexual_orientation_validator = EnumAttributeValidator.new('String', ["ORIENTATION_UNKNOWN", "ORIENTATION_HOMOSEXUAL", "ORIENTATION_HETEROSEXUAL", "ORIENTATION_BISEXUAL", "ORIENTATION_QUESTIONING", "ORIENTATION_OTHER", "ORIENTATION_PREFER_NOT_TO_DISCLOSE"])
|
251
251
|
return false unless sexual_orientation_validator.valid?(@sexual_orientation)
|
@@ -269,7 +269,7 @@ module PrimaryConnectClient
|
|
269
269
|
# Custom attribute writer method checking allowed values (enum).
|
270
270
|
# @param [Object] gender Object to be assigned
|
271
271
|
def gender=(gender)
|
272
|
-
validator = EnumAttributeValidator.new('String', ["GENDER_UNKNOWN", "GENDER_FEMALE", "GENDER_MALE", "GENDER_OTHER", "GENDER_NON_BINARY", "GENDER_TRANSGENDER_MALE", "GENDER_TRANSGENDER_FEMALE", "GENDER_PREFER_NOT_TO_DISCLOSE"])
|
272
|
+
validator = EnumAttributeValidator.new('String', ["GENDER_UNKNOWN", "GENDER_FEMALE", "GENDER_MALE", "GENDER_OTHER", "GENDER_NON_BINARY", "GENDER_TRANSGENDER_MALE", "GENDER_TRANSGENDER_FEMALE", "GENDER_PREFER_NOT_TO_DISCLOSE", "GENDER_INTERSEX"])
|
273
273
|
unless validator.valid?(gender)
|
274
274
|
fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}."
|
275
275
|
end
|
@@ -15,8 +15,8 @@ require 'time'
|
|
15
15
|
|
16
16
|
module PrimaryConnectClient
|
17
17
|
class Device
|
18
|
-
#
|
19
|
-
attr_accessor :
|
18
|
+
# List of IDs and types that identify the device
|
19
|
+
attr_accessor :identifiers
|
20
20
|
|
21
21
|
attr_accessor :manufacturer
|
22
22
|
|
@@ -31,16 +31,19 @@ module PrimaryConnectClient
|
|
31
31
|
# Arbitrary key/value pairs for Device specific use
|
32
32
|
attr_accessor :config
|
33
33
|
|
34
|
+
attr_accessor :model_name
|
35
|
+
|
34
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
35
37
|
def self.attribute_map
|
36
38
|
{
|
37
|
-
:'
|
39
|
+
:'identifiers' => :'identifiers',
|
38
40
|
:'manufacturer' => :'manufacturer',
|
39
41
|
:'model_number' => :'modelNumber',
|
40
42
|
:'serial_number' => :'serialNumber',
|
41
43
|
:'address' => :'address',
|
42
44
|
:'location' => :'location',
|
43
|
-
:'config' => :'config'
|
45
|
+
:'config' => :'config',
|
46
|
+
:'model_name' => :'modelName'
|
44
47
|
}
|
45
48
|
end
|
46
49
|
|
@@ -52,13 +55,14 @@ module PrimaryConnectClient
|
|
52
55
|
# Attribute type mapping.
|
53
56
|
def self.openapi_types
|
54
57
|
{
|
55
|
-
:'
|
58
|
+
:'identifiers' => :'Array<Identifier>',
|
56
59
|
:'manufacturer' => :'String',
|
57
60
|
:'model_number' => :'String',
|
58
61
|
:'serial_number' => :'String',
|
59
62
|
:'address' => :'Address',
|
60
63
|
:'location' => :'Location',
|
61
|
-
:'config' => :'Object'
|
64
|
+
:'config' => :'Object',
|
65
|
+
:'model_name' => :'String'
|
62
66
|
}
|
63
67
|
end
|
64
68
|
|
@@ -83,9 +87,9 @@ module PrimaryConnectClient
|
|
83
87
|
h[k.to_sym] = v
|
84
88
|
}
|
85
89
|
|
86
|
-
if attributes.key?(:'
|
87
|
-
if (value = attributes[:'
|
88
|
-
self.
|
90
|
+
if attributes.key?(:'identifiers')
|
91
|
+
if (value = attributes[:'identifiers']).is_a?(Array)
|
92
|
+
self.identifiers = value
|
89
93
|
end
|
90
94
|
end
|
91
95
|
|
@@ -112,6 +116,10 @@ module PrimaryConnectClient
|
|
112
116
|
if attributes.key?(:'config')
|
113
117
|
self.config = attributes[:'config']
|
114
118
|
end
|
119
|
+
|
120
|
+
if attributes.key?(:'model_name')
|
121
|
+
self.model_name = attributes[:'model_name']
|
122
|
+
end
|
115
123
|
end
|
116
124
|
|
117
125
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -132,13 +140,14 @@ module PrimaryConnectClient
|
|
132
140
|
def ==(o)
|
133
141
|
return true if self.equal?(o)
|
134
142
|
self.class == o.class &&
|
135
|
-
|
143
|
+
identifiers == o.identifiers &&
|
136
144
|
manufacturer == o.manufacturer &&
|
137
145
|
model_number == o.model_number &&
|
138
146
|
serial_number == o.serial_number &&
|
139
147
|
address == o.address &&
|
140
148
|
location == o.location &&
|
141
|
-
config == o.config
|
149
|
+
config == o.config &&
|
150
|
+
model_name == o.model_name
|
142
151
|
end
|
143
152
|
|
144
153
|
# @see the `==` method
|
@@ -150,7 +159,7 @@ module PrimaryConnectClient
|
|
150
159
|
# Calculates hash code according to all attributes.
|
151
160
|
# @return [Integer] Hash code
|
152
161
|
def hash
|
153
|
-
[
|
162
|
+
[identifiers, manufacturer, model_number, serial_number, address, location, config, model_name].hash
|
154
163
|
end
|
155
164
|
|
156
165
|
# Builds the object from hash
|
@@ -0,0 +1,221 @@
|
|
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 Ids
|
18
|
+
# List of IDs
|
19
|
+
attr_accessor :ids
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'ids' => :'ids'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'ids' => :'Array<String>'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::Ids` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::Ids`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'ids')
|
62
|
+
if (value = attributes[:'ids']).is_a?(Array)
|
63
|
+
self.ids = value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
invalid_properties = Array.new
|
72
|
+
invalid_properties
|
73
|
+
end
|
74
|
+
|
75
|
+
# Check to see if the all the properties in the model are valid
|
76
|
+
# @return true if the model is valid
|
77
|
+
def valid?
|
78
|
+
true
|
79
|
+
end
|
80
|
+
|
81
|
+
# Checks equality by comparing each attribute.
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def ==(o)
|
84
|
+
return true if self.equal?(o)
|
85
|
+
self.class == o.class &&
|
86
|
+
ids == o.ids
|
87
|
+
end
|
88
|
+
|
89
|
+
# @see the `==` method
|
90
|
+
# @param [Object] Object to be compared
|
91
|
+
def eql?(o)
|
92
|
+
self == o
|
93
|
+
end
|
94
|
+
|
95
|
+
# Calculates hash code according to all attributes.
|
96
|
+
# @return [Integer] Hash code
|
97
|
+
def hash
|
98
|
+
[ids].hash
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def self.build_from_hash(attributes)
|
105
|
+
new.build_from_hash(attributes)
|
106
|
+
end
|
107
|
+
|
108
|
+
# Builds the object from hash
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
+
# @return [Object] Returns the model itself
|
111
|
+
def build_from_hash(attributes)
|
112
|
+
return nil unless attributes.is_a?(Hash)
|
113
|
+
self.class.openapi_types.each_pair do |key, type|
|
114
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
115
|
+
self.send("#{key}=", nil)
|
116
|
+
elsif type =~ /\AArray<(.*)>/i
|
117
|
+
# check to ensure the input is an array given that the attribute
|
118
|
+
# is documented as an array but the input is not
|
119
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
120
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
121
|
+
end
|
122
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
134
|
+
def _deserialize(type, value)
|
135
|
+
case type.to_sym
|
136
|
+
when :Time
|
137
|
+
Time.parse(value)
|
138
|
+
when :Date
|
139
|
+
Date.parse(value)
|
140
|
+
when :String
|
141
|
+
value.to_s
|
142
|
+
when :Integer
|
143
|
+
value.to_i
|
144
|
+
when :Float
|
145
|
+
value.to_f
|
146
|
+
when :Boolean
|
147
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
# models (e.g. Pet) or oneOf
|
168
|
+
klass = PrimaryConnectClient.const_get(type)
|
169
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the string representation of the object
|
174
|
+
# @return [String] String presentation of the object
|
175
|
+
def to_s
|
176
|
+
to_hash.to_s
|
177
|
+
end
|
178
|
+
|
179
|
+
# to_body is an alias to to_hash (backward compatibility)
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_body
|
182
|
+
to_hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Returns the object in the form of hash
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_hash
|
188
|
+
hash = {}
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
190
|
+
value = self.send(attr)
|
191
|
+
if value.nil?
|
192
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
193
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
194
|
+
end
|
195
|
+
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
@@ -0,0 +1,240 @@
|
|
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 Measurement
|
18
|
+
attr_accessor :meta
|
19
|
+
|
20
|
+
attr_accessor :subject
|
21
|
+
|
22
|
+
# List of result components
|
23
|
+
attr_accessor :metrics
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'meta' => :'meta',
|
29
|
+
:'subject' => :'subject',
|
30
|
+
:'metrics' => :'metrics'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns all the JSON keys this model knows about
|
35
|
+
def self.acceptable_attributes
|
36
|
+
attribute_map.values
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.openapi_types
|
41
|
+
{
|
42
|
+
:'meta' => :'Meta',
|
43
|
+
:'subject' => :'Subject',
|
44
|
+
:'metrics' => :'Array<Result>'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# List of attributes with nullable: true
|
49
|
+
def self.openapi_nullable
|
50
|
+
Set.new([
|
51
|
+
:'subject',
|
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::Measurement` 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::Measurement`. 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?(:'meta')
|
71
|
+
self.meta = attributes[:'meta']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'subject')
|
75
|
+
self.subject = attributes[:'subject']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'metrics')
|
79
|
+
if (value = attributes[:'metrics']).is_a?(Array)
|
80
|
+
self.metrics = value
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properties with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = Array.new
|
89
|
+
invalid_properties
|
90
|
+
end
|
91
|
+
|
92
|
+
# Check to see if the all the properties in the model are valid
|
93
|
+
# @return true if the model is valid
|
94
|
+
def valid?
|
95
|
+
true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Checks equality by comparing each attribute.
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def ==(o)
|
101
|
+
return true if self.equal?(o)
|
102
|
+
self.class == o.class &&
|
103
|
+
meta == o.meta &&
|
104
|
+
subject == o.subject &&
|
105
|
+
metrics == o.metrics
|
106
|
+
end
|
107
|
+
|
108
|
+
# @see the `==` method
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def eql?(o)
|
111
|
+
self == o
|
112
|
+
end
|
113
|
+
|
114
|
+
# Calculates hash code according to all attributes.
|
115
|
+
# @return [Integer] Hash code
|
116
|
+
def hash
|
117
|
+
[meta, subject, metrics].hash
|
118
|
+
end
|
119
|
+
|
120
|
+
# Builds the object from hash
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
+
# @return [Object] Returns the model itself
|
123
|
+
def self.build_from_hash(attributes)
|
124
|
+
new.build_from_hash(attributes)
|
125
|
+
end
|
126
|
+
|
127
|
+
# Builds the object from hash
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
# @return [Object] Returns the model itself
|
130
|
+
def build_from_hash(attributes)
|
131
|
+
return nil unless attributes.is_a?(Hash)
|
132
|
+
self.class.openapi_types.each_pair do |key, type|
|
133
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
134
|
+
self.send("#{key}=", nil)
|
135
|
+
elsif type =~ /\AArray<(.*)>/i
|
136
|
+
# check to ensure the input is an array given that the attribute
|
137
|
+
# is documented as an array but the input is not
|
138
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
139
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
140
|
+
end
|
141
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
142
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
self
|
147
|
+
end
|
148
|
+
|
149
|
+
# Deserializes the data based on type
|
150
|
+
# @param string type Data type
|
151
|
+
# @param string value Value to be deserialized
|
152
|
+
# @return [Object] Deserialized data
|
153
|
+
def _deserialize(type, value)
|
154
|
+
case type.to_sym
|
155
|
+
when :Time
|
156
|
+
Time.parse(value)
|
157
|
+
when :Date
|
158
|
+
Date.parse(value)
|
159
|
+
when :String
|
160
|
+
value.to_s
|
161
|
+
when :Integer
|
162
|
+
value.to_i
|
163
|
+
when :Float
|
164
|
+
value.to_f
|
165
|
+
when :Boolean
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
|
+
true
|
168
|
+
else
|
169
|
+
false
|
170
|
+
end
|
171
|
+
when :Object
|
172
|
+
# generic object (usually a Hash), return directly
|
173
|
+
value
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each do |k, v|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else # model
|
186
|
+
# models (e.g. Pet) or oneOf
|
187
|
+
klass = PrimaryConnectClient.const_get(type)
|
188
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
# Returns the string representation of the object
|
193
|
+
# @return [String] String presentation of the object
|
194
|
+
def to_s
|
195
|
+
to_hash.to_s
|
196
|
+
end
|
197
|
+
|
198
|
+
# to_body is an alias to to_hash (backward compatibility)
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_body
|
201
|
+
to_hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the object in the form of hash
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_hash
|
207
|
+
hash = {}
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
209
|
+
value = self.send(attr)
|
210
|
+
if value.nil?
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
213
|
+
end
|
214
|
+
|
215
|
+
hash[param] = _to_hash(value)
|
216
|
+
end
|
217
|
+
hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Outputs non-array value in the form of hash
|
221
|
+
# For object, use to_hash. Otherwise, just return the value
|
222
|
+
# @param [Object] value Any valid value
|
223
|
+
# @return [Hash] Returns the value in the form of hash
|
224
|
+
def _to_hash(value)
|
225
|
+
if value.is_a?(Array)
|
226
|
+
value.compact.map { |v| _to_hash(v) }
|
227
|
+
elsif value.is_a?(Hash)
|
228
|
+
{}.tap do |hash|
|
229
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
230
|
+
end
|
231
|
+
elsif value.respond_to? :to_hash
|
232
|
+
value.to_hash
|
233
|
+
else
|
234
|
+
value
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
@@ -36,6 +36,9 @@ module PrimaryConnectClient
|
|
36
36
|
# Timestamp when the results were composed into a report and released. (ISO-8601)
|
37
37
|
attr_accessor :completion_date_time
|
38
38
|
|
39
|
+
# Timestamp when the specimen was received by the destination. (ISO-8601)
|
40
|
+
attr_accessor :accession_date_time
|
41
|
+
|
39
42
|
# YYYY-MM-DD, Date when the order becomes invalid
|
40
43
|
attr_accessor :expiration_date
|
41
44
|
|
@@ -46,6 +49,9 @@ module PrimaryConnectClient
|
|
46
49
|
|
47
50
|
attr_accessor :procedure
|
48
51
|
|
52
|
+
# Array of Procedures ordered
|
53
|
+
attr_accessor :procedures
|
54
|
+
|
49
55
|
attr_accessor :ordering_provider
|
50
56
|
|
51
57
|
# Array of providers to be copied on the results
|
@@ -111,10 +117,12 @@ module PrimaryConnectClient
|
|
111
117
|
:'collection_date_time' => :'collectionDateTime',
|
112
118
|
:'collection_start_date_time' => :'collectionStartDateTime',
|
113
119
|
:'completion_date_time' => :'completionDateTime',
|
120
|
+
:'accession_date_time' => :'accessionDateTime',
|
114
121
|
:'expiration_date' => :'expirationDate',
|
115
122
|
:'specimen' => :'specimen',
|
116
123
|
:'medication_administrations' => :'medicationAdministrations',
|
117
124
|
:'procedure' => :'procedure',
|
125
|
+
:'procedures' => :'procedures',
|
118
126
|
:'ordering_provider' => :'orderingProvider',
|
119
127
|
:'result_copy_providers' => :'resultCopyProviders',
|
120
128
|
:'ordering_facility' => :'orderingFacility',
|
@@ -145,10 +153,12 @@ module PrimaryConnectClient
|
|
145
153
|
:'collection_date_time' => :'Time',
|
146
154
|
:'collection_start_date_time' => :'Time',
|
147
155
|
:'completion_date_time' => :'Time',
|
156
|
+
:'accession_date_time' => :'Time',
|
148
157
|
:'expiration_date' => :'String',
|
149
158
|
:'specimen' => :'Specimen',
|
150
159
|
:'medication_administrations' => :'Array<MedicationAdministration>',
|
151
160
|
:'procedure' => :'CodedValue',
|
161
|
+
:'procedures' => :'Array<CodedValues>',
|
152
162
|
:'ordering_provider' => :'Provider',
|
153
163
|
:'result_copy_providers' => :'Array<Provider>',
|
154
164
|
:'ordering_facility' => :'OrderOrderOrderingFacility',
|
@@ -213,6 +223,10 @@ module PrimaryConnectClient
|
|
213
223
|
self.completion_date_time = attributes[:'completion_date_time']
|
214
224
|
end
|
215
225
|
|
226
|
+
if attributes.key?(:'accession_date_time')
|
227
|
+
self.accession_date_time = attributes[:'accession_date_time']
|
228
|
+
end
|
229
|
+
|
216
230
|
if attributes.key?(:'expiration_date')
|
217
231
|
self.expiration_date = attributes[:'expiration_date']
|
218
232
|
end
|
@@ -231,6 +245,12 @@ module PrimaryConnectClient
|
|
231
245
|
self.procedure = attributes[:'procedure']
|
232
246
|
end
|
233
247
|
|
248
|
+
if attributes.key?(:'procedures')
|
249
|
+
if (value = attributes[:'procedures']).is_a?(Array)
|
250
|
+
self.procedures = value
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
234
254
|
if attributes.key?(:'ordering_provider')
|
235
255
|
self.ordering_provider = attributes[:'ordering_provider']
|
236
256
|
end
|
@@ -365,10 +385,12 @@ module PrimaryConnectClient
|
|
365
385
|
collection_date_time == o.collection_date_time &&
|
366
386
|
collection_start_date_time == o.collection_start_date_time &&
|
367
387
|
completion_date_time == o.completion_date_time &&
|
388
|
+
accession_date_time == o.accession_date_time &&
|
368
389
|
expiration_date == o.expiration_date &&
|
369
390
|
specimen == o.specimen &&
|
370
391
|
medication_administrations == o.medication_administrations &&
|
371
392
|
procedure == o.procedure &&
|
393
|
+
procedures == o.procedures &&
|
372
394
|
ordering_provider == o.ordering_provider &&
|
373
395
|
result_copy_providers == o.result_copy_providers &&
|
374
396
|
ordering_facility == o.ordering_facility &&
|
@@ -392,7 +414,7 @@ module PrimaryConnectClient
|
|
392
414
|
# Calculates hash code according to all attributes.
|
393
415
|
# @return [Integer] Hash code
|
394
416
|
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
|
417
|
+
[id, application_order_id, status, transaction_date_time, collection_date_time, collection_start_date_time, completion_date_time, accession_date_time, expiration_date, specimen, medication_administrations, procedure, procedures, ordering_provider, result_copy_providers, ordering_facility, priority, diagnoses, clinical_comments, notes, clinical_info, results_status, response_flag, external_ids, results].hash
|
396
418
|
end
|
397
419
|
|
398
420
|
# Builds the object from hash
|