Module: ThinkFeelDoEngine::Coach::DashboardAndPhqTableHelper
- Defined in:
- app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb
Overview
Provides helpers for patient dashboard index and phq9 table
Instance Attribute Summary collapse
-
#nil_stay ⇒ Object
Returns the value of attribute nil_stay.
-
#nil_step ⇒ Object
Returns the value of attribute nil_step.
-
#release_label ⇒ Object
Returns the value of attribute release_label.
-
#release_string ⇒ Object
Returns the value of attribute release_string.
-
#stay_label ⇒ Object
Returns the value of attribute stay_label.
-
#stay_string ⇒ Object
Returns the value of attribute stay_string.
-
#step_label ⇒ Object
Returns the value of attribute step_label.
-
#step_or_nil_results ⇒ Object
Returns the value of attribute step_or_nil_results.
-
#step_string ⇒ Object
Returns the value of attribute step_string.
-
#test_summary ⇒ Object
Returns the value of attribute test_summary.
Instance Method Summary collapse
- #edge_week? ⇒ Boolean
- #init_summary_styles(test_summary) ⇒ Object
- #result_span(text, label) ⇒ Object
- #study_length_in_weeks ⇒ Object
- #view_membership(participant, group) ⇒ Object
Instance Attribute Details
#nil_stay ⇒ Object
Returns the value of attribute nil_stay.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def nil_stay @nil_stay end |
#nil_step ⇒ Object
Returns the value of attribute nil_step.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def nil_step @nil_step end |
#release_label ⇒ Object
Returns the value of attribute release_label.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def release_label @release_label end |
#release_string ⇒ Object
Returns the value of attribute release_string.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def release_string @release_string end |
#stay_label ⇒ Object
Returns the value of attribute stay_label.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def stay_label @stay_label end |
#stay_string ⇒ Object
Returns the value of attribute stay_string.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def stay_string @stay_string end |
#step_label ⇒ Object
Returns the value of attribute step_label.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def step_label @step_label end |
#step_or_nil_results ⇒ Object
Returns the value of attribute step_or_nil_results.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def step_or_nil_results @step_or_nil_results end |
#step_string ⇒ Object
Returns the value of attribute step_string.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def step_string @step_string end |
#test_summary ⇒ Object
Returns the value of attribute test_summary.
6 7 8 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 6 def test_summary @test_summary end |
Instance Method Details
#edge_week? ⇒ Boolean
25 26 27 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 25 def edge_week? @test_summary[:current_week] == @test_summary[:range_start] end |
#init_summary_styles(test_summary) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 11 def init_summary_styles(test_summary) @nil_step = test_summary[:step?].nil? @nil_stay = test_summary[:stay?].nil? @step_or_nil_results = @nil_step || test_summary[:step?] define_strings(test_summary) define_labels(test_summary) @test_summary = test_summary end |
#result_span(text, label) ⇒ Object
20 21 22 23 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 20 def result_span(text, label) content_tag(:span, text.to_s, class: "label label-" + label.to_s).html_safe end |
#study_length_in_weeks ⇒ Object
33 34 35 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 33 def study_length_in_weeks Rails.application.config.study_length_in_weeks end |
#view_membership(participant, group) ⇒ Object
29 30 31 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 29 def view_membership(participant, group) Membership.find_by(participant: participant, group: group) end |