limiting patient index
This commit is contained in:
parent
2b8a2580fc
commit
e36689716e
@ -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');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user