From 76d1474f3e3529b19503fd9ce6b34de110bab885 Mon Sep 17 00:00:00 2001 From: Remo Mueller Date: Tue, 12 Mar 2019 16:08:02 -0400 Subject: [PATCH] Remove medication review prototype, addresses #697. --- app/controllers/subjects_controller.rb | 13 +++---- app/views/medications/show.html.haml | 2 -- app/views/subjects/medication_added.html.haml | 22 ------------ app/views/subjects/medications.html.haml | 31 ---------------- .../subjects/review_medication.html.haml | 28 --------------- ...iew_medication_something_changed.html.haml | 29 --------------- .../review_medication_stop_date.html.haml | 36 ------------------- ...medication_when_did_change_occur.html.haml | 36 ------------------- config/routes.rb | 10 ------ 9 files changed, 4 insertions(+), 203 deletions(-) delete mode 100644 app/views/subjects/medication_added.html.haml delete mode 100644 app/views/subjects/medications.html.haml delete mode 100644 app/views/subjects/review_medication.html.haml delete mode 100644 app/views/subjects/review_medication_something_changed.html.haml delete mode 100644 app/views/subjects/review_medication_stop_date.html.haml delete mode 100644 app/views/subjects/review_medication_when_did_change_occur.html.haml diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 6a1dd9b7e..81efcebc7 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -7,28 +7,23 @@ class SubjectsController < ApplicationController :index, :show, :timeline, :comments, :files, :adverse_events, :ae_adverse_events, :events, :sheets, :event, :report, :search, :choose_site, :autocomplete, :designs_search, :events_search, - :event_coverage, :medications + :event_coverage ] before_action :find_editable_project_or_editable_site_or_redirect, only: [ :new, :edit, :create, :update, :destroy, :choose_date, :data_entry, :send_url, :set_sheet_as_missing, :set_sheet_as_shareable, :new_data_entry, :choose_event, - :launch_subject_event, :edit_event, :update_event, :destroy_event, - :edit_medications, :review_medications, - :review_medication, :review_medication_stop_date, :review_medication_something_changed, - :review_medication_when_did_change_occur, :medication_added + :launch_subject_event, :edit_event, :update_event, :destroy_event ] before_action :find_viewable_subject_or_redirect, only: [ :show, :timeline, :comments, :files, :adverse_events, :ae_adverse_events, - :events, :sheets, :event, :event_coverage, :medications + :events, :sheets, :event, :event_coverage ] before_action :find_editable_subject_or_redirect, only: [ :edit, :update, :destroy, :choose_date, :data_entry, :send_url, :set_sheet_as_missing, :set_sheet_as_shareable, :new_data_entry, :choose_event, :launch_subject_event, :edit_event, :update_event, - :destroy_event, :edit_medications, :review_medications, - :review_medication, :review_medication_stop_date, :review_medication_something_changed, - :review_medication_when_did_change_occur, :medication_added + :destroy_event ] before_action :set_design, only: [ :new_data_entry, :set_sheet_as_missing, :set_sheet_as_shareable diff --git a/app/views/medications/show.html.haml b/app/views/medications/show.html.haml index 3d81bedd5..6ed2242f9 100644 --- a/app/views/medications/show.html.haml +++ b/app/views/medications/show.html.haml @@ -20,5 +20,3 @@ = render "forms/horizontal/show/generic", title: "Start date", content: @medication.fuzzy_pretty(:start_date_fuzzy) = render "forms/horizontal/show/generic", title: "Stop date", content: @medication.fuzzy_pretty(:stop_date_fuzzy) - -= link_to plus_or("MEDICATION CREATED PROTOTYPE"), medication_added_project_subject_path(@project, @subject, number: 1), class: "btn btn-accent btn-shadow" diff --git a/app/views/subjects/medication_added.html.haml b/app/views/subjects/medication_added.html.haml deleted file mode 100644 index a692978b3..000000000 --- a/app/views/subjects/medication_added.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -- @title = "Medication #{params[:number]} - Review Medications" -- @menu_title = "#{@project.name} #{@subject.name} #{@title}" - -- content_for :sidebar, render("subjects/sidebar") - -- content_for :header do - = @title - -- content_for :breadcrumbs do - %ol - %li= link_to @subject.subject_code, [@project, @subject] - %li= link_to "medications", project_subject_medications_path(@project, @subject) - %li.breadcrumb-muted= "added #{params[:number]}" - -.jumbotron.jumbotron-custom-text - %p Medication added! - - %p Albuterol 500mg 1x per day pill - -= link_to "Back to medications", medications_project_subject_path(@project, @subject), class: "btn btn-accent btn-shadow" - -= link_to plus_or("ADD ANOTHER"), new_project_subject_medication_path(@project, @subject), class: "btn btn-accent btn-shadow" diff --git a/app/views/subjects/medications.html.haml b/app/views/subjects/medications.html.haml deleted file mode 100644 index 3bba0d71e..000000000 --- a/app/views/subjects/medications.html.haml +++ /dev/null @@ -1,31 +0,0 @@ -- @title = "Medications" -- @menu_title = "#{@project.name} #{@subject.name} #{@title}" - -- content_for :sidebar, render("subjects/sidebar") - -- content_for :header do - - if @subject.editable_by?(current_user) - .float-right - = link_to plus_or("Add Medication"), new_project_subject_medication_path(@project, @subject), class: "btn btn-accent btn-shadow" - = link_to plus_or("Start Medication Review"), review_medications_project_subject_path(@project, @subject), class: "btn btn-accent btn-shadow #{"disabled" if @subject.medications.blank?}" - =# link_to plus_or("Edit Medications"), edit_medications_project_subject_path(@project, @subject), class: "btn btn-accent btn-shadow" - = @title - -- content_for :breadcrumbs do - = render "layouts/per_page_breadcrumbs", per_page: 20, object_count: -5 # @subject.medications.total_count # TODO: - %ol - %li= link_to @subject.subject_code, [@project, @subject] - %li.breadcrumb-muted medications - -.mb-3.alert.alert-info Display medications as cards - -- if @subject.medications.present? - .dashboard-container - %table - - @subject.medications.each do |medication| - %tr - %td= medication.id -- else - .jumbotron.jumbotron-custom-text - = icon("fas", "file-prescription") - No medications entered for this subject. diff --git a/app/views/subjects/review_medication.html.haml b/app/views/subjects/review_medication.html.haml deleted file mode 100644 index b8ed2e0f2..000000000 --- a/app/views/subjects/review_medication.html.haml +++ /dev/null @@ -1,28 +0,0 @@ -- @title = "Medication #{params[:number]} - Review Medications" -- @menu_title = "#{@project.name} #{@subject.name} #{@title}" - -- content_for :sidebar, render("subjects/sidebar") - -- content_for :header do - = @title - -- content_for :breadcrumbs do - %ol - %li= link_to @subject.subject_code, [@project, @subject] - %li= link_to "medications", project_subject_medications_path(@project, @subject) - %li.breadcrumb-muted review - %li.breadcrumb-muted - medication - = params[:number] - -.jumbotron.jumbotron-custom-text - Is participant still taking... - .display-1 - = "ALBUTEROL" - 500mg 1x per day pill - -= link_to plus_or("YES"), review_medication_project_subject_path(@project, @subject, number: params[:number].to_i + 1), class: "btn btn-accent btn-shadow" - -= link_to plus_or("NO SOMETHING CHANGED"), review_medication_something_changed_project_subject_path(@project, @subject, number: params[:number].to_i), class: "btn btn-accent btn-shadow" - -= link_to plus_or("NO STOPPED COMPLETELY"), review_medication_stop_date_project_subject_path(@project, @subject, number: params[:number].to_i), class: "btn btn-accent btn-shadow" diff --git a/app/views/subjects/review_medication_something_changed.html.haml b/app/views/subjects/review_medication_something_changed.html.haml deleted file mode 100644 index 61bc1f279..000000000 --- a/app/views/subjects/review_medication_something_changed.html.haml +++ /dev/null @@ -1,29 +0,0 @@ -- @title = "Medication Stopped - Medication #{params[:number]} - Review Medications" -- @menu_title = "#{@project.name} #{@subject.name} #{@title}" - -- content_for :sidebar, render("subjects/sidebar") - -- content_for :header do - = @title - -- content_for :breadcrumbs do - %ol - %li= link_to @subject.subject_code, [@project, @subject] - %li= link_to "medications", project_subject_medications_path(@project, @subject) - %li.breadcrumb-muted review - %li.breadcrumb-muted - medication - = params[:number] - -.jumbotron.jumbotron-custom-text - Update Medication Details - -.dashboard-container - = form_with do |form| - = render "forms/horizontal/text_field", form: form, object: @medication, key: :name - = render "forms/horizontal/text_field", form: form, object: @medication, key: :indication - = render "forms/horizontal/text_field", form: form, object: @medication, key: :dose - = render "forms/horizontal/text_field", form: form, object: @medication, key: :units - = render "forms/horizontal/text_field", form: form, object: @medication, key: :frequency - -= link_to plus_or("CONTINUE REVIEW"), review_medication_when_did_change_occur_project_subject_path(@project, @subject, number: params[:number].to_i), class: "btn btn-accent btn-shadow" diff --git a/app/views/subjects/review_medication_stop_date.html.haml b/app/views/subjects/review_medication_stop_date.html.haml deleted file mode 100644 index cf00c92da..000000000 --- a/app/views/subjects/review_medication_stop_date.html.haml +++ /dev/null @@ -1,36 +0,0 @@ -- @title = "Medication Stopped - Medication #{params[:number]} - Review Medications" -- @menu_title = "#{@project.name} #{@subject.name} #{@title}" - -- content_for :sidebar, render("subjects/sidebar") - -- content_for :header do - = @title - -- content_for :breadcrumbs do - %ol - %li= link_to @subject.subject_code, [@project, @subject] - %li= link_to "medications", project_subject_medications_path(@project, @subject) - %li.breadcrumb-muted review - %li.breadcrumb-muted - medication - = params[:number] - -.jumbotron.jumbotron-custom-text - When did participant stop taking - .display-1 - = "ALBUTEROL?" - - = text_field_tag :stop_date_fuzzy_mo_1, "", maxlength: 1, size: 1, placeholder: "M", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}", autofocus: true - = text_field_tag :stop_date_fuzzy_mo_2, "", maxlength: 1, size: 1, placeholder: "M", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - \/ - = text_field_tag :stop_date_fuzzy_dy_1, "", maxlength: 1, size: 1, placeholder: "D", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - = text_field_tag :stop_date_fuzzy_dy_2, "", maxlength: 1, size: 1, placeholder: "D", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - \/ - = text_field_tag :stop_date_fuzzy_yr_1, "", maxlength: 1, size: 1, placeholder: "Y", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - = text_field_tag :stop_date_fuzzy_yr_2, "", maxlength: 1, size: 1, placeholder: "Y", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - = text_field_tag :stop_date_fuzzy_yr_3, "", maxlength: 1, size: 1, placeholder: "Y", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - = text_field_tag :stop_date_fuzzy_yr_4, "", maxlength: 1, size: 1, placeholder: "Y", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - .mt-3{ style: "font-size: 1rem;" } - .small.text-muted Enter 99 for unknown values - -= link_to plus_or("CONTINUE REVIEW"), review_medication_project_subject_path(@project, @subject, number: params[:number].to_i + 1), class: "btn btn-accent btn-shadow" diff --git a/app/views/subjects/review_medication_when_did_change_occur.html.haml b/app/views/subjects/review_medication_when_did_change_occur.html.haml deleted file mode 100644 index 35998b1fe..000000000 --- a/app/views/subjects/review_medication_when_did_change_occur.html.haml +++ /dev/null @@ -1,36 +0,0 @@ -- @title = "Medication Change Occurred - Medication #{params[:number]} - Review Medications" -- @menu_title = "#{@project.name} #{@subject.name} #{@title}" - -- content_for :sidebar, render("subjects/sidebar") - -- content_for :header do - = @title - -- content_for :breadcrumbs do - %ol - %li= link_to @subject.subject_code, [@project, @subject] - %li= link_to "medications", project_subject_medications_path(@project, @subject) - %li.breadcrumb-muted review - %li.breadcrumb-muted - medication - = params[:number] - -.jumbotron.jumbotron-custom-text - When did the change occur? - .display-1 - = "ALBUTEROL?" - - = text_field_tag :stop_date_fuzzy_mo_1, "", maxlength: 1, size: 1, placeholder: "M", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}", autofocus: true - = text_field_tag :stop_date_fuzzy_mo_2, "", maxlength: 1, size: 1, placeholder: "M", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - \/ - = text_field_tag :stop_date_fuzzy_dy_1, "", maxlength: 1, size: 1, placeholder: "D", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - = text_field_tag :stop_date_fuzzy_dy_2, "", maxlength: 1, size: 1, placeholder: "D", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - \/ - = text_field_tag :stop_date_fuzzy_yr_1, "", maxlength: 1, size: 1, placeholder: "Y", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - = text_field_tag :stop_date_fuzzy_yr_2, "", maxlength: 1, size: 1, placeholder: "Y", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - = text_field_tag :stop_date_fuzzy_yr_3, "", maxlength: 1, size: 1, placeholder: "Y", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - = text_field_tag :stop_date_fuzzy_yr_4, "", maxlength: 1, size: 1, placeholder: "Y", class: "text-center", data: { object: "fuzzy-date" }, pattern: "[0-9]{1}" - .mt-3{ style: "font-size: 1rem;" } - .small.text-muted Enter 99 for unknown values - -= link_to plus_or("CONTINUE REVIEW"), review_medication_project_subject_path(@project, @subject, number: params[:number].to_i + 1), class: "btn btn-accent btn-shadow" diff --git a/config/routes.rb b/config/routes.rb index fbd70752c..f619dea36 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -439,16 +439,6 @@ get :files get :adverse_events, path: "adverse-events" get :ae_adverse_events, path: "ae-adverse-events" - - get :medications, path: "meds" - get :review_medications, path: "meds/review" - get :medication_added, path: "meds/:number/added" - get :review_medication, path: "meds/:number" - get :review_medication_stop_date, path: "meds/:number/stop-date" - get :review_medication_something_changed, path: "meds/:number/something-changed" - get :review_medication_when_did_change_occur, path: "meds/:number/when-did-change-occur" - - get :edit_medications, path: "medications/edit" get :sheets get :data_entry, path: "data-entry" get "data-entry/:design_id", action: :new_data_entry, as: :new_data_entry