<% if can? :show, patient %> <%= link_to patient.study_id, think_feel_do_engine.coach_group_patient_dashboard_path(@group, patient) %> <%= current_user.received_messages.sent_from(patient.id).unread.count %> <%= (view_membership(patient, @group).day_in_study / 7.0).ceil %> <% if phq_features? %> <% if (last_phq = patient.phq_assessments.most_recent) %> <%- if last_phq.suicidal? -%>
PHQ-9 WARNING
<%- end -%> <%= last_phq.score %> <%= last_phq.completed? ? "" : "*" %> on <%= last_phq.release_date.to_s(:user_date) %> <% else %> No Completed Assessments <% end %> <% if !view_membership(patient, @group).stepped_on %> <% if patient.phq_assessments.count > 0 %> <% suggestion = patient.stepping_suggestion %> <%= suggestion.suggestion %> <% else %> No Completed Assessments <% end %> <%= render "think_feel_do_engine/coach/patient_dashboards/details", patient: patient if view_membership(patient, @group) %> <% end %> <% end %> <%= patient.sign_in_count %> <%= patient.current_sign_in_at ? patient.current_sign_in_at.to_s(:standard) : "Never Logged In" %> <% if phq_features? %> <% if view_membership(patient, @group) && (patient.most_recent_membership.stepped_on != nil) %> <%= "Stepped " + patient.most_recent_membership.stepped_on.to_s(:user_date) %> <% elsif view_membership(patient, @group) %> <% if can? :update, view_membership(patient, @group) %> <%= form_for([think_feel_do_engine, :coach, @group, view_membership(patient, @group)], html: { method: :put }) do |f| %> <%= f.hidden_field(:stepped_on, value: Date.today) %> <%= f.submit "Step", data: { confirm: "You can't undo this! Please make sure you really want to STEP this participant before confirming. Otherwise click CANCEL." }, class: "btn btn-success" %> <% end %> <% end %> <% elsif patient.most_recent_membership.stepped_on != nil %> <%= patient.most_recent_membership.stepped_on.to_s(:user_date) %> <% end %> <% else %> <% if patient.most_recent_membership.stepped_on != nil %> <%= patient.most_recent_membership.stepped_on.to_s(:user_date) %> <% end %> <% end %> <% if view_membership(patient, @group) %> <%= form_for [think_feel_do_engine, view_membership(patient, @group)] do |f| %> <%= f.hidden_field :end_date %> " readonly="readonly"> <% end %> <% if phq_features? %> <%= button_to "Discontinue", think_feel_do_engine.discontinue_membership_path(view_membership(patient, @group).id), data: { confirm: "Are you sure you would like to end this study? You will not be able to undo this." }, method: :put, class: "btn btn-primary" %> <% end %> <%= button_to "Terminate Access", think_feel_do_engine.withdraw_membership_path(view_membership(patient, @group).id), data: { confirm: "Are you sure you would like to terminate access to this membership? This option should also be used before changing membership of the patient to a different group or to completely revoke access to this membership. You will not be able to undo this." }, method: :put, class: "btn btn-danger" %> <% end %> <% end %>