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:
parent
3a9ca883b9
commit
0abec034df
@ -8,12 +8,12 @@ from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import getdate
|
||||
import json
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account,get_income_account
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account
|
||||
|
||||
class Consultation(Document):
|
||||
def on_update(self):
|
||||
if(self.appointment):
|
||||
frappe.db.set_value("Patient Appointment",self.appointment,"status","Closed")
|
||||
frappe.db.set_value("Patient Appointment", self.appointment, "status", "Closed")
|
||||
update_consultation_to_medical_record(self)
|
||||
|
||||
def after_insert(self):
|
||||
@ -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")
|
||||
@ -87,8 +92,8 @@ def create_invoice_items(physician, invoice, company):
|
||||
item_line.qty = 1
|
||||
item_line.uom = "Nos"
|
||||
item_line.conversion_factor = 1
|
||||
item_line.income_account = get_income_account(physician,company)
|
||||
op_consulting_charge = frappe.get_value("Physician",physician,"op_consulting_charge")
|
||||
item_line.income_account = get_income_account(physician, company)
|
||||
op_consulting_charge = frappe.get_value("Physician", physician, "op_consulting_charge")
|
||||
if op_consulting_charge:
|
||||
item_line.rate = op_consulting_charge
|
||||
item_line.amount = op_consulting_charge
|
||||
@ -107,10 +112,13 @@ def insert_consultation_to_medical_record(doc):
|
||||
medical_record.save(ignore_permissions=True)
|
||||
|
||||
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))
|
||||
medical_record_id = frappe.db.sql("select name from `tabPatient Medical Record` where reference_name=%s", (consultation.name))
|
||||
if(medical_record_id[0][0]):
|
||||
subject = set_subject_field(consultation)
|
||||
frappe.db.set_value("Patient Medical Record",medical_record_id[0][0],"subject",subject)
|
||||
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 "
|
||||
|
@ -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
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -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
|
||||
}
|
@ -9,6 +9,7 @@ frappe.ui.form.on('Physician', {
|
||||
filters: {
|
||||
'root_type': 'Income',
|
||||
'company': d.company,
|
||||
'is_group': 0
|
||||
}
|
||||
};
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user