malawi_hiv_program_reports 1.0.3 → 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: f760361da4c9737b3c6e1a656bc241a2b00b293bb55a8ea87140b80b17791944
4
- data.tar.gz: 38d1370e27a37f4cf05c1693aeb2520cededf24def54ff9dc9aacc2a37058b54
3
+ metadata.gz: bf17f7c17c9197b1aab5936d0ab803ca2c5260898078907ca9a6b81f9b664faa
4
+ data.tar.gz: f43489a7292fbc4e1f76c05f75d5765d00430387bf8773da8fd571601927067c
5
5
  SHA512:
6
- metadata.gz: 44185581748db309173379260ff86ad76c64dcae1689c7e4d306b4930d80e0f6e0f670382fdc931c171da06bc18debd657ce149ebc848aa455aa5edfb3a758ca
7
- data.tar.gz: 19693969f34e6401039883a0c4974d2426e77262420b465db8123293a5f0ba086e91798b5cc06d14ef6263aaccb4df9b3c4c982cb1187ebbeb8d69fd876c37f2
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
@@ -882,7 +882,7 @@ module MalawiHivProgramReports
882
882
  INNER JOIN temp_other_patient_types tmp ON tmp.patient_id = pp.patient_id #{site_manager(operator: 'AND', column: 'pp.site_id', location: @location)}
883
883
  INNER JOIN obs o ON pp.patient_id = o.person_id AND o.concept_id = #{type_of_patient_concept} #{site_manager(operator: 'AND', column: 'o.site_id', location: @location)}
884
884
  AND o.value_coded = #{new_patient_concept}
885
- AND o.voided = 0 AND o.obs_datetime < DATE(#{end_date}) + INTERVAL 1 DAY
885
+ AND o.voided = 0 AND o.obs_datetime < DATE('#{end_date}') + INTERVAL 1 DAY
886
886
  WHERE pp.program_id = 1 #{site_manager(operator: 'AND', column: 'pp.site_id', location: @location)}
887
887
  GROUP BY pp.patient_id #{@adapter == 'mysql2' ? '' : ', pp.site_id'}
888
888
  SQL
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MalawiHivProgramReports
4
- VERSION = '1.0.3'
4
+ VERSION = '1.0.5'
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.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roy Chanunkha