Class: MalawiHivProgramReports::Pepfar::DefaulterList

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_date:, end_date:, **kwargs) ⇒ DefaulterList

Returns a new instance of DefaulterList.



7
8
9
10
11
# File 'app/services/malawi_hiv_program_reports/pepfar/defaulter_list.rb', line 7

def initialize(start_date:, end_date:, **kwargs)
    @start_date = start_date
    @end_date = end_date
    @location = kwargs[:location]
end

Instance Attribute Details

#end_dateObject (readonly)

Returns the value of attribute end_date.



5
6
7
# File 'app/services/malawi_hiv_program_reports/pepfar/defaulter_list.rb', line 5

def end_date
  @end_date
end

#locationObject (readonly)

Returns the value of attribute location.



5
6
7
# File 'app/services/malawi_hiv_program_reports/pepfar/defaulter_list.rb', line 5

def location
  @location
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



5
6
7
# File 'app/services/malawi_hiv_program_reports/pepfar/defaulter_list.rb', line 5

def start_date
  @start_date
end

Instance Method Details

#find_reportObject



13
14
15
16
17
18
19
20
21
# File 'app/services/malawi_hiv_program_reports/pepfar/defaulter_list.rb', line 13

def find_report
    MalawiHivProgramReports::Moh::Cohort.new(
                                type: 'defaulter_list',
                                location: @location,
                                name: 'defaulter_list',
                                start_date: start_date,
                                end_date: end_date
                            ).defaulter_list('pepfar')
end