primary_connect_client 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -6
- data/docs/OrderOrder.md +1 -1
- data/docs/Subject.md +10 -39
- data/lib/primary_connect_client/models/measurement.rb +0 -1
- data/lib/primary_connect_client/models/order.rb +0 -1
- data/lib/primary_connect_client/models/order_order.rb +1 -1
- data/lib/primary_connect_client/models/subject.rb +196 -74
- data/lib/primary_connect_client/version.rb +1 -1
- data/lib/primary_connect_client.rb +0 -2
- data/spec/models/subject_spec.rb +14 -5
- metadata +2 -7
- data/lib/primary_connect_client/models/order_order_specimen.rb +0 -239
- data/lib/primary_connect_client/models/patient_demographics.rb +0 -466
- data/lib/primary_connect_client/models/result_specimen.rb +0 -239
- data/lib/primary_connect_client/models/subject_one_of.rb +0 -218
- data/lib/primary_connect_client/models/subject_one_of1.rb +0 -218
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c21b6c5d8e7df842065531543644b17933fc1e96ddd6a90649be582f1331ad98
|
4
|
+
data.tar.gz: 711d0a09341d53c78db0b9c4762cfbc92bbec5b12faf103f857581a82d32056c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aec6d001df9b89210d9a24ddd345e707fd3ac0dbfbf3ac0c3c5ed908c2628c68c65181adf6fc3887d170d3aebb7c5029ce93b46cf11f90d40efbc974b212a6c0
|
7
|
+
data.tar.gz: 071b97faec6f8a08dfe35899b9c080d0e485b6809092ba955ffe53aab6065f66cb712f36ee57aad39fda8c86cc821eaf986eef461146925e0df5a589615905f4
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Client Library to interface with Primary Connect
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: v1
|
10
|
-
- Package version: 1.5.
|
10
|
+
- Package version: 1.5.1
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
|
13
13
|
## Installation
|
@@ -23,16 +23,16 @@ gem build primary_connect_client.gemspec
|
|
23
23
|
Then either install the gem locally:
|
24
24
|
|
25
25
|
```shell
|
26
|
-
gem install ./primary_connect_client-1.5.
|
26
|
+
gem install ./primary_connect_client-1.5.1.gem
|
27
27
|
```
|
28
28
|
|
29
|
-
(for development, run `gem install --dev ./primary_connect_client-1.5.
|
29
|
+
(for development, run `gem install --dev ./primary_connect_client-1.5.1.gem` to install the development dependencies)
|
30
30
|
|
31
31
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
32
32
|
|
33
33
|
Finally add this to the Gemfile:
|
34
34
|
|
35
|
-
gem 'primary_connect_client', '~> 1.5.
|
35
|
+
gem 'primary_connect_client', '~> 1.5.1'
|
36
36
|
|
37
37
|
### Install from Git
|
38
38
|
|
@@ -142,8 +142,6 @@ Class | Method | HTTP request | Description
|
|
142
142
|
- [PrimaryConnectClient::Results](docs/Results.md)
|
143
143
|
- [PrimaryConnectClient::Specimen](docs/Specimen.md)
|
144
144
|
- [PrimaryConnectClient::Subject](docs/Subject.md)
|
145
|
-
- [PrimaryConnectClient::SubjectOneOf](docs/SubjectOneOf.md)
|
146
|
-
- [PrimaryConnectClient::SubjectOneOf1](docs/SubjectOneOf1.md)
|
147
145
|
- [PrimaryConnectClient::V2Device](docs/V2Device.md)
|
148
146
|
- [PrimaryConnectClient::V2Dosage](docs/V2Dosage.md)
|
149
147
|
- [PrimaryConnectClient::V2Medication](docs/V2Medication.md)
|
data/docs/OrderOrder.md
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
| **specimen** | [**Specimen**](Specimen.md) | | [optional] |
|
17
17
|
| **medication_administrations** | [**Array<MedicationAdministration>**](MedicationAdministration.md) | Array of medications administered to the subject | [optional] |
|
18
18
|
| **procedure** | [**CodedValue**](CodedValue.md) | | [optional] |
|
19
|
-
| **procedures** | [**Array<
|
19
|
+
| **procedures** | [**Array<CodedValue>**](CodedValue.md) | Array of Procedures ordered | [optional] |
|
20
20
|
| **ordering_provider** | [**Provider**](Provider.md) | | [optional] |
|
21
21
|
| **result_copy_providers** | [**Array<Provider>**](Provider.md) | Array of providers to be copied on the results | [optional] |
|
22
22
|
| **ordering_facility** | [**OrderOrderOrderingFacility**](OrderOrderOrderingFacility.md) | | [optional] |
|
data/docs/Subject.md
CHANGED
@@ -1,49 +1,20 @@
|
|
1
1
|
# PrimaryConnectClient::Subject
|
2
2
|
|
3
|
-
##
|
3
|
+
## Properties
|
4
4
|
|
5
|
-
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **patient** | [**Patient**](Patient.md) | | [optional] |
|
8
|
+
| **device** | [**Device**](Device.md) | | [optional] |
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
#### Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'primary_connect_client'
|
13
|
-
|
14
|
-
PrimaryConnectClient::Subject.openapi_one_of
|
15
|
-
# =>
|
16
|
-
# [
|
17
|
-
# :'SubjectOneOf',
|
18
|
-
# :'SubjectOneOf1'
|
19
|
-
# ]
|
20
|
-
```
|
21
|
-
|
22
|
-
### build
|
23
|
-
|
24
|
-
Find the appropriate object from the `openapi_one_of` list and casts the data into it.
|
25
|
-
|
26
|
-
#### Example
|
10
|
+
## Example
|
27
11
|
|
28
12
|
```ruby
|
29
13
|
require 'primary_connect_client'
|
30
14
|
|
31
|
-
PrimaryConnectClient::Subject.
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
# => nil
|
15
|
+
instance = PrimaryConnectClient::Subject.new(
|
16
|
+
patient: null,
|
17
|
+
device: null
|
18
|
+
)
|
36
19
|
```
|
37
20
|
|
38
|
-
#### Parameters
|
39
|
-
|
40
|
-
| Name | Type | Description |
|
41
|
-
| ---- | ---- | ----------- |
|
42
|
-
| **data** | **Mixed** | data to be matched against the list of oneOf items |
|
43
|
-
|
44
|
-
#### Return type
|
45
|
-
|
46
|
-
- `SubjectOneOf`
|
47
|
-
- `SubjectOneOf1`
|
48
|
-
- `nil` (if no type matches)
|
49
|
-
|
@@ -158,7 +158,7 @@ module PrimaryConnectClient
|
|
158
158
|
:'specimen' => :'Specimen',
|
159
159
|
:'medication_administrations' => :'Array<MedicationAdministration>',
|
160
160
|
:'procedure' => :'CodedValue',
|
161
|
-
:'procedures' => :'Array<
|
161
|
+
:'procedures' => :'Array<CodedValue>',
|
162
162
|
:'ordering_provider' => :'Provider',
|
163
163
|
:'result_copy_providers' => :'Array<Provider>',
|
164
164
|
:'ordering_facility' => :'OrderOrderOrderingFacility',
|
@@ -14,92 +14,214 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module PrimaryConnectClient
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
class Subject
|
18
|
+
attr_accessor :patient
|
19
|
+
|
20
|
+
attr_accessor :device
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'patient' => :'patient',
|
26
|
+
:'device' => :'device'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'patient' => :'Patient',
|
39
|
+
:'device' => :'Device'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::Subject` initialize method"
|
25
54
|
end
|
26
55
|
|
27
|
-
#
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
32
|
-
# Note:
|
33
|
-
# - We do not attempt to check whether exactly one item matches.
|
34
|
-
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
35
|
-
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
36
|
-
# - TODO: scalar values are de facto behaving as if they were nullable.
|
37
|
-
# - TODO: logging when debugging is set.
|
38
|
-
openapi_one_of.each do |klass|
|
39
|
-
begin
|
40
|
-
next if klass == :AnyType # "nullable: true"
|
41
|
-
typed_data = find_and_cast_into_type(klass, data)
|
42
|
-
return typed_data if typed_data
|
43
|
-
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
44
|
-
end
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::Subject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
45
60
|
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
46
63
|
|
47
|
-
|
64
|
+
if attributes.key?(:'patient')
|
65
|
+
self.patient = attributes[:'patient']
|
48
66
|
end
|
49
67
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
68
|
+
if attributes.key?(:'device')
|
69
|
+
self.device = attributes[:'device']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
74
|
+
# @return Array for valid properties with the reasons
|
75
|
+
def list_invalid_properties
|
76
|
+
invalid_properties = Array.new
|
77
|
+
invalid_properties
|
78
|
+
end
|
79
|
+
|
80
|
+
# Check to see if the all the properties in the model are valid
|
81
|
+
# @return true if the model is valid
|
82
|
+
def valid?
|
83
|
+
true
|
84
|
+
end
|
85
|
+
|
86
|
+
# Checks equality by comparing each attribute.
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def ==(o)
|
89
|
+
return true if self.equal?(o)
|
90
|
+
self.class == o.class &&
|
91
|
+
patient == o.patient &&
|
92
|
+
device == o.device
|
93
|
+
end
|
94
|
+
|
95
|
+
# @see the `==` method
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def eql?(o)
|
98
|
+
self == o
|
99
|
+
end
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Integer] Hash code
|
103
|
+
def hash
|
104
|
+
[patient, device].hash
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def self.build_from_hash(attributes)
|
111
|
+
new.build_from_hash(attributes)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def build_from_hash(attributes)
|
118
|
+
return nil unless attributes.is_a?(Hash)
|
119
|
+
self.class.openapi_types.each_pair do |key, type|
|
120
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
121
|
+
self.send("#{key}=", nil)
|
122
|
+
elsif type =~ /\AArray<(.*)>/i
|
123
|
+
# check to ensure the input is an array given that the attribute
|
124
|
+
# is documented as an array but the input is not
|
125
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
126
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
82
127
|
end
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
128
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
129
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
self
|
134
|
+
end
|
135
|
+
|
136
|
+
# Deserializes the data based on type
|
137
|
+
# @param string type Data type
|
138
|
+
# @param string value Value to be deserialized
|
139
|
+
# @return [Object] Deserialized data
|
140
|
+
def _deserialize(type, value)
|
141
|
+
case type.to_sym
|
142
|
+
when :Time
|
143
|
+
Time.parse(value)
|
144
|
+
when :Date
|
145
|
+
Date.parse(value)
|
146
|
+
when :String
|
147
|
+
value.to_s
|
148
|
+
when :Integer
|
149
|
+
value.to_i
|
150
|
+
when :Float
|
151
|
+
value.to_f
|
152
|
+
when :Boolean
|
153
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
154
|
+
true
|
155
|
+
else
|
156
|
+
false
|
157
|
+
end
|
158
|
+
when :Object
|
159
|
+
# generic object (usually a Hash), return directly
|
160
|
+
value
|
161
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
162
|
+
inner_type = Regexp.last_match[:inner_type]
|
163
|
+
value.map { |v| _deserialize(inner_type, v) }
|
164
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
165
|
+
k_type = Regexp.last_match[:k_type]
|
166
|
+
v_type = Regexp.last_match[:v_type]
|
167
|
+
{}.tap do |hash|
|
168
|
+
value.each do |k, v|
|
169
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
95
170
|
end
|
96
171
|
end
|
172
|
+
else # model
|
173
|
+
# models (e.g. Pet) or oneOf
|
174
|
+
klass = PrimaryConnectClient.const_get(type)
|
175
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
176
|
+
end
|
177
|
+
end
|
97
178
|
|
98
|
-
|
99
|
-
|
100
|
-
|
179
|
+
# Returns the string representation of the object
|
180
|
+
# @return [String] String presentation of the object
|
181
|
+
def to_s
|
182
|
+
to_hash.to_s
|
183
|
+
end
|
184
|
+
|
185
|
+
# to_body is an alias to to_hash (backward compatibility)
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_body
|
188
|
+
to_hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the object in the form of hash
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
193
|
+
def to_hash
|
194
|
+
hash = {}
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
196
|
+
value = self.send(attr)
|
197
|
+
if value.nil?
|
198
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
199
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
200
|
+
end
|
201
|
+
|
202
|
+
hash[param] = _to_hash(value)
|
101
203
|
end
|
204
|
+
hash
|
102
205
|
end
|
206
|
+
|
207
|
+
# Outputs non-array value in the form of hash
|
208
|
+
# For object, use to_hash. Otherwise, just return the value
|
209
|
+
# @param [Object] value Any valid value
|
210
|
+
# @return [Hash] Returns the value in the form of hash
|
211
|
+
def _to_hash(value)
|
212
|
+
if value.is_a?(Array)
|
213
|
+
value.compact.map { |v| _to_hash(v) }
|
214
|
+
elsif value.is_a?(Hash)
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
217
|
+
end
|
218
|
+
elsif value.respond_to? :to_hash
|
219
|
+
value.to_hash
|
220
|
+
else
|
221
|
+
value
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
103
225
|
end
|
104
226
|
|
105
227
|
end
|
@@ -59,8 +59,6 @@ require 'primary_connect_client/models/result_report'
|
|
59
59
|
require 'primary_connect_client/models/results'
|
60
60
|
require 'primary_connect_client/models/specimen'
|
61
61
|
require 'primary_connect_client/models/subject'
|
62
|
-
require 'primary_connect_client/models/subject_one_of'
|
63
|
-
require 'primary_connect_client/models/subject_one_of1'
|
64
62
|
require 'primary_connect_client/models/v2_device'
|
65
63
|
require 'primary_connect_client/models/v2_dosage'
|
66
64
|
require 'primary_connect_client/models/v2_medication'
|
data/spec/models/subject_spec.rb
CHANGED
@@ -18,14 +18,23 @@ require 'date'
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
19
|
# Please update as you see appropriate
|
20
20
|
describe PrimaryConnectClient::Subject do
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
let(:instance) { PrimaryConnectClient::Subject.new }
|
22
|
+
|
23
|
+
describe 'test an instance of Subject' do
|
24
|
+
it 'should create an instance of Subject' do
|
25
|
+
expect(instance).to be_instance_of(PrimaryConnectClient::Subject)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "patient"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
24
31
|
end
|
25
32
|
end
|
26
33
|
|
27
|
-
describe '
|
28
|
-
it '
|
34
|
+
describe 'test attribute "device"' do
|
35
|
+
it 'should work' do
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
29
37
|
end
|
30
38
|
end
|
39
|
+
|
31
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: primary_connect_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenAPI-Generator
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -174,25 +174,20 @@ files:
|
|
174
174
|
- lib/primary_connect_client/models/order_order_clinical_info.rb
|
175
175
|
- lib/primary_connect_client/models/order_order_diagnoses.rb
|
176
176
|
- lib/primary_connect_client/models/order_order_ordering_facility.rb
|
177
|
-
- lib/primary_connect_client/models/order_order_specimen.rb
|
178
177
|
- lib/primary_connect_client/models/order_with_event_errors.rb
|
179
178
|
- lib/primary_connect_client/models/orders.rb
|
180
179
|
- lib/primary_connect_client/models/orders_orders.rb
|
181
180
|
- lib/primary_connect_client/models/patient.rb
|
182
181
|
- lib/primary_connect_client/models/patient_contacts.rb
|
183
|
-
- lib/primary_connect_client/models/patient_demographics.rb
|
184
182
|
- lib/primary_connect_client/models/phone_number.rb
|
185
183
|
- lib/primary_connect_client/models/provider.rb
|
186
184
|
- lib/primary_connect_client/models/result.rb
|
187
185
|
- lib/primary_connect_client/models/result_ids.rb
|
188
186
|
- lib/primary_connect_client/models/result_reference_range.rb
|
189
187
|
- lib/primary_connect_client/models/result_report.rb
|
190
|
-
- lib/primary_connect_client/models/result_specimen.rb
|
191
188
|
- lib/primary_connect_client/models/results.rb
|
192
189
|
- lib/primary_connect_client/models/specimen.rb
|
193
190
|
- lib/primary_connect_client/models/subject.rb
|
194
|
-
- lib/primary_connect_client/models/subject_one_of.rb
|
195
|
-
- lib/primary_connect_client/models/subject_one_of1.rb
|
196
191
|
- lib/primary_connect_client/models/v2_device.rb
|
197
192
|
- lib/primary_connect_client/models/v2_dosage.rb
|
198
193
|
- lib/primary_connect_client/models/v2_medication.rb
|