Class: MalawiHivProgramReports::Pepfar::TbPrev3
- Inherits:
-
Object
- Object
- MalawiHivProgramReports::Pepfar::TbPrev3
- Includes:
- Adapters::Moh::Custom, Utils, Utils::CommonSqlQueryUtils
- Defined in:
- app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb
Overview
Patients who started TPT just before the start of the current and have finished within the current reporting period.
Constant Summary
Constants included from Utils
Utils::COHORT_REGIMENS, Utils::FULL_3HP_COURSE_DAYS, Utils::FULL_6H_COURSE_PILLS
Instance Attribute Summary collapse
-
#check_date ⇒ Object
readonly
Returns the value of attribute check_date.
-
#cut_off_point ⇒ Object
readonly
Returns the value of attribute cut_off_point.
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#occupation ⇒ Object
readonly
Returns the value of attribute occupation.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
Instance Method Summary collapse
- #fetch_individual_report(patient_id) ⇒ Object
- #find_report ⇒ Object
-
#initialize(start_date:, end_date:, **kwargs) ⇒ TbPrev3
constructor
A new instance of TbPrev3.
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
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
Constructor Details
#initialize(start_date:, end_date:, **kwargs) ⇒ TbPrev3
Returns a new instance of TbPrev3.
15 16 17 18 19 20 21 22 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 15 def initialize(start_date:, end_date:, **kwargs) @start_date = ActiveRecord::Base.connection.quote(start_date) @check_date = start_date.to_date - 6.months @cut_off_point = start_date.to_date @end_date = ActiveRecord::Base.connection.quote(end_date) @occupation = kwargs[:occupation] @location = kwargs[:location] end |
Instance Attribute Details
#check_date ⇒ Object (readonly)
Returns the value of attribute check_date.
9 10 11 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 9 def check_date @check_date end |
#cut_off_point ⇒ Object (readonly)
Returns the value of attribute cut_off_point.
9 10 11 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 9 def cut_off_point @cut_off_point end |
#end_date ⇒ Object (readonly)
Returns the value of attribute end_date.
9 10 11 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 9 def end_date @end_date end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
9 10 11 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 9 def location @location end |
#occupation ⇒ Object (readonly)
Returns the value of attribute occupation.
9 10 11 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 9 def occupation @occupation end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
9 10 11 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 9 def report @report end |
#start_date ⇒ Object (readonly)
Returns the value of attribute start_date.
9 10 11 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 9 def start_date @start_date end |
Instance Method Details
#fetch_individual_report(patient_id) ⇒ Object
33 34 35 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 33 def fetch_individual_report(patient_id) individual_tpt_report(patient_id) end |
#find_report ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'app/services/malawi_hiv_program_reports/pepfar/tb_prev3.rb', line 24 def find_report process_data flatten_the_report rescue StandardError => e Rails.logger.error("Error generating TB Prev3 report: #{e.}") Rails.logger.error(e.backtrace.join("\n")) raise e end |