diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js index c4f625947ec..944986a8ca6 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 0f595b926e8..d00e7bc7dd2 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",