fix: disabled patient shown as enabled
This commit is contained in:
parent
c7417c08ed
commit
a4202d1660
@ -29,7 +29,7 @@ frappe.ui.form.on('Clinical Procedure', {
|
|||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frm.set_query("patient", function () {
|
frm.set_query("patient", function () {
|
||||||
return {
|
return {
|
||||||
filters: {"disabled": 0}
|
filters: {"status": "Disabled"}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
frm.set_query("appointment", function () {
|
frm.set_query("appointment", function () {
|
||||||
|
|||||||
@ -70,6 +70,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "0",
|
"default": "0",
|
||||||
|
"description": "Checking this will create new Patients with a Disabled status by default and will only be enabled after invoicing the Registration Fee.",
|
||||||
"fieldname": "collect_registration_fee",
|
"fieldname": "collect_registration_fee",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Collect Fee for Patient Registration"
|
"label": "Collect Fee for Patient Registration"
|
||||||
@ -294,7 +295,7 @@
|
|||||||
],
|
],
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-01-28 18:04:48.671093",
|
"modified": "2020-01-29 10:49:00.758580",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Healthcare",
|
"module": "Healthcare",
|
||||||
"name": "Healthcare Settings",
|
"name": "Healthcare Settings",
|
||||||
|
|||||||
@ -15,7 +15,7 @@ frappe.ui.form.on('Patient', {
|
|||||||
} else {
|
} else {
|
||||||
erpnext.toggle_naming_series();
|
erpnext.toggle_naming_series();
|
||||||
}
|
}
|
||||||
if (frappe.defaults.get_default("collect_registration_fee") && frm.doc.disabled == 1) {
|
if (frappe.defaults.get_default("collect_registration_fee") && frm.doc.status == 'Disabled') {
|
||||||
frm.add_custom_button(__('Invoice Patient Registration'), function () {
|
frm.add_custom_button(__('Invoice Patient Registration'), function () {
|
||||||
btn_invoice_registration(frm);
|
btn_invoice_registration(frm);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"actions": [],
|
||||||
"allow_copy": 1,
|
"allow_copy": 1,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
@ -19,15 +20,14 @@
|
|||||||
"blood_group",
|
"blood_group",
|
||||||
"dob",
|
"dob",
|
||||||
"age_html",
|
"age_html",
|
||||||
"status",
|
|
||||||
"image",
|
"image",
|
||||||
"column_break_14",
|
"column_break_14",
|
||||||
|
"status",
|
||||||
"customer",
|
"customer",
|
||||||
"report_preference",
|
"report_preference",
|
||||||
"mobile",
|
"mobile",
|
||||||
"email",
|
"email",
|
||||||
"phone",
|
"phone",
|
||||||
"disabled",
|
|
||||||
"sb_relation",
|
"sb_relation",
|
||||||
"patient_relation",
|
"patient_relation",
|
||||||
"allergy_medical_and_surgical_history",
|
"allergy_medical_and_surgical_history",
|
||||||
@ -125,15 +125,15 @@
|
|||||||
"report_hide": 1
|
"report_hide": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "Active",
|
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 1,
|
"in_filter": 1,
|
||||||
|
"in_list_view": 1,
|
||||||
"label": "Status",
|
"label": "Status",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Active\nDormant\nOpen",
|
"options": "Active\nDisabled",
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"report_hide": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "image",
|
"fieldname": "image",
|
||||||
@ -183,19 +183,8 @@
|
|||||||
"fieldname": "phone",
|
"fieldname": "phone",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Phone"
|
"label": "Phone"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"default": "0",
|
|
||||||
"fieldname": "disabled",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"hidden": 1,
|
|
||||||
"label": "Disabled",
|
|
||||||
"no_copy": 1,
|
|
||||||
"print_hide": 1,
|
|
||||||
"report_hide": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"fieldname": "sb_relation",
|
"fieldname": "sb_relation",
|
||||||
@ -346,8 +335,9 @@
|
|||||||
],
|
],
|
||||||
"icon": "fa fa-user",
|
"icon": "fa fa-user",
|
||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
|
"links": [],
|
||||||
"max_attachments": 50,
|
"max_attachments": 50,
|
||||||
"modified": "2019-09-25 23:30:49.905893",
|
"modified": "2020-01-29 11:22:40.698125",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Healthcare",
|
"module": "Healthcare",
|
||||||
"name": "Patient",
|
"name": "Patient",
|
||||||
|
|||||||
@ -15,8 +15,8 @@ class Patient(Document):
|
|||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
if(frappe.db.get_value("Healthcare Settings", None, "link_customer_to_patient") == '1' and not self.customer):
|
if(frappe.db.get_value("Healthcare Settings", None, "link_customer_to_patient") == '1' and not self.customer):
|
||||||
create_customer(self)
|
create_customer(self)
|
||||||
if(frappe.db.get_value("Healthcare Settings", None, "collect_registration_fee") == '1'):
|
if frappe.db.get_single_value('Healthcare Settings', 'collect_registration_fee'):
|
||||||
frappe.db.set_value("Patient", self.name, "disabled", 1)
|
frappe.db.set_value('Patient', self.name, 'status', 'Disabled')
|
||||||
else:
|
else:
|
||||||
send_registration_sms(self)
|
send_registration_sms(self)
|
||||||
self.reload()
|
self.reload()
|
||||||
@ -62,7 +62,7 @@ class Patient(Document):
|
|||||||
return age_str
|
return age_str
|
||||||
|
|
||||||
def invoice_patient_registration(self):
|
def invoice_patient_registration(self):
|
||||||
frappe.db.set_value("Patient", self.name, "disabled", 0)
|
frappe.db.set_value("Patient", self.name, "status", "Active")
|
||||||
send_registration_sms(self)
|
send_registration_sms(self)
|
||||||
if(flt(frappe.get_value("Healthcare Settings", None, "registration_fee"))>0):
|
if(flt(frappe.get_value("Healthcare Settings", None, "registration_fee"))>0):
|
||||||
company = frappe.defaults.get_user_default('company')
|
company = frappe.defaults.get_user_default('company')
|
||||||
|
|||||||
@ -11,7 +11,7 @@ frappe.ui.form.on('Patient Appointment', {
|
|||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frm.set_query("patient", function () {
|
frm.set_query("patient", function () {
|
||||||
return {
|
return {
|
||||||
filters: {"disabled": 0}
|
filters: {"status": "Disabled"}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
frm.set_query("practitioner", function() {
|
frm.set_query("practitioner", function() {
|
||||||
|
|||||||
@ -62,7 +62,7 @@ frappe.ui.form.on('Patient Encounter', {
|
|||||||
|
|
||||||
frm.set_query("patient", function () {
|
frm.set_query("patient", function () {
|
||||||
return {
|
return {
|
||||||
filters: {"disabled": 0}
|
filters: {"status": "Disabled"}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
frm.set_query("drug_code", "drug_prescription", function() {
|
frm.set_query("drug_code", "drug_prescription", function() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user