Sha256: b1a0a02661119f8d8999770be3f514a0ab834233efedc62e58b2b7febc28124e

Contents?: true

Size: 814 Bytes

Versions: 5

Compression:

Stored size: 814 Bytes

Contents

require_dependency "renalware/transplants"
require "attr_extras"

module Renalware
  module Transplants
    class DonorDashboardPresenter
      attr_reader_initialize :patient

      def donor_stages
        @donor_stages ||= DonorStage.for_patient(patient).ordered
      end

      def donor_workup
        @donor_workups ||= DonorWorkup.for_patient(patient).first_or_initialize
      end

      def donations
        @donations ||= Donation.for_patient(patient).reversed
      end

      def donor_operations
        @donor_operations ||= DonorOperation.for_patient(patient).reversed
      end

      def investigations
        @investigations ||= begin
          Events::Investigation
            .for_patient(patient)
            .transplant_donors
            .ordered
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.0.pre.rc10 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.0.pre.rc9 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.0.pre.rc8 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.0.pre.rc7 app/presenters/renalware/transplants/donor_dashboard_presenter.rb