Index: /ruby/trunk/lib/models/rm.rb
===================================================================
--- /ruby/trunk/lib/models/rm.rb	(revision 130)
+++ /ruby/trunk/lib/models/rm.rb	(revision 131)
@@ -35,4 +35,5 @@
       autoload :URI, "rm/data_types/uri.rb"
       autoload :Quantity, "rm/data_types/quantity.rb"
+      autoload :Encapsulated, "rm/data_types/encapsulated.rb"
     end
 
Index: /ruby/trunk/lib/models/rm/common/archetyped.rb
===================================================================
--- /ruby/trunk/lib/models/rm/common/archetyped.rb	(revision 130)
+++ /ruby/trunk/lib/models/rm/common/archetyped.rb	(revision 131)
@@ -132,4 +132,12 @@
           end
         end # of Link
+
+        class Feeder_Audit
+          
+        end # of Feeder_Audit
+
+        class Feeder_Audit_Details
+
+        end # of Feeder_Audit_Details
       end # of Archetyped
     end # of Common
Index: by/trunk/lib/models/rm/data_types/encapslated.rb
===================================================================
--- /ruby/trunk/lib/models/rm/data_types/encapslated.rb	(revision 130)
+++ 	(revision )
@@ -1,78 +1,0 @@
-# OpenEHR::RM::Data_Types::Encapsulated 
-# http://www.openehr.org/svn/specification/TAGS/Release-1.0.2/publishing/architecture/computable/UML/uml_start_view.html
-# refs #51
-require 'rubygems'
-require 'locale/info'
-
-module OpenEHR
-  module RM
-    module Data_Types
-      module Encapsulated
-        class DV_Encapsulated  < OpenEHR::RM::Data_Types::Basic::Data_Value
-          attr_reader :language, :charset
-
-          def size
-            raise NotImplementedError, "size method not implemented"
-          end
-
-          def language=(language)
-            unless Language::Info.valid_language?(language.code_string)
-              raise ArgumentError, 'invalid language code'
-            end
-            @language = language
-          end
-
-          def charset=(charset)
-            unless charset_valid?(charset)
-              raise ArgumentError, 'invalid charset'
-            end
-            @charset=charset
-          end
-
-          private
-          def size_positive
-            raise ArgumentError, "size must be positive" if size < 0
-          end
-
-          def charset_valid?(charset)
-            open('charset.list') do |file|
-              while line = file.gets
-                if charset == line
-                  file.close
-                  return true
-                end
-              end
-            end
-            return false
-          end
-        end
-
-        class DV_Multimedia < DV_Encapsulated
-          
-        end
-
-        class DV_Parsable < DV_Encapsulated
-          attr_reader :value, :formalism
-          def initialize(value, formalism, charset = nil, language = nil)
-            @value = value
-            size_positive
-            formalism_validity(formalism)
-            @formalism = formalism
-            @charset, @language = charset, language
-          end
-          def size
-            value.size
-          end
-          private
-          def formalism_validity(formalism)
-            if formalism.nil
-              raise ArgumentError, "formalism must not be nil"
-            elsif formalism.empty?
-              raise ArgumentError, "formalism must nto be empty"
-            end
-          end
-        end
-      end # of Encapsulated
-    end # of Data_Types
-  end # of RM
-end # of OpenEHR
Index: /ruby/trunk/lib/models/rm/data_types/encapsulated.rb
===================================================================
--- /ruby/trunk/lib/models/rm/data_types/encapsulated.rb	(revision 131)
+++ /ruby/trunk/lib/models/rm/data_types/encapsulated.rb	(revision 131)
@@ -0,0 +1,84 @@
+# OpenEHR::RM::Data_Types::Encapsulated 
+# http://www.openehr.org/svn/specification/TAGS/Release-1.0.2/publishing/architecture/computable/UML/uml_start_view.html
+# refs #51
+require 'rubygems'
+require 'locale/info'
+
+module OpenEHR
+  module RM
+    module Data_Types
+      module Encapsulated
+        class DV_Encapsulated  < OpenEHR::RM::Data_Types::Basic::Data_Value
+          attr_reader :language, :charset
+          def initialize(charset, language)
+            self.charset = charset
+            self.language = language
+          end
+
+          def size
+            raise NotImplementedError, "size method not implemented"
+          end
+
+          def language=(language)
+            if language.nil? ||
+                !Locale::Info.language_code?(language.code_string)
+              raise ArgumentError, 'invalid language code'
+            end
+            @language = language
+          end
+
+          def charset=(charset)
+            if charset.nil? || !charset_valid?(charset.code_string)
+              raise ArgumentError, 'invalid charset'
+            end
+            @charset = charset
+          end
+
+          private
+          def size_positive
+            raise ArgumentError, "size must be positive" if size < 0
+          end
+
+          def charset_valid?(charset)
+            result = false
+            open('rm/data_types/charset.lst') do |file|
+              while line = file.gets
+                if charset == line.chomp
+                  result = true
+                  break
+                end
+              end
+            end
+            return result
+          end
+        end
+
+        class DV_Multimedia < DV_Encapsulated
+          
+        end
+
+        class DV_Parsable < DV_Encapsulated
+          attr_reader :value, :formalism
+          def initialize(value, formalism, charset = nil, language = nil)
+            @value = value
+            size_positive
+            formalism_validity(formalism)
+            @formalism = formalism
+            @charset, @language = charset, language
+          end
+          def size
+            value.size
+          end
+          private
+          def formalism_validity(formalism)
+            if formalism.nil
+              raise ArgumentError, "formalism must not be nil"
+            elsif formalism.empty?
+              raise ArgumentError, "formalism must nto be empty"
+            end
+          end
+        end
+      end # of Encapsulated
+    end # of Data_Types
+  end # of RM
+end # of OpenEHR
Index: /ruby/trunk/lib/models/tests/rm/test_data_types.rb
===================================================================
--- /ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 130)
+++ /ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 131)
@@ -197,2 +197,15 @@
   end
 end
+
+class EncapsulatedTest < Test::Unit::TestCase
+  def setup
+    charset = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('UTF-8','character-sets')
+    language = OpenEHR::RM::Data_Types::Text::Code_Phrase.new('ja', 'languages')
+    assert_nothing_raised(Exception){
+      @dv_encapsulated = OpenEHR::RM::Data_Types::Encapsulated::DV_Encapsulated.new(charset, language)}
+  end
+
+  def test_init
+    assert_instance_of OpenEHR::RM::Data_Types::Encapsulated::DV_Encapsulated, @dv_encapsulated
+  end
+end
