5 * Copyright (C) 2017 Victor Kofia <victor.kofia@gmail.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
19 * @author Victor Kofia <victor.kofia@gmail.com>
20 * @link http://www.open-emr.org
25 class PatientService
{
28 * Default constructor.
30 public function __construct() {
34 * @param $pid unique patient id
37 public static function getChartTrackerInformationActivity($pid) {
38 $sql = "SELECT ct.ct_when,
45 FROM chart_tracker AS ct
46 LEFT OUTER JOIN users AS u ON u.id = ct.ct_userid
48 ORDER BY ct.ct_when DESC";
49 return sqlStatement($sql, array($pid));
55 public static function getChartTrackerInformation() {
56 $sql = "SELECT ct.ct_when,
65 FROM chart_tracker AS ct
66 JOIN cttemp ON cttemp.ct_pid = ct.ct_pid AND cttemp.ct_when = ct.ct_when
67 LEFT OUTER JOIN users AS u ON u.id = ct.ct_userid
68 LEFT OUTER JOIN patient_data AS p ON p.pid = ct.ct_pid
69 WHERE ct.ct_userid != 0
71 return sqlStatement($sql);