Class: Renalware::PatientPresenter

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

Direct Known Subclasses

MDMPatientPresenter

Instance Method Summary collapse

Instance Method Details

#addressObject



8
9
10
# File 'app/presenters/renalware/patient_presenter.rb', line 8

def address
  AddressPresenter::SingleLine.new(current_address)
end

#nhs_numberObject



16
17
18
19
20
21
# File 'app/presenters/renalware/patient_presenter.rb', line 16

def nhs_number
  return super unless super.present? && super.length >= 10
  return if super.index(" ")

  "#{super[0..2]} #{super[3..5]} #{super[6..-1]}"
end

#renalreg_decisionObject



30
31
32
33
34
35
# File 'app/presenters/renalware/patient_presenter.rb', line 30

def renalreg_decision
  [
    I18n.l(renalreg_decision_on),
    renalreg_recorded_by
  ].compact.join(" by ")
end

#rpv_decisionObject



23
24
25
26
27
28
# File 'app/presenters/renalware/patient_presenter.rb', line 23

def rpv_decision
  [
    I18n.l(rpv_decision_on),
    rpv_recorded_by
  ].compact.join(" by ")
end

#to_s(format = :long) ⇒ Object



12
13
14
# File 'app/presenters/renalware/patient_presenter.rb', line 12

def to_s(format = :long)
  super(format)
end