Sha256: 6db2ecfb8d210518483b665aac20b77d71e3e27feafa0bded2aa6d7b84f2b3aa

Contents?: true

Size: 792 Bytes

Versions: 43

Compression:

Stored size: 792 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/pathology"

module Renalware
  module Pathology
    module Requests
      class GlobalAlgorithm
        def initialize(patient, clinic, date: Date.current)
          @patient = patient
          @clinic = clinic
          @date = date
        end

        def determine_required_request_descriptions
          rule_sets
            .select { |rule_set| rule_set.observation_required_for_patient?(@patient, @date) }
            .map(&:request_description)
            .uniq
        end

        private

        def rule_sets
          GlobalRuleSet
            .for_clinic(@clinic)
            .ordered
            .eager_load(:rules, request_description: :required_observation_description)
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.1.0 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.167 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.166 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.165 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.164 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.163 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.162 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.161 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.160 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.159 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.158 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.157 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.156 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.155 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.153 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.152 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.151 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.149 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.148 app/models/renalware/pathology/requests/global_algorithm.rb