Patient medical record updation and deletion fixes (#13891)
This commit is contained in:
parent
55daa9cd24
commit
bd63f0056a
@ -113,9 +113,11 @@ def insert_consultation_to_medical_record(doc):
|
||||
|
||||
def update_consultation_to_medical_record(consultation):
|
||||
medical_record_id = frappe.db.sql("select name from `tabPatient Medical Record` where reference_name=%s", (consultation.name))
|
||||
if(medical_record_id[0][0]):
|
||||
if medical_record_id and medical_record_id[0][0]:
|
||||
subject = set_subject_field(consultation)
|
||||
frappe.db.set_value("Patient Medical Record", medical_record_id[0][0], "subject", subject)
|
||||
else:
|
||||
insert_consultation_to_medical_record(consultation)
|
||||
|
||||
def delete_medical_record(consultation):
|
||||
frappe.db.sql("""delete from `tabPatient Medical Record` where reference_name = %s""", (consultation.name))
|
||||
|
@ -244,7 +244,7 @@ def insert_lab_test_to_medical_record(doc):
|
||||
def delete_lab_test_from_medical_record(self):
|
||||
medical_record_id = frappe.db.sql("select name from `tabPatient Medical Record` where reference_name=%s",(self.name))
|
||||
|
||||
if(medical_record_id[0][0]):
|
||||
if medical_record_id and medical_record_id[0][0]:
|
||||
frappe.delete_doc("Patient Medical Record", medical_record_id[0][0])
|
||||
|
||||
def create_item_line(test_code, sales_invoice):
|
||||
|
@ -27,7 +27,7 @@ def insert_vital_signs_to_medical_record(doc):
|
||||
|
||||
def delete_vital_signs_from_medical_record(doc):
|
||||
medical_record_id = frappe.db.sql("select name from `tabPatient Medical Record` where reference_name=%s",(doc.name))
|
||||
if(medical_record_id[0][0]):
|
||||
if medical_record_id and medical_record_id[0][0]:
|
||||
frappe.delete_doc("Patient Medical Record", medical_record_id[0][0])
|
||||
|
||||
def set_subject_field(doc):
|
||||
|
Loading…
x
Reference in New Issue
Block a user