Index: ruby/trunk/lib/models/am.rb
===================================================================
--- ruby/trunk/lib/models/am.rb	(revision 268)
+++ 	(revision )
@@ -1,57 +1,0 @@
-#! /usr/bin/env ruby
-# component: openEHR Ruby reference implementation
-# description: This file includes Archetype 
-#      class that contains Archetype values.
-#      Main concept is based on Java ref impl.
-#      We should make refactoring to suit for Ruby way.
-# keywords: archetype
-# author: Akimichi TATSUKAWA, Shinji KOBAYASHI
-# support: openEHR.jp
-# license: openEHR open source license
-#
-
-$:.unshift File.join(File.dirname(__FILE__))
-require 'rm/common/resource.rb'
-#require 'rm/support/terminology/openehr_code_set_identifier.rb'
-module OpenEHR
-  module AM
-    module Archetype
-      autoload :ARCHETYPE, "am/archetype/archetype.rb"
-      autoload :Constraint_Model, "am/archetype/constraint_model/archetype_constraint.rb"
-      autoload :Ontology, "am/archetype/ontology.rb"
-      
-      module Archetype_Description
-        autoload :ARCHETYPE_DESCRIPTION, "am/archetype/archetype_description/archetype_description.rb"
-      end
-
-      module Constraint_Model
-        autoload :ARCHETYPE_CONSTRAINT, "am/archetype/constraint_model/archetype_constraint.rb"
-        autoload :ARCHETYPE_SLOT, "am/archetype/constraint_model/archetype_constraint.rb"
-        autoload :Primitive, "am/archetype/constraint_model/primitive.rb"
-      end #end of ConstraintModel
-
-      module Assertion
-        autoload :ASSERTION, "am/archetype/constraint_model/assertion.rb"
-      end
-
-    end # of Archetype
-
-    module OpenEHR_Profile
-      module Data_Types
-        module Basic
-          autoload :C_DV_STATE, "am/openehr_profile/data_types/basic.rb"
-        end
-
-        module Text
-          autoload :C_CODE_PHASE, "am/openehr_profile/data_types/text.rb"
-        end
-
-        module Quantity
-          autoload :C_DV_QUANTITY, "am/openehr_profile/data_types/quantity.rb"
-          autoload :C_DV_ORDINAL, "am/openehr_profile/data_types/quantity.rb"
-          autoload :C_QUANTITY_ITEM, "am/openehr_profile/data_types/quantity.rb"
-        end
-      end
-    end
-  end # of AM
-end # of OpenEHR
Index: ruby/trunk/lib/models/assumed_library_types.rb
===================================================================
--- ruby/trunk/lib/models/assumed_library_types.rb	(revision 268)
+++ 	(revision )
@@ -1,563 +1,0 @@
-# This module is related to the ticket #36
-require 'date'
-require 'time'
-
-module OpenEHR
-  module Assumed_Library_Types
-    class Any < Object
-      
-    end # of Any
-
-    class Interval < Any
-      attr_reader :lower, :upper
-      
-      def initialize(lower, upper, 
-                     lower_included = nil, upper_included = nil)
-        check_lower_upper(lower, upper)
-        self.lower_included = lower_included
-        self.upper_included = upper_included
-      end
-
-      def lower=(lower)
-        check_lower_upper(lower, @upper)
-      end
-
-      def upper=(upper)
-        check_lower_upper(@lower, upper)
-      end
-
-      def lower_included?
-        return @lower_included
-      end
-
-      def lower_included=(lower_included)
-        if (lower == nil) && (lower_included != nil)
-          raise ArgumentError, "lower is not set"
-        end
-        @lower_included = lower_included
-      end
-      
-      def lower_unbounded?
-        return @lower.nil?
-      end
-
-      def upper_included?
-        return @upper_included
-      end
-
-      def upper_included=(upper_included)
-        if (upper == nil) && (upper_included != nil)
-          raise ArgumentError, "upper is not set"
-        end
-        @upper_included = upper_included
-      end
-
-      def upper_unbounded?
-        return @upper.nil?
-      end
-
-      def has?(value)
-        if ((@lower < value) && (value < @upper) ||
-            (@lower_included == true) && (@lower == value) ||
-            (@upper_included == true) && (@upper == value))
-          true
-        else
-          false
-        end
-      end
-
-      private
-
-      def check_lower_upper(lower, upper)
-        if (lower == nil) && (upper == nil)
-          raise ArgumentError, "Either lower or upper must be assigned"
-        end
-        unless (lower.nil? || upper.nil?)
-          if lower > upper
-            raise ArgumentError, "Upper must be larger than lower."
-          end
-        end
-        @lower = lower
-        @upper = upper
-      end
-    end # end of Interval
-  
-    class TIME_DEFINITIONS < Any
-      DAYS_IN_LEAP_YEAR = 366
-      DAYS_IN_WEEK = 7
-      DAYS_IN_YEAR = 365
-      HOURS_IN_DAY = 24
-      MAX_DAYS_IN_MONTH = 31
-      MAX_DAYS_IN_YEAR = 366
-      MINUTES_IN_HOUR = 60
-      MONTH_IN_YEAR = 12
-      NOMINAL_DAYS_IN_MONTH = 30.42
-      NOMINAL_DAYS_IN_YEAR = 365.24
-      SECONDS_IN_MINUTE = 60
-
-      def self.valid_year?(year)
-        year >= 0
-      end
-
-      def self.valid_day?(y, m, d)
-        Date.valid_date?(y,m,d) and valid_year? y
-      end
-
-      def self.valid_hour?(h,m = nil, s = nil)
-        if !m.nil? and !valid_minute?(m)
-          return false
-        end
-        if !s.nil? and (!m.nil? and !valid_second?(s))
-          return false
-        end
-        (h >= 0 and h < HOURS_IN_DAY) or (h == HOURS_IN_DAY and m == 0 and s == 0)
-      end
-      def self.valid_minute?(mi)
-        mi >= 0 and mi < MINUTES_IN_HOUR
-      end
-      def self.valid_second?(s)
-        s >= 0 and s < SECONDS_IN_MINUTE
-      end
-      def self.valid_month?(mo)
-        mo >= 1 and mo <= MONTH_IN_YEAR
-      end
-    end # end of TIME_DEFINITIONS
-
-    module ISO8601_DATE_MODULE
-      attr_reader :year, :month, :day
-      def year=(year)
-        raise ArgumentError, "Year is not valid" unless ISO8601_DATE.valid_year?(year)
-        @year = year
-      end
-      def month=(month)
-        raise ArgumentError, "Month is not valid" unless month.nil? or ISO8601_DATE.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)
-        @day = day
-      end
-
-      def as_string
-        if (!@year.nil? and !@month.nil? and !@day.nil?)
-          Date.new(@year, @month, @day).to_s
-        elsif (!@year.nil? and !@month.nil? and @day.nil?)
-          Date.new(@year, @month).to_s[0,7]
-        elsif (!@year.nil? and @month.nil? and @day.nil?)
-          Date.new(@year).to_s[0,4]
-        end          
-      end
-
-      def month_unknown?
-        @month.nil?
-      end
-
-      def day_unknown?
-        @day.nil?
-      end
-
-      def is_extended?
-        true
-      end
-
-      def is_partial?
-        month_unknown? or day_unknown?
-      end
-
-      protected
-      def leapyear?(year)
-        case
-        when year % 400 == 0: true
-        when year % 100 == 0: false
-        else year % 4 == 0
-        end
-      end
-    end
-
-    class ISO8601_DATE < TIME_DEFINITIONS
-      include ISO8601_DATE_MODULE
-      def initialize(string)
-        /(\d{4})(?:-(\d{2})(?:-(\d{2})?)?)?/ =~ string
-        if $1.nil?
-          raise ArgumentError, 'data invalid'
-        else
-          self.year = $1.to_i
-        end
-        if $2.nil?
-          self.month = nil
-        else
-          self.month = $2.to_i
-        end
-        if $3.nil?
-          self.day = nil
-        else
-          self.day = $3.to_i
-        end
-      end
-
-      def self.valid_iso8601_date?(string)
-        begin
-          Date.parse(string)
-        rescue
-          return false
-        end
-        true
-      end
-    end # end of ISO8601_DATE
-
-    module ISO8601_TIME_MODULE
-      attr_reader :hour, :minute, :second, :fractional_second, :timezone
-
-      def hour=(hour)
-        raise ArgumentError, "hour is not valid" if !ISO8601_TIME.valid_hour?(hour, @minute, @second)
-        @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?
-        raise ArgumentError, "second is not valid" if !second.nil? and !ISO8601_TIME.valid_second?(second)
-        @second = second
-      end
-
-      def fractional_second=(fractional_second)
-        raise ArgumentError, "minute not defined" if minute_unknown? and !fractional_second.nil?
-        raise ArgumentError, "second not defined" if second_unknown? and !fractional_second.nil?
-        raise ArgumentError, "fractional second should be lower than 1.0" if !fractional_second.nil? and fractional_second >= 1.0
-        @fractional_second = fractional_second
-      end
-
-      def has_fractional_second?
-        if @fractional_second.nil?
-          return false
-        else
-          return true
-        end
-      end
-
-      def timezone=(timezone)
-        unless timezone.nil? or timezone == 'Z'
-          if /[+-](\d{2}):?(\d{2})/ =~ timezone
-            @timezone = timezone
-          else
-            raise ArgumentError, "timezone invalid"
-          end
-        else
-          @timezone = nil
-        end
-      end
-
-      def is_decimal_sign_comma?
-        false
-      end
-
-      def is_extended?
-        true
-      end
-
-      def is_partial?
-        second_unknown? or minute_unknown?
-      end
-
-      def as_string
-        s = sprintf("%02d", @hour)
-        if !@minute.nil?
-          s += ":" + sprintf("%02d",@minute)
-          if !@second.nil?
-            s += ":" + sprintf("%02d", @second)
-            if !@fractional_second.nil?
-              s += "." + @fractional_second.to_s[2..-1]
-              if !@timezone.nil?
-                s += @timezone
-              end
-            end
-          end
-        end
-        return s
-      end
-    end
-
-    class ISO8601_TIME < TIME_DEFINITIONS
-      include ISO8601_TIME_MODULE
-      def initialize(string)
-        /(\d{2}):?(\d{2})?(:?)(\d{2})?((\.|,)(\d+))?(Z|([+-](\d{2}):?(\d{2})))?/ =~ string
-        if $2.nil?
-          self.minute = nil
-        else
-          self.minute = $2.to_i
-        end
-        if $4.nil?
-          self.second = nil
-        else
-          self.second = $4.to_i
-        end
-        if $1.nil?
-          raise ArgumentError, 'data invalid'
-        else
-          self.hour = $1.to_i
-        end
-        if $7.nil?
-          self.fractional_second = nil
-        else
-          self.fractional_second = ("0." + $7).to_f
-        end
-        if $8.nil?
-          self.timezone = nil
-        else
-          self.timezone = $8
-        end
-      end
-      def self.valid_iso8601_time?(s)
-        if /(\d{2}):?(\d{2})?(:?)(\d{2})?((\.|,)(\d+))?(Z|([+-](\d{2}):?(\d{2})))?/ =~ s
-# ISO 8601 regular expression by H. Yuki
-#  http://digit.que.ne.jp/work/wiki.cgi?Perl%E3%83%A1%E3%83%A2%2FW3C%E5%BD%A2%E5%BC%8F%E3%81%AE%E6%97%A5%E6%99%82%E3%81%AE%E8%A7%A3%E6%9E%90
-# (\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d))?)?(Z|([+-]\d{2}):(\d{2}))?)?)?)?
-          hh = $1; mm = $2; ss = $4; msec = $7; tz = $8
-          if hh.to_i == HOURS_IN_DAY and (mm.nil? or mm.to_i == 0) and (ss.nil? or ss.to_i == 0) and (msec.nil? or msec.to_i==0)
-            return true
-          end
-          if hh.nil? or (hh.to_i < 0 or hh.to_i >= HOURS_IN_DAY)
-            return false
-          end
-          if !mm.nil? 
-            if !self.valid_minute?(mm.to_i)
-              return false
-            end
-          end
-          if !ss.nil? 
-            if !self.valid_second?(ss.to_i)
-              return false
-            end
-          end
-          if !tz.nil? and tz != "Z"
-            if /[+-](\d{2}):?(\d{2})/ =~ tz
-              h = $1; m = $2
-              if h.to_i < 0 or h.to_i >= HOURS_IN_DAY
-                return false
-              end
-              if m.to_i < 0 or m.to_i >= MINUTES_IN_HOUR
-                return false
-              end
-            else
-              return false
-            end
-          end
-          return true
-        else
-          return false
-        end
-      end
-    end # end of ISO8601_TIME
-
-    module ISO8601_DATE_TIME_MODULE
-      include ISO8601_DATE_MODULE, ISO8601_TIME_MODULE
-      def as_string
-        if (!@year.nil? and !@month.nil? and !@day.nil?)
-          s = Date.new(@year, @month, @day).to_s
-        elsif (!@year.nil? and !@month.nil? and @day.nil?)
-          return Date.new(@year, @month).to_s[0,7]
-        elsif (!@year.nil? and @month.nil? and @day.nil?)
-          return Date.new(@year).to_s[0,4]
-        end
-        unless hour.nil?
-          s += sprintf("T%02d", @hour)
-          unless @minute.nil?
-            s += ":" + sprintf("%02d",@minute)
-            unless @second.nil?
-              s += ":" + sprintf("%02d", @second)
-              unless @fractional_second.nil?
-                s += "." + @fractional_second.to_s[2..-1]
-                unless @timezone.nil?
-                  s += @timezone
-                end
-              end
-            end
-          end
-        end
-        return s
-      end
-    end
-
-    class ISO8601_DATE_TIME < ISO8601_DATE
-      include ISO8601_DATE_TIME_MODULE
-      def initialize(string)
-        /(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|([+-]\d{2}):?(\d{2}))?)?)?)?/ =~ string
-        if $1.empty?
-          raise ArgumentError, 'format invalid'
-        else
-          self.year = $1.to_i
-        end
-        if $2.nil?
-          self.month = nil
-        else
-          self.month = $2.to_i
-        end
-        if $3.nil?
-          self.day = nil
-        else
-          self.day = $3.to_i
-        end
-        if $5.nil?
-          self.minute = nil
-        else
-          self.minute = $5.to_i
-        end
-        if $6.nil?
-          self.second = nil
-        else
-          self.second = $6.to_i
-        end
-        if $4.nil?
-          self.hour = nil
-        else
-          self.hour = $4.to_i
-        end
-        if $7.nil? or $7.empty?
-          self.fractional_second = nil
-        else
-          self.fractional_second = ("0."+$7).to_f
-        end
-        if $8.nil?
-          self.timezone = nil
-        else
-          self.timezone = $9+$10
-        end
-      end
-    end
-  
-    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"
-          s = "+"
-        elsif @sign == "-1"
-          s = "-"
-        end
-        sprintf("Z%s%02d%02d", s, @hour, @minute)
-      end
-    end # end of ISO8601_TIMEZONE
-
-    module ISO8601_DURATION_MODULE
-      attr_reader :years, :months, :weeks, :days
-      attr_reader :hours, :minutes, :seconds, :fractional_second
-
-      def years=(years)
-        unless years.nil? || years >= 0
-          raise ArgumentError, 'years must be above zero'
-        end
-        @years = years
-      end
-
-      def months=(months)
-        unless months.nil? || months >= 0
-          raise ArgumentError, 'months must be above zero'
-        end
-        @months = months
-      end
-
-      def weeks=(weeks)
-        unless weeks.nil? || weeks >= 0
-          raise ArgumentError, 'weeks must be above zero'
-        end
-        @weeks = weeks
-      end
-
-      def days=(days)
-        unless days.nil? || days >= 0
-          raise ArgumentError, 'days must be above zero'
-        end
-        @days = days
-      end
-
-      def hours=(hours)
-        unless hours.nil? || hours >= 0
-          raise ArgumentError, 'hours must be above zero'
-        end
-        @hours = hours
-      end
-
-      def minutes=(minutes)
-        unless minutes.nil? || minutes >= 0
-          raise ArgumentError, 'minutes must be above zero'
-        end
-        @minutes = minutes
-      end
-
-      def seconds=(seconds)
-        unless seconds.nil? || seconds >= 0
-          raise ArgumentError, 'seconds must be above zero'
-        end
-        @seconds = seconds
-      end
-
-      def fractional_second=(fractional_second)
-        unless fractional_second.nil? || (fractional_second >= 0 && fractional_second < 1.0)
-          raise ArgumentError, 'fractional_second must be between 0.0 and 1.0'
-        end
-        @fractional_second = fractional_second
-      end
-
-      def as_string
-        str = 'P'
-        unless @years.nil?
-          str += @years.to_s + 'Y'
-        end
-        unless @months.nil?
-          str += @months.to_s + 'M'
-        end
-        unless @weeks.nil?
-          str += @weeks.to_s + 'W'
-        end
-        unless @days.nil?
-          str += @days.to_s + 'D'
-        end
-        unless @hours.nil?
-          str += 'T' + @hours.to_s + 'H'
-          unless @minutes.nil?
-            str += @minutes.to_s + 'M'
-            unless @seconds.nil?
-              str += @seconds.to_s
-              unless @fractional_second.nil?
-                str += @fractional_second.to_s[1 .. -1]
-              end
-              str += 'S'
-            end
-          end
-        end
-        return str
-      end
-    end
-    class ISO8601_DURATION < TIME_DEFINITIONS
-      include ISO8601_DURATION_MODULE
-      def initialize(str)
-        /^P((\d+)Y)?((\d+)M)?((\d+)W)?((\d)D)?(T((\d+)H)?((\d+)M)?((\d+)(\.\d+)?S)?)?$/ =~ str
-        self.years = $2.to_i
-        self.months = $4.to_i
-        self.weeks = $6.to_i
-        self.days = $8.to_i
-        self.hours = $11.to_i
-        self.minutes = $13.to_i
-        self.seconds = $15.to_i
-        self.fractional_second = $16.to_f
-      end
-    end # end of ISO8601_DURATION
-  end # end of Assumed_Types
-end # end of OpenEHR
Index: ruby/trunk/lib/models/tests/rm/quantity/ts_date_time.rb
===================================================================
--- ruby/trunk/lib/models/tests/rm/quantity/ts_date_time.rb	(revision 268)
+++ ruby/trunk/lib/models/tests/rm/quantity/ts_date_time.rb	(revision 291)
@@ -1,26 +1,26 @@
 require 'test/unit'
 require 'rm'
-include OpenEHR::RM::Data_Types::Quantity::Date_Time
+include OpenEhr::RM::DataTypes::Quantity::DateTime
 
 class DateTimeTest < Test::Unit::TestCase
   def setup
     assert_nothing_raised(Exception){
-      @dv_temporal = DV_Temporal.new('2008')}
+      @dv_temporal = DvTemporal.new('2008')}
     assert_nothing_raised(Exception){
-      @dv_date = DV_Date.new('2009-06-29')}
+      @dv_date = DvDate.new('2009-06-29')}
     assert_nothing_raised(Exception){
-      @dv_time = DV_Time.new('12:34:56.78')}
+      @dv_time = DvTime.new('12:34:56.78')}
     assert_nothing_raised(Exception){
-      @dv_date_time = DV_Date_Time.new('2009-06-29T12:34:56.78')}
+      @dv_date_time = DvDateTime.new('2009-06-29T12:34:56.78')}
     assert_nothing_raised(Exception){
-      @dv_duration = DV_Duration.new('P1Y2M3W4DT5H6M7.8S')}
+      @dv_duration = DvDuration.new('P1Y2M3W4DT5H6M7.8S')}
   end
 
   def test_init
-    assert_instance_of DV_Temporal, @dv_temporal
-    assert_instance_of DV_Date, @dv_date
-    assert_instance_of DV_Time, @dv_time
-    assert_instance_of DV_Date_Time, @dv_date_time
-    assert_instance_of DV_Duration, @dv_duration
+    assert_instance_of DvTemporal, @dv_temporal
+    assert_instance_of DvDate, @dv_date
+    assert_instance_of DvTime, @dv_time
+    assert_instance_of DvDateTime, @dv_date_time
+    assert_instance_of DvDuration, @dv_duration
   end
 
@@ -36,13 +36,13 @@
     assert_equal 29, @dv_date.day
     assert_equal 733954, @dv_date.magnitude
-    date2 = DV_Date.new('2009-07-08')
+    date2 = DvDate.new('2009-07-08')
     assert_equal 'P0Y0M1W9D',@dv_date.diff(date2).value
-    date2 = DV_Date.new('2004-02-28')
-    date3 = DV_Date.new('2004-03-01')
+    date2 = DvDate.new('2004-02-28')
+    date3 = DvDate.new('2004-03-01')
     assert_equal 'P0Y0M0W2D', date2.diff(date3).value
-    date4 = DV_Date.new('2003-12-31')
+    date4 = DvDate.new('2003-12-31')
     assert_equal 'P0Y1M4W28D', date2.diff(date4).value
-    birthday = DV_Date.new('1970-04-19')
-    assert_equal 'P39Y2M1W11D', birthday.diff(DV_Date.new('2009-06-30')).value
+    birthday = DvDate.new('1970-04-19')
+    assert_equal 'P39Y2M1W11D', birthday.diff(DvDate.new('2009-06-30')).value
   end
 
@@ -54,5 +54,5 @@
     assert_equal 0.78, @dv_time.fractional_second
     assert_equal((12*60*60 + 34 * 60 + 56 + 0.78), @dv_time.magnitude)
-    dv_time2 = DV_Time.new('15:36:48.05')
+    dv_time2 = DvTime.new('15:36:48.05')
     assert_equal 'P0Y0M0W0DT3H1M51.27S', @dv_time.diff(dv_time2).value
   end
@@ -67,5 +67,5 @@
     assert_equal 56, @dv_date_time.second
     assert_equal 0.78, @dv_date_time.fractional_second
-    dv_date_time2 = DV_Date_Time.new('1970-04-19T13:55:30.12')
+    dv_date_time2 = DvDateTime.new('1970-04-19T13:55:30.12')
     assert_equal 'P39Y2M1W9DT22H39M26.66S', @dv_date_time.diff(dv_date_time2).value
   end
Index: ruby/trunk/lib/models/tests/rm/test_common.rb
===================================================================
--- ruby/trunk/lib/models/tests/rm/test_common.rb	(revision 268)
+++ ruby/trunk/lib/models/tests/rm/test_common.rb	(revision 291)
@@ -3,23 +3,23 @@
 require 'rm'
 
-include OpenEHR::RM::Data_Types::Text
-include OpenEHR::RM::Common::Resource
-include OpenEHR::RM::Common::Archetyped
-include OpenEHR::RM::Common::Generic
-include OpenEHR::RM::Common::Change_Control
-include OpenEHR::RM::Common::Directory
-include OpenEHR::RM::Support::Identification
-include OpenEHR::RM::Data_Types::Basic
-include OpenEHR::RM::Data_Types::Quantity
-include OpenEHR::RM::Data_Types::URI
+include OpenEhr::RM::DataTypes::Text
+include OpenEhr::RM::Common::Resource
+include OpenEhr::RM::Common::Archetyped
+include OpenEhr::RM::Common::Generic
+include OpenEhr::RM::Common::ChangeControl
+include OpenEhr::RM::Common::Directory
+include OpenEhr::RM::Support::Identification
+include OpenEhr::RM::DataTypes::Basic
+include OpenEhr::RM::DataTypes::Quantity
+include OpenEhr::RM::DataTypes::Uri
 
 class RM_Common_Resource_Test < Test::Unit::TestCase
   def setup
-    terminology_id = Terminology_ID.new('openehr')
-    code_phrase = Code_Phrase.new('ja', terminology_id)    
-    @translation_details = OpenEHR::RM::Common::Resource::Translation_Details.new(:language => code_phrase, :author => {'KOBAYASHI, Shinji', 'Ehime Univ'},
+    terminology_id = TerminologyId.new('openehr')
+    code_phrase = CodePhrase.new('ja', terminology_id)
+    @translation_details = OpenEhr::RM::Common::Resource::TranslationDetails.new(:language => code_phrase, :author => {'KOBAYASHI, Shinji', 'Ehime Univ'},
   :accreditation => 'jp', :other_details => {'ruby', 'test'})
-    @authored_resource = OpenEHR::RM::Common::Resource::Authored_Resource.new(:original_language => code_phrase, :translations => {'ja', @translation_details}, :description => "test")
-    @resource_description_item = OpenEHR::RM::Common::Resource::Resource_Description_Item.new(:language => code_phrase,
+    @authored_resource = OpenEhr::RM::Common::Resource::AuthoredResource.new(:original_language => code_phrase, :translations => {'ja', @translation_details}, :description => "test")
+    @resource_description_item = OpenEhr::RM::Common::Resource::ResourceDescriptionItem.new(:language => code_phrase,
               :purpose => 'test',
               :keywords => %w[test ruby],
@@ -29,5 +29,5 @@
               :original_resource_uri => {'issuer', 'http://openehr.jp/'},
               :other_details => {'samos', 'icicth7'})
-    @resource_description = OpenEHR::RM::Common::Resource::Resource_Description.new(:original_author => {'KOBAYASHI, Shinji' => 'Ehime University'},
+    @resource_description = OpenEhr::RM::Common::Resource::ResourceDescription.new(:original_author => {'KOBAYASHI, Shinji' => 'Ehime University'},
     :lifecycle_state => 'experimental',
     :details => {'ja', @resource_description_item},
@@ -36,12 +36,12 @@
     :other_details => {'ja', 'shikoku'},
     :parent_resource => @authored_resource)
-    @authored_resource = OpenEHR::RM::Common::Resource::Authored_Resource.new(:original_language => code_phrase, :translations => {'ja', @translation_details}, :description => @resource_description)
+    @authored_resource = OpenEhr::RM::Common::Resource::AuthoredResource.new(:original_language => code_phrase, :translations => {'ja', @translation_details}, :description => @resource_description)
   end
 
   def test_init
-    assert_instance_of OpenEHR::RM::Common::Resource::Authored_Resource, @authored_resource
-    assert_instance_of OpenEHR::RM::Common::Resource::Translation_Details, @translation_details
-    assert_instance_of OpenEHR::RM::Common::Resource::Resource_Description_Item, @resource_description_item
-    assert_instance_of OpenEHR::RM::Common::Resource::Resource_Description, @resource_description
+    assert_instance_of OpenEhr::RM::Common::Resource::AuthoredResource, @authored_resource
+    assert_instance_of OpenEhr::RM::Common::Resource::TranslationDetails, @translation_details
+    assert_instance_of OpenEhr::RM::Common::Resource::ResourceDescriptionItem, @resource_description_item
+    assert_instance_of OpenEhr::RM::Common::Resource::ResourceDescription, @resource_description
   end
 
@@ -86,4 +86,5 @@
 class RM_Common_Archetyped_Test < Test::Unit::TestCase
   def setup
+<<<<<<< .working
     @dv_text = OpenEHR::RM::Data_Types::Text::DV_Text.new('Test')
     @uid_based_id = OpenEHR::RM::Support::Identification::UID_Based_ID.new('rrip::0.0.5')
@@ -92,7 +93,15 @@
     assert_nothing_raised(Exception){@archetyped = OpenEHR::RM::Common::Archetyped::Archetyped.new(@archetype_id, '1.0.1')}
     assert_nothing_raised(Exception){@link = OpenEHR::RM::Common::Archetyped::Link.new(OpenEHR::RM::Data_Types::Text::DV_Text.new("generic"), OpenEHR::RM::Data_Types::URI::DV_EHR_URI.new("ehr://test/"),OpenEHR::RM::Data_Types::Text::DV_Text.new("problem"))}
-    assert_nothing_raised(Exception){
-      @pathable = OpenEHR::RM::Common::Archetyped::Pathable.new }
-    name = OpenEHR::RM::Data_Types::Text::DV_Text.new('blood')
+=======
+    @dv_text = OpenEhr::RM::DataTypes::Text::DvText.new('Test')
+    @uid_based_id = OpenEhr::RM::Support::Identification::UidBasedId.new('rrip::0.0.5')
+    @archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")
+    @template_id = OpenEhr::RM::Support::Identification::TemplateId.new('1.0.1')
+    assert_nothing_raised(Exception){@archetyped = OpenEhr::RM::Common::Archetyped::Archetyped.new(@archetype_id, '1.0.1')}
+    assert_nothing_raised(Exception){@link = OpenEhr::RM::Common::Archetyped::Link.new(OpenEhr::RM::DataTypes::Text::DvText.new("generic"), OpenEhr::RM::DataTypes::Uri::DvEhrUri.new("ehr://test/"),OpenEhr::RM::DataTypes::Text::DvText.new("problem"))}
+>>>>>>> .merge-right.r168
+    assert_nothing_raised(Exception){
+      @pathable = OpenEhr::RM::Common::Archetyped::Pathable.new }
+    name = OpenEhr::RM::DataTypes::Text::DvText.new('blood')
     links = Set.new([@uid_based_id])
     assert_nothing_raised(Exception){
@@ -100,25 +109,25 @@
                                  :name => name,
                                  :links => links)}
-    provider = Party_Identified.new(:name => 'NERV')
-    location = Party_Identified.new(:name => 'GEOFRONT')
-    object_version_id = Object_Version_ID.new('ABC::DEF::1.3.4')
-    party_ref = Party_Ref.new('local', 'ORGANISATION', object_id)
-    assert_nothing_raised(Exception){
-      @feeder_audit_details = Feeder_Audit_Details.new(:system_id => 'MAGI',
+    provider = PartyIdentified.new(:name => 'NERV')
+    location = PartyIdentified.new(:name => 'GEOFRONT')
+    object_version_id = ObjectVersionId.new('ABC::DEF::1.3.4')
+    party_ref = PartyRef.new('local', 'ORGANISATION', object_id)
+    assert_nothing_raised(Exception){
+      @feeder_audit_details = FeederAuditDetails.new(:system_id => 'MAGI',
                                                        :provider => provider,
                                                        :location => location,
-                                                       :time => DV_Date_Time.new('2009-07-03T12:16:31'),
-                                                       :subject => Party_Proxy.new(:external_ref => party_ref),
+                                                       :time => DvDateTime.new('2009-07-03T12:16:31'),
+                                                       :subject => PartyProxy.new(:external_ref => party_ref),
                                                        :version_id => '0.0.4')}
-    feeder_audit_details = Feeder_Audit_Details.new(:system_id => 'AKAGI')
-    dv_identifier = DV_Identifier.new('NERV', 'MELCHIOR', 'RITSUKO', 'COMPUTER')
-    feeder_audit_details2 = Feeder_Audit_Details.new(:system_id => 'KATSURAGI')
-    dv_identifier2 = DV_Identifier.new('NERV', 'SHOGOUKI', 'MISATO', 'EVANGELION')
-    charset = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('UTF-8','character-sets')
-    language = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('ja', 'languages')
-
-    dv_encapsulated = OpenEHR::RM::Data_Types::Encapsulated::DV_Encapsulated.new(charset, language, 10)
-    assert_nothing_raised(Exception){
-      @feeder_audit = Feeder_Audit.new(:originating_system_audit => feeder_audit_details,
+    feeder_audit_details = FeederAuditDetails.new(:system_id => 'AKAGI')
+    dv_identifier = DvIdentifier.new('NERV', 'MELCHIOR', 'RITSUKO', 'COMPUTER')
+    feeder_audit_details2 = FeederAuditDetails.new(:system_id => 'KATSURAGI')
+    dv_identifier2 = DvIdentifier.new('NERV', 'SHOGOUKI', 'MISATO', 'EVANGELION')
+    charset = OpenEhr::RM::DataTypes::Text::CodePhrase.new('UTF-8','character-sets')
+    language = OpenEhr::RM::DataTypes::Text::CodePhrase.new('ja', 'languages')
+
+    dv_encapsulated = OpenEhr::RM::DataTypes::Encapsulated::DvEncapsulated.new(charset, language, 10)
+    assert_nothing_raised(Exception){
+      @feeder_audit = FeederAudit.new(:originating_system_audit => feeder_audit_details,
                                        :originating_system_item_ids => [dv_identifier],
                                        :feeder_system_audit => feeder_audit_details2,
@@ -128,10 +137,10 @@
 
   def test_init
-    assert_instance_of OpenEHR::RM::Common::Archetyped::Archetyped, @archetyped
-    assert_instance_of OpenEHR::RM::Common::Archetyped::Link, @link
-    assert_instance_of OpenEHR::RM::Common::Archetyped::Pathable, @pathable
-    assert_instance_of OpenEHR::RM::Common::Archetyped::Locatable, @locatable
-    assert_instance_of Feeder_Audit_Details, @feeder_audit_details
-    assert_instance_of Feeder_Audit, @feeder_audit
+    assert_instance_of OpenEhr::RM::Common::Archetyped::Archetyped, @archetyped
+    assert_instance_of OpenEhr::RM::Common::Archetyped::Link, @link
+    assert_instance_of OpenEhr::RM::Common::Archetyped::Pathable, @pathable
+    assert_instance_of OpenEhr::RM::Common::Archetyped::Locatable, @locatable
+    assert_instance_of FeederAuditDetails, @feeder_audit_details
+    assert_instance_of FeederAudit, @feeder_audit
   end
 
@@ -144,5 +153,9 @@
     assert_nothing_raised(Exception){@archetyped.template_id = @template_id}
     assert_equal @template_id, @archetyped.template_id
+<<<<<<< .working
     archetype_id2 = OpenEHR::RM::Support::Identification::Archetype_ID.new('openEHR-EHR-SECTION.physical_examination-prenatal.v2')
+=======
+    archetype_id2 = OpenEhr::RM::Support::Identification::ArchetypeId.new("1.0.2", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")
+>>>>>>> .merge-right.r168
     assert_nothing_raised(ArgumentError){@archetyped.archetype_id = archetype_id2}
     assert_equal archetype_id2, @archetyped.archetype_id
@@ -157,13 +170,13 @@
     assert_equal 'problem', @link.type.value
     # test meaning
-    assert_nothing_raised(Exception){@link.meaning = OpenEHR::RM::Data_Types::Text::DV_Text.new('clinical')}
+    assert_nothing_raised(Exception){@link.meaning = OpenEhr::RM::DataTypes::Text::DvText.new('clinical')}
     assert_equal 'clinical', @link.meaning.value
     assert_raise(ArgumentError){@link.meaning = nil}
     # test target
-    assert_nothing_raised(Exception){@link.target = OpenEHR::RM::Data_Types::URI::DV_EHR_URI.new("ehr://try/")}
+    assert_nothing_raised(Exception){@link.target = OpenEhr::RM::DataTypes::Uri::DvEhrUri.new("ehr://try/")}
     assert_equal 'ehr://try/', @link.target.value
     assert_raise(ArgumentError){@link.target = nil}
     # test type
-    assert_nothing_raised(Exception){@link.type = OpenEHR::RM::Data_Types::Text::DV_Text.new("issue")}
+    assert_nothing_raised(Exception){@link.type = OpenEhr::RM::DataTypes::Text::DvText.new("issue")}
     assert_equal 'issue', @link.type.value
     assert_raise(ArgumentError){@link.type = nil}
@@ -190,35 +203,35 @@
 class RM_Common_Generic_Test < Test::Unit::TestCase
   def setup
-    assert_nothing_raised(Exception){party_proxy = Party_Proxy.new}
-    object_id = Object_ID.new('0.0.4')
-    party_ref = Party_Ref.new('unknown', 'ORGANISATION', object_id)
-    assert_nothing_raised(Exception){
-      @party_proxy = Party_Proxy.new(:external_ref => party_ref)}
-    assert_nothing_raised(Exception){party_self = Party_Self.new}
-    assert_nothing_raised(Exception){
-      @party_self = Party_Self.new(:external_ref => party_ref)}
+    assert_nothing_raised(Exception){party_proxy = PartyProxy.new}
+    object_id = ObjectId.new('0.0.4')
+    party_ref = PartyRef.new('unknown', 'ORGANISATION', object_id)
+    assert_nothing_raised(Exception){
+      @party_proxy = PartyProxy.new(:external_ref => party_ref)}
+    assert_nothing_raised(Exception){party_self = PartySelf.new}
+    assert_nothing_raised(Exception){
+      @party_self = PartySelf.new(:external_ref => party_ref)}
     assert_raise(ArgumentError){
-      party_identified = Party_Identified.new}
+      party_identified = PartyIdentified.new}
 
     identifiers = []
-    identifiers << DV_Identifier.new('NERV', 'MELCHIOR', 'GENDO', 'COMPUTER')
-    identifiers << DV_Identifier.new('NERV', 'CASPER', 'GENDO', 'COMPUTER')
-    identifiers << DV_Identifier.new('NERV', 'BALTHAZAR', 'GENDO', 'COMPUTER')
-    assert_nothing_raised(Exception){
-      @party_identified = Party_Identified.new(:name => 'NERV',
+    identifiers << DvIdentifier.new('NERV', 'MELCHIOR', 'GENDO', 'COMPUTER')
+    identifiers << DvIdentifier.new('NERV', 'CASPER', 'GENDO', 'COMPUTER')
+    identifiers << DvIdentifier.new('NERV', 'BALTHAZAR', 'GENDO', 'COMPUTER')
+    assert_nothing_raised(Exception){
+      @party_identified = PartyIdentified.new(:name => 'NERV',
                                                :external_ref => party_ref,
                                                :identifier => identifiers)}
 
-    terminology_id = Terminology_ID.new('test(0.04)')
-    code_phrase = Code_Phrase.new('self', terminology_id)
-    dv_coded_text = DV_Coded_Text.new('Seele',code_phrase)
-    assert_nothing_raised(Exception){
-      @party_related = Party_Related.new(:name => 'GEHIRN',
+    terminology_id = TerminologyId.new('test(0.04)')
+    code_phrase = CodePhrase.new('self', terminology_id)
+    dv_coded_text = DvCodedText.new('Seele',code_phrase)
+    assert_nothing_raised(Exception){
+      @party_related = PartyRelated.new(:name => 'GEHIRN',
                                          :relationship => dv_coded_text)}
-    dv_text = DV_Text.new('commiter')
-    dv_coded_text = DV_Coded_Text.new('present',terminology_id)
-    dv_date_time1 = DV_Date_Time.new('2009-07-04T16:30:00')
-    dv_date_time2 = DV_Date_Time.new('2009-07-14T00:00:00')
-    dv_interval = DV_Interval.new(dv_date_time1, dv_date_time2)
+    dv_text = DvText.new('commiter')
+    dv_coded_text = DvCodedText.new('present',terminology_id)
+    dv_date_time1 = DvDateTime.new('2009-07-04T16:30:00')
+    dv_date_time2 = DvDateTime.new('2009-07-14T00:00:00')
+    dv_interval = DvInterval.new(dv_date_time1, dv_date_time2)
     assert_nothing_raised(Exception){
       @participation = Participation.new(:performer => @party_proxy,
@@ -226,17 +239,17 @@
                                          :mode => dv_coded_text,
                                          :time => dv_interval)}
-    dv_date_time = DV_Date_Time.new('2009-07-04T18:56:00')
-    terminology_id = Terminology_ID.new('openehr(1.0.2)')
-    code_phrase = Code_Phrase.new('249', terminology_id)
-    dv_coded_text = DV_Coded_Text.new('creation', code_phrase)
-    dv_text = DV_Text.new('test environment')
-    assert_nothing_raised(Exception){
-      @audit_details = Audit_Details.new(:system_id => 'MAGI',
+    dv_date_time = DvDateTime.new('2009-07-04T18:56:00')
+    terminology_id = TerminologyId.new('openehr(1.0.2)')
+    code_phrase = CodePhrase.new('249', terminology_id)
+    dv_coded_text = DvCodedText.new('creation', code_phrase)
+    dv_text = DvText.new('test environment')
+    assert_nothing_raised(Exception){
+      @audit_details = AuditDetails.new(:system_id => 'MAGI',
                                          :committer => @party_proxy,
                                          :time_committed => dv_date_time,
                                          :change_type => dv_coded_text,
                                          :description => dv_text)}
-    dv_text = DV_Text.new('authorisation')
-    dv_ehr_uri = DV_EHR_URI.new('ehr://test/')
+    dv_text = DvText.new('authorisation')
+    dv_ehr_uri = DvEhrUri.new('ehr://test/')
     assert_nothing_raised(Exception){
       @attestation = Attestation.new(:system_id => 'NERV',
@@ -248,38 +261,38 @@
                                      :proof => 'hashedstring',
                                      :items => Set[dv_ehr_uri])}
-    object_version_id = Object_Version_ID.new('SHOGOUKI::NERV::1.1.1')
-    audit_details2 = Audit_Details.new(:system_id => 'MAGI',
+    object_version_id = ObjectVersionId.new('SHOGOUKI::NERV::1.1.1')
+    audit_details2 = AuditDetails.new(:system_id => 'MAGI',
                                        :committer => @party_proxy,
                                        :time_committed => dv_date_time2,
                                        :change_type => dv_coded_text)
     assert_nothing_raised(Exception){
-      @revision_history_item = Revision_History_Item.new(:audits => [@audit_details, audit_details2],
+      @revision_history_item = RevisionHistoryItem.new(:audits => [@audit_details, audit_details2],
                                                          :version_id => object_version_id)}
-    dv_date_time3 = DV_Date_Time.new('2009-07-14T12:00:00')
-    dv_date_time4 = DV_Date_Time.new('2009-07-15T00:00:00')
-    audit_details3 = Audit_Details.new(:system_id => 'MAGI',
+    dv_date_time3 = DvDateTime.new('2009-07-14T12:00:00')
+    dv_date_time4 = DvDateTime.new('2009-07-15T00:00:00')
+    audit_details3 = AuditDetails.new(:system_id => 'MAGI',
                                      :committer => @party_proxy,
                                      :time_committed => dv_date_time3,
                                      :change_type => dv_coded_text)
-    audit_details4 = Audit_Details.new(:system_id => 'MAGI',
+    audit_details4 = AuditDetails.new(:system_id => 'MAGI',
                                      :committer => @party_proxy,
                                      :time_committed => dv_date_time4,
                                      :change_type => dv_coded_text)
-    object_version_id = Object_Version_ID.new('NIGOUKI::NERV::2.2.2')
-    revision_history_item2 = Revision_History_Item.new(:audits => [audit_details3, audit_details4],
+    object_version_id = ObjectVersionId.new('NIGOUKI::NERV::2.2.2')
+    revision_history_item2 = RevisionHistoryItem.new(:audits => [audit_details3, audit_details4],
                                                       :version_id => object_version_id)
     assert_nothing_raised(Exception){
-      @revision_history = Revision_History.new([@revision_history_item, revision_history_item2])}
+      @revision_history = RevisionHistory.new([@revision_history_item, revision_history_item2])}
   end
 
   def test_init
-    assert_instance_of Party_Proxy, @party_proxy
-    assert_instance_of Party_Self, @party_self
-    assert_instance_of Party_Identified, @party_identified
+    assert_instance_of PartyProxy, @party_proxy
+    assert_instance_of PartySelf, @party_self
+    assert_instance_of PartyIdentified, @party_identified
     assert_instance_of Participation, @participation
-    assert_instance_of Audit_Details, @audit_details
+    assert_instance_of AuditDetails, @audit_details
     assert_instance_of Attestation, @attestation
-    assert_instance_of Revision_History_Item, @revision_history_item
-    assert_instance_of Revision_History, @revision_history
+    assert_instance_of RevisionHistoryItem, @revision_history_item
+    assert_instance_of RevisionHistory, @revision_history
   end
 
@@ -347,7 +360,7 @@
   def setup
     archetype_node_id = 'at0001'
-    name = DV_Text.new('folder_test')
-    object_id = Object_ID.new('1.1.1')
-    object_ref = Object_Ref.new('local', 'PARTY', object_id)
+    name = DvText.new('folder_test')
+    object_id = ObjectId.new('1.1.1')
+    object_ref = ObjectRef.new('local', 'PARTY', object_id)
     assert_nothing_raised(Exception){
       @folder = Folder.new(:archetype_node_id => archetype_node_id,
@@ -359,5 +372,5 @@
   
   def test_init
-    assert_instance_of OpenEHR::RM::Common::Directory::Folder, @folder
+    assert_instance_of OpenEhr::RM::Common::Directory::Folder, @folder
   end
 
@@ -370,22 +383,22 @@
 class RM_Common_Change_Control_Test < Test::Unit::TestCase
   def setup
-    object_version_id1 = Object_Version_ID.new('ABC::DEF::2.2.3')
-    object_version_id2 = Object_Version_ID.new('GHI::JKL::4.5.6')
-    object_id = Object_ID.new('ehr://uniqueid1020')
-    dv_date_time = DV_Date_Time.new('2009-07-06T21:10:12')
-    party_ref = Party_Ref.new('unknown', 'ORGANISATION', object_id)
-    party_proxy = Party_Proxy.new(:external_ref => party_ref)
-    terminology_id = Terminology_ID.new('openehr(1.0.2)')
-    code_phrase = Code_Phrase.new('249', terminology_id)
-    dv_coded_text = DV_Coded_Text.new('creation', code_phrase)
-    audit_details = Audit_Details.new(:system_id => 'MAGI',
+    object_version_id1 = ObjectVersionId.new('ABC::DEF::2.2.3')
+    object_version_id2 = ObjectVersionId.new('GHI::JKL::4.5.6')
+    object_id = ObjectId.new('ehr://uniqueid1020')
+    dv_date_time = DvDateTime.new('2009-07-06T21:10:12')
+    party_ref = PartyRef.new('unknown', 'ORGANISATION', object_id)
+    party_proxy = PartyProxy.new(:external_ref => party_ref)
+    terminology_id = TerminologyId.new('openehr(1.0.2)')
+    code_phrase = CodePhrase.new('249', terminology_id)
+    dv_coded_text = DvCodedText.new('creation', code_phrase)
+    audit_details = AuditDetails.new(:system_id => 'MAGI',
                                       :committer => party_proxy,
                                       :time_committed => dv_date_time,
                                       :change_type => dv_coded_text)
-    code_phrase = Code_Phrase.new('532', terminology_id)
-    dv_coded_text = DV_Coded_Text.new('complete', code_phrase)
-    object_id = Object_ID.new('ehr://test_location')
-    object_ref = Object_Ref.new('local', 'PARTY', object_id)
-    hier_object_id = Hier_Object_ID.new('ABC')
+    code_phrase = CodePhrase.new('532', terminology_id)
+    dv_coded_text = DvCodedText.new('complete', code_phrase)
+    object_id = ObjectId.new('ehr://test_location')
+    object_ref = ObjectRef.new('local', 'PARTY', object_id)
+    hier_object_id = HierObjectId.new('ABC')
     assert_nothing_raised(Exception){
       @version = Version.new(:uid => object_version_id1,
@@ -396,20 +409,20 @@
                              :signature => 'test_version',
                              :data => 'data')}
-    object_version_id3 = Object_Version_ID.new('MNO::PQR::7.8.9')
-    object_version_id4 = Object_Version_ID.new('STU::VWX::1.2.3')
-    code_phrase = Code_Phrase.new('240', terminology_id)
-    dv_coded_text2 = DV_Coded_Text.new('signed', code_phrase)
+    object_version_id3 = ObjectVersionId.new('MNO::PQR::7.8.9')
+    object_version_id4 = ObjectVersionId.new('STU::VWX::1.2.3')
+    code_phrase = CodePhrase.new('240', terminology_id)
+    dv_coded_text2 = DvCodedText.new('signed', code_phrase)
     attestation = Attestation.new(:system_id => 'NERV',
                                   :committer => party_proxy,
                                   :time_committed => dv_date_time,
                                   :change_type => dv_coded_text,
-                                  :reason => DV_Text.new('signed'))
-    dv_date_time = DV_Date_Time.new('2009-07-07T21:10:12')
-    audit_details = Audit_Details.new(:system_id => 'MAGI',
+                                  :reason => DvText.new('signed'))
+    dv_date_time = DvDateTime.new('2009-07-07T21:10:12')
+    audit_details = AuditDetails.new(:system_id => 'MAGI',
                                       :committer => party_proxy,
                                       :time_committed => dv_date_time,
                                       :change_type => dv_coded_text)
     assert_nothing_raised(Exception){
-      @original_version = Original_Version.new(:uid => object_version_id3,
+      @original_version = OriginalVersion.new(:uid => object_version_id3,
                                                :preceding_version_uid => object_version_id4,
                                                :other_input_version_uids => Set[object_version_id1, object_version_id2],
@@ -419,13 +432,13 @@
                                                :data => 'data',
                                                :lifecycle_state => dv_coded_text)}
-    dv_date_time = DV_Date_Time.new('2009-07-08T21:10:12')
-    audit_details = Audit_Details.new(:system_id => 'CASPER',
+    dv_date_time = DvDateTime.new('2009-07-08T21:10:12')
+    audit_details = AuditDetails.new(:system_id => 'CASPER',
                                       :committer => party_proxy,
                                       :time_committed => dv_date_time,
                                       :change_type => dv_coded_text,
                                       :description => 'for contribution')
-    object_ref = Object_Ref.new('unknown', 'PARTY', object_id)
-    assert_nothing_raised(Exception){
-      @imported_version = Imported_Version.new(:item => @original_version,
+    object_ref = ObjectRef.new('unknown', 'PARTY', object_id)
+    assert_nothing_raised(Exception){
+      @imported_version = ImportedVersion.new(:item => @original_version,
                                                :commit_audit => audit_details,
                                                :contribution => object_ref,
@@ -435,6 +448,6 @@
                                        :versions => Set[object_ref],
                                        :audit => audit_details)}
-    dv_date_time = DV_Date_Time.new('2009-07-08T18:10:12')
-    audit_details = Audit_Details.new(:system_id => 'MAGI',
+    dv_date_time = DvDateTime.new('2009-07-08T18:10:12')
+    audit_details = AuditDetails.new(:system_id => 'MAGI',
                                       :committer => party_proxy,
                                       :time_committed => dv_date_time,
@@ -446,5 +459,5 @@
                                 :change_type => dv_coded_text)
     assert_nothing_raised(Exception){
-      @versioned_object = Versioned_Object.new(:uid => hier_object_id,
+      @versioned_object = VersionedObject.new(:uid => hier_object_id,
                                                :owner_id => object_ref,
                                                :time_created => dv_date_time,
@@ -453,9 +466,9 @@
 
   def test_init
-    assert_instance_of OpenEHR::RM::Common::Change_Control::Version, @version
-    assert_instance_of Original_Version, @original_version
-    assert_instance_of Imported_Version, @imported_version
-    assert_instance_of OpenEHR::RM::Common::Change_Control::Contribution, @contribution
-    assert_instance_of Versioned_Object, @versioned_object
+    assert_instance_of OpenEhr::RM::Common::ChangeControl::Version, @version
+    assert_instance_of OriginalVersion, @original_version
+    assert_instance_of ImportedVersion, @imported_version
+    assert_instance_of OpenEhr::RM::Common::ChangeControl::Contribution, @contribution
+    assert_instance_of VersionedObject, @versioned_object
   end
 
@@ -505,5 +518,5 @@
     assert !@versioned_object.is_original_version?(@version.uid)
     assert @versioned_object.is_original_version?(@original_version.uid)
-    assert @versioned_object.has_version_at_time?(DV_Date_Time.new('2009-07-06T21:10:12'))
+    assert @versioned_object.has_version_at_time?(DvDateTime.new('2009-07-06T21:10:12'))
     assert_equal @version, @versioned_object.version_with_id(@version.uid)
     assert_equal @version, @versioned_object.version_at_time(@version.commit_audit.time_committed)
@@ -538,10 +551,10 @@
                                                 :item => @imported_version.item)}
     assert_equal 7, @versioned_object.version_count
-    dv_date_time = DV_Date_Time.new('2009-07-07T22:11:31')
+    dv_date_time = DvDateTime.new('2009-07-07T22:11:31')
     attestation = Attestation.new(:system_id => 'NERV2',
                                   :committer => @version.contribution,
                                   :time_committed => dv_date_time,
                                   :change_type => @original_version.commit_audit.change_type,
-                                  :reason => DV_Text.new('signed'))
+                                  :reason => DvText.new('signed'))
     assert_nothing_raised(Exception){
       @versioned_object.commit_attestation(:attestation => attestation,
Index: ruby/trunk/lib/models/tests/rm/test_data_structure.rb
===================================================================
--- ruby/trunk/lib/models/tests/rm/test_data_structure.rb	(revision 268)
+++ ruby/trunk/lib/models/tests/rm/test_data_structure.rb	(revision 291)
@@ -3,5 +3,10 @@
 require 'rm'
 
+<<<<<<< .working
 include OpenEHR::RM::Data_Structures
+=======
+include OpenEHR::RM::Data_Structures
+include OpenEHR::RM::Data_Structures::Item_Structure
+>>>>>>> .merge-right.r168
 
 class RmDataStructureTest < Test::Unit::TestCase
@@ -24,2 +29,12 @@
   end
 end
+
+class RmDataStructureItemStructureTest < Test::Unit::TestCase
+  def setup
+    assert_nothing_raised(Exception){
+      
+  end
+
+  def test_init
+  end
+end
Index: ruby/trunk/lib/models/tests/rm/test_data_types.rb
===================================================================
--- ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 268)
+++ ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 291)
@@ -6,21 +6,21 @@
 class RM_Data_Types_Basic_Test < Test::Unit::TestCase
   def setup
-    assert_nothing_raised(Exception){@dv_boolean = OpenEHR::RM::Data_Types::Basic::DV_Boolean.new("TRUE")}
-    @terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('openEHR(1.0.2)')
-    @code_phrase = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('PROPOSED', @terminology_id)
-    @dv_coded_text = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new("Blood examination", @code_phrase)
-    assert_nothing_raised(Exception){@dv_state = OpenEHR::RM::Data_Types::Basic::DV_State.new(@dv_coded_text, false)}
-    assert_nothing_raised(Exception){@dv_identifier = OpenEHR::RM::Data_Types::Basic::DV_Identifier.new("Ruby Hospital","0123456-0", "Information office", "personal id")}
+    assert_nothing_raised(Exception){@dv_boolean = OpenEhr::RM::DataTypes::Basic::DvBoolean.new("TRUE")}
+    @terminology_id = OpenEhr::RM::Support::Identification::TerminologyId.new('openEHR(1.0.2)')
+    @code_phrase = OpenEhr::RM::DataTypes::Text::CodePhrase.new('PROPOSED', @terminology_id)
+    @dv_coded_text = OpenEhr::RM::DataTypes::Text::DvCodedText.new("Blood examination", @code_phrase)
+    assert_nothing_raised(Exception){@dv_state = OpenEhr::RM::DataTypes::Basic::DvState.new(@dv_coded_text, false)}
+    assert_nothing_raised(Exception){@dv_identifier = OpenEhr::RM::DataTypes::Basic::DvIdentifier.new("Ruby Hospital","0123456-0", "Information office", "personal id")}
   end
 
   def test_init
-    assert_instance_of OpenEHR::RM::Data_Types::Basic::DV_Boolean, @dv_boolean
-    assert_instance_of OpenEHR::RM::Data_Types::Basic::DV_State, @dv_state
-    assert_instance_of OpenEHR::RM::Data_Types::Basic::DV_Identifier, @dv_identifier
+    assert_instance_of OpenEhr::RM::DataTypes::Basic::DvBoolean, @dv_boolean
+    assert_instance_of OpenEhr::RM::DataTypes::Basic::DvState, @dv_state
+    assert_instance_of OpenEhr::RM::DataTypes::Basic::DvIdentifier, @dv_identifier
   end
 
   def test_constant
-    assert_equal("\r", OpenEHR::RM::Data_Types::Basic::Data_Value::CR)
-    assert_equal("\n", OpenEHR::RM::Data_Types::Basic::Data_Value::LF)
+    assert_equal("\r", OpenEhr::RM::DataTypes::Basic::DataValue::CR)
+    assert_equal("\n", OpenEhr::RM::DataTypes::Basic::DataValue::LF)
   end
 
@@ -31,5 +31,5 @@
     # inv: Value_exists
     assert_raise(ArgumentError){@dv_boolean.value=nil}
-    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Basic::DV_Boolean.new(nil)}
+    assert_raise(ArgumentError){OpenEhr::RM::DataTypes::Basic::DvBoolean.new(nil)}
   end
 
@@ -44,5 +44,5 @@
     assert_equal 'COMPLETED', @dv_state.value.defining_code.code_string
     assert @dv_state.is_terminal?
-    assert_raise(ArgumentError) {OpenEHR::RM::Data_Types::Basic::DV_State.new(nil,nil)}
+    assert_raise(ArgumentError) {OpenEhr::RM::DataTypes::Basic::DvState.new(nil,nil)}
     assert_raise(ArgumentError) {@dv_state.value=nil}
     assert_raise(ArgumentError) {@dv_state.is_terminal=nil}
@@ -62,5 +62,5 @@
     @dv_identifier.type = "test id"
     assert_equal("test id", @dv_identifier.type)
-    assert_raise(ArgumentError) {OpenEHR::RM::Data_Types::Basic::DV_Identifier.new(nil, nil, nil, nil)}
+    assert_raise(ArgumentError) {OpenEhr::RM::DataTypes::Basic::DvIdentifier.new(nil, nil, nil, nil)}
   end
 end
@@ -69,11 +69,11 @@
 class RM_Data_Types_URI_Test < Test::Unit::TestCase
   def setup
-    @dv_uri = OpenEHR::RM::Data_Types::URI::DV_URI.new("http://www.openehr.jp/changeset/test?cmd=93#file0")
-    @dv_ehr_uri = OpenEHR::RM::Data_Types::URI::DV_EHR_URI.new("ehr://1234567/87284370-2D4B-4e3d-A3F3-F303D2F4F34B@2005-08-02T04:30:00")
+    @dv_uri = OpenEhr::RM::DataTypes::Uri::DvUri.new("http://www.openehr.jp/changeset/test?cmd=93#file0")
+    @dv_ehr_uri = OpenEhr::RM::DataTypes::Uri::DvEhrUri.new("ehr://1234567/87284370-2D4B-4e3d-A3F3-F303D2F4F34B@2005-08-02T04:30:00")
   end
 
   def test_init
-    assert_instance_of OpenEHR::RM::Data_Types::URI::DV_URI, @dv_uri
-    assert_instance_of OpenEHR::RM::Data_Types::URI::DV_EHR_URI, @dv_ehr_uri    
+    assert_instance_of OpenEhr::RM::DataTypes::Uri::DvUri, @dv_uri
+    assert_instance_of OpenEhr::RM::DataTypes::Uri::DvEhrUri, @dv_ehr_uri
   end
 
@@ -98,18 +98,18 @@
 class RM_Data_Types_Text_Test < Test::Unit::TestCase
   def setup
-    assert_nothing_raised(Exception){@dv_text = OpenEHR::RM::Data_Types::Text::DV_Text.new("valid value")}
-    @terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('ICD10')
+    assert_nothing_raised(Exception){@dv_text = OpenEhr::RM::DataTypes::Text::DvText.new("valid value")}
+    @terminology_id = OpenEhr::RM::Support::Identification::TerminologyId.new('ICD10')
     
-    assert_nothing_raised(Exception){@code_phrase = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('C92.0', @terminology_id)}
-    assert_nothing_raised(Exception){@dv_coded_text = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new("Acute Myeloid Leukemia", @code_phrase)}
-    @dv_paragraph = OpenEHR::RM::Data_Types::Text::DV_Paragraph.new(Set.new(["test1", "test2"]))
-    @term_mapping = OpenEHR::RM::Data_Types::Text::Term_Mapping.new('=',@dv_coded_text,"TEST")
+    assert_nothing_raised(Exception){@code_phrase = OpenEhr::RM::DataTypes::Text::CodePhrase.new('C92.0', @terminology_id)}
+    assert_nothing_raised(Exception){@dv_coded_text = OpenEhr::RM::DataTypes::Text::DvCodedText.new("Acute Myeloid Leukemia", @code_phrase)}
+    @dv_paragraph = OpenEhr::RM::DataTypes::Text::DvParagraph.new(Set.new(["test1", "test2"]))
+    @term_mapping = OpenEhr::RM::DataTypes::Text::TermMapping.new('=',@dv_coded_text,"TEST")
   end
 
   def test_init
-    assert_instance_of OpenEHR::RM::Data_Types::Text::DV_Text, @dv_text
-    assert_instance_of OpenEHR::RM::Data_Types::Text::Code_Phrase, @code_phrase
-    assert_instance_of OpenEHR::RM::Data_Types::Text::DV_Coded_Text, @dv_coded_text
-    assert_instance_of OpenEHR::RM::Data_Types::Text::Term_Mapping, @term_mapping
+    assert_instance_of OpenEhr::RM::DataTypes::Text::DvText, @dv_text
+    assert_instance_of OpenEhr::RM::DataTypes::Text::CodePhrase, @code_phrase
+    assert_instance_of OpenEhr::RM::DataTypes::Text::DvCodedText, @dv_coded_text
+    assert_instance_of OpenEhr::RM::DataTypes::Text::TermMapping, @term_mapping
   end
 
@@ -147,15 +147,15 @@
   def test_term_mapping
     assert_equal '=', @term_mapping.match
-    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('>')
-    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('=')
-    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('<')
-    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('?')
-    assert !OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('!')
+    assert OpenEhr::RM::DataTypes::Text::TermMapping.is_valid_mach_code?('>')
+    assert OpenEhr::RM::DataTypes::Text::TermMapping.is_valid_mach_code?('=')
+    assert OpenEhr::RM::DataTypes::Text::TermMapping.is_valid_mach_code?('<')
+    assert OpenEhr::RM::DataTypes::Text::TermMapping.is_valid_mach_code?('?')
+    assert !OpenEhr::RM::DataTypes::Text::TermMapping.is_valid_mach_code?('!')
     assert_equal @dv_coded_text, @term_mapping.purpose
     assert_equal "TEST", @term_mapping.target
-    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new}
-    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new('!',@dv_coded_text, "invalid case")}
-    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new('=',nil , "invalid case")}
-    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new('=',@dv_coded_text, nil)}
+    assert_raise(ArgumentError){OpenEhr::RM::DataTypes::Text::TermMapping.new}
+    assert_raise(ArgumentError){OpenEhr::RM::DataTypes::Text::TermMapping.new('!',@dv_coded_text, "invalid case")}
+    assert_raise(ArgumentError){OpenEhr::RM::DataTypes::Text::TermMapping.new('=',nil , "invalid case")}
+    assert_raise(ArgumentError){OpenEhr::RM::DataTypes::Text::TermMapping.new('=',@dv_coded_text, nil)}
   end
 end
@@ -164,45 +164,45 @@
   def setup
     assert_nothing_raised(Exception){
-      @dv_ordered = OpenEHR::RM::Data_Types::Quantity::DV_Ordered.new }
-    assert_nothing_raised(Exception){
-      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_ordinal1 = OpenEHR::RM::Data_Types::Quantity::DV_Ordinal.new(1, urinary_protein)
-      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_ordinal2 = OpenEHR::RM::Data_Types::Quantity::DV_Ordinal.new(3, urinary_protein)}
-    assert_nothing_raised(Exception){
-      @dv_interval = OpenEHR::RM::Data_Types::Quantity::DV_Interval.new(@dv_ordinal1, @dv_ordinal2)}
-    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, @dv_interval)}
-    assert_nothing_raised(Exception){
-      @dv_quantified = OpenEHR::RM::Data_Types::Quantity::DV_Quantified.new(1,'=')}
-    assert_nothing_raised(Exception){
-      @dv_amount = OpenEHR::RM::Data_Types::Quantity::DV_Amount.new(2,'<')}
-    assert_nothing_raised(Exception){
-      @dv_quantity = OpenEHR::RM::Data_Types::Quantity::DV_Quantity.new(3, 'mg', '~')}
-    assert_nothing_raised(Exception){
-      @dv_count = OpenEHR::RM::Data_Types::Quantity::DV_Count.new(1)}
-    assert_nothing_raised(Exception){
-      @dv_proportion = OpenEHR::RM::Data_Types::Quantity::DV_Proportion.new(2,3,0)}
-    assert_nothing_raised(Exception){
-      @dv_absolute_quantity = OpenEHR::RM::Data_Types::Quantity::DV_Absolute_Quantity.new(7,'=')}
+      @dv_ordered = OpenEhr::RM::DataTypes::Quantity::DvOrdered.new }
+    assert_nothing_raised(Exception){
+      terminology = OpenEhr::RM::Support::Identification::TerminologyId.new('urine')
+      code_phrase = OpenEhr::RM::DataTypes::Text::CodePhrase.new('protein',terminology)
+      urinary_protein = OpenEhr::RM::DataTypes::Text::DvCodedText.new('+', code_phrase)
+      @dv_ordinal1 = OpenEhr::RM::DataTypes::Quantity::DvOrdinal.new(1, urinary_protein)
+      code_phrase = OpenEhr::RM::DataTypes::Text::CodePhrase.new('protein',terminology)
+      urinary_protein = OpenEhr::RM::DataTypes::Text::DvCodedText.new('+++', code_phrase)
+      @dv_ordinal2 = OpenEhr::RM::DataTypes::Quantity::DvOrdinal.new(3, urinary_protein)}
+    assert_nothing_raised(Exception){
+      @dv_interval = OpenEhr::RM::DataTypes::Quantity::DvInterval.new(@dv_ordinal1, @dv_ordinal2)}
+    meaning = OpenEhr::RM::DataTypes::Text::DvText.new('normal')
+    assert_nothing_raised(Exception){
+      @reference_range = OpenEhr::RM::DataTypes::Quantity::ReferenceRange.new(meaning, @dv_interval)}
+    assert_nothing_raised(Exception){
+      @dv_quantified = OpenEhr::RM::DataTypes::Quantity::DvQuantified.new(1,'=')}
+    assert_nothing_raised(Exception){
+      @dv_amount = OpenEhr::RM::DataTypes::Quantity::DvAmount.new(2,'<')}
+    assert_nothing_raised(Exception){
+      @dv_quantity = OpenEhr::RM::DataTypes::Quantity::DvQuantity.new(3, 'mg', '~')}
+    assert_nothing_raised(Exception){
+      @dv_count = OpenEhr::RM::DataTypes::Quantity::DvCount.new(1)}
+    assert_nothing_raised(Exception){
+      @dv_proportion = OpenEhr::RM::DataTypes::Quantity::DvProportion.new(2,3,0)}
+    assert_nothing_raised(Exception){
+      @dv_absolute_quantity = OpenEhr::RM::DataTypes::Quantity::DvAbsoluteQuantity.new(7,'=')}
    end
 
    def test_init
-     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::DV_Interval, @dv_interval
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::Reference_Range, @reference_range
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Ordinal, @dv_ordinal1
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Ordinal, @dv_ordinal2
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Quantified, @dv_quantified
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Amount, @dv_amount
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Quantity, @dv_quantity
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Count, @dv_count
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Proportion, @dv_proportion
-     assert_instance_of OpenEHR::RM::Data_Types::Quantity::DV_Absolute_Quantity, @dv_absolute_quantity
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvOrdered, @dv_ordered
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvQuantified, @dv_quantified
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvInterval, @dv_interval
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::ReferenceRange, @reference_range
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvOrdinal, @dv_ordinal1
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvOrdinal, @dv_ordinal2
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvQuantified, @dv_quantified
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvAmount, @dv_amount
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvQuantity, @dv_quantity
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvCount, @dv_count
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvProportion, @dv_proportion
+     assert_instance_of OpenEhr::RM::DataTypes::Quantity::DvAbsoluteQuantity, @dv_absolute_quantity
   end
 
@@ -214,11 +214,11 @@
     assert @dv_ordered.is_simple?
     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)
+    openehr_terminology_id = OpenEhr::RM::Support::Identification::TerminologyId.new('openEHR')
+    normal_code = OpenEhr::RM::DataTypes::Text::CodePhrase.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?
-    other = OpenEHR::RM::Data_Types::Quantity::DV_Ordered.new
+    other = OpenEhr::RM::DataTypes::Quantity::DvOrdered.new
     assert_raise(NotImplementedError){
       @dv_ordered.is_strictly_comparable_to?(other)}
@@ -232,8 +232,8 @@
     assert_equal 'normal', @reference_range.meaning.value
     assert_equal 1, @reference_range.range.lower.value
-    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(2, urinary_protein)
+    terminology = OpenEhr::RM::Support::Identification::TerminologyId.new('urine')
+    code_phrase = OpenEhr::RM::DataTypes::Text::CodePhrase.new('protein',terminology)
+    urinary_protein = OpenEhr::RM::DataTypes::Text::DvCodedText.new('++', code_phrase)
+    dv_ordinal = OpenEhr::RM::DataTypes::Quantity::DvOrdinal.new(2, urinary_protein)
     assert @reference_range.is_in_range?(dv_ordinal)
     dv_ordinal.value = 6
@@ -244,10 +244,10 @@
     assert_equal 1, @dv_quantified.magnitude
     assert_equal '=', @dv_quantified.magnitude_status
-    assert !OpenEHR::RM::Data_Types::Quantity::DV_Quantified.valid_magnitude_status?('*')
-    assert OpenEHR::RM::Data_Types::Quantity::DV_Quantified.valid_magnitude_status?('>')
-    assert OpenEHR::RM::Data_Types::Quantity::DV_Quantified.valid_magnitude_status?('<')
-    assert OpenEHR::RM::Data_Types::Quantity::DV_Quantified.valid_magnitude_status?('>=')
-    assert OpenEHR::RM::Data_Types::Quantity::DV_Quantified.valid_magnitude_status?('<=')
-    assert OpenEHR::RM::Data_Types::Quantity::DV_Quantified.valid_magnitude_status?('~')
+    assert !OpenEhr::RM::DataTypes::Quantity::DvQuantified.valid_magnitude_status?('*')
+    assert OpenEhr::RM::DataTypes::Quantity::DvQuantified.valid_magnitude_status?('>')
+    assert OpenEhr::RM::DataTypes::Quantity::DvQuantified.valid_magnitude_status?('<')
+    assert OpenEhr::RM::DataTypes::Quantity::DvQuantified.valid_magnitude_status?('>=')
+    assert OpenEhr::RM::DataTypes::Quantity::DvQuantified.valid_magnitude_status?('<=')
+    assert OpenEhr::RM::DataTypes::Quantity::DvQuantified.valid_magnitude_status?('~')
     assert_nothing_raised(Exception){@dv_quantified.magnitude = 0}
     assert_equal 0, @dv_quantified.magnitude
@@ -289,6 +289,6 @@
     assert @dv_ordinal1 > @dv_ordinal2
     assert_raise(ArgumentError){@dv_ordinal1.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, @dv_interval)
+    meaning = OpenEhr::RM::DataTypes::Text::DvText.new('limits')
+    limit_reference_range = OpenEhr::RM::DataTypes::Quantity::ReferenceRange.new(meaning, @dv_interval)
     assert_nothing_raised(Exception){@dv_ordinal1.limits = limit_reference_range}
     assert_equal 'limits', @dv_ordinal1.limits.meaning.value
@@ -299,5 +299,5 @@
     assert_equal 'mg', @dv_quantity.units
     assert_equal '~', @dv_quantity.magnitude_status
-    dv_quantity2 = OpenEHR::RM::Data_Types::Quantity::DV_Quantity.new(4, 'mg', '~')
+    dv_quantity2 = OpenEhr::RM::DataTypes::Quantity::DvQuantity.new(4, 'mg', '~')
     assert_equal 'mg', dv_quantity2.units
     assert @dv_quantity.is_strictly_comparable_to?(dv_quantity2)
@@ -318,5 +318,5 @@
   def test_dv_count
     assert_equal 1, @dv_count.magnitude
-    dv_count2 = OpenEHR::RM::Data_Types::Quantity::DV_Count.new(2)
+    dv_count2 = OpenEhr::RM::DataTypes::Quantity::DvCount.new(2)
     dv_count3 = @dv_count + dv_count2
     assert 3, dv_count3.magnitude
@@ -326,13 +326,13 @@
 
   def test_proportion_kind
-    assert_equal 0, OpenEHR::RM::Data_Types::Quantity::Proportion_Kind::PK_RATIO
-    assert_equal 1, OpenEHR::RM::Data_Types::Quantity::Proportion_Kind::PK_UNITARY
-    assert_equal 2, OpenEHR::RM::Data_Types::Quantity::Proportion_Kind::PK_PERCENT
-    assert_equal 3, OpenEHR::RM::Data_Types::Quantity::Proportion_Kind::PK_FRACTION
-    assert_equal 4, OpenEHR::RM::Data_Types::Quantity::Proportion_Kind::PK_INTEGER_FRACTION
-    assert OpenEHR::RM::Data_Types::Quantity::Proportion_Kind.valid_proportion_kind?(0)
-    assert OpenEHR::RM::Data_Types::Quantity::Proportion_Kind.valid_proportion_kind?(4)
-    assert !OpenEHR::RM::Data_Types::Quantity::Proportion_Kind.valid_proportion_kind?(-1)
-    assert !OpenEHR::RM::Data_Types::Quantity::Proportion_Kind.valid_proportion_kind?(5)
+    assert_equal 0, OpenEhr::RM::DataTypes::Quantity::ProportionKind::PK_RATIO
+    assert_equal 1, OpenEhr::RM::DataTypes::Quantity::ProportionKind::PK_UNITARY
+    assert_equal 2, OpenEhr::RM::DataTypes::Quantity::ProportionKind::PK_PERCENT
+    assert_equal 3, OpenEhr::RM::DataTypes::Quantity::ProportionKind::PK_FRACTION
+    assert_equal 4, OpenEhr::RM::DataTypes::Quantity::ProportionKind::PK_INTEGER_FRACTION
+    assert OpenEhr::RM::DataTypes::Quantity::ProportionKind.valid_proportion_kind?(0)
+    assert OpenEhr::RM::DataTypes::Quantity::ProportionKind.valid_proportion_kind?(4)
+    assert !OpenEhr::RM::DataTypes::Quantity::ProportionKind.valid_proportion_kind?(-1)
+    assert !OpenEhr::RM::DataTypes::Quantity::ProportionKind.valid_proportion_kind?(5)
   end
 
@@ -343,18 +343,18 @@
     assert_equal 2.0/3.0, @dv_proportion.magnitude
     assert @dv_proportion.is_integral?
-    dv_proportion2 = OpenEHR::RM::Data_Types::Quantity::DV_Proportion.new(1,3,0)
+    dv_proportion2 = OpenEhr::RM::DataTypes::Quantity::DvProportion.new(1,3,0)
     assert @dv_proportion.is_strictly_comparable_to?(dv_proportion2)
-    dv_proportion2 = OpenEHR::RM::Data_Types::Quantity::DV_Proportion.new(1,3,4)
+    dv_proportion2 = OpenEhr::RM::DataTypes::Quantity::DvProportion.new(1,3,4)
     assert !@dv_proportion.is_strictly_comparable_to?(dv_proportion2)
     assert_raise(ArgumentError){
-      dv_proportion2 = OpenEHR::RM::Data_Types::Quantity::DV_Proportion.new(1.5,2.3,3)}
-    assert_raise(ArgumentError){
-      dv_proportion2 = OpenEHR::RM::Data_Types::Quantity::DV_Proportion.new(10,10,1)}
-    assert_nothing_raised(Exception){
-      dv_proportion2 = OpenEHR::RM::Data_Types::Quantity::DV_Proportion.new(10,1,1)}
-    assert_raise(ArgumentError){
-      dv_proportion2 = OpenEHR::RM::Data_Types::Quantity::DV_Proportion.new(10,10,2)}
-    assert_nothing_raised(Exception){
-      dv_proportion2 = OpenEHR::RM::Data_Types::Quantity::DV_Proportion.new(10,100,2)}
+      dv_proportion2 = OpenEhr::RM::DataTypes::Quantity::DvProportion.new(1.5,2.3,3)}
+    assert_raise(ArgumentError){
+      dv_proportion2 = OpenEhr::RM::DataTypes::Quantity::DvProportion.new(10,10,1)}
+    assert_nothing_raised(Exception){
+      dv_proportion2 = OpenEhr::RM::DataTypes::Quantity::DvProportion.new(10,1,1)}
+    assert_raise(ArgumentError){
+      dv_proportion2 = OpenEhr::RM::DataTypes::Quantity::DvProportion.new(10,10,2)}
+    assert_nothing_raised(Exception){
+      dv_proportion2 = OpenEhr::RM::DataTypes::Quantity::DvProportion.new(10,100,2)}
   end
 
@@ -363,20 +363,20 @@
 class EncapsulatedTest < Test::Unit::TestCase
   def setup
-    charset = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('UTF-8','character-sets')
-    language = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('ja', 'languages')
-    assert_nothing_raised(Exception){
-      @dv_encapsulated = OpenEHR::RM::Data_Types::Encapsulated::DV_Encapsulated.new(charset, language, 10)}
-    assert_nothing_raised(Exception){
-      @dv_parsable = OpenEHR::RM::Data_Types::Encapsulated::DV_Parsable.new(charset, language, 10, 'XML','<TEST>test</TEST>')}
-    media_type = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('text/html', 'media-types')
-    uri = OpenEHR::RM::Data_Types::URI::DV_URI.new("http://www.openehr.jp/changeset/test?cmd=93#file0")
-    assert_nothing_raised(Exception){
-      @dv_multimedia = OpenEHR::RM::Data_Types::Encapsulated::DV_Multimedia.new(charset, language, 10, media_type, uri)}
+    charset = OpenEhr::RM::DataTypes::Text::CodePhrase.new('UTF-8','character-sets')
+    language = OpenEhr::RM::DataTypes::Text::CodePhrase.new('ja', 'languages')
+    assert_nothing_raised(Exception){
+      @dv_encapsulated = OpenEhr::RM::DataTypes::Encapsulated::DvEncapsulated.new(charset, language, 10)}
+    assert_nothing_raised(Exception){
+      @dv_parsable = OpenEhr::RM::DataTypes::Encapsulated::DvParsable.new(charset, language, 10, 'XML','<TEST>test</TEST>')}
+    media_type = OpenEhr::RM::DataTypes::Text::CodePhrase.new('text/html', 'media-types')
+    uri = OpenEhr::RM::DataTypes::Uri::DvUri.new("http://www.openehr.jp/changeset/test?cmd=93#file0")
+    assert_nothing_raised(Exception){
+      @dv_multimedia = OpenEhr::RM::DataTypes::Encapsulated::DvMultimedia.new(charset, language, 10, media_type, uri)}
   end
 
   def test_init
-    assert_instance_of OpenEHR::RM::Data_Types::Encapsulated::DV_Encapsulated, @dv_encapsulated
-    assert_instance_of OpenEHR::RM::Data_Types::Encapsulated::DV_Parsable, @dv_parsable
-    assert_instance_of OpenEHR::RM::Data_Types::Encapsulated::DV_Multimedia, @dv_multimedia
+    assert_instance_of OpenEhr::RM::DataTypes::Encapsulated::DvEncapsulated, @dv_encapsulated
+    assert_instance_of OpenEhr::RM::DataTypes::Encapsulated::DvParsable, @dv_parsable
+    assert_instance_of OpenEhr::RM::DataTypes::Encapsulated::DvMultimedia, @dv_multimedia
   end
 
@@ -385,12 +385,12 @@
     assert_equal 'ja', @dv_encapsulated.language.code_string
     assert_equal 10, @dv_encapsulated.size
-    wrong_charset = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('USO8000', 'character-sets')
+    wrong_charset = OpenEhr::RM::DataTypes::Text::CodePhrase.new('USO8000', 'character-sets')
     assert_raise(ArgumentError){@dv_encapsulated.charset = wrong_charset}
-    charset = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('EUC-JP', 'character-sets')
+    charset = OpenEhr::RM::DataTypes::Text::CodePhrase.new('EUC-JP', 'character-sets')
     assert_nothing_raised(Exception){@dv_encapsulated.charset = charset}
     assert_equal 'EUC-JP', @dv_encapsulated.charset.code_string
-    wrong_language = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('jpg', 'language')
+    wrong_language = OpenEhr::RM::DataTypes::Text::CodePhrase.new('jpg', 'language')
     assert_raise(ArgumentError){@dv_encapsulated.language = wrong_language}
-    language = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('eng', 'language')
+    language = OpenEhr::RM::DataTypes::Text::CodePhrase.new('eng', 'language')
     assert_nothing_raised(Exception){@dv_encapsulated.language = language}
     assert_equal 'eng', @dv_encapsulated.language.code_string
@@ -429,12 +429,12 @@
 
 class TestDvTimeSpecification < Test::Unit::TestCase
-  include OpenEHR::RM::Data_Types::Time_Specification
-  include OpenEHR::RM::Data_Types::Encapsulated
-  def setup
-    charset = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('UTF-8','character-sets')
-    language = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('ja', 'languages')
-    assert_nothing_raised(Exception){
-      dv_parsable = DV_Parsable.new(charset, language, 10, 'XML','<TEST>test</TEST>')
-      @dv_time_specification = DV_Time_Specification.new(dv_parsable)}
+  include OpenEhr::RM::DataTypes::TimeSpecification
+  include OpenEhr::RM::DataTypes::Encapsulated
+  def setup
+    charset = OpenEhr::RM::DataTypes::Text::CodePhrase.new('UTF-8','character-sets')
+    language = OpenEhr::RM::DataTypes::Text::CodePhrase.new('ja', 'languages')
+    assert_nothing_raised(Exception){
+      dv_parsable = DvParsable.new(charset, language, 10, 'XML','<TEST>test</TEST>')
+      @dv_time_specification = DvTimeSpecification.new(dv_parsable)}
 #    assert_nothing_raised(Exception){
 #      @dv_periodic_time_specification = DV_Periodic_Time_Specification.new('[200004181100;200004181110]/(7d)@DWIST', charset, language, 10, 'HL7:PIVL')}
@@ -442,5 +442,5 @@
 
   def test_init
-    assert_instance_of DV_Time_Specification, @dv_time_specification
+    assert_instance_of DvTimeSpecification, @dv_time_specification
   end
 
Index: ruby/trunk/lib/models/tests/rm/test_security.rb
===================================================================
--- ruby/trunk/lib/models/tests/rm/test_security.rb	(revision 268)
+++ ruby/trunk/lib/models/tests/rm/test_security.rb	(revision 291)
@@ -5,9 +5,9 @@
   def setup
     assert_nothing_raised(Exception){
-      @access_control_setting = OpenEHR::RM::Security::Access_Control_Settings.new}
+      @access_control_setting = OpenEhr::RM::Security::AccessControlSettings.new}
   end
 
   def test_init
-    assert_instance_of OpenEHR::RM::Security::Access_Control_Settings, @access_control_setting
+    assert_instance_of OpenEhr::RM::Security::AccessControlSettings, @access_control_setting
   end
 end
Index: ruby/trunk/lib/models/tests/rm/test_support.rb
===================================================================
--- ruby/trunk/lib/models/tests/rm/test_support.rb	(revision 268)
+++ ruby/trunk/lib/models/tests/rm/test_support.rb	(revision 291)
@@ -5,6 +5,6 @@
 class RM_Support_Definition_Test < Test::Unit::TestCase
     def test_constant
-    assert_equal("\r", OpenEHR::RM::Support::Definition::OpenEHR_Definitions::CR)
-    assert_equal("\n", OpenEHR::RM::Support::Definition::OpenEHR_Definitions::LF)
+    assert_equal("\r", OpenEhr::RM::Support::Definition::OpenEHRDefinitions::CR)
+    assert_equal("\n", OpenEhr::RM::Support::Definition::OpenEHRDefinitions::LF)
   end
 end
@@ -13,4 +13,5 @@
 class RM_Support_Identification_Test < Test::Unit::TestCase
   def setup
+<<<<<<< .working
     assert_nothing_raised(Exception){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new("0.0.3")}
     assert_nothing_raised(Exception){@object_ref = OpenEHR::RM::Support::Identification::Object_Ref.new('local', 'ANY', @object_id)}
@@ -25,20 +26,34 @@
     assert_nothing_raised(Exception){@version_tree_id = OpenEHR::RM::Support::Identification::Version_Tree_ID.new('1.2.3')}
     assert_nothing_raised(Exception){@object_version_id = OpenEHR::RM::Support::Identification::Object_Version_ID.new('ABC::DEF::1.2.3')}
+=======
+    assert_nothing_raised(Exception){@object_id = OpenEhr::RM::Support::Identification::ObjectId.new("0.0.3")}
+    assert_nothing_raised(Exception){@object_ref = OpenEhr::RM::Support::Identification::ObjectRef.new('local', 'ANY', @object_id)}
+    assert_nothing_raised(Exception){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_nothing_raised(Exception){@terminology_id = OpenEhr::RM::Support::Identification::TerminologyId.new('ICD10(2003)')}
+    assert_nothing_raised(Exception){@generic_id = OpenEhr::RM::Support::Identification::GenericId.new("0.0.3", "openehr")}
+    assert_nothing_raised(Exception){@uid_based_id = OpenEhr::RM::Support::Identification::UidBasedId.new('rrip::0.0.3')}
+    assert_nothing_raised(Exception){@hier_object_id = OpenEhr::RM::Support::Identification::HierObjectId.new('0.0.4')}
+    assert_nothing_raised(Exception){@locatable_ref = OpenEhr::RM::Support::Identification::LocatableRef.new('unknown', 'PERSON', @uid_based_id, 'data/event[at0001, standing]')}
+    assert_nothing_raised(Exception){@party_ref = OpenEhr::RM::Support::Identification::PartyRef.new('unknown', 'ORGANISATION', @object_id)}
+    assert_nothing_raised(Exception){@access_group_ref = OpenEhr::RM::Support::Identification::AccessGroupRef.new('unknown', 'ACCESS_GROUP', @object_id)}
+    assert_nothing_raised(Exception){@version_tree_id = OpenEhr::RM::Support::Identification::VersionTreeId.new('1.2.3')}
+    assert_nothing_raised(Exception){@object_version_id = OpenEhr::RM::Support::Identification::ObjectVersionId.new('ABC::DEF::1.2.3')}
+>>>>>>> .merge-right.r168
   end
   
   def test_init
-    assert_instance_of OpenEHR::RM::Support::Identification::Object_ID, @object_id
-    assert_instance_of OpenEHR::RM::Support::Identification::Object_Ref, @object_ref
-    assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, @archetype_id
-    assert_instance_of OpenEHR::RM::Support::Identification::Terminology_ID, @terminology_id
-    assert_instance_of OpenEHR::RM::Support::Identification::Object_ID, @object_id
-    assert_instance_of OpenEHR::RM::Support::Identification::Generic_ID, @generic_id
-    assert_instance_of OpenEHR::RM::Support::Identification::UID_Based_ID, @uid_based_id
-    assert_instance_of OpenEHR::RM::Support::Identification::Hier_Object_ID, @hier_object_id
-    assert_instance_of OpenEHR::RM::Support::Identification::Locatable_Ref, @locatable_ref
-    assert_instance_of OpenEHR::RM::Support::Identification::Party_Ref, @party_ref
-    assert_instance_of OpenEHR::RM::Support::Identification::Access_Group_Ref, @access_group_ref
-    assert_instance_of OpenEHR::RM::Support::Identification::Version_Tree_ID, @version_tree_id
-    assert_instance_of OpenEHR::RM::Support::Identification::Object_Version_ID, @object_version_id
+    assert_instance_of OpenEhr::RM::Support::Identification::ObjectId, @object_id
+    assert_instance_of OpenEhr::RM::Support::Identification::ObjectRef, @object_ref
+    assert_instance_of OpenEhr::RM::Support::Identification::ArchetypeId, @archetype_id
+    assert_instance_of OpenEhr::RM::Support::Identification::TerminologyId, @terminology_id
+    assert_instance_of OpenEhr::RM::Support::Identification::ObjectId, @object_id
+    assert_instance_of OpenEhr::RM::Support::Identification::GenericId, @generic_id
+    assert_instance_of OpenEhr::RM::Support::Identification::UidBasedId, @uid_based_id
+    assert_instance_of OpenEhr::RM::Support::Identification::HierObjectId, @hier_object_id
+    assert_instance_of OpenEhr::RM::Support::Identification::LocatableRef, @locatable_ref
+    assert_instance_of OpenEhr::RM::Support::Identification::PartyRef, @party_ref
+    assert_instance_of OpenEhr::RM::Support::Identification::AccessGroupRef, @access_group_ref
+    assert_instance_of OpenEhr::RM::Support::Identification::VersionTreeId, @version_tree_id
+    assert_instance_of OpenEhr::RM::Support::Identification::ObjectVersionId, @object_version_id
   end
 
@@ -49,8 +64,8 @@
     assert_raise(ArgumentError){@object_id.value=nil}
     assert_raise(ArgumentError){@object_id.value=""}
-    assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new}
-    assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new(nil)}
-    assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new("")}
-    assert_equal @object_id, OpenEHR::RM::Support::Identification::Object_ID.new("0.0.4")
+    assert_raise(ArgumentError){@object_id = OpenEhr::RM::Support::Identification::ObjectId.new}
+    assert_raise(ArgumentError){@object_id = OpenEhr::RM::Support::Identification::ObjectId.new(nil)}
+    assert_raise(ArgumentError){@object_id = OpenEhr::RM::Support::Identification::ObjectId.new("")}
+    assert_equal @object_id, OpenEhr::RM::Support::Identification::ObjectId.new("0.0.4")
   end
 
@@ -60,10 +75,10 @@
     assert_equal @object_id, @object_ref.id
 
-    assert_raise(ArgumentError){@object_ref = OpenEHR::RM::Support::Identification::Archetype_ID.new}
-    assert_raise(ArgumentError){@object_ref = OpenEHR::RM::Support::Identification::Archetype_ID.new(nil, 'ANY', @object_id)}
-    assert_raise(ArgumentError){@object_ref = OpenEHR::RM::Support::Identification::Archetype_ID.new('', 'ANY', @object_id)}
-    assert_raise(ArgumentError){@object_ref = OpenEHR::RM::Support::Identification::Archetype_ID.new('local', nil, @object_id)}
-    assert_raise(ArgumentError){@object_ref = OpenEHR::RM::Support::Identification::Archetype_ID.new('local', '', @object_id)}
-    assert_raise(ArgumentError){@object_ref = OpenEHR::RM::Support::Identification::Archetype_ID.new('local', 'ANY', nil)}
+    assert_raise(ArgumentError){@object_ref = OpenEhr::RM::Support::Identification::ArchetypeId.new}
+    assert_raise(ArgumentError){@object_ref = OpenEhr::RM::Support::Identification::ArchetypeId.new(nil, 'ANY', @object_id)}
+    assert_raise(ArgumentError){@object_ref = OpenEhr::RM::Support::Identification::ArchetypeId.new('', 'ANY', @object_id)}
+    assert_raise(ArgumentError){@object_ref = OpenEhr::RM::Support::Identification::ArchetypeId.new('local', nil, @object_id)}
+    assert_raise(ArgumentError){@object_ref = OpenEhr::RM::Support::Identification::ArchetypeId.new('local', '', @object_id)}
+    assert_raise(ArgumentError){@object_ref = OpenEhr::RM::Support::Identification::ArchetypeId.new('local', 'ANY', nil)}
 
     assert_nothing_raised(Exception){@object_ref.namespace = 'terminology'}
@@ -79,10 +94,11 @@
     assert_raise(ArgumentError){@object_ref.type = ''}
 
-    assert_nothing_raised(Exception){@object_ref.id = OpenEHR::RM::Support::Identification::Object_ID.new("0.0.5")}
-    assert_equal OpenEHR::RM::Support::Identification::Object_ID.new("0.0.5"), @object_ref.id
+    assert_nothing_raised(Exception){@object_ref.id = OpenEhr::RM::Support::Identification::ObjectId.new("0.0.5")}
+    assert_equal OpenEhr::RM::Support::Identification::ObjectId.new("0.0.5"), @object_ref.id
     assert_raise(ArgumentError){@object_ref.id = nil}
   end
 
   def test_archetype_id
+<<<<<<< .working
     assert_equal 'openEHR-EHR-SECTION.physical_examination-prenatal.v2', @archetype_id.value
     assert_equal 'openEHR-EHR-SECTION', @archetype_id.qualified_rm_entity
@@ -93,4 +109,62 @@
     assert_equal 'prenatal', @archetype_id.specialisation
     assert_equal 'v2', @archetype_id.version_id
+=======
+    assert_equal "0.0.5", @archetype_id.value
+    assert_nothing_raised(Exception){@archetype_id.value = "0.0.6"}
+    assert_equal "0.0.6", @archetype_id.value
+    assert_raise(ArgumentError){@archetype_id.value=nil}
+    assert_raise(ArgumentError){@archetype_id.value=""}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new(nil, "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@object_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", nil, "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", nil, "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", nil, "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", "", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", nil,"cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr",nil ,"0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol", nil)}
+    assert_raise(ArgumentError){@archetype_id = OpenEhr::RM::Support::Identification::ArchetypeId.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","")}
+
+    assert_equal "biochemistry result_cholesterol", @archetype_id.domain_concept
+    assert_nothing_raised(Exception){(@archetype_id.domain_concept = "biochemistry result_triglyceride")}
+    assert_equal "biochemistry result_triglyceride", @archetype_id.domain_concept
+    assert_raise(ArgumentError){@archetype_id.domain_concept = nil}
+    assert_raise(ArgumentError){@archetype_id.domain_concept = ""}
+
+    assert_equal "entry", @archetype_id.rm_name
+    assert_nothing_raised(Exception){@archetype_id.rm_name = "section"}
+    assert_equal "section", @archetype_id.rm_name
+    assert_raise(ArgumentError){@archetype_id.rm_name = nil}
+    assert_raise(ArgumentError){@archetype_id.rm_name = ""}
+
+    assert_equal "ehr_rm", @archetype_id.rm_entity
+    assert_nothing_raised(Exception){@archetype_id.rm_entity = "13606"}
+    assert_equal "13606", @archetype_id.rm_entity
+    assert_raise(ArgumentError){@archetype_id.rm_entity = nil}
+    assert_raise(ArgumentError){@archetype_id.rm_entity = ""}
+
+    assert_equal "openehr", @archetype_id.rm_originator
+    assert_nothing_raised(Exception){@archetype_id.rm_originator = "cen"}
+    assert_equal "cen", @archetype_id.rm_originator
+    assert_raise(ArgumentError){@archetype_id.rm_originator = nil}
+    assert_raise(ArgumentError){@archetype_id.rm_originator = ""}
+
+    assert_equal "cholesterol", @archetype_id.specialisation
+    assert_nothing_raised(Exception){@archetype_id.specialisation = "triglyceride"}
+    assert_equal "triglyceride", @archetype_id.specialisation
+    assert_raise(ArgumentError){@archetype_id.specialisation = nil}
+    assert_raise(ArgumentError){@archetype_id.specialisation = ""}
+
+    assert_equal "0.0.3", @archetype_id.version_id
+    assert_nothing_raised(Exception){@archetype_id.version_id = "0.0.7"}
+    assert_equal "0.0.7", @archetype_id.version_id
+    assert_raise(ArgumentError){@archetype_id.version_id = nil}
+    assert_raise(ArgumentError){@archetype_id.version_id = ""}
+>>>>>>> .merge-right.r168
   end
 
@@ -103,9 +177,9 @@
     assert_raise(ArgumentError){@terminology_id.value = ""}
 
-    assert_raise(ArgumentError){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new}
-    assert_raise(ArgumentError){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new(nil,'2008')}
-    assert_raise(ArgumentError){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('','02008')}
-    assert_raise(ArgumentError){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new("SNOMED", nil)}
-    assert_nothing_raised(Exception){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new("SNOMED")}
+    assert_raise(ArgumentError){@terminology_id = OpenEhr::RM::Support::Identification::TerminologyId.new}
+    assert_raise(ArgumentError){@terminology_id = OpenEhr::RM::Support::Identification::TerminologyId.new(nil,'2008')}
+    assert_raise(ArgumentError){@terminology_id = OpenEhr::RM::Support::Identification::TerminologyId.new('','02008')}
+    assert_raise(ArgumentError){@terminology_id = OpenEhr::RM::Support::Identification::TerminologyId.new("SNOMED", nil)}
+    assert_nothing_raised(Exception){@terminology_id = OpenEhr::RM::Support::Identification::TerminologyId.new("SNOMED")}
 
     assert_equal "SNOMED", @terminology_id.name
@@ -127,8 +201,8 @@
     assert_equal "openehr", @generic_id.scheme
 
-    assert_raise(ArgumentError){@generic_id = OpenEHR::RM::Support::Identification::Generic_ID.new(nil, "openehr")}
-    assert_raise(ArgumentError){@generic_id = OpenEHR::RM::Support::Identification::Generic_ID.new("", "openehr")}
-    assert_raise(ArgumentError){@generic_id = OpenEHR::RM::Support::Identification::Generic_ID.new("0.0.3", nil)}
-    assert_raise(ArgumentError){@generic_id = OpenEHR::RM::Support::Identification::Generic_ID.new("0.0.3", "")}
+    assert_raise(ArgumentError){@generic_id = OpenEhr::RM::Support::Identification::GenericId.new(nil, "openehr")}
+    assert_raise(ArgumentError){@generic_id = OpenEhr::RM::Support::Identification::GenericId.new("", "openehr")}
+    assert_raise(ArgumentError){@generic_id = OpenEhr::RM::Support::Identification::GenericId.new("0.0.3", nil)}
+    assert_raise(ArgumentError){@generic_id = OpenEhr::RM::Support::Identification::GenericId.new("0.0.3", "")}
 
     assert_raise(ArgumentError){@generic_id.value = nil}
@@ -149,6 +223,6 @@
     assert @uid_based_id.has_extension?
 
-    assert_raise(ArgumentError){@uid_based_id = OpenEHR::RM::Support::Identification::UID_Based_ID.new(nil)}
-    assert_raise(ArgumentError){@uid_based_id = OpenEHR::RM::Support::Identification::UID_Based_ID.new('')}
+    assert_raise(ArgumentError){@uid_based_id = OpenEhr::RM::Support::Identification::UidBasedId.new(nil)}
+    assert_raise(ArgumentError){@uid_based_id = OpenEhr::RM::Support::Identification::UidBasedId.new('')}
     assert_raise(ArgumentError){@uid_based_id.value = nil}
     assert_raise(ArgumentError){@uid_based_id.value = ''}
Index: ruby/trunk/lib/models/tests/test_archetype_model.rb
===================================================================
--- ruby/trunk/lib/models/tests/test_archetype_model.rb	(revision 268)
+++ ruby/trunk/lib/models/tests/test_archetype_model.rb	(revision 291)
@@ -5,25 +5,25 @@
 class ArchetypeModelTest < Test::Unit::TestCase
   def setup
-    @archetype = OpenEHR::AM::Archetype::ARCHETYPE.new
-    @validity_kind = OpenEHR::AM::Archetype::VALIDITY_KIND.new
+    @archetype = OpenEhr::AM::Archetype::ARCHETYPE.new
+    @validity_kind = OpenEhr::AM::Archetype::VALIDITY_KIND.new
 
-    @archetype_description = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new
-    @archetype_description_item = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM.new
+    @archetype_description = OpenEhr::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new
+    @archetype_description_item = OpenEhr::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM.new
   end
   
   def test_init
-    assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
-    assert_instance_of OpenEHR::AM::Archetype::VALIDITY_KIND, @validity_kind
-    assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, @archetype_description
-    assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM, @archetype_description_item
-    assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
+    assert_instance_of OpenEhr::AM::Archetype::ARCHETYPE, @archetype
+    assert_instance_of OpenEhr::AM::Archetype::VALIDITY_KIND, @validity_kind
+    assert_instance_of OpenEhr::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, @archetype_description
+    assert_instance_of OpenEhr::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM, @archetype_description_item
+    assert_instance_of OpenEhr::AM::Archetype::ARCHETYPE, @archetype
   end
 
   def test_create
-    archetype_instance = OpenEHR::AM::Archetype::ARCHETYPE.create() do |archetype|
+    archetype_instance = OpenEhr::AM::Archetype::ARCHETYPE.create() do |archetype|
       archetype.adl_version = '1.4'
     end
 
-    assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, archetype_instance
+    assert_instance_of OpenEhr::AM::Archetype::ARCHETYPE, archetype_instance
   end
 end
@@ -31,49 +31,49 @@
 class ArchetypeModelConstraintTest < Test::Unit::TestCase
   def setup
-    @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
-    @cardinality = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new    
+    @archetype_constraint = OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
+    @cardinality = OpenEhr::AM::Archetype::Constraint_Model::CARDINALITY.new
     
-    @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
-    @c_object = OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT.new
-    @c_defined_object = OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT.new
-    @c_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE.new
-    @c_single_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new
-    @c_multiple_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new(:rm_attribute_name => 'attribute_name', :cardinality => @cardinality)
-    @c_primitive_object = OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.new
-    @c_reference_object =  OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT.new
-    @archetype_internal_ref =  OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.new
-    @archetype_slot = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.new
-    @constraint_ref = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.new
-    @c_domain_type = OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE.new
-    @c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => [@c_single_attribute])
+    @archetype_constraint = OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
+    @c_object = OpenEhr::AM::Archetype::Constraint_Model::C_OBJECT.new
+    @c_defined_object = OpenEhr::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT.new
+    @c_attribute = OpenEhr::AM::Archetype::Constraint_Model::C_ATTRIBUTE.new
+    @c_single_attribute = OpenEhr::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new
+    @c_multiple_attribute = OpenEhr::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new(:rm_attribute_name => 'attribute_name', :cardinality => @cardinality)
+    @c_primitive_object = OpenEhr::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.new
+    @c_reference_object =  OpenEhr::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT.new
+    @archetype_internal_ref =  OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.new
+    @archetype_slot = OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.new
+    @constraint_ref = OpenEhr::AM::Archetype::Constraint_Model::CONSTRAINT_REF.new
+    @c_domain_type = OpenEhr::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE.new
+    @c_complex_object = OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => [@c_single_attribute])
   end
 
   def test_init
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT, @c_object
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT, @c_defined_object
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE, @c_attribute
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE, @c_single_attribute
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE, @c_multiple_attribute
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_OBJECT, @c_object
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT, @c_defined_object
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_ATTRIBUTE, @c_attribute
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE, @c_single_attribute
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE, @c_multiple_attribute
     assert_equal 'attribute_name', @c_multiple_attribute.rm_attribute_name
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY, @c_multiple_attribute.cardinality
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT, @c_primitive_object
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT, @c_reference_object
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF, @archetype_internal_ref
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT, @archetype_slot
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF, @constraint_ref
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE, @c_domain_type
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, @c_complex_object
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::CARDINALITY, @c_multiple_attribute.cardinality
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT, @c_primitive_object
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT, @c_reference_object
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF, @archetype_internal_ref
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT, @archetype_slot
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::CONSTRAINT_REF, @constraint_ref
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE, @c_domain_type
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, @c_complex_object
     assert_instance_of Array, @c_complex_object.attributes
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY, @cardinality
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::CARDINALITY, @cardinality
   end
 
   def test_create
-    c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:node_id => 'test_node',
+    c_complex_object = OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:node_id => 'test_node',
                                                                                          :attributes => [1,2],
                                                                                          :assumed_value => Array
                                                                                          )
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, c_complex_object
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, c_complex_object
     assert_equal 'test_node', c_complex_object.node_id
   end
@@ -83,26 +83,26 @@
   def setup
     #@c_primitive = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE.new
-    @c_boolean = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,
+    @c_boolean = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,
                                                                                     :false_valid => true,
                                                                                     :assumed_value => true)
-    @c_string = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING.new
-    @c_integer = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.new
-    @c_real = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL.new
-    @c_time = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME.new
-    @c_date = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE.new
-    @c_date_time = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new
-    @c_duration = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new
+    @c_string = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_STRING.new
+    @c_integer = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.new
+    @c_real = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_REAL.new
+    @c_time = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_TIME.new
+    @c_date = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DATE.new
+    @c_date_time = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new
+    @c_duration = OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new
   end
 
   def test_init
     #assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE, @c_primitive
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN, @c_boolean
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING, @c_string
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER, @c_integer
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL, @c_real
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME, @c_time
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE, @c_date
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME, @c_date_time
-    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION, @c_duration
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN, @c_boolean
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_STRING, @c_string
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_INTEGER, @c_integer
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_REAL, @c_real
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_TIME, @c_time
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DATE, @c_date
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME, @c_date_time
+    assert_instance_of OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_DURATION, @c_duration
   end
 
@@ -119,5 +119,5 @@
     end
     assert_raise(ArgumentError) do 
-      OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid =>false,
+      OpenEhr::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid =>false,
                                                                          :false_valid => false,
                                                                          :assumed_value => false)
@@ -129,11 +129,11 @@
 class ArchetypeModelOntologyTest < Test::Unit::TestCase
   def setup
-    @archetype_ontology = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new
-    @archetype_term = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_TERM.new(:code => '', :items => '')
+    @archetype_ontology = OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new
+    @archetype_term = OpenEhr::AM::Archetype::Ontology::ARCHETYPE_TERM.new(:code => '', :items => '')
   end
 
   def test_init
-    assert_instance_of OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY, @archetype_ontology
-    assert_instance_of OpenEHR::AM::Archetype::Ontology::ARCHETYPE_TERM, @archetype_term
+    assert_instance_of OpenEhr::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY, @archetype_ontology
+    assert_instance_of OpenEhr::AM::Archetype::Ontology::ARCHETYPE_TERM, @archetype_term
   end
 end
@@ -141,23 +141,23 @@
 class ArchetypeModelAssertionTest < Test::Unit::TestCase
   def setup
-    @assertion = OpenEHR::AM::Archetype::Assertion::ASSERTION.new
-    @assertion_variable = OpenEHR::AM::Archetype::Assertion::ASSERTION_VARIABLE.new
-    @operator_kind = OpenEHR::AM::Archetype::Assertion::OPERATOR_KIND.new
-    @expr_item = OpenEHR::AM::Archetype::Assertion::EXPR_ITEM.new
-    @expr_leaf = OpenEHR::AM::Archetype::Assertion::EXPR_LEAF.new
-    @expr_operator = OpenEHR::AM::Archetype::Assertion::EXPR_OPERATOR.new
-    @expr_unary_operator = OpenEHR::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR.new
-    @expr_binary_operator = OpenEHR::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR.new
+    @assertion = OpenEhr::AM::Archetype::Assertion::ASSERTION.new
+    @assertion_variable = OpenEhr::AM::Archetype::Assertion::ASSERTION_VARIABLE.new
+    @operator_kind = OpenEhr::AM::Archetype::Assertion::OPERATOR_KIND.new
+    @expr_item = OpenEhr::AM::Archetype::Assertion::EXPR_ITEM.new
+    @expr_leaf = OpenEhr::AM::Archetype::Assertion::EXPR_LEAF.new
+    @expr_operator = OpenEhr::AM::Archetype::Assertion::EXPR_OPERATOR.new
+    @expr_unary_operator = OpenEhr::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR.new
+    @expr_binary_operator = OpenEhr::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR.new
   end
 
   def test_init
-    assert_instance_of OpenEHR::AM::Archetype::Assertion::ASSERTION, @assertion
-    assert_instance_of OpenEHR::AM::Archetype::Assertion::ASSERTION_VARIABLE, @assertion_variable
-    assert_instance_of OpenEHR::AM::Archetype::Assertion::OPERATOR_KIND, @operator_kind
-    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_ITEM, @expr_item
-    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_LEAF, @expr_leaf
-    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_OPERATOR, @expr_operator
-    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR, @expr_unary_operator
-    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR, @expr_binary_operator
+    assert_instance_of OpenEhr::AM::Archetype::Assertion::ASSERTION, @assertion
+    assert_instance_of OpenEhr::AM::Archetype::Assertion::ASSERTION_VARIABLE, @assertion_variable
+    assert_instance_of OpenEhr::AM::Archetype::Assertion::OPERATOR_KIND, @operator_kind
+    assert_instance_of OpenEhr::AM::Archetype::Assertion::EXPR_ITEM, @expr_item
+    assert_instance_of OpenEhr::AM::Archetype::Assertion::EXPR_LEAF, @expr_leaf
+    assert_instance_of OpenEhr::AM::Archetype::Assertion::EXPR_OPERATOR, @expr_operator
+    assert_instance_of OpenEhr::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR, @expr_unary_operator
+    assert_instance_of OpenEhr::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR, @expr_binary_operator
   end
 end
@@ -165,29 +165,29 @@
 class ArchetypeModelProfileTest < Test::Unit::TestCase
   def setup
-    @c_dv_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::C_DV_STATE.new
-    @state_machine = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE_MACHINE.new
-    @state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE.new
-    @terminal_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TERMINAL_STATE.new
-    @non_terminal_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::NON_TERMINAL_STATE.new
-    @transition = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TRANSITION.new
+    @c_dv_state = OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::C_DV_STATE.new
+    @state_machine = OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::STATE_MACHINE.new
+    @state = OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::STATE.new
+    @terminal_state = OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::TERMINAL_STATE.new
+    @non_terminal_state = OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::NON_TERMINAL_STATE.new
+    @transition = OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::TRANSITION.new
 
-    @c_code_phase = OpenEHR::AM::OpenEHR_Profile::Data_Types::Text::C_CODE_PHASE.new
+    @c_code_phase = OpenEhr::AM::OpenEHR_Profile::DataTypes::Text::C_CODE_PHASE.new
 
-    @c_dv_quantity = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_QUANTITY.new
-    @c_dv_ordinal = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_ORDINAL.new
-    @c_quantity_item = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_QUANTITY_ITEM.new
+    @c_dv_quantity = OpenEhr::AM::OpenEHR_Profile::DataTypes::Quantity::C_DV_QUANTITY.new
+    @c_dv_ordinal = OpenEhr::AM::OpenEHR_Profile::DataTypes::Quantity::C_DV_ORDINAL.new
+    @c_quantity_item = OpenEhr::AM::OpenEHR_Profile::DataTypes::Quantity::C_QUANTITY_ITEM.new
   end
 
   def test_init
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::C_DV_STATE, @c_dv_state
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE_MACHINE, @state_machine
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE, @state
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TERMINAL_STATE, @terminal_state
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::NON_TERMINAL_STATE, @non_terminal_state
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TRANSITION, @transition
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Text::C_CODE_PHASE, @c_code_phase
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_QUANTITY, @c_dv_quantity
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_ORDINAL, @c_dv_ordinal
-    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_QUANTITY_ITEM, @c_quantity_item
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::C_DV_STATE, @c_dv_state
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::STATE_MACHINE, @state_machine
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::STATE, @state
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::TERMINAL_STATE, @terminal_state
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::NON_TERMINAL_STATE, @non_terminal_state
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Basic::TRANSITION, @transition
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Text::C_CODE_PHASE, @c_code_phase
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Quantity::C_DV_QUANTITY, @c_dv_quantity
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Quantity::C_DV_ORDINAL, @c_dv_ordinal
+    assert_instance_of OpenEhr::AM::OpenEHR_Profile::DataTypes::Quantity::C_QUANTITY_ITEM, @c_quantity_item
   end
 end
Index: ruby/trunk/lib/models/tests/test_assumed_library_types.rb
===================================================================
--- ruby/trunk/lib/models/tests/test_assumed_library_types.rb	(revision 268)
+++ ruby/trunk/lib/models/tests/test_assumed_library_types.rb	(revision 291)
@@ -2,23 +2,23 @@
 require 'assumed_library_types.rb'
 
-include OpenEHR::Assumed_Library_Types
+include OpenEhr::AssumedLibraryTypes
 
 class Assumed_Library_Test < Test::Unit::TestCase
   def setup
-    assert_nothing_raised(Exception){@interval = OpenEHR::Assumed_Library_Types::Interval.new(1,2)}
-    assert_nothing_raised(Exception){@iso8601_date = OpenEHR::Assumed_Library_Types::ISO8601_DATE.new('2009-04-27')}
-    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('P1Y2M3W4DT5H6M7.8S')}
-    assert_nothing_raised(Exception){@iso8601_timezone = OpenEHR::Assumed_Library_Types::ISO8601_TIMEZONE.new}
+    assert_nothing_raised(Exception){@interval = OpenEhr::AssumedLibraryTypes::Interval.new(1,2)}
+    assert_nothing_raised(Exception){@iso8601_date = OpenEhr::AssumedLibraryTypes::ISO8601_DATE.new('2009-04-27')}
+    assert_nothing_raised(Exception){@iso8601_time = OpenEhr::AssumedLibraryTypes::ISO8601_TIME.new('15:55:37.32+0900')}
+    assert_nothing_raised(Exception){@iso8601_date_time = OpenEhr::AssumedLibraryTypes::ISO8601_DATE_TIME.new('2009-04-27T15:55:37.32+0900')}
+    assert_nothing_raised(Exception){@iso8601_duration = OpenEhr::AssumedLibraryTypes::ISO8601_DURATION.new('P1Y2M3W4DT5H6M7.8S')}
+    assert_nothing_raised(Exception){@iso8601_timezone = OpenEhr::AssumedLibraryTypes::ISO8601_TIMEZONE.new}
   end
 
   def test_initialize
-    assert_instance_of OpenEHR::Assumed_Library_Types::Interval, @interval
-    assert_instance_of OpenEHR::Assumed_Library_Types::ISO8601_DATE, @iso8601_date
-    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
+    assert_instance_of OpenEhr::AssumedLibraryTypes::Interval, @interval
+    assert_instance_of OpenEhr::AssumedLibraryTypes::ISO8601_DATE, @iso8601_date
+    assert_instance_of OpenEhr::AssumedLibraryTypes::ISO8601_TIME, @iso8601_time
+    assert_instance_of OpenEhr::AssumedLibraryTypes::ISO8601_DATE_TIME, @iso8601_date_time
+    assert_instance_of OpenEhr::AssumedLibraryTypes::ISO8601_DURATION, @iso8601_duration
+    assert_instance_of OpenEhr::AssumedLibraryTypes::ISO8601_TIMEZONE, @iso8601_timezone
   end
 
@@ -58,114 +58,114 @@
 
   def test_time_definitions
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::DAYS_IN_LEAP_YEAR, 366
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::DAYS_IN_WEEK, 7
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::DAYS_IN_YEAR, 365
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::HOURS_IN_DAY, 24
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::MAX_DAYS_IN_MONTH, 31
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::MAX_DAYS_IN_YEAR, 366
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::MINUTES_IN_HOUR, 60
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::MONTH_IN_YEAR, 12
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::NOMINAL_DAYS_IN_MONTH, 30.42
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::NOMINAL_DAYS_IN_YEAR, 365.24
-    assert_equal OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS::SECONDS_IN_MINUTE, 60
+    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
   end
 
   def test_time_definition_validity
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_year?(2008)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_year?(-20)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_year?(0)
+    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_year?(2008)
+    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_year?(-20)
+    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_year?(0)
 # today
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,6,19)
+    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_day?(2008,6,19)
 # test valid_day lower limit
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(0,0,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(0,1,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(-1,1,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(0,1,0)
+    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)
 # test valid_day upper and lowerlimit of each month
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(0,0,1)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,1,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,1,0)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,0,1)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,1,31)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,1,32)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,2,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,2,0)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,2,31)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,3,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,3,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,3,31)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,3,32)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,4,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,4,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,4,30)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,4,31)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,5,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,5,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,5,31)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,5,32)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,6,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,6,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,6,30)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,6,31)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,7,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,7,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,7,31)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,7,32)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,8,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,8,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,8,31)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,8,32)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,9,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,9,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,9,30)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,9,31)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,10,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,10,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,10,31)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,10,32)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,11,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,11,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,11,30)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,11,31)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,12,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,12,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,12,31)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,12,32)
+    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)
 # test valid_day leap year
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(1900,2,28)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(1900,2,29)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2000,2,29)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_day?(2008,2,29)
+    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)
 # test valid_hour lower limit
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(0,0,0)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(-1,0,0)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(0,-1,0)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(0,0,-1)
+    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)
 # test valid_hour upper limit
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(0,59,0)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(0,60,0)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(0,0,59)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(0,0,60)
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(24,0,0)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(24,0,1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_hour?(24,1,0)
+    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)
 # test valid_minute method lower limit
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_minute?(0)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_minute?(-1)
+    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_minute?(0)
+    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_minute?(-1)
 # test valid_minute method upper limit
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_minute?(59)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_minute?(60)
+    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_minute?(59)
+    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_minute?(60)
 # test valid_second method lower limit
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_second?(0)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_second?(-1)
+    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_second?(0)
+    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_second?(-1)
 # test valid_second method upper limit
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_second?(59)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_second?(60)
+    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_second?(59)
+    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_second?(60)
 # test valid_month method lower limit
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_month?(1)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_month?(0)
+    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_month?(1)
+    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_month?(0)
 # test valid_month method upper limit
-    assert OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_month?(12)
-    assert !OpenEHR::Assumed_Library_Types::TIME_DEFINITIONS.valid_month?(13)
+    assert OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_month?(12)
+    assert !OpenEhr::AssumedLibraryTypes::TIME_DEFINITIONS.valid_month?(13)
   end
   def test_iso8601_date
@@ -173,5 +173,5 @@
     assert_equal 4,@iso8601_date.month
     assert_equal 27,@iso8601_date.day
-    assert_nothing_raised(Exception){@iso8601_date = OpenEHR::Assumed_Library_Types::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?
@@ -194,6 +194,6 @@
     assert !@iso8601_date.is_partial?
     assert_equal "2008-06-14", @iso8601_date.as_string
-    assert OpenEHR::Assumed_Library_Types::ISO8601_DATE.valid_iso8601_date?("2006-06-14")
-    assert !OpenEHR::Assumed_Library_Types::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
 
@@ -207,5 +207,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::Assumed_Library_Types::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?
@@ -253,11 +253,11 @@
     assert @iso8601_time.is_extended?
     assert !@iso8601_time.is_decimal_sign_comma?
-    assert OpenEHR::Assumed_Library_Types::ISO8601_TIME.valid_iso8601_time?("012345Z")
-    assert OpenEHR::Assumed_Library_Types::ISO8601_TIME.valid_iso8601_time?("012345.67+0900")
-    assert !OpenEHR::Assumed_Library_Types::ISO8601_TIME.valid_iso8601_time?("242345.67+0900")
-    assert !OpenEHR::Assumed_Library_Types::ISO8601_TIME.valid_iso8601_time?("242345.67+0900")
-    assert OpenEHR::Assumed_Library_Types::ISO8601_TIME.valid_iso8601_time?("240000")
-    assert OpenEHR::Assumed_Library_Types::ISO8601_TIME.valid_iso8601_time?("240000Z")
-    assert !OpenEHR::Assumed_Library_Types::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
 
