From e36689716e95282a99d394f18136a8a834f1caf5 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Tue, 5 Aug 2025 10:34:58 +0700 Subject: [PATCH] limiting patient index --- app/Controllers/Patient.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Controllers/Patient.php b/app/Controllers/Patient.php index 44cdf7c..92bef06 100644 --- a/app/Controllers/Patient.php +++ b/app/Controllers/Patient.php @@ -19,11 +19,11 @@ class Patient extends Controller { $PatientID = $this->request->getVar('PatientID'); $Name = $this->request->getVar('Name'); $BirthDate = $this->request->getVar('BirthDate'); - + $qname = "LOWER(CONCAT_WS(' ', IFNULL(Prefix,''), IFNULL(NameFirst,''), IFNULL(NameMiddle,''), IFNULL(NameLast,''), IFNULL(NameMaiden,''), IFNULL(Suffix,'')))"; $builder = $this->db->table('patient'); - + $builder->select("InternalPID, PatientID, $qname as FullName, Gender, BirthDate"); if ($Name !== null) { - $sql = "LOWER(CONCAT_WS(' ', IFNULL(Prefix,''), IFNULL(NameFirst,''), IFNULL(NameMiddle,''), IFNULL(NameLast,''), IFNULL(NameMaiden,''), IFNULL(Suffix,'')))"; + $sql = $qname; $rawSql = new RawSql($sql); $builder->like($rawSql, $Name, 'both'); }