Sha256: b8e1523606159cfbfa6c9acb0c40d46f810dddf63863ace535b8707713f79379

Contents?: true

Size: 774 Bytes

Versions: 114

Compression:

Stored size: 774 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware"
require_dependency "renalware/address_presenter/single_line"

module Renalware
  class PatientPresenter < SimpleDelegator
    def address
      AddressPresenter::SingleLine.new(current_address)
    end

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

    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

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

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

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/presenters/renalware/patient_presenter.rb
renalware-core-2.1.0 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.167 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.166 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.165 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.164 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.163 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.162 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.161 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.160 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.159 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.158 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.157 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.156 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.155 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.153 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.152 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.151 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.149 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.148 app/presenters/renalware/patient_presenter.rb