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.74 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.73 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.72 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.71 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.70 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.69 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.68 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.67 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.64 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.63 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.62 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.61 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.60 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.58 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.57 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.56 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.55 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.54 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.53 app/presenters/renalware/transplants/donor_dashboard_presenter.rb
renalware-core-2.0.52 app/presenters/renalware/transplants/donor_dashboard_presenter.rb