renalware-core 2.0.134 → 2.0.135

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: b308604c578950cd16e772e2d2f7a6dbfb86dfbcafb84f8aa01b16ffa0d8d9c7
4
- data.tar.gz: 7f0eac255cb6e8f039202b60212f7b2b9b7c38eeaffd0f0a7f7844a41d198ca3
3
+ metadata.gz: 1dd66726ab2f121aa82adb08e1394ac8ff1756942f8d449b9c836515ef15c036
4
+ data.tar.gz: 7ca005b27ddfc4a1cd1e26991af6919fccbe6da98b2bd9dffb7acb0a31315f53
5
5
  SHA512:
6
- metadata.gz: 82528a4b57e270d3f1668ed007c07aa3f4a81c15b30ac70aab0e44c6a037b0779cd2dc3d5007427907740f51d4b3e3e5f087332df26f0de55ce368444627148e
7
- data.tar.gz: c675b81757960c0f4f975c997b70437e97126578ed69d4d7c333ed539bf8873156f0e11c0639b2fd60badbe29177dcc4040c586da580f8d83a6a2336c005194c
6
+ metadata.gz: 6f7b907624c1f47c6aababef3e08aa301f8fed2e06f16edea73d7dfb1d291ed656904e37ed3295fd4a8adb897ab9288f721f14e665b59f84a2060d10abafc8c2
7
+ data.tar.gz: 717795f78c80e5f23cad39a20ecbc0395029f77fde81a738043fc67c8c71bf06f3bda2e0f6d18b682b63d8a26bf2c9e10386839b273219b40c39410db9fff6fc
@@ -7,8 +7,12 @@ module Renalware
7
7
 
8
8
  def index
9
9
  patients = Patient.dead.page(page).per(per_page)
10
+ search = patients.ransack(params[:q])
10
11
  authorize patients
11
- render locals: { patients: present(patients, PatientPresenter) }
12
+ render locals: {
13
+ patients: present(search.result, PatientPresenter),
14
+ q: search
15
+ }
12
16
  end
13
17
 
14
18
  def edit
@@ -27,11 +27,18 @@ module Renalware
27
27
  SQL
28
28
  }
29
29
 
30
+ # Because the database allows multiple current access profiles, this scope
31
+ # needs to choose just one, otherwise queries that merge in this scope
32
+ # can have duplicates, or worse, broken pagination.
30
33
  scope :with_profile, lambda {
31
34
  joins(<<-SQL)
32
- left outer join access_profiles on (access_profiles.patient_id = patients.id
33
- and access_profiles.terminated_on is null
34
- and access_profiles.started_on <= current_date)
35
+ left outer join (
36
+ select distinct on (patient_id) * from access_profiles
37
+ where
38
+ access_profiles.terminated_on is null
39
+ and access_profiles.started_on <= current_date
40
+ order by patient_id, updated_at desc
41
+ ) access_profiles on (access_profiles.patient_id = patients.id)
35
42
  left outer join access_types on access_types.id = access_profiles.type_id
36
43
  SQL
37
44
  }
@@ -16,6 +16,7 @@ module Renalware
16
16
  patient.send_to_rpv = false
17
17
  patient.rpv_decision_on = Time.zone.today
18
18
  patient.rpv_recorded_by = by.to_s
19
+ patient.skip_death_validations = true
19
20
  patient.save_by!(by)
20
21
  end
21
22
  end
@@ -13,8 +13,8 @@
13
13
  th.col-width-nhs-no NHS No.
14
14
  th.col-width-reference-no Hosp No.
15
15
  th.col-width-tiny Sex
16
- th.col-width-date Date of Birth
17
- th.col-width-date Date of Death
16
+ th.col-width-date= sort_link([:renalware, q], :born_on, "Date of Birth")
17
+ th.col-width-date-time= sort_link([:renalware, q], :died_on, "Date of Death")
18
18
  th.col-width-tiny Age
19
19
  th.col-width-medium
20
20
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Renalware
4
- VERSION = "2.0.134"
4
+ VERSION = "2.0.135"
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.134
4
+ version: 2.0.135
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airslie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-04 00:00:00.000000000 Z
11
+ date: 2020-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview-component