Sha256: e0af1ed588fe8c8dad0e435d88b21888ec04392b5daa1ab0fd28b767d543b1ba

Contents?: true

Size: 550 Bytes

Versions: 15

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module Admissions
    # rubocop:disable Rails/Pick
    class ActiveConsultAlertComponent < ApplicationComponent
      pattr_initialize [:current_user, :patient!]

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

      def render?
        consult_id.present?
      end
    end
    # rubocop:enable Rails/Pick
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.1.0 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.167 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.166 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.165 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.164 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.163 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.162 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.161 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.160 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.159 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.158 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.157 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.156 app/components/renalware/admissions/active_consult_alert_component.rb
renalware-core-2.0.155 app/components/renalware/admissions/active_consult_alert_component.rb