malawi_hiv_program_reports 1.1.11 → 1.1.12
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: 4dd5fc5368f281be52f0ae6a385bd308305decdc1bddead9b43195f45483300a
|
4
|
+
data.tar.gz: 73c0192c634ec93585911753dd70ca3161255ac2c18f3b9e3f9a35b4316785de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b9d37ed649f14098645177373285292f52027a2a82ef181e8358f503a476c9248db4ed2d835f81a479f967678c4713eef27ce95e208cbc501cf31da35f98db1
|
7
|
+
data.tar.gz: 7624ab3418f262f2e97eea4852a0dd34b74a57948829aea5983e30ff4854e20a439ca5b9f0f1098e9706cd9b9a0365479d755c9fc1d4f73af69cb2c28ff3c134
|
@@ -293,7 +293,7 @@ module MalawiHivProgramReports
|
|
293
293
|
INSERT INTO cdr_temp_patient_outcomes#{start ? '_start' : ''} PARTITION (p#{location})
|
294
294
|
SELECT patients.patient_id, 'On antiretrovirals', COALESCE(cs.outcome_date, patients.start_date), #{location}, 4
|
295
295
|
FROM cdr_temp_min_auto_expire_date#{start ? '_start' : ''} PARTITION (p#{location}) AS patients
|
296
|
-
|
296
|
+
INNER JOIN cdr_temp_current_state#{start ? '_start' : ''} PARTITION (p#{location}) AS cs ON cs.patient_id = patients.patient_id AND cs.outcomes = 1
|
297
297
|
WHERE patients.#{definition == 'pepfar' ? 'pepfar_defaulter_date' : 'moh_defaulter_date'} > DATE(#{start ? start_date : end_date}) #{start ? '- INTERVAL 1 DAY' : ''}
|
298
298
|
AND (patients.patient_id) NOT IN (SELECT patient_id FROM cdr_temp_patient_outcomes#{start ? '_start' : ''} PARTITION (p#{location}) WHERE step IN (1, 2, 3))
|
299
299
|
ON DUPLICATE KEY UPDATE cum_outcome = VALUES(cum_outcome), outcome_date = VALUES(outcome_date), step = VALUES(step)
|
@@ -305,7 +305,7 @@ module MalawiHivProgramReports
|
|
305
305
|
INSERT INTO cdr_temp_patient_outcomes#{start ? '_start' : ''} PARTITION (p#{location})
|
306
306
|
SELECT patients.patient_id, 'Defaulted', patients.#{definition == 'pepfar' ? 'pepfar_defaulter_date' : 'moh_defaulter_date'},#{location}, 5
|
307
307
|
FROM cdr_temp_current_medication#{start ? '_start' : ''} PARTITION (p#{location}) AS patients
|
308
|
-
|
308
|
+
INNER JOIN cdr_temp_current_state#{start ? '_start' : ''} PARTITION (p#{location}) AS cs ON cs.patient_id = patients.patient_id AND cs.outcomes = 1
|
309
309
|
WHERE patients.#{definition == 'pepfar' ? 'pepfar_defaulter_date' : 'moh_defaulter_date'} <= DATE(#{start ? start_date : end_date}) #{start ? '- INTERVAL 1 DAY' : ''}
|
310
310
|
AND (patients.patient_id) NOT IN (SELECT patient_id FROM cdr_temp_patient_outcomes#{start ? '_start' : ''} PARTITION (p#{location}) WHERE step IN (1, 2, 3, 4))
|
311
311
|
ON DUPLICATE KEY UPDATE cum_outcome = VALUES(cum_outcome), outcome_date = VALUES(outcome_date), step = VALUES(step)
|