Class: MalawiHivProgramReports::Pepfar::TxMl

Inherits:
Object
  • Object
show all
Includes:
Adapters::Moh::Custom, Utils, Utils::CommonSqlQueryUtils
Defined in:
app/services/malawi_hiv_program_reports/pepfar/tx_ml.rb

Constant Summary

Constants included from Utils

Utils::COHORT_REGIMENS, Utils::FULL_3HP_COURSE_DAYS, Utils::FULL_6H_COURSE_PILLS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Adapters::Moh::Custom

#cast_manager, #current_partition, #exe_create_drill_down_table, #exe_temp_cohort_members_table, #exe_temp_order_details_table, #exe_temp_other_patient_types, #exe_temp_register_start_date_table, #exe_tmp_patient_table, #function_manager, #group_by_columns, #in_manager, #interval_manager, #min_filt, #site_manager, #timestampdiff_manager

Methods included from Utils::CommonSqlQueryUtils

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

Methods included from Utils

#drug_refills_and_external_consultation_list, #isoniazid_rifapentine_concept, #patient_completed_tpt?, #patient_on_3hp?, #patient_on_tb_treatment?, #pepfar_age_groups, #pepfar_patient_drilldown_information, #pepfar_patient_identifier_type, #rifapentine_concept

Constructor Details

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

Returns a new instance of TxMl.



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

def initialize(start_date:, end_date:, **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')
  @location = kwargs[:location]
  @rebuild = kwargs[:rebuild]&.casecmp?('true')
end

Instance Attribute Details

#end_dateObject (readonly)

Returns the value of attribute end_date.



6
7
8
# File 'app/services/malawi_hiv_program_reports/pepfar/tx_ml.rb', line 6

def end_date
  @end_date
end

#locationObject (readonly)

Returns the value of attribute location.



6
7
8
# File 'app/services/malawi_hiv_program_reports/pepfar/tx_ml.rb', line 6

def location
  @location
end

#rebuildObject (readonly)

Returns the value of attribute rebuild.



6
7
8
# File 'app/services/malawi_hiv_program_reports/pepfar/tx_ml.rb', line 6

def rebuild
  @rebuild
end

#reportObject (readonly)

Returns the value of attribute report.



6
7
8
# File 'app/services/malawi_hiv_program_reports/pepfar/tx_ml.rb', line 6

def report
  @report
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



6
7
8
# File 'app/services/malawi_hiv_program_reports/pepfar/tx_ml.rb', line 6

def start_date
  @start_date
end

Instance Method Details

#find_reportObject



19
20
21
22
23
24
25
# File 'app/services/malawi_hiv_program_reports/pepfar/tx_ml.rb', line 19

def find_report
  rebuild_outcomes if rebuild
  init_report
  addittional_groups
  process_data
  flatten_the_report
end