Index: ruby/trunk/lib/models/rm/data_types/basic.rb
===================================================================
--- ruby/trunk/lib/models/rm/data_types/basic.rb	(revision 105)
+++ ruby/trunk/lib/models/rm/data_types/basic.rb	(revision 106)
@@ -15,5 +15,8 @@
         class DV_Boolean < Data_Value
           def initialize(value)
-            check_not_nil(value)
+            self.value = value
+          end
+          def value=(value)
+            raise ArgumentError, "value must not be nil" if value.nil?
             if value == "TRUE" or value == true
               @value = true
@@ -22,16 +25,6 @@
             end
           end
-          def value=(value)
-            check_not_nil(value)
-            @value = value
-          end
           def value?
             @value == true
-          end
-          private
-          def check_not_nil(value)
-            if value == nil
-              raise ArgumentError, "value must not be empty"
-            end
           end
         end  # end of DV_Boolean
@@ -55,8 +48,4 @@
             @is_terminal = s
           end
-          private
-          def value_validity?
-            @value.instance_of? OpenEHR::Data_Types::Text::DV_Coded_Text
-          end
         end # end of DV_State
 
@@ -64,5 +53,7 @@
           attr_accessor :issuer, :assigner, :id, :type
           def initialize(assigner, id, issuer, type)
-            if assigner == nil or id == nil or issuer == nil or type == nil
+            if assigner.nil? or assigner.empty?\
+              or id.nil? or id.empty? or issuer.nil? or issuer.empty?\
+              or type.nil? or type.empty?
               raise ArgumentError, "invalid argument"
             end
Index: ruby/trunk/lib/models/rm/data_types/text.rb
===================================================================
--- ruby/trunk/lib/models/rm/data_types/text.rb	(revision 105)
+++ ruby/trunk/lib/models/rm/data_types/text.rb	(revision 106)
@@ -47,17 +47,17 @@
           attr_reader :terminology_id, :code_string
           def initialize(terminology_id, code_string)
-            if terminlogyID.nil?
-              raise Exception.new("nil terminology")
-            end
-            if code_string.nil?
-              raise Exception.new("empty codeString")
-            end
-            if terminology_id.instance_of?(Terminology_ID)
-              @terminology_id = terminology_id
-            else
-              @terminologyID = Terminology_ID.new(terminology_id)
-            end
+            self.terminology_id = terminology_id
+            self.code_string = code_string
+          end
+
+          def terminology_id=(terminology_id)
+            raise ArgumentError, "terminology_id should not be nil" if terminology_id.nil?
+            @terminology_id = terminology_id
+          end
+
+          def code_string=(code_string)
+            raise ArgumentError, "code_string should not be empty" if code_string.nil? or code_string.empty?
             @code_string = code_string
-          end
+          end 
         end # of Code_Phrase
 
Index: ruby/trunk/lib/models/rm/support/identification.rb
===================================================================
--- ruby/trunk/lib/models/rm/support/identification.rb	(revision 105)
+++ ruby/trunk/lib/models/rm/support/identification.rb	(revision 106)
@@ -95,7 +95,18 @@
 
           def initialize(value, name , version_id="")
-            super(value)
+            self.value = value
             self.name = name
             self.version_id = version_id
+          end
+
+          def value = (value)
+            raise ArgumentError, "value not valid" if value.nil? or value.empty?
+            if /(.*)(\(.*\)$)/ = value
+              @name = $1
+              @version_id = $2
+            else
+              @name = value
+            end
+            @value = value
           end
 
@@ -103,4 +114,9 @@
             raise ArgumentError, "name not valid" if name.nil? or name.empty?
             @name = name
+            if @version_id.empty?
+              @value = name
+            else
+              @value = name + '(' + value ')'
+            end 
           end
 
Index: ruby/trunk/lib/models/tests/test_reference_model.rb
===================================================================
--- ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 105)
+++ ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 106)
@@ -352,6 +352,9 @@
 class RM_Data_Types_Basic_Test < Test::Unit::TestCase
   def setup
-    @dv_boolean = OpenEHR::RM::Data_Types::Basic::DV_Boolean.new("TRUE")
-    @dv_state = OpenEHR::RM::Data_Types::Basic::DV_State.new("code1",true)
+    assert_nothing_raised(Exception){@dv_boolean = OpenEHR::RM::Data_Types::Basic::DV_Boolean.new("TRUE")}
+    @terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('C83.3', 'ICD10','')
+    @code_phrase = OpenEHR::RM::Data_Types::Text::Code_Phrase(@terminology_id, 
+    @dv_coded_text = OpenEHR::RM::Data_Types::Text::DV_Coded_Text
+    @dv_state = OpenEHR::RM::Data_Types::Basic::DV_State.new(OpenEHR::RM::Data_Types::Text:DV_Coded_Text.new("Chronic myeloid leukemia", @terminology_id), true)
     @dv_identifier = OpenEHR::RM::Data_Types::Basic::DV_Identifier.new("Ruby Hospital","0123456-0", "Information office", "personal id")
   end
@@ -433,6 +436,7 @@
 class RM_Data_Types_Text_Test < Test::Unit::TestCase
   def setup
-    @dv_text = OpenEHR::RM::Data_Types::Text::DV_Text.new("valid value")
-    @dv_coded_text = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new("valid value", "AT1000")
+    assert_nothing_raised(Exception){@dv_text = OpenEHR::RM::Data_Types::Text::DV_Text.new("valid value")}
+    @terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID('ICD10', '')
+    assert_nothing_raised(Exception){@dv_coded_text = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new("C82.3", @terminology_id)}
     @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")
@@ -459,6 +463,6 @@
 
   def test_dv_coded_text
-    assert_equal("valid value", @dv_coded_text.value)
-    assert_equal("AT1000", @dv_coded_text.defining_code)
+    assert_equal("C83.2", @dv_coded_text.value)
+    assert_equal("ICD10", @dv_coded_text.defining_code)
     assert_raise(ArgumentError){@dv_coded_text.defining_code=nil}
   end
