From cdf7189c2909f689847a09867e86441ebdbb27e8 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Fri, 27 Mar 2020 11:30:00 +0530 Subject: [PATCH] fix: remove Expired status from Appointment --- .../doctype/patient_appointment/patient_appointment.json | 4 ++-- .../doctype/patient_appointment/patient_appointment.py | 6 ++---- .../patient_appointment_analytics.py | 2 +- .../web_form/patient_registration/patient_registration.py | 2 -- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json index 51db3e9ce1..7f9a671d47 100644 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json @@ -90,7 +90,7 @@ "in_filter": 1, "in_list_view": 1, "label": "Status", - "options": "\nScheduled\nOpen\nClosed\nExpired\nCancelled", + "options": "\nScheduled\nOpen\nClosed\nCancelled", "read_only": 1, "search_index": 1 }, @@ -285,7 +285,7 @@ } ], "links": [], - "modified": "2020-03-02 14:35:54.040428", + "modified": "2020-03-27 11:27:33.773195", "modified_by": "Administrator", "module": "Healthcare", "name": "Patient Appointment", diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py index 9f77738573..c362679142 100755 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py @@ -37,8 +37,6 @@ class PatientAppointment(Document): self.status = 'Open' elif appointment_date > today: self.status = 'Scheduled' - elif appointment_date < today: - self.status = 'Expired' def validate_overlaps(self): end_time = datetime.datetime.combine(getdate(self.appointment_date), get_time(self.appointment_time)) \ @@ -421,8 +419,8 @@ def get_procedure_prescribed(patient): return frappe.db.sql("""select pp.name, pp.procedure, pp.parent, ct.practitioner, ct.encounter_date, pp.practitioner, pp.date, pp.department from `tabPatient Encounter` ct, `tabProcedure Prescription` pp - where ct.patient='{0}' and pp.parent=ct.name and pp.appointment_booked=0 - order by ct.creation desc""".format(patient)) + where ct.patient=%(patient)s and pp.parent=ct.name and pp.appointment_booked=0 + order by ct.creation desc""", {'patient': patient}) def update_appointment_status(): diff --git a/erpnext/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py b/erpnext/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py index 16af55d74d..9c35dbb3ea 100644 --- a/erpnext/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py +++ b/erpnext/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py @@ -13,7 +13,7 @@ def execute(filters=None): class Analytics(object): def __init__(self, filters=None): - """Patient Appointment Analytics Report""" + """Patient Appointment Analytics Report.""" self.filters = frappe._dict(filters or {}) self.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] self.get_period_date_ranges() diff --git a/erpnext/healthcare/web_form/patient_registration/patient_registration.py b/erpnext/healthcare/web_form/patient_registration/patient_registration.py index 2334f8b26d..1bc4d1874c 100644 --- a/erpnext/healthcare/web_form/patient_registration/patient_registration.py +++ b/erpnext/healthcare/web_form/patient_registration/patient_registration.py @@ -1,7 +1,5 @@ from __future__ import unicode_literals -import frappe - def get_context(context): # do your magic here pass