Class: Renalware::Pathology::Requests::GlobalAlgorithm

Inherits:
Object
  • Object
show all
Defined in:
app/models/renalware/pathology/requests/global_algorithm.rb

Instance Method Summary collapse

Constructor Details

#initialize(patient, clinic, date: Date.current) ⇒ GlobalAlgorithm

Returns a new instance of GlobalAlgorithm.



9
10
11
12
13
# File 'app/models/renalware/pathology/requests/global_algorithm.rb', line 9

def initialize(patient, clinic, date: Date.current)
  @patient = patient
  @clinic = clinic
  @date = date
end

Instance Method Details

#determine_required_request_descriptionsObject



15
16
17
18
19
20
# File 'app/models/renalware/pathology/requests/global_algorithm.rb', line 15

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