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