Sha256: 3b33ba14bae2890b0786e6ce6b8a0d1aecd83bdbde9b6e8767add937cf97340c
Contents?: true
Size: 900 Bytes
Versions: 139
Compression:
Stored size: 900 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/admissions" require "attr_extras" module Renalware module Admissions class AdmissionQuery pattr_initialize :query def self.call(query) new(query).call end def call search.result end def search @search ||= begin Admission .extending(Scopes) .joins(:patient) # required for PatientsRansackHelper - see Admission .includes( hospital_ward: [:hospital_unit], patient: { current_modality: [:description] } ) .order(created_at: :desc) .ransack(query) end end module Scopes def ransackable_scopes(_auth_object = nil) %i(currently_admitted discharged_but_missing_a_summary identity_match) end end end end end
Version data entries
139 entries across 139 versions & 1 rubygems