renalware-core 2.0.132 → 2.0.133

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/renalware/core.js.erb +1 -1
  3. data/app/assets/stylesheets/renalware/core.scss +1 -1
  4. data/app/assets/stylesheets/renalware/modules/_clinics.scss +1 -2
  5. data/app/assets/stylesheets/renalware/modules/_patients.scss +1 -1
  6. data/app/assets/stylesheets/renalware/partials/_dashboards.scss +15 -0
  7. data/app/components/renalware/application_component.rb +22 -0
  8. data/app/components/renalware/events/biopsies_component.html.slim +14 -0
  9. data/app/components/renalware/events/biopsies_component.rb +20 -0
  10. data/app/components/renalware/letters/letters_in_progress_component.html.slim +8 -0
  11. data/app/components/renalware/letters/letters_in_progress_component.rb +32 -0
  12. data/app/components/renalware/letters/unread_electronic_ccs_component.html.slim +7 -0
  13. data/app/components/renalware/letters/unread_electronic_ccs_component.rb +24 -0
  14. data/app/components/renalware/messaging/unread_messages_component.html.slim +11 -0
  15. data/app/components/renalware/messaging/unread_messages_component.rb +24 -0
  16. data/app/components/renalware/patients/bookmarks_component.html.slim +11 -0
  17. data/app/components/renalware/patients/bookmarks_component.rb +22 -0
  18. data/app/controllers/renalware/clinical/body_compositions_controller.rb +1 -1
  19. data/app/controllers/renalware/pathology/code_groups_controller.rb +44 -0
  20. data/app/controllers/renalware/transplants/wait_lists_controller.rb +17 -8
  21. data/app/models/renalware/clinical/body_composition.rb +7 -0
  22. data/app/models/renalware/hd/mdm_patients_query.rb +10 -1
  23. data/app/models/renalware/pathology/code_group.rb +10 -3
  24. data/app/models/renalware/pathology/code_group_membership.rb +2 -0
  25. data/app/models/renalware/pathology/current_observation_set.rb +16 -3
  26. data/app/models/renalware/pathology/observations_jsonb_serializer.rb +1 -1
  27. data/app/models/renalware/pathology/version.rb +11 -0
  28. data/app/models/renalware/system/component.rb +25 -0
  29. data/app/models/renalware/system/dashboard.rb +20 -0
  30. data/app/models/renalware/system/dashboard_component.rb +17 -0
  31. data/app/models/renalware/transplants.rb +8 -1
  32. data/app/models/renalware/transplants/registrations/wait_list_form.rb +16 -0
  33. data/app/models/renalware/transplants/registrations/wait_list_query.rb +17 -3
  34. data/app/models/renalware/ukrdc/incoming/file_list.rb +1 -1
  35. data/app/models/renalware/ukrdc/incoming/import_surveys.rb +16 -0
  36. data/app/models/renalware/ukrdc/outgoing/rendering/base.rb +22 -0
  37. data/app/models/renalware/ukrdc/outgoing/rendering/dialysis_session.rb +2 -2
  38. data/app/models/renalware/ukrdc/outgoing/rendering/hd_session_observations.rb +1 -1
  39. data/app/models/renalware/user.rb +9 -0
  40. data/app/policies/renalware/hd/closed_session_policy.rb +1 -1
  41. data/app/policies/renalware/pathology/code_group_policy.rb +23 -0
  42. data/app/presenters/renalware/hd/protocol_presenter.rb +8 -2
  43. data/app/views/renalware/clinical/body_compositions/_form.html.slim +6 -0
  44. data/app/views/renalware/clinical/body_compositions/_table.html.slim +4 -0
  45. data/app/views/renalware/dashboard/bookmarks/_bookmark.html.slim +5 -5
  46. data/app/views/renalware/dashboard/bookmarks/_table.html.slim +5 -5
  47. data/app/views/renalware/dashboard/dashboards/_content.html.slim +4 -41
  48. data/app/views/renalware/dashboard/letters/_letter.html.slim +2 -2
  49. data/app/views/renalware/hd/mdm_patients/_patient.html.slim +5 -1
  50. data/app/views/renalware/hd/mdm_patients/_table.html.slim +2 -1
  51. data/app/views/renalware/hd/protocols/_recent_pathology.html.slim +5 -12
  52. data/app/views/renalware/mdm/{_biopsies.html.slim → _biopsies.html.slim.dead} +0 -0
  53. data/app/views/renalware/mdm_patients/_patient.html.slim +5 -1
  54. data/app/views/renalware/mdm_patients/_table.html.slim +1 -1
  55. data/app/views/renalware/medications/prescriptions/_tables.html.slim +27 -23
  56. data/app/views/renalware/messaging/internal/receipts/_receipt.html.slim +1 -1
  57. data/app/views/renalware/modalities/modalities/index.html.slim +17 -16
  58. data/app/views/renalware/navigation/_super_admin.html.slim +1 -0
  59. data/app/views/renalware/pathology/code_groups/edit.html.slim +8 -0
  60. data/app/views/renalware/pathology/code_groups/index.html.slim +16 -0
  61. data/app/views/renalware/pathology/code_groups/show.html.slim +34 -0
  62. data/app/views/renalware/problems/problems/index.html.slim +9 -5
  63. data/app/views/renalware/surveys/_eq5d_summary_part.html.slim +17 -17
  64. data/app/views/renalware/surveys/_pos_s_summary_part.html.slim +61 -60
  65. data/app/views/renalware/transplants/mdm/_bottom.html.slim +1 -1
  66. data/app/views/renalware/transplants/mdm_patients/_patient.html.slim +5 -1
  67. data/app/views/renalware/transplants/mdm_patients/_table.html.slim +1 -1
  68. data/app/views/renalware/transplants/wait_lists/_registration.html.slim +1 -0
  69. data/app/views/renalware/transplants/wait_lists/show.html.slim +24 -1
  70. data/config/locales/renalware/clinical/body_composition.yml +4 -0
  71. data/config/routes/pathology.rb +1 -0
  72. data/db/migrate/20200114151225_add_clinical_body_composition_cols.rb +11 -0
  73. data/db/migrate/20200127165951_create_pathology_versions.rb +16 -0
  74. data/db/migrate/20200127170711_add_created_by_to_pathology_code_groups.rb +15 -0
  75. data/db/migrate/20200129093835_create_system_dashboards.rb +73 -0
  76. data/db/seeds/default/pathology/code_groups.rb +15 -0
  77. data/db/seeds/default/pathology/seeds.rb +2 -1
  78. data/lib/core_extensions/active_record/migration_helpers.rb +3 -2
  79. data/lib/renalware/engine.rb +1 -1
  80. data/lib/renalware/version.rb +1 -1
  81. data/lib/tasks/spec.rake +23 -21
  82. data/spec/factories/clinical/body_compositions.rb +3 -1
  83. data/spec/factories/pathology/code_group_memberships.rb +7 -0
  84. data/spec/factories/pathology/code_groups.rb +13 -0
  85. data/spec/factories/transplants/registration_status_descriptions.rb +5 -0
  86. data/spec/support/devise_spec_helper.rb +24 -8
  87. data/spec/support/ukrdc_helpers.rb +2 -1
  88. metadata +53 -24
@@ -4,13 +4,13 @@ table.auto-layout
4
4
  th.at-least.col-width-medium= t(".patient_name")
5
5
  th.col-width-nhs-no= t(".nhs_number")
6
6
  th.col-width-reference-no= t(".hospital_number")
7
- th.col-width-date= t(".born_on")
7
+ th.show-for-medium-up.col-width-date= t(".born_on")
8
8
  th.col-width-tiny= t(".age")
9
9
  th.col-width-tiny= t(".sex")
10
- th.col-width-medium= t(".modality")
11
- th= t(".notes")
12
- th= t(".tags")
13
- th.col-width-date-time= t(".bookmarked_on")
10
+ th= t(".modality")
11
+ th.show-for-medium-up= t(".notes")
12
+ th.show-for-medium-up= t(".tags")
13
+ th.col-width-date= t(".bookmarked_on")
14
14
  th.col-width-tiny
15
15
 
16
16
  tbody
@@ -1,45 +1,8 @@
1
1
  .dashboard-content
2
- article.letters
3
- header
4
- h2 Letters in Progress
5
- - if dashboard.letters_in_progress.any?
6
- #letters-in-progress
7
- = render "renalware/dashboard/letters/table", letters: dashboard.letters_in_progress
8
- - else
9
- p.empty-section= t(".letters.in_progress.none").html_safe
10
-
11
- article.bookmarks
12
- header
13
- h2.title= "Bookmarked Patients"
14
- ul
15
- li= link_to "View All", bookmarks_path, class: "button"
16
-
17
- - if dashboard.bookmarks.any?
18
- #bookmarks
19
- = render "renalware/dashboard/bookmarks/table", bookmarks: dashboard.bookmarks
20
- - else
21
- p.empty-section= t(".bookmarks.none")
22
-
23
- article.messages
24
- header
25
- h2 Messages
26
- ul
27
- li= render "renalware/messaging/shared/key"
28
- - if dashboard.unread_messages_receipts.any?
29
- .unread-messages
30
- = render "renalware/messaging/internal/receipts/table",
31
- receipts: dashboard.unread_messages_receipts
32
- - else
33
- p.empty-section= t(".messages.none")
34
-
35
- article.electonic_ccs
36
- header
37
- h2 Electronic CCs
38
- - if dashboard.unread_electronic_ccs.any?
39
- = render "renalware/letters/electronic_receipts/table",
40
- receipts: dashboard.unread_electronic_ccs
41
- - else
42
- p.empty-section= t(".electronic_ccs.none")
2
+ = render(Renalware::Letters::LettersInProgressComponent, current_user: current_user)
3
+ = render(Renalware::Patients::BookmarksComponent, current_user: current_user)
4
+ = render(Renalware::Messaging::UnreadMessagesComponent, current_user: current_user)
5
+ = render(Renalware::Letters::UnreadElectronicCCsComponent, current_user: current_user)
43
6
 
44
7
  - if current_user_is_admin?
45
8
  = render Renalware::Admin::Users::SummaryPart.new(nil, current_user)
@@ -3,8 +3,8 @@ tr(class=letter.state.dasherize)
3
3
  span= letter.state_description
4
4
  td= l letter.effective_date
5
5
  td= letter.author
6
- td= link_to letter.patient, patient_clinical_summary_path(letter.patient)
7
- td= letter.description
6
+ td.col-width-medium-with-ellipsis= link_to letter.patient, patient_clinical_summary_path(letter.patient)
7
+ td.col-width-medium-with-ellipsis= letter.description
8
8
  td.actions
9
9
  = link_to "Toggle", "#quick-preview-#{letter.id}", data: { behaviour: "toggler" }
10
10
  = link_to letter.view_label, patient_letters_letter_path(letter.patient, letter)
@@ -3,6 +3,11 @@
3
3
  - transplant_patient = Renalware::Transplants::PatientPresenter.new(patient)
4
4
 
5
5
  tr
6
+ td.actions
7
+ = link_to view_proc.call(patient), target: "_blank" do
8
+ i.fa.fa-external-link-square-alt
9
+ |   
10
+ = t(".view")
6
11
  td.full-name= link_to patient, view_proc.call(patient)
7
12
  td.nowrap= patient.nhs_number
8
13
  td.nowrap= patient.hospital_identifier
@@ -26,4 +31,3 @@ tr
26
31
  td.show-for-xlarge-up= l(patient.current_observation_set.pthi_observed_at)
27
32
  td.show-for-xlarge-up= patient.current_observation_set.urr_result
28
33
  td.show-for-xlarge-up= l(patient.current_observation_set.urr_observed_at)
29
- td.actions= link_to t(".view"), view_proc.call(patient)
@@ -2,6 +2,7 @@
2
2
  table#patients.mdm-patients.columns
3
3
  thead
4
4
  tr
5
+ th.col-width-tiny
5
6
  th.col-width-large= sort_link(path, :family_name, t(".name"))
6
7
  th.col-width-nhs-no= t(".nhs_no")
7
8
  th.col-width-reference-no= t(".hosp_no")
@@ -25,7 +26,7 @@ table#patients.mdm-patients.columns
25
26
  th.show-for-xlarge-up.col-width-date= sort_link(path, :pthi_date, t(".pthi_date"))
26
27
  th.show-for-xlarge-up.col-width-tiny= sort_link(path, :urr, t(".urr"))
27
28
  th.show-for-xlarge-up.col-width-date= sort_link(path, :urr_date, t(".urr_date"))
28
- th.col-width-tiny
29
+
29
30
  tbody
30
31
  = render partial: "patient",
31
32
  collection: presenter.patients,
@@ -1,14 +1,7 @@
1
1
  table.recent-pathology
2
2
  tbody
3
- tr
4
- th.code HGB
5
- td.result= recent_pathology.hgb_result
6
- td.nowrap.observed_at= (l(recent_pathology.hgb_observed_at))
7
- tr
8
- th.code PLT
9
- td.result= recent_pathology.plt_result
10
- td.nowrap.observed_at= (l(recent_pathology.plt_observed_at))
11
- tr
12
- th.code CRP
13
- td.result= recent_pathology.crp_result
14
- td.nowrap.observed_at= (l(recent_pathology.crp_observed_at))
3
+ - recent_pathology.each do |code, value|
4
+ tr
5
+ th.code= code
6
+ td.result= value[:result]
7
+ td.nowrap.observed_at= (value[:observed_at] && l(Date.parse(value[:observed_at])))
@@ -1,6 +1,11 @@
1
1
  - observation_set = patient.current_observation_set
2
2
  - transplant_patient = Renalware::Transplants::PatientPresenter.new(patient)
3
3
  tr
4
+ td.actions
5
+ = link_to view_proc.call(patient), target: "_blank" do
6
+ i.fa.fa-external-link-square-alt
7
+ |   
8
+ = t(".view")
4
9
  td.full-name= link_to patient.to_s(:default), view_proc.call(patient)
5
10
  td.nowrap= patient.nhs_number
6
11
  td.nowrap= patient.hospital_identifier
@@ -16,4 +21,3 @@ tr
16
21
  td= l(observation_set.cre_observed_at)
17
22
  td= observation_set.egfr_result
18
23
  td= l(patient.esrf_date)
19
- td.actions= link_to t(".view"), view_proc.call(patient)
@@ -2,6 +2,7 @@
2
2
  table#patients.mdm-patients.columns
3
3
  thead
4
4
  tr
5
+ th.col-width-tiny
5
6
  th.col-width-large= sort_link(path, :family_name, t(".name"))
6
7
  th.col-width-nhs-no= sort_link(path, :nhs_number, t(".nhs_no"))
7
8
  th.col-width-reference-no= t(".hosp_no")
@@ -14,7 +15,6 @@ table#patients.mdm-patients.columns
14
15
  th.col-width-date= sort_link(path, :"#{code}_date", t(".#{code}_date"))
15
16
  th.col-width-tiny= sort_link(path, :egfr, t(".egfr"))
16
17
  th.col-width-date= t(".esrf")
17
- th.col-width-small
18
18
 
19
19
  tbody
20
20
  = render partial: "patient",
@@ -1,25 +1,29 @@
1
- h2 Current
2
- = render "renalware/medications/prescriptions/table",
3
- id: "current-prescriptions",
4
- patient: patient,
5
- treatable: treatable,
6
- prescriptions: current_prescriptions,
7
- search: current_search,
8
- current_scope: true
9
- .row
10
- .large-12.columns
11
- .right
12
- = link_to "Add Prescription",
13
- new_patient_prescription_path(patient, treatable),
14
- remote: true,
15
- class: %i(button tiny add_prescription)
1
+ article
2
+ header
3
+ h2 Current
4
+ ul
5
+ li
6
+ = link_to "Add Prescription",
7
+ new_patient_prescription_path(patient, treatable),
8
+ remote: true,
9
+ class: %i(button add_prescription)
16
10
 
17
- - if defined? historical_prescriptions
18
- h2 Historical
19
11
  = render "renalware/medications/prescriptions/table",
20
- id: "historical-prescriptions",
21
- patient: patient,
22
- treatable: treatable,
23
- prescriptions: historical_prescriptions,
24
- search: historical_prescriptions_search,
25
- current_scope: false
12
+ id: "current-prescriptions",
13
+ patient: patient,
14
+ treatable: treatable,
15
+ prescriptions: current_prescriptions,
16
+ search: current_search,
17
+ current_scope: true
18
+
19
+ - if defined? historical_prescriptions
20
+ article
21
+ header
22
+ h2 Historical
23
+ = render "renalware/medications/prescriptions/table",
24
+ id: "historical-prescriptions",
25
+ patient: patient,
26
+ treatable: treatable,
27
+ prescriptions: historical_prescriptions,
28
+ search: historical_prescriptions_search,
29
+ current_scope: false
@@ -6,7 +6,7 @@ tr(class="#{ "urgent" if message.urgent?}" id=message.html_identifier)
6
6
  td= message.author
7
7
  td= l(message.sent_at)
8
8
  td= l(receipt.read_at)
9
- td= default_patient_link(patient)
9
+ td.col-width-medium-with-ellipsis= default_patient_link(patient)
10
10
  td= patient.nhs_number
11
11
  td= patient.hospital_identifier
12
12
  td.col-width-medium-with-ellipsis= message.subject
@@ -4,20 +4,21 @@
4
4
  class: "button"
5
5
 
6
6
  = within_patient_layout(title: "Modality History") do
7
- table
8
- thead
9
- tr
10
- th Modality
11
- th Notes
12
- th.col-width-date Start Date
13
- th.col-width-date.wide Termination Date
14
- th Added by
15
-
16
- tbody
17
- - modalities.each do |modality|
7
+ article
8
+ table
9
+ thead
18
10
  tr
19
- td= modality.description.name
20
- td= modality.notes
21
- td= l modality.started_on
22
- td= l modality.ended_on
23
- td= modality.created_by.full_name
11
+ th Modality
12
+ th Notes
13
+ th.col-width-date Start Date
14
+ th.col-width-date.wide Termination Date
15
+ th Added by
16
+
17
+ tbody
18
+ - modalities.each do |modality|
19
+ tr
20
+ td= modality.description.name
21
+ td= modality.notes
22
+ td= l modality.started_on
23
+ td= l modality.ended_on
24
+ td= modality.created_by.full_name
@@ -14,3 +14,4 @@ li.has-dropdown
14
14
  li= link_to "HD Dialysers", hd_dialysers_path
15
15
  li= link_to "HD Cannulation Types", hd_cannulation_types_path
16
16
  li= link_to "Print batches", letters_batches_path
17
+ li= link_to "Pathology Code Groups", renalware.pathology_code_groups_path
@@ -0,0 +1,8 @@
1
+ = within_admin_layout(title: "Pathology Code Group") do
2
+ h3= group.name
3
+ = simple_form_for(group,
4
+ url: renalware.pathology_code_group_path(group),
5
+ method: :patch,
6
+ as: :code_group) do |f|
7
+ = f.input :description
8
+ = f.submit "Save", class: :button
@@ -0,0 +1,16 @@
1
+ = within_admin_layout(title: "Pathology Code Groups") do
2
+
3
+ table.code-groups-table
4
+ thead
5
+ tr
6
+ th Group name
7
+ th Description
8
+ tbody
9
+ - groups.each do |group|
10
+ tr
11
+ td.actions
12
+ - if policy(group).edit?
13
+ = link_to "View", pathology_code_group_path(group)
14
+ td= group.name
15
+ td= group.description
16
+
@@ -0,0 +1,34 @@
1
+ = within_admin_layout(title: group.name) do
2
+
3
+ .panel.info.radius.columns
4
+ | Editing code groups here is not currently support, sorry.
5
+ | You'll need to update the database directly for now.
6
+
7
+ h5= group.description
8
+ = link_to "Edit group", edit_pathology_code_group_path(group)
9
+
10
+ br
11
+ br
12
+
13
+ article
14
+ header
15
+ h2 Codes
16
+
17
+ table.pathology-code-group-memberships.sortables
18
+ thead
19
+ /th.col-width-tiny
20
+ th.col-width-tiny Subgroup
21
+ th.col-width-small Position inside sub group
22
+ th.col-width-small Code
23
+ th Name
24
+
25
+ tbody
26
+ - group.memberships.order(:subgroup, :position_within_subgroup ).each do |membership|
27
+ tr.sortable
28
+ /td
29
+ i.fas.fa-bars
30
+ td= membership.subgroup
31
+ td= membership.position_within_subgroup
32
+ td= membership.observation_description.code
33
+ td= membership.observation_description.name
34
+
@@ -5,8 +5,12 @@
5
5
 
6
6
  = within_patient_layout(title: "Problems") do
7
7
 
8
- h2 Current
9
- = render "renalware/problems/problems/current_table", problems: current_problems
10
- br
11
- h2 Archived
12
- = render "renalware/problems/problems/archived_table", problems: archived_problems
8
+ article
9
+ header
10
+ h2 Current
11
+ = render "renalware/problems/problems/current_table", problems: current_problems
12
+
13
+ article
14
+ header
15
+ h2 Archived
16
+ = render "renalware/problems/problems/archived_table", problems: archived_problems
@@ -3,24 +3,24 @@
3
3
  header
4
4
  h2 EQ5D
5
5
 
6
- / b Example WIP for charting one question over time
7
- / = line_chart(eq5d_summary_part.data_for_question_code(1), curve: false)
8
- / br
9
- / br
10
- / br
6
+ / b Example WIP for charting one question over time
7
+ / = line_chart(eq5d_summary_part.data_for_question_code(1), curve: false)
8
+ / br
9
+ / br
10
+ / br
11
11
 
12
- - return if eq5d_summary_part.rows.blank?
12
+ - return if eq5d_summary_part.rows.blank?
13
13
 
14
- .xsss
15
- table
16
- thead
17
- tr
18
- th.col-width-date Date
19
- - eq5d_summary_part.question_labels.each do |code, label|
20
- th= label
21
- tbody
22
- - eq5d_summary_part.rows.each do |row|
14
+ .xsss
15
+ table
16
+ thead
23
17
  tr
24
- td= row.answered_on
18
+ th.col-width-date Date
25
19
  - eq5d_summary_part.question_labels.each do |code, label|
26
- td= row.send(code.to_sym)
20
+ th= label
21
+ tbody
22
+ - eq5d_summary_part.rows.each do |row|
23
+ tr
24
+ td= row.answered_on
25
+ - eq5d_summary_part.question_labels.each do |code, label|
26
+ td= row.send(code.to_sym)
@@ -6,70 +6,71 @@
6
6
  header
7
7
  h2 POS-S
8
8
 
9
- / b Example WIP for charting one question over time
10
- / = line_chart(eq5d_summary_part.data_for_question_code(1), curve: false)
11
- / br
12
- / br
13
- / br
9
+ / b Example WIP for charting one question over time
10
+ / = line_chart(eq5d_summary_part.data_for_question_code(1), curve: false)
11
+ / br
12
+ / br
13
+ / br
14
14
 
15
- - return if pos_s_summary_part.rows.blank?
16
- br
17
- br
18
- br
19
- br
20
- .xsss
21
- table.table-header-rotated.toggleable
22
- thead
23
- tr
24
- th.togglers= rows_toggler
25
- th.col-width-date.valign-bottom Date
26
- th.col-width-tiny.valign-bottom Total
27
- - pos_s_summary_part.question_labels.each do |code, label|
28
- th.rotate
29
- div
30
- span= label
15
+ - return if pos_s_summary_part.rows.blank?
31
16
 
32
- - superscript_char = 97
33
- - pos_s_summary_part.rows.each do |row|
34
- tbody
17
+ br
18
+ br
19
+ br
20
+ br
21
+ .xsss
22
+ table.table-header-rotated.toggleable
23
+ thead
35
24
  tr
36
- td= row_toggler
37
- td= row.answered_on
38
- td= row.total_score
25
+ th.togglers= rows_toggler
26
+ th.col-width-date.valign-bottom Date
27
+ th.col-width-tiny.valign-bottom Total
39
28
  - pos_s_summary_part.question_labels.each do |code, label|
40
- - value = row.send(code.to_sym)
41
- - patient_question_text = row.try(:"#{code}_patient_question_text")
42
- td(class="pos-s--#{value}")
43
- - if patient_question_text
44
- span(title="Toggle row for question text")= value
45
- sup= superscript_char.chr
46
- - superscript_char += 1
47
- - else
48
- = value
49
- tr
50
- td
51
- td
52
- td
53
- td(class="summary-part--pos_s-patient-question-text" colspan=(pos_s_summary_part.question_labels.count ))
54
- - superscript_char = 97
29
+ th.rotate
30
+ div
31
+ span= label
32
+
33
+ - superscript_char = 97
34
+ - pos_s_summary_part.rows.each do |row|
35
+ tbody
36
+ tr
37
+ td= row_toggler
38
+ td= row.answered_on
39
+ td= row.total_score
55
40
  - pos_s_summary_part.question_labels.each do |code, label|
41
+ - value = row.send(code.to_sym)
56
42
  - patient_question_text = row.try(:"#{code}_patient_question_text")
57
- - if patient_question_text
58
- sup= superscript_char.chr
59
- |  
60
- span= patient_question_text
61
- |   
62
- - superscript_char += 1
43
+ td(class="pos-s--#{value}")
44
+ - if patient_question_text
45
+ span(title="Toggle row for question text")= value
46
+ sup= superscript_char.chr
47
+ - superscript_char += 1
48
+ - else
49
+ = value
50
+ tr
51
+ td
52
+ td
53
+ td
54
+ td(class="summary-part--pos_s-patient-question-text" colspan=(pos_s_summary_part.question_labels.count ))
55
+ - superscript_char = 97
56
+ - pos_s_summary_part.question_labels.each do |code, label|
57
+ - patient_question_text = row.try(:"#{code}_patient_question_text")
58
+ - if patient_question_text
59
+ sup= superscript_char.chr
60
+ |  
61
+ span= patient_question_text
62
+ |   
63
+ - superscript_char += 1
63
64
 
64
- / Colour-coded key
65
- dl.pos-s-key
66
- dt.pos-s--0 0
67
- dd Not at all
68
- dt.pos-s--1 1
69
- dd Slightly
70
- dt.pos-s--2 2
71
- dd Moderately
72
- dt.pos-s--3 3
73
- dd Severely
74
- dt.pos-s--4 4
75
- dd Overwhelmingly
65
+ / Colour-coded key
66
+ dl.pos-s-key
67
+ dt.pos-s--0 0
68
+ dd Not at all
69
+ dt.pos-s--1 1
70
+ dd Slightly
71
+ dt.pos-s--2 2
72
+ dd Moderately
73
+ dt.pos-s--3 3
74
+ dd Severely
75
+ dt.pos-s--4 4
76
+ dd Overwhelmingly