Sha256: 895a02bcee1d1ae7bc5f478aa3615ff4be36ff9da7f03b18a2996d455787adb5

Contents?: true

Size: 825 Bytes

Versions: 124

Compression:

Stored size: 825 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/pathology"

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

      def index
        description = find_description
        observations = find_observations_for_description(description)

        render locals: { patient: @patient, observations: observations, description: description }
      end

      private

      def find_description
        ObservationDescription.find(params[:description_id])
      end

      def find_observations_for_description(description)
        @patient.observations
          .page(page)
          .includes(:request)
          .for_description(description)
          .ordered
      end
    end
  end
end

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
renalware-core-2.0.21 app/controllers/renalware/pathology/observations_controller.rb
renalware-core-2.0.20 app/controllers/renalware/pathology/observations_controller.rb
renalware-core-2.0.18 app/controllers/renalware/pathology/observations_controller.rb
renalware-core-2.0.17 app/controllers/renalware/pathology/observations_controller.rb