class OpenEHR::RM::DataStructures::History::IntervalEvent
Attributes
math_function[R]
sample_count[RW]
width[R]
Public Class Methods
new(args = { })
click to toggle source
Calls superclass method
OpenEHR::RM::DataStructures::History::Event::new
# File lib/openehr/rm/data_structures/history.rb, line 82 def initialize(args = { }) super(args) self.width = args[:width] self.math_function = args[:math_function] self.sample_count = args[:sample_count] end
Public Instance Methods
interval_start_time()
click to toggle source
# File lib/openehr/rm/data_structures/history.rb, line 101 def interval_start_time date_time = ::Time.iso8601(time.as_string) start_time = (@width.years).years.ago date_time start_time = (@width.months).months.ago start_time start_time = (@width.days).days.ago start_time start_time = (@width.hours).hours.ago start_time start_time = (@width.minutes).minutes.ago start_time seconds = @width.seconds unless @width.fractional_second.nil? seconds += @width.fractional_second end start_time = seconds.seconds.ago start_time return OpenEHR::RM::DataTypes::Quantity::DateTime::DvDateTime.new(:value => start_time.iso8601) end
math_function=(math_function)
click to toggle source
# File lib/openehr/rm/data_structures/history.rb, line 94 def math_function=(math_function) if math_function.nil? raise ArgumentError, 'math_function is mandatory' end @math_function = math_function end
width=(width)
click to toggle source
# File lib/openehr/rm/data_structures/history.rb, line 89 def width=(width) raise ArgumentError, 'width is mandatory' if width.nil? @width = width end