Class: Renalware::Pathology::Requests::GlobalRule::TransplantDateWithinWeeks
Constant Summary
PARAM_COMPARISON_OPERATORS
Instance Method Summary
collapse
Instance Method Details
#observation_required_for_patient?(patient, date) ⇒ Boolean
12
13
14
15
16
17
18
19
20
|
# File 'app/models/renalware/pathology/requests/global_rule/transplant_date_within_weeks.rb', line 12
def observation_required_for_patient?(patient, date)
most_recent_operation =
Transplants::RecipientOperation.for_patient(patient).most_recent
return false if most_recent_operation.blank?
latest_date_possible = date - param_comparison_value.to_i.weeks
most_recent_operation.performed_on > latest_date_possible
end
|
#to_s ⇒ Object
22
23
24
|
# File 'app/models/renalware/pathology/requests/global_rule/transplant_date_within_weeks.rb', line 22
def to_s
"transplant date within #{@param_comparison_value} weeks ago"
end
|