renalware-core 2.0.15 → 2.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/renalware/concerns/pdf_renderable.rb +2 -0
- data/app/controllers/renalware/hd/mdm_patients_controller.rb +8 -6
- data/app/controllers/renalware/hospitals/units_controller.rb +38 -26
- data/app/controllers/renalware/letters/letters_controller.rb +2 -1
- data/app/controllers/renalware/mdm_controller.rb +2 -0
- data/app/controllers/renalware/mdm_patients_controller.rb +2 -0
- data/app/controllers/renalware/messaging/internal/messages_controller.rb +0 -6
- data/app/controllers/renalware/pd/regimes_controller.rb +4 -2
- data/app/controllers/renalware/transplants/wait_lists_controller.rb +1 -1
- data/app/models/renalware/hd/modality_description.rb +27 -0
- data/app/models/renalware/hd/patient.rb +8 -1
- data/app/models/renalware/hd/sessions/auditable_session.rb +5 -2
- data/app/models/renalware/hd/sessions/auditable_session_collection.rb +1 -1
- data/app/models/renalware/letters/electronic_receipt.rb +10 -2
- data/app/models/renalware/letters/letter.rb +3 -0
- data/app/models/renalware/modalities/description.rb +6 -0
- data/app/models/renalware/renal/patient.rb +3 -0
- data/app/models/renalware/transplants/registrations/wait_list_query.rb +14 -4
- data/app/policies/renalware/letters/electronic_receipt_policy.rb +1 -1
- data/app/presenters/renalware/patients/banner_presenter.rb +15 -0
- data/app/presenters/renalware/transplants/wait_list_registration_presenter.rb +46 -2
- data/app/views/renalware/hd/protocols/show.pdf.slim +0 -1
- data/app/views/renalware/hospitals/units/_form.html.slim +2 -2
- data/app/views/renalware/hospitals/units/edit.html.slim +1 -1
- data/app/views/renalware/hospitals/units/index.html.slim +2 -2
- data/app/views/renalware/hospitals/units/new.html.slim +1 -1
- data/app/views/renalware/letters/electronic_receipts/_table.html.slim +5 -2
- data/app/views/renalware/letters/letters/_letter.html.slim +8 -3
- data/app/views/renalware/letters/letters/_table.html.slim +12 -6
- data/app/views/renalware/letters/letters/author.html.slim +1 -2
- data/app/views/renalware/mdm/_prescriptions.html.slim +22 -16
- data/app/views/renalware/mdm_patients/_patient.html.slim +2 -0
- data/app/views/renalware/mdm_patients/_table.html.slim +1 -0
- data/app/views/renalware/patients/_header.html.slim +2 -1
- data/app/views/renalware/patients/side_menu/_actions.html.slim +17 -15
- data/app/views/renalware/transplants/wait_lists/_registration.html.slim +17 -23
- data/app/views/renalware/transplants/wait_lists/show.html.slim +2 -5
- data/config/locales/renalware/mdm.yml +1 -0
- data/config/routes.rb +20 -14
- data/lib/renalware/version.rb +1 -1
- metadata +3 -3
- data/app/controllers/renalware/concerns/nested_actions_controller_methods.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48ebb9515ae94eb8fe4576bb06a5b5caffab683620a3a86baad31e571aeacbd1
|
4
|
+
data.tar.gz: 1dea69e84c15ff4b351b3d541edaae89ef01a20d2a702802ddbc0a3c3f34445f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f71f9360fbed7a17f3c34b4adcbc8a6dd717d734d45741b13d30737dedcb4cbe520200885d0c3c46eb8f55eb93e73004240571a2a434351c854ed1d59c8c545
|
7
|
+
data.tar.gz: b9d76f685b3208666c869c0688d4cff3e706d6ef279411f58ff8984cf6d0a8263f4efef7780aa3fd49ea228b2c020bf30b2318ff0b2030aff9a599e959ca771f
|
@@ -3,12 +3,6 @@ require_dependency "renalware/hd"
|
|
3
3
|
module Renalware
|
4
4
|
module HD
|
5
5
|
class MDMPatientsController < Renalware::MDMPatientsController
|
6
|
-
def render_index(**args)
|
7
|
-
presenter = build_presenter(params: params, **args)
|
8
|
-
authorize presenter.patients
|
9
|
-
render :index, locals: { presenter: presenter }
|
10
|
-
end
|
11
|
-
|
12
6
|
def index
|
13
7
|
query = HD::MDMPatientsQuery.new(
|
14
8
|
relation: HD::Patient.eager_load(hd_profile: [:hospital_unit]),
|
@@ -19,6 +13,14 @@ module Renalware
|
|
19
13
|
view_proc: ->(patient) { patient_hd_mdm_path(patient) },
|
20
14
|
patient_presenter_class: HD::PatientPresenter)
|
21
15
|
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def render_index(**args)
|
20
|
+
presenter = build_presenter(params: params, **args)
|
21
|
+
authorize presenter.patients
|
22
|
+
render :index, locals: { presenter: presenter }
|
23
|
+
end
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
@@ -3,59 +3,71 @@ require_dependency "renalware/hospitals"
|
|
3
3
|
module Renalware
|
4
4
|
module Hospitals
|
5
5
|
class UnitsController < BaseController
|
6
|
-
before_action :load_hospital_unit, only: [:edit, :update]
|
7
|
-
|
8
6
|
def new
|
9
|
-
|
10
|
-
authorize
|
7
|
+
hospital_unit = Unit.new
|
8
|
+
authorize hospital_unit
|
9
|
+
render_new(hospital_unit)
|
11
10
|
end
|
12
11
|
|
13
12
|
def create
|
14
|
-
|
15
|
-
authorize
|
13
|
+
hospital_unit = Unit.new(hospital_unit_params)
|
14
|
+
authorize hospital_unit
|
16
15
|
|
17
|
-
if
|
18
|
-
redirect_to hospitals_units_path,
|
19
|
-
notice: t(".success", model_name: "hospital unit")
|
16
|
+
if hospital_unit.save
|
17
|
+
redirect_to hospitals_units_path, notice: success_msg_for("hospital unit")
|
20
18
|
else
|
21
|
-
flash.now[:error] =
|
22
|
-
|
19
|
+
flash.now[:error] = failed_msg_for("hospital unit")
|
20
|
+
render_new(hospital_unit)
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
26
24
|
def index
|
27
|
-
|
28
|
-
authorize
|
25
|
+
hospital_units = Unit.all
|
26
|
+
authorize hospital_units
|
27
|
+
render locals: { hospital_units: hospital_units }
|
28
|
+
end
|
29
|
+
|
30
|
+
def edit
|
31
|
+
render_edit(find_and_authorize_hospital_unit)
|
29
32
|
end
|
30
33
|
|
31
34
|
def update
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
+
hospital_unit = find_and_authorize_hospital_unit
|
36
|
+
if hospital_unit.update(hospital_unit_params)
|
37
|
+
redirect_to hospitals_units_path, notice: success_msg_for("hospital unit")
|
35
38
|
else
|
36
|
-
flash.now[:error] =
|
37
|
-
|
39
|
+
flash.now[:error] = failed_msg_for("hospital unit")
|
40
|
+
render_edit(hospital_unit)
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
41
44
|
def destroy
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
+
hospital_unit = find_and_authorize_hospital_unit
|
46
|
+
hospital_unit.destroy!
|
47
|
+
redirect_to hospitals_units_path, notice: success_msg_for("hospital unit")
|
45
48
|
end
|
46
49
|
|
47
50
|
private
|
48
51
|
|
52
|
+
def render_new(hospital_unit)
|
53
|
+
render :new, locals: { hospital_unit: hospital_unit }
|
54
|
+
end
|
55
|
+
|
56
|
+
def render_edit(hospital_unit)
|
57
|
+
render :edit, locals: { hospital_unit: hospital_unit }
|
58
|
+
end
|
59
|
+
|
60
|
+
def find_and_authorize_hospital_unit
|
61
|
+
hospital_unit = Unit.find(params[:id])
|
62
|
+
authorize hospital_unit
|
63
|
+
hospital_unit
|
64
|
+
end
|
65
|
+
|
49
66
|
def hospital_unit_params
|
50
67
|
params.require(:hospitals_unit).permit(
|
51
68
|
:name, :unit_code, :renal_registry_code, :unit_type, :hospital_centre_id, :is_hd_site
|
52
69
|
)
|
53
70
|
end
|
54
|
-
|
55
|
-
def load_hospital_unit
|
56
|
-
@hospital_unit = Unit.find(params[:id])
|
57
|
-
authorize @hospital_unit
|
58
|
-
end
|
59
71
|
end
|
60
72
|
end
|
61
73
|
end
|
@@ -7,12 +7,6 @@ module Renalware
|
|
7
7
|
include Renalware::Concerns::Pageable
|
8
8
|
include PresenterHelper
|
9
9
|
|
10
|
-
def sent
|
11
|
-
messages = author.messages.page(page).per(per_page)
|
12
|
-
authorize messages
|
13
|
-
render locals: { messages: present(messages, MessagePresenter) }
|
14
|
-
end
|
15
|
-
|
16
10
|
def new
|
17
11
|
authorize Message, :new?
|
18
12
|
form = MessageFormBuilder.new(patient: patient, params: params).call
|
@@ -3,8 +3,6 @@ require_dependency "renalware/hd/base_controller"
|
|
3
3
|
module Renalware
|
4
4
|
module PD
|
5
5
|
class RegimesController < BaseController
|
6
|
-
include Renalware::Concerns::NestedActionsControllerMethods
|
7
|
-
|
8
6
|
before_action :load_patient
|
9
7
|
|
10
8
|
def new
|
@@ -16,6 +14,7 @@ module Renalware
|
|
16
14
|
}
|
17
15
|
end
|
18
16
|
|
17
|
+
# rubocop:disable Metrics/AbcSize
|
19
18
|
def create
|
20
19
|
result = CreateRegime.new(patient: patient)
|
21
20
|
.call(by: current_user, params: pd_regime_params)
|
@@ -30,6 +29,7 @@ module Renalware
|
|
30
29
|
}
|
31
30
|
end
|
32
31
|
end
|
32
|
+
# rubocop:enable Metrics/AbcSize
|
33
33
|
|
34
34
|
def edit
|
35
35
|
render :edit, locals: {
|
@@ -38,6 +38,7 @@ module Renalware
|
|
38
38
|
}
|
39
39
|
end
|
40
40
|
|
41
|
+
# rubocop:disable Metrics/AbcSize
|
41
42
|
def update
|
42
43
|
result = ReviseRegime.new(pd_regime).call(by: current_user, params: pd_regime_params)
|
43
44
|
|
@@ -52,6 +53,7 @@ module Renalware
|
|
52
53
|
}
|
53
54
|
end
|
54
55
|
end
|
56
|
+
# rubocop:enable Metrics/AbcSize
|
55
57
|
|
56
58
|
def show
|
57
59
|
render :show, locals: {
|
@@ -8,6 +8,33 @@ module Renalware
|
|
8
8
|
def to_sym
|
9
9
|
:hd
|
10
10
|
end
|
11
|
+
|
12
|
+
def augmented_name_for(patient)
|
13
|
+
AugmentedModalityName.new(name, patient).to_s
|
14
|
+
end
|
15
|
+
|
16
|
+
# This class might be better as a presenter but leaving here for now.
|
17
|
+
# #to_s returns e.g. "HD (HOSPCODE)" if patient's HD profile indicates they dialyse at
|
18
|
+
# HOSPCODE, otherwise returns "HD".
|
19
|
+
class AugmentedModalityName
|
20
|
+
delegate :hd_profile, to: :patient, allow_nil: true
|
21
|
+
delegate :hospital_unit, to: :hd_profile, allow_nil: true
|
22
|
+
delegate :unit_code, to: :hospital_unit, allow_nil: true
|
23
|
+
|
24
|
+
def initialize(default_name, patient)
|
25
|
+
@patient = HD.cast_patient(patient)
|
26
|
+
@default_name = default_name
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_s
|
30
|
+
return default_name if patient.blank? || unit_code.blank?
|
31
|
+
"#{default_name} (#{unit_code})"
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
attr_reader :patient, :default_name
|
37
|
+
end
|
11
38
|
end
|
12
39
|
end
|
13
40
|
end
|
@@ -8,7 +8,14 @@ module Renalware
|
|
8
8
|
has_one :hd_profile, class_name: "Profile"
|
9
9
|
has_one :hd_preference_set, class_name: "PreferenceSet"
|
10
10
|
has_many :hd_sessions, class_name: "Session"
|
11
|
-
scope :with_profile,
|
11
|
+
scope :with_profile, lambda {
|
12
|
+
includes(hd_profile: :hospital_unit)
|
13
|
+
.joins(<<-SQL)
|
14
|
+
LEFT OUTER JOIN hd_profiles ON hd_profiles.patient_id = patients.id
|
15
|
+
LEFT OUTER JOIN hospital_units ON hd_profiles.hospital_unit_id = hospital_units.id
|
16
|
+
SQL
|
17
|
+
.where("hd_profiles.deactivated_at is NULL")
|
18
|
+
}
|
12
19
|
|
13
20
|
def treated?
|
14
21
|
modality_descriptions.exists?(type: "Renalware::HD::ModalityDescription")
|
@@ -61,8 +61,7 @@ module Renalware
|
|
61
61
|
# This is fluid removed (ml) / HD time in hours eg 3.75 / dry weight (kg)
|
62
62
|
# The result is in ml/hr/kg
|
63
63
|
def ufr
|
64
|
-
return nil unless measured_dry_weight > 0 && duration > 0
|
65
|
-
return nil unless (fluid_removed = document.dialysis.fluid_removed) > 0
|
64
|
+
return nil unless measured_dry_weight > 0 && duration > 0 && fluid_removed > 0
|
66
65
|
|
67
66
|
fluid_removed / duration_as_hours / measured_dry_weight
|
68
67
|
end
|
@@ -80,6 +79,10 @@ module Renalware
|
|
80
79
|
def duration_as_hours
|
81
80
|
duration.to_f / 60.0
|
82
81
|
end
|
82
|
+
|
83
|
+
def fluid_removed
|
84
|
+
document.dialysis.fluid_removed.to_f
|
85
|
+
end
|
83
86
|
end
|
84
87
|
end
|
85
88
|
end
|
@@ -20,8 +20,16 @@ module Renalware
|
|
20
20
|
.merge(Letter::Approved.all)
|
21
21
|
.where(letter_letters: { author_id: user_id })
|
22
22
|
}
|
23
|
-
scope :unread,
|
24
|
-
|
23
|
+
scope :unread, lambda {
|
24
|
+
where(read_at: nil)
|
25
|
+
.joins(:letter)
|
26
|
+
.merge(Letter.approved_or_completed)
|
27
|
+
}
|
28
|
+
scope :read, lambda {
|
29
|
+
where.not(read_at: nil)
|
30
|
+
.joins(:letter)
|
31
|
+
.merge(Letter.approved_or_completed)
|
32
|
+
}
|
25
33
|
scope :for_recipient, ->(user_id) { where(recipient_id: user_id) }
|
26
34
|
scope :ordered, -> { order(created_at: :desc) }
|
27
35
|
|
@@ -63,6 +63,9 @@ module Renalware
|
|
63
63
|
scope :with_patient, -> { includes(patient: :primary_care_physician) }
|
64
64
|
scope :with_event, -> { includes(:event) }
|
65
65
|
scope :with_cc_recipients, -> { includes(cc_recipients: { addressee: { person: :address } }) }
|
66
|
+
scope :approved_or_completed, lambda {
|
67
|
+
where(type: [state_class_name(:approved), state_class_name(:completed)])
|
68
|
+
}
|
66
69
|
|
67
70
|
delegate :primary_care_physician, to: :patient
|
68
71
|
|
@@ -20,6 +20,12 @@ module Renalware
|
|
20
20
|
def self.policy_class
|
21
21
|
Modalities::DescriptionPolicy
|
22
22
|
end
|
23
|
+
|
24
|
+
# Modalities::Description subclasses can override this to for instance add
|
25
|
+
# the patient's 'HD Site' add after 'HD'
|
26
|
+
def augmented_name_for(_patient)
|
27
|
+
name
|
28
|
+
end
|
23
29
|
end
|
24
30
|
end
|
25
31
|
end
|
@@ -23,7 +23,11 @@ module Renalware
|
|
23
23
|
query = query_for_filter(named_filter).merge(q)
|
24
24
|
QueryableRegistration
|
25
25
|
.includes(patient: [current_modality: :description])
|
26
|
+
.includes(current_status: :description)
|
27
|
+
.merge(HD::Patient.with_profile)
|
28
|
+
.merge(Renal::Patient.with_profile)
|
26
29
|
.search(query).tap do |s|
|
30
|
+
|
27
31
|
s.sorts = ["patient_family_name, patient_given_name"]
|
28
32
|
end
|
29
33
|
end
|
@@ -80,10 +84,6 @@ module Renalware
|
|
80
84
|
.where.not(transplant_registration_status_descriptions: { code: codes })
|
81
85
|
}
|
82
86
|
|
83
|
-
ransacker :uk_transplant_centre_code do
|
84
|
-
Arel.sql("transplant_registrations.document -> 'codes' ->> 'uk_transplant_centre_code'")
|
85
|
-
end
|
86
|
-
|
87
87
|
ransacker :crf_highest_value do
|
88
88
|
Arel.sql("transplant_registrations.document -> 'crf' -> 'highest' ->> 'result'")
|
89
89
|
end
|
@@ -92,6 +92,16 @@ module Renalware
|
|
92
92
|
Arel.sql("transplant_registrations.document -> 'crf' -> 'latest' ->> 'result'")
|
93
93
|
end
|
94
94
|
|
95
|
+
# TODO: move ransacker to HD namespace
|
96
|
+
ransacker :hd_site do
|
97
|
+
Arel.sql("hospital_units.unit_code")
|
98
|
+
end
|
99
|
+
|
100
|
+
# TODO: move ransacker to Renal namespace
|
101
|
+
ransacker :esrf_on do
|
102
|
+
Arel.sql("renal_profiles.esrf_on")
|
103
|
+
end
|
104
|
+
|
95
105
|
scope :ukt_status_is, lambda { |status|
|
96
106
|
where(
|
97
107
|
"transplant_registrations.document -> 'uk_transplant_centre' ->> 'status' ilike ?",
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_dependency "renalware/patients"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Patients
|
5
|
+
class BannerPresenter < SimpleDelegator
|
6
|
+
def current_modality_description
|
7
|
+
if current_modality.blank? || current_modality.new_record?
|
8
|
+
I18n.t("renalware.modalities.none")
|
9
|
+
else
|
10
|
+
current_modality.description.augmented_name_for(__getobj__)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -5,13 +5,57 @@ require_dependency "renalware/transplants"
|
|
5
5
|
module Renalware
|
6
6
|
module Transplants
|
7
7
|
class WaitListRegistrationPresenter < SimpleDelegator
|
8
|
-
delegate :uk_transplant_centre,
|
9
|
-
|
8
|
+
delegate :uk_transplant_centre,
|
9
|
+
:transplant,
|
10
|
+
:organs,
|
11
|
+
:crf,
|
12
|
+
to: :document
|
13
|
+
delegate :status,
|
14
|
+
:status_updated_on,
|
15
|
+
to: :uk_transplant_centre, prefix: true, allow_nil: true
|
16
|
+
delegate :highest,
|
17
|
+
:latest,
|
18
|
+
to: :crf, prefix: true, allow_nil: true
|
19
|
+
delegate :recorded_on,
|
20
|
+
:result,
|
21
|
+
to: :crf_highest, prefix: true, allow_nil: true
|
22
|
+
delegate :recorded_on,
|
23
|
+
:result,
|
24
|
+
to: :crf_latest, prefix: true, allow_nil: true
|
25
|
+
delegate :blood_group,
|
26
|
+
:nb_of_previous_grafts,
|
27
|
+
to: :transplant, prefix: true, allow_nil: true
|
28
|
+
delegate :transplant_type,
|
29
|
+
to: :organs,
|
30
|
+
prefix: true, allow_nil: true
|
31
|
+
delegate :hospital_identifier,
|
32
|
+
:age,
|
33
|
+
:sex,
|
34
|
+
:current_modality,
|
35
|
+
to: :patient,
|
36
|
+
prefix: true, allow_nil: true
|
10
37
|
|
11
38
|
def uk_transplant_centre_summary
|
12
39
|
return if uk_transplant_centre_status.blank?
|
13
40
|
"#{uk_transplant_centre_status} (#{I18n.l(uk_transplant_centre_status_updated_on)})"
|
14
41
|
end
|
42
|
+
|
43
|
+
def hd_hospital_unit_code
|
44
|
+
Renalware::HD.cast_patient(patient).hd_profile&.hospital_unit&.unit_code
|
45
|
+
end
|
46
|
+
|
47
|
+
def esrf_date
|
48
|
+
Renalware::Renal.cast_patient(patient).profile&.esrf_on
|
49
|
+
end
|
50
|
+
|
51
|
+
def dol
|
52
|
+
entered_on && (Time.zone.today - entered_on).to_i
|
53
|
+
end
|
54
|
+
|
55
|
+
def sens
|
56
|
+
return if crf_latest_result.blank?
|
57
|
+
crf_latest_result.to_i > 60 ? "Sens" : "Unsens"
|
58
|
+
end
|
15
59
|
end
|
16
60
|
end
|
17
61
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
= render "renalware/shared/errors", model:
|
1
|
+
= render "renalware/shared/errors", model: hospital_unit
|
2
2
|
|
3
|
-
= simple_form_for
|
3
|
+
= simple_form_for hospital_unit,
|
4
4
|
wrapper: :horizontal_form,
|
5
5
|
html: { autocomplete: "off" } do |f|
|
6
6
|
= f.association :hospital_centre,
|
@@ -16,14 +16,14 @@
|
|
16
16
|
th.col-width-tiny Stations
|
17
17
|
th.col-width-medium
|
18
18
|
tbody
|
19
|
-
-
|
19
|
+
- hospital_units.each do |unit|
|
20
20
|
tr
|
21
21
|
td
|
22
22
|
= link_to "Edit", edit_hospitals_unit_path(unit.id)
|
23
23
|
= pipe_separator
|
24
24
|
= link_to "Delete",
|
25
25
|
hospitals_unit_path(unit.id),
|
26
|
-
|
26
|
+
method: :delete,
|
27
27
|
data: { confirm: I18n.t("prompts.confirm_delete") }
|
28
28
|
td= unit.unit_code
|
29
29
|
td= unit.name
|
@@ -1,6 +1,7 @@
|
|
1
1
|
table.letters.electronic-ccs.has-togglable-rows
|
2
2
|
thead
|
3
3
|
tr
|
4
|
+
th.col-width-tiny State
|
4
5
|
th.col-width-date Date
|
5
6
|
th.col-width-date-time Read at
|
6
7
|
th.col-width-medium Author
|
@@ -15,7 +16,9 @@ table.letters.electronic-ccs.has-togglable-rows
|
|
15
16
|
- letter = Renalware::Letters::LetterPresenter.new(receipt.letter)
|
16
17
|
- patient = letter.patient
|
17
18
|
|
18
|
-
tr(id=receipt.html_identifier)
|
19
|
+
tr(id=receipt.html_identifier class=letter.state.dasherize)
|
20
|
+
td.state
|
21
|
+
span= letter.state_description
|
19
22
|
td= l(letter.issued_on)
|
20
23
|
td= l(receipt.read_at)
|
21
24
|
td= letter.author
|
@@ -31,7 +34,7 @@ table.letters.electronic-ccs.has-togglable-rows
|
|
31
34
|
|
32
35
|
= content_tag(:tr, id: receipt.html_preview_identifier, style: "display: none")
|
33
36
|
td
|
34
|
-
td(colspan=
|
37
|
+
td(colspan=7)
|
35
38
|
.quick-preview
|
36
39
|
= simple_format letter.body
|
37
40
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
- columns = local_assigns[:columns] || []
|
2
|
+
|
1
3
|
tr(class=letter.state.dasherize)
|
2
4
|
td
|
3
5
|
= link_to "Toggle", "#quick-preview-#{letter.id}", data: { behaviour: "toggler" }
|
@@ -16,12 +18,15 @@ tr(class=letter.state.dasherize)
|
|
16
18
|
td.state
|
17
19
|
span= letter.state_description
|
18
20
|
td= l(letter.issued_on)
|
19
|
-
|
21
|
+
- if columns.include?(:author)
|
22
|
+
td.col-width-medium-with-ellipsis= letter.author
|
23
|
+
- if columns.include?(:patient)
|
24
|
+
td.col-width-medium-with-ellipsis= default_patient_link(letter.patient)
|
20
25
|
td.recipient= letter.main_recipient.address
|
21
|
-
td= letter.description
|
26
|
+
td.col-width-medium-with-ellipsis= letter.description
|
22
27
|
|
23
28
|
= content_tag(:tr, id: "quick-preview-#{letter.id}", style: "display: none")
|
24
29
|
td
|
25
|
-
td(colspan=
|
30
|
+
td(colspan=8)
|
26
31
|
.quick-preview
|
27
32
|
= simple_format letter.body
|
@@ -1,14 +1,20 @@
|
|
1
|
+
- columns = local_assigns[:columns] || [:author]
|
2
|
+
|
1
3
|
table.auto-layout.letters.has-togglable-rows
|
2
4
|
thead
|
3
5
|
tr
|
4
|
-
th.col-width-
|
5
|
-
th State
|
6
|
+
th.col-width-small
|
7
|
+
th.col-width-tiny State
|
6
8
|
th.col-width-date Date
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
- if columns.include?(:author)
|
10
|
+
th.col-width-medium Author
|
11
|
+
- if columns.include?(:patient)
|
12
|
+
th.col-width-medium Patient
|
13
|
+
th.col-width-medium Recipient
|
14
|
+
th.col-width-medium Description
|
10
15
|
|
11
16
|
tbody
|
12
17
|
= render partial: "renalware/letters/letters/letter",
|
13
18
|
collection: letters,
|
14
|
-
cached: true
|
19
|
+
cached: true,
|
20
|
+
locals: { columns: columns }
|
@@ -7,21 +7,27 @@ article
|
|
7
7
|
patient_prescriptions_path(mdm.patient),
|
8
8
|
class: "button secondary"
|
9
9
|
|
10
|
-
|
10
|
+
= link_to "Toggle",
|
11
|
+
"#prescriptions",
|
12
|
+
class: "button secondary",
|
13
|
+
data: { behaviour: "css-toggler" }
|
11
14
|
|
12
|
-
|
13
|
-
|
14
|
-
li.tab-title= link_to "EPO History", "#epo-history"
|
15
|
+
#prescriptions.expandable
|
16
|
+
- if local_assigns[:with_esa] == true
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
=
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
18
|
+
ul.tab-strip(data-tab)
|
19
|
+
li.tab-title.active= link_to "Current", "#current"
|
20
|
+
li.tab-title= link_to "EPO History", "#epo-history"
|
21
|
+
|
22
|
+
.tabs-content
|
23
|
+
#current.content.active
|
24
|
+
= render "renalware/mdm/prescriptions/table",
|
25
|
+
prescriptions: mdm.current_prescriptions,
|
26
|
+
show_administer_on_hd: true
|
27
|
+
#epo-history.content
|
28
|
+
= render "renalware/mdm/prescriptions/table",
|
29
|
+
prescriptions: mdm.esa_prescriptions,
|
30
|
+
show_terminated_on: true,
|
31
|
+
show_administer_on_hd: true
|
32
|
+
- else
|
33
|
+
= render "current_prescriptions", mdm: mdm
|
@@ -1,4 +1,5 @@
|
|
1
1
|
- observation_set = patient.current_observation_set
|
2
|
+
- transplant_patient = Renalware::Transplants::PatientPresenter.new(patient)
|
2
3
|
tr
|
3
4
|
td.full-name= link_to patient.to_s(:default), view_proc.call(patient)
|
4
5
|
td.nowrap= patient.nhs_number
|
@@ -6,6 +7,7 @@ tr
|
|
6
7
|
td= patient.sex.code
|
7
8
|
td= patient.age
|
8
9
|
td= patient.modality_description&.name
|
10
|
+
td= transplant_patient.current_registration_status
|
9
11
|
td= observation_set.hgb_result
|
10
12
|
td= l(observation_set.hgb_observed_at)
|
11
13
|
td= observation_set.ure_result
|
@@ -8,6 +8,7 @@ table#patients.mdm-patients.columns
|
|
8
8
|
th.col-width-tiny= t(".sex")
|
9
9
|
th.col-width-tiny= t(".age")
|
10
10
|
th.col-width-medium= t(".modality")
|
11
|
+
th.col-width-date= t(".registration_status")
|
11
12
|
- %i(hgb ure cre).each do |code|
|
12
13
|
th.col-width-tiny= sort_link(path, code, t(".#{code}"))
|
13
14
|
th.col-width-date= sort_link(path, :"#{code}_date", t(".#{code}_date"))
|
@@ -1,4 +1,5 @@
|
|
1
1
|
- back_path ||= nil
|
2
|
+
- patient = Renalware::Patients::BannerPresenter.new(patient)
|
2
3
|
|
3
4
|
.header.patient-header
|
4
5
|
/ If screen-is-mobile-size is visible then we collapse the patient LH nav
|
@@ -31,4 +32,4 @@
|
|
31
32
|
dt= t(".born_on")
|
32
33
|
dd= "#{l(patient.born_on)} (#{patient.age}y)"
|
33
34
|
dt= t(".modality")
|
34
|
-
dd=
|
35
|
+
dd= patient.current_modality_description
|
@@ -1,20 +1,22 @@
|
|
1
1
|
- bookmark = find_user_bookmark_for_patient(patient)
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
3
|
+
/ Don't cache fragments that contain a form
|
4
|
+
/- cache([patient, current_user, bookmark || "bookmarks/"]) do
|
5
|
+
- if bookmark.present?
|
6
|
+
li.link.action= render partial: "renalware/patients/bookmarks/delete",
|
7
|
+
locals: { bookmark: bookmark, link_text: t(".delete_bookmark") }
|
8
|
+
- else
|
9
|
+
li.link.action= render partial: "renalware/patients/bookmarks/new",
|
10
|
+
locals: { patient: patient, link_text: t(".create_bookmark") }
|
11
|
+
|
12
|
+
/ Don't cache fragments that contain a form
|
13
|
+
/- cache([patient, patient.worry || "worries/"]) do
|
14
|
+
- if patient.worry.present?
|
15
|
+
li.link.action= render partial: "renalware/patients/worries/delete",
|
16
|
+
locals: { patient: patient }
|
17
|
+
- else
|
18
|
+
li.link.action= render partial: "renalware/patients/worries/new",
|
19
|
+
locals: { patient: patient }
|
18
20
|
|
19
21
|
- cache([patient, "send_message_link"]) do
|
20
22
|
li.link.action= render partial: "renalware/messaging/internal/messages/send_message_link",
|
@@ -5,27 +5,21 @@ tr
|
|
5
5
|
td.full-name
|
6
6
|
= link_to registration.patient.to_s,
|
7
7
|
patient_clinical_summary_path(registration.patient)
|
8
|
-
td= registration.
|
9
|
-
td= registration.
|
10
|
-
td= registration.
|
11
|
-
td= registration.
|
12
|
-
td= registration.
|
8
|
+
td= registration.patient_hospital_identifier
|
9
|
+
td= registration.patient_age
|
10
|
+
td= registration.patient_sex.code
|
11
|
+
td= registration.patient_current_modality
|
12
|
+
td= registration.hd_hospital_unit_code
|
13
13
|
td= registration.current_status
|
14
|
-
td= registration.
|
15
|
-
td
|
16
|
-
|
17
|
-
|
18
|
-
td=
|
19
|
-
td
|
20
|
-
|
21
|
-
|
22
|
-
td= registration.
|
23
|
-
td= registration.
|
24
|
-
td=
|
25
|
-
td= registration.
|
26
|
-
td= I18n.l registration.document.crf.latest.recorded_on
|
27
|
-
td
|
28
|
-
- if registration.document.crf.latest.result.present?
|
29
|
-
= (registration.document.crf.latest.result.to_i > 60 ? "Sens" : "Unsens")
|
30
|
-
td= registration.document.transplant.nb_of_previous_grafts
|
31
|
-
td= registration.document.organs.transplant_type.try(:text)
|
14
|
+
td= registration.uk_transplant_centre_status
|
15
|
+
td= l(registration.esrf_date)
|
16
|
+
td= l(registration.entered_on)
|
17
|
+
td= registration.dol
|
18
|
+
td= registration.transplant_blood_group.to_s
|
19
|
+
td= registration.crf_highest_result
|
20
|
+
td= l(registration.crf_highest_recorded_on)
|
21
|
+
td= registration.crf_latest_result
|
22
|
+
td= l(registration.crf_latest_recorded_on)
|
23
|
+
td= registration.sens
|
24
|
+
td= registration.transplant_nb_of_previous_grafts
|
25
|
+
td= registration.organs_transplant_type&.text
|
@@ -25,13 +25,10 @@
|
|
25
25
|
th= sort_link([:renalware, q], :patient_born_on, "Age")
|
26
26
|
th= sort_link([:renalware, q], :patient_sex, "Sex")
|
27
27
|
th Modal
|
28
|
-
th= sort_link([:renalware, q], :
|
28
|
+
th= sort_link([:renalware, q], :hd_site, "HD Site")
|
29
29
|
th Status
|
30
30
|
th UKT Status
|
31
|
-
|
32
|
-
/ Renal::Patient so patient#profile does not exist. We may need to add a ransacker
|
33
|
-
/ in WaitListQuery
|
34
|
-
th.col-width-date= sort_link([:renalware, q], :patient_profile_esrf_on, "ESRF Date")
|
31
|
+
th.col-width-date= sort_link([:renalware, q], :esrf_on, "ESRF Date")
|
35
32
|
th.col-width-date= sort_link([:renalware, q], :entered_on, "Entry Date")
|
36
33
|
th DOL
|
37
34
|
th Bld Grp
|
data/config/routes.rb
CHANGED
@@ -36,16 +36,16 @@ Renalware::Engine.routes.draw do
|
|
36
36
|
resources :mock_errors, only: [:index], controller: "system/mock_errors"
|
37
37
|
|
38
38
|
namespace :reporting do
|
39
|
-
resources :audits, except: [:destroy]
|
39
|
+
resources :audits, except: [:destroy, :create, :new]
|
40
40
|
resources :audit_refreshments, only: [:create]
|
41
41
|
end
|
42
42
|
|
43
43
|
namespace :admissions do
|
44
|
-
resources :requests do
|
44
|
+
resources :requests, except: :show do
|
45
45
|
post :sort, on: :collection
|
46
46
|
end
|
47
|
-
resources :consults
|
48
|
-
resources :admissions
|
47
|
+
resources :consults, except: :show
|
48
|
+
resources :admissions, except: :show
|
49
49
|
end
|
50
50
|
|
51
51
|
namespace :messaging do
|
@@ -110,11 +110,11 @@ Renalware::Engine.routes.draw do
|
|
110
110
|
|
111
111
|
resources :bookmarks, controller: "patients/bookmarks", only: :destroy
|
112
112
|
resource :dashboard, only: :show, controller: "dashboard/dashboards"
|
113
|
-
resource :worryboard, :show, controller: "patients/worryboard"
|
113
|
+
resource :worryboard, only: :show, controller: "patients/worryboard"
|
114
114
|
|
115
115
|
# Clinics
|
116
116
|
resources :appointments, controller: "clinics/appointments", only: [:index]
|
117
|
-
resources :clinic_visits, controller: "clinics/visits"
|
117
|
+
resources :clinic_visits, only: :index, controller: "clinics/visits"
|
118
118
|
|
119
119
|
resources :deaths, only: :index, as: :patient_deaths
|
120
120
|
|
@@ -453,21 +453,27 @@ Renalware::Engine.routes.draw do
|
|
453
453
|
scope "/donor" do
|
454
454
|
resource :donor_dashboard, only: :show, path: "/dashboard"
|
455
455
|
resource :donor_workup, only: [:show, :edit, :update], path: "/workup"
|
456
|
-
resources :donor_operations,
|
457
|
-
resource :followup,
|
456
|
+
resources :donor_operations, except: [:index, :destroy], path: "/operations" do
|
457
|
+
resource :followup,
|
458
|
+
except: :destroy,
|
459
|
+
controller: "donor_followups",
|
460
|
+
path: "/follow_up"
|
458
461
|
end
|
459
|
-
resources :donations,
|
460
|
-
resource :donor_stage,
|
462
|
+
resources :donations, except: [:index, :destroy]
|
463
|
+
resource :donor_stage, only: [:new, :create], path: "/stage"
|
461
464
|
end
|
462
465
|
|
463
466
|
scope "/recipient" do
|
464
467
|
resource :recipient_dashboard, only: :show, path: "/dashboard"
|
465
468
|
resource :recipient_workup, only: [:show, :edit, :update], path: "/workup"
|
466
|
-
resources :recipient_operations,
|
467
|
-
resource :followup,
|
469
|
+
resources :recipient_operations, except: [:index, :destroy], path: "/operations" do
|
470
|
+
resource :followup,
|
471
|
+
except: :destroy,
|
472
|
+
controller: "recipient_followups",
|
473
|
+
path: "/follow_up"
|
468
474
|
end
|
469
|
-
resource :registration,
|
470
|
-
resources :statuses, controller: "registration_statuses"
|
475
|
+
resource :registration, only: [:show, :edit, :update] do
|
476
|
+
resources :statuses, except: [:index, :show], controller: "registration_statuses"
|
471
477
|
end
|
472
478
|
end
|
473
479
|
end
|
data/lib/renalware/version.rb
CHANGED
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.
|
4
|
+
version: 2.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -1059,7 +1059,6 @@ files:
|
|
1059
1059
|
- app/controllers/renalware/clinics/visits_controller.rb
|
1060
1060
|
- app/controllers/renalware/concerns/cache_busting.rb
|
1061
1061
|
- app/controllers/renalware/concerns/devise_controller_methods.rb
|
1062
|
-
- app/controllers/renalware/concerns/nested_actions_controller_methods.rb
|
1063
1062
|
- app/controllers/renalware/concerns/pageable.rb
|
1064
1063
|
- app/controllers/renalware/concerns/pdf_renderable.rb
|
1065
1064
|
- app/controllers/renalware/dashboard.rb
|
@@ -1875,6 +1874,7 @@ files:
|
|
1875
1874
|
- app/presenters/renalware/pathology/requests/sample_description.rb
|
1876
1875
|
- app/presenters/renalware/pathology/results_presenter.rb
|
1877
1876
|
- app/presenters/renalware/patient_presenter.rb
|
1877
|
+
- app/presenters/renalware/patients/banner_presenter.rb
|
1878
1878
|
- app/presenters/renalware/pd/dashboard_presenter.rb
|
1879
1879
|
- app/presenters/renalware/pd/delivery_interval_presenter.rb
|
1880
1880
|
- app/presenters/renalware/pd/mdm_presenter.rb
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require "active_support/concern"
|
2
|
-
|
3
|
-
module Renalware
|
4
|
-
module Concerns::NestedActionsControllerMethods
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
included do
|
8
|
-
# Allows add and remove form submissions for a nested collection
|
9
|
-
#
|
10
|
-
# @params
|
11
|
-
# nested - the nested collection where items are added or removed
|
12
|
-
# default_action - the update or save action wrapped in a proc
|
13
|
-
# build_attrs - attributes to pass to collection#build when adding to the collection
|
14
|
-
#
|
15
|
-
def perform_action(nested, default_action, build_attrs = {})
|
16
|
-
if (actions = params[:actions]).present?
|
17
|
-
if actions.key?(:remove)
|
18
|
-
index = actions[:remove].keys.first.to_i
|
19
|
-
nested.destroy(nested[index])
|
20
|
-
else
|
21
|
-
nested.build(build_attrs)
|
22
|
-
end
|
23
|
-
false
|
24
|
-
else
|
25
|
-
default_action.call
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|