Class: Renalware::Transplants::WaitListRegistrationPresenter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/presenters/renalware/transplants/wait_list_registration_presenter.rb

Instance Method Summary collapse

Instance Method Details

#dolObject



52
53
54
# File 'app/presenters/renalware/transplants/wait_list_registration_presenter.rb', line 52

def dol
  entered_on && (Time.zone.today - entered_on).to_i
end

#esrf_dateObject



48
49
50
# File 'app/presenters/renalware/transplants/wait_list_registration_presenter.rb', line 48

def esrf_date
  Renalware::Renal.cast_patient(patient).profile&.esrf_on
end

#hd_hospital_unit_codeObject



44
45
46
# File 'app/presenters/renalware/transplants/wait_list_registration_presenter.rb', line 44

def hd_hospital_unit_code
  Renalware::HD.cast_patient(patient).hd_profile&.hospital_unit&.unit_code
end

#sensObject



56
57
58
59
60
# File 'app/presenters/renalware/transplants/wait_list_registration_presenter.rb', line 56

def sens
  return if crf_latest_result.blank?

  crf_latest_result.to_i > 60 ? "Sens" : "Unsens"
end

#uk_transplant_centre_summaryObject



38
39
40
41
42
# File 'app/presenters/renalware/transplants/wait_list_registration_presenter.rb', line 38

def uk_transplant_centre_summary
  return if uk_transplant_centre_status.blank?

  "#{uk_transplant_centre_status} (#{I18n.l(uk_transplant_centre_status_updated_on)})"
end