renalware-core 2.0.0.pre.rc9 → 2.0.0.pre.rc10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/renalware/modules/_clinics.scss +1 -1
  3. data/app/assets/stylesheets/renalware/modules/_letters.scss +7 -0
  4. data/app/assets/stylesheets/renalware/partials/_navigation.scss +1 -1
  5. data/app/controllers/renalware/api/ukrdc/patients_controller.rb +2 -1
  6. data/app/controllers/renalware/application_controller.rb +13 -0
  7. data/app/controllers/renalware/base_controller.rb +0 -2
  8. data/app/controllers/renalware/concerns/cache_busting.rb +21 -0
  9. data/app/controllers/renalware/devise/passwords_controller.rb +0 -2
  10. data/app/controllers/renalware/devise/registrations_controller.rb +0 -2
  11. data/app/controllers/renalware/devise/sessions_controller.rb +0 -2
  12. data/app/controllers/renalware/events/events_controller.rb +2 -0
  13. data/app/controllers/renalware/letters/letters_controller.rb +1 -1
  14. data/app/controllers/renalware/pd/bag_types_controller.rb +1 -1
  15. data/app/controllers/renalware/virology/dashboards_controller.rb +15 -0
  16. data/app/controllers/renalware/virology/vaccinations_controller.rb +11 -0
  17. data/app/documents/renalware/patient_document.rb +9 -0
  18. data/app/jobs/hl7_message_example.yml +12 -12
  19. data/app/models/renalware/events/event.rb +28 -3
  20. data/app/models/renalware/pathology/create_observation_requests.rb +2 -1
  21. data/app/models/renalware/pathology/observation_description.rb +2 -0
  22. data/app/models/renalware/pathology/observation_descriptions_by_code_query.rb +2 -1
  23. data/app/models/renalware/pathology/observation_requests_attributes_builder.rb +14 -1
  24. data/app/models/renalware/pd/bag_type.rb +2 -0
  25. data/app/models/renalware/pd/capd_regime.rb +5 -1
  26. data/app/models/renalware/virology.rb +13 -0
  27. data/app/models/renalware/virology/profile.rb +8 -0
  28. data/app/models/renalware/virology/vaccination.rb +24 -0
  29. data/app/policies/renalware/virology/dasboard_policy.rb +8 -0
  30. data/app/policies/renalware/virology/vaccination_policy.rb +8 -0
  31. data/app/presenters/renalware/admissions/summary_part.rb +30 -0
  32. data/app/presenters/renalware/events/summary_part.rb +31 -0
  33. data/app/presenters/renalware/letters/summary_part.rb +48 -0
  34. data/app/presenters/renalware/medications/summary_part.rb +23 -0
  35. data/app/presenters/renalware/problems/summary_part.rb +19 -0
  36. data/app/presenters/renalware/renal/clinical_summary_presenter.rb +5 -90
  37. data/app/presenters/renalware/summary_part.rb +34 -0
  38. data/app/views/renalware/admissions/_summary_part.html.slim +14 -0
  39. data/app/views/renalware/clinical/_header.html.slim +3 -3
  40. data/app/views/renalware/clinics/visits/index.html.slim +0 -1
  41. data/app/views/renalware/events/events/_event.html.slim +2 -2
  42. data/app/views/renalware/events/events/_form.html.slim +1 -2
  43. data/app/views/renalware/events/events/_summary_part.html.slim +15 -0
  44. data/app/views/renalware/events/events/new.js.erb +2 -3
  45. data/app/views/renalware/events/events/simple/_event.html.slim +1 -2
  46. data/app/views/renalware/layouts/_patient.html.slim +1 -0
  47. data/app/views/renalware/letters/_summary_part.html.slim +16 -0
  48. data/app/views/renalware/letters/letters/index.html.slim +3 -3
  49. data/app/views/renalware/mdm_patients/_table.html.slim +1 -1
  50. data/app/views/renalware/medications/_summary_part.html.slim +18 -0
  51. data/app/views/renalware/patients/clinical_summaries/show.html.slim +6 -32
  52. data/app/views/renalware/patients/patients/_form.html.slim +13 -0
  53. data/app/views/renalware/patients/patients/show.html.slim +2 -0
  54. data/app/views/renalware/patients/patients/show/_psychosocial.html.slim +15 -0
  55. data/app/views/renalware/patients/side_menu/_general.html.slim +4 -0
  56. data/app/views/renalware/problems/problems/_summary_part.html.slim +16 -0
  57. data/app/views/renalware/virology/dashboards/_actions.html.slim +10 -0
  58. data/app/views/renalware/virology/dashboards/show.html.slim +6 -0
  59. data/app/views/renalware/virology/vaccinations/_cell.html.slim +2 -0
  60. data/app/views/renalware/virology/vaccinations/_inputs.html.slim +4 -0
  61. data/app/views/renalware/virology/vaccinations/_list.html.slim +14 -0
  62. data/app/views/renalware/virology/vaccinations/_toggled_cell.html.slim +8 -0
  63. data/config/locales/en-GB.yml +1 -3
  64. data/config/locales/en.yml +0 -11
  65. data/config/locales/renalware/age.yml +0 -1
  66. data/config/locales/renalware/clinical/allergies.en.yml +0 -3
  67. data/config/locales/renalware/clinical/body_composition.yml +0 -2
  68. data/config/locales/renalware/clinical/dry_weight.en.yml +0 -2
  69. data/config/locales/renalware/clinics/visit.yml +0 -2
  70. data/config/locales/renalware/feeds/file.en.yml +0 -1
  71. data/config/locales/renalware/hd/diary_slots.en.yml +0 -1
  72. data/config/locales/renalware/hd/prescription_administration.en.yml +0 -1
  73. data/config/locales/renalware/hd/session.en.yml +0 -1
  74. data/config/locales/renalware/hospitals/unit.yml +0 -2
  75. data/config/locales/renalware/letters/contact.en.yml +0 -1
  76. data/config/locales/renalware/letters/letter.en.yml +0 -2
  77. data/config/locales/renalware/low_clearance/profile.en.yml +0 -1
  78. data/config/locales/renalware/medications/prescription.yml +0 -2
  79. data/config/locales/renalware/messaging/internal/messages.en.yml +0 -2
  80. data/config/locales/renalware/patient.yml +0 -2
  81. data/config/locales/renalware/patients/side_menu.en.yml +1 -1
  82. data/config/locales/renalware/pd/assessments.en.yml +0 -1
  83. data/config/locales/renalware/pd/bag_types.yml +0 -2
  84. data/config/locales/renalware/pd/regime.en.yml +0 -2
  85. data/config/locales/renalware/pd/training_sessions.en.yml +0 -1
  86. data/config/locales/renalware/renal/profile.en.yml +0 -1
  87. data/config/locales/renalware/renal/registry.en.yml +0 -2
  88. data/config/locales/renalware/research/study_participant.en.yml +0 -1
  89. data/config/locales/renalware/snippets/snippets.en.yml +0 -1
  90. data/config/locales/renalware/transplants/donation.yml +0 -3
  91. data/config/locales/renalware/transplants/donor_followup.yml +0 -4
  92. data/config/locales/renalware/transplants/donor_operation.yml +0 -4
  93. data/config/locales/renalware/transplants/donor_workup.yml +0 -4
  94. data/config/locales/renalware/transplants/recipient_followup.yml +0 -2
  95. data/config/locales/renalware/transplants/recipient_operation.yml +0 -4
  96. data/config/locales/renalware/transplants/recipient_workup.yml +0 -4
  97. data/config/locales/renalware/transplants/registration.yml +0 -4
  98. data/config/locales/renalware/virology/virology.en.yml +18 -0
  99. data/config/routes.rb +8 -0
  100. data/db/migrate/20180122173922_create_virology_profiles.rb +6 -0
  101. data/db/migrate/20180213171805_add_display_order_cols_to_observation_descriptions.rb +12 -0
  102. data/db/seeds/default/events/event_types.csv +1 -0
  103. data/db/seeds/default/pathology/measurement_units.csv +45 -38
  104. data/db/seeds/default/pathology/measurement_units.rb +1 -0
  105. data/lib/renalware/configuration.rb +14 -0
  106. data/lib/renalware/engine.rb +0 -4
  107. data/lib/renalware/version.rb +1 -1
  108. data/lib/sql/index_case_stmt.rb +6 -6
  109. data/spec/factories/events/events_types.rb +6 -0
  110. data/spec/factories/virology/vaccinations.rb +6 -0
  111. metadata +265 -243
  112. data/app/controllers/application_controller.rb +0 -6
  113. data/app/models/renalware/pathology/view_current_observation_results.rb.dead +0 -47
  114. data/app/presenters/renalware/pathology/current_observation_results.dead/html_table_view.rb.dead +0 -67
  115. data/app/views/renalware/layouts/application.html.slim +0 -44
  116. data/app/views/renalware/patients/clinical_summaries/_admissions.html.slim +0 -11
  117. data/app/views/renalware/patients/clinical_summaries/_events.html.slim +0 -11
  118. data/app/views/renalware/patients/clinical_summaries/_letters.html.slim +0 -12
  119. data/app/views/renalware/patients/clinical_summaries/_prescriptions.html.slim +0 -16
  120. data/app/views/renalware/patients/clinical_summaries/_problems.html.slim +0 -13
@@ -1,6 +0,0 @@
1
-
2
- class ApplicationController < ActionController::Base
3
- # Prevent CSRF attacks by raising an exception.
4
- # For APIs, you may want to use :null_session instead.
5
- protect_from_forgery with: :exception
6
- end
@@ -1,47 +0,0 @@
1
- require_dependency "renalware/pathology"
2
-
3
- module Renalware
4
- module Pathology
5
- class ViewCurrentObservationResults
6
- def initialize(patient, presenter, descriptions: default_descriptions)
7
- @patient = patient
8
- @descriptions = descriptions
9
- @presenter = presenter
10
- end
11
-
12
- def call(_params = {})
13
- # Get an array of observations for the requested descriptions
14
- results = find_current_observations_for_descriptions
15
- # Although we now have all the observations, they are not in the right order.
16
- # Hence this sort by description code.
17
- sorted_results = sort_results(results)
18
- present(sorted_results)
19
- end
20
-
21
- private
22
-
23
- def find_current_observations_for_descriptions
24
- CurrentObservationsForDescriptionsQuery
25
- .new(patient: @patient, descriptions: @descriptions)
26
- .call
27
- end
28
-
29
- def sort_results(results)
30
- @descriptions.map { |description| find_result_for_description(results, description) }
31
- .compact
32
- end
33
-
34
- def find_result_for_description(results, description)
35
- results.detect { |result| result.description_code == description.code }
36
- end
37
-
38
- def present(results)
39
- @presenter.present(results)
40
- end
41
-
42
- def default_descriptions
43
- RelevantObservationDescription.all
44
- end
45
- end
46
- end
47
- end
@@ -1,67 +0,0 @@
1
- require_dependency "renalware/pathology"
2
-
3
- module Renalware
4
- module Pathology
5
- # Responsible for rendering a HTML table for recent observation results.
6
- #
7
- class CurrentObservationResults::HTMLTableView < SimpleDelegator
8
- def render(view_model)
9
- header, *body = view_model
10
-
11
- content_tag(:div) do
12
- slice_size = calculate_slice_size(body.size)
13
- body.each_slice(slice_size) do |partial_body|
14
- concat(build_table(header, partial_body))
15
- end
16
- end
17
- end
18
-
19
- private
20
-
21
- def calculate_slice_size(number)
22
- (number.to_f / number_of_columns).ceil
23
- end
24
-
25
- def number_of_columns
26
- 3
27
- end
28
-
29
- def build_table(header, body)
30
- content_tag(:table, id: "observations", class: "current-observations") do
31
- concat(format_header(header))
32
- concat(format_body(body))
33
- end
34
- end
35
-
36
- def format_header(cells)
37
- content_tag(:thead) do
38
- content_tag(:tr) do
39
- cells.each do |cell|
40
- concat(format_header_cell(cell))
41
- end
42
- end
43
- end
44
- end
45
-
46
- def format_body(rows)
47
- content_tag(:tbody) do
48
- rows.each do |row|
49
- concat(content_tag(:tr) do
50
- row.each do |cell|
51
- concat(format_body_cell(cell))
52
- end
53
- end)
54
- end
55
- end
56
- end
57
-
58
- def format_header_cell(cell)
59
- content_tag(:th, cell)
60
- end
61
-
62
- def format_body_cell(cell)
63
- content_tag(:td, cell.content)
64
- end
65
- end
66
- end
67
- end
@@ -1,44 +0,0 @@
1
- doctype html
2
- html lang="en"
3
- head
4
- meta charset="utf-8"
5
- meta name="viewport" content="width=device-width, initial-scale=1.0"
6
-
7
- - if defined?(page_title)
8
- title= page_title
9
-
10
- = stylesheet_link_tag "renalware/application", media: :all
11
- = javascript_include_tag "renalware/modernizr"
12
- = csrf_meta_tag
13
- link(rel="apple-touch-icon" sizes="180x180" href="#{image_path('renalware/favicon/apple-touch-icon.png')}")
14
- link(rel="icon" type="image/png" sizes="32x32" href="#{image_path('renalware/favicon/favicon-32x32.png')}")
15
- link(rel="icon" type="image/png" sizes="16x16" href="#{image_path('renalware/favicon/favicon-16x16.png')}")
16
- link(rel="manifest" href="#{image_path('renalware/favicon/manifest.json')}")
17
- link(rel="mask-icon" href="#{image_path('renalware/favicon/safari-pinned-tab.svg')}" color="#5bbad5")
18
- meta(name="theme-color" content="#ffffff")
19
-
20
- body(class="#{yield(:body_class)}")
21
- #modals-wrapper
22
- .page
23
- .sticky-top
24
- - if Renalware.config.display_feedback_banner
25
- = render "renalware/system/user_feedback/banner"
26
- - if content_for?(:top_navigation)
27
- = yield :top_navigation
28
- - else
29
- = render "renalware/navigation/main"
30
- = yield(:header)
31
-
32
- - if defined?(flash_messages)
33
- = render "renalware/shared/flash_messages"
34
-
35
- main
36
- .main-content
37
- = yield
38
-
39
- - unless user_signed_in?
40
- = render "renalware/navigation/footer"
41
- /- load_js_asynchonously = (Rails.env.staging? || Rails.env.production?)
42
- - load_js_asynchonously = false
43
- = javascript_include_tag "renalware/application", async: load_js_asynchonously
44
- = yield(:javascript)
@@ -1,11 +0,0 @@
1
- article
2
- header
3
- h2= "Admissions (#{admissions_count})"
4
-
5
- ul
6
- li= link_to admissions_admissions_path(query: { term: patient.nhs_number }), class: "button" do
7
- | View All
8
-
9
- = render "renalware/admissions/admissions/table",
10
- admissions: admissions,
11
- compact: true
@@ -1,11 +0,0 @@
1
- article
2
- header
3
- h2= link_to "Events (#{current_events_count})", patient_events_path(patient)
4
-
5
- ul
6
- li= link_to new_patient_event_path(patient), class: "button" do
7
- | Add
8
- li= link_to patient_events_path(patient), class: "button" do
9
- | View All
10
-
11
- = render "renalware/events/events/table", events: events
@@ -1,12 +0,0 @@
1
- article
2
- header
3
- h2
4
- = link_to "Letters (#{letters_count})", patient_letters_letters_path(patient)
5
-
6
- ul
7
- li= link_to patient_letters_letters_path(patient), class: "button" do
8
- | Draft letter
9
- li= link_to patient_letters_letters_path(patient), class: "button" do
10
- | View All
11
-
12
- = render "renalware/letters/letters/table", letters: letters
@@ -1,16 +0,0 @@
1
- article
2
- header
3
- h2
4
- = link_to "Current Prescriptions (#{prescriptions.length})",
5
- patient_prescriptions_path(patient)
6
-
7
- = link_to patient_prescriptions_path(patient), class: "button" do
8
- | Add
9
-
10
- ul.no-bullet
11
- - prescriptions.each do |prescription|
12
- li class="drug-#{drug_types_colour_tag(prescription.drug_types)}"
13
- = "#{prescription.drug.name}, "
14
- = "#{prescription.dose}, "
15
- = "#{prescription.medication_route.code} #{prescription.frequency} - "
16
- = l(prescription.prescribed_on)
@@ -1,13 +0,0 @@
1
- article
2
- header
3
- h2
4
- = link_to "Problems (#{problems.length})", patient_problems_path(patient)
5
-
6
- = link_to patient_problems_path(patient), class: "button" do
7
- | Add
8
-
9
- ul.no-bullet
10
- - problems.each do |problem|
11
- li
12
- = problem.full_description
13
- = " - #{l(problem.created_at.to_date)}"