Class: Renalware::Pathology::Requests::GlobalRule::LatestCRFOlderThanWeeks
- Inherits:
-
Renalware::Pathology::Requests::GlobalRule
- Object
- ActiveRecord::Base
- ApplicationRecord
- Renalware::Pathology::Requests::GlobalRule
- Renalware::Pathology::Requests::GlobalRule::LatestCRFOlderThanWeeks
- Defined in:
- app/models/renalware/pathology/requests/global_rule/latest_crf_older_than_weeks.rb
Constant Summary
Constants inherited from Renalware::Pathology::Requests::GlobalRule
Instance Method Summary collapse
-
#observation_required_for_patient?(patient, date) ⇒ Boolean
Returns true if the patient has a transplant registration with a latest CRF date older than <param_comparison_value> weeks ago.
- #to_s ⇒ Object
Instance Method Details
#observation_required_for_patient?(patient, date) ⇒ Boolean
Returns true if the patient has a transplant registration with a latest CRF date older than <param_comparison_value> weeks ago.
14 15 16 17 18 19 20 21 22 23 |
# File 'app/models/renalware/pathology/requests/global_rule/latest_crf_older_than_weeks.rb', line 14 def observation_required_for_patient?(patient, date) registration = registration_for(patient) return false unless registration latest_crf_date = registration.document.crf.latest.recorded_on return false if latest_crf_date.blank? max_crf_date = date - param_comparison_value.to_i.weeks latest_crf_date < max_crf_date end |
#to_s ⇒ Object
25 26 27 |
# File 'app/models/renalware/pathology/requests/global_rule/latest_crf_older_than_weeks.rb', line 25 def to_s "latest CRF older than #{param_comparison_value} weeks" end |