diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index dac6028..d320572 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -20,7 +20,7 @@ docs/Event.md docs/Events.md docs/Identifier.md docs/Ids.md -docs/Immunizations.md +docs/ImmunizationQueryResponse.md docs/Location.md docs/Measurement.md docs/Medication.md @@ -85,7 +85,7 @@ lib/primary_connect_client/models/event.rb lib/primary_connect_client/models/events.rb lib/primary_connect_client/models/identifier.rb lib/primary_connect_client/models/ids.rb -lib/primary_connect_client/models/immunizations.rb +lib/primary_connect_client/models/immunization_query_response.rb lib/primary_connect_client/models/location.rb lib/primary_connect_client/models/measurement.rb lib/primary_connect_client/models/medication.rb @@ -149,7 +149,7 @@ spec/models/event_spec.rb spec/models/events_spec.rb spec/models/identifier_spec.rb spec/models/ids_spec.rb -spec/models/immunizations_spec.rb +spec/models/immunization_query_response_spec.rb spec/models/location_spec.rb spec/models/measurement_spec.rb spec/models/medication_administration_spec.rb diff --git a/.travis.yml b/.travis.yml index f5676ee..7f1f2c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,4 @@ script: - bundle install --path vendor/bundle - bundle exec rspec - gem build primary_connect_client.gemspec - - gem install ./primary_connect_client-1.13.0.gem + - gem install ./primary_connect_client-1.14.1.gem diff --git a/README.md b/README.md index fa6c0f7..e8e3508 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Client Library to interface with Primary Connect This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v1 -- Package version: 1.13.0 +- Package version: 1.14.1 - Build package: org.openapitools.codegen.languages.RubyClientCodegen ## Installation @@ -23,16 +23,16 @@ gem build primary_connect_client.gemspec Then either install the gem locally: ```shell -gem install ./primary_connect_client-1.13.0.gem +gem install ./primary_connect_client-1.14.1.gem ``` -(for development, run `gem install --dev ./primary_connect_client-1.13.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./primary_connect_client-1.14.1.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'primary_connect_client', '~> 1.13.0' + gem 'primary_connect_client', '~> 1.14.1' ### Install from Git @@ -116,7 +116,7 @@ Class | Method | HTTP request | Description - [PrimaryConnectClient::Events](docs/Events.md) - [PrimaryConnectClient::Identifier](docs/Identifier.md) - [PrimaryConnectClient::Ids](docs/Ids.md) - - [PrimaryConnectClient::Immunizations](docs/Immunizations.md) + - [PrimaryConnectClient::ImmunizationQueryResponse](docs/ImmunizationQueryResponse.md) - [PrimaryConnectClient::Location](docs/Location.md) - [PrimaryConnectClient::Measurement](docs/Measurement.md) - [PrimaryConnectClient::Medication](docs/Medication.md) diff --git a/docs/Candidates.md b/docs/Candidates.md index 4040b9f..61066fb 100644 --- a/docs/Candidates.md +++ b/docs/Candidates.md @@ -4,6 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +| **error** | **String** | Error message | [optional] | | **candidates** | [**Array<Patient>**](Patient.md) | List of possible matches for the query | [optional] | ## Example @@ -12,6 +13,7 @@ require 'primary_connect_client' instance = PrimaryConnectClient::Candidates.new( + error: null, candidates: null ) ``` diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 2a63e2e..0522cca 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -989,7 +989,7 @@ nil (empty response body) ## send_query -> send_query(opts) +> send_query(opts) send query @@ -1022,7 +1022,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> send_query_with_http_info(opts) +> , Integer, Hash)> send_query_with_http_info(opts) ```ruby begin @@ -1030,7 +1030,7 @@ begin data, status_code, headers = api_instance.send_query_with_http_info(opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue PrimaryConnectClient::ApiError => e puts "Error when calling DefaultApi->send_query_with_http_info: #{e}" end @@ -1044,7 +1044,7 @@ end ### Return type -[**Immunizations**](Immunizations.md) +[**ImmunizationQueryResponse**](ImmunizationQueryResponse.md) ### Authorization diff --git a/docs/ImmunizationQueryResponse.md b/docs/ImmunizationQueryResponse.md new file mode 100644 index 0000000..7bbaa8b --- /dev/null +++ b/docs/ImmunizationQueryResponse.md @@ -0,0 +1,22 @@ +# PrimaryConnectClient::ImmunizationQueryResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **meta** | [**Meta**](Meta.md) | | [optional] | +| **patient** | [**Patient**](Patient.md) | | [optional] | +| **medication_administrations** | [**Array<MedicationAdministration>**](MedicationAdministration.md) | List of Medication Administrations | [optional] | + +## Example + +```ruby +require 'primary_connect_client' + +instance = PrimaryConnectClient::ImmunizationQueryResponse.new( + meta: null, + patient: null, + medication_administrations: null +) +``` + diff --git a/lib/primary_connect_client.rb b/lib/primary_connect_client.rb index b1c8ab7..5b788dd 100644 --- a/lib/primary_connect_client.rb +++ b/lib/primary_connect_client.rb @@ -30,7 +30,7 @@ require 'primary_connect_client/models/events' require 'primary_connect_client/models/identifier' require 'primary_connect_client/models/ids' -require 'primary_connect_client/models/immunizations' +require 'primary_connect_client/models/immunization_query_response' require 'primary_connect_client/models/location' require 'primary_connect_client/models/measurement' require 'primary_connect_client/models/medication' diff --git a/lib/primary_connect_client/api/default_api.rb b/lib/primary_connect_client/api/default_api.rb index c551c25..509fd48 100644 --- a/lib/primary_connect_client/api/default_api.rb +++ b/lib/primary_connect_client/api/default_api.rb @@ -905,7 +905,7 @@ def reroute_order_by_ulid_with_http_info(id, opts = {}) # send query # @param [Hash] opts the optional parameters # @option opts [Query] :query - # @return [Immunizations] + # @return [ImmunizationQueryResponse] def send_query(opts = {}) data, _status_code, _headers = send_query_with_http_info(opts) data @@ -914,7 +914,7 @@ def send_query(opts = {}) # send query # @param [Hash] opts the optional parameters # @option opts [Query] :query - # @return [Array<(Immunizations, Integer, Hash)>] Immunizations data, response status code and response headers + # @return [Array<(ImmunizationQueryResponse, Integer, Hash)>] ImmunizationQueryResponse data, response status code and response headers def send_query_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.send_query ...' @@ -942,7 +942,7 @@ def send_query_with_http_info(opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'query']) # return_type - return_type = opts[:debug_return_type] || 'Immunizations' + return_type = opts[:debug_return_type] || 'ImmunizationQueryResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearer_auth'] diff --git a/lib/primary_connect_client/models/candidates.rb b/lib/primary_connect_client/models/candidates.rb index f6fffb0..acb3ba3 100644 --- a/lib/primary_connect_client/models/candidates.rb +++ b/lib/primary_connect_client/models/candidates.rb @@ -15,12 +15,16 @@ module PrimaryConnectClient class Candidates + # Error message + attr_accessor :error + # List of possible matches for the query attr_accessor :candidates # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'error' => :'error', :'candidates' => :'candidates' } end @@ -33,6 +37,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'error' => :'String', :'candidates' => :'Array' } end @@ -58,6 +63,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + if attributes.key?(:'candidates') if (value = attributes[:'candidates']).is_a?(Array) self.candidates = value @@ -83,6 +92,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + error == o.error && candidates == o.candidates end @@ -95,7 +105,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [candidates].hash + [error, candidates].hash end # Builds the object from hash diff --git a/lib/primary_connect_client/models/immunization_query_response.rb b/lib/primary_connect_client/models/immunization_query_response.rb new file mode 100644 index 0000000..c0a3d40 --- /dev/null +++ b/lib/primary_connect_client/models/immunization_query_response.rb @@ -0,0 +1,239 @@ +=begin +#Primary Connect API V1 + +#Client Library to interface with Primary Connect + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.3.0 + +=end + +require 'date' +require 'time' + +module PrimaryConnectClient + class ImmunizationQueryResponse + attr_accessor :meta + + attr_accessor :patient + + # List of Medication Administrations + attr_accessor :medication_administrations + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'meta' => :'meta', + :'patient' => :'patient', + :'medication_administrations' => :'medicationAdministrations' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'meta' => :'Meta', + :'patient' => :'Patient', + :'medication_administrations' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `PrimaryConnectClient::ImmunizationQueryResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `PrimaryConnectClient::ImmunizationQueryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'patient') + self.patient = attributes[:'patient'] + end + + if attributes.key?(:'medication_administrations') + if (value = attributes[:'medication_administrations']).is_a?(Array) + self.medication_administrations = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + meta == o.meta && + patient == o.patient && + medication_administrations == o.medication_administrations + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [meta, patient, medication_administrations].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = PrimaryConnectClient.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/primary_connect_client/models/order_order.rb b/lib/primary_connect_client/models/order_order.rb index e182977..f53a073 100644 --- a/lib/primary_connect_client/models/order_order.rb +++ b/lib/primary_connect_client/models/order_order.rb @@ -322,7 +322,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - status_validator = EnumAttributeValidator.new('String', ["STATUS_UNKNOWN", "STATUS_UPDATE", "STATUS_CANCEL", "STATUS_RESULTED", "STATUS_NEW", "STATUS_REPORTED", "STATUS_SHIPPED"]) + status_validator = EnumAttributeValidator.new('String', ["STATUS_UNKNOWN", "STATUS_UPDATE", "STATUS_CANCEL", "STATUS_RESULTED", "STATUS_NEW", "STATUS_REPORTED", "STATUS_SHIPPED", "STATUS_NOT_REPORTED"]) return false unless status_validator.valid?(@status) priority_validator = EnumAttributeValidator.new('String', ["PRIORITY_UNKNOWN", "PRIORITY_ASAP", "PRIORITY_ROUTINE", "PRIORITY_PREOPERATIVE", "PRIORITY_TIMING_CRITICAL", "PRIORITY_STAT"]) return false unless priority_validator.valid?(@priority) @@ -336,7 +336,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ["STATUS_UNKNOWN", "STATUS_UPDATE", "STATUS_CANCEL", "STATUS_RESULTED", "STATUS_NEW", "STATUS_REPORTED", "STATUS_SHIPPED"]) + validator = EnumAttributeValidator.new('String', ["STATUS_UNKNOWN", "STATUS_UPDATE", "STATUS_CANCEL", "STATUS_RESULTED", "STATUS_NEW", "STATUS_REPORTED", "STATUS_SHIPPED", "STATUS_NOT_REPORTED"]) unless validator.valid?(status) fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end diff --git a/lib/primary_connect_client/version.rb b/lib/primary_connect_client/version.rb index b478391..d9cd485 100644 --- a/lib/primary_connect_client/version.rb +++ b/lib/primary_connect_client/version.rb @@ -11,5 +11,5 @@ =end module PrimaryConnectClient - VERSION = '1.13.0' + VERSION = '1.14.1' end diff --git a/spec/api/default_api_spec.rb b/spec/api/default_api_spec.rb index 1d93b08..37da1e2 100644 --- a/spec/api/default_api_spec.rb +++ b/spec/api/default_api_spec.rb @@ -199,7 +199,7 @@ # send query # @param [Hash] opts the optional parameters # @option opts [Query] :query - # @return [Immunizations] + # @return [ImmunizationQueryResponse] describe 'send_query test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/models/candidates_spec.rb b/spec/models/candidates_spec.rb index 51ecd33..6b17009 100644 --- a/spec/models/candidates_spec.rb +++ b/spec/models/candidates_spec.rb @@ -25,6 +25,12 @@ expect(instance).to be_instance_of(PrimaryConnectClient::Candidates) end end + describe 'test attribute "error"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "candidates"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/models/immunization_query_response_spec.rb b/spec/models/immunization_query_response_spec.rb new file mode 100644 index 0000000..bdd555b --- /dev/null +++ b/spec/models/immunization_query_response_spec.rb @@ -0,0 +1,46 @@ +=begin +#Primary Connect API V1 + +#Client Library to interface with Primary Connect + +The version of the OpenAPI document: v1 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.3.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for PrimaryConnectClient::ImmunizationQueryResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe PrimaryConnectClient::ImmunizationQueryResponse do + let(:instance) { PrimaryConnectClient::ImmunizationQueryResponse.new } + + describe 'test an instance of ImmunizationQueryResponse' do + it 'should create an instance of ImmunizationQueryResponse' do + expect(instance).to be_instance_of(PrimaryConnectClient::ImmunizationQueryResponse) + end + end + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "patient"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "medication_administrations"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/order_order_spec.rb b/spec/models/order_order_spec.rb index daea327..e6f387b 100644 --- a/spec/models/order_order_spec.rb +++ b/spec/models/order_order_spec.rb @@ -40,7 +40,7 @@ describe 'test attribute "status"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["STATUS_UNKNOWN", "STATUS_UPDATE", "STATUS_CANCEL", "STATUS_RESULTED", "STATUS_NEW", "STATUS_REPORTED", "STATUS_SHIPPED"]) + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["STATUS_UNKNOWN", "STATUS_UPDATE", "STATUS_CANCEL", "STATUS_RESULTED", "STATUS_NEW", "STATUS_REPORTED", "STATUS_SHIPPED", "STATUS_NOT_REPORTED"]) # validator.allowable_values.each do |value| # expect { instance.status = value }.not_to raise_error # end