fix: remove Expired status from Appointment

This commit is contained in:
Rucha Mahabal
2020-03-27 11:30:00 +05:30
parent 197165ff40
commit cdf7189c29
4 changed files with 5 additions and 9 deletions

View File

@@ -90,7 +90,7 @@
"in_filter": 1, "in_filter": 1,
"in_list_view": 1, "in_list_view": 1,
"label": "Status", "label": "Status",
"options": "\nScheduled\nOpen\nClosed\nExpired\nCancelled", "options": "\nScheduled\nOpen\nClosed\nCancelled",
"read_only": 1, "read_only": 1,
"search_index": 1 "search_index": 1
}, },
@@ -285,7 +285,7 @@
} }
], ],
"links": [], "links": [],
"modified": "2020-03-02 14:35:54.040428", "modified": "2020-03-27 11:27:33.773195",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Healthcare", "module": "Healthcare",
"name": "Patient Appointment", "name": "Patient Appointment",

View File

@@ -37,8 +37,6 @@ class PatientAppointment(Document):
self.status = 'Open' self.status = 'Open'
elif appointment_date > today: elif appointment_date > today:
self.status = 'Scheduled' self.status = 'Scheduled'
elif appointment_date < today:
self.status = 'Expired'
def validate_overlaps(self): def validate_overlaps(self):
end_time = datetime.datetime.combine(getdate(self.appointment_date), get_time(self.appointment_time)) \ 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, return frappe.db.sql("""select pp.name, pp.procedure, pp.parent, ct.practitioner,
ct.encounter_date, pp.practitioner, pp.date, pp.department ct.encounter_date, pp.practitioner, pp.date, pp.department
from `tabPatient Encounter` ct, `tabProcedure Prescription` pp from `tabPatient Encounter` ct, `tabProcedure Prescription` pp
where ct.patient='{0}' and pp.parent=ct.name and pp.appointment_booked=0 where ct.patient=%(patient)s and pp.parent=ct.name and pp.appointment_booked=0
order by ct.creation desc""".format(patient)) order by ct.creation desc""", {'patient': patient})
def update_appointment_status(): def update_appointment_status():

View File

@@ -13,7 +13,7 @@ def execute(filters=None):
class Analytics(object): class Analytics(object):
def __init__(self, filters=None): def __init__(self, filters=None):
"""Patient Appointment Analytics Report""" """Patient Appointment Analytics Report."""
self.filters = frappe._dict(filters or {}) self.filters = frappe._dict(filters or {})
self.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] self.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
self.get_period_date_ranges() self.get_period_date_ranges()

View File

@@ -1,7 +1,5 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe
def get_context(context): def get_context(context):
# do your magic here # do your magic here
pass pass