Index: ruby/branches/0.5/lib/open_ehr/rm/common/archetyped.rb
===================================================================
--- ruby/branches/0.5/lib/open_ehr/rm/common/archetyped.rb	(revision 305)
+++ ruby/branches/0.5/lib/open_ehr/rm/common/archetyped.rb	(revision 308)
@@ -161,5 +161,5 @@
           attr_accessor :provider, :location, :time, :subject, :version_id
 
-          def initialize(args ={ })
+          def initialize(args = { })
             self.system_id = args[:system_id]
             self.provider = args[:provider]
@@ -171,5 +171,7 @@
 
           def system_id=(system_id)
-            raise ArgumentError, 'system_id invalid' if system_id.nil? or system_id.empty?
+            if system_id.nil? or system_id.empty?
+              raise ArgumentError, 'system_id invalid'
+            end
             @system_id = system_id
           end
Index: ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity.rb
===================================================================
--- ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity.rb	(revision 305)
+++ ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity.rb	(revision 308)
@@ -151,5 +151,5 @@
           def add(a_diff)
             type_check(a_diff)
-            return result_builder(DvAbsoluteQuantity,
+            return result_builder(self.class,
                                   @magnitude+a_diff.magnitude)
           end
@@ -157,5 +157,5 @@
           def diff(other)
             type_check(other)
-            return result_builder(DvAmount,
+            return result_builder(self.class,
                                   (@magnitude-other.magnitude).abs)
           end
@@ -163,5 +163,5 @@
           def subtract(a_diff)
             type_check(a_diff)
-            return result_builder(DvAbsoluteQuantity,
+            return result_builder(self.class,
                                   @magnitude-a_diff.magnitude)
           end
Index: ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity/date_time.rb
===================================================================
--- ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity/date_time.rb	(revision 305)
+++ ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity/date_time.rb	(revision 308)
@@ -4,24 +4,13 @@
 #require 'assumed_library_types'
 require 'date'
-
-module OpenEhr
+include OpenEHR::RM::DataTypes::Quantity
+
+module OpenEHR
   module RM
     module DataTypes
       module Quantity
         module DateTime
-          class DvTemporal < OpenEhr::RM::DataTypes::Quantity::DvAbsoluteQuantity
+          class DvTemporal < DvAbsoluteQuantity
             include Comparable
-            attr_reader :value
-
-            def initialize(value, magnitude_status=nil, accuracy=nil,
-                         normal_range=nil, normal_status=nil,
-                         other_reference_ranges=nil)
-              self.value = value
-              self.magnitude_status = magnitude_status
-              self.accuracy = accuracy
-              self.normal_range = normal_range
-              self.normal_status = normal_status
-              self.other_reference_ranges = other_reference_ranges
-            end
 
             def value=(value)
@@ -31,12 +20,8 @@
               @value = value
             end
-
-            def <=>(other)
-              self.magnitude <=> other.magnitude
-            end
           end
 
           class DvDate < DvTemporal
-            include OpenEhr::AssumedLibraryTypes::ISO8601_DATE_MODULE
+            include OpenEHR::AssumedLibraryTypes::ISO8601DateModule
 
             DAYS_IN_MONTH = [0,31,28,31,30,31,30,31,31,30,31,30,31]
@@ -98,5 +83,5 @@
           
           class DvTime < DvTemporal
-            include OpenEhr::AssumedLibraryTypes::ISO8601_TIME_MODULE
+            include OpenEHR::AssumedLibraryTypes::ISO8601TimeModule
             def initialize(value, magnitude_status=nil, accuracy=nil,
                            normal_range=nil, normal_status=nil,
@@ -108,5 +93,5 @@
             def value=(value)
               super(value)
-              iso8601_time = AssumedLibraryTypes::ISO8601_TIME.new(value)
+              iso8601_time = AssumedLibraryTypes::ISO8601Time.new(value)
               @hour = iso8601_time.hour
               @minute = iso8601_time.minute
@@ -132,5 +117,5 @@
 
           class DvDateTime < DvTemporal
-            include OpenEhr::AssumedLibraryTypes::ISO8601_DATE_TIME_MODULE
+            include OpenEHR::AssumedLibraryTypes::ISO8601DateTimeModule
             attr_reader :value
 
@@ -144,5 +129,5 @@
             def value=(value)              
               super(value)
-              iso8601date_time = AssumedLibraryTypes::ISO8601_DATE_TIME.new(value)
+              iso8601date_time = AssumedLibraryTypes::ISO8601DateTime.new(value)
               self.year = iso8601date_time.year
               self.month = iso8601date_time.month
@@ -202,5 +187,5 @@
 
           class DvDuration < DvAmount
-            include AssumedLibraryTypes::ISO8601_DURATION_MODULE
+            include AssumedLibraryTypes::ISO8601DurationModule
             attr_reader :value
             
@@ -214,5 +199,5 @@
               raise ArgumentError, 'value must be not nil' if value.nil?
               @value = value
-              iso8601_duration = AssumedLibraryTypes::ISO8601_DURATION.new(value)
+              iso8601_duration = AssumedLibraryTypes::ISO8601Duration.new(value)
               self.years = iso8601_duration.years
               self.months = iso8601_duration.months
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/common/archetyped/feeder_audit_details_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/common/archetyped/feeder_audit_details_spec.rb	(revision 308)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/common/archetyped/feeder_audit_details_spec.rb	(revision 308)
@@ -0,0 +1,60 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::Common::Archetyped
+include OpenEHR::RM::Common::Generic
+include OpenEHR::RM::DataTypes::Quantity::DateTime
+
+describe FeederAuditDetails do
+  before(:each) do
+    provider = stub(PartyIdentified, :name => 'NERV')
+    location = stub(PartyIdentified, :name => '3rd Tokyo')
+    time = stub(DvDateTime, :value => '2009-09-28T19:40')
+    subject = stub(PartyProxy, :type => 'PARTY')
+    @feeder_audit_details =
+      FeederAuditDetails.new(:system_id => 'MELCHIOR',
+                             :provider => provider,
+                             :location => location,
+                             :time => time,
+                             :subject => subject,
+                             :version_id => '0.5.0')
+  end
+
+  it 'should be an instance of FeederAuditDetails' do
+    @feeder_audit_details.should be_an_instance_of FeederAuditDetails
+  end
+
+  it 'system_id should be MELCHIOR' do
+    @feeder_audit_details.system_id.should == 'MELCHIOR'
+  end
+
+  it 'provider.name should be NERV' do
+    @feeder_audit_details.provider.name.should == 'NERV'
+  end
+
+  it 'location.name should be 3rd Tokyo' do
+    @feeder_audit_details.location.name.should == '3rd Tokyo'
+  end
+
+  it 'time.value should be 2009-09-28T19:40' do
+    @feeder_audit_details.time.value.should == '2009-09-28T19:40'
+  end
+
+  it 'subject.type should be PARTY' do
+    @feeder_audit_details.subject.type.should == 'PARTY'
+  end
+
+  it 'version_id should be 0.5.0' do
+    @feeder_audit_details.version_id.should == '0.5.0'
+  end
+
+  it 'should reise ArgumentError with nil system_id' do
+    lambda {
+      @feeder_audit_details.system_id = nil
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with empty syste_id' do
+    lambda {
+      @feeder_audit_details.system_id = ''
+    }.should raise_error ArgumentError
+  end
+end
