Merge pull request #22625 from ruchamahabal/fix-encounter-deletion
fix: attribute error while cancelling patient encounter
diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py
index 56401a3..262fc46 100644
--- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py
+++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py
@@ -73,7 +73,7 @@
insert_encounter_to_medical_record(encounter)
def delete_medical_record(encounter):
- frappe.db.delete_doc_if_exists('Patient Medical Record', 'reference_name', encounter.name)
+ frappe.delete_doc_if_exists('Patient Medical Record', 'reference_name', encounter.name)
def set_subject_field(encounter):
subject = frappe.bold(_('Healthcare Practitioner: ')) + encounter.practitioner + '<br>'