Sha256: c7d8081f5e15bad1af13aa71849abd33e19dd528e2b9a3754ad86b4c4ec26106

Contents?: true

Size: 979 Bytes

Versions: 148

Compression:

Stored size: 979 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/transplants"
require "attr_extras"

module Renalware
  module Transplants
    class RecipientDashboardPresenter
      attr_reader_initialize :patient

      def recipient_workup
        @recipient_workup ||= RecipientWorkup.for_patient(patient).first_or_initialize
      end

      def registration
        @registration ||= begin
          WaitListRegistrationPresenter.new(
            Registration.for_patient(patient).first_or_initialize
          )
        end
      end

      def recipient_operations
        @recipient_operations ||= RecipientOperation.for_patient(patient).reversed
      end

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

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

Version data entries

148 entries across 148 versions & 1 rubygems

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