renalware-core 2.0.113 → 2.0.115

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 (194) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -2
  3. data/app/assets/javascripts/renalware/application.js.erb +0 -1
  4. data/app/assets/javascripts/renalware/feed_only_inputs.js.erb +26 -0
  5. data/app/assets/javascripts/renalware/feeds.js +50 -0
  6. data/app/assets/javascripts/renalware/person_ajax_search.js +43 -0
  7. data/app/assets/stylesheets/renalware/application.scss +0 -1
  8. data/app/assets/stylesheets/renalware/modules/_admin.scss +7 -0
  9. data/app/assets/stylesheets/renalware/modules/_pathology.scss +1 -1
  10. data/app/assets/stylesheets/renalware/modules/_patients.scss +6 -0
  11. data/app/assets/stylesheets/renalware/modules/_snippets.scss +2 -2
  12. data/app/assets/stylesheets/renalware/partials/_forms.scss +5 -1
  13. data/app/assets/stylesheets/renalware/partials/_layout.scss +4 -0
  14. data/app/{views/renalware/patients/_side_menu.html.slim → components/renalware/patients/side_menu_component.html.slim} +0 -0
  15. data/app/components/renalware/patients/side_menu_component.rb +18 -0
  16. data/app/controllers/renalware/clinical/body_compositions_controller.rb +6 -0
  17. data/app/controllers/renalware/feeds/hl7_test_messages_controller.rb +60 -0
  18. data/app/controllers/renalware/hd/mdm_patients_controller.rb +16 -6
  19. data/app/controllers/renalware/hd/scheduling/diaries_controller.rb +91 -0
  20. data/app/controllers/renalware/hd/scheduling/diary_slots_controller.rb +169 -0
  21. data/app/controllers/renalware/hd/session_forms/batches_controller.rb +1 -1
  22. data/app/controllers/renalware/pathology/observation_requests_controller.rb +23 -4
  23. data/app/controllers/renalware/pathology/requests/requests_controller.rb +0 -4
  24. data/app/controllers/renalware/patients/abridgements_controller.rb +39 -0
  25. data/app/controllers/renalware/pd/regimes_controller.rb +26 -0
  26. data/app/controllers/renalware/problems/problems_controller.rb +2 -2
  27. data/app/helpers/renalware/application_helper.rb +9 -0
  28. data/app/helpers/renalware/article_helper.rb +18 -0
  29. data/app/helpers/renalware/form_helper.rb +3 -2
  30. data/app/helpers/renalware/users_helper.rb +5 -1
  31. data/app/javascript/controllers/clipboard_controller.js +16 -0
  32. data/app/javascript/packs/renalware_core.js +20 -0
  33. data/app/jobs/feed_job.rb +1 -3
  34. data/app/jobs/hl7_message_example.yml +2 -2
  35. data/app/models/renalware/feeds/files/practice_memberships/import_job.rb +3 -0
  36. data/app/models/renalware/feeds/files/primary_care_physicians/import_job.rb +2 -0
  37. data/app/models/renalware/feeds/hl7_message.rb +57 -6
  38. data/app/models/renalware/feeds/hl7_test_form.rb +10 -0
  39. data/app/models/renalware/feeds/hl7_test_message.rb +11 -0
  40. data/app/models/renalware/feeds/message_parser.rb +6 -2
  41. data/app/models/renalware/feeds/message_processor.rb +44 -32
  42. data/app/models/renalware/feeds/persist_message.rb +9 -3
  43. data/app/models/renalware/feeds.rb +2 -0
  44. data/app/models/renalware/hd/scheduling/archive_arguments.rb +19 -0
  45. data/app/models/renalware/hd/scheduling/diary.rb +54 -0
  46. data/app/models/renalware/hd/scheduling/diary_housekeeping_job.rb +84 -0
  47. data/app/models/renalware/hd/scheduling/diary_range.rb +69 -0
  48. data/app/models/renalware/hd/scheduling/diary_slot.rb +88 -0
  49. data/app/models/renalware/hd/scheduling/find_or_create_diary_by_week_query.rb +52 -0
  50. data/app/models/renalware/hd/scheduling/find_or_create_master_diary.rb +27 -0
  51. data/app/models/renalware/hd/scheduling/master_diary.rb +35 -0
  52. data/app/models/renalware/hd/scheduling/weekly_diary.rb +47 -0
  53. data/app/models/renalware/pathology/message_listener.rb +2 -2
  54. data/app/models/renalware/pathology/requests/global_rule/latest_crf_older_than_weeks.rb +38 -0
  55. data/app/models/renalware/pathology/requests/global_rule/patient_is_diabetic.rb +1 -1
  56. data/app/models/renalware/patient.rb +1 -1
  57. data/app/models/renalware/patients/abridgement.rb +18 -0
  58. data/app/models/renalware/patients/abridgement_search_form.rb +12 -0
  59. data/app/models/renalware/patients/ingestion/command.rb +25 -0
  60. data/app/models/renalware/patients/ingestion/command_factory.rb +135 -0
  61. data/app/models/renalware/patients/ingestion/commands/add_or_update_patient.rb +65 -0
  62. data/app/models/renalware/patients/ingestion/message_listener.rb +21 -0
  63. data/app/models/renalware/patients/ingestion/message_mapper.rb +26 -0
  64. data/app/models/renalware/patients/ingestion/message_mappers/patient.rb +73 -0
  65. data/app/models/renalware/patients/ingestion/update_master_patient_index.rb +60 -0
  66. data/app/models/renalware/patients/ingestion/update_master_patient_index_job.rb.dead +20 -0
  67. data/app/models/renalware/patients.rb +4 -3
  68. data/app/models/renalware/problems/problem.rb +6 -2
  69. data/app/models/renalware/ukrdc/incoming/paths.rb +6 -7
  70. data/app/policies/renalware/admin/devops_policy.rb +18 -0
  71. data/app/policies/renalware/hd/{diary_policy.rb → scheduling/diary_policy.rb} +3 -1
  72. data/app/presenters/renalware/clinical/profile_presenter.rb +2 -1
  73. data/app/presenters/renalware/directory/person_auto_complete_presenter.rb +1 -1
  74. data/app/presenters/renalware/hd/scheduling/diary_presenter.rb +84 -0
  75. data/app/presenters/renalware/hd/scheduling/diary_slot_presenter.rb +74 -0
  76. data/app/presenters/renalware/hd/scheduling/null_slot.rb +42 -0
  77. data/app/presenters/renalware/pd/dashboard_presenter.rb +3 -2
  78. data/app/views/renalware/accesses/procedures/_form.html.slim +5 -1
  79. data/app/views/renalware/accesses/procedures/_list.html.slim +11 -4
  80. data/app/views/renalware/accesses/procedures/show.html.slim +17 -19
  81. data/app/views/renalware/addresses/_form.html.slim +17 -12
  82. data/app/views/renalware/admin/cache/show.html.slim +24 -0
  83. data/app/views/renalware/clinical/body_compositions/_list.html.slim +7 -43
  84. data/app/views/renalware/clinical/body_compositions/_table.html.slim +42 -0
  85. data/app/views/renalware/clinical/body_compositions/index.html.slim +9 -0
  86. data/app/views/renalware/clinical/dry_weights/_list.html.slim +2 -8
  87. data/app/views/renalware/clinical/dry_weights/_table.html.slim +7 -0
  88. data/app/views/renalware/clinical/profiles/show.html.slim +4 -2
  89. data/app/views/renalware/feeds/hl7_test_messages/create.js.erb +10 -0
  90. data/app/views/renalware/feeds/hl7_test_messages/new.slim +18 -0
  91. data/app/views/renalware/hd/mdm_patients/_filters.html.slim +0 -11
  92. data/app/views/renalware/hd/mdm_patients/_page_actions.html.slim +29 -0
  93. data/app/views/renalware/hd/mdm_patients/index.html.slim +7 -4
  94. data/app/views/renalware/hd/{diaries → scheduling/diaries}/_page_actions.html.slim +4 -4
  95. data/app/views/renalware/hd/{diaries → scheduling/diaries}/_table.html.slim +0 -0
  96. data/app/views/renalware/hd/{diaries → scheduling/diaries}/_weekly_diary.html.slim +1 -1
  97. data/app/views/renalware/hd/{diaries → scheduling/diaries}/edit.html.slim +6 -6
  98. data/app/views/renalware/hd/{diaries → scheduling/diaries}/index.html.slim +0 -0
  99. data/app/views/renalware/hd/{diaries → scheduling/diaries}/show.pdf.slim +0 -0
  100. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/_form.html.slim +15 -6
  101. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/_slot.html.slim +2 -2
  102. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/_tab.html.slim +1 -1
  103. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/create.js.erb +1 -1
  104. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/destroy.js.erb +1 -1
  105. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/edit.html.slim +2 -2
  106. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/new.html.slim +0 -0
  107. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/new.js.erb +0 -0
  108. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/show.js.erb +0 -0
  109. data/app/views/renalware/hd/{diary_slots → scheduling/diary_slots}/update.js.erb +1 -1
  110. data/app/views/renalware/hospitals/units/index.html.slim +2 -2
  111. data/app/views/renalware/layouts/_patient.html.slim +2 -1
  112. data/app/views/renalware/letters/contacts/_form.html.slim +10 -13
  113. data/app/views/renalware/letters/letters/_form.html.slim +2 -9
  114. data/app/views/renalware/navigation/_developer.html.slim +4 -0
  115. data/app/views/renalware/navigation/_menu.html.slim +2 -0
  116. data/app/views/renalware/pathology/observation_requests/_filters.html.slim +17 -0
  117. data/app/views/renalware/pathology/observation_requests/index.html.slim +2 -1
  118. data/app/views/renalware/patients/_layout.html.slim +1 -1
  119. data/app/views/renalware/patients/_side_menu.html.slim.dead +7 -0
  120. data/app/views/renalware/patients/abridgements/_abridgement.html.slim +8 -0
  121. data/app/views/renalware/patients/abridgements/_table.html.slim +12 -0
  122. data/app/views/renalware/patients/abridgements/index.html.slim +22 -0
  123. data/app/views/renalware/patients/alerts/create.json +3 -0
  124. data/app/views/renalware/patients/patients/_form.html.slim +36 -17
  125. data/app/views/renalware/patients/patients/edit.html.slim +1 -1
  126. data/app/views/renalware/patients/patients/new.html.slim +1 -1
  127. data/app/views/renalware/patients/side_menu/_actions.html.slim +2 -0
  128. data/app/views/renalware/pd/_apd_regimes.html.slim +1 -1
  129. data/app/views/renalware/pd/_capd_regimes.html.slim +1 -1
  130. data/app/views/renalware/pd/dashboards/show/_apd_regimes.html.slim +11 -2
  131. data/app/views/renalware/pd/dashboards/show/_capd_regimes.html.slim +11 -2
  132. data/app/views/renalware/pd/regimes/index.html.slim +7 -0
  133. data/app/views/renalware/renal/profiles/_form.html.slim +7 -24
  134. data/app/views/renalware/shared/documents/_binary_marker_input.html.slim +2 -2
  135. data/app/views/renalware/shared/documents/_blood_group_input.html.slim +4 -2
  136. data/app/views/renalware/transplants/registrations/_form.html.slim +22 -17
  137. data/config/locales/renalware/clinical/body_composition.yml +6 -3
  138. data/config/locales/renalware/clinical/dry_weight.en.yml +4 -3
  139. data/config/locales/renalware/hd/diary_slots.en.yml +3 -2
  140. data/config/locales/renalware/letters/contact.en.yml +0 -2
  141. data/config/routes/feeds.rb +5 -0
  142. data/config/routes/hd.rb +11 -7
  143. data/config/routes/letters.rb +0 -5
  144. data/config/routes/patients.rb +1 -0
  145. data/config/routes/pd.rb +2 -2
  146. data/config/routes/renal.rb +0 -5
  147. data/config/routes.rb +1 -0
  148. data/config/webpack/development.js +5 -0
  149. data/config/webpack/environment.js +3 -0
  150. data/config/webpack/production.js +5 -0
  151. data/config/webpack/test.js +5 -0
  152. data/config/webpacker.yml +103 -0
  153. data/db/functions/hd_diary_archive_elapsed_master_slots_v01.sql +40 -0
  154. data/db/migrate/20190322120025_create_feed_hl7_test_messages.rb +12 -0
  155. data/db/migrate/20190325134823_create_patients_master_index.rb +24 -0
  156. data/db/migrate/20190327100851_add_handled_to_feed_messages.rb +5 -0
  157. data/db/migrate/20191012121433_add_consultant_to_users.rb +7 -0
  158. data/db/migrate/20191018143635_create_hd_diary_matrix_view.rb +7 -0
  159. data/db/migrate/20191018144917_create_fn_to_archive_master_slots.rb +9 -0
  160. data/db/views/hd_diary_matrix_v01.sql +38 -0
  161. data/lib/core_extensions/active_record/sort.rb +27 -9
  162. data/lib/renalware/configuration.rb +3 -0
  163. data/lib/renalware/engine.rb +31 -0
  164. data/lib/renalware/version.rb +1 -1
  165. data/lib/renalware/week_period.rb +8 -7
  166. data/lib/renalware.rb +13 -1
  167. data/lib/tasks/hd.rake +7 -0
  168. data/lib/tasks/pathology.rake +1 -1
  169. data/lib/tasks/renalware.rake +89 -4
  170. data/spec/factories/hd/scheduling/diaries.rb +18 -0
  171. data/spec/factories/hd/{slots.rb → scheduling/slots.rb} +1 -1
  172. data/spec/factories/patients/abridgements.rb +9 -0
  173. data/spec/support/hl7_helpers.rb +13 -0
  174. data/spec/support/pages/letters/form.rb +4 -1
  175. metadata +126 -50
  176. data/app/assets/javascripts/renalware/auto_complete.js +0 -63
  177. data/app/controllers/renalware/hd/diaries_controller.rb +0 -89
  178. data/app/controllers/renalware/hd/diary_slots_controller.rb +0 -175
  179. data/app/controllers/renalware/letters/descriptions_controller.rb +0 -22
  180. data/app/controllers/renalware/renal/prd_descriptions_controller.rb +0 -15
  181. data/app/models/renalware/hd/archive_yesterdays_slots_job.rb +0 -69
  182. data/app/models/renalware/hd/diary.rb +0 -41
  183. data/app/models/renalware/hd/diary_slot.rb +0 -83
  184. data/app/models/renalware/hd/find_or_create_diary_by_week_query.rb +0 -50
  185. data/app/models/renalware/hd/find_or_create_master_diary.rb +0 -26
  186. data/app/models/renalware/hd/master_diary.rb +0 -32
  187. data/app/models/renalware/hd/weekly_diary.rb +0 -45
  188. data/app/models/renalware/renal/prd_descriptions/search_query.rb +0 -35
  189. data/app/presenters/renalware/hd/diary_presenter.rb +0 -79
  190. data/app/presenters/renalware/hd/diary_slot_presenter.rb +0 -72
  191. data/app/presenters/renalware/hd/null_slot.rb +0 -40
  192. data/app/views/renalware/renal/prd_descriptions/search.json.jbuilder +0 -6
  193. data/lib/test_support/autocomplete_helpers.rb +0 -14
  194. data/spec/factories/hd/diaries.rb +0 -14
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "renalware/hd"
4
+
5
+ module Renalware
6
+ module HD
7
+ module Scheduling
8
+ NullSlot = Naught.build do |config|
9
+ config.black_hole
10
+ config.define_explicit_conversions
11
+ config.predicates_return false
12
+
13
+ attr_reader :diary_id, :diurnal_period_code_id, :station_id, :day_of_week
14
+
15
+ def initialize(diary_id, diurnal_period_code_id, station_id, day_of_week)
16
+ @diary_id = diary_id
17
+ @diurnal_period_code_id = diurnal_period_code_id
18
+ @station_id = station_id
19
+ @day_of_week = day_of_week
20
+ end
21
+
22
+ def master?
23
+ false
24
+ end
25
+
26
+ def cell_id
27
+ "#{diurnal_period_code_id}-#{station_id}-#{day_of_week}"
28
+ end
29
+
30
+ def cache_key
31
+ [
32
+ self.class.name,
33
+ diary_id,
34
+ diurnal_period_code_id,
35
+ station_id,
36
+ day_of_week
37
+ ].join("-")
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -7,6 +7,7 @@ module Renalware
7
7
  module PD
8
8
  class DashboardPresenter
9
9
  include PresenterHelper
10
+ include Renalware::Concerns::Pageable
10
11
 
11
12
  attr_accessor :patient
12
13
 
@@ -19,11 +20,11 @@ module Renalware
19
20
  end
20
21
 
21
22
  def capd_regimes
22
- @capd_regimes ||= CAPDRegime.for_patient(patient).with_bags.ordered
23
+ @capd_regimes ||= CAPDRegime.for_patient(patient).with_bags.ordered.page(1).per(5)
23
24
  end
24
25
 
25
26
  def apd_regimes
26
- @apd_regimes ||= APDRegime.for_patient(patient).with_bags.ordered
27
+ @apd_regimes ||= APDRegime.for_patient(patient).with_bags.ordered.page(1).per(5)
27
28
  end
28
29
 
29
30
  def peritonitis_episodes
@@ -24,7 +24,11 @@ ruby:
24
24
  label_method: :description,
25
25
  value_method: :code,
26
26
  wrapper: :horizontal_medium
27
- = f.input :notes, as: :text, input_html: { rows: 5 }, wrapper: :horizontal_large
27
+ - target = "procedure-notes-editor"
28
+ = f.label :notes
29
+ = snippets_modal_and_link_to_open_it(target_input_for_seleted_snippet: ".#{target}")
30
+ = f.trix_editor :notes, class: target
31
+ br
28
32
  = f.input :catheter_make, wrapper: :horizontal_small
29
33
  = f.input :catheter_lot_no, wrapper: :horizontal_small
30
34
 
@@ -13,8 +13,6 @@ article.access-procedures
13
13
  th.col-width-tiny Side
14
14
  th Performed By
15
15
  th.col-width-date First Use
16
- th Notes
17
- th Outcome
18
16
 
19
17
  tbody
20
18
  - procedures.each do |procedure|
@@ -23,10 +21,19 @@ article.access-procedures
23
21
  = link_to "View", patient_accesses_procedure_path(patient, procedure)
24
22
  = pipe_separator
25
23
  = 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
26
  td= procedure.performed_on
27
27
  td= procedure.type&.long_name
28
28
  td= procedure.side
29
29
  td= procedure.performed_by
30
30
  td= procedure.first_used_on
31
- td.col-width-mediumish-with-ellipsis(title=procedure.notes)=procedure.notes
32
- td.col-width-mediumish-with-ellipsis(title=procedure.outcome)=procedure.outcome
31
+
32
+ = content_tag(:tr, id: "procedure-quick-preview-#{procedure.id}", style: "display: none")
33
+ td(colspan=6)
34
+ .quick-preview
35
+ dl.dl-horizontal
36
+ dt Notes
37
+ dd= simple_format(procedure.notes)
38
+ dt Outcome
39
+ dd= simple_format(procedure.outcome)
@@ -10,24 +10,22 @@
10
10
  .document-view
11
11
  .grid
12
12
  .row
13
- = render "renalware/shared/attributes_group",
14
- legend: "Access Procedure", destination: "procedure",
15
- models: { procedure => [:performed_on,
16
- :performed_by,
17
- :type,
18
- :side,
19
- :pd_catheter_insertion_technique,
20
- :notes,
21
- :catheter_make,
22
- :catheter_lot_no] }
13
+ .columns.small-12.large-6
14
+ = article_tag "Access Procedure" do
15
+ = definition_list_for(procedure) do |list|
16
+ = list.definition(:performed_on)
17
+ = list.definition(:performed_by)
18
+ = list.definition(:type)
19
+ = list.definition(:side)
20
+ = list.definition(:pd_catheter_insertion_technique)
21
+ = list.definition(:notes) { |str| simple_format(str) }
22
+ = list.definition(:catheter_make)
23
+ = list.definition(:catheter_lot_no)
23
24
 
24
- = render "renalware/shared/attributes_group",
25
- legend: "Follow-up", destination: "followup",
26
- models: { procedure => [:outcome,
27
- :first_used_on,
28
- :failed_on] }
25
+ = render "renalware/shared/attributes_group",
26
+ legend: "Follow-up", destination: "followup",
27
+ models: { procedure => [:outcome, :first_used_on, :failed_on] }
29
28
 
30
- = render "renalware/shared/attributes_group",
31
- legend: "Admin", destination: "notes",
32
- models: { procedure => [:updated_by,
33
- :updated_at] }
29
+ = render "renalware/shared/attributes_group",
30
+ legend: "Admin", destination: "notes",
31
+ models: { procedure => [:updated_by, :updated_at] }
@@ -1,14 +1,19 @@
1
- / = a.input :name,
2
- / placeholder: "If different than above (optional)",
3
- / wrapper: :horizontal_medium
4
- = a.input :street_1, wrapper: :horizontal_large
5
- = a.input :street_2, wrapper: :horizontal_large
6
- = a.input :street_3, wrapper: :horizontal_large
7
- = a.input :town, wrapper: :horizontal_medium
8
- = a.input :county, wrapper: :horizontal_small
9
- = a.input :postcode, wrapper: :horizontal_small
1
+ / line 1 of the address and the postcode are provided by a feed, so when editing a patient address
2
+ / the caller will pass in a controlled_by_feed_options hash - probably containing a data attribute
3
+ / which will cause the input to be disabled.
4
+ / When editing other kinds of addresses, or adding a new patient address, controlled_by_feed_options
5
+ / is not passed in.
6
+ - controlled_by_feed_options = (defined?(:controlled_by_feed_options) && controlled_by_feed_options).presence || {}
7
+
8
+ = a.input :street_1, wrapper: :horizontal_large, input_html: controlled_by_feed_options
9
+ = a.input :street_2, wrapper: :horizontal_large, input_html: controlled_by_feed_options
10
+ = a.input :street_3, wrapper: :horizontal_large, input_html: controlled_by_feed_options
11
+ = a.input :town, wrapper: :horizontal_medium, input_html: controlled_by_feed_options
12
+ = a.input :county, wrapper: :horizontal_small, input_html: controlled_by_feed_options
13
+ = a.input :postcode, wrapper: :horizontal_small, input_html: controlled_by_feed_options
10
14
  = a.input :country_id,
11
15
  collection: Renalware::System::Country.pluck(:name, :id),
12
- wrapper: :horizontal_small
13
- = a.input :telephone, wrapper: :horizontal_medium
14
- = a.input :email, wrapper: :horizontal_medium
16
+ wrapper: :horizontal_small,
17
+ input_html: controlled_by_feed_options
18
+ = a.input :telephone, wrapper: :horizontal_medium, input_html: controlled_by_feed_options
19
+ = a.input :email, wrapper: :horizontal_medium, input_html: controlled_by_feed_options
@@ -42,3 +42,27 @@
42
42
  method: :delete,
43
43
  data: { confirm: "Are you sure you want to clear the PDF letter cache?\n" },
44
44
  class: "button alert"
45
+ br
46
+ br
47
+ br
48
+ br
49
+ br
50
+ br
51
+ br
52
+ br
53
+ br
54
+ br
55
+ br
56
+ br
57
+ br
58
+ br
59
+ br
60
+ br
61
+ br
62
+ br
63
+ hr
64
+ div(data-controller="clipboard")
65
+ input(data-target="clipboard.source" type="text" value="Clipbpoard test" style="width: 100px")
66
+ div(data-target="clipboard.result")
67
+ a(href="#" data-action="clipboard#copy")
68
+ | Copy
@@ -1,48 +1,12 @@
1
1
  article.body_compositions
2
2
  header
3
- h2= t(".title")
4
- = link_to t(".add"),
3
+ h2.title= defined?(limit) ? t(".recent.title") : t(".title")
4
+ ul
5
+ li= link_to t(".add"),
5
6
  new_patient_clinical_body_composition_path(patient),
6
7
  class: "button right"
7
- table
8
- thead
9
- tr
10
- th.col-width-tiny
11
- th.col-width-date= t(".assessed_on")
12
- th.col-width-small= t(".modality_description")
13
- th.col-width-tiny= t(".assessor")
14
- th.col-width-tiny= t(".overhydration")
15
- th.col-width-tiny= t(".volume_of_distribution")
16
- th.col-width-tiny= t(".total_body_water")
17
- th.col-width-tiny= t(".extracellular_water")
18
- th.col-width-tiny= t(".intracellular_water")
19
- th.col-width-tiny= t(".lean_tissue_index")
20
- th.col-width-tiny= t(".fat_tissue_index")
21
- th.col-width-tiny= t(".lean_tissue_mass")
22
- th.col-width-tiny= t(".fat_tissue_mass")
23
- th.col-width-tiny= t(".adipose_tissue_mass")
24
- th.col-width-tiny= t(".body_cell_mass")
25
- th.col-width-tiny= t(".quality_of_reading")
8
+ li= link_to t(".view_all"),
9
+ patient_clinical_body_compositions_path(patient),
10
+ class: "button"
26
11
 
27
- tbody
28
- - body_compositions.each do |body_composition|
29
- tr
30
- td
31
- = link_to "View", patient_clinical_body_composition_path(patient, body_composition)
32
- = pipe_separator
33
- = link_to "Edit", edit_patient_clinical_body_composition_path(patient, body_composition)
34
- td= body_composition.assessed_on
35
- td= body_composition.modality_description&.name
36
- td= body_composition.assessor
37
- td= body_composition.overhydration
38
- td= body_composition.volume_of_distribution
39
- td= body_composition.total_body_water
40
- td= body_composition.extracellular_water
41
- td= body_composition.intracellular_water
42
- td= body_composition.lean_tissue_index
43
- td= body_composition.fat_tissue_index
44
- td= body_composition.lean_tissue_mass
45
- td= body_composition.fat_tissue_mass
46
- td= body_composition.adipose_tissue_mass
47
- td= body_composition.body_cell_mass
48
- td= body_composition.quality_of_reading
12
+ = render "renalware/clinical/body_compositions/table", body_compositions: body_compositions, patient: patient
@@ -0,0 +1,42 @@
1
+ table
2
+ thead
3
+ tr
4
+ th.col-width-tiny
5
+ th.col-width-date= t(".assessed_on")
6
+ th= t(".modality_description")
7
+ th= t(".assessor")
8
+ th.col-width-tiny= t(".overhydration")
9
+ th.col-width-tiny= t(".volume_of_distribution")
10
+ th.col-width-tiny= t(".total_body_water")
11
+ th.col-width-tiny= t(".extracellular_water")
12
+ th.col-width-tiny= t(".intracellular_water")
13
+ th.col-width-tiny= t(".lean_tissue_index")
14
+ th.col-width-tiny= t(".fat_tissue_index")
15
+ th.col-width-tiny= t(".lean_tissue_mass")
16
+ th.col-width-tiny= t(".fat_tissue_mass")
17
+ th.col-width-tiny= t(".adipose_tissue_mass")
18
+ th.col-width-tiny= t(".body_cell_mass")
19
+ th.col-width-tiny= t(".quality_of_reading")
20
+
21
+ tbody
22
+ - body_compositions.each do |body_composition|
23
+ tr
24
+ td
25
+ = link_to "View", patient_clinical_body_composition_path(patient, body_composition)
26
+ = pipe_separator
27
+ = link_to "Edit", edit_patient_clinical_body_composition_path(patient, body_composition)
28
+ td= body_composition.assessed_on
29
+ td= body_composition.modality_description&.name
30
+ td= body_composition.assessor
31
+ td= body_composition.overhydration
32
+ td= body_composition.volume_of_distribution
33
+ td= body_composition.total_body_water
34
+ td= body_composition.extracellular_water
35
+ td= body_composition.intracellular_water
36
+ td= body_composition.lean_tissue_index
37
+ td= body_composition.fat_tissue_index
38
+ td= body_composition.lean_tissue_mass
39
+ td= body_composition.fat_tissue_mass
40
+ td= body_composition.adipose_tissue_mass
41
+ td= body_composition.body_cell_mass
42
+ td= body_composition.quality_of_reading
@@ -0,0 +1,9 @@
1
+ = within_patient_layout( \
2
+ title: "Body Composition Measurements",
3
+ breadcrumbs: clinical_profile_breadcrumb(patient)) do
4
+
5
+ = render "renalware/clinical/body_compositions/table",
6
+ body_compositions: body_compositions,
7
+ patient: patient
8
+
9
+ = paginate body_compositions
@@ -11,12 +11,6 @@ article.dry-weights.simple.simple-table
11
11
  h2.title= defined?(limit) ? t(".recent.title") : t(".title")
12
12
  ul
13
13
  li= link_to t(".add"), new_patient_clinical_dry_weight_path(patient), class: "button"
14
- li= link_to t(".view_all"), patient_clinical_dry_weights_path(patient), class: "button"
14
+ li= link_to t(".view_all"), patient_clinical_dry_weights_path(patient), class: "button secondary"
15
15
 
16
- table.auto-layout
17
- thead
18
- th.col-width-date= t(".date")
19
- th.col-width-small= t(".weight")
20
- th= t(".assessor")
21
- tbody
22
- = render presenter.dry_weights
16
+ = render "renalware/clinical/dry_weights/table", dry_weights: presenter.dry_weights
@@ -0,0 +1,7 @@
1
+ table.auto-layout
2
+ thead
3
+ th.col-width-date= t(".date")
4
+ th.col-width-small= t(".weight")
5
+ th= t(".assessor")
6
+ tbody
7
+ = render dry_weights
@@ -63,9 +63,11 @@
63
63
  .columns.medium-12.large-6
64
64
  = render "renalware/clinical/dry_weights/list",
65
65
  dry_weights: profile.dry_weights,
66
- patient: patient
66
+ patient: patient,
67
+ limit: true
67
68
 
68
69
  .columns
69
70
  = render "renalware/clinical/body_compositions/list",
70
71
  body_compositions: profile.body_compositions,
71
- patient: patient
72
+ patient: patient,
73
+ limit: true
@@ -0,0 +1,10 @@
1
+
2
+ $("#output").html("<%= test_patient %>");
3
+ $("#output").append("<br>")
4
+ $("#output").append("<b>Changes</b>")
5
+ $("#output").append("<br>")
6
+ $("#output").append("<%= JSON.pretty_generate(version) %>")
7
+ $("#output").append("<br>")
8
+ $("#output").append("<b>Current Address</b>")
9
+ $("#output").append("<br>")
10
+ $("#output").append("<%= test_patient.current_address %>")
@@ -0,0 +1,18 @@
1
+ = within_admin_layout(title: "HL7 Test Messages") do
2
+
3
+ .row.hl7-file-browser
4
+ .columns.small-3
5
+ - test_messages.each do |msg|
6
+ .file
7
+ = link_to "#", data: { body: msg.body } do
8
+ .panel
9
+ = msg.name
10
+ | &nbsp;
11
+ i.fas.fa-arrow-circle-right
12
+ p= msg.description
13
+ .row
14
+ .columns.small-12.file-viewer
15
+ = simple_form_for(form, remote: true, url: renalware.feeds_hl7_test_messages_path) do |f|
16
+ = f.input :body, as: :text, input_html: { style: "font-family: monospace", rows: 11 }
17
+ = f.submit "Submit", class: :button
18
+ pre#output
@@ -28,14 +28,3 @@
28
28
  = f.submit t("helpers.submit.filter"), class: "button", name: nil
29
29
  span= " or "
30
30
  = link_to t("helpers.reset"), filter_form.url
31
-
32
- - if Renalware.config.batch_printing_enabled
33
- = simple_form_for batch_print_form,
34
- as: :batch,
35
- url: hd_session_forms_batches_path,
36
- method: :post,
37
- remote: true do |f|
38
- = f.input :patient_ids, as: :hidden
39
- = f.submit "Batch Print #{presenter.patients.total_count} HD Session Forms",
40
- class: "button",
41
- disabled: presenter.patients.none?
@@ -0,0 +1,29 @@
1
+ .page-action-inline-form
2
+
3
+ - if Renalware.config.batch_printing_enabled
4
+ / This form lets us batch print the HD Session Forms for all patients in the list (all pages)
5
+ = simple_form_for batch_print_form,
6
+ as: :batch,
7
+ url: hd_session_forms_batches_path,
8
+ method: :post,
9
+ remote: true do |f|
10
+ = f.input :patient_ids, as: :hidden_array
11
+ = button_tag(type: "submit",
12
+ class: "button secondary",
13
+ disabled: presenter.patients.none?) do
14
+ i.fas.fa-print
15
+ = "Batch Print #{presenter.patients.total_count} HD Session Forms"
16
+
17
+ / This form lets us generate pathology request forms (eg for monthly bloods) for all patients
18
+ / in the list (all pages)
19
+ - if Renalware.config.generate_pathology_request_forms_from_hd_mdm_listing
20
+ = simple_form_for pathology_requests_form,
21
+ url: pathology_requests_new_request_path,
22
+ html: { autocomplete: "off", style: "display: inline" },
23
+ as: :request do |f|
24
+ = f.input :patient_ids, as: :hidden_array
25
+ = button_tag(type: "submit",
26
+ class: "button secondary",
27
+ disabled: presenter.patients.none?) do
28
+ i.fas.fa-copy
29
+ = "Generate #{presenter.patients.total_count} Request Forms"
@@ -1,11 +1,14 @@
1
- / = content_for(:actions) do
2
- / = render "page_actions", presenter: presenter, form: filter_form
1
+ = content_for(:actions) do
2
+ = render "page_actions",
3
+ presenter: presenter,
4
+ batch_print_form: batch_print_form,
5
+ pathology_requests_form: pathology_requests_form
3
6
 
4
7
  = content_for(:filters) do
5
8
  = render "filters",
6
9
  presenter: presenter,
7
- filter_form: filter_form,
8
- batch_print_form: batch_print_form
10
+ filter_form: filter_form
11
+
9
12
 
10
13
  = content_for(:tabs) do
11
14
  = render_if_exists "tabs", presenter: presenter
@@ -8,16 +8,16 @@ li
8
8
  ul.f-dropdown#diary-options(data-dropdown-content aria-hidden="true")
9
9
  - date = Time.zone.today
10
10
  = dropdown_btn_item title: "This week",
11
- url: hd_unit_edit_diary_path(year: date.year, week_number: date.cweek)
11
+ url: hd_scheduling_unit_edit_diary_path(year: date.year, week_number: date.cweek)
12
12
  - date = Time.zone.today + 1.week
13
13
  = dropdown_btn_item title: "Next week",
14
- url: hd_unit_edit_diary_path(year: date.year, week_number: date.cweek)
14
+ url: hd_scheduling_unit_edit_diary_path(year: date.year, week_number: date.cweek)
15
15
  - date = Time.zone.today - 1.week
16
16
  = dropdown_btn_item title: "Last week",
17
- url: hd_unit_edit_diary_path(year: date.year, week_number: date.cweek)
17
+ url: hd_scheduling_unit_edit_diary_path(year: date.year, week_number: date.cweek)
18
18
  hr
19
19
  li= link_to "Edit stations", hd_unit_stations_path(unit)
20
20
 
21
21
  - if defined?(diary)
22
- li= link_to "Print", hd_unit_diary_path(unit, diary.id, format: :pdf), class: "button"
22
+ li= link_to "Print", hd_scheduling_unit_diary_path(unit, diary.id, format: :pdf), class: "button"
23
23
  / hd_unit_show_diary_path(year: date.year, week_number: date.cweek, format: :pdf),
@@ -1,6 +1,6 @@
1
1
  tr[class = "#{'current-week' if weekly_diary.applies_to_current_week?}"]
2
2
  td= link_to "View",
3
- hd_unit_edit_diary_path(week_number: weekly_diary.week.week_number,
3
+ hd_scheduling_unit_edit_diary_path(week_number: weekly_diary.week.week_number,
4
4
  year: weekly_diary.week.year)
5
5
  td= weekly_diary.week_number
6
6
  td= weekly_diary.year
@@ -4,15 +4,15 @@
4
4
  = within_admin_layout(title: diary,
5
5
  breadcrumbs: [\
6
6
  breadcrumb_for(unit.name, edit_hospitals_unit_path(unit)),
7
- breadcrumb_for("HD Diaries", hd_unit_diaries_path(unit))\
7
+ breadcrumb_for("HD Diaries", hd_scheduling_unit_diaries_path(unit))\
8
8
  ]) do
9
9
 
10
10
  .diary__navigation
11
- = link_to hd_unit_edit_diary_path(**diary.week.previous.to_h), class: "button secondary" do
11
+ = link_to hd_scheduling_unit_edit_diary_path(**diary.week.previous.to_h), class: "button secondary" do
12
12
  i.fas.fa-arrow-left
13
13
  | Previous week
14
14
 
15
- = link_to hd_unit_edit_diary_path(**diary.week.next.to_h), class: "button secondary" do
15
+ = link_to hd_scheduling_unit_edit_diary_path(**diary.week.next.to_h), class: "button secondary" do
16
16
  i.fas.fa-arrow-right
17
17
  | Next week
18
18
 
@@ -25,9 +25,9 @@
25
25
  li(style="background-color: #{location.colour}")= location.name
26
26
 
27
27
  .diary(data={"weekly-diary-id" => diary.id,
28
- "weekly-diary-slots-path" => hd_diary_slots_path(diary_id: diary.id),
28
+ "weekly-diary-slots-path" => hd_scheduling_diary_slots_path(diary_id: diary.id),
29
29
  "master-diary-id" => diary.master_diary.id,
30
- "master-diary-slots-path" => hd_diary_slots_path(diary.master_diary)})
30
+ "master-diary-slots-path" => hd_scheduling_diary_slots_path(diary.master_diary)})
31
31
 
32
32
  .diary__grid
33
33
 
@@ -52,7 +52,7 @@
52
52
 
53
53
  - diary.each_day(diurnal_period, station) do |slot, _day_of_week|
54
54
  /- cache(slot.cache_key) do
55
- = render "renalware/hd/diary_slots/slot", slot: slot
55
+ = render "renalware/hd/scheduling/diary_slots/slot", slot: slot
56
56
 
57
57
  / Modal dialog container
58
58
  #add-patient-to-diary-modal.reveal-modal.medium(data-reveal)
@@ -1,8 +1,9 @@
1
1
  = render "renalware/shared/errors", model: slot
2
2
 
3
3
  = simple_form_for(slot,
4
- url: hd_diary_slots_path(slot.diary.id),
4
+ url: hd_scheduling_diary_slots_path(slot.diary.id),
5
5
  html: { id: "slot-form", autocomplete: "off" },
6
+ as: :slot,
6
7
  remote: true,
7
8
  method: :post,
8
9
  wrapper: :horizontal_form) do |f|
@@ -20,7 +21,7 @@
20
21
  label: "Search"
21
22
  .col-small-8
22
23
 
23
- / We will post 3 patient_id values in hd_diary_slot[patient_id][]
24
+ / We will post 3 patient_id values in slot[patient_id][]
24
25
  / The value selected in in change_type above will determine which one to choose.
25
26
  #patient_select2s
26
27
  #dialysing_on_day_and_period
@@ -30,7 +31,7 @@
30
31
  value_method: :id,
31
32
  input_html: { class: "searchable_select patient-id-select2",
32
33
  id: "patient_id1",
33
- name: "hd_diary_slot[patient_id][]" }
34
+ name: "slot[patient_ids][]" }
34
35
 
35
36
  #dialysing_on_day(style="display:none")
36
37
  = f.input :patient_id,
@@ -39,13 +40,13 @@
39
40
  value_method: :id,
40
41
  input_html: { class: "searchable_select patient-id-select2",
41
42
  id: "patient_id2",
42
- name: "hd_diary_slot[patient_id][]" }
43
+ name: "slot[patient_ids][]" }
43
44
  #dialysing_at_unit(style="display:none")
44
45
  = f.input :patient_id,
45
46
  collection: [],
46
47
  input_html: { \
47
48
  class: "patient-id-select2 patient-ajax-search",
48
- name: "hd_diary_slot[patient_id][]",
49
+ name: "slot[patient_ids][]",
49
50
  data: { "ajax--url" => hd_patients_dialysing_at_unit_path(unit_id: slot.diary.hospital_unit_id, format: :json),
50
51
  placeholder: "Search by patient name or NHS/hosp no." } \
51
52
  }
@@ -55,10 +56,12 @@
55
56
  collection: [],
56
57
  input_html: { \
57
58
  class: "patient-id-select2 patient-ajax-search",
58
- name: "hd_diary_slot[patient_id][]",
59
+ name: "slot[patient_ids][]",
59
60
  data: { "ajax--url" => hd_patients_dialysing_at_hospital_path(format: :json),
60
61
  placeholder: "Search by patient name or NHS/hosp no." } \
61
62
  }
63
+ / This is the one that actually gets posted
64
+ = f.input :patient_id, as: :hidden, input_html: { id: "patient_id" }
62
65
  = f.submit "Add for this week only", class: "button save weekly"
63
66
  | &nbsp;
64
67
  = f.submit "Add to this and all future weeks", class: "button secondary master", name: "master"
@@ -72,6 +75,11 @@
72
75
  javascript:
73
76
  $(document).ready(function() {
74
77
 
78
+ $(".patient-id-select2").on("select2:select", function(e) {
79
+ var selected_patient_id = $(this).find(':selected').val();
80
+ $("#patient_id").val(selected_patient_id);
81
+ })
82
+
75
83
  // 1. add handler for button if master set action
76
84
  $('input.master[type=submit]').click(function (e) {
77
85
  var master_slots_url = $(".diary").data("master-diary-slots-path");
@@ -103,6 +111,7 @@ javascript:
103
111
 
104
112
  $("#change_type").on("change", function() {
105
113
  change_type = $(this).val(); // e.g. "dialysing_at_unit"
114
+ $("#patient_id").val("");
106
115
  refreshSelect2s(change_type);
107
116
  })
108
117
  });
@@ -7,14 +7,14 @@ td*{ "data-slot-id" => slot.id.present? && slot.id,
7
7
 
8
8
  - if slot.patient.present?
9
9
  = link_to slot.patient.to_s,
10
- edit_hd_diary_slot_path(diary_id: slot.diary_id, id: slot.id),
10
+ edit_hd_scheduling_diary_slot_path(diary_id: slot.diary_id, id: slot.id),
11
11
  class: "button diary__button diary__target",
12
12
  title: slot.patient,
13
13
  data: { "reveal-id" => "add-patient-to-diary-modal",
14
14
  "reveal-ajax" => "true" }
15
15
  - else
16
16
  = link_to "Add",
17
- new_hd_diary_slot_path(diary_id: slot.diary_id,
17
+ new_hd_scheduling_diary_slot_path(diary_id: slot.diary_id,
18
18
  station_id: slot.station_id,
19
19
  diurnal_period_code_id: slot.diurnal_period_code_id,
20
20
  day_of_week: slot.day_of_week),
@@ -1,7 +1,7 @@
1
1
  - form_id = SecureRandom.hex(16)
2
2
  = simple_form_for(slot,
3
3
  html: { id: form_id },
4
- url: hd_diary_slot_path(weekly_diary.id, slot),
4
+ url: hd_scheduling_diary_slot_path(weekly_diary.id, slot),
5
5
  remote: true,
6
6
  wrapper: :horizontal_form) do |f|
7
7