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.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def nil_stay @nil_stay end |
#nil_step ⇒ Object
Returns the value of attribute nil_step.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def nil_step @nil_step end |
#release_label ⇒ Object
Returns the value of attribute release_label.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def release_label @release_label end |
#release_string ⇒ Object
Returns the value of attribute release_string.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def release_string @release_string end |
#stay_label ⇒ Object
Returns the value of attribute stay_label.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def stay_label @stay_label end |
#stay_string ⇒ Object
Returns the value of attribute stay_string.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def stay_string @stay_string end |
#step_label ⇒ Object
Returns the value of attribute step_label.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def step_label @step_label end |
#step_or_nil_results ⇒ Object
Returns the value of attribute step_or_nil_results.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def step_or_nil_results @step_or_nil_results end |
#step_string ⇒ Object
Returns the value of attribute step_string.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def step_string @step_string end |
#test_summary ⇒ Object
Returns the value of attribute test_summary.
5 6 7 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 5 def test_summary @test_summary end |
Instance Method Details
#edge_week? ⇒ Boolean
24 25 26 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 24 def edge_week? @test_summary[:current_week] == @test_summary[:range_start] end |
#init_summary_styles(test_summary) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 10 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
19 20 21 22 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 19 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
32 33 34 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 32 def study_length_in_weeks Rails.application.config.study_length_in_weeks end |
#view_membership(participant, group) ⇒ Object
28 29 30 |
# File 'app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb', line 28 def view_membership(participant, group) Membership.find_by(participant: participant, group: group) end |