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.0.147 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.146 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.145 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.144 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.143 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.142 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.141 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.140 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.139 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.138 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.137 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.136 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.135 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.134 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.133 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.132 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.131 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.130 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.129 app/models/renalware/pathology/requests/global_algorithm.rb
renalware-core-2.0.128 app/models/renalware/pathology/requests/global_algorithm.rb