Class: Renalware::Pathology::Requests::GlobalRule::PrescriptionDrugType

Inherits:
Renalware::Pathology::Requests::GlobalRule show all
Defined in:
app/models/renalware/pathology/requests/global_rule/prescription_drug_type.rb

Constant Summary

Constants inherited from Renalware::Pathology::Requests::GlobalRule

PARAM_COMPARISON_OPERATORS

Instance Method Summary collapse

Instance Method Details

#observation_required_for_patient?(patient, _date) ⇒ Boolean

Returns:

  • (Boolean)


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

def observation_required_for_patient?(patient, _date)
  patient
    .prescriptions.current.joins(drug: :classifications)
    .where("drug_types_drugs.drug_type_id = ?", param_id)
    .count > 0
end

#to_sObject



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

def to_s
  "prescribed drugs include #{drug_type.name}"
end