Class: Renalware::Transplants::RecipientOperation

Inherits:
ApplicationRecord
  • Object
show all
Extended by:
Enumerize
Includes:
Document::Base, PatientScope
Defined in:
app/models/renalware/transplants/recipient_operation.rb

Instance Method Summary collapse

Instance Method Details

#cold_ischaemic_time_formattedObject



50
51
52
53
# File 'app/models/renalware/transplants/recipient_operation.rb', line 50

def cold_ischaemic_time_formatted
  # For presentation purposes
  Duration.new(self[:cold_ischaemic_time]).to_s
end

#cold_ischaemic_time_formatted=(value) ⇒ Object



55
56
57
# File 'app/models/renalware/transplants/recipient_operation.rb', line 55

def cold_ischaemic_time_formatted=(value)
  self.cold_ischaemic_time = Duration.from_string(value).seconds
end

#recipient_age_at_operationObject



68
69
70
71
72
73
74
# File 'app/models/renalware/transplants/recipient_operation.rb', line 68

def recipient_age_at_operation
  @recipient_age_at_operation ||=
    AutomaticAgeCalculator.new(
      Age.new,
      born_on: patient.born_on, age_on_date: performed_on
    ).compute
end

#theatre_case_start_timeObject



46
47
48
# File 'app/models/renalware/transplants/recipient_operation.rb', line 46

def theatre_case_start_time
  TimeOfDay.new(self[:theatre_case_start_time])
end

#warm_ischaemic_time_formattedObject



59
60
61
62
# File 'app/models/renalware/transplants/recipient_operation.rb', line 59

def warm_ischaemic_time_formatted
  # For presentation purposes
  Duration.new(self[:warm_ischaemic_time]).to_s
end

#warm_ischaemic_time_formatted=(value) ⇒ Object



64
65
66
# File 'app/models/renalware/transplants/recipient_operation.rb', line 64

def warm_ischaemic_time_formatted=(value)
  self.warm_ischaemic_time = Duration.from_string(value).seconds
end