Sha256: c8c4035111c3061e33a7cee49560af62a768bb293fdef126d961600167035d27

Contents?: true

Size: 754 Bytes

Versions: 114

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module HospitalsHelper
    def ward_dropdown_grouped_by_hospital_unit(form, attribute, **options)
      form.input(
        attribute.to_sym,
        as: :grouped_select,
        group_method: :wards,
        collection: Renalware::Hospitals::WardPresenter.units_with_wards,
        label_method: lambda { |ward|
          Renalware::Hospitals::WardPresenter.new(ward).title_including_unit
        },
        wrapper: :horizontal_medium,
        input_html: { class: "searchable_select" },
        **options
      )
    end

    def ward_title(ward)
      ward_label = ward.name.blank? ? ward.code : "#{ward.name} (#{ward.code})"
      "#{ward.hospital_unit.unit_code} / #{ward_label}"
    end
  end
end

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
renalware-core-2.0.147 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.146 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.145 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.144 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.143 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.142 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.141 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.140 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.139 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.138 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.137 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.136 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.135 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.134 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.133 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.132 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.131 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.130 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.129 app/helpers/renalware/hospitals_helper.rb
renalware-core-2.0.128 app/helpers/renalware/hospitals_helper.rb