Class: OpenEHR::RM::DataTypes::Quantity::DvOrdinal

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

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_refference_ranges

Instance Method Summary collapse

Methods inherited from DvOrdered

#is_normal?, #is_simple?, #other_reference_ranges=

Methods inherited from Basic::DataValue

#==

Constructor Details

#initialize(args = {}) ⇒ DvOrdinal

Returns a new instance of DvOrdinal.



108
109
110
111
112
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 108

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

Instance Attribute Details

#limitsObject

Returns the value of attribute limits.



106
107
108
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 106

def limits
  @limits
end

#symbolObject

Returns the value of attribute symbol.



106
107
108
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 106

def symbol
  @symbol
end

#valueObject

Returns the value of attribute value.



106
107
108
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 106

def value
  @value
end

Instance Method Details

#<=>(other) ⇒ Object



124
125
126
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 124

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

#is_strictly_comparable_to?(others) ⇒ Boolean

Returns:

  • (Boolean)


135
136
137
138
139
140
141
142
143
144
145
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 135

def is_strictly_comparable_to?(others)
  unless super(others)
    return false
  end
  unless others.symbol.defining_code.terminology_id.value ==
      @symbol.defining_code.terminology_id.value
    return false
  else
    return true
  end
end