renalware-core 2.0.64 → 2.0.67

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/renalware/application.js.erb +2 -2
  3. data/app/controllers/renalware/admin/users_controller.rb +1 -1
  4. data/app/controllers/renalware/api/ukrdc/patients_controller.rb +14 -67
  5. data/app/controllers/renalware/drugs/drugs_controller.rb +1 -1
  6. data/app/controllers/renalware/hd/protocols_controller.rb +1 -1
  7. data/app/controllers/renalware/patients/bookmarks_controller.rb +16 -5
  8. data/app/controllers/renalware/snippets/snippets_controller.rb +1 -1
  9. data/app/controllers/renalware/system/user_feedback_controller.rb +1 -1
  10. data/app/documents/renalware/hd/session_document.rb +1 -0
  11. data/app/models/renalware/admissions/consult_query.rb +1 -1
  12. data/app/models/renalware/clinical/dry_weight.rb +4 -0
  13. data/app/models/renalware/clinical/patient.rb +5 -0
  14. data/app/models/renalware/clinical/patient_dry_weights_query.rb +1 -1
  15. data/app/models/renalware/directory/person_query.rb +1 -1
  16. data/app/models/renalware/hd/mdm_patients_query.rb +1 -1
  17. data/app/models/renalware/hd/patient.rb +6 -0
  18. data/app/models/renalware/hd/patient_listener.rb +8 -0
  19. data/app/models/renalware/hd/sessions/ongoing_query.rb +1 -1
  20. data/app/models/renalware/hd/sessions/patient_query.rb +1 -1
  21. data/app/models/renalware/letters/descriptions/search_query.rb +1 -1
  22. data/app/models/renalware/letters/letter_factory.rb +55 -2
  23. data/app/models/renalware/letters/letter_query.rb +1 -1
  24. data/app/models/renalware/letters/recipient.rb +11 -0
  25. data/app/models/renalware/letters/resolve_default_electronic_ccs.rb +47 -0
  26. data/app/models/renalware/low_clearance/mdm_patients_query.rb +1 -1
  27. data/app/models/renalware/medications/prescriptions_by_drug_type_query.rb +1 -1
  28. data/app/models/renalware/medications/prescriptions_query.rb +1 -1
  29. data/app/models/renalware/patients/bookmarks_query.rb +49 -0
  30. data/app/models/renalware/patients/patient_search.rb +1 -1
  31. data/app/models/renalware/pd/mdm_patients_query.rb +1 -1
  32. data/app/models/renalware/renal/prd_descriptions/search_query.rb +1 -1
  33. data/app/models/renalware/transplants/live_donors_query.rb +1 -1
  34. data/app/models/renalware/transplants/mdm_patients_query.rb +1 -1
  35. data/app/models/renalware/transplants/registrations/wait_list_query.rb +1 -1
  36. data/app/models/renalware/ukrdc/create_encrypted_patient_xml_files.rb +13 -11
  37. data/app/models/renalware/ukrdc/create_patient_xml_file.rb +33 -21
  38. data/app/models/renalware/ukrdc/transmission_log.rb +1 -1
  39. data/app/models/renalware/ukrdc/xml_renderer.rb +126 -0
  40. data/app/presenters/renalware/clinical/dry_weight_presenter.rb +4 -0
  41. data/app/presenters/renalware/clinical/dry_weights_presenter.rb +15 -9
  42. data/app/presenters/renalware/ukrdc/modality_presenter.rb +8 -0
  43. data/app/presenters/renalware/ukrdc/patient_presenter.rb +9 -6
  44. data/app/views/renalware/api/ukrdc/patients/_clinical_relationships.xml.builder +4 -4
  45. data/app/views/renalware/api/ukrdc/patients/_encounters.xml.builder +9 -9
  46. data/app/views/renalware/api/ukrdc/patients/_family_histories.xml.builder +4 -4
  47. data/app/views/renalware/api/ukrdc/patients/_patient.xml.builder +1 -20
  48. data/app/views/renalware/api/ukrdc/patients/_program_memberships.xml.builder +4 -4
  49. data/app/views/renalware/api/ukrdc/patients/_surveys.xml.builder +4 -4
  50. data/app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder +31 -31
  51. data/app/views/renalware/api/ukrdc/patients/encounters/_treatment.xml.builder +34 -0
  52. data/app/views/renalware/api/ukrdc/patients/lab_orders/_lab_order.xml.builder +1 -1
  53. data/app/views/renalware/api/ukrdc/patients/show.xml.builder +1 -1
  54. data/app/views/renalware/hd/mdm/_summary.html.slim +12 -4
  55. data/app/views/renalware/hd/protocols/_recent_pathology.html.slim +4 -0
  56. data/app/views/renalware/hd/sessions/_form.html.slim +1 -0
  57. data/app/views/renalware/mdm/_prescription_buttons.html.slim +15 -0
  58. data/app/views/renalware/mdm/_prescriptions.html.slim +1 -8
  59. data/app/views/renalware/patients/bookmarks/_bookmark.html.slim +16 -0
  60. data/app/views/renalware/patients/bookmarks/_table.html.slim +20 -0
  61. data/app/views/renalware/patients/bookmarks/index.html.slim +3 -1
  62. data/app/views/renalware/transplants/mdm/_prescriptions.html.slim +1 -8
  63. data/config/initializers/core_extensions.rb +1 -1
  64. data/config/initializers/renalware.rb +3 -0
  65. data/config/locales/renalware/hd/session.en.yml +7 -0
  66. data/config/locales/renalware/patients/bookmarks.en.yml +12 -0
  67. data/config/locales/renalware/patients/side_menu.en.yml +1 -1
  68. data/db/migrate/20150119160039_create_versions.rb +3 -3
  69. data/db/migrate/20150120155952_create_problem_versions.rb +3 -3
  70. data/db/migrate/20150203161438_create_medication_prescription_versions.rb +3 -3
  71. data/db/migrate/20150515155052_users_have_and_belong_to_many_roles.rb +3 -1
  72. data/db/migrate/20160120203747_create_access_versions.rb +3 -3
  73. data/db/migrate/20160121175711_create_hd_versions.rb +3 -3
  74. data/db/migrate/20170217141529_create_clinic_versions.rb +3 -3
  75. data/db/migrate/20170217161409_create_patient_versions.rb +3 -3
  76. data/db/migrate/20170605102519_create_clinical_versions.rb +3 -3
  77. data/db/migrate/20171002175804_add_rr_columns_to_transplant_registration_status_descriptions.rb +9 -7
  78. data/db/migrate/20171003093347_create_hospital_wards.rb +14 -12
  79. data/db/migrate/20171003111228_create_aki_alert_actions.rb +6 -4
  80. data/db/migrate/20171003122425_create_renal_aki_alerts.rb +18 -16
  81. data/db/migrate/20171004092235_create_hd_dialysates.rb +9 -7
  82. data/db/migrate/20171004110909_add_dialysate_id_to_profile_and_session.rb +6 -4
  83. data/db/migrate/20171005081224_create_reporting_bone_audit.rb +3 -1
  84. data/db/migrate/20171005091202_reporting_audit_changes.rb +5 -3
  85. data/db/migrate/20171005130109_create_medication_current_prescriptions.rb +3 -1
  86. data/db/migrate/20171005144505_create_reporting_anaemia_audit.rb +3 -1
  87. data/db/migrate/20171009104106_add_legacy_patient_id_to_patients.rb +4 -2
  88. data/db/migrate/20171009181615_add_columns_to_drug_drugs.rb +6 -4
  89. data/db/migrate/20171012110133_create_research_studies.rb +19 -17
  90. data/db/migrate/20171012143050_create_research_study_participants.rb +27 -25
  91. data/db/migrate/20171013145849_set_patients_secure_id.rb +12 -10
  92. data/db/migrate/20171016152223_add_index_to_diary_slots.rb +14 -12
  93. data/db/migrate/20171017132738_add_unique_indexes_to_local_patient_ids.rb +11 -9
  94. data/db/migrate/20171017171625_update_hd_overall_audit_view.rb +7 -5
  95. data/db/migrate/20171101121130_create_function_to_render_audit_view_as_json.rb +6 -4
  96. data/db/migrate/20171101162244_create_consults.rb +21 -19
  97. data/db/migrate/20171106100216_create_pd_audit_view.rb +3 -1
  98. data/db/migrate/20171109084751_remove_local_patient_id_unique_idx.rb +11 -9
  99. data/db/migrate/20171113120217_add_uuid_to_hd_sessions.rb +4 -2
  100. data/db/migrate/20171114120904_add_pathology_snapshot_to_letters.rb +3 -1
  101. data/db/migrate/20171118160030_add_tags_to_patient_bookmarks.rb +3 -1
  102. data/db/migrate/20171123123712_add_id_to_roles_users.rb +3 -1
  103. data/db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb +13 -12
  104. data/db/migrate/20171123154116_create_renal_versions.rb +11 -9
  105. data/db/migrate/20171127082158_add_region_to_addresses.rb +3 -1
  106. data/db/migrate/20171127092158_create_function_to_import_practices.rb +6 -2
  107. data/db/migrate/20171127092359_create_fn_to_insert_gps.rb +6 -2
  108. data/db/migrate/20171128163543_add_more_missing_indexes.rb +14 -12
  109. data/db/migrate/20171204112150_create_consult_sites.rb +13 -9
  110. data/db/migrate/20171206121652_add_loinc_code_to_observation_descriptions.rb +3 -1
  111. data/db/migrate/20171206140738_create_fn_to_load_practice_memberships_csv.rb +9 -5
  112. data/db/migrate/20171208211206_create_user_feedback.rb +7 -5
  113. data/db/migrate/20171211130716_remove_unused_patients_cols.rb +4 -2
  114. data/db/migrate/20171211131918_remove_email_from_primary_care_physicians.rb +5 -3
  115. data/db/migrate/20171211161400_create_pathology_current_table.rb +9 -7
  116. data/db/migrate/20171213111513_create_fn_to_refresh_current_obs.rb +6 -2
  117. data/db/migrate/20171214141335_create_trigger_to_update_current_observation_sets.rb +10 -6
  118. data/db/migrate/20171214190849_enforce_request_id_on_observations.rb +3 -1
  119. data/db/migrate/20171215122454_add_pathology_observation_set_to_letters.rb +8 -6
  120. data/db/migrate/20171219154529_create_admission_admissions.rb +25 -23
  121. data/db/migrate/20180102155055_update_patient_summaries_to_version_5.rb +3 -1
  122. data/db/migrate/20180105132358_add_emailed_at_to_letter_recipients.rb +4 -2
  123. data/db/migrate/20180108185400_remove_null_constraint_from_letters_pathology_snapshot.rb +3 -1
  124. data/db/migrate/20180112151706_create_low_clearance_profiles.rb +43 -41
  125. data/db/migrate/20180112151813_create_low_clearance_versions.rb +11 -9
  126. data/db/migrate/20180119121243_create_trigger_to_preprocess_hl7_msg.rb +10 -6
  127. data/db/migrate/20180121115246_add_include_pathology_in_letter_to_letters_letterheads.rb +3 -1
  128. data/db/migrate/20180122173922_create_virology_profiles.rb +5 -1
  129. data/db/migrate/20180125201356_make_obs_set_trigger_change_updated_at.rb +6 -2
  130. data/db/migrate/20180126142314_add_uuid_to_letters.rb +4 -2
  131. data/db/migrate/20180130165803_add_deleted_at_indexes.rb +14 -12
  132. data/db/migrate/20180201090444_add_created_at_to_delayed_jobs_in_hl7_trig_fn.rb +6 -2
  133. data/db/migrate/20180202184954_create_view_pathology_observation_digests.rb +3 -1
  134. data/db/migrate/20180206225525_update_fn_update_current_observation_set_from_trigger.rb +6 -2
  135. data/db/migrate/20180207082540_create_count_estimate_function.rb +6 -2
  136. data/db/migrate/20180208150629_add_authentication_token_to_users.rb +3 -1
  137. data/db/migrate/20180213124203_add_cancelled_to_pathology_observations.rb +7 -5
  138. data/db/migrate/20180213125734_update_fn_update_current_obs_set_trgger.rb +6 -2
  139. data/db/migrate/20180213171805_add_display_order_cols_to_observation_descriptions.rb +10 -8
  140. data/db/migrate/20180214124317_add_cols_to_aki_alerts.rb +7 -5
  141. data/db/migrate/20180216132741_disable_some_audits.rb +6 -4
  142. data/db/migrate/20180221210458_add_state_index_on_modalities.rb +3 -1
  143. data/db/migrate/20180222090501_add_partial_index_to_bookmarks.rb +4 -2
  144. data/db/migrate/20180223100420_add_sent_to_ukrdc_at_to_patients.rb +3 -1
  145. data/db/migrate/20180226124724_add_patient_id_to_virology_profile.rb +9 -5
  146. data/db/migrate/20180226132410_create_ukrdc_transmission_logs.rb +12 -10
  147. data/db/migrate/20180301095040_update_fn_to_upsert_gp_practive_memberships.rb +7 -3
  148. data/db/migrate/20180305134959_add_display_group_to_observation_desriptions.rb +23 -22
  149. data/db/migrate/20180306071308_remove_rogue_aki_alerts_column.rb +3 -1
  150. data/db/migrate/20180306080518_add_state_tracking_cols_to_letters.rb +17 -15
  151. data/db/migrate/20180307191650_add_dwell_time_to_pd_regime.rb +3 -1
  152. data/db/migrate/20180307223111_create_system_visits_and_events.rb +42 -39
  153. data/db/migrate/20180309140316_add_unique_constraint_to_obr_requestor.rb +3 -1
  154. data/db/migrate/20180311104609_remove_unique_obr_requestor_order_number_index.rb +4 -2
  155. data/db/migrate/20180313114927_remove_deleted_at_from_admission_consults.rb +3 -1
  156. data/db/migrate/20180313124819_remove_tx_operation_constraints.rb +7 -5
  157. data/db/migrate/20180319191942_create_function_to_sort_without_failing_on_nonnumerics.rb +6 -2
  158. data/db/migrate/20180323150241_update_path_obs_descs_for_letter_groupings.rb +25 -23
  159. data/db/migrate/20180326155400_add_admin_notes_to_system_user_feedback.rb +4 -2
  160. data/db/migrate/20180327100423_add_constraints_to_recipient_operations.rb +3 -1
  161. data/db/migrate/20180328210434_add_rrt_to_admission_consults.rb +3 -1
  162. data/db/migrate/20180419141524_add_cols_to_hd_patient_statistics.rb +8 -6
  163. data/db/migrate/20180422090043_update_hd_overall_audit_to_version_6.rb +85 -84
  164. data/db/migrate/20180427133558_add_code_to_hospitals_wards.rb +3 -1
  165. data/db/migrate/20180502093256_add_document_to_virology_profiles.rb +22 -21
  166. data/db/migrate/20180502110638_create_virology_versions.rb +7 -5
  167. data/db/migrate/20180510151959_update_hd_overall_audit_to_version_7.rb +8 -4
  168. data/db/migrate/20180511100345_add_notes_to_transplant_registration_statuses.rb +3 -1
  169. data/db/migrate/20180511140415_add_message_hash_messaging_messages.rb +4 -2
  170. data/db/migrate/20180511171835_create_unique_indexes_on_obr_obr_codes.rb +5 -3
  171. data/db/migrate/20180514151627_create_system_messages.rb +10 -8
  172. data/db/migrate/20180516111411_create_view_patient_current_modalities.rb +3 -1
  173. data/db/migrate/20180524072633_add_columns_to_dialysates.rb +10 -8
  174. data/db/migrate/20180524074320_add_columns_to_hd_dialysers.rb +8 -6
  175. data/db/migrate/20180605114332_create_pseudo_encrypt_function.rb +6 -2
  176. data/db/migrate/20180605141806_add_external_id_to_research_study_participants.rb +33 -31
  177. data/db/migrate/20180605175211_add_application_url_to_research_studies.rb +3 -1
  178. data/db/migrate/20180622130552_add_external_id_to_hd_sessions.rb +4 -2
  179. data/db/migrate/20180625124431_add_patient_identifier_to_feed_messages.rb +3 -1
  180. data/db/migrate/20180628132323_add_letter_date_indexes.rb +9 -7
  181. data/db/migrate/20180702091222_create_hd_providers.rb +5 -3
  182. data/db/migrate/20180702091237_create_hd_provider_units.rb +8 -6
  183. data/db/migrate/20180702091352_create_hd_transmission_log.rb +15 -13
  184. data/db/migrate/20180712143314_add_hidden_to_modality_descriptions.rb +3 -1
  185. data/db/migrate/20180718172750_update_audit_letters_authors_to_version_3.rb +13 -11
  186. data/db/migrate/20180725132557_add_days_text_to_hd_schedule_definitions.rb +21 -19
  187. data/db/migrate/20180725132808_create_hd_schedule_definition_filters_view.rb +3 -1
  188. data/db/migrate/20180730154454_add_external_session_id_to_hd_transmission_logs.rb +7 -5
  189. data/db/migrate/20180802103013_add_hd_mdm_missing_indexes.rb +6 -4
  190. data/db/migrate/20180802132417_add_missing_indexes_2.rb +16 -14
  191. data/db/migrate/20180802144507_add_missing_foreign_key_indexes.rb +14 -12
  192. data/db/migrate/20180803131157_add_uuid_to_hd_transmission_logs.rb +7 -1
  193. data/db/migrate/20180814103916_create_index_on_lower_patient_family_name.rb +5 -3
  194. data/db/migrate/20180815144429_update_hd_overall_audit_to_version_8.rb +8 -4
  195. data/db/migrate/20180831134926_create_daily_reports.rb +3 -6
  196. data/db/migrate/20180907100545_add_page_count_to_letters.rb +3 -1
  197. data/db/migrate/20181001162513_add_active_to_hospital_wards.rb +3 -1
  198. data/db/migrate/20181008144324_update_daily_letters_report_view_to_version_2.rb +0 -2
  199. data/db/migrate/20181008145159_create_reporting_daily_ukrdc_view.rb +0 -4
  200. data/db/migrate/20181013115138_update_reporting_daily_pathology_view_to_v2.rb +0 -2
  201. data/db/migrate/20181025170410_add_ukrdc_helper_column_to_patients.rb +0 -2
  202. data/db/migrate/20181026145459_create_ukrdc_batch_numbers.rb +5 -3
  203. data/db/migrate/20181106133500_update_hd_overall_audit_to_version_9.rb +0 -2
  204. data/db/migrate/20181109110616_create_hd_grouped_transmission_logs_view.rb +0 -2
  205. data/db/migrate/20181126090401_add_warnings_to_hd_transmission_logs.rb +7 -0
  206. data/db/migrate/20181126123745_refresh_hd_grouped_transmission_logs_view.rb +8 -0
  207. data/db/migrate/20181217124025_change_ukrdc_transmission_log_error_type.rb +15 -0
  208. data/db/seeds/default/practices/nhs_practices_sample.csv +2 -2
  209. data/db/seeds/default/practices/primary_care_physicians_sample.csv +2 -2
  210. data/lib/core_extensions/active_record/migration_helpers.rb +43 -1
  211. data/lib/renalware/engine.rb +2 -0
  212. data/lib/renalware/version.rb +1 -1
  213. metadata +55 -19
  214. data/lib/migration_helper.rb +0 -11
  215. data/vendor/assets/javascripts/renalware/moment.min.js +0 -1
  216. data/vendor/assets/javascripts/renalware/mousetrap.js +0 -1044
@@ -0,0 +1,20 @@
1
+ table.auto-layout
2
+ thead
3
+ tr
4
+ th.at-least.col-width-medium= sort_link(search,
5
+ :patient,
6
+ ["patient_family_name", "patient_given_name asc"],
7
+ t(".patient_name"))
8
+ th.col-width-nhs-no= t(".nhs_number")
9
+ th.col-width-reference-no= t(".hospital_number")
10
+ th.col-width-date= t(".born_on")
11
+ th.col-width-tiny= t(".age")
12
+ th.col-width-tiny= t(".sex")
13
+ th.col-width-medium= sort_link(search, :modality_desc, t(".modality"))
14
+ th= t(".notes")
15
+ th= t(".tags")
16
+ th.col-width-date-time= sort_link(search, :created_at, t(".bookmarked_on"))
17
+ th.col-width-tiny
18
+
19
+ tbody
20
+ = render partial: "bookmark", collection: bookmarks
@@ -1,2 +1,4 @@
1
1
  = within_admin_layout(title: "Bookmarked Patients") do
2
- #bookmarks= render "renalware/dashboard/bookmarks/table", bookmarks: bookmarks
2
+ #bookmarks
3
+ = render "table", bookmarks: bookmarks, search: search
4
+ = paginate bookmarks
@@ -3,14 +3,7 @@ article
3
3
  h1 Prescriptions
4
4
  .supplemental
5
5
  span= "#{mdm.current_prescriptions.length} of #{mdm.patient.summary.prescriptions_count}"
6
- = link_to t("links.view_all"),
7
- patient_prescriptions_path(mdm.patient),
8
- class: "button secondary"
9
-
10
- = link_to "Toggle",
11
- "#prescriptions",
12
- class: "button secondary",
13
- data: { behaviour: "css-toggler" }
6
+ = render "prescription_buttons", patient: mdm.patient
14
7
 
15
8
  #prescriptions.expandable
16
9
 
@@ -3,12 +3,12 @@
3
3
  require "core_extensions/i18n/handle_blank_value"
4
4
  require "core_extensions/i18n/always_cascade"
5
5
  require "core_extensions/dumb_delegator"
6
- require "core_extensions/active_record/migration_helpers"
7
6
  require "core_extensions/active_record/sort"
8
7
  require "core_extensions/date"
9
8
  require "core_extensions/active_support/duration"
10
9
  require "core_extensions/scenic"
11
10
  require "core_extensions/hash"
11
+ require "core_extensions/active_record/migration_helpers"
12
12
 
13
13
  I18n.extend CoreExtensions::I18n::HandleBlankValue
14
14
  I18n::Backend::Simple.send(:include, I18n::Backend::Cascade)
@@ -36,6 +36,9 @@ Renalware.configure do |config|
36
36
  async: true
37
37
  )
38
38
  ],
39
+ "Renalware::Letters::ResolveDefaultElectronicCCs" => [
40
+ "Renalware::HD::PatientListener"
41
+ ],
39
42
  "Renalware::Pathology::CreateObservationRequests" => []
40
43
  }
41
44
  end
@@ -50,6 +50,7 @@ en:
50
50
  subs_volume: Subs Volume
51
51
  renalware/hd/session_document/complications:
52
52
  access_site_status: Access Site Status
53
+ line_exit_site_status: MR VICTOR (line exit site assessment)
53
54
  was_dressing_changed: Was dressing changed?
54
55
  had_intradialytic_hypotension: Had intradialytic hypotension?
55
56
  had_saline_administration: Had saline administration?
@@ -102,6 +103,12 @@ en:
102
103
  slight_erythema: Slight Erythema
103
104
  erythema: Erythema
104
105
  purulent: Purulent
106
+ line_exit_site_status:
107
+ 0: 0
108
+ 1: 1
109
+ 2: 2
110
+ 3: 3
111
+ 4: 4
105
112
 
106
113
  simple_form:
107
114
  hints:
@@ -8,3 +8,15 @@ en:
8
8
  cancel: Cancel
9
9
  delete:
10
10
  confirm: Are you sure you want to remove this bookmark?
11
+ none: There are no patients bookmarked.
12
+ table:
13
+ patient_name: Name
14
+ nhs_number: NHS Number
15
+ hospital_number: Hosp No
16
+ born_on: DOB
17
+ age: Age
18
+ sex: Sex
19
+ notes: Notes
20
+ tags: Tags
21
+ modality: Modality
22
+ bookmarked_on: Bookmarked
@@ -20,7 +20,7 @@ en:
20
20
  virology: Virology
21
21
  problems: Problems (%{count})
22
22
  modalities: Modalities (%{count})
23
- esrf: ESRF/Comorbidities
23
+ esrf: Renal Profile
24
24
  clinical_profile: Clinical Profile
25
25
  contacts: Contacts (%{count})
26
26
  demographics: Demographics
@@ -1,9 +1,9 @@
1
1
  class CreateVersions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :versions do |t|
4
- t.string :item_type, :null => false
5
- t.integer :item_id, :null => false
6
- t.string :event, :null => false
4
+ t.string :item_type, null: false
5
+ t.integer :item_id, null: false
6
+ t.string :event, null: false
7
7
  t.string :whodunnit
8
8
  t.jsonb :object
9
9
  t.jsonb :object_changes
@@ -1,9 +1,9 @@
1
1
  class CreateProblemVersions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :problem_versions do |t|
4
- t.string :item_type, :null => false
5
- t.integer :item_id, :null => false
6
- t.string :event, :null => false
4
+ t.string :item_type, null: false
5
+ t.integer :item_id, null: false
6
+ t.string :event, null: false
7
7
  t.string :whodunnit
8
8
  t.jsonb :object
9
9
  t.jsonb :object_changes
@@ -1,9 +1,9 @@
1
1
  class CreateMedicationPrescriptionVersions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :medication_prescription_versions do |t|
4
- t.string :item_type, :null => false
5
- t.integer :item_id, :null => false
6
- t.string :event, :null => false
4
+ t.string :item_type, null: false
5
+ t.integer :item_id, null: false
6
+ t.string :event, null: false
7
7
  t.string :whodunnit
8
8
  t.jsonb :object
9
9
  t.jsonb :object_changes
@@ -1,10 +1,12 @@
1
1
  class UsersHaveAndBelongToManyRoles < ActiveRecord::Migration[4.2]
2
+ # rubocop:disable Rails/CreateTableWithTimestamps
2
3
  def change
3
- create_table :roles_users, :id => false do |t|
4
+ create_table :roles_users, id: false do |t|
4
5
  t.references :role, :user
5
6
  end
6
7
 
7
8
  add_foreign_key :roles_users, :users, column: :user_id
8
9
  add_foreign_key :roles_users, :roles, column: :role_id
9
10
  end
11
+ # rubocop:enable Rails/CreateTableWithTimestamps
10
12
  end
@@ -1,9 +1,9 @@
1
1
  class CreateAccessVersions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :access_versions do |t|
4
- t.string :item_type, :null => false
5
- t.integer :item_id, :null => false
6
- t.string :event, :null => false
4
+ t.string :item_type, null: false
5
+ t.integer :item_id, null: false
6
+ t.string :event, null: false
7
7
  t.string :whodunnit
8
8
  t.jsonb :object
9
9
  t.jsonb :object_changes
@@ -1,9 +1,9 @@
1
1
  class CreateHDVersions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :hd_versions do |t|
4
- t.string :item_type, :null => false
5
- t.integer :item_id, :null => false
6
- t.string :event, :null => false
4
+ t.string :item_type, null: false
5
+ t.integer :item_id, null: false
6
+ t.string :event, null: false
7
7
  t.string :whodunnit
8
8
  t.jsonb :object
9
9
  t.jsonb :object_changes
@@ -1,9 +1,9 @@
1
1
  class CreateClinicVersions < ActiveRecord::Migration[5.0]
2
2
  def change
3
3
  create_table :clinic_versions do |t|
4
- t.string :item_type, :null => false
5
- t.integer :item_id, :null => false
6
- t.string :event, :null => false
4
+ t.string :item_type, null: false
5
+ t.integer :item_id, null: false
6
+ t.string :event, null: false
7
7
  t.string :whodunnit
8
8
  t.jsonb :object
9
9
  t.jsonb :object_changes
@@ -1,9 +1,9 @@
1
1
  class CreatePatientVersions < ActiveRecord::Migration[5.0]
2
2
  def change
3
3
  create_table :patient_versions do |t|
4
- t.string :item_type, :null => false
5
- t.integer :item_id, :null => false
6
- t.string :event, :null => false
4
+ t.string :item_type, null: false
5
+ t.integer :item_id, null: false
6
+ t.string :event, null: false
7
7
  t.string :whodunnit
8
8
  t.jsonb :object
9
9
  t.jsonb :object_changes
@@ -1,9 +1,9 @@
1
1
  class CreateClinicalVersions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :clinical_versions do |t|
4
- t.string :item_type, :null => false
5
- t.integer :item_id, :null => false
6
- t.string :event, :null => false
4
+ t.string :item_type, null: false
5
+ t.integer :item_id, null: false
6
+ t.string :event, null: false
7
7
  t.string :whodunnit
8
8
  t.jsonb :object
9
9
  t.jsonb :object_changes
@@ -1,12 +1,14 @@
1
1
  class AddRrColumnsToTransplantRegistrationStatusDescriptions < ActiveRecord::Migration[5.1]
2
2
  def change
3
- add_column :transplant_registration_status_descriptions,
4
- :rr_code,
5
- :integer,
6
- index: true
3
+ within_renalware_schema do
4
+ add_column :transplant_registration_status_descriptions,
5
+ :rr_code,
6
+ :integer,
7
+ index: true
7
8
 
8
- add_column :transplant_registration_status_descriptions,
9
- :rr_comment,
10
- :text
9
+ add_column :transplant_registration_status_descriptions,
10
+ :rr_comment,
11
+ :text
12
+ end
11
13
  end
12
14
  end
@@ -1,17 +1,19 @@
1
1
  class CreateHospitalWards < ActiveRecord::Migration[5.1]
2
2
  def change
3
- create_table :hospital_wards do |t|
4
- t.string :name, null: false
5
- t.references :hospital_unit, index: true, foreign_key: true, null: false
6
- t.datetime :deleted_at
7
- t.timestamps null: false
8
- end
3
+ within_renalware_schema do
4
+ create_table :hospital_wards do |t|
5
+ t.string :name, null: false
6
+ t.references :hospital_unit, index: true, foreign_key: true, null: false
7
+ t.datetime :deleted_at
8
+ t.timestamps null: false
9
+ end
9
10
 
10
- # This create a postgres partial index
11
- # Name must be unique in for any unit, but only amongst un-deleted wards.
12
- add_index :hospital_wards,
13
- [:name, :hospital_unit_id],
14
- unique: true,
15
- where: "deleted_at IS NOT NULL"
11
+ # This create a postgres partial index
12
+ # Name must be unique in for any unit, but only amongst un-deleted wards.
13
+ add_index :hospital_wards,
14
+ [:name, :hospital_unit_id],
15
+ unique: true,
16
+ where: "deleted_at IS NOT NULL"
17
+ end
16
18
  end
17
19
  end
@@ -1,10 +1,12 @@
1
1
  class CreateAKIAlertActions < ActiveRecord::Migration[5.1]
2
2
  def change
3
- create_table :renal_aki_alert_actions do |t|
4
- t.string :name, null: false, index: :unique
5
- t.integer :position, null: false, default: 0
3
+ within_renalware_schema do
4
+ create_table :renal_aki_alert_actions do |t|
5
+ t.string :name, null: false, index: :unique
6
+ t.integer :position, null: false, default: 0
6
7
 
7
- t.timestamps null: false
8
+ t.timestamps null: false
9
+ end
8
10
  end
9
11
  end
10
12
  end
@@ -1,22 +1,24 @@
1
1
  class CreateRenalAKIAlerts < ActiveRecord::Migration[5.1]
2
2
  def change
3
- create_table :renal_aki_alerts do |t|
4
- t.references :patient, null: false, foreign_key: true, index: true
5
- t.references :action,
6
- foreign_key: { to_table: :renal_aki_alert_actions },
7
- index: true,
8
- null: true
9
- t.references :hospital_ward,
10
- foreign_key: { to_table: :hospital_wards },
11
- index: true,
12
- null: true
13
- t.boolean :hotlist, null: false, default: false, index: true
14
- t.string :renal_aki_alerts, :action, :string, index: true
15
- t.text :notes
16
- t.references :updated_by, foreign_key: { to_table: :users }, index: true
17
- t.references :created_by, foreign_key: { to_table: :users }, index: true
3
+ within_renalware_schema do
4
+ create_table :renal_aki_alerts do |t|
5
+ t.references :patient, null: false, foreign_key: true, index: true
6
+ t.references :action,
7
+ foreign_key: { to_table: :renal_aki_alert_actions },
8
+ index: true,
9
+ null: true
10
+ t.references :hospital_ward,
11
+ foreign_key: { to_table: :hospital_wards },
12
+ index: true,
13
+ null: true
14
+ t.boolean :hotlist, null: false, default: false, index: true
15
+ t.string :renal_aki_alerts, :action, :string, index: true
16
+ t.text :notes
17
+ t.references :updated_by, foreign_key: { to_table: :users }, index: true
18
+ t.references :created_by, foreign_key: { to_table: :users }, index: true
18
19
 
19
- t.timestamps null: false
20
+ t.timestamps null: false
21
+ end
20
22
  end
21
23
  end
22
24
  end
@@ -1,13 +1,15 @@
1
1
  class CreateHDDialysates < ActiveRecord::Migration[5.1]
2
2
  def change
3
- create_table :hd_dialysates do |t|
4
- t.string :name, null: false
5
- t.text :description
6
- t.integer :sodium_content, null: false
7
- t.string :sodium_content_uom, null: false
3
+ within_renalware_schema do
4
+ create_table :hd_dialysates do |t|
5
+ t.string :name, null: false
6
+ t.text :description
7
+ t.integer :sodium_content, null: false
8
+ t.string :sodium_content_uom, null: false
8
9
 
9
- t.datetime :deleted_at, index: true
10
- t.timestamps null: false
10
+ t.datetime :deleted_at, index: true
11
+ t.timestamps null: false
12
+ end
11
13
  end
12
14
  end
13
15
  end
@@ -1,9 +1,11 @@
1
1
  class AddDialysateIdToProfileAndSession < ActiveRecord::Migration[5.1]
2
2
  def change
3
- add_reference :hd_profiles, :dialysate, references: :hd_dialysates, index: true
4
- add_foreign_key :hd_profiles, :hd_dialysates, column: :dialysate_id
3
+ within_renalware_schema do
4
+ add_reference :hd_profiles, :dialysate, references: :hd_dialysates, index: true
5
+ add_foreign_key :hd_profiles, :hd_dialysates, column: :dialysate_id
5
6
 
6
- add_reference :hd_sessions, :dialysate, references: :hd_dialysates, index: true
7
- add_foreign_key :hd_sessions, :hd_dialysates, column: :dialysate_id
7
+ add_reference :hd_sessions, :dialysate, references: :hd_dialysates, index: true
8
+ add_foreign_key :hd_sessions, :hd_dialysates, column: :dialysate_id
9
+ end
8
10
  end
9
11
  end
@@ -1,5 +1,7 @@
1
1
  class CreateReportingBoneAudit < ActiveRecord::Migration[5.0]
2
2
  def change
3
- create_view :reporting_bone_audit
3
+ within_renalware_schema do
4
+ create_view :reporting_bone_audit
5
+ end
4
6
  end
5
7
  end
@@ -1,7 +1,9 @@
1
1
  class ReportingAuditChanges < ActiveRecord::Migration[5.1]
2
2
  def change
3
- rename_column :reporting_audits, :materialized_view_name, :view_name
4
- add_column :reporting_audits, :materialized, :boolean, null: false, default: true
5
- change_column_null :reporting_audits, :refresh_schedule, true
3
+ within_renalware_schema do
4
+ rename_column :reporting_audits, :materialized_view_name, :view_name
5
+ add_column :reporting_audits, :materialized, :boolean, null: false, default: true
6
+ change_column_null :reporting_audits, :refresh_schedule, true
7
+ end
6
8
  end
7
9
  end
@@ -1,5 +1,7 @@
1
1
  class CreateMedicationCurrentPrescriptions < ActiveRecord::Migration[5.0]
2
2
  def change
3
- create_view :medication_current_prescriptions
3
+ within_renalware_schema do
4
+ create_view :medication_current_prescriptions
5
+ end
4
6
  end
5
7
  end
@@ -1,5 +1,7 @@
1
1
  class CreateReportingAnaemiaAudit < ActiveRecord::Migration[5.0]
2
2
  def change
3
- create_view :reporting_anaemia_audit
3
+ within_renalware_schema do
4
+ create_view :reporting_anaemia_audit
5
+ end
4
6
  end
5
7
  end