Index: /ruby/trunk/lib/models/rm/support/identification.rb
===================================================================
--- /ruby/trunk/lib/models/rm/support/identification.rb	(revision 93)
+++ /ruby/trunk/lib/models/rm/support/identification.rb	(revision 94)
@@ -18,5 +18,33 @@
             @value = value            
           end
+          def ==(object_id)
+            @value == object_id.value
+          end
         end # of ObjectID
+
+        class Object_Ref
+          attr_reader :namespace, :type, :id
+
+          def initialize(namespace, type, id)
+            self.namespace = namespace
+            self.type = type
+            self.id = id
+          end
+
+          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]|[_-\:\/\&\+\?])*/
+            @namespace = namespace
+          end
+
+          def type=(type)
+            raise ArgumentError if type.nil? or type.empty?
+            @type = type
+          end
+
+          def id=(id)
+            raise ArgumentError if id.nil?
+            @id = id
+          end
+        end
         
         class Archetype_ID < Object_ID
@@ -96,4 +124,5 @@
           end
         end # of Generic_ID
+
         class UID_Based_ID < Object_ID
           def initialize(value)
Index: /ruby/trunk/lib/models/tests/test_reference_model.rb
===================================================================
--- /ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 93)
+++ /ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 94)
@@ -147,4 +147,5 @@
   def setup
     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)}
     assert_nothing_raised(Exception){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.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::Terminology_ID.new("0.0.7", 'terminology','0.0.3')}
@@ -155,4 +156,5 @@
   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
@@ -170,4 +172,33 @@
     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("")}
+  end
+
+  def test_object_refs
+    assert_equal 'local', @object_ref.namespace
+    assert_equal 'ANY', @object_ref.type
+    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_nothing_raised(Exception){@object_ref.namespace = 'terminology'}
+    assert_equal 'terminology', @object_ref.namespace
+    assert_raise(ArgumentError){@object_ref.namespace = nil}
+    assert_raise(ArgumentError){@object_ref.namespace = ''}
+    assert_raise(ArgumentError){@object_ref.namespace = '?&&'}
+    assert_raise(ArgumentError){@object_ref.namespace = '843'}
+
+    assert_nothing_raised(Exception){@object_ref.type = 'GUIDELINE'}
+    assert_equal 'GUIDELINE', @object_ref.type
+    assert_raise(ArgumentError){@object_ref.type = nil}
+    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_raise(ArgumentError){@object_ref.id = nil}
   end
 
