Index: ruby/trunk/lib/models/rm/common/generic.rb
===================================================================
--- ruby/trunk/lib/models/rm/common/generic.rb	(revision 155)
+++ ruby/trunk/lib/models/rm/common/generic.rb	(revision 156)
@@ -9,5 +9,40 @@
       module Generic
         class Audit_Details
+          attr_reader :system_id, :committer, :time_committed, :change_type
+          attr_accessor :description
+
+          def initialize(args = { })
+            self.system_id = args[:system_id]
+            self.committer = args[:committer]
+            self.time_committed = args[:time_committed]
+            self.change_type = args[:change_type]
+            self.description = args[:description]
+          end
+
+          def system_id=(system_id)
+            if system_id.nil? or system_id.empty?
+              raise ArgumentError, 'system_id is mandatory'
+            end
+            @system_id = system_id
+          end
+
+          def committer=(committer)
+            raise ArgumentError, 'committer is mandatory' if committer.nil?
+            @committer = committer
+          end
+
+          def time_committed=(time_committed)
+            if time_committed.nil?
+              raise ArgumentError, 'time_commited is mandatory'
+            end
+            @time_committed = time_committed
+          end
+
+          def change_type=(change_type)
+            raise ArgumentError, 'change_type is mandatory' if change_type.nil?
+            @change_type = change_type
+          end
         end
+
         class Revision_History
           
@@ -75,4 +110,31 @@
           end
         end
+
+        class Participation
+          attr_reader :performer, :function, :mode
+          attr_accessor :time
+
+          def initialize(args ={ })
+            self.performer = args[:performer]
+            self.function = args[:function]
+            self.mode = args[:mode]
+            self.time = args[:time]
+          end
+
+          def performer=(performer)
+            raise ArgumentError, 'performer is mandatory' if performer.nil?
+            @performer = performer
+          end
+
+          def function=(function)
+            raise ArgumentError, 'function is mandatory' if function.nil?
+            @function = function
+          end
+
+          def mode=(mode)
+            raise ArgumentError, 'mode is mandatory' if mode.nil?
+            @mode = mode
+          end
+        end
       end # of Generic
     end # of Common
Index: ruby/trunk/lib/models/tests/rm/test_common.rb
===================================================================
--- ruby/trunk/lib/models/tests/rm/test_common.rb	(revision 155)
+++ ruby/trunk/lib/models/tests/rm/test_common.rb	(revision 156)
@@ -9,4 +9,5 @@
 include OpenEHR::RM::Support::Identification
 include OpenEHR::RM::Data_Types::Basic
+include OpenEHR::RM::Data_Types::Quantity
 
 class RM_Common_Resource_Test < Test::Unit::TestCase
@@ -142,4 +143,5 @@
     assert_raise(ArgumentError){
       party_identified = Party_Identified.new}
+
     identifiers = []
     identifiers << DV_Identifier.new('NERV', 'MELCHIOR', 'GENDO', 'COMPUTER')
@@ -150,12 +152,32 @@
                                                :external_ref => party_ref,
                                                :identifier => identifiers)}
+
     terminology_id = Terminology_ID.new('test','0.04')
     code_phrase = Code_Phrase.new('self', terminology_id)
-    dv_coded_text = DV_Coded_Text.new('Seele',terminology_id)
+    dv_coded_text = DV_Coded_Text.new('Seele',code_phrase)
     assert_nothing_raised(Exception){
       @party_related = Party_Related.new(:name => 'GEHIRN',
                                          :relationship => dv_coded_text)}
-                                         
-
+    dv_text = DV_Text.new('commiter')
+    dv_coded_text = DV_Coded_Text.new('present',terminology_id)
+    dv_date_time1 = DV_Date_Time.new('2009-07-04T16:30:00')
+    dv_date_time2 = DV_Date_Time.new('2009-07-14T00:00:00')
+    dv_interval = DV_Interval.new(dv_date_time1, dv_date_time2)
+    assert_nothing_raised(Exception){
+      @participation = Participation.new(:performer => @party_proxy,
+                                         :function => dv_text,
+                                         :mode => dv_coded_text,
+                                         :time => dv_interval)}
+    dv_date_time = DV_Date_Time.new('2009-07-04T18:56:00')
+    terminology_id = Terminology_ID.new('openehr','1.0.2')
+    code_phrase = Code_Phrase.new('249', terminology_id)
+    dv_coded_text = DV_Coded_Text.new('creation', code_phrase)
+    dv_text = DV_Text.new('test environment')
+    assert_nothing_raised(Exception){
+      @audit_details = Audit_Details.new(:system_id => 'MAGI',
+                                         :committer => @party_proxy,
+                                         :time_committed => dv_date_time,
+                                         :change_type => dv_coded_text,
+                                         :description => dv_text)}
 #    change_type = OpenEHR::RM::Data_Types::Text::DV_Text.new('audit_type')
 #    time_committed = OpenEHR::RM::Data_Types::Quantity::Date_Time::DV_Date_Time.new(2008)
@@ -167,4 +189,6 @@
     assert_instance_of Party_Self, @party_self
     assert_instance_of Party_Identified, @party_identified
+    assert_instance_of Participation, @participation
+    assert_instance_of Audit_Details, @audit_details
   end
 
@@ -191,4 +215,19 @@
     assert_equal 'GEHIRN', @party_related.name
   end
+
+  def test_participation
+    assert_equal 'unknown', @participation.performer.external_ref.namespace
+    assert_equal 'commiter', @participation.function.value
+    assert_equal 'present', @participation.mode.value
+    assert_equal 2009, @participation.time.lower.year
+  end
+
+  def test_audit_details
+    assert_equal 'MAGI', @audit_details.system_id
+    assert_equal 'unknown', @audit_details.committer.external_ref.namespace
+    assert_equal '2009-07-04T18:56:00', @audit_details.time_committed.as_string
+    assert_equal 'creation', @audit_details.change_type.value
+    assert_equal 'test environment', @audit_details.description.value
+  end
 end
 
