Sha256: 1ad0793388a0b5394c14b39914ec0897106bc9331761fb6aad7db67ddb290ed8

Contents?: true

Size: 949 Bytes

Versions: 35

Compression:

Stored size: 949 Bytes

Contents

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    class RequiredObservationsController < Pathology::BaseController
      before_action :load_patient

      def index
        request_params = Requests::RequestParamsFactory.new(raw_request_params).build
        request = Requests::RequestFactory.new(@patient, request_params).build

        render :index, locals: {
          request_html_form_params: build_params_for_html_form,
          request: request,
          all_clinics: all_clinics
        }
      end

      private

      def build_params_for_html_form
        OpenStruct.new(
          patient_ids: [@patient.id],
          clinic_id: raw_request_params[:clinic_id]
        )
      end

      def raw_request_params
        params
          .fetch(:request, {})
          .permit(:clinic_id)
      end

      def all_clinics
        Renalware::Pathology::Clinic.for_algorithm
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

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