Sha256: c155862b991eabdf52bc8d5ea0cefd8706dc9127d9da179b416369cb4e116977

Contents?: true

Size: 758 Bytes

Versions: 72

Compression:

Stored size: 758 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

72 entries across 72 versions & 1 rubygems

Version Path
renalware-core-2.0.153 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.152 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.151 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.149 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.148 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.147 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.146 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.145 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.144 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.143 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.142 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.141 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.140 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.139 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.138 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.137 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.136 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.135 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.134 app/helpers/renalware/drugs_helper.rb
renalware-core-2.0.133 app/helpers/renalware/drugs_helper.rb