Sha256: 02a1671924022a07e3d5ef0e9392cf1baee6f5385ca6751a177ac85bd1d7c6ae

Contents?: true

Size: 773 Bytes

Versions: 44

Compression:

Stored size: 773 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

44 entries across 44 versions & 1 rubygems

Version Path
renalware-core-2.0.46 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.45 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.44 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.43 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.42 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.41 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.40 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.39 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.38 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.37 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.36 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.35 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.34 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.33 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.32 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.31 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.30 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.28 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.27 app/presenters/renalware/patient_presenter.rb
renalware-core-2.0.26 app/presenters/renalware/patient_presenter.rb