Class: OpenEHR::RM::DataStructures::History::IntervalEvent
- Defined in:
- lib/open_ehr/rm/data_structures/history.rb
Instance Attribute Summary collapse
-
#math_function ⇒ Object
Returns the value of attribute math_function.
-
#sample_count ⇒ Object
Returns the value of attribute sample_count.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(args = { }) ⇒ IntervalEvent
constructor
A new instance of IntervalEvent.
- #interval_start_time ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(args = { }) ⇒ IntervalEvent
Returns a new instance of IntervalEvent.
80 81 82 83 84 85 |
# File 'lib/open_ehr/rm/data_structures/history.rb', line 80 def initialize(args = { }) super(args) self.width = args[:width] self.math_function = args[:math_function] self.sample_count = args[:sample_count] end |
Instance Attribute Details
#math_function ⇒ Object
Returns the value of attribute math_function.
77 78 79 |
# File 'lib/open_ehr/rm/data_structures/history.rb', line 77 def math_function @math_function end |
#sample_count ⇒ Object
Returns the value of attribute sample_count.
78 79 80 |
# File 'lib/open_ehr/rm/data_structures/history.rb', line 78 def sample_count @sample_count end |
#width ⇒ Object
Returns the value of attribute width.
77 78 79 |
# File 'lib/open_ehr/rm/data_structures/history.rb', line 77 def width @width end |
Instance Method Details
#interval_start_time ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/open_ehr/rm/data_structures/history.rb', line 99 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.ago start_time return DvDateTime.new(:value => start_time.iso8601) end |