Index: ruby/trunk/lib/models/Rakefile
===================================================================
--- ruby/trunk/lib/models/Rakefile	(revision 141)
+++ ruby/trunk/lib/models/Rakefile	(revision 142)
@@ -1,4 +1,4 @@
 require 'rubygems'
-Gem::manage_gems
+#Gem::manage_gems
 require 'rake'
 require 'rake/testtask'
Index: ruby/trunk/lib/models/rm/data_types/quantity.rb
===================================================================
--- ruby/trunk/lib/models/rm/data_types/quantity.rb	(revision 141)
+++ ruby/trunk/lib/models/rm/data_types/quantity.rb	(revision 142)
@@ -46,5 +46,5 @@
           end
 
-          def is_strictry_comparable_to?(other)
+          def is_strictly_comparable_to?(other)
             raise NotImplementedError, 'this method should be implemented'
           end
@@ -54,5 +54,5 @@
 
         end
-        
+
         class DV_Quantified < DV_Ordered
 
@@ -76,19 +76,45 @@
 
         class DV_Ordinal < DV_Ordered
-          attr_reader :value, :symbol
-          def initialize(value, symbol, normal_range=nil, normal_status = nil,
-                         other_reference_ranges=nil)
+          attr_reader :value, :symbol, :limits
+
+          def initialize(value, symbol, limits=nil, normal_range=nil,
+                         normal_status = nil, other_reference_ranges=nil)
+            self.value = value
+            self.symbol = symbol
+            self.limits = limits
+            super(normal_range, normal_status, other_reference_ranges)
           end
 
-          def is_strictly_comparable_to?
+          def value=(value)
+            raise ArgumentError, 'value should not be nil' if value.nil?
+            @value = value
+          end
 
+          def symbol=(symbol)
+            raise ArgumentError,'symbol should not be nil' if symbol.nil?
+            @symbol = symbol
+          end
+
+          def is_strictly_comparable_to?(others)
+            unless others.instance_of? OpenEHR::RM::Data_Types::Quantity::DV_Ordinal
+              return false
+            end
+            unless others.symbol.defining_code.terminology_id.value ==
+                @symbol.defining_code.terminology_id.value
+              return false
+            end
+            return true
           end
 
           def <=>(other)
-              @value <=> other.value
+            @value <=> other.value
           end
 
-          def limits
-
+          def limits=(limits)
+            unless limits.nil? or limits.meaning.value == 'limits'
+              raise ArgumentError, 'invalid limits'
+            else
+              @limits = limits
+            end
           end
         end
Index: ruby/trunk/lib/models/rm/data_types/quantity/date_time.rb
===================================================================
--- ruby/trunk/lib/models/rm/data_types/quantity/date_time.rb	(revision 141)
+++ ruby/trunk/lib/models/rm/data_types/quantity/date_time.rb	(revision 142)
@@ -43,9 +43,4 @@
             end
           end
-
-          class DV_Interval
-            def initialize
-            end
-          end
         end # of Date_Time
       end # of Quantity
Index: ruby/trunk/lib/models/tests/rm/test_data_types.rb
===================================================================
--- ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 141)
+++ ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 142)
@@ -165,10 +165,13 @@
       @dv_ordered = OpenEHR::RM::Data_Types::Quantity::DV_Ordered.new }
     assert_nothing_raised(Exception){
-      @dv_interval = OpenEHR::RM::Data_Types::Quantity::Date_Time::DV_Interval.new}
+      @dv_interval = OpenEHR::RM::Data_Types::Quantity::DV_Interval.new(1,10)}
     meaning = OpenEHR::RM::Data_Types::Text::DV_Text.new('normal')
     assert_nothing_raised(Exception){
       @reference_range = OpenEHR::RM::Data_Types::Quantity::Reference_Range.new(meaning)}
     assert_nothing_raised(Exception){
-      @dv_ordinal = OpenEHR::RM::Data_Types::Quantity::DV_Ordinal.new(1,'+')}
+      terminology = OpenEHR::RM::Support::Identification::Terminology_ID.new('urine', '')
+      code_phrase = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('protein',terminology)
+      urinary_protein = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new('+', code_phrase)
+      @dv_ordinal = OpenEHR::RM::Data_Types::Quantity::DV_Ordinal.new(1, urinary_protein)}
     assert_nothing_raised(Exception){
       @dv_quantified = OpenEHR::RM::Data_Types::Quantity::DV_Quantified.new }
@@ -182,5 +185,5 @@
      assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Ordered, @dv_ordered
      assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Quantified, @dv_quantified
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::Date_Time::DV_Interval, @dv_interval
+     assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Interval, @dv_interval
      assert_instance_of OpenEHR::RM::Data_Types::Quantity::Reference_Range, @reference_range
      
@@ -206,9 +209,10 @@
     other = OpenEHR::RM::Data_Types::Quantity::DV_Ordered.new
     assert_raise(NotImplementedError){
-      @dv_ordered.is_strictry_comparable_to?(other)}
+      @dv_ordered.is_strictly_comparable_to?(other)}
   end
 
   def test_reference_range
     assert_equal 'normal', @reference_range.meaning.value
+    
   end
 
@@ -226,5 +230,24 @@
 
   def test_dv_ordinal
-    
+    assert_equal 1, @dv_ordinal.value
+    assert_equal '+', @dv_ordinal.symbol.value
+    assert_raise(ArgumentError){@dv_ordinal.symbol = nil}
+    assert_raise(ArgumentError){@dv_ordinal.value = nil}
+    terminology = OpenEHR::RM::Support::Identification::Terminology_ID.new('urine', '')
+    code_phrase = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('protein',terminology)
+    urinary_protein = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new('++', code_phrase)
+    assert_nothing_raised(Exception){
+      @dv_ordinal2 = OpenEHR::RM::Data_Types::Quantity::DV_Ordinal.new(2, urinary_protein)}
+    assert @dv_ordinal.is_strictly_comparable_to?(@dv_ordinal2)
+    assert @dv_ordinal < @dv_ordinal2
+    assert @dv_ordinal2 > @dv_ordinal
+    @dv_ordinal.value = 3
+    assert 3, @dv_ordinal.value
+    assert @dv_ordinal > @dv_ordinal2
+    assert_raise(ArgumentError){@dv_ordinal.limits = @reference_range}
+    meaning = OpenEHR::RM::Data_Types::Text::DV_Text.new('limits')
+    limit_reference_range = OpenEHR::RM::Data_Types::Quantity::Reference_Range.new(meaning)
+    assert_nothing_raised(Exception){@dv_ordinal.limits = limit_reference_range}
+    assert_equal 'limits', @dv_ordinal.limits.meaning.value
   end
 
