Update Index untuk search
This commit is contained in:
parent
68c7ceeced
commit
475c10a6d6
@ -15,24 +15,26 @@ class Patient extends Controller {
|
||||
// OK - Done
|
||||
public function index() {
|
||||
try {
|
||||
$InternalPID = $this->request->getVar('InternalPID');
|
||||
$PatientID = $this->request->getVar('PatientID');
|
||||
$AlternatePID = $this->request->getVar('AlternatePID');
|
||||
$Prefix = $this->request->getVar('Prefix');
|
||||
$name = $this->request->getVar('Name');
|
||||
$Suffix = $this->request->getVar('Suffix');
|
||||
// $AlternatePID = $this->request->getVar('AlternatePID');
|
||||
// $Prefix = $this->request->getVar('Prefix');
|
||||
$Name = $this->request->getVar('Name');
|
||||
// $Suffix = $this->request->getVar('Suffix');
|
||||
$BirthDate = $this->request->getVar('BirthDate');
|
||||
$startDate = $this->request->getVar('StartDate');
|
||||
$endDate = $this->request->getVar('EndDate');
|
||||
// $startDate = $this->request->getVar('StartDate');
|
||||
// $endDate = $this->request->getVar('EndDate');
|
||||
|
||||
$builder = $this->db->table('patient');
|
||||
|
||||
if ($name !== null) {
|
||||
if ($Name !== null) {
|
||||
$sql = "LOWER(CONCAT_WS(' ', IFNULL(prefix,''), IFNULL(name_first,''), IFNULL(name_middle,''), IFNULL(name_last,''), IFNULL(name_maiden,''), IFNULL(suffix,'')))";
|
||||
$rawSql = new RawSql($sql);
|
||||
$builder->like($rawSql, $name, 'both');
|
||||
$builder->like($rawSql, $Name, 'both');
|
||||
}
|
||||
if ($PatientID !== null) { $builder->where('PatientID', $pat_num); }
|
||||
if ($AlternatePID !== null) { $builder->where('AlternatePID', $pat_altnum); }
|
||||
if ($InternalPID !== null) { $builder->where('InternalPID', $InternalPID); }
|
||||
if ($PatientID !== null) { $builder->where('PatientID', $PatientID); }
|
||||
// if ($AlternatePID !== null) { $builder->where('AlternatePID', $pat_altnum); }
|
||||
if ($BirthDate !== null) { $builder->where('BirthDate', $pat_dob); }
|
||||
/*
|
||||
if ($startDate !== null || $endDate !== null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user