Class: ChangeHealthcare::ProfessionalClaims::SwaggerClient::ProfessionalService

Inherits:
Object
  • Object
show all
Defined in:
lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ProfessionalService

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# 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

Instance Attribute Details

#composite_diagnosis_code_pointersObject

Returns the value of attribute composite_diagnosis_code_pointers.



19
20
21
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 19

def composite_diagnosis_code_pointers
  @composite_diagnosis_code_pointers
end

#descriptionObject

Returns the value of attribute description.



19
20
21
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 19

def description
  @description
end

#line_item_charge_amountObject

Returns the value of attribute line_item_charge_amount.



19
20
21
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 19

def line_item_charge_amount
  @line_item_charge_amount
end

#measurement_unitObject

Allowed Values are: 'MJ' Minutes, 'UN' Unit



23
24
25
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 23

def measurement_unit
  @measurement_unit
end

#place_of_service_codeObject

Returns the value of attribute place_of_service_code.



19
20
21
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 19

def place_of_service_code
  @place_of_service_code
end

#procedure_codeObject

Returns the value of attribute procedure_code.



19
20
21
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 19

def procedure_code
  @procedure_code
end

#procedure_identifierObject

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



26
27
28
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 26

def procedure_identifier
  @procedure_identifier
end

#procedure_modifiersObject

Returns the value of attribute procedure_modifiers.



19
20
21
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 19

def procedure_modifiers
  @procedure_modifiers
end

#service_unit_countObject

Returns the value of attribute service_unit_count.



19
20
21
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 19

def service_unit_count
  @service_unit_count
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



50
51
52
53
54
55
56
57
58
59
60
61
62
# 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

.swagger_typesObject

Attribute type mapping.



65
66
67
68
69
70
71
72
73
74
75
76
77
# 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

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



152
153
154
155
156
157
158
159
160
161
162
163
164
165
# 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

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# 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

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



274
275
276
277
278
279
280
281
282
283
284
285
286
# 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

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# 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

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


169
170
171
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 169

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



175
176
177
178
# 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

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



110
111
112
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 110

def list_invalid_properties
  []
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



253
254
255
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 253

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



259
260
261
262
263
264
265
266
267
268
# 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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



247
248
249
# File 'lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb', line 247

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



116
117
118
119
120
121
122
123
124
# 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