fix: Patient Appointment Calendar (#15684)
This commit is contained in:
parent
0d2a4c6a59
commit
741bd29b74
@ -339,13 +339,13 @@ def get_events(start, end, filters=None):
|
||||
|
||||
data = frappe.db.sql("""select name, patient, practitioner, status,
|
||||
duration, timestamp(appointment_date, appointment_time) as
|
||||
'appointment_date' from `tabPatient Appointment` where
|
||||
'start' from `tabPatient Appointment` where
|
||||
(appointment_date between %(start)s and %(end)s)
|
||||
and docstatus < 2 {conditions}""".format(conditions=conditions),
|
||||
{"start": start, "end": end}, as_dict=True, update={"allDay": 0})
|
||||
|
||||
for item in data:
|
||||
item.appointment_datetime = item.appointment_date + datetime.timedelta(minutes = item.duration)
|
||||
item.end = item.start + datetime.timedelta(minutes = item.duration)
|
||||
|
||||
return data
|
||||
|
||||
|
@ -10,37 +10,5 @@ frappe.views.calendar["Patient Appointment"] = {
|
||||
},
|
||||
order_by: "appointment_date",
|
||||
gantt: true,
|
||||
get_events_method: "erpnext.healthcare.doctype.patient_appointment.patient_appointment.get_events",
|
||||
filters: [
|
||||
{
|
||||
'fieldtype': 'Link',
|
||||
'fieldname': 'practitioner',
|
||||
'options': 'Healthcare Practitioner',
|
||||
'label': __('Healthcare Practitioner')
|
||||
},
|
||||
{
|
||||
'fieldtype': 'Link',
|
||||
'fieldname': 'patient',
|
||||
'options': 'Patient',
|
||||
'label': __('Patient')
|
||||
},
|
||||
{
|
||||
'fieldtype': 'Link',
|
||||
'fieldname': 'appointment_type',
|
||||
'options': 'Appointment Type',
|
||||
'label': __('Appointment Type')
|
||||
},
|
||||
{
|
||||
'fieldtype': 'Link',
|
||||
'fieldname': 'department',
|
||||
'options': 'Medical Department',
|
||||
'label': __('Department')
|
||||
},
|
||||
{
|
||||
'fieldtype': 'Select',
|
||||
'fieldname': 'status',
|
||||
'options': 'Scheduled\nOpen\nClosed\nPending',
|
||||
'label': __('Status')
|
||||
}
|
||||
]
|
||||
get_events_method: "erpnext.healthcare.doctype.patient_appointment.patient_appointment.get_events"
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user