Index: ruby/branches/0.5/lib/open_ehr/rm/composition/content/entry.rb
===================================================================
--- ruby/branches/0.5/lib/open_ehr/rm/composition/content/entry.rb	(revision 357)
+++ ruby/branches/0.5/lib/open_ehr/rm/composition/content/entry.rb	(revision 358)
@@ -96,16 +96,77 @@
           end
 
+          class Activity < Locatable
+            attr_reader :description, :timing, :action_archetype_id
+
+            def initialize(args = { })
+              super(args)
+              self.description = args[:description]
+              self.timing = args[:timing]
+              self.action_archetype_id = args[:action_archetype_id]
+            end
+
+            def description=(description)
+              if description.nil?
+                raise ArgumentError, 'description is mandatory'
+              end
+              @description = description
+            end
+
+            def timing=(timing)
+              if timing.nil?
+                raise ArgumentError, 'timing is mandatory'
+              end
+              @timing = timing
+            end
+          end
+
+          def action_archetype_id=(action_archetype_id)
+            if action_archetype_id.nil? || action_archetype_id.empty?
+              raise ArgumentError, 'action_archetype_id is mandatory'
+            end
+            @action_archetype_id = action_archetype_id
+          end
+
           class Action < CareEntry
-            attr_accessor :description, :time
-            attr_accessor :ism_transition, :instruction_details
+            attr_reader :time, :description, :ism_transition
+            attr_accessor :instruction_details
             
-            def initialize(description, time, ism_transition, instruction_details)
-              raise Exception.new("invalid argument") if description == nil || time == nil || ism_transition == nil
+            def initialize(args = { })
+              super(args)
+              self.description = args[:description]
+              self.time = args[:time]
+              self.ism_transition = args[:ism_transition]
+              self.instruction_details = args[:instruction_details]
+            end
+
+            def time=(time)
+              if time.nil?
+                raise ArgumentError, 'time is mandatory'
+              end
+              @time = time
+            end
+
+            def description=(description)
+              if description.nil?
+                raise ArgumentError, 'description is mandatory'
+              end
               @description = description
-              @time = time
+            end
+
+            def ism_transition=(ism_transition)
+              if ism_transition.nil?
+                raise ArgumentError
+              end
               @ism_transition = ism_transition
-              @instruction_details = instruction_details if instruction_details != nil
             end
-          end # of Action
+          end
+
+          class InstructionDetails < Pathable
+
+          end
+
+          class IsmTransition < Pathable
+
+          end
         end # of Entry
       end # of Content
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/action_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/action_spec.rb	(revision 358)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/action_spec.rb	(revision 358)
@@ -0,0 +1,65 @@
+require File.dirname(__FILE__) + '/../../../../../../spec_helper'
+require File.dirname(__FILE__) + '/shared_examples_spec'
+include OpenEHR::RM::Composition::Content::Entry
+include OpenEHR::RM::DataTypes::Quantity::DateTime
+include OpenEHR::RM::DataTypes::Text
+include OpenEHR::RM::DataStructures::ItemStructure
+
+describe Action do
+  it_should_behave_like 'entry'
+
+  before(:each) do
+    time = DvDateTime.new(:value => '2009-11-18T20:17:18')
+    description = stub(ItemStructure, :archetype_node_id => 'at0002')
+    current_state = stub(DvCodedText, :value => 'planned')
+    ism_transition = stub(IsmTransition, :current_state => current_state)
+    instruction_details = stub(InstructionDetails, :activity_id => 'at0003')
+    @action= Action.new(:archetype_node_id => 'at0001',
+                        :name => @name,
+                        :language => @language,
+                        :encoding => @encoding,
+                        :subject => @subject,
+                        :time => time,
+                        :description => description,
+                        :ism_transition => ism_transition,
+                        :instruction_details => instruction_details)
+  end
+
+  it 'should be an instance of Action' do
+    @action.should be_an_instance_of Action
+  end
+
+  it 'time should be assigned properly' do
+    @action.time.value.should == '2009-11-18T20:17:18'
+  end
+
+  it 'should raise ArgumentError with nil assigned to time' do
+    lambda {
+      @action.time = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'description should assigned properly' do
+    @action.description.archetype_node_id.should == 'at0002'
+  end
+
+  it 'should raise ArgumentError with nil description' do
+    lambda {
+      @action.description = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'ism_transition should be assigned properly' do
+    @action.ism_transition.current_state.value.should == 'planned'
+  end
+
+  it 'should raise ArgumentError with nil ism_transition' do
+    lambda {
+      @action.ism_transition = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'instruction_details should be assigned properly' do
+    @action.instruction_details.activity_id.should == 'at0003'
+  end
+end
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/activity_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/activity_spec.rb	(revision 358)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/composition/content/entry/activity_spec.rb	(revision 358)
@@ -0,0 +1,59 @@
+require File.dirname(__FILE__) + '/../../../../../../spec_helper'
+require File.dirname(__FILE__) + '/shared_examples_spec'
+include OpenEHR::RM::DataStructures::ItemStructure
+include OpenEHR::RM::Composition::Content::Entry
+include OpenEHR::RM::DataTypes::Encapsulated
+
+describe Activity do
+  it_should_behave_like 'entry'
+
+  before(:each) do
+    description = stub(ItemStructure, :archetype_node_id => 'at0002')
+    timing = stub(DvParsable, :value => '2009-11-18T19:35:11')
+    @activity = Activity.new(:archetype_node_id => 'at0001',
+                             :name => @name,
+                             :description => description,
+                             :timing => timing,
+                             :action_archetype_id => '/at.+/')
+  end
+
+  it 'should be an instance of Activity' do
+    @activity.should be_an_instance_of Activity
+  end
+
+  it 'description should be assigned properly' do
+    @activity.description.archetype_node_id.should == 'at0002'
+  end
+
+  it 'should raise ArgumentError with nil description' do
+    lambda {
+      @activity.description = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'timing should be assigned properly' do
+    @activity.timing.value.should == '2009-11-18T19:35:11'
+  end
+
+  it 'should raise ArgumentError with nil timing' do
+    lambda {
+      @activity.timing = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'action_archetype_id should be assigned properly' do
+    @activity.action_archetype_id.should == '/at.+/'
+  end
+
+  it 'should raise ArgumentError with nil action_archetype_id' do
+    lambda {
+      @activity.action_archetype_id = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with empty action_archetype_id' do
+    lambda {
+      @activity.action_archetype_id = ''
+    }.should raise_error ArgumentError
+  end
+end
