Sha256: f58592f2dc8205b8f9e707ac2b16142ceeefafbd54f90863d108415bd28582f9

Contents?: true

Size: 539 Bytes

Versions: 9

Compression:

Stored size: 539 Bytes

Contents

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    # Responsible for finding Observations for the specified descriptions.
    #
    class ObservationsForDescriptionsQuery
      def initialize(relation: Observation.all, descriptions: ObservationDescription.all)
        @relation = relation
        @descriptions = descriptions
      end

      def call
        @relation
          .joins(:description)
          .preload(:description)
          .where(description: @descriptions)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta12 app/models/renalware/pathology/observations_for_descriptions_query.rb
renalware-core-2.0.0.pre.beta11 app/models/renalware/pathology/observations_for_descriptions_query.rb
renalware-core-2.0.0.pre.beta10 app/models/renalware/pathology/observations_for_descriptions_query.rb
renalware-core-2.0.0.pre.beta9 app/models/renalware/pathology/observations_for_descriptions_query.rb
renalware-core-2.0.0.pre.beta8 app/models/renalware/pathology/observations_for_descriptions_query.rb
renalware-core-2.0.0.pre.beta7 app/models/renalware/pathology/observations_for_descriptions_query.rb
renalware-core-2.0.0.pre.beta6 app/models/renalware/pathology/observations_for_descriptions_query.rb
renalware-core-2.0.0.pre.beta5 app/models/renalware/pathology/observations_for_descriptions_query.rb
renalware-core-2.0.0.pre.beta4 app/models/renalware/pathology/observations_for_descriptions_query.rb