def after_insert(self): if self.prescription: frappe.db.set_value('Procedure Prescription', self.prescription, 'procedure_created', 1) if self.appointment: frappe.db.set_value('Patient Appointment', self.appointment, 'status', 'Closed') template = frappe.get_doc('Clinical Procedure Template', self.procedure_template) if template.sample: patient = frappe.get_doc('Patient', self.patient) sample_collection = create_sample_doc(template, patient, None, self.company) frappe.db.set_value('Clinical Procedure', self.name, 'sample', sample_collection.name) self.reload()
def after_insert(self): if self.prescription: frappe.db.set_value("Procedure Prescription", self.prescription, "procedure_created", 1) if self.appointment: frappe.db.set_value("Patient Appointment", self.appointment, "status", "Closed") template = frappe.get_doc("Clinical Procedure Template", self.procedure_template) if template.sample: patient = frappe.get_doc("Patient", self.patient) sample_collection = create_sample_doc(template, patient, None) frappe.db.set_value("Clinical Procedure", self.name, "sample", sample_collection.name) self.reload()