malawi_hiv_program_reports 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e9cba775f0bc9cd2eaa2f0d078186ce06a39b90bb2012a55b7e1430e675dd6b
|
4
|
+
data.tar.gz: ffa4ed80f23149a3c41e1a0c90dd31de1a27325275655f2a292c850bae667fb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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'] || '
|
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
|
|
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.
|
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-
|
11
|
+
date: 2024-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|