renalware-core 2.0.0.pre.beta8 → 2.0.0.pre.beta9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -1
  3. data/app/assets/stylesheets/renalware/lib/_select2-foundation5-overrides.scss +2 -2
  4. data/app/controllers/renalware/directory/people_controller.rb +1 -1
  5. data/app/controllers/renalware/letters/contacts_controller.rb +1 -1
  6. data/app/controllers/renalware/letters/letters_controller.rb +1 -1
  7. data/app/controllers/renalware/patients/patients_controller.rb +3 -5
  8. data/app/controllers/renalware/patients/primary_care_physicians_controller.rb +1 -1
  9. data/app/controllers/renalware/renal/aki_alerts_controller.rb +44 -0
  10. data/app/controllers/renalware/renal/profiles_controller.rb +1 -1
  11. data/app/controllers/renalware/reporting/audits_controller.rb +9 -3
  12. data/app/documents/renalware/patient_document.rb +0 -13
  13. data/app/jobs/hl7_message_example.yml +1 -1
  14. data/app/jobs/renalware/reporting/refresh_audit_data_job.rb +7 -3
  15. data/app/models/renalware/clinical/create_allergy.rb +4 -2
  16. data/app/models/renalware/clinics/create_clinic_visit.rb +6 -2
  17. data/app/models/renalware/hd/session.rb +12 -0
  18. data/app/models/renalware/hospitals/unit.rb +4 -0
  19. data/app/models/renalware/hospitals/ward.rb +22 -0
  20. data/app/models/renalware/modalities/change_patient_modality.rb +4 -2
  21. data/app/models/renalware/patient.rb +1 -0
  22. data/app/models/renalware/patients/language.rb +1 -0
  23. data/app/models/renalware/pd/create_regime.rb +4 -2
  24. data/app/models/renalware/pd/revise_regime.rb +5 -3
  25. data/app/models/renalware/renal/aki_alert.rb +15 -0
  26. data/app/models/renalware/renal/aki_alert_action.rb +10 -0
  27. data/app/models/renalware/reporting/audit.rb +2 -3
  28. data/app/models/renalware/reporting/generate_audit_json.rb +21 -5
  29. data/app/models/renalware/system/country.rb +21 -0
  30. data/app/models/renalware/transplants/create_donor_stage.rb +4 -2
  31. data/app/policies/renalware/base_policy.rb +4 -0
  32. data/app/policies/renalware/renal/aki_alert_policy.rb +9 -0
  33. data/app/presenters/renalware/hd/patient_presenter.rb +5 -0
  34. data/app/presenters/renalware/reporting/audit_presenter.rb +1 -0
  35. data/app/presenters/renalware/transplants/patient_presenter.rb +2 -1
  36. data/app/presenters/renalware/ukrdc/patient_presenter.rb +27 -0
  37. data/app/values/renalware/address.rb +2 -13
  38. data/app/views/renalware/addresses/_form.html.slim +4 -2
  39. data/app/views/renalware/api/ukrdc/patients/_address.xml.builder +2 -2
  40. data/app/views/renalware/api/ukrdc/patients/_diagnoses.xml.builder +5 -2
  41. data/app/views/renalware/api/ukrdc/patients/_encounters.xml.builder +8 -1
  42. data/app/views/renalware/api/ukrdc/patients/_medications.xml.builder +30 -0
  43. data/app/views/renalware/api/ukrdc/patients/_patient.xml.builder +36 -4
  44. data/app/views/renalware/api/ukrdc/patients/_sending_facility.xml.builder +1 -0
  45. data/app/views/renalware/api/ukrdc/patients/diagnoses/_cause_of_death.xml.builder +10 -0
  46. data/app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder +40 -0
  47. data/app/views/renalware/api/ukrdc/patients/show.xml.builder +1 -0
  48. data/app/views/renalware/directory/people/_address_form.html.slim +1 -1
  49. data/app/views/renalware/hd/sessions/_form.html.slim +43 -33
  50. data/app/views/renalware/letters/contacts/_person_form.html.slim +1 -1
  51. data/app/views/renalware/navigation/_renal.html.slim +1 -0
  52. data/app/views/renalware/patients/patients/_form.html.slim +5 -2
  53. data/app/views/renalware/patients/patients/show.html.slim +0 -5
  54. data/app/views/renalware/patients/patients/show/_patient_demographics.html.slim +3 -3
  55. data/app/views/renalware/patients/side_menu/_actions.html.slim +3 -0
  56. data/app/views/renalware/renal/aki_alerts/_filters.html.slim +0 -0
  57. data/app/views/renalware/renal/aki_alerts/edit.html.slim +17 -0
  58. data/app/views/renalware/renal/aki_alerts/index.html.slim +28 -0
  59. data/app/views/renalware/reporting/audits/edit.html.slim +1 -1
  60. data/app/views/renalware/reporting/audits/index.html.slim +11 -7
  61. data/app/views/renalware/reporting/audits/show.html.slim +2 -17
  62. data/app/views/renalware/shared/documents/_blood_pressure_input.html.slim +6 -7
  63. data/config/initializers/inflections.rb +3 -2
  64. data/config/locales/renalware/navigation/renal.en.yml +1 -0
  65. data/config/locales/renalware/renal/aki_alerts.en.yml +5 -0
  66. data/config/locales/renalware/renal/{profile.yml → profile.en.yml} +0 -0
  67. data/config/locales/renalware/reporting/audit.en.yml +1 -1
  68. data/config/routes.rb +1 -0
  69. data/db/migrate/20150312113937_create_drug_types_drugs.rb +2 -2
  70. data/db/migrate/20170925161033_add_code_to_patient_langauges.rb +6 -0
  71. data/db/migrate/20170925182738_add_rr_code_to_medication_routes.rb +5 -0
  72. data/db/migrate/20170926081426_create_countries.rb +14 -0
  73. data/db/migrate/20170926132845_add_country_of_birth_to_patients.rb +6 -0
  74. data/db/migrate/20171002175804_add_rr_columns_to_transplant_registration_status_descriptions.rb +12 -0
  75. data/db/migrate/20171003093347_create_hospital_wards.rb +17 -0
  76. data/db/migrate/20171003111228_create_aki_alert_actions.rb +10 -0
  77. data/db/migrate/20171003122425_create_renal_aki_alerts.rb +22 -0
  78. data/db/migrate/20171005081224_create_reporting_bone_audit.rb +5 -0
  79. data/db/migrate/20171005091202_reporting_audit_changes.rb +7 -0
  80. data/db/migrate/20171005130109_create_medication_current_prescriptions.rb +5 -0
  81. data/db/migrate/20171005144505_create_reporting_anaemia_audit.rb +5 -0
  82. data/db/migrate/20171009104106_add_legacy_patient_id_to_patients.rb +6 -0
  83. data/db/seeds/default/events/{event_types_required.csv → event_types.csv} +0 -0
  84. data/db/seeds/default/events/{event_types_required.rb → event_types.rb} +2 -2
  85. data/db/seeds/default/events/seeds.rb +1 -2
  86. data/db/seeds/default/medications/medication_routes.rb +23 -13
  87. data/db/seeds/default/patients/patients_languages.csv +192 -102
  88. data/db/seeds/default/patients/patients_languages.rb +1 -1
  89. data/db/seeds/default/patients/patients_religions.csv +2 -0
  90. data/db/seeds/default/reporting/audits.rb +4 -3
  91. data/db/seeds/default/reporting/audits.yml +47 -4
  92. data/db/seeds/default/system/countries.csv +250 -0
  93. data/db/seeds/default/system/countries.rb +12 -0
  94. data/db/seeds/default/system/seeds.rb +1 -0
  95. data/db/seeds/default/transplants/transplant_registration_statuses.rb +30 -19
  96. data/db/views/medication_current_prescriptions_v01.sql +28 -0
  97. data/db/views/reporting_anaemia_audit_v01.sql +41 -0
  98. data/db/views/reporting_bone_audit_v01.sql +32 -0
  99. data/lib/renalware/version.rb +1 -1
  100. data/spec/factories/deaths/cause.rb +1 -1
  101. data/spec/factories/drugs/drug.rb +6 -0
  102. data/spec/factories/drugs/drug_types.rb +5 -0
  103. data/spec/factories/hospitals/wards.rb +9 -0
  104. data/spec/factories/modalities/modality_descriptions.rb +10 -8
  105. data/spec/factories/patients/ethnicities.rb +3 -0
  106. data/spec/factories/patients/languages.rb +12 -1
  107. data/spec/factories/renal/aki_alert_actions.rb +5 -0
  108. data/spec/factories/renal/aki_alerts.rb +9 -0
  109. data/spec/factories/reporting/audits.rb +1 -1
  110. data/spec/factories/system/addresses.rb +1 -1
  111. data/spec/factories/system/countries.rb +15 -0
  112. metadata +42 -13
  113. data/app/values/renalware/country.rb +0 -19
  114. data/config/countries.csv +0 -250
  115. data/db/migrate/20170706120643_create_reporting_data_sources.rb +0 -5
  116. data/db/seeds/default/events/event_types_blt.csv +0 -109
  117. data/db/seeds/default/events/event_types_local.rb +0 -10
  118. data/db/views/reporting_data_sources_v01.sql +0 -17
@@ -23,6 +23,7 @@ xml.ukrdc(:PatientRecord, namespace_and_schema) do
23
23
  render "observations", builder: xml, patient: patient
24
24
  render "allergies", builder: xml, patient: patient
25
25
  render "diagnoses", builder: xml, patient: patient
26
+ render "medications", builder: xml, patient: patient
26
27
  render "documents", builder: xml, patient: patient
27
28
  render "encounters", builder: xml, patient: patient
28
29
  render "program_memberships", builder: xml, patient: patient
@@ -11,6 +11,6 @@
11
11
  = fa.input :town, wrapper: :horizontal_small
12
12
  = fa.input :county, wrapper: :horizontal_small
13
13
  = fa.input :postcode, wrapper: :horizontal_small
14
- = fa.input :country, as: :string, wrapper: :horizontal_small
14
+ = fa.association :country, wrapper: :horizontal_small
15
15
  = fa.input :telephone, wrapper: :horizontal_small
16
16
  = fa.input :email, wrapper: :horizontal_small
@@ -13,57 +13,67 @@ ruby:
13
13
  locals: { legend: "Sign-In", name: "signin" } do
14
14
  = f.input :performed_on, as: :date_picker, wrapper: :horizontal_datepicker
15
15
  = f.association :hospital_unit,
16
- as: :grouped_select,
17
- group_method: :hd_sites,
18
- collection: Renalware::Hospitals::Centre.with_hd_sites.ordered,
19
- label_method: :to_s
20
- = f.input :start_time, as: :clock_picker, wrapper: :horizontal_clockpicker
21
- = f.association :signed_on_by, as: :user_picker, collection: Renalware::User.ordered
16
+ as: :grouped_select,
17
+ group_method: :hd_sites,
18
+ collection: Renalware::Hospitals::Centre.with_hd_sites.ordered,
19
+ label_method: :to_s,
20
+ wrapper: :horizontal_medium
21
+ = f.input :start_time,
22
+ as: :clock_picker,
23
+ wrapper: :horizontal_clockpicker
24
+ = f.association :signed_on_by,
25
+ as: :user_picker,
26
+ collection: Renalware::User.ordered,
27
+ wrapper: :horizontal_medium
28
+
22
29
 
23
30
  = render layout: "renalware/shared/fieldset",
24
31
  locals: { legend: "Sign-Off", name: "signoff" } do
25
32
 
26
33
  = f.input :end_time, as: :clock_picker, wrapper: :horizontal_clockpicker
27
- = f.association :signed_off_by, as: :user_picker, collection: Renalware::User.ordered
34
+ = f.association :signed_off_by,
35
+ as: :user_picker,
36
+ collection: Renalware::User.ordered,
37
+ wrapper: :horizontal_medium
28
38
 
29
39
  = render layout: "renalware/shared/fieldset",
30
40
  locals: { legend: "Session Info", name: "info" } do
31
41
 
32
42
  = fd.simple_fields_for :info, fd.object.info do |fcm|
33
- = fcm.input :hd_type, as: :inline_radio_buttons
43
+ = fcm.input :hd_type, as: :inline_radio_buttons, wrapper: :horizontal_medium
34
44
  fieldset
35
45
  legend Access
36
46
  = fcm.input :access_type, as: :select, value_method: :name,
37
47
  collection: Renalware::Accesses::Type.relevant_to_access_profiles,
38
48
  wrapper: :horizontal_small
39
- = fcm.input :access_side, wrapper: :horizontal_tiny
49
+ = fcm.input :access_side, wrapper: :horizontal_small
40
50
  = fcm.input :access_confirmed, as: :boolean, wrapper: :horizontal_medium
41
- = fcm.input :is_access_first_use, as: :inline_radio_buttons
42
- = fcm.input :fistula_plus_line, as: :inline_radio_buttons
43
- = fcm.input :single_needle, as: :inline_radio_buttons
44
- = fcm.input :lines_reversed, as: :inline_radio_buttons
51
+ = fcm.input :is_access_first_use, as: :inline_radio_buttons, wrapper: :horizontal_medium
52
+ = fcm.input :fistula_plus_line, as: :inline_radio_buttons, wrapper: :horizontal_medium
53
+ = fcm.input :single_needle, as: :inline_radio_buttons, wrapper: :horizontal_medium
54
+ = fcm.input :lines_reversed, as: :inline_radio_buttons, wrapper: :horizontal_medium
45
55
  = fcm.input :machine_no, wrapper: :horizontal_tiny
46
56
  = fcm.input :dialysis_fluid_used, wrapper: :horizontal_tiny
47
57
 
48
58
  = render layout: "renalware/shared/fieldset",
49
59
  locals: { legend: "Pre-Dialysis Observations", name: "before" } do
50
60
  = fd.simple_fields_for :observations_before, fd.object.observations_before do |fcm|
51
- = fcm.input :weight_measured, as: :inline_radio_buttons
61
+ = fcm.input :weight_measured, as: :inline_radio_buttons, wrapper: :horizontal_medium
52
62
  = fcm.input :weight, wrapper: :horizontal_tiny
53
63
  = fcm.input :pulse, wrapper: :horizontal_tiny
54
64
  = render_input fcm, :blood_pressure
55
- = fcm.input :temperature_measured, as: :inline_radio_buttons
65
+ = fcm.input :temperature_measured, as: :inline_radio_buttons, wrapper: :horizontal_medium
56
66
  = fcm.input :temperature, wrapper: :horizontal_tiny
57
67
  = fcm.input :bm_stix, wrapper: :horizontal_tiny
58
68
 
59
69
  = render layout: "renalware/shared/fieldset",
60
70
  locals: { legend: "Post-Dialysis Observations", name: "after" } do
61
71
  = fd.simple_fields_for :observations_after, fd.object.observations_after do |fcm|
62
- = fcm.input :weight_measured, as: :inline_radio_buttons
72
+ = fcm.input :weight_measured, as: :inline_radio_buttons, wrapper: :horizontal_medium
63
73
  = fcm.input :weight, wrapper: :horizontal_tiny
64
74
  = fcm.input :pulse, wrapper: :horizontal_tiny
65
75
  = render_input fcm, :blood_pressure
66
- = fcm.input :temperature_measured, as: :inline_radio_buttons
76
+ = fcm.input :temperature_measured, as: :inline_radio_buttons, wrapper: :horizontal_medium
67
77
  = fcm.input :temperature, wrapper: :horizontal_tiny
68
78
  = fcm.input :bm_stix, wrapper: :horizontal_tiny
69
79
 
@@ -83,10 +93,10 @@ ruby:
83
93
  = render layout: "renalware/shared/fieldset",
84
94
  locals: { legend: "HDF", name: "hdf" } do
85
95
  = fd.simple_fields_for :hdf, fd.object.hdf do |fcm|
86
- = fcm.input :subs_fluid_pct, input_html: { class: "small-input" }
87
- = fcm.input :subs_rate, input_html: { class: "small-input" }
88
- = fcm.input :subs_goal, input_html: { class: "small-input" }
89
- = fcm.input :subs_volume, input_html: { class: "small-input" }
96
+ = fcm.input :subs_fluid_pct, wrapper: :horizontal_tiny
97
+ = fcm.input :subs_rate, wrapper: :horizontal_tiny
98
+ = fcm.input :subs_goal, wrapper: :horizontal_tiny
99
+ = fcm.input :subs_volume, wrapper: :horizontal_tiny
90
100
 
91
101
  = render layout: "renalware/shared/fieldset",
92
102
  locals: { legend: "HD Drugs", name: "hd_prescriptions" } do
@@ -104,18 +114,18 @@ ruby:
104
114
  = render layout: "renalware/shared/fieldset",
105
115
  locals: { legend: "Notes/Complications", name: "complications" } do
106
116
  = fd.simple_fields_for :complications, fd.object.complications do |fcm|
107
- = fcm.input :access_site_status, input_html: { class: "small-input" }
108
- = fcm.input :was_dressing_changed, as: :inline_radio_buttons
109
- = fcm.input :had_mrsa_swab, as: :inline_radio_buttons
110
- = fcm.input :had_mssa_swab, as: :inline_radio_buttons
111
- = fcm.input :had_intradialytic_hypotension, as: :inline_radio_buttons
112
- = fcm.input :had_saline_administration, as: :inline_radio_buttons
113
- = fcm.input :had_cramps, as: :inline_radio_buttons
114
- = fcm.input :had_headache, as: :inline_radio_buttons
115
- = fcm.input :had_chest_pain, as: :inline_radio_buttons
116
- = fcm.input :had_alteplase_urokinase, as: :inline_radio_buttons
117
- = fcm.input :had_blood_transfusion, as: :inline_radio_buttons
118
- = f.input :notes, as: :text, input_html: { rows: 5 }
117
+ = fcm.input :access_site_status, wrapper: :horizontal_small
118
+ = fcm.input :was_dressing_changed, as: :inline_radio_buttons, wrapper: :horizontal_small
119
+ = fcm.input :had_mrsa_swab, as: :inline_radio_buttons, wrapper: :horizontal_small
120
+ = fcm.input :had_mssa_swab, as: :inline_radio_buttons, wrapper: :horizontal_small
121
+ = fcm.input :had_intradialytic_hypotension, as: :inline_radio_buttons, wrapper: :horizontal_small
122
+ = fcm.input :had_saline_administration, as: :inline_radio_buttons, wrapper: :horizontal_small
123
+ = fcm.input :had_cramps, as: :inline_radio_buttons, wrapper: :horizontal_small
124
+ = fcm.input :had_headache, as: :inline_radio_buttons, wrapper: :horizontal_small
125
+ = fcm.input :had_chest_pain, as: :inline_radio_buttons, wrapper: :horizontal_small
126
+ = fcm.input :had_alteplase_urokinase, as: :inline_radio_buttons, wrapper: :horizontal_small
127
+ = fcm.input :had_blood_transfusion, as: :inline_radio_buttons, wrapper: :horizontal_small
128
+ = f.input :notes, as: :text, input_html: { rows: 5 }, wrapper: :horizontal_large
119
129
 
120
130
  .row
121
131
  .large-12.columns
@@ -17,7 +17,7 @@
17
17
  = fa.input :town
18
18
  = fa.input :county
19
19
  = fa.input :postcode
20
- = fa.input :country, as: :string
20
+ = fa.association :country
21
21
  = fa.input :telephone
22
22
  = fa.input :email
23
23
 
@@ -10,3 +10,4 @@ li.has-dropdown
10
10
  li= link_to t(".letters"), letters_list_path
11
11
  li= link_to t(".esa_prescriptions"), medications_esa_prescriptions_path
12
12
  li= link_to t(".audits"), reporting_audits_path
13
+ li= link_to t(".aki_alerts"), renal_aki_alerts_path
@@ -26,11 +26,14 @@
26
26
  wrapper: :horizontal_small
27
27
  = f.association :ethnicity,
28
28
  label_method: :name, value_method: :id,
29
- include_blank: "Please select ethnicity",
29
+ include_blank: "Please select",
30
+ wrapper: :horizontal_small
31
+ = f.association :country_of_birth,
32
+ include_blank: "Please select",
30
33
  wrapper: :horizontal_small
31
34
  = f.association :religion,
32
35
  label_method: :name, value_method: :id,
33
- include_blank: "Please select religion",
36
+ include_blank: "Please select",
34
37
  wrapper: :horizontal_small
35
38
  = f.association :language,
36
39
  label_method: :name, value_method: :id,
@@ -22,10 +22,5 @@
22
22
  = render "renalware/patients/patients/show/ukrdc_preferences", patient: patient
23
23
  .columns.medium-6.large-4.xlarge-3
24
24
  = render "renalware/patients/patients/show/contact_details", patient: patient
25
- .columns.medium-6.large-4.xlarge-3
26
- article
27
- header
28
- h2 Current Address
29
- = render patient.current_address if patient.current_address
30
25
  .columns.medium-6.large-4.xlarge-3
31
26
  = render "renalware/patients/patients/show/referral", patient: patient
@@ -28,13 +28,13 @@ article
28
28
  dt Ethnicity:
29
29
  dd= default_for_associated(patient.ethnicity, :name, "Unspecified")
30
30
 
31
+ dt Country of Birth:
32
+ dd= default_for_associated(patient.country_of_birth, :name, "Unspecified")
33
+
31
34
  dl.dl-horizontal
32
35
  dt Sex:
33
36
  dd= patient.sex
34
37
 
35
- dt Ethnicity:
36
- dd= default_for_associated(patient.ethnicity, :name, "Unspecified")
37
-
38
38
  dt Marital Status
39
39
  dd= patient.marital_status
40
40
 
@@ -27,5 +27,8 @@ li.link.action
27
27
  locals: { patient: patient, link_text: t(".create_alert") }
28
28
  = render "renalware/patients/alerts/modal_dialog_placeholder"
29
29
 
30
+ - if policy(patient).debug?
31
+ li.link.action
32
+ = link_to "Debug: UKRDC XML", api_ukrdc_patient_path(patient)
30
33
  = render "renalware/admissions/requests/modal_dialog_placeholder"
31
34
  = render "renalware/messaging/internal/messages/modal_dialog_placeholder"
@@ -0,0 +1,17 @@
1
+ = within_admin_layout(title: "Edit",
2
+ breadcrumbs: breadcrumb_for("AKI Alerts", renal_aki_alerts_path)) do
3
+
4
+ = simple_form_for(alert, wrapper: :horizontal_form) do |f|
5
+ = f.association :action, wrapper: :horizontal_small
6
+ = f.association :hospital_ward,
7
+ as: :grouped_select,
8
+ group_method: :wards,
9
+ collection: Renalware::Hospitals::Unit.includes(:wards).ordered,
10
+ label_method: :to_s,
11
+ wrapper: :horizontal_medium
12
+ = f.input :hotlist, wrapper: :horizontal_small, as: :inline_radio_buttons
13
+ = f.input :notes, wrapper: :horizontal_large, input_html: { rows: 5 }
14
+ = f.submit class: "button"
15
+ span= " or "
16
+ = link_to "cancel", renal_aki_alerts_path
17
+
@@ -0,0 +1,28 @@
1
+ = within_admin_layout(title: "AKI Alerts") do
2
+ table.aki-alerts
3
+ thead
4
+ th
5
+ th Patient
6
+ th.col-width-nhs-no NHS No.
7
+ th.col-width-reference Hosp. No.
8
+ th.col-width-tiny Sex
9
+ th.col-width-tiny Age
10
+ th.col-width-date Born on
11
+ th Action
12
+ th Ward
13
+ th Hotlist
14
+ th Decided by
15
+ tbody
16
+ - alerts.each do |alert|
17
+ tr
18
+ td= link_to("Edit", edit_renal_aki_alert_path(alert))
19
+ td= default_patient_link(alert.patient)
20
+ td= alert.patient.nhs_number
21
+ td= alert.patient.hospital_identifiers
22
+ td= alert.patient.sex
23
+ td= alert.patient.age
24
+ td= alert.patient.born_on
25
+ td= alert.action
26
+ td= alert.hospital_ward
27
+ td= yes_no alert.hotlist?
28
+ td= alert.decided_by
@@ -11,7 +11,7 @@
11
11
  as: :text,
12
12
  wrapper: :horizontal_medium,
13
13
  input_html: { rows: 2 }
14
- = f.input :materialized_view_name,
14
+ = f.input :view_name,
15
15
  collection: available_data_sources,
16
16
  wrapper: :horizontal_medium
17
17
  = f.input :display_configuration,
@@ -5,7 +5,8 @@
5
5
  tr
6
6
  th.col-width-small
7
7
  th.col-width-medium Name
8
- th Materialized view name
8
+ th Postgres view name
9
+ th Materialized
9
10
  th Schedule
10
11
  th.col-width-date-time Updated on
11
12
  th.col-width-date-time Data last refreshed
@@ -18,12 +19,15 @@
18
19
  = pipe_separator
19
20
  = link_to("Edit", edit_reporting_audit_path(audit))
20
21
  td= audit.name
21
- td= audit.materialized_view_name
22
+ td= audit.view_name
23
+ td= yes_no audit.materialized?
22
24
  td= audit.refresh_schedule
23
25
  td= l(audit.updated_at)
24
26
  td= l(audit.refreshed_at)
25
- td= link_to("Refresh Data",
26
- reporting_audit_refreshments_path(audit_id: audit.id),
27
- remote: true,
28
- method: :post,
29
- class: "button compact warning")
27
+ td
28
+ -if audit.materialized?
29
+ = link_to("Refresh Data",
30
+ reporting_audit_refreshments_path(audit_id: audit.id),
31
+ remote: true,
32
+ method: :post,
33
+ class: "button compact warning")
@@ -6,19 +6,6 @@
6
6
  var databaseColumns = eval(#{raw(columns)});
7
7
  var userConfiguredColumns = eval(#{raw(audit.display_configuration)})['columnDefs'];
8
8
 
9
- // You would now have to merge two hashes - one from config into one from db
10
- // becuase we want to
11
- // change the name, wht width, hide
12
-
13
- // if we just use ruby, we can
14
- // build col headers and table
15
- // need some config to add names, widths, hide
16
- // hide can be driven by sql view
17
- // width and name are display logic and need config outside of view.
18
- // could display a table of cols and you tick Hide and enter label to change name and width
19
- // | name | apped name | hide | width |
20
- // | x_y_x| My X Y Z | no | 100 |
21
-
22
9
  $("body").ready(function() {
23
10
  $("body.audits-show table#audit").DataTable(
24
11
  {
@@ -33,9 +20,7 @@
33
20
  - if audit.description.present?
34
21
  .panel.radius.compact= audit.description
35
22
 
36
- /
37
- / jQuery dataTables will build this table; for the columns it will use column definitions in
38
- / audit.display_configuration. Row data comes from a select on the materialized_view
23
+ / jQuery dataTables will build this table; for the columns it will use column definitions in
24
+ / audit.display_configuration. Row data comes from a select on the audit view
39
25
  / specified by the audit row, inserted as a js var into the page above.
40
- /
41
26
  table#audit.display.natural-width
@@ -1,21 +1,20 @@
1
1
  = f.simple_fields_for attribute, f.object.public_send(attribute) do |fd|
2
2
  .blood-pressure class=('with-errors' if fd.object.errors.any?)
3
3
  .row
4
- .small-3.columns
4
+ .small-5.medium-4.large-3.columns
5
5
  = fd.label :age, f.object.class.human_attribute_name(attribute), class: "right inline"
6
- .small-1.columns
6
+ .small-2.medium-1.columns
7
7
  = fd.input :systolic, as: :integer,
8
8
  placeholder: "syst",
9
9
  error: false,
10
10
  label: false, wrapper: "vertical_form"
11
- .small-1.columns
11
+ .small-2.medium-1.columns.end
12
12
  = fd.input :diastolic, as: :integer,
13
13
  placeholder: "dias",
14
14
  error: false,
15
15
  label: false, wrapper: "vertical_form"
16
- .small-7.columns
16
+
17
17
  - if fd.object.errors.any?
18
18
  .row
19
- .small-offset-3.small-9.columns
20
- =fd.error(:systolic)
21
- =fd.error(:diastolic)
19
+ .error.small-offset-5.medium-offset-4.large-offset-3.small-3.columns
20
+ =fd.error(:systolic) || fd.error(:diastolic)
@@ -12,6 +12,7 @@
12
12
 
13
13
  # These inflection rules are supported but not enabled by default:
14
14
  ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ inflect.acronym "AKI"
15
16
  inflect.acronym "APD"
16
17
  inflect.acronym "API"
17
18
  inflect.acronym "CAPD"
@@ -21,6 +22,7 @@ ActiveSupport::Inflector.inflections(:en) do |inflect|
21
22
  inflect.acronym "DNA"
22
23
  inflect.acronym "EDTA"
23
24
  inflect.acronym "ESRF"
25
+ inflect.acronym "GP"
24
26
  inflect.acronym "HD"
25
27
  inflect.acronym "HDF"
26
28
  inflect.acronym "HL7"
@@ -28,8 +30,7 @@ ActiveSupport::Inflector.inflections(:en) do |inflect|
28
30
  inflect.acronym "PD"
29
31
  inflect.acronym "PET"
30
32
  inflect.acronym "PRD"
31
- inflect.acronym "XHR"
32
- inflect.acronym "GP"
33
33
  inflect.acronym "RTF"
34
34
  inflect.acronym "UKRDC"
35
+ inflect.acronym "XHR"
35
36
  end
@@ -12,6 +12,7 @@ en:
12
12
  letters: Letters
13
13
  esa_prescriptions: ESA Patients
14
14
  audits: Audits
15
+ aki_alerts: AKI Alerts
15
16
  mdms:
16
17
  menu_title: MDMs
17
18
  hd: HD
@@ -0,0 +1,5 @@
1
+ en:
2
+ activerecord:
3
+ attributes:
4
+ renalware/renal/aki_alert:
5
+ hotlist: On Hotlist
@@ -6,4 +6,4 @@ en:
6
6
  refresh_schedule: Refresh schedule (cron format)
7
7
  name: Name
8
8
  description: Description
9
- materialized_view_name: Name of materialized view (the data source)
9
+ view_name: Name of materialized view (the data source)
data/config/routes.rb CHANGED
@@ -203,6 +203,7 @@ Renalware::Engine.routes.draw do
203
203
  get :search
204
204
  end
205
205
  end
206
+ resources :aki_alerts, except: [:new, :create, :destroy]
206
207
  end
207
208
 
208
209
  namespace :system do
@@ -1,9 +1,9 @@
1
1
  class CreateDrugTypesDrugs < ActiveRecord::Migration[4.2]
2
2
  def change
3
- create_table :drug_types_drugs, id: false do |t|
3
+ create_table :drug_types_drugs, primary_key: [:drug_id, :drug_type_id] do |t|
4
4
  t.references :drug, foreign_key: true
5
5
  t.references :drug_type, foreign_key: true
6
6
  end
7
- add_index(:drug_types_drugs, [:drug_id, :drug_type_id], unique: true)
7
+ #add_index(:drug_types_drugs, [:drug_id, :drug_type_id], unique: true)
8
8
  end
9
9
  end