renalware-core 2.0.0.pre.beta4 → 2.0.0.pre.beta5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -2
  3. data/app/assets/javascripts/renalware/application.js.erb +3 -0
  4. data/app/assets/javascripts/renalware/dialogs.js.erb +3 -1
  5. data/app/assets/javascripts/renalware/forms.js +0 -17
  6. data/app/assets/javascripts/renalware/keyboard_shortcuts.js +4 -0
  7. data/app/assets/javascripts/renalware/messaging.js +15 -0
  8. data/app/assets/javascripts/renalware/modality_codes.js +1 -0
  9. data/app/assets/javascripts/renalware/pdf.js +6 -3
  10. data/app/assets/javascripts/renalware/renal.js +2 -1
  11. data/app/assets/javascripts/renalware/session_timeout_redirect.js.erb +10 -4
  12. data/app/assets/javascripts/renalware/toggler.js +5 -0
  13. data/app/assets/stylesheets/renalware/base/_variables.scss +3 -1
  14. data/app/assets/stylesheets/renalware/lib/_foundation_and_overrides.scss +1 -1
  15. data/app/assets/stylesheets/renalware/lib/_select2-foundation5-overrides.scss +22 -1
  16. data/app/assets/stylesheets/renalware/lib/_select2-foundation5.scss +7 -4
  17. data/app/assets/stylesheets/renalware/modules/_dashboard.scss +1 -0
  18. data/app/assets/stylesheets/renalware/modules/_messaging.scss +55 -0
  19. data/app/assets/stylesheets/renalware/modules/_patients.scss +70 -0
  20. data/app/assets/stylesheets/renalware/partials/_button.scss +10 -0
  21. data/app/assets/stylesheets/renalware/partials/_forms.scss +9 -1
  22. data/app/assets/stylesheets/renalware/partials/_lists.scss +6 -1
  23. data/app/assets/stylesheets/renalware/partials/_navigation.scss +36 -1
  24. data/app/assets/stylesheets/renalware/partials/_simple_form.scss +1 -1
  25. data/app/assets/stylesheets/renalware/partials/_tables.scss +40 -1
  26. data/app/controllers/renalware/accesses/assessments_controller.rb +2 -2
  27. data/app/controllers/renalware/accesses/procedures_controller.rb +2 -2
  28. data/app/controllers/renalware/accesses/profiles_controller.rb +2 -2
  29. data/app/controllers/renalware/admin/users_controller.rb +1 -1
  30. data/app/controllers/renalware/base_controller.rb +1 -1
  31. data/app/controllers/renalware/clinical/body_compositions_controller.rb +1 -14
  32. data/app/controllers/renalware/clinical/dry_weights_controller.rb +1 -1
  33. data/app/controllers/renalware/clinics/clinic_visits_controller.rb +3 -3
  34. data/app/controllers/renalware/concerns/pdf_renderable.rb +0 -1
  35. data/app/controllers/renalware/deaths_controller.rb +1 -1
  36. data/app/controllers/renalware/devise/sessions_controller.rb +24 -0
  37. data/app/controllers/renalware/directory/people_controller.rb +30 -20
  38. data/app/controllers/renalware/drugs/drugs_controller.rb +2 -2
  39. data/app/controllers/renalware/events/events_controller.rb +19 -4
  40. data/app/controllers/renalware/events/types_controller.rb +2 -2
  41. data/app/controllers/renalware/hd/cannulation_types_controller.rb +2 -2
  42. data/app/controllers/renalware/hd/current_profile_controller.rb +1 -1
  43. data/app/controllers/renalware/hd/dialysers_controller.rb +2 -2
  44. data/app/controllers/renalware/hd/preference_sets_controller.rb +1 -1
  45. data/app/controllers/renalware/hd/sessions_controller.rb +1 -1
  46. data/app/controllers/renalware/hd/stations_controller.rb +79 -0
  47. data/app/controllers/renalware/hospitals/units_controller.rb +4 -3
  48. data/app/controllers/renalware/letters/contacts_controller.rb +3 -3
  49. data/app/controllers/renalware/letters/letters_controller.rb +2 -2
  50. data/app/controllers/renalware/medications/drug_types/prescriptions_controller.rb +3 -0
  51. data/app/controllers/renalware/messaging/messages_controller.rb +73 -0
  52. data/app/controllers/renalware/messaging/receipts_controller.rb +55 -0
  53. data/app/controllers/renalware/messaging/sent_messages_controller.rb +22 -0
  54. data/app/controllers/renalware/modalities/descriptions_controller.rb +31 -17
  55. data/app/controllers/renalware/modalities/modalities_controller.rb +21 -13
  56. data/app/controllers/renalware/pathology/current_observation_results_controller.rb +1 -1
  57. data/app/controllers/renalware/pathology/historical_observation_results_controller.rb +1 -1
  58. data/app/controllers/renalware/pathology/patient_rules_controller.rb +2 -2
  59. data/app/controllers/renalware/pathology/recent_observation_results_controller.rb +1 -1
  60. data/app/controllers/renalware/pathology/requests/requests_controller.rb +1 -1
  61. data/app/controllers/renalware/patients/alerts_controller.rb +61 -0
  62. data/app/controllers/renalware/patients/clinical_summaries_controller.rb +15 -0
  63. data/app/controllers/renalware/patients/patients_controller.rb +109 -0
  64. data/app/controllers/renalware/patients/primary_care_physicians_controller.rb +3 -2
  65. data/app/controllers/renalware/patients/worry_controller.rb +13 -2
  66. data/app/controllers/renalware/patients/worryboard_controller.rb +15 -1
  67. data/app/controllers/renalware/pd/bag_types_controller.rb +2 -2
  68. data/app/controllers/renalware/pd/exit_site_infections_controller.rb +2 -2
  69. data/app/controllers/renalware/pd/peritonitis_episodes_controller.rb +1 -1
  70. data/app/controllers/renalware/pd/pet_adequacy_results_controller.rb +2 -2
  71. data/app/controllers/renalware/pd/regimes_controller.rb +2 -2
  72. data/app/controllers/renalware/problems/problems_controller.rb +2 -2
  73. data/app/controllers/renalware/system/errors_controller.rb +20 -0
  74. data/app/controllers/renalware/system/mock_errors_controller.rb +12 -0
  75. data/app/controllers/renalware/transplants/donations_controller.rb +2 -2
  76. data/app/controllers/renalware/transplants/donor_operations_controller.rb +2 -2
  77. data/app/controllers/renalware/transplants/donor_workups_controller.rb +1 -1
  78. data/app/controllers/renalware/transplants/recipient_followups_controller.rb +2 -2
  79. data/app/controllers/renalware/transplants/recipient_operations_controller.rb +2 -2
  80. data/app/controllers/renalware/transplants/recipient_workups_controller.rb +1 -1
  81. data/app/controllers/renalware/transplants/registration_statuses_controller.rb +2 -2
  82. data/app/controllers/renalware/transplants/registrations_controller.rb +1 -1
  83. data/app/documents/renalware/renal/profile_document.rb +1 -0
  84. data/app/documents/renalware/smoking_status.rb +9 -0
  85. data/app/helpers/renalware/application_helper.rb +1 -1
  86. data/app/helpers/renalware/navigation_helper.rb +1 -1
  87. data/app/models/concerns/renalware/accountable.rb +16 -1
  88. data/app/models/concerns/renalware/broadcasting.rb +33 -0
  89. data/app/models/renalware/clinical/modality_description.rb +3 -0
  90. data/app/models/renalware/deaths/modality_description.rb +3 -0
  91. data/app/models/renalware/directory/person.rb +1 -1
  92. data/app/models/renalware/events/event.rb +3 -1
  93. data/app/models/renalware/events/event_query.rb +29 -0
  94. data/app/models/renalware/events/line_change_event_query.rb +25 -0
  95. data/app/models/renalware/events/patient_listener.rb +8 -0
  96. data/app/models/renalware/events/simple.rb +1 -1
  97. data/app/models/renalware/hd/diurnal_period_code.rb +9 -0
  98. data/app/models/renalware/hd/mdm_patients_query.rb +1 -0
  99. data/app/models/renalware/hd/modality_description.rb +3 -0
  100. data/app/models/renalware/hd/patient_listener.rb +20 -0
  101. data/app/models/renalware/hd/patients_with_unmet_preferences_query.rb +2 -0
  102. data/app/models/renalware/hd/session/closed.rb +2 -2
  103. data/app/models/renalware/hd/station.rb +24 -0
  104. data/app/models/renalware/hospitals/unit.rb +1 -0
  105. data/app/models/renalware/letters/draft_letter.rb +1 -1
  106. data/app/models/renalware/letters/letter_params_processor.rb +2 -2
  107. data/app/models/renalware/letters/letter_query.rb +1 -1
  108. data/app/models/renalware/letters/part/recent_pathology_results.rb +9 -4
  109. data/app/models/renalware/letters/patient_listener.rb +16 -0
  110. data/app/models/renalware/letters/revise_letter.rb +1 -1
  111. data/app/models/renalware/medications/patient_listener.rb +11 -0
  112. data/app/models/renalware/medications/prescriptions_by_drug_type_query.rb +2 -1
  113. data/app/models/renalware/medications/terminate_all_patient_prescriptions.rb +24 -0
  114. data/app/models/renalware/messaging/author.rb +9 -0
  115. data/app/models/renalware/messaging/message.rb +19 -0
  116. data/app/models/renalware/messaging/message_factory.rb +18 -0
  117. data/app/models/renalware/messaging/message_form.rb +34 -0
  118. data/app/models/renalware/messaging/message_form_builder.rb +50 -0
  119. data/app/models/renalware/messaging/patient.rb +13 -0
  120. data/app/models/renalware/messaging/receipt.rb +19 -0
  121. data/app/models/renalware/messaging/recipient.rb +10 -0
  122. data/app/models/renalware/messaging/recipient_options.rb +85 -0
  123. data/app/models/renalware/messaging/send_message.rb +22 -0
  124. data/app/models/renalware/messaging.rb +21 -0
  125. data/app/models/renalware/modalities/change_patient_modality.rb +112 -0
  126. data/app/models/renalware/modalities/description.rb +9 -5
  127. data/app/models/renalware/modalities/modality.rb +4 -10
  128. data/app/models/renalware/pathology/measurement_unit.rb +10 -0
  129. data/app/models/renalware/pathology/observation_description.rb +2 -0
  130. data/app/models/renalware/pathology/requests/global_algorithm.rb +1 -1
  131. data/app/models/renalware/pathology/requests/high_risk_rule_set.rb +1 -1
  132. data/app/models/renalware/patient.rb +14 -8
  133. data/app/models/renalware/patients/alert.rb +15 -0
  134. data/app/models/renalware/patients/patient_search.rb +13 -0
  135. data/app/models/renalware/patients/summary.rb +13 -0
  136. data/app/models/renalware/patients/worry_query.rb +27 -0
  137. data/app/models/renalware/pd/modality_description.rb +3 -0
  138. data/app/models/renalware/pd.rb +1 -1
  139. data/app/models/renalware/transplants/mdm_patients_query.rb +1 -0
  140. data/app/policies/renalware/hd/station_policy.rb +9 -0
  141. data/app/policies/renalware/messaging/message_policy.rb +11 -0
  142. data/app/policies/renalware/messaging/receipt_policy.rb +19 -0
  143. data/app/policies/renalware/modalities/description_policy.rb +22 -0
  144. data/app/policies/renalware/patients/alert_policy.rb +8 -0
  145. data/app/presenters/renalware/clinical/profile_presenter.rb +6 -1
  146. data/app/presenters/renalware/dashboard/dashboard_presenter.rb +18 -8
  147. data/app/presenters/renalware/events/events_presenter.rb +37 -0
  148. data/app/presenters/renalware/hd/station_presenter.rb +10 -0
  149. data/app/presenters/renalware/messaging/internal_message_presenter.rb +19 -0
  150. data/app/presenters/renalware/messaging/receipt_presenter.rb +11 -0
  151. data/app/presenters/renalware/pd/dashboard_presenter.rb +7 -0
  152. data/app/presenters/renalware/pd/mdm_presenter.rb +4 -0
  153. data/app/views/renalware/admin/users/edit.html.slim +34 -34
  154. data/app/views/renalware/admin/users/index.html.slim +9 -3
  155. data/app/views/renalware/clinical/body_compositions/_form.html.slim +1 -1
  156. data/app/views/renalware/clinical/body_compositions/_list.html.slim +1 -1
  157. data/app/views/renalware/clinical/body_compositions/edit.html.slim +2 -2
  158. data/app/views/renalware/clinics/clinic_visits/_form.html.slim +2 -2
  159. data/app/views/renalware/dashboard/bookmarks/_bookmark.html.slim +4 -5
  160. data/app/views/renalware/dashboard/bookmarks/_table.html.slim +1 -2
  161. data/app/views/renalware/dashboard/dashboards/_content.html.slim +7 -1
  162. data/app/views/renalware/dashboard/letters/_letter.html.slim +1 -1
  163. data/app/views/renalware/deaths/edit.html.slim +23 -26
  164. data/app/views/renalware/deaths/index.html.slim +0 -1
  165. data/app/views/renalware/devise/registrations/edit.html.slim +2 -2
  166. data/app/views/renalware/devise/sessions/new.html.slim +1 -1
  167. data/app/views/renalware/directory/people/_address_form.html.slim +13 -11
  168. data/app/views/renalware/directory/people/_filters.html.slim +9 -0
  169. data/app/views/renalware/directory/people/_form.html.slim +12 -14
  170. data/app/views/renalware/directory/people/_person.html.slim +1 -1
  171. data/app/views/renalware/directory/people/_table.html.slim +10 -0
  172. data/app/views/renalware/directory/people/edit.html.slim +4 -4
  173. data/app/views/renalware/directory/people/index.html.slim +7 -29
  174. data/app/views/renalware/directory/people/new.html.slim +4 -4
  175. data/app/views/renalware/directory/people/show.html.slim +27 -40
  176. data/app/views/renalware/drugs/drugs/_filters.html.slim +11 -0
  177. data/app/views/renalware/drugs/drugs/_form.html.slim +1 -3
  178. data/app/views/renalware/drugs/drugs/edit.html.slim +3 -1
  179. data/app/views/renalware/drugs/drugs/index.html.slim +7 -16
  180. data/app/views/renalware/drugs/drugs/new.html.slim +3 -1
  181. data/app/views/renalware/events/events/_filters.html.slim +21 -0
  182. data/app/views/renalware/events/events/_list.html.slim +5 -0
  183. data/app/views/renalware/events/events/_table.html.slim +3 -3
  184. data/app/views/renalware/events/events/index.html.slim +3 -2
  185. data/app/views/renalware/events/events/simple/_event.html.slim +10 -0
  186. data/app/views/renalware/events/events/simple/_list.html.slim +5 -0
  187. data/app/views/renalware/events/events/simple/_table.html.slim +15 -0
  188. data/app/views/renalware/events/events/toggled_cell/_simple.html.slim +2 -0
  189. data/app/views/renalware/hd/current_profile/_form.html.slim +64 -28
  190. data/app/views/renalware/hd/mdm_patients/_table.html.slim +26 -0
  191. data/app/views/renalware/hd/mdm_patients/index.html.slim +3 -33
  192. data/app/views/renalware/hd/stations/_form.html.slim +11 -0
  193. data/app/views/renalware/hd/stations/_station.html.slim +6 -0
  194. data/app/views/renalware/hd/stations/_table.html.slim +9 -0
  195. data/app/views/renalware/hd/stations/edit.html.slim +8 -0
  196. data/app/views/renalware/hd/stations/index.html.slim +14 -0
  197. data/app/views/renalware/hd/stations/new.html.slim +8 -0
  198. data/app/views/renalware/hospitals/units/_form.html.slim +16 -15
  199. data/app/views/renalware/hospitals/units/edit.html.slim +3 -1
  200. data/app/views/renalware/hospitals/units/index.html.slim +8 -3
  201. data/app/views/renalware/hospitals/units/new.html.slim +3 -1
  202. data/app/views/renalware/layouts/_patient.html.slim +1 -0
  203. data/app/views/renalware/letters/letters/_table.html.slim +1 -1
  204. data/app/views/renalware/letters/letters/author.html.slim +1 -3
  205. data/app/views/renalware/letters/parts/_problems.html.slim +10 -7
  206. data/app/views/renalware/letters/parts/_recent_pathology_results.html.slim +11 -8
  207. data/app/views/renalware/mdm_patients/_table.html.slim +23 -0
  208. data/app/views/renalware/mdm_patients/index.html.slim +5 -28
  209. data/app/views/renalware/medications/prescriptions/_current.html.slim +2 -2
  210. data/app/views/renalware/medications/prescriptions/_recently_stopped.html.slim +1 -1
  211. data/app/views/renalware/messaging/messages/_form.html.slim +31 -0
  212. data/app/views/renalware/messaging/messages/_message.html.slim +19 -0
  213. data/app/views/renalware/messaging/messages/_modal_dialog_placeholder.html.slim +2 -0
  214. data/app/views/renalware/messaging/messages/_send_message_link.html.slim +11 -0
  215. data/app/views/renalware/messaging/messages/_send_reply_link.html.slim +12 -0
  216. data/app/views/renalware/messaging/messages/_table.html.slim +13 -0
  217. data/app/views/renalware/messaging/messages/create.js.erb +13 -0
  218. data/app/views/renalware/messaging/messages/new.html.slim +5 -0
  219. data/app/views/renalware/messaging/messages/new.js.erb +7 -0
  220. data/app/views/renalware/messaging/messages/sent.html.slim +4 -0
  221. data/app/views/renalware/messaging/receipts/_receipt.html.slim +45 -0
  222. data/app/views/renalware/messaging/receipts/_table.html.slim +16 -0
  223. data/app/views/renalware/messaging/receipts/mark_as_read.js.erb +6 -0
  224. data/app/views/renalware/messaging/receipts/read.html.slim +5 -0
  225. data/app/views/renalware/messaging/receipts/unread.html.slim +5 -0
  226. data/app/views/renalware/messaging/shared/_key.html.slim +3 -0
  227. data/app/views/renalware/messaging/shared/_messages_type_tabs.html.slim +7 -0
  228. data/app/views/renalware/modalities/descriptions/_form.html.slim +12 -10
  229. data/app/views/renalware/modalities/descriptions/edit.html.slim +6 -1
  230. data/app/views/renalware/modalities/descriptions/index.html.slim +16 -11
  231. data/app/views/renalware/modalities/descriptions/new.html.slim +6 -1
  232. data/app/views/renalware/navigation/_user.html.slim +1 -0
  233. data/app/views/renalware/pathology/requests/requests/new.html.slim +1 -1
  234. data/app/views/renalware/patients/_layout.html.slim +0 -1
  235. data/app/views/renalware/patients/_person_form_fields.html.slim +1 -0
  236. data/app/views/renalware/patients/{_prescriptions.html.slim → _prescriptions.html.slim.dead} +0 -0
  237. data/app/views/renalware/patients/_side_menu.html.slim +1 -1
  238. data/app/views/renalware/patients/alerts/_alert.html.slim +12 -0
  239. data/app/views/renalware/patients/alerts/_create_alert_link.html.slim +8 -0
  240. data/app/views/renalware/patients/alerts/_form.html.slim +14 -0
  241. data/app/views/renalware/patients/alerts/_list.html.slim +4 -0
  242. data/app/views/renalware/patients/alerts/_modal_dialog_placeholder.html.slim +2 -0
  243. data/app/views/renalware/patients/alerts/create.js.erb +3 -0
  244. data/app/views/renalware/patients/alerts/destroy.js.erb +2 -0
  245. data/app/views/renalware/patients/alerts/new.html.slim +5 -0
  246. data/app/views/renalware/patients/alerts/new.js.erb +4 -0
  247. data/app/views/renalware/patients/bookmarks/_delete.html.slim +4 -3
  248. data/app/views/renalware/patients/bookmarks/_new.html.slim +4 -2
  249. data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/_events.html.slim +0 -0
  250. data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/_letters.html.slim +0 -0
  251. data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/_prescriptions.html.slim +0 -0
  252. data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/_problems.html.slim +0 -0
  253. data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/show.html.slim +1 -1
  254. data/app/views/renalware/patients/{_form.html.slim → patients/_form.html.slim} +0 -0
  255. data/app/views/renalware/patients/{_patient.html.slim → patients/_patient.html.slim} +0 -0
  256. data/app/views/renalware/patients/{_table.html.slim → patients/_table.html.slim} +1 -1
  257. data/app/views/renalware/patients/{edit.html.slim → patients/edit.html.slim} +1 -1
  258. data/app/views/renalware/patients/{index.html.slim → patients/index.html.slim} +0 -0
  259. data/app/views/renalware/patients/{new.html.slim → patients/new.html.slim} +1 -1
  260. data/app/views/renalware/patients/{show → patients/show}/_contact_details.html.slim +0 -0
  261. data/app/views/renalware/patients/{show → patients/show}/_hospital_numbers.html.slim +0 -0
  262. data/app/views/renalware/patients/{show → patients/show}/_letter_preferences.html.slim +0 -0
  263. data/app/views/renalware/patients/{show → patients/show}/_patient_demographics.html.slim +0 -0
  264. data/app/views/renalware/patients/{show → patients/show}/_person.html.slim +0 -0
  265. data/app/views/renalware/patients/{show → patients/show}/_primary_care_physician.html.slim +0 -0
  266. data/app/views/renalware/patients/{show → patients/show}/_referral.html.slim +0 -0
  267. data/app/views/renalware/patients/{show → patients/show}/_ukrdc_preferences.html.slim +0 -0
  268. data/app/views/renalware/patients/{show.html.slim → patients/show.html.slim} +7 -7
  269. data/app/views/renalware/patients/side_menu/_actions.html.slim +27 -0
  270. data/app/views/renalware/patients/side_menu/_general.html.slim +4 -2
  271. data/app/views/renalware/patients/side_menu/_modalities.html.slim +2 -2
  272. data/app/views/renalware/patients/side_menu/{_options.html.slim → _options.html.slim.redundant} +5 -0
  273. data/app/views/renalware/patients/side_menu/_transplants.html.slim +2 -1
  274. data/app/views/renalware/patients/worries/_delete.html.slim +4 -3
  275. data/app/views/renalware/patients/worries/_new.html.slim +23 -4
  276. data/app/views/renalware/patients/worryboard/_filters.html.slim +15 -0
  277. data/app/views/renalware/patients/worryboard/_table.html.slim +13 -6
  278. data/app/views/renalware/patients/worryboard/_worry.html.slim +6 -4
  279. data/app/views/renalware/patients/worryboard/show.html.slim +3 -5
  280. data/app/views/renalware/pd/dashboards/show.html.slim +11 -2
  281. data/app/views/renalware/pd/mdm/_top.html.slim +6 -1
  282. data/app/views/renalware/renal/profiles/_form.html.slim +2 -1
  283. data/app/views/renalware/renal/profiles/show.html.slim +1 -1
  284. data/app/views/renalware/shared/documents/_smoking_status.html.slim +1 -0
  285. data/app/views/renalware/shared/documents/_smoking_status_input.html.slim +5 -0
  286. data/app/views/renalware/{errors → system/errors}/internal_server_error.html.slim +0 -0
  287. data/app/views/renalware/{errors → system/errors}/not_found.html.slim +0 -0
  288. data/app/views/renalware/transplants/mdm_patients/_filters.html.slim +6 -7
  289. data/config/cucumber.yml +5 -2
  290. data/config/initializers/renalware.rb +13 -0
  291. data/config/initializers/simple_form_foundation.rb +3 -1
  292. data/config/locales/renalware/dashboard/dashboard.yml +0 -1
  293. data/config/locales/renalware/errors.en.yml +15 -14
  294. data/config/locales/renalware/events/events.yml +5 -0
  295. data/config/locales/renalware/hd/mdm_patients.yml +1 -1
  296. data/config/locales/renalware/hospitals/unit.yml +1 -0
  297. data/config/locales/renalware/mdm.yml +1 -1
  298. data/config/locales/renalware/messaging/messages.en.yml +29 -0
  299. data/config/locales/renalware/patients/alerts.en.yml +10 -0
  300. data/config/locales/renalware/patients/side_menu.en.yml +7 -4
  301. data/config/locales/renalware/patients/worries.en.yml +1 -1
  302. data/config/routes.rb +25 -6
  303. data/config/spring.rb +2 -0
  304. data/db/migrate/20170725120242_add_units_to_pathology_observation_descriptions.rb +19 -0
  305. data/db/migrate/20170809080925_add_notes_to_patient_worries.rb +5 -0
  306. data/db/migrate/20170810092953_create_messaging_messages.rb +13 -0
  307. data/db/migrate/20170810093532_create_messaging_receipts.rb +9 -0
  308. data/db/migrate/20170821100353_add_replying_to_message_id_to_messages.rb +12 -0
  309. data/db/migrate/20170823084127_create_patient_alerts.rb +16 -0
  310. data/db/migrate/20170824113401_add_stations_to_hospital_units.rb +8 -0
  311. data/db/migrate/20170830085137_create_hd_unit_stations.rb +17 -0
  312. data/db/migrate/20170830171726_create_hd_diurnal_period_codes.rb +10 -0
  313. data/db/seeds/default/hd/diurnal_period_codes.csv +4 -0
  314. data/db/seeds/default/hd/diurnal_period_codes.rb +13 -0
  315. data/db/seeds/default/hd/seeds.rb +1 -0
  316. data/db/seeds/default/pathology/measurement_units.csv +38 -0
  317. data/db/seeds/default/pathology/measurement_units.rb +13 -0
  318. data/db/seeds/default/pathology/pathology_observation_descriptions.csv +1741 -1741
  319. data/db/seeds/default/pathology/pathology_observation_descriptions.rb +8 -10
  320. data/db/seeds/default/pathology/seeds.rb +1 -0
  321. data/db/seeds/default/seeds.rb +0 -1
  322. data/db/seeds/default/system/roles.rb +1 -1
  323. data/{app/models → lib}/renalware/breadcrumb.rb +0 -0
  324. data/lib/renalware/configuration.rb +2 -0
  325. data/{app/models → lib}/renalware/failure.rb +0 -0
  326. data/{app/models → lib}/renalware/month_period.rb +0 -0
  327. data/{app/models → lib}/renalware/remembered_preferences.rb +0 -0
  328. data/{app/models → lib}/renalware/service_result.rb +0 -0
  329. data/{app/models → lib}/renalware/success.rb +0 -0
  330. data/lib/renalware/version.rb +1 -1
  331. data/lib/subscription_registry.rb +5 -0
  332. metadata +152 -61
  333. data/app/controllers/renalware/clinical_summaries_controller.rb +0 -13
  334. data/app/controllers/renalware/errors_controller.rb +0 -18
  335. data/app/controllers/renalware/mock_errors_controller.rb +0 -10
  336. data/app/controllers/renalware/patients_controller.rb +0 -107
  337. data/app/models/renalware/patient_search.rb +0 -11
  338. data/app/models/renalware/patient_summary.rb +0 -6
  339. data/app/views/renalware/admin/users/_header.html.slim +0 -6
  340. data/app/views/renalware/clinical/body_compositions/_row.html.slim +0 -15
  341. data/app/views/renalware/clinical/body_compositions/index.html.slim +0 -12
  342. data/app/views/renalware/deaths/_navigation.html.slim +0 -3
  343. data/app/views/renalware/directory/people/_header.html.slim +0 -5
  344. data/app/views/renalware/drugs/drugs/_header.html.slim +0 -5
  345. data/app/views/renalware/hospitals/units/_header.html.slim +0 -5
  346. data/db/seeds/default/hospitals/dialysis_units.csv +0 -7
  347. data/db/seeds/default/hospitals/dialysis_units.rb +0 -17
  348. data/db/seeds/default/hospitals/hospital_centres.csv +0 -86
  349. data/db/seeds/default/hospitals/hospitals.rb +0 -17
  350. data/db/seeds/default/hospitals/seeds.rb +0 -2
@@ -0,0 +1,19 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ module Renalware
4
+ module Messaging
5
+ class Message < ApplicationRecord
6
+ validates :body, presence: true
7
+ validates :subject, presence: true
8
+ validates :author, presence: true
9
+ validates :patient, presence: true
10
+ validates :sent_at, presence: true
11
+
12
+ belongs_to :patient
13
+ belongs_to :author
14
+ belongs_to :replying_to_message, class_name: name
15
+ has_many :receipts
16
+ has_many :recipients, through: :receipts
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ module Renalware
4
+ module Messaging
5
+ class MessageFactory
6
+ def self.build(**attributes)
7
+ attributes[:sent_at] ||= Time.zone.now
8
+ recipient_ids = attributes.delete(:recipient_ids) || []
9
+
10
+ Message.new(attributes).tap do |message|
11
+ recipient_ids.each do |recipient_id|
12
+ message.receipts.build(recipient_id: recipient_id)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,34 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ # A form object used behind the html messages#new form, and serving to helps us capture
4
+ # attributes for a Message and its Recipients. The MessageForm is passed to the SendMessage
5
+ # object where it is persisted as a Message with many Recipients through Receipts.
6
+ module Renalware
7
+ module Messaging
8
+ class MessageForm
9
+ include ActiveModel::Model
10
+ include Virtus::Model
11
+
12
+ attribute :body, String
13
+ attribute :subject, String
14
+ attribute :urgent, Boolean, default: false
15
+ attribute :recipient_ids, Array, default: []
16
+ attribute :replying_to_message_id
17
+
18
+ validates :body, presence: true
19
+ validates :subject, presence: true
20
+ validates :recipient_ids, presence: true, length: { minimum: 1 }
21
+
22
+ def initialize(attributes = {})
23
+ remove_blank_recipient_ids_from(attributes)
24
+ super
25
+ end
26
+
27
+ private
28
+
29
+ def remove_blank_recipient_ids_from(params)
30
+ params[:recipient_ids].reject!(&:blank?) if params.key?(:recipient_ids)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,50 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ # Builds a new MessageForm form object. MessageForm is used behind the html form when displaying a
4
+ # `Send Message` Dialog the first time. Note that we don't use this builder again on e.g.
5
+ # form submission - at that point all the required params are in the form payload - this is
6
+ # only for the initial MesageForm creation.
7
+ #
8
+ module Renalware
9
+ module Messaging
10
+ class MessageFormBuilder
11
+ attr_reader :patient, :params
12
+
13
+ def initialize(patient:, params:)
14
+ @patient = patient
15
+ @params = params
16
+ end
17
+
18
+ def call
19
+ MessageForm.new(
20
+ subject: build_subject,
21
+ recipient_ids: build_recipient_ids,
22
+ replying_to_message_id: replying_to_message_id
23
+ )
24
+ end
25
+
26
+ private
27
+
28
+ def build_subject
29
+ replying? ? "Re: #{replying_to_message.subject}" : patient.to_s
30
+ end
31
+
32
+ def build_recipient_ids
33
+ replying? ? Array(replying_to_message.author_id) : []
34
+ end
35
+
36
+ def replying_to_message
37
+ return NullObject.instance unless replying?
38
+ @replying_to_message ||= Message.find(replying_to_message_id)
39
+ end
40
+
41
+ def replying_to_message_id
42
+ params[:replying_to_message_id]
43
+ end
44
+
45
+ def replying?
46
+ replying_to_message_id.present?
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,13 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ module Renalware
4
+ module Messaging
5
+ class Patient < ActiveType::Record[Renalware::Patient]
6
+ has_many :messages
7
+
8
+ def to_s
9
+ super(:long)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,19 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ module Renalware
4
+ module Messaging
5
+ class Receipt < ApplicationRecord
6
+ validates :recipient, presence: true
7
+ validates :message, presence: true
8
+
9
+ belongs_to :message
10
+ belongs_to :recipient
11
+
12
+ scope :unread, -> { where(read_at: nil) }
13
+
14
+ def read?
15
+ read_at.present?
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,10 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ module Renalware
4
+ module Messaging
5
+ class Recipient < ActiveType::Record[Renalware::User]
6
+ has_many :receipts
7
+ has_many :messages, through: :receipts
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,85 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ # Builds grouped drop down options for potential private message recipients.
4
+ # The groups are:
5
+ # - users who have recently received a message about the current patient
6
+ # - users who have recently received a message from the current author (excluding those already
7
+ # listed in the above group)
8
+ # - all remaining users
9
+ #
10
+ # The author is excluded from all lists so they cannot send to themselves
11
+ #
12
+ module Renalware
13
+ module Messaging
14
+ class RecipientOptions
15
+ attr_reader :patient, :author
16
+
17
+ class Group
18
+ include Virtus.model
19
+ attribute :name, String
20
+ attribute :users, Array, default: []
21
+ end
22
+
23
+ def initialize(patient, author)
24
+ @patient = patient
25
+ @author = author
26
+ end
27
+
28
+ def to_a
29
+ [
30
+ users_having_previously_received_a_message_about_patient,
31
+ users_having_recently_received_messages_from_author,
32
+ all_other_users
33
+ ]
34
+ end
35
+
36
+ private
37
+
38
+ def users_having_previously_received_a_message_about_patient
39
+ Group.new(
40
+ name: "Previous patient recipients",
41
+ users: Recipient.where(id: ids_of_users_having_received_a_message_about_patient)
42
+ )
43
+ end
44
+
45
+ def users_having_recently_received_messages_from_author
46
+ Group.new(
47
+ name: "Other recent recipients",
48
+ users: Recipient.where(id: ids_of_users_having_received_messages_from_author)
49
+ )
50
+ end
51
+
52
+ def all_other_users
53
+ ids_to_exclude = ids_of_users_having_received_a_message_about_patient +
54
+ ids_of_users_having_received_messages_from_author
55
+ Group.new(
56
+ name: "KCH",
57
+ users: Recipient.where.not(id: ids_to_exclude)
58
+ )
59
+ end
60
+
61
+ def ids_of_users_having_received_a_message_about_patient
62
+ @ids_of_users_having_received_a_message_about_patient ||= begin
63
+ Message
64
+ .includes(:receipts)
65
+ .eager_load(:receipts)
66
+ .where(patient: patient)
67
+ .limit(20)
68
+ .pluck(:author_id, :recipient_id)
69
+ .flatten.uniq.compact
70
+ end
71
+ end
72
+
73
+ def ids_of_users_having_received_messages_from_author
74
+ @ids_of_users_having_received_messages_from_author ||= begin
75
+ ids = Message
76
+ .includes(:receipts).eager_load(:receipts)
77
+ .where(author: author)
78
+ .limit(20)
79
+ .pluck(:recipient_id).uniq.compact
80
+ ids - ids_of_users_having_received_a_message_about_patient
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,22 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ module Renalware
4
+ module Messaging
5
+ class SendMessage
6
+
7
+ def self.call(*args)
8
+ new.call(*args)
9
+ end
10
+
11
+ def call(author:, patient:, form:)
12
+ Message.transaction do
13
+ message = MessageFactory.build(patient: patient,
14
+ author: author,
15
+ **form.attributes)
16
+ message.save!
17
+ message
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,21 @@
1
+ require_dependency "renalware"
2
+
3
+ module Renalware
4
+ module Messaging
5
+ def self.table_name_prefix
6
+ "messaging_"
7
+ end
8
+
9
+ def self.cast_patient(patient)
10
+ ActiveType.cast(patient, ::Renalware::Messaging::Patient)
11
+ end
12
+
13
+ def self.cast_author(author)
14
+ ActiveType.cast(author, ::Renalware::Messaging::Author)
15
+ end
16
+
17
+ def self.cast_recipient(recipient)
18
+ ActiveType.cast(recipient, ::Renalware::Messaging::Recipient)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,112 @@
1
+ require_dependency "renalware/modalities"
2
+
3
+ module Renalware
4
+ module Modalities
5
+ class ChangePatientModality
6
+ include Broadcasting
7
+
8
+ attr_reader :patient, :user
9
+
10
+ def initialize(patient:, user:)
11
+ @patient = patient
12
+ @user = user
13
+ end
14
+
15
+ # Accepts an existing (unsaved) :modality, or builds a new one from the options hash.
16
+ # Terminates an existing current modality if once exists, and saves and make the new
17
+ # modality current.
18
+ # Example usage:
19
+ #
20
+ # result = Modalities::ChangePatientModality
21
+ # .new(patient: patient, user: curret_user)
22
+ # .call(
23
+ # description: HD::ModalityDescription.first!,
24
+ # started_on: Time.zone.now
25
+ # )
26
+ #
27
+ # or
28
+ #
29
+ # modality = patient.modalities.new(
30
+ # description: HD::ModalityDescription.first!,
31
+ # started_on: Time.zone.now
32
+ # )
33
+ # result = Modalities::ChangePatientModality
34
+ # .new(patient: patient, user: curret_user)
35
+ # .call(modality: modality)
36
+ # )
37
+ #
38
+ # A Success or Failure result object is returned and the actual modality can be accessed on
39
+ # the result.object property.
40
+ #
41
+ # We can broadcast events to inform listeners the modality has changed.
42
+ # See #broadcast_modality_change_event_to_any_listeners for configuration.
43
+ #
44
+ def call(options)
45
+ new_modality = parse_options(options)
46
+ if new_modality.valid?
47
+ make_new_modality_the_current_one(new_modality)
48
+ broadcast_modality_change_event_to_any_listeners(new_modality)
49
+ Success.new(new_modality)
50
+ else
51
+ Failure.new(new_modality)
52
+ end
53
+ end
54
+
55
+ private
56
+
57
+ def make_new_modality_the_current_one(new_modality)
58
+ Modality.transaction do
59
+ current_modality.terminate_by(user, on: new_modality.started_on)
60
+ new_modality.save_by!(user)
61
+ end
62
+ end
63
+
64
+ # Broadcast (using Wisper) an event to indicate the patient's current modality has changed,
65
+ # This allows classes in other modules/parts of the application to take appropriate action.
66
+ # For example the Letters module may want to terminate all patient prescriptions if the
67
+ # modality changes to Death.
68
+ #
69
+ # The list of subscribers/listeners who will receive the message is set in the Broadcasting
70
+ # module which we mix in above _proveided_ the caller has chained the
71
+ # #broadcasting_to_configured_subscribers method like so
72
+ #
73
+ # result = Modalities::ChangePatientModality
74
+ # .new(..)
75
+ # .broadcasting_to_configured_subscribers
76
+ # .call(..)
77
+ #
78
+ # If you wish to add more listeners and these are site/hospital-specific, this can be done
79
+ # by configuring Renalware.config.broadcast_subscription_map. Be careful to append to rather
80
+ # than replace the default entries in the hash map.
81
+ # For example in a your applications config/initalizers/renalware_core.rb, add:
82
+ # Renalware.configure do |config|
83
+ # map = config.broadcast_subscription_map
84
+ # map["Renalware::Modalities::ChangePatientModality"] << "SomeNamespace::SomeListenerClass"
85
+ # end
86
+ #
87
+ # When broadcasting events, if the event description has a #.to_sym e.g :hd or :death
88
+ # then we use that in the name of the event, e.g. `patient_modality_changed_to_death`.
89
+ # Otherwise, for more generic events we use `patient_modality_changed`.
90
+ # I'm not sure this is a very consistent approach so may need to revisit.
91
+ def broadcast_modality_change_event_to_any_listeners(new_modality)
92
+ type = new_modality.description.to_sym
93
+ method_name = type.nil? ? :patient_modality_changed : :"patient_modality_changed_to_#{type}"
94
+ broadcast(
95
+ method_name,
96
+ patient: patient,
97
+ modality: new_modality,
98
+ actor: user
99
+ )
100
+ end
101
+
102
+ def parse_options(options)
103
+ return options[:modality] if options.key?(:modality)
104
+ patient.modalities.new(options)
105
+ end
106
+
107
+ def current_modality
108
+ patient.current_modality || NullObject.instance
109
+ end
110
+ end
111
+ end
112
+ end
@@ -5,15 +5,19 @@ module Renalware
5
5
  class Description < ApplicationRecord
6
6
  acts_as_paranoid
7
7
 
8
- validates :name, presence: true
9
-
10
- def self.policy_class
11
- BasePolicy
12
- end
8
+ validates :name, presence: true, uniqueness: true
13
9
 
14
10
  def to_s
15
11
  name
16
12
  end
13
+
14
+ def to_sym
15
+ nil
16
+ end
17
+
18
+ def self.policy_class
19
+ Modalities::DescriptionPolicy
20
+ end
17
21
  end
18
22
  end
19
23
  end
@@ -11,25 +11,19 @@ module Renalware
11
11
  belongs_to :reason, class_name: "Reason"
12
12
 
13
13
  scope :ordered, -> { order(ended_on: :desc, updated_at: :desc) }
14
-
15
14
  scope :started_on_reversed, -> { order(started_on: :desc, updated_at: :desc) }
16
15
  scope :last_started_on, -> { started_on_reversed.where(ended_on: nil) }
17
16
 
18
17
  validates :patient, presence: true
19
18
  validates :started_on, presence: true
20
19
  validates :description, presence: true
21
-
22
20
  validates :started_on, timeliness: { type: :date }
23
-
24
21
  validate :validate_modality_starts_later_than_previous, on: :create, if: :patient
25
22
 
26
- def transfer!(attrs)
27
- transaction do
28
- successor = patient.modalities.new(attrs)
29
- successor.save!
30
- terminate!(successor) if successor.valid?
31
- successor
32
- end
23
+ def terminate_by(user, on:)
24
+ self.ended_on = on
25
+ self.state = "terminated"
26
+ save_by!(user)
33
27
  end
34
28
 
35
29
  def to_s
@@ -0,0 +1,10 @@
1
+ require_dependency "renalware/pathology"
2
+
3
+ module Renalware
4
+ module Pathology
5
+ class MeasurementUnit < ApplicationRecord
6
+ validates :name, presence: true
7
+ has_many :observation_descriptions
8
+ end
9
+ end
10
+ end
@@ -3,6 +3,8 @@ require_dependency "renalware/pathology"
3
3
  module Renalware
4
4
  module Pathology
5
5
  class ObservationDescription < ApplicationRecord
6
+ belongs_to :measurement_unit
7
+
6
8
  def self.for(codes)
7
9
  ObservationDescriptionsByCodeQuery.new(codes: codes).call
8
10
  end
@@ -13,7 +13,7 @@ module Renalware
13
13
  def determine_required_request_descriptions
14
14
  rule_sets
15
15
  .select { |rule_set| rule_set.observation_required_for_patient?(@patient, @date) }
16
- .map { |rule_set| rule_set.request_description }
16
+ .map(&:request_description)
17
17
  .uniq
18
18
  end
19
19
 
@@ -10,7 +10,7 @@ module Renalware
10
10
  class HighRiskRuleSet
11
11
 
12
12
  def self.rules
13
- GlobalRule.where(rule_set_type: self.name)
13
+ GlobalRule.where(rule_set_type: name)
14
14
  end
15
15
 
16
16
  def self.primary_key
@@ -29,11 +29,12 @@ module Renalware
29
29
 
30
30
  has_one :current_key_observation_set, class_name: "Pathology::CurrentKeyObservationSet"
31
31
  has_one :current_address, as: :addressable, class_name: "Address"
32
- has_one :summary, class_name: "PatientSummary"
32
+ has_one :summary, class_name: "Patients::Summary"
33
33
  belongs_to :ethnicity, class_name: "Patients::Ethnicity"
34
34
  belongs_to :religion, class_name: "Patients::Religion"
35
35
  belongs_to :language, class_name: "Patients::Language"
36
36
  has_many :bookmarks, class_name: "Patients::Bookmark"
37
+ has_many :alerts, class_name: "Patients::Alert"
37
38
  has_one :worry, class_name: "Patients::Worry"
38
39
 
39
40
  belongs_to :first_cause, class_name: "Deaths::Cause", foreign_key: :first_cause_id
@@ -123,13 +124,18 @@ module Renalware
123
124
 
124
125
  # @section services
125
126
 
126
- def set_modality(attrs)
127
- if current_modality.present?
128
- current_modality.transfer!(attrs)
129
- else
130
- modalities.create(attrs)
131
- end
132
- end
127
+ # def set_modality(attrs, by: nil)
128
+ # by ||= attrs[:by]
129
+ # # if current_modality.present?
130
+ # # current_modality.transfer!(attrs)
131
+ # # else
132
+ # # modalities.create(attrs)
133
+ # # end
134
+ # new_modality = modalities.new(attrs)
135
+ # Modalities::ChangePatientModality
136
+ # .new(patient: self, by: by)
137
+ # .call(old_modality: current_modality, new_modality:new_modality)
138
+ # end
133
139
 
134
140
  def current_modality_death?
135
141
  return false if current_modality.blank?
@@ -0,0 +1,15 @@
1
+ require_dependency "renalware/patients"
2
+
3
+ module Renalware
4
+ module Patients
5
+ class Alert < ApplicationRecord
6
+ include Accountable
7
+ acts_as_paranoid
8
+
9
+ validates :patient, presence: true
10
+ validates :notes, presence: true
11
+
12
+ belongs_to :patient
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ module Renalware
2
+ module Patients
3
+ class PatientSearch
4
+ def self.call(params)
5
+ Renalware::Patient
6
+ .includes(current_modality: [:description])
7
+ .search(params[:q]).tap do |search|
8
+ search.sorts = %w(family_name given_name)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require_dependency "renalware"
2
+
3
+ ##
4
+ # Backed by a SQL view, the patient summary is principally a set of counts fo various entities
5
+ # which hang off a patient, for example prescriptions_count, problems_count etc.
6
+ # These can be used for instance when building the patient navigation.
7
+ #
8
+ module Renalware
9
+ module Patients
10
+ class Summary < ApplicationRecord
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,27 @@
1
+ require_dependency "renalware/patients"
2
+
3
+ module Renalware
4
+ module Patients
5
+ class WorryQuery
6
+ attr_reader :query_params
7
+
8
+ def initialize(query_params)
9
+ @query_params = query_params
10
+ @query_params[:s] = "date_time DESC" if @query_params[:s].blank?
11
+ end
12
+
13
+ def call
14
+ search
15
+ .result
16
+ .includes(:created_by, patient: { current_modality: [:description] })
17
+ .order(created_at: :asc)
18
+ .page(query_params[:page])
19
+ .per(query_params[:per_page])
20
+ end
21
+
22
+ def search
23
+ @search ||= Worry.ransack(query_params)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -3,6 +3,9 @@ require_dependency "renalware/pd"
3
3
  module Renalware
4
4
  module PD
5
5
  class ModalityDescription < Modalities::Description
6
+ def to_sym
7
+ :pd
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -25,7 +25,7 @@ module Renalware
25
25
 
26
26
  config_accessor(:delivery_intervals) { [1.week, 2.weeks, 3.weeks, 4.weeks] }
27
27
 
28
- config_accessor(:training_durations) { (1..15).map{ |day| day.days } }
28
+ config_accessor(:training_durations) { (1..15).map(&:days) }
29
29
 
30
30
  end
31
31
 
@@ -23,6 +23,7 @@ module Renalware
23
23
  def search
24
24
  @search ||= begin
25
25
  relation
26
+ .includes(:current_key_observation_set)
26
27
  .extending(ModalityScopes)
27
28
  .extending(NamedFilterScopes)
28
29
  .with_current_modality_matching(MODALITY_NAMES)
@@ -0,0 +1,9 @@
1
+ module Renalware
2
+ module HD
3
+ class StationPolicy < BasePolicy
4
+ def sort?
5
+ edit?
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ require_dependency "renalware/messaging"
2
+
3
+ module Renalware
4
+ module Messaging
5
+ class MessagePolicy < BasePolicy
6
+ def sent?
7
+ index?
8
+ end
9
+ end
10
+ end
11
+ end