Sha256: 7d763ac80126d0eb19952ee04bde9dada71c8ee264924ac0e6e3dcd27c241295

Contents?: true

Size: 670 Bytes

Versions: 51

Compression:

Stored size: 670 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module Transplants
    class LiveDonorsQuery
      include ModalityScopes
      DEFAULT_ORDER = %w(family_name given_name).freeze

      def initialize(q = {})
        @q = q
      end

      def call
        search.result
      end

      def search
        @search ||= begin
          relation.search(q).tap do |search|
            search.sorts = DEFAULT_ORDER
          end
        end
      end

      private

      def relation
        Patient
          .all
          .extending(ModalityScopes)
          .with_current_modality_of_class(DonorModalityDescription)
      end

      attr_reader :q
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
renalware-core-2.0.64 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.63 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.62 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.61 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.60 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.58 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.57 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.56 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.55 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.54 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.53 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.52 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.51 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.50 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.48 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.47 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.46 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.45 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.44 app/models/renalware/transplants/live_donors_query.rb
renalware-core-2.0.43 app/models/renalware/transplants/live_donors_query.rb