Class: Renalware::Events::BiopsiesComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/renalware/events/biopsies_component.rb

Instance Method Summary collapse

Methods inherited from ApplicationComponent

#policy, #renalware

Constructor Details

#initialize(patient:, limit: 6) ⇒ BiopsiesComponent

Returns a new instance of BiopsiesComponent.



8
9
10
11
12
13
# File 'app/components/renalware/events/biopsies_component.rb', line 8

def initialize(patient:, limit: 6)
  @patient = patient
  relation = Biopsy.for_patient(patient).includes(:created_by)
  @biopsies = relation.limit(limit).ordered
  @total_biopsies = relation.count
end