malawi_hiv_program_reports 1.1.3 → 1.1.4

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: ed231eff9bb9c45a7d57027366c82fc112fc1de0cb6c4f457cd87bfeed1bd908
4
- data.tar.gz: 3b9a9292285146cac5a4f202bf2d2266fdf323f1acdb67a94706efee322f4afe
3
+ metadata.gz: f074dc44fc448956bea3c452a3b95a930b01d71357826666e5e0820dfc5340df
4
+ data.tar.gz: 675f722dbc8c93e3bfdd0cde1e160801f0bd55c9159703eadd49d8963adbd730
5
5
  SHA512:
6
- metadata.gz: 2dab0b971e5a76b0097586837b7adb5869d5c0d34563824cc79d02b8cce0679f22a1afce0955b3a733663e017a6886ccced14f924dd5636f34026c05fc6649b4
7
- data.tar.gz: 7015b44578a5bdfaea8a15c2b85b03823688b5a13fdf37e683612549c257376c0583117a28b03332d4af53c2561069c1b5d406862fd341ba15e0c724b0bbdfe7
6
+ metadata.gz: '095bfc87622d4516d50dea06daac994c9528fa8a182e9d2afee41aecbbd05bc63c9dafbdfc44006028c7e9469456e9d5c9d4a09e6fd1eaf494679d28c7ac9f6e'
7
+ data.tar.gz: 867e696edf6d2fd7318c3227ad82e262e0b1b275323b5f151f587e138cf1e80eec59fe0c612032ecfcb009d07bca5df1040a72d82aa3c6af9be7f9302bb83998
@@ -124,14 +124,15 @@ module MalawiHivProgramReports
124
124
  ActiveRecord::Base.connection.select_all <<~SQL
125
125
  SELECT o.person_id, o.value_coded
126
126
  FROM obs #{current_partition} o
127
- LEFT JOIN obs #{current_partition} a ON a.obs_id = o.obs_id and a.obs_datetime > o.obs_datetime and a.concept_id in (#{pregnant_concepts.to_sql}) and a.voided = 0
127
+ LEFT JOIN obs #{current_partition} a ON a.person_id = o.person_id AND a.obs_datetime > o.obs_datetime AND a.concept_id IN (#{pregnant_concepts.to_sql}) AND a.voided = 0
128
128
  AND a.obs_datetime >= DATE(#{ActiveRecord::Base.connection.quote(start_date)}) AND a.obs_datetime < DATE(#{ActiveRecord::Base.connection.quote(end_date)}) + INTERVAL 1 DAY
129
129
  WHERE a.obs_id is null
130
- and o.obs_datetime < DATE(#{ActiveRecord::Base.connection.quote(end_date)}) + INTERVAL 1 DAY
130
+ AND o.obs_datetime >= DATE(#{ActiveRecord::Base.connection.quote(start_date)})
131
+ AND o.obs_datetime < DATE(#{ActiveRecord::Base.connection.quote(end_date)}) + INTERVAL 1 DAY
131
132
  AND o.voided = 0
132
133
  AND o.concept_id in (#{pregnant_concepts.to_sql})
133
- AND o.value_coded IN (#{yes_concepts.join(',')})
134
134
  AND o.person_id IN (#{patient_list.join(',')})
135
+ AND o.value_coded IN (#{yes_concepts.join(',')})
135
136
  GROUP BY o.person_id
136
137
  SQL
137
138
  end
@@ -140,14 +141,15 @@ module MalawiHivProgramReports
140
141
  ActiveRecord::Base.connection.select_all <<~SQL
141
142
  SELECT o.person_id, o.value_coded
142
143
  FROM obs #{current_partition} o
143
- LEFT JOIN obs #{current_partition} a ON a.obs_id = o.obs_id and a.obs_datetime > o.obs_datetime and a.concept_id in (#{breast_feeding_concepts.to_sql}) and a.voided = 0
144
+ LEFT JOIN obs #{current_partition} a ON a.person_id = o.person_id AND a.obs_datetime > o.obs_datetime AND a.concept_id IN (#{breast_feeding_concepts.to_sql}) AND a.voided = 0
144
145
  AND a.obs_datetime >= DATE(#{ActiveRecord::Base.connection.quote(start_date)}) AND a.obs_datetime < DATE(#{ActiveRecord::Base.connection.quote(end_date)}) + INTERVAL 1 DAY
145
146
  WHERE a.obs_id is null
146
- and o.obs_datetime < DATE(#{ActiveRecord::Base.connection.quote(end_date)}) + INTERVAL 1 DAY
147
+ AND o.obs_datetime >= DATE(#{ActiveRecord::Base.connection.quote(start_date)})
148
+ AND o.obs_datetime < DATE(#{ActiveRecord::Base.connection.quote(end_date)}) + INTERVAL 1 DAY
147
149
  AND o.voided = 0
148
150
  AND o.concept_id IN (#{breast_feeding_concepts.to_sql})
149
- AND o.value_coded IN (#{yes_concepts.join(',')})
150
151
  AND o.person_id IN (#{patient_list.join(',')})
152
+ AND o.value_coded IN (#{yes_concepts.join(',')})
151
153
  GROUP BY o.person_id
152
154
  SQL
153
155
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MalawiHivProgramReports
4
- VERSION = '1.1.3'
4
+ VERSION = '1.1.4'
5
5
  end
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.3
4
+ version: 1.1.4
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-20 00:00:00.000000000 Z
11
+ date: 2024-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails