Class: OpenEHR::RM::DataTypes::Quantity::DvOrdered
- Inherits:
-
Basic::DataValue
- Object
- Basic::DataValue
- OpenEHR::RM::DataTypes::Quantity::DvOrdered
- Includes:
- Comparable
- Defined in:
- lib/open_ehr/rm/data_types/quantity.rb
Direct Known Subclasses
Constant Summary
Constants included from Support::Definition::BasicDefinition
Support::Definition::BasicDefinition::CR, Support::Definition::BasicDefinition::LF
Instance Attribute Summary collapse
-
#normal_range ⇒ Object
Returns the value of attribute normal_range.
-
#normal_status ⇒ Object
Returns the value of attribute normal_status.
-
#other_refference_ranges ⇒ Object
Returns the value of attribute other_refference_ranges.
Attributes inherited from Basic::DataValue
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(args = {}) ⇒ DvOrdered
constructor
A new instance of DvOrdered.
- #is_normal? ⇒ Boolean
- #is_simple? ⇒ Boolean
- #is_strictly_comparable_to?(others) ⇒ Boolean
- #other_reference_ranges=(other_reference_ranges) ⇒ Object
Methods inherited from Basic::DataValue
Constructor Details
#initialize(args = {}) ⇒ DvOrdered
Returns a new instance of DvOrdered.
19 20 21 22 23 24 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 19 def initialize(args = {}) super(args) self.normal_range = args[:normal_range] self.normal_status = args[:normal_status] self.other_reference_ranges = args[:other_reference_ranges] end |
Instance Attribute Details
#normal_range ⇒ Object
Returns the value of attribute normal_range.
17 18 19 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 17 def normal_range @normal_range end |
#normal_status ⇒ Object
Returns the value of attribute normal_status.
17 18 19 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 17 def normal_status @normal_status end |
#other_refference_ranges ⇒ Object
Returns the value of attribute other_refference_ranges.
17 18 19 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 17 def other_refference_ranges @other_refference_ranges end |
Instance Method Details
#<=>(other) ⇒ Object
40 41 42 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 40 def <=>(other) raise NotImplementedError, 'This method should be implemented' end |
#is_normal? ⇒ Boolean
26 27 28 29 30 31 32 33 34 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 26 def is_normal? if @normal_range.nil? and @normal_status.nil? return false elsif !@normal_range.nil? return @normal_range.has(@value) elsif !@normal_status.nil? return @normal_status.code_string == 'N' end end |
#is_simple? ⇒ Boolean
36 37 38 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 36 def is_simple? return @other_reference_ranges.nil? end |
#is_strictly_comparable_to?(others) ⇒ Boolean
51 52 53 54 55 56 57 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 51 def is_strictly_comparable_to?(others) if others.instance_of? self.class return true else return false end end |
#other_reference_ranges=(other_reference_ranges) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/open_ehr/rm/data_types/quantity.rb', line 44 def other_reference_ranges=(other_reference_ranges) if !other_reference_ranges.nil? && other_reference_ranges.empty? raise ArgumentError, "Other reference ranges validity error" end @other_reference_ranges = other_reference_ranges end |