Sha256: 84391e40885837000d91fdcf82741a196c8541a9da272034f93fdf15fbed024f

Contents?: true

Size: 778 Bytes

Versions: 26

Compression:

Stored size: 778 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module DrugsHelper
    def drug_select_options
      options_for_select Drugs::Type.all
                                    .reject{ |r| r.name == "Peritonitis" }
                                    .map { |dt| [dt.name, dt.name.downcase] }
    end

    def drug_types_colour_tag(drug_types)
      drug_names = drug_types.map(&:name)
      return "esa" if drug_names.include?("ESA")
      return "immunosuppressant" if drug_names.include?("Immunosuppressant")
      "other"
    end

    def drug_types_tag(drug_type)
      if drug_type.map(&:name).include?("ESA")
        "ESA"
      elsif drug_type.map(&:name).include?("Immunosuppressant")
        "Immunosuppressant"
      else
        "Standard"
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
renalware-core-2.0.44 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.43 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.42 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.41 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.40 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.39 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.38 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.37 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.36 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.35 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.34 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.33 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.32 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.31 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.30 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.28 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.27 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.26 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.25 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.24 app/helpers/renalware/drugs_helper.rb