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 247)
+++ ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity.rb	(revision 248)
@@ -43,6 +43,10 @@
           end
 
-          def is_strictly_comparable_to?(other)
-            raise NotImplementedError, 'this method should be implemented'
+          def is_strictly_comparable_to?(others)
+            if others.instance_of? self.class
+              return true
+            else
+              return false
+            end
           end
         end
@@ -113,15 +117,4 @@
           end
 
-          def is_strictly_comparable_to?(others)
-            unless others.instance_of? OpenEHR::RM::DataTypes::Quantity::DvOrdinal
-              return false
-            end
-            unless others.symbol.defining_code.terminology_id.value ==
-                @symbol.defining_code.terminology_id.value
-              return false
-            end
-            return true
-          end
-
           def <=>(other)
             @value <=> other.value
@@ -133,4 +126,16 @@
             else
               @limits = limits
+            end
+          end
+          def is_strictly_comparable_to?(others)
+            super
+            unless others.instance_of? self.class
+              return false
+            end
+            unless others.symbol.defining_code.terminology_id.value ==
+                @symbol.defining_code.terminology_id.value
+              return false
+            else
+              return true
             end
           end
@@ -163,11 +168,9 @@
         class DvAmount < DvQuantified
           attr_reader :accuracy, :accuracy_percent
-          def initialize(magnitude, magnitude_status=nil, accuracy=nil,
-                         accuracy_percent=nil, normal_range=nil,
-                         normal_status = nil, other_reference_ranges=nil)
-            super(magnitude, magnitude_status, normal_range,
-                  normal_status, other_reference_ranges)
-            unless accuracy.nil?
-              set_accuracy(accuracy, accuracy_percent)
+
+          def initialize(args = {})
+            super(args)
+            unless args[:accuracy].nil?
+              set_accuracy(args[:accuracy], args[:accuracy_percent])
             else
               @accuracy, @accuracy_percent = nil, nil
@@ -176,13 +179,13 @@
 
           def +(other)
-            unless self.is_strictly_comparable_to?(other)
+            unless self.is_strictly_comparable_to? other
               raise ArgumentError, 'type mismatch'
             end
-            return DvAmount.new(@magnitude+other.magnitude, @magnitude_status,
-                                 @accuracy, @accuracy_percent, @normal_range,
-                                 @normal_status, @other_reference_ranges)
-          end
-
-          def -(other)
+            result = self.dup
+            result.magnitude = @magnitude + other.magnitude
+            return result
+          end
+
+          def -(other)            
             other.magnitude = - other.magnitude
             self+(other)
@@ -253,12 +256,5 @@
 
         class DvCount < DvAmount
-          def is_strictly_comparable_to?(others)
-            return false if others.nil?
-            if others.instance_of?(DvCount)
-              return true
-            else
-              return false
-            end
-          end
+
         end
 
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_amount_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_amount_spec.rb	(revision 248)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_amount_spec.rb	(revision 248)
@@ -0,0 +1,105 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::DataTypes::Quantity
+
+describe DvAmount do
+  before(:each) do
+    @dv_amount = DvAmount.new(:magnitude => 2,
+                              :accuracy => 100,
+                              :accuracy_percent => true)
+  end
+
+  it 'should be an instance of DvAmount' do
+    @dv_amount.should be_an_instance_of DvAmount
+  end
+
+  it 's magnitude should be equal 2' do
+    @dv_amount.magnitude.should be_equal 2
+  end
+
+  it 's accuracy should be 100 percent' do
+    @dv_amount.accuracy.should be_equal 100
+  end
+
+  it 's accuracy_is_percent should be true' do
+    @dv_amount.accuracy_is_percent?.should be_true
+  end
+
+  it 'should has an instance with nil accuracy' do
+    dv_amount = DvAmount.new(:magnitude => 1)
+    dv_amount.should be_an_instance_of DvAmount
+  end
+
+  it 'should be 3 if +2 magnitude DvAmount' do
+    dv_amount4 = @dv_amount + DvAmount.new(:magnitude => 2)
+    dv_amount4.magnitude.should == 4
+  end
+
+  it 'should be -1 if - 3 magnitude DvAmount' do
+    dv_amount_1 = @dv_amount - DvAmount.new(:magnitude => 3)
+    dv_amount_1.magnitude.should == -1
+  end
+
+  it 'should be type mismatch' do
+    lambda {
+      @dv_amount + 1
+    }.should raise_error ArgumentError
+  end
+
+  it 'should not raise ArgumentError' do
+    lambda {
+      @dv_amount.set_accuracy(0, true)
+    }.should_not raise_error ArgumentError
+  end
+  it 'should not raise ArgumentError' do
+    lambda {
+      @dv_amount.set_accuracy(50, true)
+    }.should_not raise_error ArgumentError
+  end
+
+  it 'should not raise ArgumentError' do
+    lambda {
+      @dv_amount.set_accuracy(100, true)
+    }.should_not raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with invaild accuracy' do
+    lambda {
+      @dv_amount.set_accuracy(-0.01, true)
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with invaild accuracy' do
+    lambda {
+      @dv_amount.set_accuracy(100.1, true)
+    }.should raise_error ArgumentError
+  end
+
+  it 'should not raise ArgumentError' do
+    lambda {
+      @dv_amount.set_accuracy(0, false)
+    }.should_not raise_error ArgumentError
+  end
+  it 'should not raise ArgumentError' do
+    lambda {
+      @dv_amount.set_accuracy(0.5, false)
+    }.should_not raise_error ArgumentError
+  end
+
+  it 'should not raise ArgumentError' do
+    lambda {
+      @dv_amount.set_accuracy(1.0, false)
+    }.should_not raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with invaild accuracy' do
+    lambda {
+      @dv_amount.set_accuracy(-0.01, false)
+    }.should raise_error ArgumentError
+  end
+
+  it 'should raise ArgumentError with invaild accuracy' do
+    lambda {
+      @dv_amount.set_accuracy(1.01, false)
+    }.should raise_error ArgumentError
+  end
+end
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_count_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_count_spec.rb	(revision 248)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_count_spec.rb	(revision 248)
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../../../../../spec_helper'
+include OpenEHR::RM::DataTypes::Quantity
+
+describe DvCount do
+  before(:each) do
+    @dv_count = DvCount.new(:magnitude => 1)
+  end
+
+  it 'should be an instance of DvCount' do
+    @dv_count.should be_an_instance_of DvCount
+  end
+end
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_ordered_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_ordered_spec.rb	(revision 247)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_ordered_spec.rb	(revision 248)
@@ -49,8 +49,6 @@
   end
 
-  it 'is_strictly_comparable_to should raise ArgumentError' do
-    lambda{
-      @dv_ordered.is_strictly_comparable_to? 'test'
-    }.should raise_error(NotImplementedError)
+  it 'is_strictly_comparable_to should be true for DvOrdered' do
+    @dv_ordered.is_strictly_comparable_to?(DvOrdered.new).should be_true
   end
 
Index: ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_ordinal_spec.rb
===================================================================
--- ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_ordinal_spec.rb	(revision 247)
+++ ruby/branches/0.5/spec/lib/open_ehr/rm/data_types/quantity/dv_ordinal_spec.rb	(revision 248)
@@ -61,5 +61,5 @@
 
   it 'is_strictly comparable should be false with other instance' do
-    @dv_ordinal.is_strictly_comparable_to?(stub).should be_false
+    @dv_ordinal.is_strictly_comparable_to?('dummy').should be_false
   end
 
