diff --git a/app/Models/Patient/PatientModel.php b/app/Models/Patient/PatientModel.php index f78ef57..986fa77 100644 --- a/app/Models/Patient/PatientModel.php +++ b/app/Models/Patient/PatientModel.php @@ -23,7 +23,8 @@ class PatientModel extends BaseModel { public function getPatients($filters = []) { $qname = "CONCAT_WS(' ', IFNULL(Prefix,''), IFNULL(NameFirst,''), IFNULL(NameMiddle,''), IFNULL(NameLast,''), IFNULL(NameMaiden,''), IFNULL(Suffix,''))"; - $this->select("InternalPID, PatientID, $qname as FullName, Gender, Birthdate, EmailAddress1 as Email, MobilePhone"); + $this->select("InternalPID, PatientID, $qname as FullName, vs.VDesc as Gender, Birthdate, EmailAddress1 as Email, MobilePhone"); + $this->join('valueset vs', 'vs.vid = Gender', 'left'); if (!empty($filters['Name'])) { $this->like($qname, $filters['Name'], 'both');