Index: ruby/trunk/lib/models/rm/common/archetyped.rb
===================================================================
--- ruby/trunk/lib/models/rm/common/archetyped.rb	(revision 102)
+++ ruby/trunk/lib/models/rm/common/archetyped.rb	(revision 103)
@@ -81,4 +81,5 @@
           end
         end
+
         class Archetyped
           attr_reader :archetype_id, :rm_version
@@ -98,4 +99,25 @@
           end
         end
+        class Link
+          attr_reader :meaning, :target, :type
+          def initialize(meaning, target, type)
+            self.meaning = meaning
+            self.target = target
+            self.type = type
+          end
+          def meaning=(meaning)
+            raise ArgumentError, "meaning should not be nil" if meaning.nil?
+            @meaning = meaning
+          end
+          def target=(target)
+            raise ArgumentError, "target should not be nil" if target.nil?
+            @target = target
+          end
+          def type=(type)
+            raise ArgumentError, "type should not be nil" if type.nil?
+            @type = type
+
+          end
+        end
       end # end of Archetyped
     end # end of Common
Index: ruby/trunk/lib/models/rm/data_types/uri.rb
===================================================================
--- ruby/trunk/lib/models/rm/data_types/uri.rb	(revision 102)
+++ ruby/trunk/lib/models/rm/data_types/uri.rb	(revision 103)
@@ -25,6 +25,5 @@
         class DV_URI < OpenEHR::RM::Data_Types::Basic::Data_Value
           def initialize(value)
-            raise ArgumentError, "value is empty" if value.nil?
-            parse(value)
+            self.value = value
           end
           def fragment_id
@@ -41,4 +40,5 @@
           end
           def value=(value)
+            raise ArgumentError, "value is empty" if value.nil?
             parse(value)
           end
@@ -53,16 +53,9 @@
         class DV_EHR_URI < DV_URI
           def initialize(value)
-            check_value(value)
             super(value)
           end
           def value=(value)
-            check_value(value)
+            raise ArgumentError, "scheme must be ehr" if !(value =~ /^ehr/i)
             parse(value)
-          end
-          private
-          def check_value(value)
-            if !(value =~ /^ehr/i)
-              raise ArgumentError, "scheme must be ehr"
-            end
           end
         end # of DV_EHR_URI
Index: ruby/trunk/lib/models/tests/test_reference_model.rb
===================================================================
--- ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 102)
+++ ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 103)
@@ -415,8 +415,10 @@
     @template_id = OpenEHR::RM::Support::Identification::Template_ID.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::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"))}
     
   end
   def test_init
     assert_instance_of OpenEHR::RM::Common::Archetyped::Archetyped, @archetyped
+    assert_instance_of OpenEHR::RM::Common::Archetyped::Link, @link
   end
   def test_archetyped
@@ -434,3 +436,21 @@
     assert_equal '1.0.2', @archetyped.rm_version
   end
+  def test_link
+    # test constructor
+    assert_equal 'generic', @link.meaning.value
+    assert_equal 'ehr://test/', @link.target.value
+    assert_equal 'problem', @link.type.value
+    # test meaning
+    assert_nothing_raised(Exception){@link.meaning = OpenEHR::RM::Data_Types::Text::DV_Text.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_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_equal 'issue', @link.type.value
+    assert_raise(ArgumentError){@link.type = nil}
+  end
 end
