Sha256: e4e93c1d85afd92a044ab8ab322a1d5d76a5d1273331e1ea474faeffd208e82a

Contents?: true

Size: 980 Bytes

Versions: 142

Compression:

Stored size: 980 Bytes

Contents

# frozen_string_literal: true

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

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.1.0 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.167 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.166 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.165 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.164 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.163 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.162 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.161 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.160 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.159 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.158 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.157 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.156 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.155 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.153 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.152 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.151 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.149 app/controllers/renalware/pathology/required_observations_controller.rb
renalware-core-2.0.148 app/controllers/renalware/pathology/required_observations_controller.rb