class SimpleXml::Value

Represents a bound within a HQMF pauseQuantity, has a value, a unit and an inclusive/exclusive indicator

Constants

OTHER_UNIT_TRANSLATION
TIME_UNIT_TRANSLATION

Attributes

type[R]
unit[R]
value[R]

Public Class Methods

new(quantity, unit, inclusive, type='PQ') click to toggle source
# File lib/model/types.rb, line 26
def initialize(quantity, unit, inclusive, type='PQ')
  @type = type
  @value = quantity
  @inclusive = inclusive
  @unit = translate_unit(unit)
end

Public Instance Methods

derived?() click to toggle source
# File lib/model/types.rb, line 33
def derived?
  false
end
expression() click to toggle source
# File lib/model/types.rb, line 41
def expression
  nil
end
inclusive?() click to toggle source
# File lib/model/types.rb, line 37
def inclusive?
  @inclusive
end
to_model() click to toggle source
# File lib/model/types.rb, line 45
def to_model
  HQMF::Value.new(type,unit,value,inclusive?,derived?,expression)
end
translate_unit(unit) click to toggle source
# File lib/model/types.rb, line 49
def translate_unit(unit)
  unit = (TIME_UNIT_TRANSLATION[unit.downcase.to_sym] || unit) if unit
  unit = (OTHER_UNIT_TRANSLATION[unit] || unit) if unit
  unit
end