malawi_hiv_program_reports 1.0.4 → 1.0.5
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: bf17f7c17c9197b1aab5936d0ab803ca2c5260898078907ca9a6b81f9b664faa
|
4
|
+
data.tar.gz: f43489a7292fbc4e1f76c05f75d5765d00430387bf8773da8fd571601927067c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 865b057424aa1fb3ad3d8b04797cece85c7d0e7965ee0cad112d6e97ba4d36215d8c581c8bfb13c95111cc6bbb8e8894358ca9b9df500d7deea426661dcb3534
|
7
|
+
data.tar.gz: ba0d487f35f1a9f75417f50803ef68a1bd2598a440c0ce95b1b547f01c0d843aacaa821f0090ec33d9f36672ee632b5104d4a0e3767e41468fdfe1d2e271c1c0
|
@@ -94,6 +94,10 @@ module MalawiHivProgramReports
|
|
94
94
|
AND patient_state.start_date < #{interval_manager(date:, value: 1, interval: 'DAY', operator: '+')}
|
95
95
|
AND patient_state.voided = 0 #{site_manager(operator: 'AND', column: 'patient_state.site_id', location: @location)}
|
96
96
|
WHERE patients.date_enrolled <= #{date} #{site_manager(operator: 'AND', column: 'patients.site_id', location: @location)}
|
97
|
+
AND patient_state.date_created = (SELECT MAX(date_created)
|
98
|
+
FROM patient_state ps#{' '}
|
99
|
+
WHERE ps.patient_program_id = patient_state.patient_program_id #{site_manager(operator: 'AND', column: 'ps.site_id', location: @location)}#{' '}
|
100
|
+
AND ps.state = patient_state.state AND ps.voided = 0)
|
97
101
|
GROUP BY patients.patient_id
|
98
102
|
SQL
|
99
103
|
end
|