Changeset 122 for ruby/trunk


Ignore:
Timestamp:
May 7, 2009, 9:46:57 PM (15 years ago)
Author:
KOBAYASHI, Shinji
Message:

#refs #50

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/models/rm/data_types/quantity.rb

    r120 r122  
    88        class DV_Ordered < OpenEHR::RM::Data_Types::Basic::Data_Value
    99          include Comparable
    10           attr_accessor :other_refference_ranges, :normal_range
    11           attr_accessor :normal_status
    12           def initialize(normal_range, other_reference_ranges,
     10          attr_reader :other_refference_ranges, :normal_range, :normal_status
     11
     12          def initialize(normal_range=nil, other_reference_ranges=nil,
    1313                         normal_status = nil)
    1414            other_reference_ranges_validity(other_reference_ranges)
     
    1717            @normal_status = normal_status
    1818          end         
     19
    1920          def is_normal?
    2021            !normal_range.nil? or !normal_status.nil
    2122          end
     23
    2224          def is_simple?
    2325            normal_status.nil? and other_refference_ranges.nil?
    2426          end
     27
     28          def <=>(other)
     29            raise NotImplementError, 'This method should be implemented'
     30          end
     31
     32          def normal_range=(normal_range)
     33          end
     34
     35          def other_reference_ranges=(other_reference_ranges)
     36          end
     37
    2538          private
    2639          def other_reference_ranges_validity(other_reference_ranges)
     
    5063
    5164          def add(a_diff)
     65            raise NotImplementError, 'add must be implemented'
    5266          end
    5367
    5468          def diff(other)
     69            raise NotImplementError, 'diff must be implemented'
    5570          end
    5671
    5772          def subtract(a_diff)
     73            raise NotImplementError, 'subtract must be implemented'
     74          end
     75        end
     76
     77        class DV_Amount < DV_Quantified
     78          attr_reader :accuracy, :accuracy_is_percent
     79          def infix(dv_amount, op)
     80            raise NotImplementError, 'infix must be implemented'
     81          end
     82          def accuracy=(accuracy)
     83            raise ArgumentError, 'accuracy invalid'
    5884          end
    5985        end
Note: See TracChangeset for help on using the changeset viewer.