chriskuhar wrote on Friday, January 17, 2014:
we noticed that from the “Patients” page, entering a single name, first name and last name are searched.
Select “Calendar” -> “click available time popup” -> “Patient Select popup” It follows the format
LastName, Firstname
if you want to search by just first name
, FirstName
NOTE: leading comma.
The following code change would be nice to have in the product so both searches worked similiar:
diff --git a/library/patient.inc b/library/patient.inc
index 732c4a7…1913c89 100644
— a/library/patient.inc
+++ b/library/patient.inc
@@ -410,7 +410,17 @@ function getPatientLnames($lname = “%”, $given = "pid, id, lname, fname, mname,
if ((strlen($fname) < 1)|| ($fname{0} != strtoupper($fname{0}))) {$search_for_pieces2 = ‘%’;}
$sqlBindArray = array();
- $where = "lname LIKE ? AND fname LIKE ? ";
- // making consistant with search in rest of product
- // check both first and last if just one name is given
- //
- if(strlen($fname) < 1) {
-
$fname = $lname;
-
$where = "lname LIKE ? OR fname LIKE ? ";
- } else {
-
$where = "lname LIKE ? AND fname LIKE ? ";
- }
- array_push($sqlBindArray, $search_for_pieces1.$lname."%", $search_for_pieces2.$fname."%");
if (!empty($GLOBALS[‘pt_restrict_field’])) {
if ( $_SESSION{“authUser”} != ‘admin’ || $GLOBALS[‘pt_restrict_admin’] ) {