Sha256: 1c4d23712d213d04386dda75ae0068fa81104cacf848c7df091c550291a82aab

Contents?: true

Size: 844 Bytes

Versions: 104

Compression:

Stored size: 844 Bytes

Contents

# frozen_string_literal: true

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_workup ||= 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

104 entries across 104 versions & 1 rubygems

Version Path
renalware-core-2.0.159 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.158 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.157 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.156 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.155 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.153 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.152 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.151 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.149 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.148 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.147 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.146 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.145 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.144 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.143 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.142 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.141 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.140 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.139 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.138 app/presenters/renalware/transplants/donor_dashboard_presenter.rb