renalware-core 2.0.44 → 2.0.45

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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/renalware/application.scss +1 -0
  3. data/app/assets/stylesheets/renalware/modules/_clinical.scss +3 -1
  4. data/app/assets/stylesheets/renalware/modules/_patients.scss +0 -1
  5. data/app/assets/stylesheets/renalware/modules/_snippets.scss +3 -1
  6. data/app/assets/stylesheets/renalware/partials/_button.scss +6 -2
  7. data/app/assets/stylesheets/renalware/partials/_tables.scss +1 -1
  8. data/app/assets/stylesheets/renalware/partials/_tabs.scss +3 -1
  9. data/app/assets/stylesheets/renalware/table_pdf.scss +1 -1
  10. data/app/controllers/renalware/clinics/appointments_controller.rb +1 -3
  11. data/app/controllers/renalware/clinics/visits_controller.rb +2 -5
  12. data/app/controllers/renalware/patients/worryboard_controller.rb +2 -4
  13. data/app/controllers/renalware/renal/aki_alerts_controller.rb +2 -7
  14. data/app/documents/renalware/dated_confirmation.rb +1 -1
  15. data/app/documents/renalware/transplants/recipient_operation_document.rb +1 -1
  16. data/app/helpers/renalware/drugs_helper.rb +6 -3
  17. data/app/helpers/renalware/primary_care_physicians_helper.rb +3 -1
  18. data/app/jobs/refresh_materialized_view_job.rb +20 -0
  19. data/app/jobs/renalware/hd/generate_monthly_statistics.rb +3 -0
  20. data/app/mailers/renalware/previews/report_preview.rb +14 -0
  21. data/app/mailers/renalware/reporting/report_mailer.rb +57 -0
  22. data/app/models/concerns/renalware/broadcasting.rb +28 -4
  23. data/app/models/renalware/patients/worry_query.rb +0 -2
  24. data/app/models/renalware/renal/aki_alert_search_form.rb +1 -3
  25. data/app/models/renalware/ukrdc/send_patients.rb +25 -1
  26. data/app/models/renalware/ukrdc/transmission_log.rb +1 -1
  27. data/app/presenters/renalware/ukrdc/patient_presenter.rb +1 -1
  28. data/app/views/renalware/admin/users/index.html.slim +2 -2
  29. data/app/views/renalware/admissions/consults/index.html.slim +1 -1
  30. data/app/views/renalware/admissions/requests/_create_request_link.html.slim +1 -1
  31. data/app/views/renalware/admissions/requests/_request.html.slim +2 -2
  32. data/app/views/renalware/base/_modality_missing_warning.html.slim +1 -1
  33. data/app/views/renalware/clinical/allergies/_mini.html.slim +1 -1
  34. data/app/views/renalware/clinics/appointments/index.html.slim +3 -3
  35. data/app/views/renalware/hd/dashboards/_page_actions.html.slim +3 -3
  36. data/app/views/renalware/hd/diaries/edit.html.slim +2 -2
  37. data/app/views/renalware/hd/diaries/index.html.slim +1 -1
  38. data/app/views/renalware/hd/stations/_station.html.slim +1 -1
  39. data/app/views/renalware/letters/electronic_receipts/_table.html.slim +1 -1
  40. data/app/views/renalware/letters/lists/_letter.html.slim +1 -1
  41. data/app/views/renalware/low_clearance/dashboards/_page_actions.html.slim +2 -2
  42. data/app/views/renalware/mdm/_top_navigation.html.slim +1 -1
  43. data/app/views/renalware/medications/prescriptions/index.html.slim +1 -1
  44. data/app/views/renalware/messaging/internal/messages/_send_message_link.html.slim +1 -1
  45. data/app/views/renalware/messaging/internal/messages/_send_reply_link.html.slim +1 -1
  46. data/app/views/renalware/messaging/internal/receipts/_receipt.html.slim +1 -1
  47. data/app/views/renalware/navigation/_patient_search.html.slim +1 -1
  48. data/app/views/renalware/navigation/_user.html.slim +1 -1
  49. data/app/views/renalware/patients/_header.html.slim +2 -2
  50. data/app/views/renalware/patients/alerts/_alert.html.slim +2 -2
  51. data/app/views/renalware/patients/alerts/_create_alert_link.html.slim +1 -1
  52. data/app/views/renalware/patients/bookmarks/_delete.html.slim +5 -4
  53. data/app/views/renalware/patients/bookmarks/_new.html.slim +1 -1
  54. data/app/views/renalware/patients/patients/_patient.html.slim +2 -2
  55. data/app/views/renalware/patients/worries/_delete.html.slim +1 -1
  56. data/app/views/renalware/patients/worries/_new.html.slim +1 -1
  57. data/app/views/renalware/pd/dashboards/show/_page_actions.html.slim +4 -4
  58. data/app/views/renalware/pd/exit_site_infections/show.html.slim +1 -1
  59. data/app/views/renalware/pd/peritonitis_episodes/show.html.slim +1 -1
  60. data/app/views/renalware/problems/problems/_current_table.html.slim +1 -1
  61. data/app/views/renalware/renal/aki_alerts/index.html.slim +1 -1
  62. data/app/views/renalware/reporting/report_mailer/daily_summary.html.slim +14 -0
  63. data/app/views/renalware/reporting/report_mailer/daily_summary.text.erb +15 -0
  64. data/app/views/renalware/research/_alert.html.slim +2 -2
  65. data/app/views/renalware/shared/_modal_close_link.html.slim +1 -1
  66. data/app/views/renalware/snippets/snippets/_list.html.slim +2 -2
  67. data/app/views/renalware/snippets/snippets/_search_form.html.slim +1 -1
  68. data/app/views/renalware/transplants/live_donors/_filters.html.slim +1 -1
  69. data/app/views/renalware/transplants/recipient_dashboards/_modality_missing_warning.html.slim +1 -1
  70. data/app/views/renalware/transplants/recipient_dashboards/_page_actions.html.slim +1 -1
  71. data/config/gpg/renalware_test.gpg +0 -0
  72. data/config/initializers/ransack.rb +1 -1
  73. data/config/initializers/renalware.rb +20 -2
  74. data/config/locales/renalware/reporting/reporting_daily.en.yml +7 -0
  75. data/config/locales/renalware/virology/virology.en.yml +1 -0
  76. data/db/migrate/20180831134606_add_reporting_indexes.rb +13 -0
  77. data/db/migrate/20180831134926_create_daily_reports.rb +6 -0
  78. data/db/seeds/default/reporting/audits.yml +1 -2
  79. data/db/views/reporting_daily_letters_v01.sql +3 -0
  80. data/db/views/reporting_daily_pathology_v01.sql +16 -0
  81. data/lib/gpg_encrypt_folder.rb +74 -0
  82. data/lib/renalware/configuration.rb +5 -0
  83. data/lib/renalware/engine.rb +5 -4
  84. data/lib/renalware/version.rb +1 -1
  85. data/lib/tasks/audit.rake +5 -0
  86. data/lib/tasks/reporting.rake +9 -0
  87. metadata +43 -16
@@ -25,7 +25,7 @@ module Renalware
25
25
  def self.formatted_exception(error)
26
26
  [
27
27
  "#{error.backtrace.first}: #{error.message} (#{error.class})",
28
- error.backtrace.drop(1).map{ |s| "\t#{s}" }
28
+ error.backtrace.drop(1).map{ |line| "\t#{line}" }
29
29
  ].join("\n")
30
30
  end
31
31
  end
@@ -51,7 +51,7 @@ module Renalware
51
51
  CollectionPresenter.new(
52
52
  letters_patient
53
53
  .letters
54
- .approved
54
+ .approved_or_completed
55
55
  .where("updated_at > ?", changes_since),
56
56
  Renalware::Letters::LetterPresenterFactory
57
57
  )
@@ -35,9 +35,9 @@
35
35
  span.tag(class=role.name)= role.name.humanize
36
36
  td.approved
37
37
  - if user.approved?
38
- i.fa.fa-check-square-o
38
+ i.far.fa-check-square
39
39
  - else
40
- i.unapproved.fa.fa-square-o
40
+ i.unapproved.far.fa-square
41
41
  td.expired= l(user.expired_at&.to_date)
42
42
  td.show-for-large-up= l(user.current_sign_in_at)
43
43
  td.show-for-large-up= l(user.last_sign_in_at)
@@ -3,7 +3,7 @@
3
3
  = content_for(:actions) do
4
4
  = link_to("Add", new_admissions_consult_path, class: :button)
5
5
  = link_to(admissions_consults_path(q: params[:q]&.permit!, format: :pdf), class: "button secondary") do
6
- i.fa.fa-print
6
+ i.fas.fa-print
7
7
  | Print (PDF)
8
8
  /data: { target: admissions_consults_path(format: :pdf)
9
9
 
@@ -7,5 +7,5 @@
7
7
  id: "create-admissions-request",
8
8
  data: { "reveal-id" => "admissions-request-modal", "reveal-ajax" => "true" }) do
9
9
  - if local_assigns.fetch(:use_icon, true)
10
- i.fa.fa-link-annotation.fa-hand-o-right
10
+ i.far.fa-link-annotation.fa-hand-point-right
11
11
  = link_text
@@ -23,7 +23,7 @@ ruby:
23
23
  method: :delete,
24
24
  class: "remove",
25
25
  data: { confirm: "Are you sure you want to remove this item?" } do
26
- i.fa.fa-trash.fa-link-annotation
26
+ i.fas.fa-trash.fa-link-annotation
27
27
  |  |  
28
28
  = link_to "Edit",
29
29
  edit_admissions_request_path(request, format: :html),
@@ -31,4 +31,4 @@ ruby:
31
31
  method: :get,
32
32
  data: { "reveal-id" => "admissions-request-modal", "reveal-ajax" => "true" }
33
33
  td.handle
34
- i.fa.fa-reorder
34
+ i.fas.fa-bars
@@ -1,3 +1,3 @@
1
1
  li.missing-modality-warning
2
- i.fa.fa-info
2
+ i.fas.fa-info
3
3
  span= message
@@ -4,7 +4,7 @@
4
4
  .allergies
5
5
  dl
6
6
  dt
7
- span.fa.fa-warning
7
+ span.fas.fa-exclamation-triangle
8
8
  span.allergy_status
9
9
  = link_to "Allergies:", patient_clinical_profile_path(patient)
10
10
  dd
@@ -27,7 +27,7 @@
27
27
 
28
28
  = f.input :patient_ids, as: :hidden_array
29
29
  = button_tag(type: "submit", class: "button secondary") do
30
- i.fa.fa-files-o
30
+ i.fas.fa-copy
31
31
  | Generate request forms
32
32
 
33
33
  table#appointments
@@ -63,13 +63,13 @@
63
63
  - if appointment.becomes_visit_id.present?
64
64
  = link_to edit_patient_clinic_visit_path(appointment.patient,
65
65
  id: appointment.becomes_visit_id) do
66
- i.fa.fa-file-o
66
+ i.fas.fa-file
67
67
  |   
68
68
  | View Clinic Visit
69
69
  - else
70
70
  = link_to new_patient_clinic_visit_path(appointment.patient,
71
71
  appointment_id: appointment.id) do
72
- i.fa.fa-pencil
72
+ i.fas.fa-pencil-alt
73
73
  |   
74
74
  | Create Clinic Visit
75
75
 
@@ -1,14 +1,14 @@
1
1
  = link_to(patient_hd_mdm_path(patient), class: "button with-icon secondary") do
2
- i.fa.fa-group
2
+ i.fas.fa-users
3
3
  = t(".mdm")
4
4
  = link_to(patient_hd_protocol_path(patient), class: "button with-icon secondary") do
5
- i.fa.fa-print
5
+ i.fas.fa-print
6
6
  = t(".protocol")
7
7
  a.button.dropdown.with-icon(href="#"
8
8
  data-dropdown="pd-options"
9
9
  aria-controls="pd-options"
10
10
  aria-expanded="false")
11
- i.fa.fa-plus
11
+ i.fas.fa-plus
12
12
  | Add
13
13
  br
14
14
  ul.f-dropdown#pd-options(data-dropdown-content aria-hidden="true")
@@ -9,11 +9,11 @@
9
9
 
10
10
  .diary__navigation
11
11
  = link_to hd_unit_edit_diary_path(**diary.week.previous.to_h), class: "button secondary" do
12
- i.fa.fa-arrow-left
12
+ i.fas.fa-arrow-left
13
13
  | Previous week
14
14
 
15
15
  = link_to hd_unit_edit_diary_path(**diary.week.next.to_h), class: "button secondary" do
16
- i.fa.fa-arrow-right
16
+ i.fas.fa-arrow-right
17
17
  | Next week
18
18
 
19
19
  .diary__key
@@ -1,7 +1,7 @@
1
1
  = content_for(:actions) do
2
2
  = render "page_actions", unit: unit
3
3
  li.warning-block
4
- i.fa.fa-info
4
+ i.fas.fa-info
5
5
  span To create a new diary, view the most recent one and choose 'Next Week'
6
6
 
7
7
  = within_admin_layout(title: "HD Unit Diaries") do
@@ -3,4 +3,4 @@ tr.sortable(id="hd-station-#{station.id}")
3
3
  td= station.name
4
4
  td= station.location&.name
5
5
  td.handle
6
- i.fa.fa-reorder
6
+ i.fas.fa-bars
@@ -50,5 +50,5 @@ table.letters.electronic-ccs.has-togglable-rows
50
50
  class: "button mark-as-read",
51
51
  method: :patch,
52
52
  remote: true) do
53
- i.fa.fa-check
53
+ i.fas.fa-check
54
54
  | Mark as read
@@ -14,7 +14,7 @@ tr(class=letter.state.dasherize)
14
14
  data: { \
15
15
  "modal-url" => new_patient_letters_letter_completed_path(letter.patient, letter) \
16
16
  } do
17
- i.fa.fa-print
17
+ i.fas.fa-print
18
18
  | Print
19
19
  |   
20
20
  = link_to "Toggle",
@@ -1,12 +1,12 @@
1
1
  = link_to(patient_low_clearance_mdm_path(patient), class: "button with-icon secondary") do
2
- i.fa.fa-group
2
+ i.fas.fa-users
3
3
  = t(".mdm")
4
4
 
5
5
  a.button.dropdown.with-icon(href="#"
6
6
  data-dropdown="pd-options"
7
7
  aria-controls="pd-options"
8
8
  aria-expanded="false")
9
- i.fa.fa-plus
9
+ i.fas.fa-plus
10
10
  | Add
11
11
  br
12
12
  ul.f-dropdown#pd-options(data-dropdown-content aria-hidden="true")
@@ -1,5 +1,5 @@
1
1
  nav.top-bar.mdm-top-bar(data-topbar role="navigation")
2
2
  ul.title-area
3
3
  li.name
4
- i.fa.fa-arrow-left
4
+ i.fas.fa-arrow-left
5
5
  = link_to "Back to Patients List", :back
@@ -8,7 +8,7 @@
8
8
  treatable,
9
9
  format: :pdf),
10
10
  class: "button secondary with-icon" do
11
- i.fa.fa-print
11
+ i.fas.fa-print
12
12
  | Print
13
13
 
14
14
  = within_patient_layout(title: "Prescriptions") do
@@ -7,5 +7,5 @@
7
7
  = link_to(url,
8
8
  id: "send-patient-message",
9
9
  data: { "reveal-id" => "send-message-modal", "reveal-ajax" => "true" }) do
10
- i.fa.fa-link-annotation.fa-envelope
10
+ i.fas.fa-link-annotation.fa-envelope
11
11
  = link_text
@@ -8,5 +8,5 @@
8
8
  = link_to(url,
9
9
  data: { "reveal-id" => "send-message-modal", "reveal-ajax" => "true" },
10
10
  class: "button secondary") do
11
- i.fa.fa-link-annotation.fa-reply
11
+ i.fas.fa-link-annotation.fa-reply
12
12
  = link_text
@@ -39,5 +39,5 @@ tr(class="#{ "urgent" if message.urgent?}" id=message.html_identifier)
39
39
  class: "button mark-as-read",
40
40
  method: :patch,
41
41
  remote: true) do
42
- i.fa.fa-check
42
+ i.fas.fa-check
43
43
  | Mark as read
@@ -15,4 +15,4 @@
15
15
  class: "radius"
16
16
  .small-2.columns
17
17
  = f.button class: "button tiny postfix radius radius-right" do
18
- i.fa.fa-search
18
+ i.fas.fa-search
@@ -4,7 +4,7 @@
4
4
  class: "button secondary")
5
5
  li.has-dropdown
6
6
  = link_to dashboard_path do
7
- i.fa.fa-home
7
+ i.fas.fa-home
8
8
  |  
9
9
  = current_user.username
10
10
  ul.dropdown
@@ -11,11 +11,11 @@
11
11
  dt
12
12
  dd.back-link
13
13
  = link_to back_path do
14
- i.fa.fa-arrow-left
14
+ i.fas.fa-arrow-left
15
15
  |  Back
16
16
  dd.name.patient-menu-toggler
17
17
  a
18
- i.fa.fa-ellipsis-v
18
+ i.fas.fa-ellipsis-v
19
19
  = patient
20
20
  - if patient.hospital_identifiers.all.count > 1
21
21
  - patient.hospital_identifiers.all.each do |hospital_identifier|
@@ -1,5 +1,5 @@
1
1
  li.patient-alert(class=("urgent" if alert.urgent) id="alert-#{alert.id}")
2
- i.fa.fa-warning
2
+ i.fas.fa-exclamation-triangle
3
3
  span.title Alert:
4
4
  span.body= alert.notes
5
5
  span.author= alert.created_by.username
@@ -9,4 +9,4 @@ li.patient-alert(class=("urgent" if alert.urgent) id="alert-#{alert.id}")
9
9
  remote: true,
10
10
  method: :delete,
11
11
  data: { confirm: "Are you sure you want to remove this alert?" }) do
12
- i.fa.fa-trash-o
12
+ i.fas.fa-trash
@@ -4,5 +4,5 @@
4
4
 
5
5
  / Link to launch the modal dialog
6
6
  = link_to(url, data: { "reveal-id" => "create-alert-modal", "reveal-ajax" => "true" }) do
7
- i.fa.fa-link-annotation.fa-exclamation-circle
7
+ i.fas.fa-link-annotation.fa-exclamation-circle
8
8
  = link_text
@@ -1,4 +1,5 @@
1
- = link_to link_text,
2
- bookmark_path(bookmark),
3
- method: :delete,
4
- data: { confirm: t(".confirm") }
1
+ = link_to(bookmark_path(bookmark),
2
+ method: :delete,
3
+ data: { confirm: t(".confirm") }) do
4
+ i.fas.fa-link-annotation.fa-bookmark
5
+ = link_text
@@ -1,6 +1,6 @@
1
1
  / Link to launch the modal dialog
2
2
  = link_to("#", data: { "reveal-id" => "add-patient-bookmark-modal" }) do
3
- i.fa.fa-link-annotation.fa-bookmark-o
3
+ i.far.fa-link-annotation.fa-bookmark
4
4
  = link_text
5
5
 
6
6
  / The modal dialog
@@ -8,12 +8,12 @@ tr
8
8
  td= patient.age
9
9
  - if(patient.send_to_rpv?)
10
10
  td(title="#{patient.rpv_decision}")
11
- i.fa.fa-check
11
+ i.fas.fa-check
12
12
  -else
13
13
  td
14
14
  - if(patient.send_to_renalreg?)
15
15
  td(title="#{patient.renalreg_decision}")
16
- i.fa.fa-check
16
+ i.fas.fa-check
17
17
  -else
18
18
  td
19
19
  td= patient.current_modality
@@ -1,5 +1,5 @@
1
1
  = link_to(patient_worry_path(patient, patient.worry),
2
2
  method: :delete,
3
3
  data: { confirm: t(".confirm") }) do
4
- i.fa.fa-link-annotation.fa-flag
4
+ i.fas.fa-link-annotation.fa-flag
5
5
  = t(".title")
@@ -1,7 +1,7 @@
1
1
  / Link to launch the modal dialog
2
2
  = link_to("#",
3
3
  data: { "reveal-id" => "add-patient-worry-modal" }) do
4
- i.fa.fa-link-annotation.fa-flag-o
4
+ i.far.fa-link-annotation.fa-flag
5
5
  = t(".title")
6
6
 
7
7
  / The modal dialog
@@ -1,13 +1,13 @@
1
1
  = link_to(patient_pd_mdm_path(patient), class: "button with-icon secondary") do
2
- i.fa.fa-group
2
+ i.fas.fa-users
3
3
  = t(".mdm")
4
4
  = blank_separator
5
- = blank_separator
6
- a.button.dropdown(href="#"
5
+ a.button.dropdown.with-icon(href="#"
7
6
  data-dropdown="pd-options"
8
7
  aria-controls="pd-options"
9
8
  aria-expanded="false")
10
- | Add...
9
+ i.fas.fa-plus
10
+ | Add
11
11
  br
12
12
 
13
13
  ul.f-dropdown#pd-options(data-dropdown-content aria-hidden="true")
@@ -1,7 +1,7 @@
1
1
  = content_for(:actions) do
2
2
  = link_to(patient_pd_exit_site_infection_path(patient, exit_site_infection, format: :pdf),
3
3
  class: "button") do
4
- i.fa.fa-print
4
+ i.fas.fa-print
5
5
  |  Print
6
6
 
7
7
  = within_patient_layout(title: "Exit Site Infection",
@@ -1,7 +1,7 @@
1
1
  = content_for(:actions) do
2
2
  = link_to(patient_pd_peritonitis_episode_path(patient, peritonitis_episode, format: :pdf),
3
3
  class: "button") do
4
- i.fa.fa-print
4
+ i.fas.fa-print
5
5
  |  Print
6
6
 
7
7
  - title = "Peritonitis Episode - Diagnosed: #{l(peritonitis_episode.diagnosis_date)}"
@@ -24,4 +24,4 @@ table#current_problems.manual-stripes.auto-layout
24
24
  td= l problem.updated_on
25
25
  td= problem.created_by.full_name
26
26
  td.handle
27
- i.fa.fa-reorder
27
+ i.fas.fa-bars
@@ -4,7 +4,7 @@
4
4
  / url_for(request.filtered_parameters&.merge({format: :pdf})
5
5
  / however this seems to loose the ransack sort option in params[:q][:s]
6
6
  = link_to(renal_aki_alerts_path(q: params[:q]&.permit!, format: :pdf), class: "button secondary") do
7
- i.fa.fa-print
7
+ i.fas.fa-print
8
8
  | Print (PDF)
9
9
 
10
10
  = within_admin_layout(title: "AKI Alerts") do
@@ -0,0 +1,14 @@
1
+ h4= l(Time.zone.now)
2
+
3
+ - view_data.each do |view_name, data|
4
+ - rows = data["data"].first
5
+ h3= t(:title, scope: "renalware.reporting.#{view_name}", default: view_name)
6
+ table
7
+ - rows.each do |row|
8
+ - description = row[0]
9
+ - value = row[1]
10
+ tr
11
+ td= t(description,
12
+ scope: "renalware.reporting.#{view_name}",
13
+ default: description.humanize)
14
+ td= value
@@ -0,0 +1,15 @@
1
+ <%= l(Time.zone.now) %>
2
+
3
+ <% view_data.each do |view_name, data| %>
4
+ <% rows = data["data"].first %>
5
+ <% title = t(:title, scope: "renalware.reporting.#{view_name}", default: view_name) %>
6
+ <%= title %>
7
+ <%= "-" * title.length %>
8
+ <% rows.each do |row| %>
9
+ <% description = row[0] %>
10
+ <% value = row[1] %>
11
+ <%= t(description,scope: "renalware.reporting.#{view_name}", default: description.humanize) -%>
12
+ <%= ": #{value}" %>
13
+ <% end %>
14
+
15
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  li.patient-alert.research-study-participant
2
- i.fa.fa-warning
2
+ i.fas.fa-exclamation-triangle
3
3
  span.title= link_to(participation.study.code, research_study_participants_path(participation.study))
4
4
  span.body participant
5
5
 
@@ -8,7 +8,7 @@ li.patient-alert.research-study-participant
8
8
  - if participation.external_application_participant_url.present?
9
9
  span.external_application_link
10
10
  = link_to(participation.external_application_participant_url, target: "_blank") do
11
- i.fa.fa-external-link
11
+ i.fas.fa-external-link-alt
12
12
  | &nbsp;Launch application
13
13
 
14
14
  span.date= l(participation.joined_on)