malawi_hiv_program_reports 1.1.18 → 1.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22a3e944fcb8f4a9e0d862b50321ead38c607a3488c002096735853b06922be5
4
- data.tar.gz: fb58caba60b6795e915efaadd08fea81e2817129ef500843da95ba48047028aa
3
+ metadata.gz: 59ce2b645e8862156cd2dfe62c5085eb8f92b940f3abb591d4ed90affc349a72
4
+ data.tar.gz: 2b4a8ba3fd2ee2e82ae0e645b6b52f8951bb04e2bc9f418faed1ff4052f14acf
5
5
  SHA512:
6
- metadata.gz: 91ae6c317a44e67d502cc97f3d3d72d54ace89d8def8326f8fc2ea7901e1b4693c0754084b33a1bf9c9d32626dd840b72df1e1c56ee558547ed0ff5056756403
7
- data.tar.gz: 8d52d72581ab43cc207e34bbb20ecf62d942cd104c854e0890c4b1712346d64a609907cd447c9f912298be40b78d0affd36e4be1a8ef123a86f7fd749258a83b
6
+ metadata.gz: 645f9cbfdbeaf74c6b2da6035a3d336408d7e28663171557ecc2e68c7d53489d218408dd76980d870ef0d74dbc1238a57d388d194ac3195e3fe0953420e97d6e
7
+ data.tar.gz: f6b5ad1078a1a8c3c68faee0d74c71502dce1099797140ab72ca171d92e8bf585b00b750758c3dead290927266c5c90aa8b912e57786d04db53418c4c15e8a67
@@ -118,10 +118,8 @@ module MalawiHivProgramReports
118
118
  end
119
119
 
120
120
  def build_cohort_tables
121
- return unless rebuild_outcome || @occupation.present?
122
-
123
121
  MalawiHivProgramReports::Moh::CumulativeCohort.new(
124
- start_date:,
122
+ start_date: (end_date - 2.months).beginning_of_month,
125
123
  end_date:,
126
124
  locations: [@location.to_s],
127
125
  rebuild: rebuild_outcome
@@ -166,6 +164,8 @@ module MalawiHivProgramReports
166
164
  cn.name AS tb_status,
167
165
  GROUP_CONCAT(DISTINCT vcn.name) AS screening_methods
168
166
  FROM cdr_temp_cohort_members #{current_partition} tesd
167
+ INNER JOIN cdr_temp_patient_outcomes #{current_partition} tpo ON tpo.patient_id = tesd.patient_id
168
+ AND tpo.cum_outcome = 'On antiretrovirals'
169
169
  INNER JOIN obs #{current_partition} o ON o.person_id = tesd.patient_id
170
170
  AND o.voided = 0 AND o.concept_id = #{tb_status}
171
171
  AND o.obs_datetime BETWEEN '#{start_date}' AND '#{end_date}'
@@ -176,6 +176,11 @@ module MalawiHivProgramReports
176
176
  AND acurr.obs_datetime > o.obs_datetime
177
177
  AND acurr.obs_datetime BETWEEN '#{start_date}' AND '#{end_date}'
178
178
  AND acurr.value_coded IN (#{tb_status_results})
179
+ INNER JOIN obs #{current_partition} patient_present ON patient_present.person_id = o.person_id
180
+ AND patient_present.concept_id = #{ConceptName.find_by_name('Patient present').concept_id}
181
+ AND patient_present.value_coded = #{ConceptName.find_by_name('Yes').concept_id}
182
+ AND patient_present.voided = 0
183
+ AND patient_present.obs_datetime BETWEEN '#{start_date}' AND '#{end_date}'
179
184
  LEFT JOIN obs #{current_partition} screen_method ON screen_method.concept_id = #{tb_screening_method}
180
185
  AND screen_method.voided = 0
181
186
  AND screen_method.person_id = o.person_id
@@ -335,9 +340,15 @@ module MalawiHivProgramReports
335
340
  end
336
341
 
337
342
  def process_method(methods:, **kwargs)
338
- indicator = :symptom_screen_alone if methods.blank?
339
- indicator = :cxr_screen if methods&.include?('cxr') && !methods&.include?('mwrd')
340
- indicator = :mwrd_screen if methods&.include?('mwrd')
343
+ indicator = nil
344
+
345
+ if methods.include?('mwrd')
346
+ indicator = :mwrd_screen
347
+ elsif methods.include?('cxr')
348
+ indicator = :cxr_screen
349
+ else
350
+ indicator = :symptom_screen_alone
351
+ end
341
352
 
342
353
  process_aggreggation_rows(kwargs[:age_group], kwargs[:gender], indicator, kwargs[:patient_id], kwargs[:maternal_status])
343
354
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MalawiHivProgramReports
4
- VERSION = '1.1.18'
4
+ VERSION = '1.1.19'
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.18
4
+ version: 1.1.19
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-10-08 00:00:00.000000000 Z
11
+ date: 2025-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails