renalware-core 2.0.32 → 2.0.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/renalware/partials/_tables.scss +1 -1
- data/app/controllers/renalware/hd/dialysates_controller.rb +78 -0
- data/app/controllers/renalware/hd/dialysers_controller.rb +3 -1
- data/app/models/renalware/hd/dialysate.rb +5 -1
- data/app/models/renalware/hd/dialyser.rb +2 -0
- data/app/models/renalware/letters/letter_query.rb +1 -1
- data/app/policies/renalware/hd/dialysate_policy.rb +8 -0
- data/app/presenters/renalware/dashboard/dashboard_presenter.rb +3 -1
- data/app/presenters/renalware/ukrdc/patient_presenter.rb +5 -0
- data/app/views/renalware/api/ukrdc/patients/_patient.xml.builder +1 -1
- data/app/views/renalware/dashboard/letters/_letter.html.slim +1 -1
- data/app/views/renalware/dashboard/letters/_table.html.slim +1 -1
- data/app/views/renalware/hd/dialysates/_form.html.slim +12 -0
- data/app/views/renalware/hd/dialysates/edit.html.slim +2 -0
- data/app/views/renalware/hd/dialysates/index.html.slim +35 -0
- data/app/views/renalware/hd/dialysates/new.html.slim +2 -0
- data/app/views/renalware/hd/dialysers/_form.html.slim +2 -0
- data/app/views/renalware/hd/dialysers/index.html.slim +10 -6
- data/app/views/renalware/letters/letters/_letter.html.slim +1 -1
- data/app/views/renalware/letters/letters/_table.html.slim +1 -1
- data/app/views/renalware/letters/lists/_letter.html.slim +1 -1
- data/app/views/renalware/letters/lists/_table.html.slim +1 -1
- data/app/views/renalware/navigation/_super_admin.html.slim +1 -0
- data/app/views/renalware/research/_alerts.html.slim +4 -6
- data/config/permissions.yml +1 -0
- data/config/routes.rb +1 -0
- data/db/migrate/20180524072633_add_columns_to_dialysates.rb +15 -0
- data/db/migrate/20180524074320_add_columns_to_hd_dialysers.rb +10 -0
- data/lib/renalware/version.rb +1 -1
- data/spec/factories/hd/dialysers.rb +2 -0
- data/spec/factories/patients/languages.rb +6 -1
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cb83ec4abb560e829604647e54cc9ad09d82dc7a5505d8f5f07491995f5b23f
|
4
|
+
data.tar.gz: 2a2113a1fbfde978e756208df0c8bf73e3fb6634f0bcde25ba3d48d45dfb8907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1324b463a16ae76bbbcb00a1c23a071eec16fa95494f536ea2be996d4931720ccddd896a42f1c03557921e4efadeaae8c2f17b67dc29075f491c8545f3257ccb
|
7
|
+
data.tar.gz: a0de64f66ec38ee3b10f5cc9cbaee028d762cf5986364e2c50dfc521ff206c916abfdea83bb15127ff7b3f2d372b8369e01f422f589361d280a48e8469d37e11
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_dependency "renalware/hd/base_controller"
|
4
|
+
|
5
|
+
module Renalware
|
6
|
+
module HD
|
7
|
+
class DialysatesController < HD::BaseController
|
8
|
+
def index
|
9
|
+
dialysates = Dialysate.all
|
10
|
+
authorize dialysates
|
11
|
+
render locals: { dialysates: dialysates }
|
12
|
+
end
|
13
|
+
|
14
|
+
def new
|
15
|
+
dialysate = Dialysate.new
|
16
|
+
authorize dialysate
|
17
|
+
render_new(dialysate)
|
18
|
+
end
|
19
|
+
|
20
|
+
def create
|
21
|
+
dialysate = Dialysate.new(dialysate_params)
|
22
|
+
authorize dialysate
|
23
|
+
|
24
|
+
if dialysate.save
|
25
|
+
redirect_to hd_dialysates_path, notice: success_msg_for("dialysate")
|
26
|
+
else
|
27
|
+
flash.now[:error] = failed_msg_for("dialysate")
|
28
|
+
render_new(dialysate)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def edit
|
33
|
+
render_edit(find_and_authorize_dialysate)
|
34
|
+
end
|
35
|
+
|
36
|
+
def update
|
37
|
+
dialysate = find_and_authorize_dialysate
|
38
|
+
if dialysate.update(dialysate_params)
|
39
|
+
redirect_to hd_dialysates_path, notice: success_msg_for("dialysate")
|
40
|
+
else
|
41
|
+
flash.now[:error] = failed_msg_for("dialysate")
|
42
|
+
render_edit(dialysate)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def destroy
|
47
|
+
find_and_authorize_dialysate.destroy!
|
48
|
+
redirect_to hd_dialysates_path, notice: success_msg_for("dialysate")
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def render_new(dialysate)
|
54
|
+
render :new, locals: { dialysate: dialysate }
|
55
|
+
end
|
56
|
+
|
57
|
+
def render_edit(dialysate)
|
58
|
+
render :edit, locals: { dialysate: dialysate }
|
59
|
+
end
|
60
|
+
|
61
|
+
def find_and_authorize_dialysate
|
62
|
+
Dialysate.find(params[:id]).tap { |dialysate| authorize(dialysate) }
|
63
|
+
end
|
64
|
+
|
65
|
+
def dialysate_params
|
66
|
+
params
|
67
|
+
.require(:dialysate)
|
68
|
+
.permit(
|
69
|
+
:name, :description,
|
70
|
+
:sodium_content, :sodium_content_uom,
|
71
|
+
:bicarbonate_content, :bicarbonate_content_uom,
|
72
|
+
:calcium_content, :calcium_content_uom,
|
73
|
+
:potassium_content, :potassium_content_uom
|
74
|
+
)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -53,7 +53,9 @@ module Renalware
|
|
53
53
|
private
|
54
54
|
|
55
55
|
def dialyser_params
|
56
|
-
params
|
56
|
+
params
|
57
|
+
.require(:hd_dialyser)
|
58
|
+
.permit(:group, :name, :membrane_surface_area, :membrane_surface_area_coefficient_k0a)
|
57
59
|
end
|
58
60
|
|
59
61
|
def load_and_authorize_dialyser
|
@@ -7,8 +7,12 @@ module Renalware
|
|
7
7
|
class Dialysate < ApplicationRecord
|
8
8
|
acts_as_paranoid
|
9
9
|
validates :name, presence: true, uniqueness: true
|
10
|
-
validates :sodium_content, presence: true
|
10
|
+
validates :sodium_content, presence: true, numericality: true
|
11
11
|
validates :sodium_content_uom, presence: true
|
12
|
+
validates :bicarbonate_content, numericality: true, allow_blank: true
|
13
|
+
validates :calcium_content, numericality: true, allow_blank: true
|
14
|
+
validates :glucose_content, numericality: true, allow_blank: true
|
15
|
+
validates :potassium_content, numericality: true, allow_blank: true
|
12
16
|
|
13
17
|
def to_s
|
14
18
|
name
|
@@ -9,6 +9,8 @@ module Renalware
|
|
9
9
|
|
10
10
|
validates :group, presence: true
|
11
11
|
validates :name, presence: true
|
12
|
+
validates :membrane_surface_area, numericality: true, allow_blank: true
|
13
|
+
validates :membrane_surface_area_coefficient_k0a, numericality: true, allow_blank: true
|
12
14
|
|
13
15
|
scope :ordered, -> { order(:group, :name) }
|
14
16
|
|
@@ -21,13 +21,15 @@ module Renalware
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
# Note we want oldest letters ordered first on the dashboard - elsewhere letters
|
25
|
+
# are newest first
|
24
26
|
def letters_in_progress
|
25
27
|
@letters_in_progress ||= begin
|
26
28
|
present_letters(
|
27
29
|
Letters::Letter
|
28
30
|
.where("author_id = ? or created_by_id = ?", user.id, user.id)
|
29
31
|
.in_progress
|
30
|
-
.
|
32
|
+
.order(updated_at: :asc)
|
31
33
|
)
|
32
34
|
# Renalware::Letters.cast_author(user)
|
33
35
|
end
|
@@ -58,7 +58,7 @@ xml.Patient do
|
|
58
58
|
|
59
59
|
if patient.language.present?
|
60
60
|
xml.PrimaryLanguage do
|
61
|
-
xml.CodingStandard "NHS_DATA_DICTIONARY_LANGUAGE_CODE" # ISO 639-1 plus braille
|
61
|
+
xml.CodingStandard "NHS_DATA_DICTIONARY_LANGUAGE_CODE" # ISO 639-1 plus braille and sign
|
62
62
|
xml.Code patient.language&.code
|
63
63
|
xml.Description patient.language
|
64
64
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
= render "renalware/shared/errors", model: dialysate
|
2
|
+
|
3
|
+
= simple_form_for dialysate, as: :dialysate, html: { autocomplete: "off" } do |f|
|
4
|
+
= f.input :name, autofocus: true, wrapper: :horizontal_medium
|
5
|
+
= f.input :description, wrapper: :horizontal_large
|
6
|
+
- %i(sodium bicarbonate potassium calcium glucose).each do |element|
|
7
|
+
= f.input :"#{element}_content", wrapper: :horizontal_small
|
8
|
+
= f.input :"#{element}_content_uom", wrapper: :horizontal_small
|
9
|
+
|
10
|
+
= f.button :submit
|
11
|
+
span= " or "
|
12
|
+
= link_to "cancel", hd_dialysates_path
|
@@ -0,0 +1,35 @@
|
|
1
|
+
= content_for(:actions) do
|
2
|
+
= link_to "Add",
|
3
|
+
new_hd_dialysate_path,
|
4
|
+
class: "button"
|
5
|
+
|
6
|
+
= within_admin_layout(title: "HD Dialysates") do
|
7
|
+
|
8
|
+
table.hd-dialysates
|
9
|
+
thead
|
10
|
+
th.col-width-tiny
|
11
|
+
th.col-width-medium Name
|
12
|
+
th.col-width-medium Description
|
13
|
+
- %i(sodium bicarbonate potassium calcium glocose).each do |element|
|
14
|
+
th.col-width-tiny= element.to_s.capitalize
|
15
|
+
tbody
|
16
|
+
- dialysates.each do |dialysate|
|
17
|
+
tr
|
18
|
+
td
|
19
|
+
- if policy(dialysate).edit?
|
20
|
+
= link_to "Edit", edit_hd_dialysate_path(dialysate)
|
21
|
+
/ Disabling destroy for now as it seems to let you delete a dialysate that is in use
|
22
|
+
/ Need to add a FK first
|
23
|
+
/ - if policy(dialysate).destroy?
|
24
|
+
/ = pipe_separator
|
25
|
+
/ = link_to "Delete",
|
26
|
+
/ hd_dialysate_path(dialysate),
|
27
|
+
/ method: :delete,
|
28
|
+
/ data: { confirm: "Are you sure?" }
|
29
|
+
td= dialysate.name
|
30
|
+
td= dialysate.description
|
31
|
+
- %i(sodium bicarbonate potassium calcium glucose).each do |element|
|
32
|
+
- line = [ \
|
33
|
+
dialysate.public_send(:"#{element}_content"), \
|
34
|
+
dialysate.public_send(:"#{element}_content_uom")].compact.join(" ")
|
35
|
+
td= line
|
@@ -4,6 +4,8 @@
|
|
4
4
|
= simple_form_for dialyser, html: { autocomplete: "off" } do |f|
|
5
5
|
= f.input :group, autofocus: true, wrapper: :horizontal_small
|
6
6
|
= f.input :name, wrapper: :horizontal_small
|
7
|
+
= f.input :membrane_surface_area, wrapper: :horizontal_small
|
8
|
+
= f.input :membrane_surface_area_coefficient_k0a, wrapper: :horizontal_small
|
7
9
|
|
8
10
|
= f.button :submit
|
9
11
|
span= " or "
|
@@ -8,16 +8,20 @@
|
|
8
8
|
tr
|
9
9
|
th.col-width-small
|
10
10
|
th.col-width-small Group
|
11
|
-
th Name
|
11
|
+
th.col-width-large Name
|
12
|
+
th.col-width-small Membrane Surface Area
|
13
|
+
th Membrane Surface Area (K0A)
|
12
14
|
tbody
|
13
|
-
- dialysers.each do |
|
15
|
+
- dialysers.each do |dialyser|
|
14
16
|
tr
|
15
17
|
td
|
16
|
-
= link_to "Edit", edit_hd_dialyser_path(
|
18
|
+
= link_to "Edit", edit_hd_dialyser_path(dialyser.id)
|
17
19
|
= pipe_separator
|
18
20
|
= link_to "Delete",
|
19
|
-
hd_dialyser_path(
|
21
|
+
hd_dialyser_path(dialyser.id),
|
20
22
|
method: :delete,
|
21
23
|
data: { confirm: I18n.t("prompts.confirm_delete") }
|
22
|
-
td=
|
23
|
-
td=
|
24
|
+
td= dialyser.group
|
25
|
+
td= dialyser.name
|
26
|
+
td= dialyser.membrane_surface_area
|
27
|
+
td= dialyser.membrane_surface_area_coefficient_k0a
|
@@ -29,7 +29,7 @@ tr(class=letter.state.dasherize)
|
|
29
29
|
td.full-name= default_patient_link(letter.patient)
|
30
30
|
td= letter.patient.nhs_number
|
31
31
|
td= letter.enclosures&.truncate(6)
|
32
|
-
td= l letter.
|
32
|
+
td= l letter.updated_at
|
33
33
|
td= letter.author
|
34
34
|
td= letter.typist
|
35
35
|
td.col-width-medium-with-ellipsis= letter.main_recipient.address
|
@@ -8,7 +8,7 @@
|
|
8
8
|
th.col-width-medium= sort_link([:renalware, q], :patient_family_name, "Patient")
|
9
9
|
th.col-width-nhs-no= sort_link([:renalware, q], :patient_nhs_number, "NHS No")
|
10
10
|
th= sort_link([:renalware, q], :enclosures, "Enc.")
|
11
|
-
th.col-width-date = sort_link([:renalware, q], :
|
11
|
+
th.col-width-date-time = sort_link([:renalware, q], :updated_at, "Date", default_order: :desc)
|
12
12
|
th= sort_link([:renalware, q], :author_family_name, "Author")
|
13
13
|
th= sort_link([:renalware, q], :created_by_family_name, "Typist")
|
14
14
|
th.col-width-small Recipient
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
collection: participations,
|
6
|
-
as: :participation
|
1
|
+
- participations = Renalware::Research::StudyParticipant.where(participant_id: patient.id).where("joined_on <= ?", Time.zone.now).where("left_on is null or left_on > ?", Time.zone.now)
|
2
|
+
= render partial: "renalware/research/alert",
|
3
|
+
collection: participations,
|
4
|
+
as: :participation
|
data/config/permissions.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -158,6 +158,7 @@ Renalware::Engine.routes.draw do
|
|
158
158
|
|
159
159
|
resources :cannulation_types, except: :show
|
160
160
|
resources :dialysers, except: :show
|
161
|
+
resources :dialysates, except: :show
|
161
162
|
resource :ongoing_sessions, only: :show
|
162
163
|
resources :mdm_patients, only: :index
|
163
164
|
resources :unmet_preferences, only: :index
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class AddColumnsToDialysates < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
add_column :hd_dialysates, :bicarbonate_content, :decimal, precision: 10, scale: 2
|
4
|
+
add_column :hd_dialysates, :bicarbonate_content_uom, :string, default: "mmol/L"
|
5
|
+
|
6
|
+
add_column :hd_dialysates, :calcium_content, :decimal, precision: 10, scale: 2
|
7
|
+
add_column :hd_dialysates, :calcium_content_uom, :string, default: "mmol/L"
|
8
|
+
|
9
|
+
add_column :hd_dialysates, :glucose_content, :decimal, precision: 10, scale: 2
|
10
|
+
add_column :hd_dialysates, :glucose_content_uom, :string, default: "g/L"
|
11
|
+
|
12
|
+
add_column :hd_dialysates, :potassium_content, :decimal, precision: 10, scale: 2
|
13
|
+
add_column :hd_dialysates, :potassium_content_uom, :string, default: "mmol/L"
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class AddColumnsToHDDialysers < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
add_column :hd_dialysers,
|
4
|
+
:membrane_surface_area,
|
5
|
+
:decimal, precision: 10, scale: 2
|
6
|
+
add_column :hd_dialysers,
|
7
|
+
:membrane_surface_area_coefficient_k0a,
|
8
|
+
:decimal, precision: 10, scale: 2
|
9
|
+
end
|
10
|
+
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.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_type
|
@@ -1080,6 +1080,7 @@ files:
|
|
1080
1080
|
- app/controllers/renalware/hd/cannulation_types_controller.rb
|
1081
1081
|
- app/controllers/renalware/hd/current_profile_controller.rb
|
1082
1082
|
- app/controllers/renalware/hd/dashboards_controller.rb
|
1083
|
+
- app/controllers/renalware/hd/dialysates_controller.rb
|
1083
1084
|
- app/controllers/renalware/hd/dialysers_controller.rb
|
1084
1085
|
- app/controllers/renalware/hd/diaries_controller.rb
|
1085
1086
|
- app/controllers/renalware/hd/diary_slots_controller.rb
|
@@ -1766,6 +1767,7 @@ files:
|
|
1766
1767
|
- app/policies/renalware/events/swab_policy.rb
|
1767
1768
|
- app/policies/renalware/feeds/file_policy.rb
|
1768
1769
|
- app/policies/renalware/hd/closed_session_policy.rb
|
1770
|
+
- app/policies/renalware/hd/dialysate_policy.rb
|
1769
1771
|
- app/policies/renalware/hd/diary_policy.rb
|
1770
1772
|
- app/policies/renalware/hd/dna_session_policy.rb
|
1771
1773
|
- app/policies/renalware/hd/open_session_policy.rb
|
@@ -2140,6 +2142,10 @@ files:
|
|
2140
2142
|
- app/views/renalware/hd/current_profile/show.html.slim
|
2141
2143
|
- app/views/renalware/hd/dashboards/_page_actions.html.slim
|
2142
2144
|
- app/views/renalware/hd/dashboards/show.html.slim
|
2145
|
+
- app/views/renalware/hd/dialysates/_form.html.slim
|
2146
|
+
- app/views/renalware/hd/dialysates/edit.html.slim
|
2147
|
+
- app/views/renalware/hd/dialysates/index.html.slim
|
2148
|
+
- app/views/renalware/hd/dialysates/new.html.slim
|
2143
2149
|
- app/views/renalware/hd/dialysers/_form.html.slim
|
2144
2150
|
- app/views/renalware/hd/dialysers/edit.html.slim
|
2145
2151
|
- app/views/renalware/hd/dialysers/index.html.slim
|
@@ -3264,6 +3270,8 @@ files:
|
|
3264
3270
|
- db/migrate/20180511171835_create_unique_indexes_on_obr_obr_codes.rb
|
3265
3271
|
- db/migrate/20180514151627_create_system_messages.rb
|
3266
3272
|
- db/migrate/20180516111411_create_view_patient_current_modalities.rb
|
3273
|
+
- db/migrate/20180524072633_add_columns_to_dialysates.rb
|
3274
|
+
- db/migrate/20180524074320_add_columns_to_hd_dialysers.rb
|
3267
3275
|
- db/migrate/20180605114332_create_pseudo_encrypt_function.rb
|
3268
3276
|
- db/migrate/20180605141806_add_external_id_to_research_study_participants.rb
|
3269
3277
|
- db/migrate/20180605175211_add_application_url_to_research_studies.rb
|