renalware-core 2.0.0.pre.rc13 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/renalware/base/_variables.scss +3 -3
  3. data/app/assets/stylesheets/renalware/modules/_clinical.scss +107 -4
  4. data/app/assets/stylesheets/renalware/modules/_patients.scss +0 -77
  5. data/app/assets/stylesheets/renalware/partials/_layout.scss +67 -7
  6. data/app/assets/stylesheets/renalware/partials/_navigation.scss +2 -7
  7. data/app/assets/stylesheets/renalware/partials/_tables.scss +1 -1
  8. data/app/controllers/renalware/base_controller.rb +5 -0
  9. data/app/controllers/renalware/clinics/visits_controller.rb +1 -1
  10. data/app/controllers/renalware/concerns/pdf_renderable.rb +2 -1
  11. data/app/controllers/renalware/devise/sessions_controller.rb +5 -0
  12. data/app/controllers/renalware/letters/pdf_letter_cache_controller.rb +13 -0
  13. data/app/controllers/renalware/pd/regimes_controller.rb +1 -1
  14. data/app/controllers/renalware/renal/aki_alerts_controller.rb +20 -3
  15. data/app/controllers/renalware/research/studies_controller.rb +3 -1
  16. data/app/controllers/renalware/session_timeout_controller.rb +1 -1
  17. data/app/models/renalware/letters/html_renderer.rb +2 -1
  18. data/app/models/renalware/letters/pdf_letter_cache.rb +4 -1
  19. data/app/models/renalware/letters/pdf_renderer.rb +2 -1
  20. data/app/models/renalware/pathology/create_observations_grouped_by_date_table.rb +0 -3
  21. data/app/models/renalware/pathology/observations_grouped_by_date_query.rb +7 -1
  22. data/app/models/renalware/pd/apd_regime.rb +6 -0
  23. data/app/models/renalware/renal/aki_alert.rb +1 -0
  24. data/app/models/renalware/renal/aki_alert_query.rb +32 -0
  25. data/app/models/renalware/renal/aki_alert_search_form.rb +31 -0
  26. data/app/models/renalware/system/event.rb +12 -0
  27. data/app/models/renalware/system/user_feedback.rb +3 -1
  28. data/app/models/renalware/system/visit.rb +11 -0
  29. data/app/presenters/renalware/events/summary_part.rb +3 -1
  30. data/app/presenters/renalware/letters/summary_part.rb +1 -1
  31. data/app/presenters/renalware/mdm_presenter.rb +4 -1
  32. data/app/presenters/renalware/medications/summary_part.rb +2 -0
  33. data/app/presenters/renalware/problems/summary_part.rb +4 -2
  34. data/app/presenters/renalware/summary_part.rb +4 -0
  35. data/app/views/renalware/accesses/procedures/_list.html.slim +7 -5
  36. data/app/views/renalware/accesses/profiles/_list.html.slim +5 -5
  37. data/app/views/renalware/admin/cache/show.html.slim +26 -2
  38. data/app/views/renalware/devise/sessions/_warning.html.slim +7 -0
  39. data/app/views/renalware/devise/sessions/new.html.slim +15 -21
  40. data/app/views/renalware/events/events/_summary_part.html.slim +1 -1
  41. data/app/views/renalware/events/events/cell/_investigation.html.slim +0 -2
  42. data/app/views/renalware/events/events/toggled_cell/_biopsy.html.slim +1 -1
  43. data/app/views/renalware/events/events/toggled_cell/_investigation.html.slim +1 -1
  44. data/app/views/renalware/events/events/toggled_cell/_simple.html.slim +1 -1
  45. data/app/views/renalware/events/events/toggled_cell/_swab.html.slim +1 -1
  46. data/app/views/renalware/hd/cannulation_types/_form.html.slim +7 -10
  47. data/app/views/renalware/hd/cannulation_types/edit.html.slim +2 -1
  48. data/app/views/renalware/hd/cannulation_types/index.html.slim +4 -3
  49. data/app/views/renalware/hd/cannulation_types/new.html.slim +2 -1
  50. data/app/views/renalware/hd/dialysers/_form.html.slim +8 -11
  51. data/app/views/renalware/hd/dialysers/edit.html.slim +2 -1
  52. data/app/views/renalware/hd/dialysers/index.html.slim +4 -3
  53. data/app/views/renalware/hd/dialysers/new.html.slim +2 -1
  54. data/app/views/renalware/layouts/_non_patient.html.slim +14 -13
  55. data/app/views/renalware/layouts/_patient.html.slim +5 -5
  56. data/app/views/renalware/letters/_summary_part.html.slim +1 -1
  57. data/app/views/renalware/letters/letters/show.html.slim +16 -15
  58. data/app/views/renalware/medications/_summary_part.html.slim +18 -17
  59. data/app/views/renalware/modalities/reasons/index.html.slim +1 -3
  60. data/app/views/renalware/navigation/_footer.html.slim +2 -2
  61. data/app/views/renalware/navigation/_help_items.html.slim +1 -0
  62. data/app/views/renalware/navigation/_more_help_items.html.slim +1 -0
  63. data/app/views/renalware/navigation/_user.html.slim +4 -0
  64. data/app/views/renalware/pathology/requests/requests/index.html.slim +40 -42
  65. data/app/views/renalware/pathology/requests/rules/index.html.slim +15 -18
  66. data/app/views/renalware/patients/_side_menu.html.slim +0 -1
  67. data/app/views/renalware/patients/alerts/_alert.html.slim +7 -7
  68. data/app/views/renalware/patients/alerts/_list.html.slim +1 -3
  69. data/app/views/renalware/patients/alerts/create.js.erb +1 -1
  70. data/app/views/renalware/patients/alerts/destroy.js.erb +1 -1
  71. data/app/views/renalware/patients/primary_care_physicians/_form.html.slim +22 -25
  72. data/app/views/renalware/patients/primary_care_physicians/edit.html.slim +2 -1
  73. data/app/views/renalware/patients/primary_care_physicians/index.html.slim +4 -3
  74. data/app/views/renalware/patients/primary_care_physicians/new.html.slim +2 -1
  75. data/app/views/renalware/patients/side_menu/_general.html.slim +1 -1
  76. data/app/views/renalware/pd/_apd_regimes.html.slim +4 -38
  77. data/app/views/renalware/pd/_capd_regimes.html.slim +4 -45
  78. data/app/views/renalware/pd/_regimes.html.slim +32 -0
  79. data/app/views/renalware/pd/assessments/_form.html.slim +8 -5
  80. data/app/views/renalware/pd/regimes/_apd_fields.html.slim +1 -0
  81. data/app/views/renalware/pd/regimes/_apd_regime_show.html.slim +2 -0
  82. data/app/views/renalware/pd/regimes/_current_apd_regime.html.slim +3 -0
  83. data/app/views/renalware/problems/problems/_summary_part.html.slim +1 -1
  84. data/app/views/renalware/renal/aki_alerts/_filters.html.slim +25 -0
  85. data/app/views/renalware/renal/aki_alerts/index.html.slim +18 -14
  86. data/app/views/renalware/research/_alert.html.slim +6 -0
  87. data/app/views/renalware/research/_alerts.html.slim +6 -0
  88. data/app/views/renalware/research/studies/index.html.slim +2 -0
  89. data/app/views/renalware/system/email_templates/index.html.slim +7 -8
  90. data/app/views/renalware/system/user_feedback/new.html.slim +3 -7
  91. data/app/views/renalware/transplants/mdm/_pathology_cmvdna.html.slim +0 -1
  92. data/app/views/renalware/virology/vaccinations/_toggled_cell.html.slim +1 -1
  93. data/config/initializers/ahoy.rb +14 -0
  94. data/config/locales/renalware/events/investigation.en.yml +8 -0
  95. data/config/locales/renalware/patients/side_menu.en.yml +1 -1
  96. data/config/routes.rb +1 -0
  97. data/db/migrate/20180307191650_add_dwell_time_to_pd_regime.rb +5 -0
  98. data/db/migrate/20180307223111_create_system_visits_and_events.rb +44 -0
  99. data/db/migrate/20180309140316_add_unique_constraint_to_obr_requestor.rb +5 -0
  100. data/db/migrate/20180311071146_update_patient_summaries_to_version6.rb +5 -0
  101. data/db/views/patient_summaries_v06.sql +16 -0
  102. data/lib/renalware/configuration.rb +3 -0
  103. data/lib/renalware/engine.rb +1 -1
  104. data/lib/renalware/version.rb +1 -1
  105. data/spec/factories/pathology/observation_requests.rb +3 -1
  106. metadata +34 -8
  107. data/app/assets/stylesheets/renalware/patient_pages.scss +0 -43
  108. data/app/views/renalware/hd/cannulation_types/_header.html.slim +0 -5
  109. data/app/views/renalware/hd/dialysers/_header.html.slim +0 -5
  110. data/app/views/renalware/patients/primary_care_physicians/_header.html.slim +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12743efe3022797cbd71c4fb23984b44a284402082931ea9bbe3ab5a1f79e213
4
- data.tar.gz: d32c248cd4e9deeea71825ffa7b1861799ed7dfb898907f3829ddf9774b34e19
3
+ metadata.gz: 8437ff54e96c5fd1e3572a47a041a66a3509eb2af0fc6d03dd0aa317837520dd
4
+ data.tar.gz: 3246ccdebc350438ca7f44ca11dd77a50f135756e46cdbe0074ae426fb216fca
5
5
  SHA512:
6
- metadata.gz: e7bfa6f1841c58d694eaf9c1d57b82c2b4d3f457e4e7459b77c78804512811fcee100547ea07ba655f03d2b00ae108d6c823aad37e2d35240b3b6d6a94bee74f
7
- data.tar.gz: 96257b76518db3e49489cd6784faa93fb3357fb160a4f8b8da5925a583687a208029265293277465a1765849d4d65c19d3c186cc771365a0b6286e53b3e29b11
6
+ metadata.gz: 6d9a61f358ce7f94a30ea9f8b81112d545e95c12f6cebb88abda0188884b95eab2949a65c653bd8d5f03c1fe625a2cf656d8bd497b57cb872542acf88d05b921
7
+ data.tar.gz: 4bf9510629744b8727e7e3f6805a0364f27b23d243e460c3ffd3cfc9ffc2a808d1b43597e062ff0e34340202f6ca3b99d8c0516f90b36b064fe5e4a9e184bc1b
@@ -104,12 +104,12 @@ $table-border-colour: #CCC;
104
104
  $table-toggled-content-colour: #FEFFF1;
105
105
  $table-urgent-colour: $nhs-yellow;
106
106
 
107
- $footer-colour: #C0C0C0;
108
- $footer-bg-colour: #FAFAFA;
109
-
110
107
  $patient-menu-background-colour: #eeeeee;
111
108
  $menu-divider-colour: #E6E6E6;
112
109
 
110
+ $footer-colour: $patient-header-muted-color;
111
+ $footer-bg-colour:$patient-menu-background-colour;
112
+
113
113
  // Forms
114
114
  $form-hint-colour: #BBB;
115
115
  $disabled-colour: #CCC;
@@ -32,14 +32,31 @@ article.clinical-allergies {
32
32
  }
33
33
  }
34
34
 
35
+ .lozenge {
36
+ padding: .2em .3rem 0 .3rem;
35
37
 
36
- .clinical-header {
38
+ ul {
39
+ li {
40
+ padding: 0.3rem 0.3rem 0 .2rem;
41
+ border: none;
42
+ margin: 0.1rem 0.3rem 0.2rem 0;
43
+ border-radius: 0.3rem;
44
+ background-color: $light-grey;
45
+ display: inline-block;
46
+ padding: 0;
47
+ margin: 0.2rem .6rem .2rem 0
48
+ }
49
+ }
50
+ }
51
+
52
+ .clinical-header,
53
+ .research-study-participation-alerts {
37
54
  background-color: $table-border-colour;
38
- padding: .2em .2em .2em .6em;
55
+ padding: 0em .2em .2em .6em;
39
56
 
40
57
  &.lozenge {
41
58
  background-color: $white;
42
- padding: .2em .3rem;
59
+ padding: 0 .3rem .2em .3rem;
43
60
 
44
61
  ul {
45
62
  li {
@@ -59,7 +76,6 @@ article.clinical-allergies {
59
76
  }
60
77
  }
61
78
 
62
-
63
79
  ul {
64
80
  padding: 0;
65
81
  margin: 0;
@@ -104,3 +120,90 @@ article.clinical-allergies {
104
120
  }
105
121
  }
106
122
  }
123
+
124
+ .research-study-participation-alerts {
125
+ .lozenge {
126
+ ul {
127
+ li {
128
+ background-color: $nhs-pink;
129
+ color: $white;
130
+ }
131
+ }
132
+ }
133
+ }
134
+
135
+ .patient-alerts {
136
+ &.lozenge {
137
+ ul {
138
+ margin: 0;
139
+
140
+ li {
141
+ background-color: $nhs-orange;
142
+ color: $white;
143
+ margin: 0 .3rem 0 0;
144
+ display: inline-block;
145
+ padding: 0 .4rem;
146
+ margin: 0.1rem 0.3rem 0.2rem 0;
147
+
148
+ &:hover {
149
+ background-color: darken($nhs-orange, 5);
150
+ }
151
+
152
+ &:hover,
153
+ span:hover {
154
+ color: white
155
+ }
156
+
157
+ &.urgent {
158
+ background-color: $nhs-red;
159
+
160
+ &:hover {
161
+ background-color: darken($nhs-red, 5);
162
+ }
163
+ }
164
+
165
+ &.research-study-participant {
166
+ background-color: $nhs-green;
167
+
168
+ &:hover {
169
+ background-color: darken($nhs-green, 5);
170
+ }
171
+
172
+ a {
173
+ color: $white;
174
+ border-bottom: 1px dotted $light-grey;
175
+ }
176
+ }
177
+
178
+ span {
179
+ padding: 0 .4rem;
180
+ }
181
+
182
+ .body {
183
+ padding-left: 0;
184
+ }
185
+
186
+ .date,
187
+ .author,
188
+ .actions {
189
+ font-style: italic;
190
+ border-left: 1px solid $winter-sky;
191
+ color: $light-grey;
192
+ white-space: nowrap;
193
+
194
+ .fa {
195
+ color: $light-grey;
196
+ &:hover {
197
+ color: $white;
198
+ }
199
+ }
200
+ }
201
+
202
+ .actions {
203
+ padding-right: .1rem;
204
+ padding-left: .6rem;
205
+ }
206
+ }
207
+ }
208
+ }
209
+ }
@@ -92,16 +92,6 @@ ul.provider {
92
92
  display: inline-block;
93
93
  }
94
94
 
95
- .patient-content {
96
- padding-bottom: 16rem;
97
- position: absolute;
98
- top: 0;
99
- right: 0;
100
- bottom: 0;
101
- left: $patient-side-nav-width;
102
- overflow-y: auto;
103
- }
104
-
105
95
  .collapse-patient-menu .patient-content {
106
96
  left: 0;
107
97
  }
@@ -287,73 +277,6 @@ ul.provider {
287
277
  }
288
278
  }
289
279
 
290
- // Alerts
291
-
292
- .alerts {
293
- table-layout: fixed;
294
- }
295
-
296
- .alerts--alert,
297
- .alerts--alert:nth-of-type(even) {
298
- clear: both;
299
- height: 2rem;
300
- padding: 0.4em 0.2em 0.5em 0.6em;
301
- background-color: $nhs-orange;
302
- color: $white;
303
-
304
- &:hover {
305
- background-color: lighten($nhs-orange, 5);
306
- }
307
-
308
- td, td.actions a {
309
- color: inherit;
310
- }
311
-
312
- td {
313
- border: 0;
314
- }
315
-
316
- .icon {
317
- width: 1.7rem;
318
- padding-left: 0.4rem;
319
- }
320
-
321
- .notes {
322
- overflow: hidden;
323
- text-overflow: ellipsis;
324
- white-space: nowrap;
325
-
326
- &:before {
327
- content: "Alert: ";
328
- }
329
- }
330
-
331
- .author {
332
- width: 15rem;
333
- text-align: right;
334
- }
335
-
336
- .actions {
337
- width: 3rem;
338
- padding-right: 1rem;
339
- }
340
-
341
- &.urgent {
342
- background-color: $nhs-red;
343
-
344
- &:hover {
345
- background-color: lighten($nhs-red, 5);
346
- }
347
- }
348
-
349
- .icon {
350
- @extend .fa;
351
- @extend .fa-warning;
352
- display: table-cell;
353
- }
354
- }
355
-
356
- // End Alerts
357
280
  form {
358
281
  .blood-pressure {
359
282
  &.with-errors {
@@ -4,16 +4,76 @@ html {
4
4
  }
5
5
  }
6
6
 
7
+ /* New flexbox layout */
8
+ html, body {
9
+ height: 100%;
10
+ }
11
+
12
+ html {
13
+ body {
14
+ overflow: hidden;
15
+ display: flex;
16
+ flex-direction: column;
17
+
18
+ > header {
19
+ flex: 0 0 auto;
20
+ background-color: #dcdcdc;
21
+ }
22
+
23
+ /* main is a wrapper about non-header content */
24
+ > main {
25
+ display: flex;
26
+ height: 100%;
27
+ min-height: 0;
28
+
29
+ > nav {
30
+ width: $patient-side-nav-width;
31
+ min-width: $patient-side-nav-width;
32
+ }
33
+
34
+ > .main-content {
35
+ position: relative; /* need this to position inner content */
36
+ width: 100%;
37
+ }
38
+
39
+ > nav,
40
+ > .main-content {
41
+ flex: 1 1 auto;
42
+ height: 100%;
43
+ min-height: 100%;
44
+ padding-bottom: 2rem;
45
+ overflow-y: auto;
46
+ }
47
+
48
+ .layout-wrapper {
49
+ padding-bottom: 3rem;
50
+ }
51
+ }
52
+
53
+ > footer {
54
+ flex: 0 0 auto;
55
+ }
56
+ }
57
+
58
+ /* When patient menu hidden/shown */
59
+ body.collapse-patient-menu nav.patient-side-nav {
60
+ margin-left: -15rem;
61
+ left: 0;
62
+ }
63
+
64
+ .full-screenable {
65
+ transition: margin .2s ease 0s;
66
+ }
67
+ }
68
+
69
+ /* End new flexbox layout */
70
+
7
71
  footer {
8
72
  background-color: $footer-bg-colour;
9
- border-top: 1px solid $smoke;
73
+ border-top: 1px solid $light-grey;
10
74
  color: $footer-colour;
11
- font-size: 12px;
12
- padding: .2rem 1rem;
13
- position: fixed;
14
- right: 0;
15
- bottom: 0;
16
- left: 0;
75
+ font-size: .8rem;
76
+ padding: 0 1rem;
17
77
  text-align: right;
18
78
  }
19
79
 
@@ -64,14 +64,9 @@ dd.patient-name {
64
64
 
65
65
  .patient-side-nav {
66
66
  background-color: $patient-menu-background-colour;
67
- padding: 0.6rem 0;
68
- padding-bottom: 11rem;
69
- position: absolute;
67
+ padding: 0.6rem 0 2rem 0.6rem;
70
68
  width: $patient-side-nav-width;
71
- overflow-y: auto;
72
- top: 0;
73
- bottom: 0;
74
- left: 0;
69
+ min-width: $patient-side-nav-width;
75
70
 
76
71
  hr {
77
72
  margin: 0.3rem 0 0.5rem;
@@ -179,7 +179,7 @@ table {
179
179
 
180
180
  &.col-width-reference-no {
181
181
  width: 8rem;
182
- min-width: 7.7rem;
182
+ min-width: 8rem;
183
183
  white-space: nowrap;
184
184
  }
185
185
 
@@ -7,6 +7,7 @@ module Renalware
7
7
 
8
8
  before_action :set_paper_trail_whodunnit
9
9
  after_action :verify_authorized
10
+ after_action :track_action, except: [:has_user_timed_out]
10
11
 
11
12
  rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
12
13
 
@@ -40,6 +41,10 @@ module Renalware
40
41
  collection.page(params[:page]).per(params[:per_page] || default_per_page)
41
42
  end
42
43
 
44
+ def track_action
45
+ ahoy.track "action", request.path_parameters
46
+ end
47
+
43
48
  private
44
49
 
45
50
  # TODO: remove load_patient before_action once refactored out of other controllers.
@@ -3,7 +3,7 @@ module Renalware
3
3
  module Clinics
4
4
  class VisitsController < BaseController
5
5
  include Renalware::Concerns::Pageable
6
- PER_PAGE = 100
6
+ PER_PAGE = 25
7
7
 
8
8
  def index
9
9
  visits_query = VisitQuery.new(query_params)
@@ -15,7 +15,8 @@ module Renalware
15
15
  font_size: 8,
16
16
  right: "Page [page] of [topage]"
17
17
  },
18
- show_as_html: Rails.env.development? && params.key?(:debug)
18
+ show_as_html: Rails.env.development? && params.key?(:debug),
19
+ encoding: "UTF-8"
19
20
  }
20
21
  end
21
22
 
@@ -12,6 +12,7 @@ module Renalware
12
12
  # regardless of how long ago they signed out, because in this instance devise removes it's
13
13
  # entries in the session cookie.
14
14
  def after_sign_in_path_for(resource)
15
+ track_signin
15
16
  max_duration_of_url_memory = Renalware.config.duration_of_last_url_memory_after_session_expiry
16
17
  max_duration_has_passed = last_sign_in_at <= max_duration_of_url_memory.ago
17
18
  max_duration_has_passed ? dashboard_path : super
@@ -26,5 +27,9 @@ module Renalware
26
27
  def epoch_start
27
28
  Date.new(0)
28
29
  end
30
+
31
+ def track_signin
32
+ ahoy.track "signin"
33
+ end
29
34
  end
30
35
  end
@@ -0,0 +1,13 @@
1
+ require_dependency "renalware/admin"
2
+
3
+ module Renalware
4
+ module Letters
5
+ class PdfLetterCacheController < BaseController
6
+ def destroy
7
+ authorize [:renalware, :admin, :cache], :destroy?
8
+ Renalware::Letters::PdfLetterCache.clear
9
+ redirect_to admin_cache_path, notice: "Cache successfully cleared"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -78,7 +78,7 @@ module Renalware
78
78
  :start_date, :end_date, :treatment, :assistance_type, :type,
79
79
  :add_hd, :tidal_full_drain_every_three_cycles,
80
80
  :tidal_indicator, :tidal_percentage, :no_cycles_per_apd,
81
- :apd_machine_pac, :therapy_time, :fill_volume, :delivery_interval,
81
+ :apd_machine_pac, :dwell_time, :therapy_time, :fill_volume, :delivery_interval,
82
82
  :system_id, :last_fill_volume, :additional_manual_exchange_volume,
83
83
  bags_attributes: [
84
84
  :id, :regime_id, :bag_type_id, :volume, :role, :capd_overnight_bag, :per_week,