Module: ThinkFeelDoEngine::Coach::MoodsAndPhqVizHelper
- Defined in:
- app/helpers/think_feel_do_engine/coach/moods_and_phq_viz_helper.rb
Overview
Provides helpers for transforming patient data for the viz
Instance Method Summary collapse
Instance Method Details
#emotional_ratings(participant) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'app/helpers/think_feel_do_engine/coach/moods_and_phq_viz_helper.rb', line 6 def (participant) = {} participant..order(:created_at).each do || [.name.to_sym] = [.name.to_sym] || [] [.name.to_sym] << [.created_at.to_i, .] end .keys.map { |key| [key.to_sym, [key.to_sym]] } end |
#mood_ratings(participant) ⇒ Object
15 16 17 18 19 |
# File 'app/helpers/think_feel_do_engine/coach/moods_and_phq_viz_helper.rb', line 15 def (participant) participant.moods.order(:created_at).map do |mood| [mood.created_at.to_i, mood.] end end |