renalware-core 2.0.162 → 2.0.167

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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/renalware/lib/_foundation_and_overrides.scss +1 -1
  3. data/app/assets/stylesheets/renalware/partials/_tables.scss +15 -0
  4. data/app/components/renalware/system/admin_menu_component.html.slim +1 -0
  5. data/app/controllers/renalware/virology/vaccination_types_controller.rb +69 -0
  6. data/app/models/renalware/virology/vaccination_type.rb +25 -3
  7. data/app/policies/renalware/events/advanced_care_plan_policy.rb +1 -1
  8. data/app/policies/renalware/events/clinical_frailty_score_policy.rb +1 -1
  9. data/app/policies/renalware/events/event_policy.rb +4 -0
  10. data/app/policies/renalware/events/investigation_policy.rb +5 -1
  11. data/app/policies/renalware/virology/vaccination_policy.rb +6 -1
  12. data/app/presenters/renalware/virology/dashboard_presenter.rb +1 -1
  13. data/app/views/renalware/clinics/appointments/index.html.slim +1 -2
  14. data/app/views/renalware/directory/people/_person.html.slim +1 -2
  15. data/app/views/renalware/events/events/_event.html.slim +16 -3
  16. data/app/views/renalware/events/events/_form.html.slim +1 -1
  17. data/app/views/renalware/events/events/_table.html.slim +1 -2
  18. data/app/views/renalware/events/events/edit.html.slim +10 -0
  19. data/app/views/renalware/events/events/new.html.slim +4 -4
  20. data/app/views/renalware/events/investigations/edit.html.slim +5 -11
  21. data/app/views/renalware/events/swabs/edit.html.slim +5 -11
  22. data/app/views/renalware/events/swabs/new.html.slim +5 -11
  23. data/app/views/renalware/hd/dialysers/index.html.slim +1 -2
  24. data/app/views/renalware/hd/ongoing_sessions/_session.html.slim +1 -2
  25. data/app/views/renalware/hospitals/units/index.html.slim +1 -2
  26. data/app/views/renalware/pd/infection_organisms/_table.html.slim +1 -2
  27. data/app/views/renalware/problems/notes/_table.html.slim +1 -2
  28. data/app/views/renalware/problems/problems/_current_table.html.slim +1 -2
  29. data/app/views/renalware/research/study_participants/_table.html.slim +2 -2
  30. data/app/views/renalware/transplants/donor_operations/_list.html.slim +1 -2
  31. data/app/views/renalware/transplants/recipient_operations/_list.html.slim +2 -3
  32. data/app/views/renalware/virology/vaccination_types/_form.html.slim +10 -0
  33. data/app/views/renalware/virology/vaccination_types/edit.html.slim +3 -0
  34. data/app/views/renalware/virology/vaccination_types/index.html.slim +42 -0
  35. data/app/views/renalware/virology/vaccination_types/new.html.slim +3 -0
  36. data/app/views/renalware/virology/vaccinations/_alert.html.slim +8 -2
  37. data/config/permissions.yml +1 -0
  38. data/config/routes/events.rb +1 -1
  39. data/config/routes/virology.rb +6 -0
  40. data/db/migrate/20210115181817_create_event_type_alert_triggers.rb +1 -1
  41. data/lib/renalware/version_number.rb +1 -1
  42. metadata +10 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e885a02e30e38f6e267bfd16a39982e2df008d175f8d4c88c885f1fbd8514fc
4
- data.tar.gz: 9ffca3aae6bafa903a4973b07c48496724254321aaa73d336655bcde8c4b6514
3
+ metadata.gz: aa22cd0095f51d9bc225561fa2560b535a6e2c1af7afc9b6c831577b62f8fff9
4
+ data.tar.gz: 32cff2bcf9bd90f1f08f79716c8541601e8ef7ad09f2c35f4daefa14df89a711
5
5
  SHA512:
6
- metadata.gz: aac008a83c72d83fb0c1c6029d1851686075537c58ebad5d74f1ccb2f6da1a413180f45697eb4ed1c635c36b358e7a5e7850c20917992a8eb93fac23bdb20fc9
7
- data.tar.gz: a2cd067bcba52812a65d5f0f63a1a6dac985a1d093331a315e0152fe349bf1eb090eefd81f3018ae660937a62dabfa68aa0d860fdaaa87453d90d66368c46f7d
6
+ metadata.gz: a40adc5547969171c58e7216f2e26ddad7b841a23c2a3e9710353639142b307007fbc6c98886e9c140a656e97a26fcbf39c9ef9091220b32ff1edfc92afd67c9
7
+ data.tar.gz: b05d494e9d5565979f7dbd9e755202cb227c1e895e065f3aa81e2de68070c36d24f79fb7e6e78b41acd84db767c2ad7069f34477c797bad968d10c8bc9348ef6
@@ -454,7 +454,7 @@ $form-spacing: rem-calc(12);
454
454
  // $input-border-radius: $global-radius;
455
455
  // $input-disabled-bg: $gainsboro;
456
456
  // $input-disabled-cursor: $cursor-default-value;
457
- // $input-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
457
+ $input-box-shadow: 0;
458
458
 
459
459
  // We use these to style the fieldset border and spacing.
460
460
  // $fieldset-border-style: solid;
@@ -37,6 +37,15 @@ td.actions {
37
37
  padding-left: 0;
38
38
  white-space: nowrap;
39
39
 
40
+ /* If the action link is just an icon, make it quite subtle so it does not draw attention */
41
+ > a.icon-only {
42
+ color: $link-hover-colour;
43
+
44
+ &:hover {
45
+ color: $link-colour;
46
+ }
47
+ }
48
+
40
49
  > a, > span {
41
50
  &:after {
42
51
  color: $pipe-separator-colour;
@@ -409,6 +418,12 @@ table {
409
418
  }
410
419
  }
411
420
 
421
+ tr.deleted {
422
+ td {
423
+ background-color: lighten($nhs-red, 53);
424
+ }
425
+ }
426
+
412
427
  table.report {
413
428
  table-layout: auto;
414
429
 
@@ -24,6 +24,7 @@ ul.side-nav.side-nav--admin
24
24
  = super_admin_menu_item "Print batches", renalware.letters_batches_path, %r{letters/batches}
25
25
  = super_admin_menu_item "OBX", renalware.pathology_observation_descriptions_path, %r{admin/pathology_observation_descriptions}
26
26
  = super_admin_menu_item "Pathology Code Groups", renalware.pathology_code_groups_path, %r{pathology/code_groups}
27
+ = super_admin_menu_item "Virology Vaccination Types", renalware.virology_vaccination_types_path, %r{virology/vaccination_types}
27
28
  = admin_menu_item "Mailshots", renalware.letters_mailshots_path, %r{letters/mailshots}
28
29
  = super_admin_menu_item "Playground", renalware.admin_playground_path, %r{admin/playground}
29
30
  = developer_menu_item "HL7 Test", renalware.new_feeds_hl7_test_message_path, %r{admin/123}
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_dependency "renalware/virology"
4
+
5
+ module Renalware
6
+ module Virology
7
+ class VaccinationTypesController < BaseController
8
+ def index
9
+ types = VaccinationType.with_deleted.ordered
10
+ authorize types
11
+ render locals: { types: types }
12
+ end
13
+
14
+ def edit
15
+ type = find_and_authorise_type
16
+ render locals: { type: type }
17
+ end
18
+
19
+ def update
20
+ type = find_and_authorise_type
21
+ if type.update(type_params)
22
+ redirect_to virology_vaccination_types_path
23
+ else
24
+ render :edit, locals: { type: type }
25
+ end
26
+ end
27
+
28
+ def new
29
+ type = VaccinationType.new
30
+ authorize type
31
+ render locals: { type: type }
32
+ end
33
+
34
+ def create
35
+ type = VaccinationType.new(type_params)
36
+ authorize type
37
+ if type.save
38
+ redirect_to virology_vaccination_types_path
39
+ else
40
+ render :new, locals: { type: type }
41
+ end
42
+ end
43
+
44
+ def destroy
45
+ find_and_authorise_type.destroy!
46
+ redirect_to virology_vaccination_types_path
47
+ end
48
+
49
+ def sort
50
+ authorize VaccinationType, :sort?
51
+ ids = params[:virology_vaccination_type]
52
+ VaccinationType.sort(ids)
53
+ render json: ids
54
+ end
55
+
56
+ private
57
+
58
+ def find_and_authorise_type
59
+ VaccinationType.find(params[:id]).tap { |type| authorize type }
60
+ end
61
+
62
+ def type_params
63
+ params
64
+ .require("virology_vaccination_type")
65
+ .permit(:name, :code, :position)
66
+ end
67
+ end
68
+ end
69
+ end
@@ -5,12 +5,34 @@ require_dependency "renalware/virology"
5
5
  module Renalware
6
6
  module Virology
7
7
  class VaccinationType < ApplicationRecord
8
- validates :name, presence: true, uniqueness: true
9
- validates :code, presence: true, uniqueness: true
8
+ include Sortable
9
+
10
+ class UniquenessIncludingDeletedValidator < ActiveModel::EachValidator
11
+ def validate_each(record, attribute, value)
12
+ return unless record.send(:"#{attribute}_changed?")
13
+
14
+ if record.class.with_deleted.exists?(attribute => value)
15
+ record.errors.add attribute, (options[:message] || "already used")
16
+ end
17
+ end
18
+ end
19
+ validates :name, presence: true, uniqueness_including_deleted: true
20
+ validates :code, presence: true, uniqueness_including_deleted: true
21
+ before_create :underscore_code
10
22
 
11
23
  acts_as_paranoid
12
24
 
13
- scope :ordered, -> { order(position: :asc, name: :asc) }
25
+ scope :ordered, -> { order(deleted_at: :desc, position: :asc, name: :asc) }
26
+
27
+ def self.policy_class
28
+ BasePolicy
29
+ end
30
+
31
+ def underscore_code
32
+ return if code.blank?
33
+
34
+ self.code = code.downcase.tr(" ", " ").tr(" ", "_")
35
+ end
14
36
  end
15
37
  end
16
38
  end
@@ -4,7 +4,7 @@ require_dependency "renalware/messaging"
4
4
 
5
5
  module Renalware
6
6
  module Events
7
- class AdvancedCarePlanPolicy < BasePolicy
7
+ class AdvancedCarePlanPolicy < EventPolicy
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ require_dependency "renalware/messaging"
4
4
 
5
5
  module Renalware
6
6
  module Events
7
- class ClinicalFrailtyScorePolicy < BasePolicy
7
+ class ClinicalFrailtyScorePolicy < EventPolicy
8
8
  end
9
9
  end
10
10
  end
@@ -10,6 +10,10 @@ module Renalware
10
10
  false
11
11
  end
12
12
  alias update? edit?
13
+
14
+ def destroy?
15
+ false
16
+ end
13
17
  end
14
18
  end
15
19
  end
@@ -4,7 +4,11 @@ require_dependency "renalware/events"
4
4
 
5
5
  module Renalware
6
6
  module Events
7
- class InvestigationPolicy < BasePolicy
7
+ class InvestigationPolicy < EventPolicy
8
+ def edit?
9
+ true
10
+ end
11
+ alias update? edit?
8
12
  end
9
13
  end
10
14
  end
@@ -4,7 +4,12 @@ require_dependency "renalware/virology"
4
4
 
5
5
  module Renalware
6
6
  module Virology
7
- class VaccinationPolicy < BasePolicy
7
+ class VaccinationPolicy < Events::EventPolicy
8
+ def edit?
9
+ user_is_super_admin?
10
+ end
11
+ alias update? edit?
12
+ alias destroy? edit?
8
13
  end
9
14
  end
10
15
  end
@@ -26,7 +26,7 @@ module Renalware
26
26
  end
27
27
 
28
28
  def vaccinations
29
- Vaccination.for_patient(patient)
29
+ Vaccination.for_patient(patient).order(date_time: :desc)
30
30
  end
31
31
  end
32
32
  end
@@ -73,11 +73,10 @@
73
73
  - appointments.each do |appointment|
74
74
  tr
75
75
  td= check_box_tag nil, appointment.patient.id, true, class: "patient_checkbox"
76
- td.nowrap
76
+ td.nowrap.actions
77
77
  = link_to("Toggle",
78
78
  "#appointment-quick-preview-#{appointment.id}",
79
79
  data: { behaviour: "toggler" })
80
- = " | "
81
80
  - if appointment.becomes_visit_id.present?
82
81
  = link_to edit_patient_clinic_visit_path(appointment.patient,
83
82
  id: appointment.becomes_visit_id) do
@@ -1,7 +1,6 @@
1
1
  tr
2
- td
2
+ td.actions
3
3
  = link_to "View", directory_person_path(person)
4
- = pipe_separator
5
4
  = link_to "Edit", edit_directory_person_path(person)
6
5
  td= person.title
7
6
  td= link_to person.family_name, directory_person_path(person)
@@ -1,9 +1,22 @@
1
1
  - row_id = "#{toggle_prefix}-quick-preview-#{event.id}"
2
2
  tr
3
3
  td.noprint= toggler("##{row_id}")
4
- - if local_assigns[:edit_proc]
5
- td.noprint
6
- = link_to("Edit", edit_proc.call(event))
4
+ td.actions
5
+ / If the event supports editing (most don't as they are immuatble once created, to ensure a
6
+ / consistent clinical record), then use the supplied proc if passed (which will render a
7
+ / custom edit link (e.g. the Investigations event subclass, has its own slug, controllwe and
8
+ / and form) otherwise render a standard Event edit link.
9
+ - if policy(event).edit?
10
+ = link_to("Edit", local_assigns[:edit_proc] ? edit_proc.call(event) : edit_patient_event_path(event.patient, event))
11
+
12
+ - if policy(event).destroy?
13
+ - if local_assigns[:destroy_proc]
14
+ = link_to("Delete", destroy_proc.call(event))
15
+ - else
16
+ = link_to(patient_event_path(event.patient, event),
17
+ method: :delete,
18
+ data: { confirm: "Are you sure you want delete this event?\n" }) do
19
+ i.far.fa-trash-alt
7
20
 
8
21
  td.nowrap= l event.created_at.to_date
9
22
  - unless local_assigns[:exclude_type_column] == true
@@ -1,5 +1,5 @@
1
1
  = simple_form_for event,
2
- url: patient_events_path(patient, event),
2
+ url: url,
3
3
  as: :events_event,
4
4
  html: { autocomplete: "off" },
5
5
  wrapper: "horizontal_form" do |f|
@@ -4,8 +4,7 @@ table.has-togglable-rows.events-table
4
4
  thead
5
5
  tr
6
6
  th.noprint.togglers= table_toggler
7
- - if local_assigns[:edit_proc]
8
- th.col-width-tiny
7
+ th.col-width-tiny
9
8
  th.col-width-date=t(".created_at")
10
9
  - unless local_assigns.fetch(:exclude_type_column, false)
11
10
  th.col-width-large= t(".type")
@@ -0,0 +1,10 @@
1
+ = within_patient_layout(\
2
+ title: "Event / Edit",
3
+ breadcrumbs: breadcrumb_for("Events", patient_events_path(patient)) \
4
+ ) do
5
+
6
+ = render "renalware/events/events/form",
7
+ event: event,
8
+ patient: patient,
9
+ event_types: event_types,
10
+ url: patient_event_path(patient, event)
@@ -11,7 +11,7 @@
11
11
  wrapper: "horizontal_form" do |f|
12
12
 
13
13
  = render "form",
14
- event: event,
15
- patient: patient,
16
- event_types: event_types,
17
- f: f
14
+ event: event,
15
+ patient: patient,
16
+ event_types: event_types,
17
+ url: patient_events_path(patient)
@@ -1,13 +1,7 @@
1
1
  = within_patient_layout(title: "Investigations / Edit") do
2
2
 
3
- = simple_form_for event,
4
- url: patient_investigation_path(patient, event),
5
- as: :events_event,
6
- html: { autocomplete: "off" },
7
- wrapper: "horizontal_form" do |f|
8
-
9
- = render "renalware/events/events/form",
10
- event: event,
11
- patient: patient,
12
- event_types: event_types,
13
- f: f
3
+ = render "renalware/events/events/form",
4
+ event: event,
5
+ patient: patient,
6
+ event_types: event_types,
7
+ url: patient_investigation_path(patient, event)
@@ -3,14 +3,8 @@
3
3
  breadcrumbs: breadcrumb_for("Clinical Profile", patient_clinical_profile_path(patient))\
4
4
  ) do
5
5
 
6
- = simple_form_for event,
7
- url: patient_swab_path(patient, event),
8
- as: :events_event,
9
- html: { autocomplete: "off" },
10
- wrapper: "horizontal_form" do |f|
11
-
12
- = render "renalware/events/events/form",
13
- event: event,
14
- patient: patient,
15
- event_types: event_types,
16
- f: f
6
+ = render "renalware/events/events/form",
7
+ event: event,
8
+ patient: patient,
9
+ event_types: event_types,
10
+ url: patient_swab_path(patient, event)
@@ -1,13 +1,7 @@
1
1
  = within_patient_layout(title: "New Swab", breadcrumbs: clinical_profile_breadcrumb(patient)) do
2
2
 
3
- = simple_form_for event,
4
- url: patient_swabs_path(patient, event),
5
- as: :events_event,
6
- html: { autocomplete: "off" },
7
- wrapper: "horizontal_form" do |f|
8
-
9
- = render "renalware/events/events/form",
10
- event: event,
11
- patient: patient,
12
- event_types: event_types,
13
- f: f
3
+ = render "renalware/events/events/form",
4
+ event: event,
5
+ patient: patient,
6
+ event_types: event_types,
7
+ url: patient_swabs_path(patient, event)
@@ -14,9 +14,8 @@
14
14
  tbody
15
15
  - dialysers.each do |dialyser|
16
16
  tr
17
- td
17
+ td.actions
18
18
  = link_to "Edit", edit_hd_dialyser_path(dialyser.id)
19
- = pipe_separator
20
19
  = link_to "Delete",
21
20
  hd_dialyser_path(dialyser.id),
22
21
  method: :delete,
@@ -1,7 +1,6 @@
1
1
  tr
2
- td.noprint
2
+ td.noprint.actions
3
3
  = link_to "Sign-Off", edit_patient_hd_session_path(session.patient, session)
4
- = pipe_separator
5
4
  = link_to "HD Summary".html_safe, patient_hd_dashboard_path(session.patient)
6
5
  td.full-name
7
6
  = link_to session.patient.to_s, patient_clinical_summary_path(session.patient)
@@ -19,10 +19,9 @@
19
19
  tbody
20
20
  - hospital_units.each do |unit|
21
21
  tr
22
- td
22
+ td.actions
23
23
  - if policy(unit).edit?
24
24
  = link_to "Edit", edit_hospitals_unit_path(unit.id)
25
- = pipe_separator
26
25
  - if policy(unit).destroy?
27
26
  = link_to "Delete",
28
27
  hospitals_unit_path(unit.id),
@@ -8,9 +8,8 @@ table
8
8
  tbody
9
9
  - infection_organisms.each do |infection_organism|
10
10
  tr
11
- td
11
+ td.noprint.actions
12
12
  = link_to "Edit", edit_pd_infection_organism_path(infection_organism), remote: true
13
- = pipe_separator
14
13
  = link_to "Terminate", pd_infection_organism_path(infection_organism),
15
14
  method: :delete, remote: true, data: { confirm: "Are you sure?" }
16
15
  td= infection_organism
@@ -15,13 +15,12 @@
15
15
  - notes.each do |note|
16
16
  tr
17
17
  - unless problem.archived?
18
- td
18
+ td.actions
19
19
  - if policy(note).edit?
20
20
  = link_to "Edit",
21
21
  edit_patient_problem_note_path(problem.patient, problem, note),
22
22
  remote: true
23
23
  - if policy(note).destroy?
24
- = pipe_separator
25
24
  = link_to "Delete",
26
25
  patient_problem_note_path(problem.patient, problem, note),
27
26
  method: :delete,
@@ -9,9 +9,8 @@ table#current_problems.manual-stripes.auto-layout
9
9
  = content_tag(:tbody, class: "sortables", data: { rel: sort_patient_problems_path(@patient) }) do
10
10
  - problems.each do |problem|
11
11
  = content_tag_for(:tr, problem, class: "sortable") do
12
- td
12
+ td.actions
13
13
  = link_to "Edit", patient_problem_path(@patient, problem)
14
- = pipe_separator
15
14
  = link_to "Archive",
16
15
  patient_problem_path(@patient, problem),
17
16
  method: :delete,
@@ -22,13 +22,13 @@
22
22
  td= participant.patient.age
23
23
  td= participant.patient.sex
24
24
  td= participant.external_id
25
- td
25
+ td.actions
26
26
  = link_to "Delete",
27
27
  research_study_participant_path(study, participant),
28
28
  method: :delete,
29
29
  data: { confirm: "Are you sure?" }
30
- = " | "
31
30
  = link_to("Edit",
32
31
  edit_research_study_participant_path(study, participant),
33
32
  data: { "reveal-id" => "study-participant-modal", "reveal-ajax" => "true" })
33
+
34
34
  = paginate participants
@@ -20,10 +20,9 @@ article.status-history
20
20
  td= operation.nephrectomy_type.try(:text)
21
21
  - if operation.followup
22
22
  td= l operation.followup.last_seen_on
23
- td
23
+ td.actions.text-left
24
24
  = link_to "View",
25
25
  patient_transplants_donor_operation_followup_path(patient, operation)
26
- = pipe_separator
27
26
  = link_to "Update",
28
27
  edit_patient_transplants_donor_operation_followup_path(patient, operation)
29
28
  - else
@@ -38,15 +38,14 @@ article.recipient-operations
38
38
  - if operation.followup
39
39
  td= l operation.followup.transplant_failed_on
40
40
  td= operation.followup.transplant_failure_cause_description
41
- td
41
+ td.actions.text-left
42
42
  = link_to "View",
43
43
  patient_transplants_recipient_operation_followup_path(patient, operation)
44
- = pipe_separator
45
44
  = link_to "Update",
46
45
  edit_patient_transplants_recipient_operation_followup_path(patient, operation)
47
46
  - else
48
47
  td
49
48
  td
50
- td
49
+ td.actions.text-left
51
50
  - url = new_patient_transplants_recipient_operation_followup_path(patient, operation)
52
51
  = link_to "Enter details", url
@@ -0,0 +1,10 @@
1
+ = simple_form_for type do |f|
2
+ = f.input :name
3
+ - if type.new_record?
4
+ = f.input :code, hint: "Will be converted to lower case with underscores"
5
+ - else
6
+ p.px-0.mb-5
7
+ ' Code:
8
+ code= type.code
9
+
10
+ = f.submit class: :button
@@ -0,0 +1,3 @@
1
+ = within_new_admin_layout(title: "Edit",
2
+ breadcrumbs: breadcrumb_for("Virology Vaccination Types", virology_vaccination_types_path)) do
3
+ = render "form", type: type
@@ -0,0 +1,42 @@
1
+ = content_for(:actions) do
2
+ = link_to t("new_record.link_title"),
3
+ new_virology_vaccination_type_path,
4
+ class: "button"
5
+
6
+ = within_new_admin_layout(title: "Virology Vaccination Types") do
7
+ .rounded-md.bg-blue-100.px-3.py-2.flex.items-start.shadow.mb-5
8
+ i.fas.fa-info-circle.mr-2.mt-1.text-blue-500
9
+ ' Deleting a type sets the 'deleted at' date, preventing the type from
10
+ ' being used prospectively.
11
+ br
12
+ ' The type's code cannot be edited once set, just in case it has already been used.
13
+ br
14
+ ' Drag and drop the icon to change the sort order.
15
+
16
+ table.vaccination_types
17
+ thead
18
+ tr
19
+ th.actions.col-width-small
20
+ th Name
21
+ th Code
22
+ th.text-center Sort order
23
+ th.col-width-date-time Created at
24
+ th.col-width-date-time Deleted at
25
+ tbody.sortables(data-rel=sort_virology_vaccination_types_path)
26
+ - types.each do |type|
27
+ = content_tag_for(:tr, type, class: "sortable #{type.deleted? ? 'deleted' : ''}") do
28
+ td.actions
29
+ - unless type.deleted?
30
+ =link_to "Edit", edit_virology_vaccination_type_path(type)
31
+ =link_to "Delete",
32
+ virology_vaccination_type_path(type),
33
+ method: :delete,
34
+ data: { confirm: "Are you sure you want to delete this type? Doing so will prevent it from being used prospectively."}
35
+
36
+ td= type.name
37
+ td= type.code
38
+ td.handle
39
+ - unless type.deleted?
40
+ i.fas.fa-bars
41
+ td= l(type.created_at)
42
+ td= l(type.deleted_at)
@@ -0,0 +1,3 @@
1
+ = within_new_admin_layout(title: "New",
2
+ breadcrumbs: breadcrumb_for("Virology Vaccination Types", virology_vaccination_types_path)) do
3
+ = render "form", type: type
@@ -1,5 +1,11 @@
1
+ ruby:
2
+ # Its possible the vaccination type has been soft-deleted so we need to use the
3
+ # #with_deleted scope. Its also possible the vaccination type row was hard deleted, so be
4
+ # sure to revert to just displaying the code from the document if this is the case.
5
+ code = event.document&.type
6
+ type = Renalware::Virology::VaccinationType.with_deleted.find_by(code: code)
7
+ title = type&.name || code&.titleize
1
8
  li.patient-alert.vaccination
2
9
  i.fas.fa-syringe
3
- - title = Renalware::Virology::VaccinationType.find_by(code: event.document&.type)&.name
4
- span.title= link_to title, patient_virology_dashboard_path
10
+ span.title= link_to title, renalware.patient_virology_dashboard_path(event.patient)
5
11
  span.date= l(event.date_time.to_date)
@@ -8,6 +8,7 @@ super_admin:
8
8
  - Renalware::HD::CannulationType
9
9
  - Renalware::System::Download
10
10
  - Renalware::Pathology::ObservationDescription
11
+ - Renalware::Virology::VaccinationType
11
12
  admin:
12
13
  - Renalware::User
13
14
  - Renalware::BagType
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  resources :patients, only: [] do
4
- resources :events, only: [:new, :create, :index], controller: "events/events"
4
+ resources :events, except: :show, controller: "events/events"
5
5
  constraints(format: /(pdf)/) do
6
6
  resources :events, only: :show, controller: "events/events"
7
7
  end
@@ -10,3 +10,9 @@ resources :patients, only: [] do
10
10
  defaults: { slug: :vaccinations }
11
11
  end
12
12
  end
13
+
14
+ namespace :virology do
15
+ resources :vaccination_types do
16
+ post :sort, on: :collection
17
+ end
18
+ end
@@ -1,4 +1,4 @@
1
- class CreateEventTypeAlertTriggers < ActiveRecord::Migration[6.0]
1
+ class CreateEventTypeAlertTriggers < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  within_renalware_schema do
4
4
  create_table(
@@ -5,6 +5,6 @@ module Renalware
5
5
  # to creat that class even though its not used. If we don't do this zeitwerk
6
6
  # complains that version.rb does export a constant called Version.
7
7
  class VersionNumber
8
- VERSION = "2.0.162"
8
+ VERSION = "2.0.167"
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renalware-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.162
4
+ version: 2.0.167
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airslie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-18 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-import
@@ -742,14 +742,14 @@ dependencies:
742
742
  requirements:
743
743
  - - "~>"
744
744
  - !ruby/object:Gem::Version
745
- version: 2.3.0
745
+ version: 2.4.0
746
746
  type: :runtime
747
747
  prerelease: false
748
748
  version_requirements: !ruby/object:Gem::Requirement
749
749
  requirements:
750
750
  - - "~>"
751
751
  - !ruby/object:Gem::Version
752
- version: 2.3.0
752
+ version: 2.4.0
753
753
  - !ruby/object:Gem::Dependency
754
754
  name: record_tag_helper
755
755
  requirement: !ruby/object:Gem::Requirement
@@ -792,20 +792,6 @@ dependencies:
792
792
  - - "~>"
793
793
  - !ruby/object:Gem::Version
794
794
  version: 1.2.0
795
- - !ruby/object:Gem::Dependency
796
- name: rubyzip
797
- requirement: !ruby/object:Gem::Requirement
798
- requirements:
799
- - - "~>"
800
- - !ruby/object:Gem::Version
801
- version: 1.3.0
802
- type: :runtime
803
- prerelease: false
804
- version_requirements: !ruby/object:Gem::Requirement
805
- requirements:
806
- - - "~>"
807
- - !ruby/object:Gem::Version
808
- version: 1.3.0
809
795
  - !ruby/object:Gem::Dependency
810
796
  name: sassc-rails
811
797
  requirement: !ruby/object:Gem::Requirement
@@ -1455,6 +1441,7 @@ files:
1455
1441
  - app/controllers/renalware/virology/base_controller.rb
1456
1442
  - app/controllers/renalware/virology/dashboards_controller.rb
1457
1443
  - app/controllers/renalware/virology/profiles_controller.rb
1444
+ - app/controllers/renalware/virology/vaccination_types_controller.rb
1458
1445
  - app/controllers/renalware/virology/vaccinations_controller.rb
1459
1446
  - app/documents/document/attribute_initializer.rb
1460
1447
  - app/documents/document/attribute_initializer/active_model.rb
@@ -2587,6 +2574,7 @@ files:
2587
2574
  - app/views/renalware/events/events/cell/_investigation.html.slim
2588
2575
  - app/views/renalware/events/events/cell/_simple.html.slim
2589
2576
  - app/views/renalware/events/events/cell/_swab.html.slim
2577
+ - app/views/renalware/events/events/edit.html.slim
2590
2578
  - app/views/renalware/events/events/index.html.slim
2591
2579
  - app/views/renalware/events/events/inputs/_biopsy.html.slim
2592
2580
  - app/views/renalware/events/events/inputs/_investigation.html.slim
@@ -3330,6 +3318,10 @@ files:
3330
3318
  - app/views/renalware/virology/dashboards/show.html.slim
3331
3319
  - app/views/renalware/virology/profiles/_summary.html.slim
3332
3320
  - app/views/renalware/virology/profiles/edit.html.slim
3321
+ - app/views/renalware/virology/vaccination_types/_form.html.slim
3322
+ - app/views/renalware/virology/vaccination_types/edit.html.slim
3323
+ - app/views/renalware/virology/vaccination_types/index.html.slim
3324
+ - app/views/renalware/virology/vaccination_types/new.html.slim
3333
3325
  - app/views/renalware/virology/vaccinations/_alert.html.slim
3334
3326
  - app/views/renalware/virology/vaccinations/_cell.html.slim
3335
3327
  - app/views/renalware/virology/vaccinations/_inputs.html.slim