Index: /ruby/branches/0.5/lib/open_ehr/assumed_library_types.rb
===================================================================
--- /ruby/branches/0.5/lib/open_ehr/assumed_library_types.rb	(revision 255)
+++ /ruby/branches/0.5/lib/open_ehr/assumed_library_types.rb	(revision 256)
@@ -81,5 +81,5 @@
     end # end of Interval
   
-    class TIME_DEFINITIONS < Any
+    class TimeDefinitions < Any
       DAYS_IN_LEAP_YEAR = 366
       DAYS_IN_WEEK = 7
@@ -120,19 +120,23 @@
         mo >= 1 and mo <= MONTH_IN_YEAR
       end
-    end # end of TIME_DEFINITIONS
-
-    module ISO8601_DATE_MODULE
+    end # end of TimeDefinitions
+
+    module ISO8601DateModule
       attr_reader :year, :month, :day
+
       def year=(year)
-        raise ArgumentError, "Year is not valid" unless ISO8601_DATE.valid_year?(year)
+        unless !year.nil? && ISO8601Date.valid_year?(year)
+          raise ArgumentError, "Year is not valid"
+        end
         @year = year
       end
+
       def month=(month)
-        raise ArgumentError, "Month is not valid" unless month.nil? or ISO8601_DATE.valid_month?(month)
+        raise ArgumentError, "Month is not valid" unless month.nil? or ISO8601Date.valid_month?(month)
         @month = month
       end
 
       def day=(day)
-        raise ArgumentError, "Day is not valid" unless day.nil? or ISO8601_DATE.valid_day?(@year, @month, day)
+        raise ArgumentError, "Day is not valid" unless day.nil? or ISO8601Date.valid_day?(@year, @month, day)
         @day = day
       end
@@ -174,6 +178,6 @@
     end
 
-    class ISO8601_DATE < TIME_DEFINITIONS
-      include ISO8601_DATE_MODULE
+    class ISO8601Date < TimeDefinitions
+      include ISO8601DateModule
       def initialize(string)
         /(\d{4})(?:-(\d{2})(?:-(\d{2})?)?)?/ =~ string
@@ -205,5 +209,5 @@
     end # end of ISO8601_DATE
 
-    module ISO8601_TIME_MODULE
+    module ISO8601TimeModule
       attr_reader :hour, :minute, :second, :fractional_second, :timezone
 
@@ -289,6 +293,6 @@
     end
 
-    class ISO8601_TIME < TIME_DEFINITIONS
-      include ISO8601_TIME_MODULE
+    class ISO8601Time < TimeDefinitions
+      include ISO8601TimeModule
       def initialize(string)
         /(\d{2}):?(\d{2})?(:?)(\d{2})?((\.|,)(\d+))?(Z|([+-](\d{2}):?(\d{2})))?/ =~ string
@@ -361,6 +365,6 @@
     end # end of ISO8601_TIME
 
-    module ISO8601_DATE_TIME_MODULE
-      include ISO8601_DATE_MODULE, ISO8601_TIME_MODULE
+    module ISO8601DateTimeModule
+      include ISO8601DateModule, ISO8601TimeModule
       def as_string
         if (!@year.nil? and !@month.nil? and !@day.nil?)
@@ -390,6 +394,6 @@
     end
 
-    class ISO8601_DATE_TIME < ISO8601_DATE
-      include ISO8601_DATE_TIME_MODULE
+    class ISO8601DateTime < ISO8601Date
+      include ISO8601DateTimeModule
       def initialize(string)
         /(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|([+-]\d{2}):?(\d{2}))?)?)?)?/ =~ string
@@ -544,5 +548,5 @@
       end
     end
-    class ISO8601_DURATION < TIME_DEFINITIONS
+    class ISO8601_DURATION < TimeDefinitions
       include ISO8601_DURATION_MODULE
       def initialize(str)
Index: /ruby/branches/0.5/spec/lib/open_ehr/assumed_library_types/interval_spec.rb
===================================================================
--- /ruby/branches/0.5/spec/lib/open_ehr/assumed_library_types/interval_spec.rb	(revision 255)
+++ /ruby/branches/0.5/spec/lib/open_ehr/assumed_library_types/interval_spec.rb	(revision 256)
@@ -1,2 +1,3 @@
+<<<<<<< .mine
 require File.dirname(__FILE__) + '/../../../spec_helper'
 include OpenEHR::AssumedLibraryTypes
@@ -48,5 +49,5 @@
   end
 
-  it 'should have not have 1' do
+  it 'should not have 1' do
     @interval.has?(1).should_not be_true
   end
@@ -138,2 +139,143 @@
   end
 end
+=======
+require File.dirname(__FILE__) + '/../../../spec_helper'
+include OpenEHR::AssumedLibraryTypes
+
+describe Interval do
+  before(:each) do
+    @interval = Interval.new(:upper => 10,
+                             :lower => 1)
+  end
+
+  it 'should be an instance of Interval' do
+    @interval.should be_an_instance_of Interval
+  end
+
+  it 's upper should be greater than lower' do
+    @interval.upper.should be > @interval.lower
+  end
+
+  it 's upper should be equal 10' do
+    @interval.upper.should == 10
+  end
+
+  it 's lower should be equal 1' do
+    @interval.lower.should == 1
+  end
+
+  it 'should raise ArgumentError with smaller upper' do
+    lambda {@interval.upper = -1}.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with greater lower' do
+    lambda {@interval.lower = 11}.should raise_error ArgumentError
+  end
+
+  it 'should have 5' do
+    @interval.has?(5).should be_true
+  end
+
+  it 'should not have 11' do
+    @interval.has?(11).should_not be_true
+  end
+
+  it 'should not have -1' do
+    @interval.has?(-1).should_not be_true
+  end
+
+  it 'should not have 10' do
+    @interval.has?(10).should_not be_true
+  end
+
+  it 'should have not have 1' do
+    @interval.has?(1).should_not be_true
+  end
+
+  describe Interval, 'when lower included' do
+    before do
+      @interval.lower_included = true
+    end
+
+    it 'should be lower_included' do
+      @interval.should be_lower_included
+    end
+
+    it 'should have 1 when lower included' do
+      @interval.has?(1).should be_true
+    end
+
+    after do
+      @interval.lower_included = false
+    end
+  end
+
+  describe Interval, 'when upper included' do
+    before do
+      @interval.upper_included = true
+    end
+
+    it 'should be upper uncluded' do
+      @interval.should be_upper_included
+    end
+
+    it 'should have 10 when upper included' do
+      @interval.has?(10).should be_true
+    end
+
+    after do
+      @interval.upper_included = false
+    end
+  end
+
+  describe Interval, 'when upper unbounded' do
+    before do
+      @interval.upper = nil
+    end
+
+    it 'should be upper unbounded' do
+      @interval.should be_upper_unbounded
+    end
+
+    it 'should have 11' do
+      @interval.has?(11).should be_true
+    end
+
+    it 'should raise ArgumentError, when upper_included is assigned' do
+      lambda{
+        @interval.upper_included = true
+      }.should raise_error ArgumentError
+    end
+
+    after do
+      @interval.upper = 10
+    end
+  end
+
+  describe Interval, 'when lower unbounded' do
+    before do
+      @interval.lower = nil
+    end
+
+    it 'should be lower unbounded' do
+      @interval.should be_lower_unbounded
+    end
+
+    it 'should  have -10' do
+      @interval.has?(-10).should be_true
+    end
+
+    it 'should raise ArgumentError, when lower_included is assigned' do
+      lambda{
+        @interval.lower_included = true
+      }.should raise_error ArgumentError
+    end
+  end
+
+  it 'should raise ArgumentError both upper and lower is nil' do
+    lambda {
+      Interval.new
+    }.should raise_error ArgumentError
+  end
+end
+>>>>>>> .r255
Index: /ruby/branches/0.5/spec/lib/open_ehr/assumed_library_types/iso_8601_date_spec.rb
===================================================================
--- /ruby/branches/0.5/spec/lib/open_ehr/assumed_library_types/iso_8601_date_spec.rb	(revision 256)
+++ /ruby/branches/0.5/spec/lib/open_ehr/assumed_library_types/iso_8601_date_spec.rb	(revision 256)
@@ -0,0 +1,156 @@
+require File.dirname(__FILE__) + '/../../../spec_helper'
+include OpenEHR::AssumedLibraryTypes
+
+describe ISO8601Date do
+  before do
+    @iso8601date = ISO8601Date.new('2009-09-10')
+  end
+
+  it 'should be an instance of ISO8601Date' do
+    @iso8601date.should be_an_instance_of ISO8601Date
+  end
+
+  it 'year should be equal 2009' do
+    @iso8601date.year.should be_equal 2009
+  end
+
+  it 'month should be equal 9' do
+    @iso8601date.month.should be_equal 9
+  end
+
+  it 'day should be equal 10' do
+    @iso8601date.day.should be_equal 10
+  end
+
+  it 'should be 2009-09-10 as_string' do
+    @iso8601date.as_string.should == '2009-09-10'
+  end
+
+  describe 'year behavior' do
+    it 'should raise ArgumentError with nil year string' do
+      lambda{ISO8601Date.new('-09-02')}.should raise_error ArgumentError
+    end
+
+    it 'should raise ArgumentError with nil year' do
+      lambda{@iso8601date.year = nil}.should raise_error ArgumentError
+    end
+
+    it 'should not raise ArgumentError more than 0 year' do
+      lambda{@iso8601date.year = 0}.should_not raise_error ArgumentError
+    end
+  end
+
+  describe 'month behavior' do
+    it '1 month should not raise ArgumentError' do
+      lambda{@iso8601date.month = 1}.should_not raise_error ArgumentError
+    end
+
+    it '12 month should not raise ArgumentError' do
+      lambda{@iso8601date.month = 12}.should_not raise_error ArgumentError
+    end
+
+    it '13 month should raise ArgumentError' do
+      lambda{@iso8601date.month = 13}.should raise_error ArgumentError
+    end
+
+    it '0 month should raise ArgumentError' do
+      lambda{@iso8601date.month = 0}.should raise_error ArgumentError
+    end
+  end
+
+  describe 'day behavior' do
+    it '0 day should raise ArgumentError' do
+      lambda{@iso8601date.day = 0}.should raise_error ArgumentError
+    end
+  end
+
+  describe 'January behavior' do
+    before do
+      @iso8601date.month = 1
+    end
+
+    it 'January should have 31 days' do
+      lambda{@iso8601date.day = 31}.should_not raise_error ArgumentError
+    end
+
+    it 'January should not have 32 days' do
+      lambda{@iso8601date.month = 32}.should raise_error ArgumentError
+    end
+  end
+
+  describe 'February and leap year behavior' do
+    before do
+      @iso8601date.month = 2
+    end
+
+    describe '2009(not leap year) behavior' do
+      before do
+        @iso8601date.year = 2009
+      end
+
+      it '2009-02-28 should not raise ArgumentError' do
+        lambda{@iso8601date.day = 28}.should_not raise_error ArgumentError
+      end
+
+      it '2009-02-29 should raise ArgumentError' do
+        lambda{@iso8601date.day = 29}.should raise_error ArgumentError
+      end
+    end
+
+    describe '2008(leap year) behavior' do
+      before do
+        @iso8601date.year = 2008
+      end
+
+      it '2008-02-29 should not raise ArgumentError' do
+        lambda{@iso8601date.day = 29}.should_not raise_error ArgumentError
+      end
+
+      it '2008-02-30 should raise ArgumentError' do
+        lambda{@iso8601date.day = 30}.should raise_error ArgumentError
+      end
+    end
+
+    describe '2000(irregular leap year' do
+      before do
+        @iso8601date.year = 2000
+      end
+
+      it '2000-02-29 should not raise ArgumentError' do
+        lambda{@iso8601date.day = 29}.should_not raise_error ArgumentError
+      end
+
+      it '2000-02-30 should raise ArgumentError' do
+        lambda{@iso8601date.day = 30}.should raise_error ArgumentError
+      end
+    end
+  end
+
+  describe 'March behavior' do
+    before do
+      @iso8601date.month = 3
+    end
+
+    it '31 day should not raise ArgumentError' do
+      lambda{@iso8601date.day = 31}.should_not raise_error ArgumentError
+    end
+
+    it '32 day should raise ArgumentError' do
+      lambda{@iso8601date.day = 32}.should raise_error ArgumentError
+    end
+  end
+
+  describe 'April behavior' do
+    before do
+      @iso8601date.month = 4
+    end
+
+    it '30 day should not raise ArgumentError' do
+      lambda{@iso8601date.day = 30}.should_not raise_error ArgumentError
+    end
+
+    it '31 day should raise ArgumentError' do
+      lambda{@iso8601date.day = 31}.should raise_error ArgumentError
+    end
+  end
+end
Index: /ruby/branches/0.5/test/unit/open_ehr/assumed_library_types_test.rb
===================================================================
--- /ruby/branches/0.5/test/unit/open_ehr/assumed_library_types_test.rb	(revision 255)
+++ /ruby/branches/0.5/test/unit/open_ehr/assumed_library_types_test.rb	(revision 256)
@@ -57,114 +57,114 @@
 
   def test_time_definitions
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::DAYS_IN_LEAP_YEAR, 366
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::DAYS_IN_WEEK, 7
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::DAYS_IN_YEAR, 365
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::HOURS_IN_DAY, 24
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::MAX_DAYS_IN_MONTH, 31
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::MAX_DAYS_IN_YEAR, 366
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::MINUTES_IN_HOUR, 60
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::MONTH_IN_YEAR, 12
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::NOMINAL_DAYS_IN_MONTH, 30.42
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::NOMINAL_DAYS_IN_YEAR, 365.24
-    assert_equal OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS::SECONDS_IN_MINUTE, 60
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::DAYS_IN_LEAP_YEAR, 366
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::DAYS_IN_WEEK, 7
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::DAYS_IN_YEAR, 365
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::HOURS_IN_DAY, 24
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::MAX_DAYS_IN_MONTH, 31
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::MAX_DAYS_IN_YEAR, 366
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::MINUTES_IN_HOUR, 60
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::MONTH_IN_YEAR, 12
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::NOMINAL_DAYS_IN_MONTH, 30.42
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::NOMINAL_DAYS_IN_YEAR, 365.24
+    assert_equal OpenEhr::AssumedLibraryTypes::TimeDefinitions::SECONDS_IN_MINUTE, 60
   end
 
   def test_time_definition_validity
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_year?(2008)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_year?(-20)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_year?(0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_year?(2008)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_year?(-20)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_year?(0)
 # today
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,6,19)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,6,19)
 # test valid_day lower limit
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(0,0,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(0,1,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(-1,1,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(0,1,0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(0,0,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(0,1,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(-1,1,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(0,1,0)
 # test valid_day upper and lowerlimit of each month
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(0,0,1)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,1,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,1,0)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,0,1)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,1,31)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,1,32)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,2,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,2,0)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,2,31)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,3,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,3,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,3,31)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,3,32)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,4,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,4,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,4,30)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,4,31)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,5,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,5,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,5,31)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,5,32)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,6,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,6,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,6,30)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,6,31)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,7,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,7,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,7,31)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,7,32)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,8,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,8,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,8,31)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,8,32)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,9,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,9,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,9,30)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,9,31)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,10,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,10,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,10,31)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,10,32)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,11,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,11,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,11,30)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,11,31)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,12,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,12,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,12,31)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,12,32)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(0,0,1)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,1,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,1,0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,0,1)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,1,31)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,1,32)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,2,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,2,0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,2,31)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,3,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,3,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,3,31)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,3,32)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,4,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,4,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,4,30)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,4,31)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,5,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,5,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,5,31)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,5,32)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,6,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,6,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,6,30)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,6,31)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,7,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,7,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,7,31)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,7,32)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,8,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,8,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,8,31)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,8,32)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,9,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,9,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,9,30)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,9,31)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,10,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,10,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,10,31)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,10,32)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,11,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,11,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,11,30)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,11,31)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,12,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,12,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,12,31)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,12,32)
 # test valid_day leap year
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(1900,2,28)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(1900,2,29)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2000,2,29)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,2,29)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(1900,2,28)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(1900,2,29)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2000,2,29)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_day?(2008,2,29)
 # test valid_hour lower limit
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(0,0,0)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(-1,0,0)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(0,-1,0)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(0,0,-1)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(0,0,0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(-1,0,0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(0,-1,0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(0,0,-1)
 # test valid_hour upper limit
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(0,59,0)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(0,60,0)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(0,0,59)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(0,0,60)
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(24,0,0)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(24,0,1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_hour?(24,1,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(0,59,0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(0,60,0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(0,0,59)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(0,0,60)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(24,0,0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(24,0,1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_hour?(24,1,0)
 # test valid_minute method lower limit
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_minute?(0)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_minute?(-1)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_minute?(0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_minute?(-1)
 # test valid_minute method upper limit
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_minute?(59)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_minute?(60)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_minute?(59)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_minute?(60)
 # test valid_second method lower limit
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_second?(0)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_second?(-1)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_second?(0)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_second?(-1)
 # test valid_second method upper limit
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_second?(59)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_second?(60)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_second?(59)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_second?(60)
 # test valid_month method lower limit
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_month?(1)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_month?(0)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_month?(1)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_month?(0)
 # test valid_month method upper limit
-    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_month?(12)
-    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_month?(13)
+    assert OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_month?(12)
+    assert !OpenEhr::AssumedLibraryTypes::TimeDefinitions.valid_month?(13)
   end
   def test_iso8601_date
@@ -172,5 +172,5 @@
     assert_equal 4,@iso8601_date.month
     assert_equal 27,@iso8601_date.day
-    assert_nothing_raised(Exception){@iso8601_date = OpenEhr::AssumedLibraryTypes::ISO8601_DATE.new('2008')}
+    assert_nothing_raised(Exception){@iso8601_date = OpenEHR::AssumedLibraryTypes::ISO8601_DATE.new('2008')}
     assert @iso8601_date.day_unknown?
     assert @iso8601_date.month_unknown?
@@ -193,6 +193,6 @@
     assert !@iso8601_date.is_partial?
     assert_equal "2008-06-14", @iso8601_date.as_string
-    assert OpenEhr::AssumedLibraryTypes::ISO8601_DATE.valid_iso8601_date?("2006-06-14")
-    assert !OpenEhr::AssumedLibraryTypes::ISO8601_DATE.valid_iso8601_date?("ABCDEFG")
+    assert OpenEHR::AssumedLibraryTypes::ISO8601_DATE.valid_iso8601_date?("2006-06-14")
+    assert !OpenEHR::AssumedLibraryTypes::ISO8601_DATE.valid_iso8601_date?("ABCDEFG")
   end
 
@@ -206,5 +206,5 @@
 #    assert_nothing_raised(Exception){@iso8601_time = OpenEHR::Assumed_Library_Types::ISO8601_TIME.new('15:55:37.32+0900')}
 
-    assert_nothing_raised(Exception){@iso8601_time = OpenEhr::AssumedLibraryTypes::ISO8601_TIME.new('01')}
+    assert_nothing_raised(Exception){@iso8601_time = OpenEHR::AssumedLibraryTypes::ISO8601_TIME.new('01')}
     assert_equal 1, @iso8601_time.hour
     assert @iso8601_time.is_partial?
@@ -252,11 +252,11 @@
     assert @iso8601_time.is_extended?
     assert !@iso8601_time.is_decimal_sign_comma?
-    assert OpenEhr::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("012345Z")
-    assert OpenEhr::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("012345.67+0900")
-    assert !OpenEhr::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("242345.67+0900")
-    assert !OpenEhr::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("242345.67+0900")
-    assert OpenEhr::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("240000")
-    assert OpenEhr::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("240000Z")
-    assert !OpenEhr::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("240000.011Z")
+    assert OpenEHR::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("012345Z")
+    assert OpenEHR::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("012345.67+0900")
+    assert !OpenEHR::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("242345.67+0900")
+    assert !OpenEHR::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("242345.67+0900")
+    assert OpenEHR::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("240000")
+    assert OpenEHR::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("240000Z")
+    assert !OpenEHR::AssumedLibraryTypes::ISO8601_TIME.valid_iso8601_time?("240000.011Z")
   end
 
