Class: Renalware::Admissions::ActiveConsultAlertComponent

Inherits:
Renalware::ApplicationComponent show all
Defined in:
app/components/renalware/admissions/active_consult_alert_component.rb

Overview

rubocop:disable Rails/Pick

Instance Method Summary collapse

Methods inherited from Renalware::ApplicationComponent

#policy, #renalware

Instance Method Details

#consult_idObject



9
10
11
12
13
14
15
16
17
# File 'app/components/renalware/admissions/active_consult_alert_component.rb', line 9

def consult_id
  @consult_id ||= begin
    Consult
      .where(patient_id: patient.id, ended_on: nil)
      .order(started_on: :desc)
      .pluck(:id)
      .first
  end
end

#render?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/components/renalware/admissions/active_consult_alert_component.rb', line 19

def render?
  consult_id.present?
end