3 * Document Helper Functions for New Documents Module.
6 * @link http://www.open-emr.org
7 * @author Jerry Padgett <sjpadgett@gmail.com>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2017-2018 Jerry Padgett <sjpadgett@gmail.com>
10 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once(dirname(__FILE__
) . "/../../interface/globals.php");
18 if (!verifyCsrfToken($_GET["csrf_token_form"])) {
23 'term' => (isset($_GET["term"]) ?
filter_input(INPUT_GET
, 'term') : ''),
24 'sql_limit' => (isset($_GET["limit"]) ?
filter_input(INPUT_GET
, 'limit') : 20),
27 function get_patients_list($req)
29 $term = "%" . $req['term'] . "%";
30 $clear = "- " . xl("Reset to no patient") . " -";
31 $response = sqlStatement(
32 "SELECT CONCAT(fname, ' ',lname,IF(IFNULL(deceased_date,0)=0,'','*')) as label, pid as value
35 ORDER BY IF(IFNULL(deceased_date,0)=0, 0, 1) ASC, IFNULL(deceased_date,0) DESC, lname ASC, fname ASC
36 LIMIT " . escape_limit($req['sql_limit']),
43 while ($row = sqlFetchArray($response)) {
44 if ($GLOBALS['pid'] == $row['value']) {
46 $row['label'] = xl("Locked") . "-" . xl("In Use") . ":" . $row['label'];
52 echo json_encode($resultpd);
55 get_patients_list($req);