class ChangeHealthcare::ProfessionalClaims::SwaggerClient::ProfessionalService
Attributes
Allowed Values are: 'MJ' Minutes, 'UN' Unit
Allowed Values are: 'ER' Jurisdiction Specific Procedure and Supply Codes, 'HC' Health Care Financing Administration Common Procedural Coding System (HCPCS) Codes, 'IV' Home Infusion EDI Coalition (HIEC) Product/Service Code, 'WK' Advanced Billing Concepts (ABC) Codes
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb, line 50 def self.attribute_map { composite_diagnosis_code_pointers: :compositeDiagnosisCodePointers, description: :description, line_item_charge_amount: :lineItemChargeAmount, measurement_unit: :measurementUnit, place_of_service_code: :placeOfServiceCode, procedure_code: :procedureCode, procedure_identifier: :procedureIdentifier, procedure_modifiers: :procedureModifiers, service_unit_count: :serviceUnitCount } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb, line 81 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.transform_keys(&:to_sym) self.composite_diagnosis_code_pointers = attributes[:compositeDiagnosisCodePointers] if attributes.key?(:compositeDiagnosisCodePointers) self.description = attributes[:description] if attributes.key?(:description) self.line_item_charge_amount = attributes[:lineItemChargeAmount] if attributes.key?(:lineItemChargeAmount) self.measurement_unit = attributes[:measurementUnit] if attributes.key?(:measurementUnit) self.place_of_service_code = attributes[:placeOfServiceCode] if attributes.key?(:placeOfServiceCode) self.procedure_code = attributes[:procedureCode] if attributes.key?(:procedureCode) self.procedure_identifier = attributes[:procedureIdentifier] if attributes.key?(:procedureIdentifier) if attributes.key?(:procedureModifiers) && (value = attributes[:procedureModifiers]).is_a?(Array) self.procedure_modifiers = value end self.service_unit_count = attributes[:serviceUnitCount] if attributes.key?(:serviceUnitCount) end
Attribute type mapping.
# File lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb, line 65 def self.swagger_types { composite_diagnosis_code_pointers: :CompositeDiagnosisCodePointers, description: :String, line_item_charge_amount: :String, measurement_unit: :String, place_of_service_code: :String, procedure_code: :String, procedure_identifier: :String, procedure_modifiers: :'Array<String>', service_unit_count: :String } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb, line 152 def ==(other) return true if equal?(other) self.class == other.class && composite_diagnosis_code_pointers == other.composite_diagnosis_code_pointers && description == other.description && line_item_charge_amount == other.line_item_charge_amount && measurement_unit == other.measurement_unit && place_of_service_code == other.place_of_service_code && procedure_code == other.procedure_code && procedure_identifier == other.procedure_identifier && procedure_modifiers == other.procedure_modifiers && service_unit_count == other.service_unit_count 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/professional_claims/swagger_client/models/professional_service.rb, line 207 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/professional_claims/swagger_client/models/professional_service.rb, line 274 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/professional_claims/swagger_client/models/professional_service.rb, line 183 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 do |v| _deserialize(Regexp.last_match(1), v) end) end elsif !attributes[self.class.attribute_map[key]].nil? send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end
@see the `==` method @param [Object] Object to be compared
# File lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb, line 169 def eql?(other) self == other end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb, line 175 def hash [composite_diagnosis_code_pointers, description, line_item_charge_amount, measurement_unit, place_of_service_code, procedure_code, procedure_identifier, procedure_modifiers, service_unit_count].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/professional_claims/swagger_client/models/professional_service.rb, line 110 def list_invalid_properties [] end
Custom attribute writer method checking allowed values (enum). @param [Object] measurement_unit
Object to be assigned
# File lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb, line 128 def measurement_unit=(measurement_unit) validator = EnumAttributeValidator.new('String', %w[MJ UN]) unless validator.valid?(measurement_unit) raise ArgumentError, %(invalid value for "measurement_unit", must be one of #{validator.allowable_values}.) end @measurement_unit = measurement_unit end
Custom attribute writer method checking allowed values (enum). @param [Object] procedure_identifier
Object to be assigned
# File lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb, line 140 def procedure_identifier=(procedure_identifier) validator = EnumAttributeValidator.new('String', %w[ER HC IV WK]) unless validator.valid?(procedure_identifier) raise ArgumentError, %(invalid value for "procedure_identifier", must be one of #{validator.allowable_values}.) end @procedure_identifier = procedure_identifier end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb, line 259 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/professional_claims/swagger_client/models/professional_service.rb, line 247 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/professional_claims/swagger_client/models/professional_service.rb, line 116 def valid? measurement_unit_validator = EnumAttributeValidator.new('String', %w[MJ UN]) return false unless measurement_unit_validator.valid?(@measurement_unit) procedure_identifier_validator = EnumAttributeValidator.new('String', %w[ER HC IV WK]) return false unless procedure_identifier_validator.valid?(@procedure_identifier) true end