renalware-core 2.0.0.pre.rc11 → 2.0.0.pre.rc13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (386) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -1
  3. data/app/assets/javascripts/renalware/letters.js +10 -0
  4. data/app/assets/stylesheets/renalware/modules/_letters.scss +0 -2
  5. data/app/assets/stylesheets/renalware/modules/_pathology.scss +24 -3
  6. data/app/assets/stylesheets/renalware/modules/_patients.scss +1 -2
  7. data/app/assets/stylesheets/renalware/partials/_layout.scss +3 -15
  8. data/app/assets/stylesheets/renalware/patient_pages.scss +43 -0
  9. data/app/controllers/renalware/api/ukrdc/patients_controller.rb +1 -1
  10. data/app/controllers/renalware/api/v1/medications/prescriptions_controller.rb +38 -0
  11. data/app/controllers/renalware/drugs/drugs_controller.rb +2 -6
  12. data/app/controllers/renalware/letters/completed_letters_controller.rb +21 -3
  13. data/app/controllers/renalware/letters/lists_controller.rb +9 -1
  14. data/app/controllers/renalware/pathology/historical_observation_results_controller.rb +1 -1
  15. data/app/controllers/renalware/pathology/recent_observation_results_controller.rb +1 -1
  16. data/app/helpers/renalware/letters_helper.rb +7 -0
  17. data/app/models/concerns/renalware/patient_pathology_scopes.rb +1 -1
  18. data/app/models/concerns/renalware/patients_ransack_helper.rb +10 -8
  19. data/app/models/concerns/renalware/personable.rb +1 -1
  20. data/app/models/renalware/admissions/admission.rb +1 -1
  21. data/app/models/renalware/admissions/consult.rb +1 -1
  22. data/app/models/renalware/admissions/request.rb +1 -1
  23. data/app/models/renalware/clinical/body_composition.rb +1 -1
  24. data/app/models/renalware/drugs/classification.rb +2 -2
  25. data/app/models/renalware/drugs/drug.rb +1 -1
  26. data/app/models/renalware/feeds/files/import_job_factory.rb +0 -1
  27. data/app/models/renalware/feeds/files/practices/import_job.rb +1 -0
  28. data/app/models/renalware/feeds/message_processor.rb +5 -4
  29. data/app/models/renalware/hd/diary_slot.rb +3 -2
  30. data/app/models/renalware/letters/archive.rb +1 -1
  31. data/app/models/renalware/letters/complete_letter.rb +9 -5
  32. data/app/models/renalware/letters/contact.rb +1 -1
  33. data/app/models/renalware/letters/electronic_receipt.rb +1 -1
  34. data/app/models/renalware/letters/letter.rb +3 -0
  35. data/app/models/renalware/letters/letter/approved.rb +2 -0
  36. data/app/models/renalware/letters/letter/draft.rb +5 -1
  37. data/app/models/renalware/letters/letter/pending_review.rb +2 -0
  38. data/app/models/renalware/letters/pdf_letter_cache.rb +27 -13
  39. data/app/models/renalware/letters/signature.rb +2 -2
  40. data/app/models/renalware/low_clearance/mdm_patients_query.rb +1 -1
  41. data/app/models/renalware/messaging/internal/author.rb +1 -0
  42. data/app/models/renalware/messaging/message.rb +1 -1
  43. data/app/models/renalware/pathology/measurement_unit.rb +1 -1
  44. data/app/models/renalware/pathology/observation.rb +7 -2
  45. data/app/models/renalware/pathology/observation_description.rb +8 -2
  46. data/app/models/renalware/pathology/observation_request.rb +1 -4
  47. data/app/models/renalware/patients/alert.rb +1 -1
  48. data/app/models/renalware/patients/bookmark.rb +1 -0
  49. data/app/models/renalware/patients/worry.rb +4 -1
  50. data/app/models/renalware/pd/peritonitis_episode_type.rb +2 -1
  51. data/app/models/renalware/pd/regime_bag.rb +1 -1
  52. data/app/models/renalware/renal/aki_alert.rb +1 -1
  53. data/app/models/renalware/research/study.rb +5 -2
  54. data/app/models/renalware/research/study_participant.rb +5 -14
  55. data/app/models/renalware/transplants/donation.rb +1 -1
  56. data/app/models/renalware/transplants/mdm_patients_query.rb +4 -2
  57. data/app/models/renalware/transplants/recipient_followup.rb +2 -2
  58. data/app/models/renalware/transplants/registrations/wait_list_query.rb +8 -2
  59. data/app/models/renalware/ukrdc.rb +9 -0
  60. data/app/models/renalware/ukrdc/patients_query.rb +24 -0
  61. data/app/models/renalware/ukrdc/send_patient.rb +97 -0
  62. data/app/models/renalware/ukrdc/send_patients.rb +91 -0
  63. data/app/models/renalware/ukrdc/transmission_log.rb +30 -0
  64. data/app/models/renalware/virology/profile.rb +1 -0
  65. data/app/presenters/date_presenter.rb +2 -0
  66. data/app/presenters/date_time_presenter.rb +2 -0
  67. data/app/presenters/enumerize/value_presenter.rb +2 -0
  68. data/app/presenters/false_class_presenter.rb +2 -0
  69. data/app/presenters/presenter.rb +2 -0
  70. data/app/presenters/renalware/accesses/assessment_presenter.rb +2 -0
  71. data/app/presenters/renalware/accesses/patient_presenter.rb +2 -0
  72. data/app/presenters/renalware/accesses/plan_presenter.rb +2 -0
  73. data/app/presenters/renalware/accesses/procedure_presenter.rb +2 -0
  74. data/app/presenters/renalware/accesses/profile_presenter.rb +2 -0
  75. data/app/presenters/renalware/address_presenter.rb +2 -0
  76. data/app/presenters/renalware/address_presenter/block.rb +2 -0
  77. data/app/presenters/renalware/address_presenter/short.rb +2 -0
  78. data/app/presenters/renalware/address_presenter/single_line.rb +2 -0
  79. data/app/presenters/renalware/admin/users/summary_part.rb +2 -0
  80. data/app/presenters/renalware/admissions/admission_presenter.rb +2 -0
  81. data/app/presenters/renalware/admissions/consult_presenter.rb +2 -0
  82. data/app/presenters/renalware/admissions/summary_part.rb +2 -0
  83. data/app/presenters/renalware/clinical/body_composition_presenter.rb +2 -0
  84. data/app/presenters/renalware/clinical/dry_weight_presenter.rb +2 -0
  85. data/app/presenters/renalware/clinical/dry_weights_presenter.rb +2 -0
  86. data/app/presenters/renalware/clinical/header_presenter.rb +2 -0
  87. data/app/presenters/renalware/clinical/profile_presenter.rb +2 -0
  88. data/app/presenters/renalware/country_presenter.rb +2 -0
  89. data/app/presenters/renalware/dashboard/dashboard_presenter.rb +2 -0
  90. data/app/presenters/renalware/directory/person_auto_complete_presenter.rb +2 -0
  91. data/app/presenters/renalware/events/events_presenter.rb +2 -0
  92. data/app/presenters/renalware/events/summary_part.rb +2 -0
  93. data/app/presenters/renalware/hd/dashboard_presenter.rb +2 -0
  94. data/app/presenters/renalware/hd/diary_presenter.rb +2 -0
  95. data/app/presenters/renalware/hd/diary_slot_presenter.rb +2 -0
  96. data/app/presenters/renalware/hd/mdm_patient_presenter.rb +2 -0
  97. data/app/presenters/renalware/hd/mdm_presenter.rb +2 -0
  98. data/app/presenters/renalware/hd/null_slot.rb +2 -0
  99. data/app/presenters/renalware/hd/patient_presenter.rb +2 -0
  100. data/app/presenters/renalware/hd/profile_document_presenter.rb +2 -0
  101. data/app/presenters/renalware/hd/profile_presenter.rb +2 -0
  102. data/app/presenters/renalware/hd/protocol/session_presenter.rb +2 -0
  103. data/app/presenters/renalware/hd/protocol_presenter.rb +2 -0
  104. data/app/presenters/renalware/hd/session_access_presenter.rb +2 -0
  105. data/app/presenters/renalware/hd/session_presenter.rb +2 -0
  106. data/app/presenters/renalware/hd/station_presenter.rb +2 -0
  107. data/app/presenters/renalware/hd/unmet_preferences_presenter.rb +2 -0
  108. data/app/presenters/renalware/letters/contact_description_presenter.rb +2 -0
  109. data/app/presenters/renalware/letters/contact_presenter.rb +2 -0
  110. data/app/presenters/renalware/letters/contacts_presenter.rb +2 -0
  111. data/app/presenters/renalware/letters/electronic_receipt_presenter.rb +2 -0
  112. data/app/presenters/renalware/letters/letter_form_presenter.rb +2 -0
  113. data/app/presenters/renalware/letters/letter_presenter.rb +2 -0
  114. data/app/presenters/renalware/letters/letter_presenter_factory.rb +2 -0
  115. data/app/presenters/renalware/letters/part_class_filter.rb +2 -0
  116. data/app/presenters/renalware/letters/practice_email_meta_data.rb +2 -0
  117. data/app/presenters/renalware/letters/recipient_presenter.rb +2 -0
  118. data/app/presenters/renalware/letters/summary_part.rb +2 -0
  119. data/app/presenters/renalware/low_clearance/dashboard_presenter.rb +2 -0
  120. data/app/presenters/renalware/low_clearance/mdm_presenter.rb +2 -0
  121. data/app/presenters/renalware/mdm_patient_presenter.rb +2 -0
  122. data/app/presenters/renalware/mdm_patients_presenter.rb +2 -0
  123. data/app/presenters/renalware/mdm_presenter.rb +2 -4
  124. data/app/presenters/renalware/medications/prescription_presenter.rb +2 -0
  125. data/app/presenters/renalware/medications/provider_code_presenter.rb +2 -0
  126. data/app/presenters/renalware/medications/route_form_presenter.rb +2 -0
  127. data/app/presenters/renalware/medications/summary_part.rb +37 -6
  128. data/app/presenters/renalware/medications/treatable_presenter.rb +2 -0
  129. data/app/presenters/renalware/messaging/internal/message_presenter.rb +2 -0
  130. data/app/presenters/renalware/messaging/internal/receipt_presenter.rb +2 -0
  131. data/app/presenters/renalware/pathology/observation_presenter.rb +4 -2
  132. data/app/presenters/renalware/pathology/observation_set_presenter.rb +21 -8
  133. data/app/presenters/renalware/pathology/observations_diff.rb +2 -0
  134. data/app/presenters/renalware/pathology/observations_for_codes_presenter.rb +2 -0
  135. data/app/presenters/renalware/pathology/patient_presenter.rb +2 -0
  136. data/app/presenters/renalware/pathology/requests/global_rule_presenter.rb +2 -0
  137. data/app/presenters/renalware/pathology/requests/global_rule_set_presenter.rb +2 -0
  138. data/app/presenters/renalware/pathology/requests/patient_rule_presenter.rb +2 -0
  139. data/app/presenters/renalware/pathology/requests/request_presenter.rb +2 -0
  140. data/app/presenters/renalware/pathology/requests/sample_description.rb +2 -0
  141. data/app/presenters/renalware/pathology/results_presenter.rb +2 -0
  142. data/app/presenters/renalware/patient_presenter.rb +2 -0
  143. data/app/presenters/renalware/pd/dashboard_presenter.rb +2 -0
  144. data/app/presenters/renalware/pd/delivery_interval_presenter.rb +2 -0
  145. data/app/presenters/renalware/pd/mdm_presenter.rb +2 -0
  146. data/app/presenters/renalware/pd/peritonitis_episode_presenter.rb +2 -0
  147. data/app/presenters/renalware/pd/training_duration_presenter.rb +2 -0
  148. data/app/presenters/renalware/primary_care_physician_presenter.rb +2 -0
  149. data/app/presenters/renalware/problems/summary_part.rb +2 -0
  150. data/app/presenters/renalware/renal/clinical_summary_presenter.rb +2 -0
  151. data/app/presenters/renalware/reporting/audit_presenter.rb +2 -0
  152. data/app/presenters/renalware/summary_part.rb +2 -0
  153. data/app/presenters/renalware/system/users_presenter.rb +2 -0
  154. data/app/presenters/renalware/time_of_day_presenter.rb +2 -0
  155. data/app/presenters/renalware/transplants/consent_presenter.rb +2 -0
  156. data/app/presenters/renalware/transplants/donor_dashboard_presenter.rb +2 -0
  157. data/app/presenters/renalware/transplants/mdm_presenter.rb +2 -0
  158. data/app/presenters/renalware/transplants/patient_presenter.rb +2 -0
  159. data/app/presenters/renalware/transplants/recipient_dashboard_presenter.rb +2 -0
  160. data/app/presenters/renalware/transplants/wait_list_registration_presenter.rb +2 -0
  161. data/app/presenters/renalware/ukrdc/pathology_observation_presenter.rb +2 -0
  162. data/app/presenters/renalware/ukrdc/patient_presenter.rb +58 -4
  163. data/app/presenters/string_presenter.rb +2 -0
  164. data/app/presenters/time_presenter.rb +2 -0
  165. data/app/presenters/true_class_presenter.rb +2 -0
  166. data/app/views/renalware/api/ukrdc/patients/_encounters.xml.builder +1 -3
  167. data/app/views/renalware/api/ukrdc/patients/_lab_orders.xml.builder +5 -6
  168. data/app/views/renalware/api/ukrdc/patients/_observations.xml.builder +5 -4
  169. data/app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder +1 -1
  170. data/app/views/renalware/api/ukrdc/patients/lab_orders/_lab_order.xml.builder +7 -1
  171. data/app/views/renalware/api/v1/medications/prescriptions/index.json.jbuilder +14 -0
  172. data/app/views/renalware/api/v1/patients/patients/show.json.jbuilder +17 -4
  173. data/app/views/renalware/clinics/clinic_visits/_clinic_visit.html.slim +1 -1
  174. data/app/views/renalware/events/events/toggled_cell/_biopsy.html.slim +1 -1
  175. data/app/views/renalware/events/events/toggled_cell/_investigation.html.slim +1 -1
  176. data/app/views/renalware/events/events/toggled_cell/_simple.html.slim +1 -1
  177. data/app/views/renalware/events/events/toggled_cell/_swab.html.slim +1 -1
  178. data/app/views/renalware/events/swabs/_list.html.slim +1 -1
  179. data/app/views/renalware/hd/mdm_patients/_patient.html.slim +6 -0
  180. data/app/views/renalware/hd/mdm_patients/_table.html.slim +6 -0
  181. data/app/views/renalware/layouts/_patient.html.slim +32 -30
  182. data/app/views/renalware/letters/completed_letters/create.js.erb +8 -0
  183. data/app/views/renalware/letters/completed_letters/new.html.slim +27 -0
  184. data/app/views/renalware/letters/lists/_letter.html.slim +18 -4
  185. data/app/views/renalware/letters/lists/_table.html.slim +19 -0
  186. data/app/views/renalware/letters/lists/show.html.slim +13 -24
  187. data/app/views/renalware/letters/lists/show.js.erb +11 -0
  188. data/app/views/renalware/medications/_summary_part.html.slim +17 -16
  189. data/app/views/renalware/pathology/current_observation_results/index.html.slim +9 -12
  190. data/app/views/renalware/patients/_layout.html.slim +27 -24
  191. data/app/views/renalware/patients/_side_menu.html.slim +1 -0
  192. data/app/views/renalware/patients/side_menu/_actions.html.slim +1 -1
  193. data/app/views/renalware/virology/vaccinations/_toggled_cell.html.slim +1 -1
  194. data/config/initializers/delayed_job.rb +3 -0
  195. data/config/initializers/wicked_pdf.rb +0 -1
  196. data/config/locales/en.yml +6 -0
  197. data/config/locales/renalware/hd/mdm_patients.yml +6 -0
  198. data/config/routes.rb +2 -4
  199. data/db/functions/import_practice_memberships_csv_v02.sql +50 -0
  200. data/db/migrate/20180221210458_add_state_index_on_modalities.rb +5 -0
  201. data/db/migrate/20180222090501_add_partial_index_to_bookmarks.rb +6 -0
  202. data/db/migrate/20180223100420_add_sent_to_ukrdc_at_to_patients.rb +5 -0
  203. data/db/migrate/20180226124724_add_patient_id_to_virology_profile.rb +9 -0
  204. data/db/migrate/20180226132410_create_ukrdc_transmission_logs.rb +15 -0
  205. data/db/migrate/20180301095040_update_fn_to_upsert_gp_practive_memberships.rb +9 -0
  206. data/db/migrate/20180305134959_add_display_group_to_observation_desriptions.rb +32 -0
  207. data/db/migrate/20180306071308_remove_rogue_aki_alerts_column.rb +5 -0
  208. data/db/migrate/20180306080518_add_state_tracking_cols_to_letters.rb +19 -0
  209. data/lib/renalware/engine.rb +1 -0
  210. data/lib/renalware/version.rb +1 -1
  211. data/lib/tasks/ukrdc.rake +16 -0
  212. data/lib/test_support/ajax_helpers.rb +2 -2
  213. data/spec/factories/accesses/patients.rb +2 -0
  214. data/spec/factories/accesses/plans.rb +2 -0
  215. data/spec/factories/accesses/plans_types.rb +2 -0
  216. data/spec/factories/accesses/procedures.rb +2 -0
  217. data/spec/factories/accesses/profiles.rb +2 -0
  218. data/spec/factories/accesses/sites.rb +2 -0
  219. data/spec/factories/accesses/types.rb +2 -0
  220. data/spec/factories/admissions/admissions.rb +2 -0
  221. data/spec/factories/admissions/consult_sites.rb +2 -0
  222. data/spec/factories/admissions/consults.rb +2 -0
  223. data/spec/factories/admissions/request_reasons.rb +2 -0
  224. data/spec/factories/admissions/requests.rb +1 -0
  225. data/spec/factories/clinical/allergies.rb +2 -0
  226. data/spec/factories/clinical/body_compositions.rb +2 -0
  227. data/spec/factories/clinical/dry_weights.rb +2 -0
  228. data/spec/factories/clinical/patients.rb +2 -0
  229. data/spec/factories/clinics/appointments.rb +2 -0
  230. data/spec/factories/clinics/clinic_visits.rb +2 -0
  231. data/spec/factories/clinics/clinics.rb +2 -0
  232. data/spec/factories/deaths/cause.rb +2 -0
  233. data/spec/factories/deaths/modality_descriptions.rb +2 -0
  234. data/spec/factories/directory/people.rb +2 -0
  235. data/spec/factories/drugs/drug.rb +2 -0
  236. data/spec/factories/drugs/drug_types.rb +7 -0
  237. data/spec/factories/events/events.rb +2 -0
  238. data/spec/factories/events/events_types.rb +2 -0
  239. data/spec/factories/feeds/file.rb +2 -0
  240. data/spec/factories/feeds/file_types.rb +2 -0
  241. data/spec/factories/hd/cannulation_types.rb +2 -0
  242. data/spec/factories/hd/dialysates.rb +2 -0
  243. data/spec/factories/hd/dialysers.rb +2 -0
  244. data/spec/factories/hd/diaries.rb +2 -0
  245. data/spec/factories/hd/diurnal_period_codes.rb +2 -0
  246. data/spec/factories/hd/hd_session_document.rb +2 -0
  247. data/spec/factories/hd/modality_descriptions.rb +2 -0
  248. data/spec/factories/hd/patient_statistics.rb +2 -0
  249. data/spec/factories/hd/patients.rb +2 -0
  250. data/spec/factories/hd/preference_sets.rb +2 -0
  251. data/spec/factories/hd/profiles.rb +2 -0
  252. data/spec/factories/hd/schedule_definitions.rb +2 -0
  253. data/spec/factories/hd/sessions.rb +2 -0
  254. data/spec/factories/hd/slots.rb +2 -0
  255. data/spec/factories/hd/station_locations.rb +2 -0
  256. data/spec/factories/hd/stations.rb +2 -0
  257. data/spec/factories/hospitals/centres.rb +2 -0
  258. data/spec/factories/hospitals/units.rb +2 -0
  259. data/spec/factories/hospitals/wards.rb +2 -0
  260. data/spec/factories/letters/archives.rb +2 -0
  261. data/spec/factories/letters/contact_descriptions.rb +2 -0
  262. data/spec/factories/letters/contacts.rb +2 -0
  263. data/spec/factories/letters/descriptions.rb +2 -0
  264. data/spec/factories/letters/electronic_receipts.rb +2 -0
  265. data/spec/factories/letters/letterheads.rb +2 -0
  266. data/spec/factories/letters/letters.rb +2 -0
  267. data/spec/factories/letters/patients.rb +2 -0
  268. data/spec/factories/letters/primary_care_physicians.rb +2 -0
  269. data/spec/factories/letters/recipients.rb +2 -0
  270. data/spec/factories/low_clearance/modality_descriptions.rb +2 -0
  271. data/spec/factories/low_clearance/patients.rb +2 -0
  272. data/spec/factories/low_clearance/profiles.rb +2 -0
  273. data/spec/factories/medications/medication_route.rb +2 -0
  274. data/spec/factories/medications/prescription.rb +2 -0
  275. data/spec/factories/medications/prescription_terminations.rb +2 -0
  276. data/spec/factories/medications/prescription_version.rb +2 -0
  277. data/spec/factories/messaging/internal/authors.rb +2 -0
  278. data/spec/factories/messaging/internal/messages.rb +2 -0
  279. data/spec/factories/messaging/internal/receipts.rb +2 -0
  280. data/spec/factories/messaging/internal/recipients.rb +2 -0
  281. data/spec/factories/messaging/patients.rb +2 -0
  282. data/spec/factories/modalities/modalities.rb +2 -0
  283. data/spec/factories/modalities/modality_descriptions.rb +2 -0
  284. data/spec/factories/modalities/modality_reasons.rb +2 -0
  285. data/spec/factories/pathology/consultant.rb +2 -0
  286. data/spec/factories/pathology/lab.rb +2 -0
  287. data/spec/factories/pathology/measurement_units.rb +2 -0
  288. data/spec/factories/pathology/observation_descriptions.rb +6 -0
  289. data/spec/factories/pathology/observation_requests.rb +3 -1
  290. data/spec/factories/pathology/observations.rb +2 -0
  291. data/spec/factories/pathology/patients.rb +2 -0
  292. data/spec/factories/pathology/request_descriptions.rb +2 -0
  293. data/spec/factories/pathology/requests/drug_category.rb +2 -0
  294. data/spec/factories/pathology/requests/global_rule.rb +2 -0
  295. data/spec/factories/pathology/requests/global_rule_set.rb +2 -0
  296. data/spec/factories/pathology/requests/patient_rule.rb +2 -0
  297. data/spec/factories/pathology/requests/request.rb +2 -0
  298. data/spec/factories/patients/alerts.rb +2 -0
  299. data/spec/factories/patients/bookmarks.rb +2 -0
  300. data/spec/factories/patients/ethnicities.rb +2 -0
  301. data/spec/factories/patients/languages.rb +2 -0
  302. data/spec/factories/patients/patients.rb +2 -0
  303. data/spec/factories/patients/practice_memberships.rb +2 -0
  304. data/spec/factories/patients/practices.rb +2 -0
  305. data/spec/factories/patients/primary_care_physicians.rb +2 -0
  306. data/spec/factories/patients/religions.rb +2 -0
  307. data/spec/factories/patients/users.rb +2 -0
  308. data/spec/factories/pd/assessments.rb +2 -0
  309. data/spec/factories/pd/bag_types.rb +2 -0
  310. data/spec/factories/pd/episode_types.rb +2 -0
  311. data/spec/factories/pd/exit_site_infections.rb +2 -0
  312. data/spec/factories/pd/fluid_descriptions.rb +2 -0
  313. data/spec/factories/pd/infection_organisms.rb +2 -0
  314. data/spec/factories/pd/modality_descriptions.rb +2 -0
  315. data/spec/factories/pd/organism_codes.rb +2 -0
  316. data/spec/factories/pd/patients.rb +2 -0
  317. data/spec/factories/pd/pd_regimes.rb +2 -0
  318. data/spec/factories/pd/peritonitis_episode_type_descriptions.rb +2 -0
  319. data/spec/factories/pd/peritonitis_episodes.rb +2 -0
  320. data/spec/factories/pd/pet_adequacies.rb +2 -0
  321. data/spec/factories/pd/regime_bags.rb +2 -0
  322. data/spec/factories/pd/systems.rb +2 -0
  323. data/spec/factories/pd/training_sessions.rb +2 -0
  324. data/spec/factories/pd/training_sites.rb +2 -0
  325. data/spec/factories/pd/training_types.rb +2 -0
  326. data/spec/factories/problems/problems.rb +2 -0
  327. data/spec/factories/renal/aki_alert_actions.rb +2 -0
  328. data/spec/factories/renal/aki_alerts.rb +2 -0
  329. data/spec/factories/renal/patients.rb +2 -0
  330. data/spec/factories/renal/prd_description.rb +2 -0
  331. data/spec/factories/renal/profiles.rb +2 -0
  332. data/spec/factories/reporting/audits.rb +2 -0
  333. data/spec/factories/research/studies.rb +2 -0
  334. data/spec/factories/research/study_participants.rb +2 -0
  335. data/spec/factories/shared/accountable.rb +2 -0
  336. data/spec/factories/snippets/snippets.rb +2 -0
  337. data/spec/factories/snippets/users.rb +2 -0
  338. data/spec/factories/system/addresses.rb +6 -0
  339. data/spec/factories/system/countries.rb +2 -0
  340. data/spec/factories/system/roles.rb +2 -0
  341. data/spec/factories/system/templates.rb +2 -0
  342. data/spec/factories/system/users.rb +2 -0
  343. data/spec/factories/transplants/donations.rb +2 -0
  344. data/spec/factories/transplants/donor_stage.rb +2 -0
  345. data/spec/factories/transplants/donor_stage_position.rb +2 -0
  346. data/spec/factories/transplants/donor_stage_status.rb +2 -0
  347. data/spec/factories/transplants/live_donor_modality_description.rb +2 -0
  348. data/spec/factories/transplants/modality_descriptions.rb +2 -0
  349. data/spec/factories/transplants/patients.rb +2 -0
  350. data/spec/factories/transplants/recipient_followups.rb +2 -0
  351. data/spec/factories/transplants/recipient_operations.rb +2 -0
  352. data/spec/factories/transplants/registration_status_descriptions.rb +2 -0
  353. data/spec/factories/transplants/registration_statuses.rb +2 -0
  354. data/spec/factories/transplants/registrations.rb +2 -0
  355. data/spec/factories/virology/vaccinations.rb +2 -0
  356. data/spec/support/capybara.rb +2 -0
  357. data/spec/support/capybara_helper.rb +2 -0
  358. data/spec/support/database_functions_spec_helper.rb +2 -0
  359. data/spec/support/date_helpers.rb +2 -0
  360. data/spec/support/devise_spec_helper.rb +2 -0
  361. data/spec/support/drugs_spec_helper.rb +2 -0
  362. data/spec/support/factory_bot.rb +2 -0
  363. data/spec/support/json_helpers.rb +2 -0
  364. data/spec/support/letters_spec_helper.rb +9 -0
  365. data/spec/support/login_macros.rb +2 -0
  366. data/spec/support/matchers/document.rb +2 -0
  367. data/spec/support/matchers/validate_timeliness_of.rb +2 -0
  368. data/spec/support/pathology_spec_helper.rb +2 -0
  369. data/spec/support/patients_spec_helper.rb +2 -0
  370. data/spec/support/poltergeist.rb +2 -0
  371. data/spec/support/pundit_matcher.rb +2 -0
  372. data/spec/support/roles_spec_helper.rb +2 -0
  373. data/spec/support/select2_spec_helper.rb +2 -0
  374. data/spec/support/select_date_spec_helper.rb +2 -0
  375. data/spec/support/shared_contexts/a_global_rule_set.rb +2 -0
  376. data/spec/support/shared_examples/accountable_examples.rb +2 -0
  377. data/spec/support/shared_examples/paranoia_examples.rb +2 -1
  378. data/spec/support/shared_examples/supersedable_examples.rb +2 -0
  379. data/spec/support/translations.rb +2 -0
  380. data/spec/support/travel.rb +2 -0
  381. data/spec/support/webmock.rb +2 -0
  382. metadata +39 -6
  383. data/app/presenters/renalware/pathology/historical_observation_results/html_table_view.rb +0 -64
  384. data/app/presenters/renalware/pathology/historical_observation_results/presenter.rb +0 -86
  385. data/app/presenters/renalware/pathology/recent_observation_results/html_table_view.rb +0 -39
  386. data/app/presenters/renalware/pathology/recent_observation_results/presenter.rb +0 -107
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pathology_requests_patient_rule,
3
5
  class: "Renalware::Pathology::Requests::PatientRule" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pathology_requests_request, class: "Renalware::Pathology::Requests::Request" do
3
5
  accountable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :patient_alert, class: "Renalware::Patients::Alert" do
3
5
  accountable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :patients_bookmark, class: "Renalware::Patients::Bookmark" do
3
5
  notes { Faker::Lorem.sentence }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :ethnicity, class: "Renalware::Patients::Ethnicity" do
3
5
  name "White - British"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :language, class: "Renalware::Patients::Language" do
3
5
  name "English"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  sequence :nhs_number do |n|
3
5
  n.to_s.rjust(10, "0000000000")
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :practice_membership, class: "Renalware::Patients::PracticeMembership" do
3
5
  practice
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  sequence :practice_code do |n|
3
5
  "PR432#{n}"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  sequence :gp_code do |n|
3
5
  "GP1234#{n}"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :patients_religion, class: "Renalware::Patients::Religion" do
3
5
  name "Christian"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :patients_user, class: "Renalware::Patients::User", parent: :user
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pd_assessment, class: "Renalware::PD::Assessment" do
3
5
  accountable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :bag_type, class: "Renalware::PD::BagType" do
3
5
  manufacturer "Star Brand, Lucky Brand"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :episode_type, class: "Renalware::PD::EpisodeType" do
3
5
  term "De novo"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :exit_site_infection, class: "Renalware::PD::ExitSiteInfection" do
3
5
  patient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :fluid_description, class: "Renalware::PD::FluidDescription" do
3
5
  description "Clear"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :infection_organism, class: "Renalware::PD::InfectionOrganism" do
3
5
  organism_code
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pd_modality_description, class: "Renalware::PD::ModalityDescription" do
3
5
  name "PD"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :organism_code, class: "Renalware::PD::OrganismCode" do
3
5
  code "7"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pd_patient, class: "Renalware::PD::Patient", parent: :patient
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pd_regime, class: "Renalware::PD::Regime" do
3
5
  patient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  sequence(:term) { |n| "term-#{n}" }
3
5
  factory :peritonitis_episode_type_description,
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :peritonitis_episode, class: "Renalware::PD::PeritonitisEpisode" do
3
5
  patient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pet_adequacy_result, class: "Renalware::PD::PETAdequacyResult" do
3
5
  patient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pd_regime_bag, class: "Renalware::PD::RegimeBag" do
3
5
  bag_type
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :apd_system, class: "Renalware::PD::System" do
3
5
  name { Faker::Company.name }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pd_training_session, class: "Renalware::PD::TrainingSession" do
3
5
  accountable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pd_training_site, class: "Renalware::PD::TrainingSite" do
3
5
  code "HOME"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :pd_training_type, class: "Renalware::PD::TrainingType" do
3
5
  name "APD Baxter"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :problem, class: "Renalware::Problems::Problem" do
3
5
  accountable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :aki_alert_action, class: "Renalware::Renal::AKIAlertAction" do
3
5
  name "IP Review"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :aki_alert, class: "Renalware::Renal::AKIAlert" do
3
5
  accountable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :renal_patient, class: "Renalware::Renal::Patient", parent: :patient
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :prd_description, class: "Renalware::Renal::PRDDescription" do
3
5
  code "1074"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :renal_profile, class: "Renalware::Renal::Profile" do
3
5
  prd_description
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :audit, class: "Renalware::Reporting::Audit" do
3
5
  name "Letters Authors"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :research_study, class: "Renalware::Research::Study" do
3
5
  code { SecureRandom.hex(8) }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :research_study_participant, class: "Renalware::Research::StudyParticipant" do
3
5
  association :study, factory: :research_study
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # A global trait for setting created_by and updated_by.
2
4
  #
3
5
  # When a model includes the Accountable concern, it adds a #by attributes and this
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :snippet, class: "Renalware::Snippets::Snippet" do
3
5
  title { Faker::Lorem.sentence }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :snippets_user, class: "Renalware::Snippets::User", parent: :user do
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :address, class: "Renalware::Address" do
3
5
  street_1 "123 Legoland"
@@ -7,5 +9,9 @@ FactoryBot.define do
7
9
  county "Berkshire"
8
10
  country { Renalware::System::Country.find_by(alpha2: "GB") }
9
11
  postcode "NW1 6BB"
12
+
13
+ trait :in_uk do
14
+ association(:country, factory: :united_kingdom)
15
+ end
10
16
  end
11
17
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :country, class: "Renalware::System::Country" do
3
5
  factory :united_kingdom do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :role, class: "Renalware::Role" do
3
5
  initialize_with { Renalware::Role.find_or_create_by(name: name) }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :esi_printable_form_template, class: "Renalware::System::Template" do
3
5
  name "esi_printable_form"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  sequence :email do |n|
3
5
  "renalware.user-#{n}@nhs.net"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :transplant_donation, class: Renalware::Transplants::Donation do
3
5
  patient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :donor_stage, class: "Renalware::Transplants::DonorStage" do
3
5
  accountable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :donor_stage_position, class: "Renalware::Transplants::DonorStagePosition" do
3
5
  name { Faker::Lorem.word }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :donor_stage_status, class: "Renalware::Transplants::DonorStageStatus" do
3
5
  name { Faker::Lorem.word }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :live_donor_modality_description,
3
5
  class: "Renalware::Transplants::DonorModalityDescription" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :transplant_donor_modality_description,
3
5
  class: "Renalware::Transplants::DonorModalityDescription" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :transplant_patient, class: "Renalware::Transplants::Patient", parent: :patient
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :transplant_recipient_followup, class: Renalware::Transplants::RecipientFollowup do
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :transplant_recipient_operation, class: Renalware::Transplants::RecipientOperation do
3
5
  patient { build(:transplant_patient) }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :transplant_registration_status_description,
3
5
  class: Renalware::Transplants::RegistrationStatusDescription do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :transplant_registration_status, class: Renalware::Transplants::RegistrationStatus do
3
5
  accountable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :transplant_registration, class: Renalware::Transplants::Registration do
3
5
  patient { build(:transplant_patient) }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :vaccination, class: "Renalware::Virology::Vaccination" do
3
5
  event_type factory: :vaccination_event_type