Sha256: 30b7fbf3afe6c8890657459b83189221ea71d88a1532b8a4ee6399d383f498d6

Contents?: true

Size: 1.02 KB

Versions: 25

Compression:

Stored size: 1.02 KB

Contents

require_dependency "renalware"

# Note we rely on template inheritance with this MDM Base class i.e. subclasses (e.g.
# HD::MDMPatientsController) can override templates and partials (e.g. add a _filters partial
# or override the _patient partial to replace what is displayed in the table).
# Otherwise the default template location is of course app/views/renalware/mdm_patients.
module Renalware
  class MDMPatientsController < BaseController
    include PresenterHelper
    include Renalware::Concerns::Pageable

    def render_index(**args)
      presenter = build_presenter(params: params, **args)
      authorize presenter.patients
      render :index, locals: { presenter: presenter }
    end

    def build_presenter(**args)
      query = args.fetch(:query)

      MDMPatientsPresenter.new(
        patients: query.call.page(page),
        page_title: args.fetch(:page_title),
        view_proc: args.fetch(:view_proc),
        q: query.search,
        patient_presenter_class: args[:patient_presenter_class]
      )
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

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