2 // Copyright (C) 2011 Ensoftek, Inc
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // A copy of the GNU General Public License is included along with this program:
15 // openemr/interface/login/GnuGPL.html
16 // For more information write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 function __construct($rule_id = "", $active_alert_flag = "", $passive_alert_flag = "", $patient_reminder_flag = "", $access_control = "")
32 $this->rule
= getLabel($this->id
, 'clinical_rules');
33 $this->active_flag
= $active_alert_flag;
34 $this->passive_flag
= $passive_alert_flag;
35 $this->reminder_flag
= $patient_reminder_flag;
36 $this->access_control
= $access_control;
39 function active_alert_flag()
41 return $this->active_flag
;
44 function passive_alert_flag()
46 return $this->passive_flag
;
59 function patient_reminder_flag()
61 return $this->reminder_flag
;
64 function access_control()
66 return $this->access_control
;
69 function update_table()
72 // Set the settings that only apply to the main rule (pid = 0)
73 $query = "UPDATE clinical_rules SET active_alert_flag = ?" .
74 ", passive_alert_flag = ?" .
75 ", patient_reminder_flag = ?" .
76 " WHERE id = ? AND pid = 0";
78 sqlStatement($query, array($this->active_flag
,$this->passive_flag
,$this->reminder_flag
,$this->id
));
80 // Set the settings that apply to all rules including the patient custom rules (pid is > 0)
81 $query = "UPDATE clinical_rules SET access_control = ?" .
84 sqlStatement($query, array($this->access_control
,$this->id
));