From e29d5c1d5ba079f4972d526b2381ec44809e6e12 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Thu, 27 Feb 2020 12:57:38 +0530 Subject: [PATCH] fix: Schedule Admission button not visible --- .../patient_encounter/patient_encounter.js | 18 ++++++++---------- .../patient_encounter/patient_encounter.json | 5 +++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js index c4f625947e..944986a8ca 100644 --- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js +++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js @@ -22,16 +22,14 @@ frappe.ui.form.on('Patient Encounter', { if (!frm.doc.__islocal) { - if (frm.doc.inpatient_record) { - if (frm.doc.inpatient_status == 'Admission Scheduled' || data.message.inpatient_status == 'Admitted') { - frm.add_custom_button(__('Schedule Discharge'), function() { - schedule_discharge(frm); - }); - } else if (frm.doc.inpatient_status != 'Discharge Scheduled') { - frm.add_custom_button(__('Schedule Admission'), function() { - schedule_inpatient(frm); - }); - } + if (frm.doc.inpatient_status == 'Admission Scheduled' || frm.doc.inpatient_status == 'Admitted') { + frm.add_custom_button(__('Schedule Discharge'), function() { + schedule_discharge(frm); + }); + } else if (frm.doc.inpatient_status != 'Discharge Scheduled') { + frm.add_custom_button(__('Schedule Admission'), function() { + schedule_inpatient(frm); + }); } frm.add_custom_button(__('Patient History'), function() { diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json index 0f595b926e..d00e7bc7dd 100644 --- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json +++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json @@ -150,7 +150,6 @@ "read_only": 1 }, { - "collapsible": 1, "fieldname": "sb_symptoms", "fieldtype": "Section Break", "label": "Encounter Impression" @@ -165,6 +164,7 @@ }, { "default": "0", + "depends_on": "eval: doc.symptoms != ''", "fieldname": "symptoms_in_print", "fieldtype": "Check", "label": "In print", @@ -186,6 +186,7 @@ }, { "default": "1", + "depends_on": "eval: doc.diagnosis != ''", "fieldname": "diagnosis_in_print", "fieldtype": "Check", "label": "In print", @@ -290,7 +291,7 @@ ], "is_submittable": 1, "links": [], - "modified": "2020-02-26 16:50:52.141816", + "modified": "2020-02-27 12:42:21.751964", "modified_by": "Administrator", "module": "Healthcare", "name": "Patient Encounter",