Class: Renalware::Pathology::Requests::HighRiskAlgorithm

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

Instance Method Summary collapse

Constructor Details

#initialize(patient) ⇒ HighRiskAlgorithm

Returns a new instance of HighRiskAlgorithm.



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

def initialize(patient)
  @patient = patient
end

Instance Method Details

#idObject



19
20
21
# File 'app/models/renalware/pathology/requests/high_risk_algorithm.rb', line 19

def id
  nil
end

#patient_is_high_risk?Boolean

Returns:

  • (Boolean)


13
14
15
16
17
# File 'app/models/renalware/pathology/requests/high_risk_algorithm.rb', line 13

def patient_is_high_risk?
  rules
    .map { |rule| rule.observation_required_for_patient?(@patient, Date.current) }
    .any?
end