Class: OpenehrRails::Rm::DvProportion

Inherits:
DataValue
  • Object
show all
Defined in:
lib/openehr_rails/rm/data_values.rb

Instance Method Summary collapse

Methods inherited from DataValue

find_sti_class, matching, sti_class_for, sti_name

Instance Method Details

#to_canonical_hashObject



60
61
62
63
# File 'lib/openehr_rails/rm/data_values.rb', line 60

def to_canonical_hash
  { '_type' => 'DV_PROPORTION', 'numerator' => numerator,
    'denominator' => denominator, 'type' => proportion_type || 1 }
end

#valueObject



56
57
58
# File 'lib/openehr_rails/rm/data_values.rb', line 56

def value
  denominator.zero? ? nil : numerator / denominator
end