malawi_hiv_program_reports 1.0.10 → 1.0.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: 577d1f703cd4fa86123a4728cc6d88a373ad300a984cb44538713c8361f9149c
4
- data.tar.gz: 411a5c315f87573ecd8450990774e6e1f3313da05a42817b79057b5320bf8f0a
3
+ metadata.gz: 88faa7e9640f4c16749d15f38fe4dc3ae068850cda349e2f5816b9fd3452c4b5
4
+ data.tar.gz: 11134ce6349f51dee3e3cb5507e2d03c26d2c6dd9ab21993fc61cf31938c9e6a
5
5
  SHA512:
6
- metadata.gz: 50c1ccfb88c9618276ef45af6150ffb1c8b60e26815b3f6cb5e2252e3d9a03a655bf22df23000d413644024de687f2630405ad3ca5c1c35d67a87dba764100f5
7
- data.tar.gz: 7a359ad17a0b1cd0fe9fd048b18e5a96f395ff046098a70950b6d28b375ba884b83b53d201d4c0ac78762002c77c3f9dbaeafca6df9781b792c50e30107f210e
6
+ metadata.gz: 4e5ab0ea1bcbeabad67e7f9b1ef7d0fb29c7477f6fbda180e757df8d1ae6729af1e0f393b4a754f981358e57cbb96fafabb09a2cd42dd3122673e63908121f51
7
+ data.tar.gz: 6222839d0182b965055094bbeb1a7ddfa7b364df27bc544acaa6e31a542ab9aac36a6741ff937423b919d5d9912708cf467a3a0312ff94c956a8fc5a5cccbcf9
@@ -92,6 +92,7 @@ module MalawiHivProgramReports
92
92
  cohort_struct.quarterly_all_males = males(quarter_start_date, end_date)
93
93
 
94
94
  # Pregnant females (all ages)
95
+ create_temp_pregnant_obs(start_date, end_date)
95
96
  cohort_struct.pregnant_females_all_ages = pregnant_females_all_ages(start_date, end_date)
96
97
  cohort_struct.cum_pregnant_females_all_ages = pregnant_females_all_ages(cum_start_date, end_date)
97
98
  cohort_struct.quarterly_pregnant_females_all_ages = pregnant_females_all_ages(quarter_start_date, end_date)
@@ -1960,7 +1961,6 @@ module MalawiHivProgramReports
1960
1961
  end
1961
1962
 
1962
1963
  def pregnant_females_all_ages(start_date, end_date)
1963
- create_temp_pregnant_obs(start_date, end_date)
1964
1964
  concept('Yes').concept_id
1965
1965
  concept('IS PATIENT PREGNANT?').concept_id
1966
1966
  concept('PATIENT PREGNANT').concept_id
@@ -1978,20 +1978,12 @@ module MalawiHivProgramReports
1978
1978
  SQL
1979
1979
 
1980
1980
  pregnant_at_initiation = ActiveRecord::Base.connection.select_all <<~SQL
1981
- SELECT patient_id, #{function_manager(function: 'patient_reason_for_starting_art', location: @location,
1982
- args: "patient_id, #{@location}")} reason_concept_id
1981
+ SELECT patient_id
1983
1982
  FROM temp_earliest_start_date
1984
1983
  WHERE date_enrolled BETWEEN '#{start_date}' AND '#{end_date}'
1985
1984
  AND gender IN ('F','Female') #{site_manager(operator: 'AND', column: 'site_id', location: @location)}
1985
+ AND reason_for_starting_art IN (6131,1755,7972,7563)
1986
1986
  GROUP BY patient_id
1987
- HAVING #{if @adapter == 'mysql2'
1988
- 'reason_concept_id IN (1755, 7972, 6131)'
1989
- else
1990
- in_manager(column: function_manager(function: 'patient_reason_for_starting_art', location: @location, args: "patient_id, #{@location}").to_s,
1991
- values: [
1992
- 1755, 7972, 6131
1993
- ])
1994
- end};
1995
1987
  SQL
1996
1988
  pregnant_at_initiation_ids = []
1997
1989
  (pregnant_at_initiation || []).each do |patient|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MalawiHivProgramReports
4
- VERSION = '1.0.10'
4
+ VERSION = '1.0.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.0.10
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roy Chanunkha