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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0bd52cc04c44118891f8973848b941a5d521b4c8b13aa7dbd4cc0a45a8d6e30
|
4
|
+
data.tar.gz: 9775a0380f000b917ccda058588ddddaf660fbe94542fd5e3351bd84655842c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|