From bab226698f5d8c12c7c75302f5d749833e360c5c Mon Sep 17 00:00:00 2001 From: Jamsheer Date: Wed, 15 Nov 2017 09:47:00 +0530 Subject: [PATCH] Healthcare hotfix (#11574) * Patient dashboard - Vital Signs * Remove submit validation in Consultation * Physician Schedule - Add Time Slots - Fix * Patient Appointment - Client side - fixes --- erpnext/healthcare/doctype/consultation/consultation.py | 4 ---- erpnext/healthcare/doctype/patient/patient_dashboard.py | 4 ++-- .../doctype/patient_appointment/patient_appointment.js | 8 ++++++++ .../doctype/physician_schedule/physician_schedule.js | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/erpnext/healthcare/doctype/consultation/consultation.py b/erpnext/healthcare/doctype/consultation/consultation.py index e16c22176c..11b5ed233a 100755 --- a/erpnext/healthcare/doctype/consultation/consultation.py +++ b/erpnext/healthcare/doctype/consultation/consultation.py @@ -23,10 +23,6 @@ class Consultation(Document): if not self.diagnosis or not self.symptoms: frappe.throw("Diagnosis and Complaints cannot be left blank") - physician = frappe.get_doc("Physician",self.physician) - if(frappe.session.user != physician.user_id): - frappe.throw(_("You don't have permission to submit")) - def set_sales_invoice_fields(company, patient): sales_invoice = frappe.new_doc("Sales Invoice") sales_invoice.customer = frappe.get_value("Patient", patient, "customer") diff --git a/erpnext/healthcare/doctype/patient/patient_dashboard.py b/erpnext/healthcare/doctype/patient/patient_dashboard.py index cb98f0dcf4..f015b83038 100644 --- a/erpnext/healthcare/doctype/patient/patient_dashboard.py +++ b/erpnext/healthcare/doctype/patient/patient_dashboard.py @@ -11,8 +11,8 @@ def get_data(): 'items': ['Patient Appointment', 'Consultation'] }, { - 'label': _('Lab Tests'), - 'items': ['Lab Test'] + 'label': _('Lab Tests and Vital Signs'), + 'items': ['Lab Test', 'Vital Signs'] } ] } diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js index 1942b66f7b..2237ff5d1b 100644 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js @@ -25,6 +25,14 @@ frappe.ui.form.on('Patient Appointment', { frm.add_custom_button(__('Cancel'), function() { btn_update_status(frm, "Cancelled"); }); + + frm.add_custom_button(__("Consultation"),function(){ + btn_create_consultation(frm); + },"Create"); + + frm.add_custom_button(__('Vital Signs'), function() { + btn_create_vital_signs(frm); + },"Create"); } if(frm.doc.status == "Scheduled" && !frm.doc.__islocal){ frm.add_custom_button(__('Cancel'), function() { diff --git a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.js b/erpnext/healthcare/doctype/physician_schedule/physician_schedule.js index e198d35fd3..74ba66f81a 100644 --- a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.js +++ b/erpnext/healthcare/doctype/physician_schedule/physician_schedule.js @@ -33,7 +33,7 @@ frappe.ui.form.on('Physician Schedule', { while(cur_time < end_time) { let to_time = cur_time.clone().add(values.duration, 'minutes'); - if(to_time < end_time) { + if(to_time <= end_time) { // add a new timeslot frm.add_child('time_slots', {