malawi_hiv_program_reports 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df87fea0cc11ac0afae293f935d62c7f6c79a8e487e1ae0161d2e9e18b87e843
4
- data.tar.gz: 9f1d344482d7f661d83f4140734f7339b81071e9984b20e25ed3af5e9c391bae
3
+ metadata.gz: 1e9cba775f0bc9cd2eaa2f0d078186ce06a39b90bb2012a55b7e1430e675dd6b
4
+ data.tar.gz: ffa4ed80f23149a3c41e1a0c90dd31de1a27325275655f2a292c850bae667fb3
5
5
  SHA512:
6
- metadata.gz: bead67daba89758fba7d271bfc729b0455e85a88edc1ae382ed17436bd2e67b6088df8b3d8ce181cbdb6457331c4c4fe3caef0b9fefd102bb66300ee9335c32d
7
- data.tar.gz: d615b55bb62b59ed7eb3bd14d20ac8fb7ace2e04ec3dcbc8df2badcc3dce8ac370a96123471e6ac0403505810231914abb1ac3ee806183720be6e5c5fbceb29a
6
+ metadata.gz: 0546e2d29b71951cf95ca6df50f82ca5e380e4a203cbbd23287aa48fe536503c1426eba5944693adac9b7291b6e685426659ad73616eebf91bba4694013ea2bb
7
+ data.tar.gz: 07dca51e1fe44552a13896ecb1106f2e68240b05e462a72985b83bf250716b757c8b862cb37fba6e47333a4e1e8bf35d400500f71555f526a975e9449fd5cbea
@@ -5,7 +5,7 @@ module MalawiHivProgramReports
5
5
  # Disaggregated cohort report
6
6
  # rubocop:disable Metrics/ClassLength
7
7
  class Disaggregated
8
- attr_accessor :type, :start_date, :end_date, :rebuild, :occupation, :report, :maternal, :location
8
+ attr_accessor :type, :start_date, :end_date, :rebuild, :occupation, :report, :maternal, :location, :aggregation
9
9
 
10
10
  include MalawiHivProgramReports::Utils::ModelUtils
11
11
  include MalawiHivProgramReports::Pepfar::Utils
@@ -16,6 +16,7 @@ module MalawiHivProgramReports
16
16
  @start_date = start_date
17
17
  @end_date = end_date
18
18
  @rebuild = kwargs[:rebuild]&.casecmp?('true')
19
+ @aggregation = kwargs[:aggregation]&.casecmp?('false')
19
20
  @occupation = kwargs[:occupation]
20
21
  @location = kwargs[:location]
21
22
  @maternal = {}
@@ -38,7 +39,7 @@ module MalawiHivProgramReports
38
39
 
39
40
  def process_initialization
40
41
  init_report
41
- init_aggregate_rows
42
+ init_aggregate_rows if aggregation
42
43
  end
43
44
 
44
45
  def init_report
@@ -61,7 +62,7 @@ module MalawiHivProgramReports
61
62
 
62
63
  def init_cohort_section(cursor)
63
64
  cursor['tx_curr'] = []
64
- (COHORT_REGIMENS + ['Unknown']).each do |regimen|
65
+ COHORT_REGIMENS.each do |regimen|
65
66
  cursor[regimen] = []
66
67
  end
67
68
  cursor['unknown'] = []
@@ -77,7 +78,7 @@ module MalawiHivProgramReports
77
78
  def process_db_data
78
79
  fetch_data.each do |data|
79
80
  age_group = data['age_group']
80
- regimen = data['regimen'] || 'Unknown'
81
+ regimen = data['regimen'] || 'unknown'
81
82
  patient_id = data['patient_id']
82
83
  # we need to handle regimes that only have one P to become PP. Otherwise if it is already PP or PA we leave
83
84
  # it as is. Regimens are in this format NUMBERLETTERS
@@ -86,7 +87,7 @@ module MalawiHivProgramReports
86
87
  report[age_group.to_s][gender.to_s][regimen.to_s] << patient_id
87
88
  report[age_group.to_s][gender.to_s]['tx_curr'] << patient_id
88
89
  report[age_group.to_s][gender.to_s]['total'] << patient_id
89
- process_aggregate_rows(gender:, regimen:, patient_id:)
90
+ process_aggregate_rows(gender:, regimen:, patient_id:) if aggregation
90
91
  end
91
92
  end
92
93
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MalawiHivProgramReports
4
- VERSION = '1.1.5'
4
+ VERSION = '1.1.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: malawi_hiv_program_reports
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roy Chanunkha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-26 00:00:00.000000000 Z
11
+ date: 2024-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails