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: 26fde8ba891270aa134af13992809a7b5216f8782c2277cecb8761c2ab33c20a
4
- data.tar.gz: 1fb79cfb698b076a3ed023c6ab460bf315115e32eb9829bd2cf08749c6603426
3
+ metadata.gz: 4dd5fc5368f281be52f0ae6a385bd308305decdc1bddead9b43195f45483300a
4
+ data.tar.gz: 73c0192c634ec93585911753dd70ca3161255ac2c18f3b9e3f9a35b4316785de
5
5
  SHA512:
6
- metadata.gz: 4f408a0b8d22481bfb47d2a4a7128c35cd9c3e51e4beb058b8f241e9e7ebc750e87e4605980ff010a5f04116e3d5d1e05b05ab43456985bb7fea25e4c2b712c8
7
- data.tar.gz: c1f738a66863e86a0d688c8166ec14068fc44c2e095f2e0a7dcd2d0077491eb1151f3d5c614a1ab9616389f4010f124f4f1c57d2b2af776f3a7ce2da1203dbb9
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
- LEFT JOIN cdr_temp_current_state#{start ? '_start' : ''} PARTITION (p#{location}) AS cs ON cs.patient_id = patients.patient_id AND cs.site_id = patients.site_id
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
- LEFT JOIN cdr_temp_current_state#{start ? '_start' : ''} PARTITION (p#{location}) AS cs ON cs.patient_id = patients.patient_id
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MalawiHivProgramReports
4
- VERSION = '1.1.11'
4
+ VERSION = '1.1.12'
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.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roy Chanunkha