Class: Renalware::HD::AdministerPrescriptionDropdownComponent
- Inherits:
-
ApplicationComponent
- Object
- ActionView::Component::Base
- ApplicationComponent
- Renalware::HD::AdministerPrescriptionDropdownComponent
- Includes:
- PresenterHelper, DropdownButtonHelper
- Defined in:
- app/components/renalware/hd/administer_prescription_dropdown_component.rb
Instance Attribute Summary collapse
-
#patient ⇒ Object
readonly
Returns the value of attribute patient.
Instance Method Summary collapse
-
#initialize(patient:) ⇒ AdministerPrescriptionDropdownComponent
constructor
A new instance of AdministerPrescriptionDropdownComponent.
- #prescriptions_to_give_on_hd ⇒ Object
Methods included from PresenterHelper
Methods included from DropdownButtonHelper
Methods inherited from ApplicationComponent
Constructor Details
#initialize(patient:) ⇒ AdministerPrescriptionDropdownComponent
Returns a new instance of AdministerPrescriptionDropdownComponent.
10 11 12 |
# File 'app/components/renalware/hd/administer_prescription_dropdown_component.rb', line 10 def initialize(patient:) @patient = patient end |
Instance Attribute Details
#patient ⇒ Object (readonly)
Returns the value of attribute patient.
8 9 10 |
# File 'app/components/renalware/hd/administer_prescription_dropdown_component.rb', line 8 def patient @patient end |
Instance Method Details
#prescriptions_to_give_on_hd ⇒ Object
14 15 16 17 18 19 |
# File 'app/components/renalware/hd/administer_prescription_dropdown_component.rb', line 14 def prescriptions_to_give_on_hd @prescriptions_to_give_on_hd ||= begin prescriptions = patient.prescriptions.includes([:drug]).to_be_administered_on_hd present(prescriptions, Medications::PrescriptionPresenter) end end |