Class: OpenEHR::RM::DataTypes::Quantity::DvQuantity
- Inherits:
-
DvAmount
- Object
- Basic::DataValue
- DvOrdered
- DvQuantified
- DvAmount
- OpenEHR::RM::DataTypes::Quantity::DvQuantity
- Defined in:
- lib/openehr/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
-
#precision ⇒ Object
Returns the value of attribute precision.
-
#units ⇒ Object
Returns the value of attribute units.
-
#units_display_name ⇒ Object
RM 1.1.0 (SPECRM-65): units is UCUM by default; units_system names another units system when units isn't UCUM, and units_display_name gives a displayable form when the units code itself isn't one (e.g. UCUM 'Cel' vs '°C').
-
#units_system ⇒ Object
RM 1.1.0 (SPECRM-65): units is UCUM by default; units_system names another units system when units isn't UCUM, and units_display_name gives a displayable form when the units code itself isn't one (e.g. UCUM 'Cel' vs '°C').
Attributes inherited from DvAmount
Attributes inherited from DvQuantified
Attributes inherited from DvOrdered
#normal_range, #normal_status, #other_reference_ranges
Attributes inherited from Basic::DataValue
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ DvQuantity
constructor
A new instance of DvQuantity.
- #is_integral? ⇒ Boolean
- #is_strictly_comparable_to?(others) ⇒ Boolean
Methods inherited from DvAmount
#+, #-, #-@, #accuracy_is_percent?, #set_accuracy, valid_percentage
Methods inherited from DvQuantified
#<=>, #accuracy_unknown?, valid_magnitude_status?
Methods inherited from DvOrdered
#<=>, #is_normal?, #is_simple?
Methods inherited from Basic::DataValue
Constructor Details
#initialize(args = {}) ⇒ DvQuantity
Returns a new instance of DvQuantity.
283 284 285 286 287 288 289 |
# File 'lib/openehr/rm/data_types/quantity.rb', line 283 def initialize(args = {}) super(args) self.units = args[:units] self.precision = args[:precision] self.units_system = args[:units_system] self.units_display_name = args[:units_display_name] end |
Instance Attribute Details
#precision ⇒ Object
Returns the value of attribute precision.
276 277 278 |
# File 'lib/openehr/rm/data_types/quantity.rb', line 276 def precision @precision end |
#units ⇒ Object
Returns the value of attribute units.
276 277 278 |
# File 'lib/openehr/rm/data_types/quantity.rb', line 276 def units @units end |
#units_display_name ⇒ Object
RM 1.1.0 (SPECRM-65): units is UCUM by default; units_system names another units system when units isn't UCUM, and units_display_name gives a displayable form when the units code itself isn't one (e.g. UCUM 'Cel' vs '°C'). Both optional.
281 282 283 |
# File 'lib/openehr/rm/data_types/quantity.rb', line 281 def units_display_name @units_display_name end |
#units_system ⇒ Object
RM 1.1.0 (SPECRM-65): units is UCUM by default; units_system names another units system when units isn't UCUM, and units_display_name gives a displayable form when the units code itself isn't one (e.g. UCUM 'Cel' vs '°C'). Both optional.
281 282 283 |
# File 'lib/openehr/rm/data_types/quantity.rb', line 281 def units_system @units_system end |
Instance Method Details
#is_integral? ⇒ Boolean
309 310 311 312 313 314 315 |
# File 'lib/openehr/rm/data_types/quantity.rb', line 309 def is_integral? if @precision.nil? || precision != 0 return false else return true end end |
#is_strictly_comparable_to?(others) ⇒ Boolean
303 304 305 306 307 |
# File 'lib/openehr/rm/data_types/quantity.rb', line 303 def is_strictly_comparable_to?(others) return false unless super(others) others.units == @units && others.units_system == @units_system end |