diff --git a/app/Controllers/Patient.php b/app/Controllers/Patient.php index af2e706..4faea95 100644 --- a/app/Controllers/Patient.php +++ b/app/Controllers/Patient.php @@ -28,14 +28,14 @@ class Patient extends Controller { $builder = $this->db->table('patient'); if ($Name !== null) { - $sql = "LOWER(CONCAT_WS(' ', IFNULL(prefix,''), IFNULL(name_first,''), IFNULL(name_middle,''), IFNULL(name_last,''), IFNULL(name_maiden,''), IFNULL(suffix,'')))"; + $sql = "LOWER(CONCAT_WS(' ', IFNULL(Prefix,''), IFNULL(NameFirst,''), IFNULL(NameMiddle,''), IFNULL(NameLast,''), IFNULL(NameMaiden,''), IFNULL(Suffix,'')))"; $rawSql = new RawSql($sql); $builder->like($rawSql, $Name, 'both'); } 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 ($BirthDate !== null) { $builder->where('BirthDate', $BirthDate); } /* if ($startDate !== null || $endDate !== null) { $builder->join('requests', 'pat_id=patients.pat_id','left');