Sha256: 7949f93a0637ecccd4d1d5733c5a99262685fbc4eb174a80c08edf823aaf9c76

Contents?: true

Size: 966 Bytes

Versions: 90

Compression:

Stored size: 966 Bytes

Contents

# frozen_string_literal: true

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

90 entries across 90 versions & 1 rubygems

Version Path
renalware-core-2.0.113 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.112 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.111 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.110 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.109 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.108 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.106 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.105 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.104 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.103 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.102 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.101 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.100 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.99 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.98 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.97 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.96 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.95 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.94 app/controllers/renalware/pathology/observation_requests_controller.rb
renalware-core-2.0.93 app/controllers/renalware/pathology/observation_requests_controller.rb