Sha256: 611f43e1e255e668426495e2baef4b3af112bdd8f598cc94e9748c595fc3c1cd
Contents?: true
Size: 793 Bytes
Versions: 119
Compression:
Stored size: 793 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/clinics" module Renalware module Renal class AKIAlertQuery DEFAULT_SORT = "aki_date desc" attr_reader :query def initialize(query = nil) @query = query || {} @query[:s] = DEFAULT_SORT if @query[:s].blank? end def self.call(query) new(query).call end def call search.result end def search @search ||= begin AKIAlert .joins(:patient) # required for PatientsRansackHelper - see Admission .includes(:patient, :updated_by, :action, hospital_ward: :hospital_unit) .eager_load(patient: [current_modality: :description]) .ransack(query) end end end end end
Version data entries
119 entries across 119 versions & 1 rubygems