Index: ruby/branches/0.5/lib/open_ehr/assumed_library_types.rb
===================================================================
--- ruby/branches/0.5/lib/open_ehr/assumed_library_types.rb	(revision 256)
+++ ruby/branches/0.5/lib/open_ehr/assumed_library_types.rb	(revision 259)
@@ -95,9 +95,15 @@
 
       def self.valid_year?(year)
-        year >= 0
+        return !year.nil? && year >= 0
       end
 
       def self.valid_day?(y, m, d)
-        Date.valid_date?(y,m,d) and valid_year? y
+        unless y.nil? || m.nil? || d.nil?
+          return Date.valid_date?(y,m,d)
+        end
+        if (y.nil?) || (m.nil? && !d.nil?)
+          return false
+        end
+        return self.valid_year?(y) && self.valid_month?(m)
       end
 
@@ -126,5 +132,5 @@
 
       def year=(year)
-        unless !year.nil? && ISO8601Date.valid_year?(year)
+        unless ISO8601Date.valid_year?(year)
           raise ArgumentError, "Year is not valid"
         end
@@ -138,4 +144,5 @@
 
       def day=(day)
+        
         raise ArgumentError, "Day is not valid" unless day.nil? or ISO8601Date.valid_day?(@year, @month, day)
         @day = day
@@ -548,4 +555,5 @@
       end
     end
+
     class ISO8601_DURATION < TimeDefinitions
       include ISO8601_DURATION_MODULE
Index: ruby/branches/0.5/lib/open_ehr/rm/support/identification.rb
===================================================================
--- ruby/branches/0.5/lib/open_ehr/rm/support/identification.rb	(revision 256)
+++ ruby/branches/0.5/lib/open_ehr/rm/support/identification.rb	(revision 259)
@@ -6,9 +6,9 @@
     module Support
       module Identification
-        class ObjectId
+        class ObjectID
           attr_reader :value
 
-          def initialize(value)
-            self.value=value
+          def initialize(args = {})
+            self.value=args[:value]
           end
 
@@ -17,4 +17,5 @@
             @value = value            
           end
+
           def ==(object_id)
             @value == object_id.value
@@ -32,5 +33,5 @@
 
           def namespace=(namespace)
-            raise ArgumentError if namespace.nil? or namespace.empty? or !(/([a-z]|[A-Z]).*/ =~ namespace) # error original is =~ #([a-z][A-Z])([a-z]|[A-Z]|\s|[0-9]|[_-\:\/\&\+\?])*/
+            raise ArgumentError if namespace.nil? or namespace.empty? or !(/([a-z]|[A-Z]).*/ =~ namespace) # error original is =~ #([a-z][A-Z])([a-z]|[A-Z]|\s|[v0-9]|[_-\:\/\&\+\?])*/
             @namespace = namespace
           end
@@ -47,5 +48,5 @@
         end
 
-        class ArchetypeId < ObjectId
+        class ArchetypeID < ObjectID
           attr_reader :domain_concept, :rm_name, :rm_entity, :rm_originator, :specialisation, :version_id
 
@@ -90,9 +91,9 @@
         end
 
-        class TerminologyId < ObjectId
+        class TerminologyID < ObjectID
           attr_reader :name, :version_id
 
-          def initialize(value)
-            super(value)
+          def initialize(args = {})
+            super(args)
           end
 
@@ -129,5 +130,5 @@
         end # of Terminology_ID
 
-        class GenericId < ObjectId
+        class GenericID < ObjectID
           attr_reader :scheme
 
@@ -143,9 +144,9 @@
         end # of Generic_ID
 
-        class TemplateId < ObjectId
-
-        end
-
-        class UidBasedId < ObjectId
+        class TemplateID < ObjectID
+
+        end
+
+        class UIDBasedID < ObjectID
           def initialize(value)
             super(value)
@@ -173,5 +174,5 @@
         end
 
-        class ObjectVersionId < UidBasedId
+        class ObjectVersionID < UIDBasedID
           attr_reader :object_id, :creating_system_id, :version_tree_id
 
@@ -183,7 +184,7 @@
             super(value)
             if /^(\w+)::(\w+)::((\d|\.)+)$/ =~ value
-              self.object_id = Uid.new($1)
-              self.creating_system_id = Uid.new($2)
-              self.version_tree_id = VersionTreeId.new($3)
+              self.object_id = UID.new($1)
+              self.creating_system_id = UID.new($2)
+              self.version_tree_id = VersionTreeID.new($3)
             else
               raise ArgumentError, 'invalid format'
@@ -249,9 +250,9 @@
         end
 
-        class HierObjectId < UidBasedId
-
-        end
-
-        class VersionTreeId
+        class HierObjectID < UIDBasedID
+
+        end
+
+        class VersionTreeID
           attr_reader :value, :trunk_version, :branch_number, :branch_version
 
@@ -302,5 +303,5 @@
         end
 
-        class Uid
+        class UID
           attr_reader :value
 
@@ -315,13 +316,13 @@
         end
 
-        class Uuid < Uid
-
-        end
-
-        class InternetId <Uid
+        class UUID < UID
+
+        end
+
+        class InternetID <UID
           
         end
 
-        class IsoOid <Uid
+        class IsoOID <UID
 
         end        
