Sha256: 28235afe8ef220cecaa0eb58e9955d7b6ebfa4470336b97fd5c993d8162a7d2a

Contents?: true

Size: 1.47 KB

Versions: 124

Compression:

Stored size: 1.47 KB

Contents

# frozen_string_literal: true

module Renalware
  module LettersHelper
    def letters_breadcrumb(patient)
      breadcrumb_for("Letters", patient_letters_letters_path(patient))
    end

    def patient_letters_letters_path(patient, event = nil)
      if event.present?
        super(patient, event_type: event.class.to_s, event_id: event.id)
      else
        super(patient)
      end
    end

    def inline_value(label, value, unit = nil)
      [
        content_tag(:strong, "#{label}: "),
        value,
        unit
      ].flatten.join(" ").html_safe
    end

    def patient_letters_letter_print_path(letter)
      patient_letters_letter_formatted_path(letter.patient,
                                            letter,
                                            format: "pdf", disposition: "inline")
    end

    def patient_letters_letter_download_path(letter, format = :pdf)
      patient_letters_letter_formatted_path(letter.patient, letter, format: format)
    end

    def patient_letters_letter_preview_path(letter)
      patient_letters_letter_formatted_path(letter.patient, letter)
    end

    def state_options
      Letters::Letter.states.map do |state|
        label = I18n.t(state.to_sym, scope: "enums.letter.state")
        [label, state]
      end
    end

    def state_options_for_receptionists
      Letters::Letter.states.map do |state|
        label = I18n.t(state.to_sym, scope: "enums.letter.for_receptionists.state")
        [label, state]
      end
    end
  end
end

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
renalware-core-2.0.106 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.105 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.104 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.103 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.102 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.101 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.100 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.99 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.98 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.97 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.96 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.95 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.94 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.93 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.92 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.91 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.90 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.89 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.88 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.87 app/helpers/renalware/letters_helper.rb