Sha256: 66f947bb5f68c331371102d0f1b596402b3c1f866d95c90ead8ad41bf02958c9

Contents?: true

Size: 1.46 KB

Versions: 18

Compression:

Stored size: 1.46 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)
      [
        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

18 entries across 18 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/helpers/renalware/letters_helper.rb
renalware-core-2.1.0 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.167 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.166 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.165 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.164 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.163 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.162 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.161 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.160 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.159 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.158 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.157 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.156 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.155 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.153 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.152 app/helpers/renalware/letters_helper.rb
renalware-core-2.0.151 app/helpers/renalware/letters_helper.rb