Index: /ruby/trunk/lib/models/assumed_library_types.rb
===================================================================
--- /ruby/trunk/lib/models/assumed_library_types.rb	(revision 123)
+++ /ruby/trunk/lib/models/assumed_library_types.rb	(revision 124)
@@ -183,14 +183,18 @@
         @hour = hour
       end
+
       def minute_unknown?
         @minute.nil?
       end
+
       def minute=(minute)
         raise ArgumentError, "minute is not valid" if !minute.nil? and !ISO8601_TIME.valid_minute?(minute)
         @minute = minute
       end
+
       def second_unknown?
         @second.nil?
       end
+
       def second=(second)
         raise ArgumentError, "minute not defined" if @minute.nil? and !second.nil?
@@ -198,4 +202,5 @@
         @second = second
       end
+
       def fractional_second=(fractional_second)
         raise ArgumentError, "minute not defined" if minute_unknown? and !fractional_second.nil?
@@ -204,4 +209,5 @@
         @fractional_second = fractional_second
       end
+
       def has_fractional_second?
         if @fractional_second.nil?
@@ -211,4 +217,5 @@
         end
       end
+
       def timezone=(timezone)
         unless timezone.nil? or timezone == 'Z'
@@ -222,10 +229,13 @@
         end
       end
+
       def is_decimal_sign_comma?
         true
       end
+
       def is_extended?
         true
       end
+
       def is_partial?
         second_unknown? or minute_unknown?
@@ -370,7 +380,9 @@
     class ISO8601_TIMEZONE
       attr_accessor :sign, :hour, :minute
+
       def is_gmt?
         @sign == "+1" and @hour == 0 and @minute == 0
       end
+
       def as_string
         if @sign == "+1"
@@ -383,10 +395,14 @@
     end # end of ISO8601_TIMEZONE
 
-    class ISO_8601_DURATION
+    class ISO8601_DURATION
       
       def initialize
-      end
-
-    end
+        
+      end
+
+      def as_string
+
+      end
+    end # end of ISO8601_DURATION
   end # end of Assumed_Types
 end # end of OpenEHR
Index: /ruby/trunk/lib/models/rm/data_types/quantity.rb
===================================================================
--- /ruby/trunk/lib/models/rm/data_types/quantity.rb	(revision 123)
+++ /ruby/trunk/lib/models/rm/data_types/quantity.rb	(revision 124)
@@ -10,13 +10,19 @@
           attr_reader :other_refference_ranges, :normal_range, :normal_status
 
-          def initialize(normal_range=nil, other_reference_ranges=nil,
-                         normal_status = nil)
+          def initialize(normal_range=nil, normal_status = nil,
+                         other_reference_ranges=nil)
             self.normal_range = normal_range
+            self.normal_status = normal_status
             self.other_reference_ranges = other_reference_ranges
-            self.normal_status = normal_status
           end          
 
           def is_normal?
-            !normal_range.nil? or !normal_status.nil?
+            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
 
@@ -26,5 +32,5 @@
 
           def <=>(other)
-            raise NotImplementError, 'This method should be implemented'
+            raise NotImplementedError, 'This method should be implemented'
           end
 
@@ -88,4 +94,8 @@
         end
 
+        class Reference_Range
+          
+        end
+
         autoload :Date_Time, "rm/data_types/quantity/date_time.rb"
         
Index: /ruby/trunk/lib/models/rm/data_types/text.rb
===================================================================
--- /ruby/trunk/lib/models/rm/data_types/text.rb	(revision 123)
+++ /ruby/trunk/lib/models/rm/data_types/text.rb	(revision 124)
@@ -130,4 +130,5 @@
         class DV_Coded_Text < DV_Text
           attr_reader :defining_code
+
           def initialize(value, defining_code, formatting = nil, 
                          hyperlink = nil, mappings = nil, language = nil, 
@@ -136,11 +137,10 @@
             self.defining_code = defining_code
           end
+
           def defining_code=(defining_code)
-            definition_exists(defining_code)
+            if defining_code.nil?
+              raise ArgumentError, "Defiinition must be exist" 
+            end
             @defining_code = defining_code
-          end
-          private
-          def definition_exists(defining_code)
-            raise ArgumentError, "Defiinition must be exist" if defining_code.nil?
           end
         end
Index: /ruby/trunk/lib/models/tests/rm/test_data_types.rb
===================================================================
--- /ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 123)
+++ /ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 124)
@@ -171,4 +171,14 @@
   def test_dv_ordered
     assert !@dv_ordered.is_normal?
+    assert_nil @dv_ordered.normal_status
+    assert_nil @dv_ordered.normal_range
+    assert_nil @dv_ordered.other_refference_ranges
+    assert_raise(NotImplementedError){@dv_ordered<=>1}
+    openehr_terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('openEHR','')
+    normal_code = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('N', openehr_terminology_id)
+    assert_equal 'N', normal_code.code_string
+    assert_nothing_raised(Exception){
+      @dv_ordered.normal_status = normal_code }
+    assert @dv_ordered.is_normal?
   end
 end
Index: /ruby/trunk/lib/models/tests/test_assumed_library_types.rb
===================================================================
--- /ruby/trunk/lib/models/tests/test_assumed_library_types.rb	(revision 123)
+++ /ruby/trunk/lib/models/tests/test_assumed_library_types.rb	(revision 124)
@@ -9,7 +9,8 @@
     assert_nothing_raised(Exception){@iso8601_time = OpenEHR::Assumed_Library_Types::ISO8601_TIME.new('15:55:37.32+0900')}
     assert_nothing_raised(Exception){@iso8601_date_time = OpenEHR::Assumed_Library_Types::ISO8601_DATE_TIME.new('2009-04-27T15:55:37.32+0900')}
-#    assert_nothing_raised(Exception){@iso8601_duration = OpenEHR::Assumed_Library_Types::ISO8601_DURATION.new()}
+    assert_nothing_raised(Exception){@iso8601_duration = OpenEHR::Assumed_Library_Types::ISO8601_DURATION.new()}
     assert_nothing_raised(Exception){@iso8601_timezone = OpenEHR::Assumed_Library_Types::ISO8601_TIMEZONE.new}
   end
+
   def test_initialize
     assert_instance_of OpenEHR::Assumed_Library_Types::Interval, @interval
@@ -18,6 +19,8 @@
     assert_instance_of OpenEHR::Assumed_Library_Types::ISO8601_TIME, @iso8601_time
     assert_instance_of OpenEHR::Assumed_Library_Types::ISO8601_DATE_TIME, @iso8601_date_time
+    assert_instance_of OpenEHR::Assumed_Library_Types::ISO8601_DURATION, @iso8601_duration
     assert_instance_of OpenEHR::Assumed_Library_Types::ISO8601_TIMEZONE, @iso8601_timezone
   end
+
   def test_limits_comparable
     assert @interval.lower < @interval.upper
@@ -26,4 +29,5 @@
     assert @interval.lower < @interval.upper
   end
+
   def test_limits_consistent
     assert @interval.has?(1.5)
