Healthcare hotfix (#11586)

* On Cancel Consultation - Open Appointment - Delete Medical Record

* Add Filter on Account Selection - is_group: 0

* Patient Medical Record - List view Fixes

* Update consultation.py
This commit is contained in:
Jamsheer 2017-11-15 13:53:50 +05:30 committed by Nabin Hait
parent 3a9ca883b9
commit 0abec034df
4 changed files with 24 additions and 12 deletions

View File

@ -23,6 +23,11 @@ class Consultation(Document):
if not self.diagnosis or not self.symptoms:
frappe.throw("Diagnosis and Complaints cannot be left blank")
def on_cancel(self):
if(self.appointment):
frappe.db.set_value("Patient Appointment", self.appointment, "status", "Open")
delete_medical_record(self)
def set_sales_invoice_fields(company, patient):
sales_invoice = frappe.new_doc("Sales Invoice")
sales_invoice.customer = frappe.get_value("Patient", patient, "customer")
@ -112,6 +117,9 @@ def update_consultation_to_medical_record(consultation):
subject = set_subject_field(consultation)
frappe.db.set_value("Patient Medical Record", medical_record_id[0][0], "subject", subject)
def delete_medical_record(consultation):
frappe.db.sql("""delete from `tabPatient Medical Record` where reference_name = %s""", (consultation.name))
def set_subject_field(consultation):
subject = "No Diagnosis "
if(consultation.diagnosis):

View File

@ -9,6 +9,7 @@ frappe.ui.form.on('Healthcare Settings', {
filters: {
'account_type': 'Receivable',
'company': d.company,
'is_group': 0
}
};
});
@ -18,6 +19,7 @@ frappe.ui.form.on('Healthcare Settings', {
filters: {
'root_type': 'Income',
'company': d.company,
'is_group': 0
}
};
});

View File

@ -56,7 +56,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Patient",
"length": 0,
@ -174,7 +174,7 @@
"ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Subject",
"length": 0,
@ -236,7 +236,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Datetime",
"length": 0,
@ -266,7 +266,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Reference DocType",
"length": 0,
@ -297,7 +297,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Reference Name",
"length": 0,
@ -389,7 +389,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-10-04 16:09:55.597866",
"modified": "2017-11-15 12:48:59.945615",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient Medical Record",
@ -425,6 +425,7 @@
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "patient",
"track_changes": 1,
"track_seen": 1
}

View File

@ -9,6 +9,7 @@ frappe.ui.form.on('Physician', {
filters: {
'root_type': 'Income',
'company': d.company,
'is_group': 0
}
};
});