Class: OpenEHR::RM::DataTypes::Quantity::DvQuantified

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

Direct Known Subclasses

DvAbsoluteQuantity, DvAmount

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

Attributes inherited from Basic::DataValue

#value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DvOrdered

#is_normal?, #is_simple?, #is_strictly_comparable_to?, #other_reference_ranges=

Methods inherited from Basic::DataValue

#==

Constructor Details

#initialize(args = {}) ⇒ DvQuantified

Returns a new instance of DvQuantified.



66
67
68
69
70
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 66

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

Instance Attribute Details

#magnitudeObject

Returns the value of attribute magnitude.



64
65
66
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 64

def magnitude
  @magnitude
end

#magnitude_statusObject

Returns the value of attribute magnitude_status.



64
65
66
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 64

def magnitude_status
  @magnitude_status
end

Class Method Details

.valid_magnitude_status?(s) ⇒ Boolean

Returns:

  • (Boolean)


95
96
97
98
99
100
101
102
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 95

def self.valid_magnitude_status?(s)
  if s == '=' || s == '>' || s == '<' || s == '<=' ||
      s == '>=' || s == '~'
    return true
  else
    return false
  end
end

Instance Method Details

#<=>(others) ⇒ Object



72
73
74
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 72

def <=>(others)
  self.magnitude <=> others.magnitude
end

#accuracy_unknown?Boolean

Returns:

  • (Boolean)


91
92
93
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 91

def accuracy_unknown?
  return @accuracy.nil?
end