Index: /ruby/trunk/lib/models/rm.rb
===================================================================
--- /ruby/trunk/lib/models/rm.rb	(revision 151)
+++ /ruby/trunk/lib/models/rm.rb	(revision 152)
@@ -37,4 +37,5 @@
       autoload :Quantity, "rm/data_types/quantity.rb"
       autoload :Encapsulated, "rm/data_types/encapsulated.rb"
+      autoload :Time_Specification, 'rm/data_types/time_specification.rb'
     end
 
Index: /ruby/trunk/lib/models/rm/data_types/time_specification.rb
===================================================================
--- /ruby/trunk/lib/models/rm/data_types/time_specification.rb	(revision 151)
+++ /ruby/trunk/lib/models/rm/data_types/time_specification.rb	(revision 152)
@@ -1,2 +1,4 @@
+# This module is related to the ticket #47
+
 module OpenEHR
   module RM
@@ -4,20 +6,45 @@
       module Time_Specification
         class DV_Time_Specification < OpenEHR::RM::Data_Types::Basic::Data_Value
+          attr_reader :value
+
           def initialize(value)
+            self.value=(value)
+          end
+
+          def value=(value)
+            raise ArgumentError, 'value must be not nil' if value.nil?
             @value = value
           end
+          
           def calender_alignment
             raise NotImlementedError, "calender_alignment must be implemented"
           end
+
           def event_alignment
             raise NotImlementedError, "event_alignment must be implemented"
           end
+
           def institution_specified
             raise NotImlementedError, "institution_specified must be implemented"
           end
         end
-        
+
+
         class DV_General_Time_Specification < DV_Time_Specification
           attr_reader :value
+          def initialize(value)
+            super(value)
+          end
+          def value=(value)
+            raise ArgumentError, "value is not valied" unless value.formalism.is_equal?('HL7:GTS')
+            @value = value
+          end
+          private
+          def value_valid(value)
+          end
+        end
+
+        class DV_Periodic_Time_Specification < DV_Time_Specification
+          attr_reader :value, :calender_alignment, :event_alingment, :period
           def initialize(value)
             value_valid(value)
@@ -25,32 +52,25 @@
           end
           def value=(value)
-            value_valid(value)
-            @value = value
+            unless value.formalism.is_equal('HL7:PIVL') or value.formalism.is_equal('HL7:EIVL')
+              raise ArgumentError, "value is not valid"
+            end
+            /^\[(\d+)\;?(\d+)?\]\/\((\d+\w+)\)(@(\w+?))?(IST)?$/ =~ value
+            interval1, interval2, difference, allignment = $1, $2, $3, $5
+# not implemented because of unknown HL7 specification
+
           end
-          private
-          def value_valid(value)
-            raise ArgumentError, "value is not valied" if !value.formalism.is_equal?('HL7:GTS')
+
+          def calender_alignment
+
           end
-        end
 
-        class DV_Periodic_Time_Specification < DV_Time_Specification
-          attr_reader :value
-          def initialize(value)
-            value_valid(value)
-            super(value)
+          def event_alignment
+
           end
-          def calender_alignment
-          end
-          def event_alignment
-          end
+
           def institution_specified?
+
           end
           def period
-          end
-          private
-          def value_valid(value)
-            if !value.formalism.is_equal('HL7:PIVL') && value.formalism.is_equal('HL7:EIVL')
-              raise ArgumentError, "value is not valid"
-            end
           end
         end
Index: /ruby/trunk/lib/models/tests/rm/test_data_types.rb
===================================================================
--- /ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 151)
+++ /ruby/trunk/lib/models/tests/rm/test_data_types.rb	(revision 152)
@@ -426,2 +426,27 @@
   end
 end
+
+
+class TestDvTimeSpecification < Test::Unit::TestCase
+  include OpenEHR::RM::Data_Types::Time_Specification
+  include OpenEHR::RM::Data_Types::Encapsulated
+  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_parsable = DV_Parsable.new(charset, language, 10, 'XML','<TEST>test</TEST>')
+      @dv_time_specification = DV_Time_Specification.new(dv_parsable)}
+    
+    assert_nothing_raised(Exception){
+      @dv_periodic_time_specification = Dv_Periodic_Time_Specification.new(
+           charset, language, 10, 'PIVL
+  end
+
+  def test_init
+    assert_instance_of DV_Time_Specification, @dv_time_specification
+  end
+
+  def test_dv_time_specification
+    assert_equal '<TEST>test</TEST>', @dv_time_specification.value.value
+  end
+end
