Sha256: 529fda0399b37fd6e00e11beb3bf54397131025bdf5ee3200d921b8fe1e278a5

Contents?: true

Size: 757 Bytes

Versions: 27

Compression:

Stored size: 757 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module DrugsHelper
    def drug_select_options
      options_for_select(
        Drugs::Type
          .all
          .reject{ |dt| dt.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.77 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.76 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.75 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.74 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.73 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.72 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.71 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.70 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.69 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.68 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.67 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.64 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.63 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.62 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.61 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.60 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.58 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.57 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.56 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.55 app/helpers/renalware/drugs_helper.rb