Class: MalawiHivProgramReports::ArchivingCandidates

Inherits:
Object
  • Object
show all
Defined in:
app/services/malawi_hiv_program_reports/archiving_candidates.rb

Instance Method Summary collapse

Constructor Details

#initialize(start_date: nil, **_kwargs) ⇒ ArchivingCandidates

Returns a new instance of ArchivingCandidates.



8
9
10
# File 'app/services/malawi_hiv_program_reports/archiving_candidates.rb', line 8

def initialize(start_date: nil, **_kwargs)
  @start_date = start_date || Date.today
end

Instance Method Details

#find_reportObject



12
13
14
15
16
17
18
# File 'app/services/malawi_hiv_program_reports/archiving_candidates.rb', line 12

def find_report
  patients = patients_with_adverse_outcomes.to_a
  long_term_defaulters(patients.map { |patient| patient['patient_id'] })
    .each { |defaulter| patients << defaulter }

  patients
end