Sha256: 573dbf9c178d512047f67175053caca8f96f4d808488d832af1ddb79adcc062e

Contents?: true

Size: 745 Bytes

Versions: 18

Compression:

Stored size: 745 Bytes

Contents

module Renalware
  module Patients
    class MDMPatientsQuery
      include ModalityScopes
      include PatientPathologyScopes
      attr_reader :modality_names, :q, :relation

      # modality_names: eg "HD" or "PD"
      def initialize(relation: Patient.all, q:, modality_names:)
        @modality_names = modality_names
        @q = q
        @relation = relation
      end

      def call
        search.result
      end

      def search
        @search ||= begin
          relation
            .extending(ModalityScopes)
            .extending(PatientPathologyScopes)
            .with_current_pathology
            .with_current_modality_matching(modality_names)
            .search(q)
        end
      end

      # `
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
renalware-core-2.0.8 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.7 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.5 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.4 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.3 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.2 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.1 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc13 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc11 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc5 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc4 app/models/renalware/patients/mdm_patients_query.rb
renalware-core-2.0.0.pre.rc3 app/models/renalware/patients/mdm_patients_query.rb