Changeset 250 for ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity.rb
- Timestamp:
- Sep 7, 2009, 3:59:20 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/branches/0.5/lib/open_ehr/rm/data_types/quantity.rb
r249 r250 146 146 def initialize(args = {}) 147 147 super(args) 148 self.accuracy = a ccuracy148 self.accuracy = args[:accuracy] 149 149 end 150 150 … … 226 226 class DvQuantity < DvAmount 227 227 attr_reader :units, :precision 228 def initialize(magnitude, units, magnitude_status=nil, precision=nil, 229 accuracy=nil, accuracy_percent=nil, normal_range=nil, 230 normal_status = nil, other_reference_ranges=nil) 231 super(magnitude, magnitude_status, accuracy, accuracy_percent, 232 normal_range, normal_status, other_reference_ranges) 233 self.units = units 234 self.precision = precision 228 229 def initialize(args = {}) 230 super(args) 231 self.units = args[:units] 232 self.precision = args[:precision] 235 233 end 236 234 … … 248 246 249 247 def is_strictly_comparable_to?(others) 250 return false if others.nil? 251 if others.instance_of?(DvQuantity) && others.units == @units 248 unless super(others) 249 return false 250 end 251 if others.units == @units 252 252 return true 253 253 else … … 262 262 return true 263 263 end 264 end265 # accuracy???266 def +(other)267 dv_amount = super(other)268 return DvQuantity.new(dv_amount.magnitude, @units,269 @magnitude_status, @precision,270 @accuracy, @accuracy_percent, @normal_range,271 @normal_status, @other_reference_ranges)272 264 end 273 265 end
Note:
See TracChangeset
for help on using the changeset viewer.