Class: Renalware::HD::Session

Inherits:
ApplicationRecord show all
Includes:
Accountable, ExplicitStateModel, PatientScope, TransactionRetry
Defined in:
app/models/renalware/hd/session.rb

Direct Known Subclasses

Closed, DNA, Open

Defined Under Namespace

Classes: Closed, DNA, Open

Instance Method Summary collapse

Methods included from Accountable

#first_or_create_by!, #save_by, #save_by!, #update_by

Instance Method Details

#compute_durationObject



60
61
62
63
64
# File 'app/models/renalware/hd/session.rb', line 60

def compute_duration
  return unless start_time_changed? || end_time_changed?

  self.duration = DurationCalculator.in_minutes(start_time, end_time)
end

#start_datetimeObject



52
53
54
# File 'app/models/renalware/hd/session.rb', line 52

def start_datetime
  datetime_at(start_time)
end

#stop_datetimeObject



56
57
58
# File 'app/models/renalware/hd/session.rb', line 56

def stop_datetime
  datetime_at(end_time)
end