]> Softwares of Agnibho - librevax.git/commitdiff
Patient list order by cid
authorAgnibho Mondal <mondal@agnibho.com>
Thu, 11 Jan 2024 19:59:51 +0000 (01:29 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Thu, 11 Jan 2024 19:59:51 +0000 (01:29 +0530)
patient.py

index 82865818c1021921ac15e0268cd72e1911f8bd7c..267e3bb240e0936a7874b33065689f496ce8e854 100644 (file)
@@ -46,9 +46,9 @@ def list(cursor, filter={"cid":"%", "name":"%", "next":"%"}, mid=None):
     try:
         filter={k:v for k,v in filter.items() if v}
         if(mid is None):
-            result=cursor.execute("SELECT * FROM patients WHERE cid LIKE ? AND name LIKE ? AND next LIKE ?", ("%"+filter.get("cid", "")+"%", "%"+filter.get("name", "")+"%", "%"+filter.get("next", "")+"%"))
+            result=cursor.execute("SELECT * FROM patients WHERE cid LIKE ? AND name LIKE ? AND next LIKE ? ORDER BY cid DESC", ("%"+filter.get("cid", "")+"%", "%"+filter.get("name", "")+"%", "%"+filter.get("next", "")+"%"))
         else:
-            result=cursor.execute("SELECT * FROM patients WHERE cid LIKE ? AND name LIKE ? AND next LIKE ? AND mid=?", ("%"+filter.get("cid", "")+"%", "%"+filter.get("name", "")+"%", "%"+filter.get("next", "")+"%", mid))
+            result=cursor.execute("SELECT * FROM patients WHERE cid LIKE ? AND name LIKE ? AND next LIKE ? AND mid=? ORDER BY cid DESC", ("%"+filter.get("cid", "")+"%", "%"+filter.get("name", "")+"%", "%"+filter.get("next", "")+"%", mid))
         #if(filter=="cid"):
         #    result=cursor.execute("SELECT * FROM patients WHERE cid LIKE ? AND mid LIKE ?", (term, mid))
         #elif(filter=="name"):