Class: OpenEHR::RM::DataTypes::Quantity::DvScale

Inherits:
DvOrdered show all
Defined in:
lib/openehr/rm/data_types/quantity.rb

Overview

RM 1.1.0 (SPECRM-19): like DV_ORDINAL, but for scales/scores whose points are Real-valued rather than Integer-valued (e.g. the Borg CR10 breathlessness scale, which includes 0.5).

Constant Summary

Constants included from Support::Definition::BasicDefinition

Support::Definition::BasicDefinition::CR, Support::Definition::BasicDefinition::LF

Instance Attribute Summary collapse

Attributes inherited from DvOrdered

#normal_range, #normal_status, #other_reference_ranges

Instance Method Summary collapse

Methods inherited from DvOrdered

#is_normal?, #is_simple?

Methods inherited from Basic::DataValue

#==

Constructor Details

#initialize(args = {}) ⇒ DvScale

Returns a new instance of DvScale.



152
153
154
155
# File 'lib/openehr/rm/data_types/quantity.rb', line 152

def initialize(args = {})
  super(args)
  self.symbol = args[:symbol]
end

Instance Attribute Details

#symbolObject

Returns the value of attribute symbol.



150
151
152
# File 'lib/openehr/rm/data_types/quantity.rb', line 150

def symbol
  @symbol
end

#valueObject

Returns the value of attribute value.



150
151
152
# File 'lib/openehr/rm/data_types/quantity.rb', line 150

def value
  @value
end

Instance Method Details

#<=>(other) ⇒ Object



168
169
170
# File 'lib/openehr/rm/data_types/quantity.rb', line 168

def <=>(other)
  @value <=> other.value
end

#is_strictly_comparable_to?(others) ⇒ Boolean

Returns:

  • (Boolean)


172
173
174
175
176
177
# File 'lib/openehr/rm/data_types/quantity.rb', line 172

def is_strictly_comparable_to?(others)
  return false unless super(others)

  others.symbol.defining_code.terminology_id.value ==
    @symbol.defining_code.terminology_id.value
end