malawi_hiv_program_reports 1.1.6 → 1.1.8

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: 1e9cba775f0bc9cd2eaa2f0d078186ce06a39b90bb2012a55b7e1430e675dd6b
4
- data.tar.gz: ffa4ed80f23149a3c41e1a0c90dd31de1a27325275655f2a292c850bae667fb3
3
+ metadata.gz: d0bd52cc04c44118891f8973848b941a5d521b4c8b13aa7dbd4cc0a45a8d6e30
4
+ data.tar.gz: 9775a0380f000b917ccda058588ddddaf660fbe94542fd5e3351bd84655842c8
5
5
  SHA512:
6
- metadata.gz: 0546e2d29b71951cf95ca6df50f82ca5e380e4a203cbbd23287aa48fe536503c1426eba5944693adac9b7291b6e685426659ad73616eebf91bba4694013ea2bb
7
- data.tar.gz: 07dca51e1fe44552a13896ecb1106f2e68240b05e462a72985b83bf250716b757c8b862cb37fba6e47333a4e1e8bf35d400500f71555f526a975e9449fd5cbea
6
+ metadata.gz: f29a3c635e3e12c1f8d660de88a2b44dcb9e74e392a08a76e5e1e57c0dba7a37926cceee9f1d7a1906356b8f4d090150eb41ef5ab79c6c61f259ee5d5e46513e
7
+ data.tar.gz: 39a8dae11d1e2ea5c8a5cbe396bc5712e3f86436165e51bb9ae9e45c7f732c47bc3236649583d806c3eb2dd85fa65d281b853a76f0e904e82700a6807103b315
@@ -30,6 +30,10 @@ module MalawiHivProgramReports
30
30
  process_initialization
31
31
  process_data
32
32
  flatten_and_sort_data
33
+ rescue StandardError => e
34
+ Rails.logger.info("Error processing location #{loc}: #{e.message}")
35
+ Rails.logger.info(e.backtrace.join("\n"))
36
+ raise e
33
37
  end
34
38
 
35
39
  private
@@ -71,14 +75,15 @@ module MalawiHivProgramReports
71
75
 
72
76
  def process_data
73
77
  process_db_data
74
- process_maternal_data
78
+ process_maternal_data if aggregation
75
79
  end
76
80
 
77
81
  # rubocop:disable Metrics/AbcSize
78
82
  def process_db_data
79
- fetch_data.each do |data|
83
+ (fetch_data || []).each do |data|
80
84
  age_group = data['age_group']
81
85
  regimen = data['regimen'] || 'unknown'
86
+ regimen = 'unknown' if regimen == 'Other'
82
87
  patient_id = data['patient_id']
83
88
  # we need to handle regimes that only have one P to become PP. Otherwise if it is already PP or PA we leave
84
89
  # it as is. Regimens are in this format NUMBERLETTERS
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MalawiHivProgramReports
4
- VERSION = '1.1.6'
4
+ VERSION = '1.1.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: malawi_hiv_program_reports
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roy Chanunkha