Index: ruby/trunk/lib/models/rm/support/identification.rb
===================================================================
--- ruby/trunk/lib/models/rm/support/identification.rb	(revision 91)
+++ ruby/trunk/lib/models/rm/support/identification.rb	(revision 92)
@@ -64,38 +64,37 @@
 
         class Terminology_ID < Object_ID
-          attr_reader :name
+          attr_reader :name, :version_id
 
-          def initialize(name , version_id)
-            @name , @version_id = name , version_id
+          def initialize(value, name , version_id="")
+            super(value)
+            self.name = name
+            self.version_id = version_id
           end
 
-          def setValue(value)
-            loadValue(value)
-            super.value = value
+          def name=(name)
+            raise ArgumentError, "name not valid" if name.nil? or name.empty?
+            @name = name
           end
 
-          def version_id
-            @version
+          def version_id=(version_id)
+            raise ArgumentError, "version_id not valid" if version_id.nil?
+            @version_id = version_id
+          end
+        end # of Terminology_ID
+
+        class Generic_ID < Object_ID
+          attr_reader :scheme
+
+          def initialize(value, scheme)
+            super(value)
+            self.scheme = scheme
           end
 
-          private
+          def scheme=(scheme)
+            raise ArgumentError, "scheme not valid" if scheme.nil? or scheme.empty?
+            @scheme = scheme
+          end
+        end # of Generic_ID
 
-          def loadValue(value)
-            if /\(.*\)$/ =~ value
-#              @name, @version = value.split(\())
-              @version.chop!
-            else
-              @name = value
-              @version = nil
-            end
-          end
-
-          def toValue(name, version)
-            if name == ""
-              raise Exception.new("empty name")
-            end
-            name + (version == nil ? "" : "(" + version + ")")
-          end
-        end # of Terminology_ID
       end # of Definition
     end # of Support
Index: ruby/trunk/lib/models/tests/test_reference_model.rb
===================================================================
--- ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 91)
+++ ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 92)
@@ -144,9 +144,11 @@
 end
 
-class ReferenceModelSupportIdentificationTest < Test::Unit::TestCase
+class RM_Support_Identification_Test < Test::Unit::TestCase
   def setup
     assert_nothing_raised(Exception){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new("0.0.3")}
-    @terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('terminology','version')
-    @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){@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')}
+    assert_nothing_raised(Exception){@generic_id = OpenEHR::RM::Support::Identification::Generic_ID.new("0.0.3", "openehr")}
+    assert_nothing_raised(Exception){@uid_based_id = OpenEHR::RM::Support::Identification::UID_Based_ID.new('rrip::0.0.3')
   end
   
@@ -155,4 +157,6 @@
     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::UID
   end
 
@@ -175,19 +179,103 @@
     assert_raise(ArgumentError){@archetype_id.value=""}
     assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new}
-    assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Archetype_ID.new(nil)}
-    assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new(nil, "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", nil, "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", nil, "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "", "ehr_rm", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", nil, "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "", "openehr","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", nil,"cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "","cholesterol","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr",nil ,"0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","","0.0.3")}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol", nil)}
+    assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.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 = ""}
+  end
+
+  def test_terminology_id
+    assert_equal "0.0.7", @terminology_id.value
+    assert_nothing_raised(Exception){@terminology_id.value = "0.0.8"}
+    assert_equal "0.0.8", @terminology_id.value
+    assert_raise(ArgumentError){@terminology_id.value = nil}
+    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, 'terminology','0.0.3')}
+    assert_raise(ArgumentError){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new("", 'terminology','0.0.3')}
+    assert_raise(ArgumentError){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new("", 'terminology','0.0.3')}
+    assert_raise(ArgumentError){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new("0.0.7", nil,'0.0.3')}
+    assert_raise(ArgumentError){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new("0.0.7", '','0.0.3')}
+    assert_raise(ArgumentError){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new("0.0.7", "terminology", nil)}
+    assert_nothing_raised(Exception){@terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new("0.0.7", "terminology",'')}
+
+    assert_equal "terminology", @terminology_id.name
+    assert_nothing_raised(Exception){@terminology_id.name = "snomed"}
+    assert_equal "snomed", @terminology_id.name
+    assert_raise(ArgumentError){@terminology_id.name = nil}
+    assert_raise(ArgumentError){@terminology_id.name = ""}
+
+    assert_equal "", @terminology_id.version_id
+    assert_nothing_raised(Exception){@terminology_id.version_id = "0.0.8"}
+    assert_equal "0.0.8", @terminology_id.version_id
+    assert_raise(ArgumentError){@terminology_id.version_id = nil}
+    assert_nothing_raised(Exception){@terminology_id.version_id = ''}
+  end
+
+  def test_generic_id
+    assert_equal "0.0.3", @generic_id.value
+    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.value = nil}
+    assert_raise(ArgumentError){@generic_id.value = ""}
+    assert_nothing_raised(Exception){@generic_id.value = "0.0.5"}
+    assert_equal "0.0.5", @generic_id.value
+
+    assert_raise(ArgumentError){@generic_id.scheme = nil}
+    assert_raise(ArgumentError){@generic_id.scheme = ""}
+    assert_nothing_raised(Exception){@generic_id.scheme = "cen"}
+    assert_equal "cen", @generic_id.scheme
   end
 end
