Sha256: c3d8a93e6a54823710c333cd20fe29665a085fe34c08a657e10d3837eb775fc3

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

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 { |rule_set| rule_set.request_description }
            .uniq
        end

        private

        def rule_sets
          GlobalRuleSet.for_clinic(@clinic).ordered
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta4 app/models/renalware/pathology/requests/global_algorithm.rb