Sha256: c7b910a70a28f94cd9a77e01b80713bd791a6b01a4321a93a52577275ce8dffb

Contents?: true

Size: 747 Bytes

Versions: 27

Compression:

Stored size: 747 Bytes

Contents

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

27 entries across 27 versions & 1 rubygems

Version Path
renalware-core-2.0.16 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.15 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.14 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.13 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.12 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.11 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.9 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.8 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.7 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.5 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.4 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.3 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.2 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.1 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.0 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.0.pre.rc13 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.0.pre.rc11 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.0.pre.rc10 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.0.pre.rc9 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.0.pre.rc8 app/helpers/renalware/drugs_helper.rb