renalware-core 2.0.129 → 2.0.130

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: 156b1e1ab54f4596ebc2b14b72f0f82c1476191b8b0efbe035615136120ad49e
4
- data.tar.gz: 05cc53cd4907c8545db2566f8ab8e33744821f50274b259212765b108a92c929
3
+ metadata.gz: da57af35307fc3b61ecd3a63a06fbbc38bcf7b11a50e81b2def0333a5f9cd773
4
+ data.tar.gz: dce6d2238587ebb06f9b25d2fb4dd90997255eb485af69df9fb0a2ad4ed080a4
5
5
  SHA512:
6
- metadata.gz: 2c8b74079f3b0dcb8e7cc78ca57f01b8d81a5ca789c3f76f60c8bedac26cab9b5e78d57d2c41ac072c2acdf2adf528c1af653787ecf7548ded3abb4b8b90741c
7
- data.tar.gz: c2e35bc6f3bf69085582d1905353b07a3e6d0f8fa20c6c180ea3d48d8d3910a125a71868302aee08ffcfe74c65fafc89dce41df30e217a7cdd486a061ce434da
6
+ metadata.gz: 319282259cb9f86a3d0bbd343b236401accd2bc70be630e152e309de57199a02680f7c27e4f566ad2eb7c8523c18a31641610f683082965f3e6684991c99b65e
7
+ data.tar.gz: 89d78ef44fc08a1de7e88ddb24f9e6c1f401c0d1481156d6cd3d967b01b130ba12aaf83006dc2183a12128ba702d37e663743776d4eb533ec3ef183be8788f39
@@ -55,7 +55,7 @@ module Renalware
55
55
  street_3: nil,
56
56
  town: address[2],
57
57
  county: address[3],
58
- postcode: address.last
58
+ postcode: address[4]
59
59
  }
60
60
  end
61
61
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
@@ -33,9 +33,19 @@ module Renalware
33
33
  private
34
34
 
35
35
  def sendable_patients
36
- Renalware::Patient.where(send_to_rpv: true).or(
37
- Renalware::Patient.where(send_to_renalreg: true)
38
- ).order(family_name: :asc, given_name: :asc)
36
+ Renalware::Patient.where(send_to__where_sql).order(family_name: :asc, given_name: :asc)
37
+ end
38
+
39
+ def send_to__where_sql
40
+ where = []
41
+ where << "send_to_rpv = true" if Renalware.config.ukrdc_send_rpv_patients
42
+ where << "send_to_renalreg = true" if Renalware.config.ukrdc_send_rreg_patients
43
+
44
+ if where.empty?
45
+ raise ArgumentError, "#{self.class.name}.sendable_patients would send all patients!"
46
+ end
47
+
48
+ where.join(" or ")
39
49
  end
40
50
  end
41
51
  end
@@ -80,6 +80,13 @@ module Renalware
80
80
  # a dump of historical pathology.
81
81
  config_accessor(:ukrdc_pathology_start_date) { ENV["UKRDC_PATHOLOGY_START_DATE"] }
82
82
 
83
+ config_accessor(:ukrdc_send_rpv_patients) {
84
+ ENV.fetch("UKRDC_SEND_RPV_PATIENTS", "true") == "true"
85
+ }
86
+ config_accessor(:ukrdc_send_rreg_patients) {
87
+ ENV.fetch("UKRDC_SEND_RREG_PATIENTS", "true") == "true"
88
+ }
89
+
83
90
  # We override this in some tests as a means of getting wicked_pdf to generate an HTML version
84
91
  # of the PDF so we can examine its content
85
92
  config_accessor(:render_pdf_as_html_for_debugging) { false }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Renalware
4
- VERSION = "2.0.129"
4
+ VERSION = "2.0.130"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renalware-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.129
4
+ version: 2.0.130
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airslie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-13 00:00:00.000000000 Z
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview-component