class ChangeHealthcare::Eligibility::SwaggerClient::BenefitsInformation
Attributes
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 20 def self.attribute_map { 'additional_information': :additionalInformation, 'auth_or_cert_indicator': :authOrCertIndicator, 'benefit_amount': :benefitAmount, 'benefit_percent': :benefitPercent, 'benefit_quantity': :benefitQuantity, 'benefits_additional_information': :benefitsAdditionalInformation, 'benefits_date_information': :benefitsDateInformation, 'benefits_related_entity': :benefitsRelatedEntity, 'benefits_service_delivery': :benefitsServiceDelivery, 'code': :code, 'composite_medical_procedure_identifier': :compositeMedicalProcedureIdentifier, 'coverage_level': :coverageLevel, 'coverage_level_code': :coverageLevelCode, 'eligibility_additional_information': :eligibilityAdditionalInformation, 'header_loop_identifier_code': :headerLoopIdentifierCode, 'in_plan_network_indicator': :inPlanNetworkIndicator, 'in_plan_network_indicator_code': :inPlanNetworkIndicatorCode, 'insurance_type': :insuranceType, 'insurance_type_code': :insuranceTypeCode, 'name': :name, 'plan_coverage': :planCoverage, 'quantity_qualifier': :quantityQualifier, 'quantity_qualifier_code': :quantityQualifierCode, 'service_type_codes': :serviceTypeCodes, 'service_types': :serviceTypes, 'time_qualifier': :timeQualifier, 'time_qualifier_code': :timeQualifierCode, 'trailer_loop_identifier_code': :trailerLoopIdentifierCode } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 89 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.transform_keys(&:to_sym) if attributes.key?(:additionalInformation) if (value = attributes[:additionalInformation]).is_a?(Array) self.additional_information = value end end self.auth_or_cert_indicator = attributes[:authOrCertIndicator] if attributes.key?(:authOrCertIndicator) self.benefit_amount = attributes[:benefitAmount] if attributes.key?(:benefitAmount) self.benefit_percent = attributes[:benefitPercent] if attributes.key?(:benefitPercent) self.benefit_quantity = attributes[:benefitQuantity] if attributes.key?(:benefitQuantity) self.benefits_additional_information = attributes[:benefitsAdditionalInformation] if attributes.key?(:benefitsAdditionalInformation) self.benefits_date_information = attributes[:benefitsDateInformation] if attributes.key?(:benefitsDateInformation) self.benefits_related_entity = attributes[:benefitsRelatedEntity] if attributes.key?(:benefitsRelatedEntity) if attributes.key?(:benefitsServiceDelivery) if (value = attributes[:benefitsServiceDelivery]).is_a?(Array) self.benefits_service_delivery = value end end self.code = attributes[:code] if attributes.key?(:code) if attributes.key?(:compositeMedicalProcedureIdentifier) self.composite_medical_procedure_identifier = attributes[:compositeMedicalProcedureIdentifier] end self.coverage_level = attributes[:coverageLevel] if attributes.key?(:coverageLevel) self.coverage_level_code = attributes[:coverageLevelCode] if attributes.key?(:coverageLevelCode) self.eligibility_additional_information = attributes[:eligibilityAdditionalInformation] if attributes.key?(:eligibilityAdditionalInformation) self.header_loop_identifier_code = attributes[:headerLoopIdentifierCode] if attributes.key?(:headerLoopIdentifierCode) self.in_plan_network_indicator = attributes[:inPlanNetworkIndicator] if attributes.key?(:inPlanNetworkIndicator) self.in_plan_network_indicator_code = attributes[:inPlanNetworkIndicatorCode] if attributes.key?(:inPlanNetworkIndicatorCode) self.insurance_type = attributes[:insuranceType] if attributes.key?(:insuranceType) self.insurance_type_code = attributes[:insuranceTypeCode] if attributes.key?(:insuranceTypeCode) self.name = attributes[:name] if attributes.key?(:name) self.plan_coverage = attributes[:planCoverage] if attributes.key?(:planCoverage) self.quantity_qualifier = attributes[:quantityQualifier] if attributes.key?(:quantityQualifier) self.quantity_qualifier_code = attributes[:quantityQualifierCode] if attributes.key?(:quantityQualifierCode) if attributes.key?(:serviceTypeCodes) if (value = attributes[:serviceTypeCodes]).is_a?(Array) self.service_type_codes = value end end if attributes.key?(:serviceTypes) if (value = attributes[:serviceTypes]).is_a?(Array) self.service_types = value end end self.time_qualifier = attributes[:timeQualifier] if attributes.key?(:timeQualifier) self.time_qualifier_code = attributes[:timeQualifierCode] if attributes.key?(:timeQualifierCode) self.trailer_loop_identifier_code = attributes[:trailerLoopIdentifierCode] if attributes.key?(:trailerLoopIdentifierCode) end
Attribute type mapping.
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 54 def self.swagger_types { 'additional_information': :'Array<AdditionalInformation>', 'auth_or_cert_indicator': :String, 'benefit_amount': :String, 'benefit_percent': :String, 'benefit_quantity': :String, 'benefits_additional_information': :BenefitsAdditionalInformation, 'benefits_date_information': :BenefitsDateInformation, 'benefits_related_entity': :BenefitsRelatedEntity, 'benefits_service_delivery': :'Array<BenefitsServiceDelivery>', 'code': :String, 'composite_medical_procedure_identifier': :CompositeMedicalProcedureIdentifier, 'coverage_level': :String, 'coverage_level_code': :String, 'eligibility_additional_information': :EligibilityAdditionalInformation, 'header_loop_identifier_code': :String, 'in_plan_network_indicator': :String, 'in_plan_network_indicator_code': :String, 'insurance_type': :String, 'insurance_type_code': :String, 'name': :String, 'plan_coverage': :String, 'quantity_qualifier': :String, 'quantity_qualifier_code': :String, 'service_type_codes': :'Array<String>', 'service_types': :'Array<String>', 'time_qualifier': :String, 'time_qualifier_code': :String, 'trailer_loop_identifier_code': :String } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 184 def ==(o) return true if equal?(o) self.class == o.class && additional_information == o.additional_information && auth_or_cert_indicator == o.auth_or_cert_indicator && benefit_amount == o.benefit_amount && benefit_percent == o.benefit_percent && benefit_quantity == o.benefit_quantity && benefits_additional_information == o.benefits_additional_information && benefits_date_information == o.benefits_date_information && benefits_related_entity == o.benefits_related_entity && benefits_service_delivery == o.benefits_service_delivery && code == o.code && composite_medical_procedure_identifier == o.composite_medical_procedure_identifier && coverage_level == o.coverage_level && coverage_level_code == o.coverage_level_code && eligibility_additional_information == o.eligibility_additional_information && header_loop_identifier_code == o.header_loop_identifier_code && in_plan_network_indicator == o.in_plan_network_indicator && in_plan_network_indicator_code == o.in_plan_network_indicator_code && insurance_type == o.insurance_type && insurance_type_code == o.insurance_type_code && name == o.name && plan_coverage == o.plan_coverage && quantity_qualifier == o.quantity_qualifier && quantity_qualifier_code == o.quantity_qualifier_code && service_type_codes == o.service_type_codes && service_types == o.service_types && time_qualifier == o.time_qualifier && time_qualifier_code == o.time_qualifier_code && trailer_loop_identifier_code == o.trailer_loop_identifier_code end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 255 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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 temp_model = SwaggerClient.const_get(type).new temp_model.build_from_hash(value) end 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
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 322 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
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 233 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if 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) send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) }) end elsif !attributes[self.class.attribute_map[key]].nil? send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end
@see the `==` method @param [Object] Object to be compared
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 220 def eql?(o) self == o end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 226 def hash [additional_information, auth_or_cert_indicator, benefit_amount, benefit_percent, benefit_quantity, benefits_additional_information, benefits_date_information, benefits_related_entity, benefits_service_delivery, code, composite_medical_procedure_identifier, coverage_level, coverage_level_code, eligibility_additional_information, header_loop_identifier_code, in_plan_network_indicator, in_plan_network_indicator_code, insurance_type, insurance_type_code, name, plan_coverage, quantity_qualifier, quantity_qualifier_code, service_type_codes, service_types, time_qualifier, time_qualifier_code, trailer_loop_identifier_code].hash end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 172 def list_invalid_properties [] end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 307 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
Returns the string representation of the object @return [String] String presentation of the object
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 295 def to_s to_hash.to_s end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 178 def valid? true end