Class: MalawiHivProgramReports::Clinic::OutcomeList

Inherits:
Object
  • Object
show all
Includes:
Utils::CommonSqlQueryUtils
Defined in:
app/services/malawi_hiv_program_reports/clinic/outcome_list.rb

Constant Summary collapse

REPORTS =
Set.new(%i[transfer_out died stopped]).freeze

Instance Method Summary collapse

Methods included from Utils::CommonSqlQueryUtils

#current_occupation_query, #external_client_query, #occupation_filter, #partition_by_site, #process_occupation

Constructor Details

#initialize(start_date:, end_date:, outcome:, **kwargs) ⇒ OutcomeList

Returns a new instance of OutcomeList.



11
12
13
14
15
16
# File 'app/services/malawi_hiv_program_reports/clinic/outcome_list.rb', line 11

def initialize(start_date:, end_date:, outcome:, **kwargs)
  @start_date = start_date.to_date.strftime('%Y-%m-%d 00:00:00')
  @end_date = end_date.to_date.strftime('%Y-%m-%d 23:59:59')
  @occupation = kwargs[:occupation]
  @report = load_report outcome.downcase.split.join('_')
end

Instance Method Details

#get_listObject



18
19
20
# File 'app/services/malawi_hiv_program_reports/clinic/outcome_list.rb', line 18

def get_list
  @report
end