Sha256: 8e337e32ae7f6cb26604c678e052fe21a7284a7e2f419792f73a92654c6f39a6

Contents?: true

Size: 918 Bytes

Versions: 77

Compression:

Stored size: 918 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module Patients
    class SummaryPart < Renalware::SummaryPart
      delegate :worry, to: :patient

      def to_partial_path
        "renalware/patients/summary_part"
      end

      def on_worryboard?
        worry.present?
      end

      def worryboard_notes
        worry&.notes
      end

      def bookmarked?
        bookmark.present?
      end

      def bookmark_notes
        bookmark&.notes
      end

      def bookmark
        return if current_user.blank?

        patients_user.bookmark_for_patient(patient)
      end

      def patients_user
        Patients.cast_user(current_user)
      end

      def bookmark_tags
        return [] if bookmark.blank?
        return [] if bookmark.tags.blank?

        bookmark
          .tags
          .split(",")
          .reject(&:blank?)
          .map(&:strip)
          .uniq
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.1.0 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.167 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.166 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.165 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.164 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.163 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.162 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.161 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.160 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.159 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.158 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.157 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.156 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.155 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.153 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.152 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.151 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.149 app/presenters/renalware/patients/summary_part.rb
renalware-core-2.0.148 app/presenters/renalware/patients/summary_part.rb