renalware-core 2.0.124 → 2.0.125

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/renalware/icons/more-horizontal.svg +1 -0
  3. data/app/assets/images/renalware/icons/more-vertical.svg +1 -0
  4. data/app/assets/stylesheets/renalware/modules/_surveys.scss +58 -0
  5. data/app/controllers/renalware/medications/prescriptions_controller.rb +1 -0
  6. data/app/controllers/renalware/pathology/requests/requests_controller.rb +1 -0
  7. data/app/controllers/renalware/pd/peritonitis_episodes_controller.rb +1 -1
  8. data/app/helpers/renalware/layout_helper.rb +1 -1
  9. data/app/helpers/renalware/primary_care_physicians_helper.rb +2 -1
  10. data/app/helpers/renalware/toggle_helper.rb +12 -0
  11. data/app/models/renalware/feeds/files/practice_memberships/import_job.rb +2 -2
  12. data/app/models/renalware/letters/letter_query.rb +1 -1
  13. data/app/models/renalware/pathology/observation_for_patient_observation_description_using_set_query.rb +2 -2
  14. data/app/models/renalware/pathology/observation_for_patient_request_description_query.rb +19 -5
  15. data/app/models/renalware/pathology/patient.rb +4 -0
  16. data/app/models/renalware/pathology/request_for_patient_request_description_query.rb +4 -2
  17. data/app/models/renalware/pathology/requests/global_algorithm.rb +4 -1
  18. data/app/models/renalware/pathology/requests/global_rule/observation_result.rb +21 -9
  19. data/app/models/renalware/pathology/requests/global_rule/prescription_drug.rb +1 -1
  20. data/app/models/renalware/pathology/requests/global_rule/prescription_drug_category.rb +2 -2
  21. data/app/models/renalware/pathology/requests/global_rule/prescription_drug_type.rb +1 -3
  22. data/app/models/renalware/pathology/requests/global_rule/request_result.rb +1 -1
  23. data/app/models/renalware/pathology/requests/global_rule_set/patient_rule_set_decision.rb +14 -5
  24. data/app/models/renalware/pd/create_regime.rb +2 -2
  25. data/app/models/renalware/ukrdc/incoming/import_surveys.rb +2 -2
  26. data/app/models/renalware/ukrdc/transmission_log.rb +1 -1
  27. data/app/models/renalware/ukrdc/treatment_timeline/hd/generator.rb +0 -3
  28. data/app/models/renalware/ukrdc/treatment_timeline/prepare_tables.rb +1 -1
  29. data/app/presenters/renalware/hd/protocol_presenter.rb +1 -1
  30. data/app/views/renalware/accesses/assessments/_list.html.slim +1 -2
  31. data/app/views/renalware/accesses/procedures/_list.html.slim +3 -4
  32. data/app/views/renalware/accesses/profiles/_list.html.slim +1 -2
  33. data/app/views/renalware/admissions/consults/_table.html.slim +3 -5
  34. data/app/views/renalware/drugs/drugs/index.html.slim +1 -2
  35. data/app/views/renalware/events/types/_table.html.slim +1 -2
  36. data/app/views/renalware/hd/cannulation_types/index.html.slim +1 -2
  37. data/app/views/renalware/hd/mdm/_top.html.slim +6 -4
  38. data/app/views/renalware/hd/scheduling/diary_slots/edit.html.slim +6 -1
  39. data/app/views/renalware/layouts/_patient.html.slim +1 -6
  40. data/app/views/renalware/letters/formatted_letters/_enclosures.html.slim +2 -0
  41. data/app/views/renalware/letters/formatted_letters/_letter.html.slim +2 -0
  42. data/app/views/renalware/letters/letters/_letter.html.slim +2 -2
  43. data/app/views/renalware/letters/letters/_table.html.slim +2 -2
  44. data/app/views/renalware/letters/lists/_letter.html.slim +1 -1
  45. data/app/views/renalware/low_clearance/mdm/_top.html.slim +1 -0
  46. data/app/views/renalware/mdm/_worryboard.html.slim +10 -0
  47. data/app/views/renalware/mdm/show.html.slim +3 -1
  48. data/app/views/renalware/modalities/descriptions/index.html.slim +1 -2
  49. data/app/views/renalware/pathology/required_observations/index.html.slim +1 -1
  50. data/app/views/renalware/patients/primary_care_physicians/_primary_care_physician.html.slim +1 -2
  51. data/app/views/renalware/pd/_pet_adequacies.html.slim +1 -2
  52. data/app/views/renalware/pd/_regimes.html.slim +1 -2
  53. data/app/views/renalware/pd/assessments/_list.html.slim +1 -2
  54. data/app/views/renalware/pd/bag_types/index.html.slim +1 -2
  55. data/app/views/renalware/pd/mdm/_top.html.slim +2 -1
  56. data/app/views/renalware/pd/training_sessions/_list.html.slim +1 -2
  57. data/app/views/renalware/renal/aki_alerts/_aki_alert.html.slim +3 -6
  58. data/app/views/renalware/renal/aki_alerts/_table.html.slim +2 -1
  59. data/app/views/renalware/reporting/audits/index.html.slim +1 -2
  60. data/app/views/renalware/surveys/_pos_s_summary_part.html.slim +14 -1
  61. data/app/views/renalware/surveys/dashboards/show.html.slim +1 -0
  62. data/app/views/renalware/system/messages/index.html.slim +1 -2
  63. data/app/views/renalware/transplants/mdm/_top.html.slim +1 -0
  64. data/config/initializers/simple_form_foundation.rb +10 -10
  65. data/db/functions/update_current_observation_set_from_trigger_v04.sql +1 -1
  66. data/lib/collection_presenter.rb +1 -1
  67. data/lib/renalware/version.rb +1 -1
  68. metadata +17 -12
@@ -30,7 +30,7 @@ module Renalware
30
30
  # Import all surverys (they will be for the same patient) in the XML file.
31
31
  # Note that #with_logging yields a block that will catch and save any error to
32
32
  # ukrdc_transmission_logs
33
- # rubocop:disable Lint/HandleExceptions, Metrics/AbcSize
33
+ # rubocop:disable Metrics/AbcSize
34
34
  def import_surveys_from_file(file)
35
35
  # Important to create the log before we do anything that might cause an error
36
36
  # eg parse the xml etc.
@@ -48,7 +48,7 @@ module Renalware
48
48
  ensure
49
49
  FileUtils.mv file, paths.archive.join(file.basename)
50
50
  end
51
- # rubocop:enable Lint/HandleExceptions, Metrics/AbcSize
51
+ # rubocop:enable Metrics/AbcSize
52
52
 
53
53
  def import_survey(survey_hash, patient)
54
54
  ImportSurvey.new(
@@ -15,7 +15,7 @@ module Renalware
15
15
  sent: 3,
16
16
  imported: 4
17
17
  }
18
- enum direction: [:out, :in]
18
+ enum direction: { out: 0, in: 1 }
19
19
  scope :ordered, -> { order(sent_at: :asc) }
20
20
 
21
21
  def self.with_logging(patient, request_uuid, **options)
@@ -2,8 +2,6 @@
2
2
 
3
3
  require_dependency "renalware/ukrdc"
4
4
  require "attr_extras"
5
-
6
- # rubocop:disable Lint/UnneededCopDisableDirective, Rails/Output
7
5
  # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
8
6
  module Renalware
9
7
  module UKRDC
@@ -138,5 +136,4 @@ module Renalware
138
136
  end
139
137
  end
140
138
  end
141
- # rubocop:enable Lint/UnneededCopDisableDirective, Rails/Output
142
139
  # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
@@ -20,7 +20,7 @@ module Renalware
20
20
  SQL
21
21
  if result.ntuples == 1
22
22
  connection.execute("select ukrdc_prepare_tables();")
23
- return true
23
+ true
24
24
  end
25
25
  end
26
26
  end
@@ -82,7 +82,7 @@ module Renalware
82
82
  old_formats = formats
83
83
  begin
84
84
  self.formats = [format]
85
- return block.call
85
+ block.call
86
86
  ensure
87
87
  self.formats = old_formats
88
88
  end
@@ -18,9 +18,8 @@ article.access-assessments
18
18
  tbody
19
19
  - assessments.each do |assessment|
20
20
  tr
21
- td
21
+ td.actions
22
22
  = link_to "View", patient_accesses_assessment_path(patient, assessment)
23
- = pipe_separator
24
23
  = link_to "Edit", edit_patient_accesses_assessment_path(patient, assessment)
25
24
  td= assessment.performed_on
26
25
  td= assessment.type
@@ -7,6 +7,7 @@ article.access-procedures
7
7
 
8
8
  table.auto-layout
9
9
  thead
10
+ th.togglers = table_toggler
10
11
  th.col-width-small
11
12
  th.col-width-date Performed
12
13
  th Procedure
@@ -17,12 +18,10 @@ article.access-procedures
17
18
  tbody
18
19
  - procedures.each do |procedure|
19
20
  tr
20
- td
21
+ td.toggler = toggler("#procedure-quick-preview-#{procedure.id}")
22
+ td.actions
21
23
  = link_to "View", patient_accesses_procedure_path(patient, procedure)
22
- = pipe_separator
23
24
  = link_to "Edit", edit_patient_accesses_procedure_path(patient, procedure)
24
- = pipe_separator
25
- = link_to("Toggle", "#procedure-quick-preview-#{procedure.id}", data: { behaviour: "toggler" })
26
25
  td= procedure.performed_on
27
26
  td= procedure.type&.long_name
28
27
  td= procedure.side
@@ -17,9 +17,8 @@ article.access-profiles
17
17
  tbody
18
18
  - profiles.each do |profile|
19
19
  tr
20
- td
20
+ td.actions
21
21
  = link_to "View", patient_accesses_profile_path(patient, profile)
22
- = pipe_separator
23
22
  = link_to "Edit", edit_patient_accesses_profile_path(patient, profile)
24
23
  td= profile.formed_on
25
24
  td= profile.started_on
@@ -5,7 +5,8 @@
5
5
  table
6
6
  thead
7
7
  tr
8
- th.col-width-medium.noprint
8
+ = th_toggle_all_rows
9
+ th.col-width-small.noprint
9
10
  - unless compact
10
11
  th.col-width-large
11
12
  - if allow_sorting
@@ -63,6 +64,7 @@
63
64
  - consults.each do |consult|
64
65
  - uid = "consult-#{consult.id}"
65
66
  tr.keep-with-next
67
+ = td_toggle_row("#consult-quick-preview-#{consult.id}")
66
68
  td.actions-dropdown.going-right.noprint
67
69
  / As we have lots of possible actions, group them in a button group.
68
70
  / A wrapping div is required for now in order for the button group display correctly
@@ -91,10 +93,6 @@
91
93
  li= render "renalware/admissions/requests/create_request_link",
92
94
  patient: consult.patient,
93
95
  link_text: "Request Admission"
94
- |   
95
- = link_to("Toggle",
96
- "#consult-quick-preview-#{consult.id}",
97
- data: { behaviour: "toggler" })
98
96
  - unless compact
99
97
  td= default_patient_link(consult.patient)
100
98
  td.noprint= consult.patient_nhs_number
@@ -16,9 +16,8 @@
16
16
  tbody
17
17
  - @drugs.each do |drug|
18
18
  tr
19
- td
19
+ td.actions
20
20
  = link_to "Edit", edit_drugs_drug_path(drug)
21
- = pipe_separator
22
21
  = link_to "Delete", drugs_drug_path(drug),
23
22
  id: "#{drug.id}-drug",
24
23
  method: :delete,
@@ -6,9 +6,8 @@ table
6
6
  tbody
7
7
  - event_types.each do |t|
8
8
  tr
9
- td
9
+ td.actions
10
10
  = link_to "Edit", edit_events_type_path(t.id)
11
- = pipe_separator
12
11
  = link_to "Delete",
13
12
  events_type_path(t.id),
14
13
  method: :delete,
@@ -13,9 +13,8 @@
13
13
  tbody
14
14
  - cannulation_types.each do |t|
15
15
  tr
16
- td
16
+ td.actions
17
17
  = link_to "Edit", edit_hd_cannulation_type_path(t.id)
18
- = pipe_separator
19
18
  = link_to "Delete",
20
19
  hd_cannulation_type_path(t.id),
21
20
  method: :delete,
@@ -1,13 +1,15 @@
1
- .columns.small-12.medium-6.large-3
1
+ .columns.small-12.medium-6.large-6
2
2
  = render "renalware/hd/current_profile/summary", profile: mdm.hd_profile, patient: mdm.patient
3
3
  .columns.small-12.medium-6.large-3
4
4
  - if mdm.access.present?
5
5
  = render "renalware/hd/accesses/summary", access: mdm.access, patient: mdm.patient
6
- .columns.medium-12.large-6
6
+ .columns.medium-6.large-6
7
7
  = render "renalware/virology/profiles/summary",
8
8
  patient: mdm.patient,
9
9
  positive_results_only: true
10
+ .columns.medium-6.large-6
11
+ = render "summary", mdm: mdm
12
+ = render "worryboard", mdm: mdm
13
+
10
14
  .columns.medium-12.large-6
11
15
  = render "prescriptions", mdm: mdm, with_esa: true
12
- .columns.medium-12.large-6
13
- = render "summary", mdm: mdm
@@ -1,6 +1,11 @@
1
1
  .modal
2
2
  .modal__header
3
- h2= slot.patient
3
+ h2
4
+ = link_to(patient_clinical_summary_path(slot.patient), target: "_blank") do
5
+ = slot.patient.to_s(:default)
6
+ |  
7
+ i.fa.fa-external-link-square-alt
8
+
4
9
  = render "renalware/shared/modal_close_link"
5
10
 
6
11
  .modal__body
@@ -6,12 +6,7 @@
6
6
 
7
7
  nav.patient-side-nav.full-screenable
8
8
  .layout-wrapper
9
- = render "renalware/patients/side_menu", patient: current_patient
10
- / Note that ActionView::Components are not really working out of the box inside an engine:
11
- / "Could not find a template file for Renalware::Patients::SideMenuComponent."
12
- / source_location.split(".")[0] returns the wrong segment when there is eg .rbenv and .2.6.3
13
- / in the path. TODO: Check/raise issue on https://github.com/github/actionview-component
14
- /= render Renalware::Patients::SideMenuComponent, patient: current_patient
9
+ = render Renalware::Patients::SideMenuComponent, patient: current_patient
15
10
 
16
11
  .main-content.patient-content.full-screenable
17
12
  .layout-wrapper
@@ -0,0 +1,2 @@
1
+ - if letter.enclosures.present?
2
+ p.enclosures = "Enc: #{letter.enclosures}"
@@ -336,6 +336,8 @@ scss:
336
336
  br
337
337
  = letter.author.professional_position
338
338
 
339
+ = render "renalware/letters/formatted_letters/enclosures", letter: letter
340
+
339
341
  .footer
340
342
  .ccs
341
343
  h3 cc:
@@ -1,8 +1,8 @@
1
1
  - columns = local_assigns[:columns] || []
2
2
  - cache([letter, columns.join("-")]) do
3
3
  tr(class=letter.state.dasherize)
4
- td= toggler("#letter-quick-preview-#{letter.id}")
5
- td.actions
4
+ td.noprint= toggler("#letter-quick-preview-#{letter.id}")
5
+ td.noprint.actions
6
6
  = link_to letter.view_label, patient_letters_letter_path(letter.patient, letter)
7
7
  - if policy(letter).update?
8
8
  = link_to "Edit", edit_patient_letters_letter_path(letter.patient, letter)
@@ -4,14 +4,14 @@ table.auto-layout.letters.has-togglable-rows
4
4
  thead
5
5
  tr
6
6
  th.noprint.togglers= table_toggler
7
- th.col-width-11
7
+ th.noprint.col-width-11
8
8
  th.col-width-tiny State
9
9
  th.col-width-date-time Date
10
10
  - if columns.include?(:author)
11
11
  th.col-width-medium Author
12
12
  - if columns.include?(:patient)
13
13
  th.col-width-medium Patient
14
- th.col-width-medium Recipient
14
+ th.at-least.col-width-medium Recipient
15
15
  th.col-width-medium Description
16
16
 
17
17
  tbody
@@ -1,5 +1,5 @@
1
1
  tr(class=letter.state.dasherize)
2
- td= toggler("#letter-quick-preview-#{letter.id}")
2
+ td.noprint= toggler("#letter-quick-preview-#{letter.id}")
3
3
  td.noprint
4
4
  = link_to "View", patient_letters_letter_path(letter.patient, letter)
5
5
  - if letter.approved?
@@ -13,3 +13,4 @@
13
13
  = render "prescriptions", mdm: mdm, with_esa: true
14
14
  .columns.small-12.medium-6.large-6.xlarge-4
15
15
  = render "problems", mdm: mdm
16
+ = render "worryboard", mdm: mdm
@@ -0,0 +1,10 @@
1
+ - worry = mdm.patient.worry
2
+ - return if worry.blank?
3
+
4
+ .columns.medium-6
5
+ article
6
+ header
7
+ h2 Worryboard
8
+ ul
9
+ li(style="float:right")= "Added #{l(worry.created_at&.to_date)} by #{worry.created_by}"
10
+ = worry.notes
@@ -8,7 +8,9 @@
8
8
  / TODO: a.trigger-full-screen Full screen
9
9
  .full-screen-container.mdm-page.no-side-gutters
10
10
  .grid
11
- .row= render_if_exists "top", mdm: mdm
11
+ .row
12
+ = render_if_exists "top", mdm: mdm
13
+
12
14
  .row= render "pathology", mdm: mdm
13
15
  .row= render_if_exists "middle", mdm: mdm
14
16
  = render_if_exists "bottom", mdm: mdm
@@ -13,11 +13,10 @@
13
13
  tbody
14
14
  - modality_descriptions.each do |description|
15
15
  tr
16
- td
16
+ td.actions
17
17
  - if policy(description).edit?
18
18
  = link_to "Edit", edit_modalities_description_path(description.id)
19
19
  - if policy(description).destroy?
20
- = pipe_separator
21
20
  = link_to "Delete",
22
21
  modalities_description_path(description.id),
23
22
  method: :delete,
@@ -39,7 +39,7 @@
39
39
  tr
40
40
  td = request_description.code
41
41
  td = request_description.lab.name
42
- td = request_description.bottle_type.capitalize
42
+ td = request_description.bottle_type&.capitalize
43
43
  td = request_description.name
44
44
 
45
45
  .row
@@ -1,8 +1,7 @@
1
1
  tr
2
- td
2
+ td.actions
3
3
  = link_to "Edit",
4
4
  edit_patients_primary_care_physician_path(primary_care_physician)
5
- = pipe_separator
6
5
  = link_to "Delete",
7
6
  patients_primary_care_physician_path(primary_care_physician),
8
7
  method: :delete
@@ -15,9 +15,8 @@ table
15
15
  tbody
16
16
  - pet_adequacies.each do |pet_adequacy|
17
17
  tr data-assessment-id="#{pet_adequacy.id}" valign="top"
18
- td
18
+ td.actions
19
19
  = link_to "View", patient_pd_pet_adequacy_result_path(patient, pet_adequacy.id)
20
- |  | 
21
20
  = link_to "Edit", edit_patient_pd_pet_adequacy_result_path(patient, pet_adequacy.id)
22
21
  td= l(pet_adequacy.pet_date)
23
22
  td= pet_adequacy.pet_type&.text
@@ -13,13 +13,12 @@ table(class=table_class)
13
13
  tbody
14
14
  - regimes.each do |r|
15
15
  tr(data-regime-id=r.id)
16
- td
16
+ td.actions
17
17
  / TODO: Use a policy
18
18
  - if r.current? && !current_user.has_role?(:read_only)
19
19
  = link_to "Update",
20
20
  edit_patient_pd_regime_path(patient, r.id),
21
21
  class: "update-pd-regime"
22
- = pipe_separator
23
22
  = link_to "View",
24
23
  patient_pd_regime_path(patient, r.id),
25
24
  class: "view-pd-regime"
@@ -16,10 +16,9 @@ article.pd_assessments
16
16
  - assessments.each do |assessment|
17
17
  - document = assessment.document
18
18
  tr
19
- td
19
+ td.actions
20
20
  - if policy(assessment).edit?
21
21
  = link_to("Edit", edit_patient_pd_assessment_path(patient, assessment))
22
- = pipe_separator
23
22
  - if policy(assessment).show?
24
23
  = link_to("View", [patient, assessment])
25
24
  td= l(assessment.created_at)
@@ -23,9 +23,8 @@
23
23
  tbody
24
24
  - bag_types.each do |bt|
25
25
  tr
26
- td
26
+ td.actions
27
27
  = link_to "Edit", edit_pd_bag_type_path(bt.id), id: "edit-bag-type-#{bt.id}"
28
- = pipe_separator
29
28
  = link_to "Delete",
30
29
  pd_bag_type_path(bt.id),
31
30
  method: :delete,
@@ -1,8 +1,9 @@
1
1
  .columns.medium-12.large-6
2
2
  - if mdm.current_regime
3
3
  = render "renalware/pd/regimes/current_regime", current_regime: mdm.current_regime
4
- .columns.medium-12.large-6
4
+ .columns.medium-6
5
5
  = render "summary", mdm: mdm
6
+ = render "worryboard", mdm: mdm
6
7
  .columns.medium-12.large-6
7
8
  = render "prescriptions", mdm: mdm, with_esa: true
8
9
  .columns.medium-12.large-6
@@ -17,10 +17,9 @@ article.pd_training_sessions
17
17
  - training_sessions.each do |training_session|
18
18
  - document = training_session.document
19
19
  tr
20
- td
20
+ td.actions
21
21
  - if policy(training_session).edit?
22
22
  = link_to("Edit", edit_patient_pd_training_session_path(patient, training_session))
23
- = pipe_separator
24
23
  - if policy(training_session).show?
25
24
  = link_to("View", [patient, training_session])
26
25
  td= l(training_session.created_at)
@@ -1,11 +1,7 @@
1
1
  - toggleable_id = "aki-alert-quick-preview-#{aki_alert.id}"
2
2
  tr(class="#{'aki_alert--hotlist' if aki_alert.hotlist?}")
3
- td
4
- = link_to("Edit", edit_renal_aki_alert_path(aki_alert))
5
- |  | 
6
- = link_to("Toggle",
7
- "##{toggleable_id}",
8
- data: { behaviour: "toggler" })
3
+ td= toggler("##{toggleable_id}")
4
+ td= link_to("Edit", edit_renal_aki_alert_path(aki_alert))
9
5
  td= default_patient_link(aki_alert.patient)
10
6
  td= aki_alert.patient.hospital_identifiers
11
7
  td.show-for-large-up.col-width-medium-with-ellipsis= aki_alert.patient.current_modality
@@ -18,6 +14,7 @@ tr(class="#{'aki_alert--hotlist' if aki_alert.hotlist?}")
18
14
  td= l(aki_alert.aki_date)
19
15
  td= aki_alert.decided_by
20
16
  = content_tag(:tr, id: "#{toggleable_id}", style: "display: none")
17
+ td
21
18
  td.notes Notes
22
19
  td(colspan=10)
23
20
  .quick-preview