Sha256: 12b96c15442cb874655eec0f527cd47a982999a3a9fb52fcf0c65e3d7061677d

Contents?: true

Size: 935 Bytes

Versions: 35

Compression:

Stored size: 935 Bytes

Contents

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    class ObservationRequestsController < Pathology::BaseController
      include Renalware::Concerns::Pageable
      before_action :load_patient

      def index
        observation_requests = find_observation_requests

        render locals: { observation_requests: observation_requests, patient: @patient }
      end

      def show
        observation_request = find_observation_request

        render locals: { observation_request: observation_request, patient: @patient }
      end

      private

      def find_observation_requests
        @patient.observation_requests
          .page(page)
          .includes(:description)
          .ordered
      end

      def find_observation_request
        @patient.observation_requests
          .includes(:description, observations: :description)
          .find(params[:id])
      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/observation_requests_controller.rb
renalware-core-2.0.15 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.14 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.13 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.12 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.11 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.9 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.8 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.7 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.5 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.4 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.3 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.2 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.1 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.0 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.0.pre.rc13 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.0.pre.rc11 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.0.pre.rc10 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.0.pre.rc9 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.0.pre.rc8 app/controllers/renalware/pathology/observation_requests_controller.rb