renalware-core 2.0.137 → 2.0.138
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/renalware/icons/home.svg +1 -0
- data/app/assets/images/renalware/icons/settings.svg +1 -0
- data/app/assets/javascripts/renalware/components/hd.js +0 -109
- data/app/assets/javascripts/renalware/components/toggler.js +0 -29
- data/app/assets/javascripts/renalware/core.js.erb +5 -1
- data/app/assets/javascripts/renalware/rollup_compiled.js +3888 -0
- data/app/assets/stylesheets/renalware/modules/_hd.scss +40 -17
- data/app/assets/stylesheets/renalware/partials/_dashboards.scss +1 -1
- data/app/assets/stylesheets/renalware/partials/_modal_window.scss +1 -0
- data/app/assets/stylesheets/renalware/partials/_navigation.scss +45 -2
- data/app/assets/stylesheets/renalware/partials/_pagination.scss +21 -0
- data/app/assets/stylesheets/renalware/partials/_tables.scss +9 -0
- data/app/assets/stylesheets/renalware/protocol_pdf.scss +45 -6
- data/app/components/renalware/application_component.rb +1 -1
- data/app/components/renalware/hd/administer_prescription_dropdown_component.html.slim +22 -0
- data/app/components/renalware/hd/administer_prescription_dropdown_component.rb +22 -0
- data/app/components/renalware/hd/prescription_last_administration_component.html.slim +6 -0
- data/app/components/renalware/hd/prescription_last_administration_component.rb +19 -0
- data/app/components/renalware/letters/letters_in_progress_component.html.slim +1 -1
- data/app/components/renalware/system/admin_menu_component.html.slim +25 -0
- data/app/components/renalware/system/admin_menu_component.rb +56 -0
- data/app/components/renalware/system/users_awaiting_approval_component.html.slim +6 -0
- data/app/components/renalware/system/users_awaiting_approval_component.rb +25 -0
- data/app/controllers/renalware/admin/dashboards_controller.rb +9 -0
- data/app/controllers/renalware/hd/base_controller.rb +4 -0
- data/app/controllers/renalware/hd/prescription_administrations_controller.rb +87 -0
- data/app/controllers/renalware/hd/sessions_controller.rb +6 -44
- data/app/controllers/renalware/hd/transmission_logs_controller.rb +7 -6
- data/app/controllers/renalware/hd/witnesses_controller.rb +62 -0
- data/app/helpers/renalware/application_helper.rb +1 -0
- data/app/helpers/renalware/layout_helper.rb +12 -0
- data/app/helpers/renalware/toggle_helper.rb +13 -4
- data/app/javascript/renalware/controllers/another_test_controller.js +8 -0
- data/app/javascript/renalware/controllers/hd/prescription_administration_controller.js +22 -0
- data/app/javascript/renalware/controllers/test_controller.js +8 -0
- data/app/javascript/renalware/controllers/toggle_controller.js +36 -0
- data/app/javascript/renalware/index.js +25 -0
- data/app/models/renalware/hd/patient.rb +1 -0
- data/app/models/renalware/hd/prescription_administration.rb +57 -33
- data/app/models/renalware/hd/prescription_last_administration_query.rb +29 -0
- data/app/models/renalware/hd/sessions/save_session.rb +1 -25
- data/app/models/renalware/hd/witness_form.rb +31 -0
- data/app/policies/renalware/hd/prescription_administration_policy.rb +8 -0
- data/app/presenters/renalware/admin/users/{summary_part.rb → summary_part.rb.dead} +0 -0
- data/app/presenters/renalware/hd/dashboard_presenter.rb +16 -7
- data/app/views/renalware/accesses/plans/_details.html.slim +1 -1
- data/app/views/renalware/admin/cache/show.html.slim +1 -1
- data/app/views/renalware/admin/dashboards/show.html.slim +4 -0
- data/app/views/renalware/admin/users/{_summary_part.html.slim → _summary_part.html.slim.dead} +1 -1
- data/app/views/renalware/admin/users/edit.html.slim +1 -1
- data/app/views/renalware/admin/users/index.html.slim +1 -1
- data/app/views/renalware/admissions/_summary_part.html.slim +5 -4
- data/app/views/renalware/admissions/consults/_summary_part.html.slim +7 -7
- data/app/views/renalware/dashboard/dashboards/_content.html.slim +5 -5
- data/app/views/renalware/drugs/drugs/edit.html.slim +2 -2
- data/app/views/renalware/drugs/drugs/index.html.slim +1 -1
- data/app/views/renalware/drugs/drugs/new.html.slim +1 -1
- data/app/views/renalware/events/types/edit.html.slim +1 -1
- data/app/views/renalware/events/types/index.html.slim +1 -1
- data/app/views/renalware/events/types/new.html.slim +1 -1
- data/app/views/renalware/hd/cannulation_types/edit.html.slim +1 -1
- data/app/views/renalware/hd/cannulation_types/index.html.slim +5 -5
- data/app/views/renalware/hd/cannulation_types/new.html.slim +1 -1
- data/app/views/renalware/hd/dashboards/_page_actions.html.slim +4 -1
- data/app/views/renalware/hd/dashboards/show.html.slim +1 -0
- data/app/views/renalware/hd/dialysates/edit.html.slim +1 -1
- data/app/views/renalware/hd/dialysates/index.html.slim +1 -1
- data/app/views/renalware/hd/dialysates/new.html.slim +1 -1
- data/app/views/renalware/hd/dialysers/edit.html.slim +1 -1
- data/app/views/renalware/hd/dialysers/index.html.slim +4 -5
- data/app/views/renalware/hd/dialysers/new.html.slim +1 -1
- data/app/views/renalware/hd/prescription_administrations/_form.html.slim +96 -0
- data/app/views/renalware/hd/prescription_administrations/_row.html.slim +25 -0
- data/app/views/renalware/hd/prescription_administrations/_table.html.slim +8 -0
- data/app/views/renalware/hd/prescription_administrations/_thead.html.slim +11 -0
- data/app/views/renalware/hd/prescription_administrations/create.js.erb +4 -0
- data/app/views/renalware/hd/prescription_administrations/edit.html.slim +5 -0
- data/app/views/renalware/hd/prescription_administrations/edit.js.erb +11 -0
- data/app/views/renalware/hd/prescription_administrations/index.html.slim +3 -0
- data/app/views/renalware/hd/prescription_administrations/new.html.slim +3 -0
- data/app/views/renalware/hd/prescription_administrations/new.js.erb +5 -0
- data/app/views/renalware/hd/protocols/_allergies.html.slim +3 -0
- data/app/views/renalware/hd/protocols/_latest_dry_weight.html.slim +3 -2
- data/app/views/renalware/hd/protocols/_prescriptions.html.slim +15 -7
- data/app/views/renalware/hd/protocols/_profile.html.slim +12 -12
- data/app/views/renalware/hd/protocols/_protocol.pdf.slim +2 -3
- data/app/views/renalware/hd/sessions/_form.html.slim +2 -6
- data/app/views/renalware/hd/sessions/_index_tabs.html.slim +11 -0
- data/app/views/renalware/hd/sessions/_list.html.slim +21 -1
- data/app/views/renalware/hd/sessions/_table.html.slim +1 -18
- data/app/views/renalware/hd/sessions/closed/_form.html.slim +1 -2
- data/app/views/renalware/hd/sessions/edit.html.slim +1 -2
- data/app/views/renalware/hd/sessions/new.html.slim +1 -2
- data/app/views/renalware/hd/sessions/open/_form.html.slim +1 -2
- data/app/views/renalware/hd/transmission_logs/index.html.slim +2 -2
- data/app/views/renalware/hd/witnesses/_form.html.slim +49 -0
- data/app/views/renalware/hd/witnesses/edit.html.slim +1 -0
- data/app/views/renalware/hd/witnesses/edit.js.erb +3 -0
- data/app/views/renalware/hd/witnesses/update.js.erb +4 -0
- data/app/views/renalware/layouts/_admin.html.slim +28 -0
- data/app/views/renalware/layouts/_patient.html.slim +1 -1
- data/app/views/renalware/letters/batches/index.html.slim +1 -1
- data/app/views/renalware/letters/letters/_letter.html.slim +1 -1
- data/app/views/renalware/modalities/descriptions/edit.html.slim +1 -1
- data/app/views/renalware/modalities/descriptions/index.html.slim +1 -1
- data/app/views/renalware/modalities/descriptions/new.html.slim +1 -1
- data/app/views/renalware/navigation/_admin.html.slim +1 -1
- data/app/views/renalware/navigation/_menu.html.slim +7 -6
- data/app/views/renalware/navigation/_user.html.slim +3 -4
- data/app/views/renalware/pathology/observation_requests/_filters.html.slim +1 -1
- data/app/views/renalware/pathology/requests/requests/index.html.slim +1 -1
- data/app/views/renalware/pathology/requests/rules/index.html.slim +1 -1
- data/app/views/renalware/patients/_layout.html.slim +1 -1
- data/app/views/renalware/patients/_summary_part.html.slim +1 -1
- data/app/views/renalware/patients/primary_care_physicians/edit.html.slim +1 -1
- data/app/views/renalware/patients/primary_care_physicians/index.html.slim +3 -5
- data/app/views/renalware/patients/primary_care_physicians/new.html.slim +1 -1
- data/app/views/renalware/pd/bag_types/edit.html.slim +1 -1
- data/app/views/renalware/pd/bag_types/index.html.slim +1 -1
- data/app/views/renalware/pd/bag_types/new.html.slim +1 -1
- data/app/views/renalware/problems/problems/_summary_part.html.slim +1 -1
- data/app/views/renalware/research/study_participants/index.html.slim +2 -3
- data/app/views/renalware/surveys/_pos_s_summary_part.html.slim +2 -1
- data/app/views/renalware/system/email_templates/index.html.slim +5 -1
- data/app/views/renalware/system/messages/edit.html.slim +1 -1
- data/app/views/renalware/system/messages/index.html.slim +1 -1
- data/app/views/renalware/system/messages/new.html.slim +1 -1
- data/app/views/renalware/system/user_feedback/edit.html.slim +1 -1
- data/app/views/renalware/system/user_feedback/index.html.slim +1 -1
- data/app/views/renalware/transplants/mdm/_bottom.html.slim +1 -1
- data/config/initializers/pagy.rb +9 -0
- data/config/locales/renalware/hd/dashboards.en.yml +1 -0
- data/config/locales/renalware/hd/session.en.yml +2 -1
- data/config/routes/admin.rb +1 -0
- data/config/routes/hd.rb +9 -0
- data/db/migrate/20190627141751_add_tokens_to_hd_prescription_administrations.rb +0 -2
- data/db/migrate/20200204153231_alter_hd_prescription_administrations.rb +18 -0
- data/db/seeds/default/accesses/access_pd_catheter_insertion_techniques.rb +0 -1
- data/db/seeds/default/accesses/access_plan_types.rb +0 -1
- data/db/seeds/default/accesses/access_sites.rb +0 -1
- data/db/seeds/default/clinics/clinics.rb +0 -1
- data/db/seeds/default/events/event_types.rb +0 -1
- data/db/seeds/default/hd/cannulation_types.rb +0 -1
- data/db/seeds/default/hd/dialysers.rb +0 -1
- data/db/seeds/default/modalities/reasons.rb +19 -19
- data/db/seeds/default/pathology/measurement_units.rb +0 -1
- data/db/seeds/default/patients/patients_ethnicities.rb +0 -1
- data/db/seeds/default/patients/patients_languages.rb +1 -0
- data/db/seeds/default/patients/patients_religions.rb +0 -1
- data/db/seeds/default/pd/bag_types.rb +0 -1
- data/db/seeds/default/pd/organisms.rb +0 -1
- data/db/seeds/default/pd/systems.rb +0 -1
- data/db/seeds/default/pd/training_sites.rb +0 -1
- data/db/seeds/default/pd/training_types.rb +0 -1
- data/db/seeds/default/practices/practices.rb +2 -2
- data/db/seeds/default/practices/primary_care_physicians.rb +1 -2
- data/db/seeds/default/renal/prd_descriptions.rb +1 -0
- data/db/seeds/default/system/roles.rb +1 -1
- data/lib/renalware/engine.rb +1 -0
- data/lib/renalware/version.rb +1 -1
- data/spec/factories/hd/prescription_administrations.rb +17 -0
- data/spec/support/factory_bot.rb +2 -0
- data/spec/support/pages/hd/prescription_administration_dialog.rb +132 -0
- metadata +62 -12
- data/app/assets/javascripts/renalware/components/bla.es6 +0 -1
- data/app/controllers/renalware/hd/prescription_administration_authorisations_controller.rb +0 -27
- data/app/javascript/controllers/clipboard_controller.js.dead +0 -16
- data/app/views/renalware/hd/sessions/_administered_drugs_row.html.slim +0 -27
- data/app/views/renalware/hd/sessions/_administered_drugs_thead.html.slim +0 -11
- data/app/views/renalware/hd/sessions/_prescription_administrations.html.slim +0 -20
- data/app/views/renalware/hd/sessions/closed/_administered_drugs_row.html.slim +0 -3
- data/app/views/renalware/hd/sessions/form/_drugs_to_be_administered.html.slim +0 -84
@@ -7,8 +7,7 @@
|
|
7
7
|
= content_for(:tabs) do
|
8
8
|
= render "renalware/research/studies/tabs", study: study
|
9
9
|
|
10
|
-
= within_admin_layout(
|
11
|
-
|
12
|
-
breadcrumbs: breadcrumb_for("Clinical Studies", research_studies_path)) do
|
10
|
+
= within_admin_layout(title: study.code,
|
11
|
+
breadcrumbs: breadcrumb_for("Clinical Studies", research_studies_path)) do
|
13
12
|
|
14
13
|
= render "table", study: study, participants: participants, query: query
|
@@ -19,7 +19,7 @@
|
|
19
19
|
br
|
20
20
|
br
|
21
21
|
.xsss
|
22
|
-
table.table-header-rotated.toggleable
|
22
|
+
table.table-header-rotated.toggleable(data-controller="toggle")
|
23
23
|
thead
|
24
24
|
tr
|
25
25
|
th.togglers= rows_toggler
|
@@ -49,6 +49,7 @@
|
|
49
49
|
= value
|
50
50
|
tr
|
51
51
|
td
|
52
|
+
|
|
52
53
|
td
|
53
54
|
td
|
54
55
|
td(class="summary-part--pos_s-patient-question-text" colspan=(pos_s_summary_part.question_labels.count ))
|
@@ -1,4 +1,4 @@
|
|
1
|
-
=
|
1
|
+
= within_new_admin_layout(title: "System Email Templates") do
|
2
2
|
|
3
3
|
.panel
|
4
4
|
p Listed below are previews of the email templates sent by this application.
|
@@ -9,3 +9,7 @@
|
|
9
9
|
|
10
10
|
dt= link_to "User Reactivated Email", "/rails/mailers/renalware/admin/user_mailer/unexpiry"
|
11
11
|
dd Sent when an administrator reactivates a deactivated user.
|
12
|
+
|
13
|
+
/ You can remove this
|
14
|
+
.xxx(data-controller="test")
|
15
|
+
.xxx(data-controller="another_test")
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# See here for all options: https://github.com/ddnexus/pagy/blob/master/lib/config/pagy.rb
|
5
|
+
#
|
6
|
+
|
7
|
+
# Foundation extra: Add nav, nav_js and combo_nav_js helpers and templates for Foundation pagination
|
8
|
+
# See https://ddnexus.github.io/pagy/extras/foundation
|
9
|
+
require "pagy/extras/foundation"
|
@@ -196,7 +196,8 @@ en:
|
|
196
196
|
add_dna_session: Add DNA Session
|
197
197
|
add: Add Session
|
198
198
|
add_dna: Add DNA Session
|
199
|
-
view_all: View All
|
199
|
+
view_all: View All Sessions
|
200
|
+
view_all_drugs_given: View All Drugs Given
|
200
201
|
missing_profile_message: |
|
201
202
|
Please enter the HD Profile before creating sessions
|
202
203
|
row:
|
data/config/routes/admin.rb
CHANGED
data/config/routes/hd.rb
CHANGED
@@ -16,6 +16,7 @@ resources :patients, only: [] do
|
|
16
16
|
only: [:index, :show],
|
17
17
|
path: "/profiles/historical"
|
18
18
|
resources :sessions
|
19
|
+
resources :prescription_administrations, only: :index
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
@@ -25,6 +26,14 @@ namespace :hd do
|
|
25
26
|
get "patients_dialysing_at_hospital" => "patients#dialysing_at_hospital"
|
26
27
|
end
|
27
28
|
|
29
|
+
resources :prescriptions, only: [] do
|
30
|
+
resources :administrations,
|
31
|
+
only: %i(new create edit update),
|
32
|
+
controller: "prescription_administrations"
|
33
|
+
end
|
34
|
+
resources :prescription_administration, only: [] do
|
35
|
+
resource :witness, only: [:edit, :update]
|
36
|
+
end
|
28
37
|
resources :prescription_administration_authorisations, only: :create
|
29
38
|
resources :transmission_logs, only: [:show, :index]
|
30
39
|
resources :cannulation_types, except: :show
|
@@ -1,8 +1,6 @@
|
|
1
1
|
class AddTokensToHDPrescriptionAdministrations < ActiveRecord::Migration[5.2]
|
2
2
|
def change
|
3
3
|
within_renalware_schema do
|
4
|
-
# add_column :hd_prescription_administrations, :administrator_authorisation_token, :string
|
5
|
-
# add_column :hd_prescription_administrations, :witness_authorisation_token, :string
|
6
4
|
add_column(
|
7
5
|
:hd_prescription_administrations,
|
8
6
|
:administrator_authorised,
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class AlterHDPrescriptionAdministrations < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
within_renalware_schema do
|
4
|
+
# Allow HD session if to be null, now that we are allowing HD drugs to be
|
5
|
+
# administered before the HD session is created, so there may be no
|
6
|
+
# associated session
|
7
|
+
change_column_null :hd_prescription_administrations, :hd_session_id, true
|
8
|
+
add_reference(
|
9
|
+
:hd_prescription_administrations,
|
10
|
+
:patient,
|
11
|
+
foreign_key: { to_table: :patients },
|
12
|
+
index: true,
|
13
|
+
null: true # old data will not have one
|
14
|
+
)
|
15
|
+
add_column :hd_prescription_administrations, :recorded_on, :date, null: true
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -3,28 +3,28 @@
|
|
3
3
|
module Renalware
|
4
4
|
module Modalities
|
5
5
|
log "Adding PD To Haemodialysis (Reasons for Change)" do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 201, description: "Patient/partner choice")
|
7
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 202, description: "Loss of supporting partner")
|
8
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 203, description: "Other change of personal circumstances")
|
9
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 204, description: "Inability to perform PD")
|
10
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 205, description: "Other reasons")
|
11
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 211, description: "Frequent/Recurrent peritonitis with or without loss of UF")
|
12
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 212, description: "Unresolving peritonitis")
|
13
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 213, description: "Catheter loss through exit site infection")
|
14
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 214, description: "Loss of UF")
|
15
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 215, description: "Inadequate clearance")
|
16
|
+
PDToHaemodialysis.find_or_create_by!(rr_code: 216, description: "Abdominal surgery or complications")
|
17
17
|
end
|
18
18
|
|
19
19
|
log "Adding Haemodialysis To PD (Reasons for Change)" do
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
HaemodialysisToPD.find_or_create_by!(rr_code: 221, description: "Patient/partner choice")
|
21
|
+
HaemodialysisToPD.find_or_create_by!(rr_code: 222, description: "Loss of supporting partner")
|
22
|
+
HaemodialysisToPD.find_or_create_by!(rr_code: 223, description: "Other change of personal circumstances")
|
23
|
+
HaemodialysisToPD.find_or_create_by!(rr_code: 224, description: "Lack of HD facilities")
|
24
|
+
HaemodialysisToPD.find_or_create_by!(rr_code: 225, description: "Other reasons")
|
25
|
+
HaemodialysisToPD.find_or_create_by!(rr_code: 231, description: "Loss of vascular access")
|
26
|
+
HaemodialysisToPD.find_or_create_by!(rr_code: 232, description: "Haemodynamic instability")
|
27
|
+
HaemodialysisToPD.find_or_create_by!(rr_code: 233, description: "Elective after temporary HD")
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -4,11 +4,11 @@ module Renalware
|
|
4
4
|
log "Adding NHS Practices\n" do
|
5
5
|
sample_status = "SAMPLE ONLY"
|
6
6
|
Patients::Practice.transaction do
|
7
|
-
#NOTE: use '_sample' file for demo/devel
|
7
|
+
# NOTE: use '_sample' file for demo/devel
|
8
8
|
CSV.foreach(File.join(File.dirname(__FILE__), "nhs_practices_sample.csv"), headers: true) do |row|
|
9
9
|
practice = Patients::Practice.find_or_initialize_by(code: row["code"])
|
10
10
|
practice.name = row["name"]
|
11
|
-
|
11
|
+
if practice.address.blank?
|
12
12
|
practice.build_address(
|
13
13
|
organisation_name: row["name"],
|
14
14
|
postcode: row["postcode"],
|
@@ -1,11 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Renalware
|
4
|
-
|
5
4
|
log "Adding Primary Care Physicians\n" do
|
6
5
|
sample_status = "SAMPLE ONLY"
|
7
6
|
file_path = File.join(File.dirname(__FILE__), "primary_care_physicians_sample.csv")
|
8
|
-
#"id","practice_code","gp_code","name","practice_id"
|
7
|
+
# "id","practice_code","gp_code","name","practice_id"
|
9
8
|
|
10
9
|
CSV.foreach(file_path, headers: true) do |row|
|
11
10
|
practice_id = row["practice_id"].to_i
|
data/lib/renalware/engine.rb
CHANGED
data/lib/renalware/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
FactoryBot.define do
|
4
|
+
factory :hd_prescription_administration, class: "Renalware::HD::PrescriptionAdministration" do
|
5
|
+
accountable
|
6
|
+
patient
|
7
|
+
prescription
|
8
|
+
association :administered_by, factory: :user
|
9
|
+
administrator_authorised { true }
|
10
|
+
association :witnessed_by, factory: :user
|
11
|
+
witness_authorised { true }
|
12
|
+
administered { true }
|
13
|
+
notes { "some notes" }
|
14
|
+
deleted_at { nil }
|
15
|
+
recorded_on { Time.zone.today }
|
16
|
+
end
|
17
|
+
end
|