Sha256: 28664d12cf35008af38eb5daa59308d1921f7c0db97c57cbfdc12ade57645c08
Contents?: true
Size: 803 Bytes
Versions: 8
Compression:
Stored size: 803 Bytes
Contents
module Renalware module HD class MDMPatientsQuery include ModalityScopes include PatientPathologyScopes MODALITY_NAMES = "HD".freeze DEFAULT_SEARCH_PREDICATE = "hgb_date".freeze attr_reader :q, :relation def initialize(relation: HD::Patient.all, q:) @q = q || {} @q[:s] = DEFAULT_SEARCH_PREDICATE if @q[:s].blank? @relation = relation end def call search.result end def search @search ||= begin relation .includes(:hd_profile) .extending(ModalityScopes) .extending(PatientPathologyScopes) .with_current_pathology .with_current_modality_matching(MODALITY_NAMES) .search(q) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems