Method: Renalware::Pathology::Patient#last_request_for_patient_rule

Defined in:
app/models/renalware/pathology/patient.rb

#last_request_for_patient_rule(patient_rule) ⇒ Object



14
15
16
17
18
19
20
21
# File 'app/models/renalware/pathology/patient.rb', line 14

def last_request_for_patient_rule(patient_rule)
  requests
    .includes(:patient_rules)
    .where(
      pathology_requests_patient_rules: { id: [patient_rule] }
    )
    .first
end