psr12 fixes for new PHP_CodeSniffer (#4795)
[openemr.git] / interface / super / rules / library / CdrAlertManager.class.php
blobedc72c697fb0782d2a01ee723777b59b4c0fe9f8
1 <?php
3 // Copyright (C) 2011 Ensoftek, Inc
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // A copy of the GNU General Public License is included along with this program:
16 // openemr/interface/login/GnuGPL.html
17 // For more information write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 require_once("CdrHelper.class.php");
22 require_once($GLOBALS['fileroot'] . "/library/clinical_rules.php");
24 /**
25 * class CdrAlertManager
28 class CdrAlertManager
30 /**
31 * Constructor
33 function CdrActivationManager($id = "", $prefix = "")
38 function populate()
40 $cdra = array();
42 $rules = resolve_rules_sql('', 0, true);
44 foreach ($rules as $rowRule) {
45 $rule_id = $rowRule['id'];
46 $cdra[] = new CdrResults($rule_id, $rowRule['active_alert_flag'], $rowRule['passive_alert_flag'], $rowRule['patient_reminder_flag'], $rowRule['access_control']);
49 return $cdra;
52 function update($rule_ids, $active_alert_flags, $passive_alert_flags, $patient_reminder_flags, $access_controls)
55 for ($index = 0; $index < count($rule_ids); $index++) {
56 $rule_id = $rule_ids[$index];
57 $active_alert_flag = $active_alert_flags[$index];
58 $passive_alert_flag = $passive_alert_flags[$index];
59 $patient_reminder_flag = $patient_reminder_flags[$index];
60 $access_control = $access_controls[$index];
61 $cdra = new CdrResults($rule_id, $active_alert_flag, $passive_alert_flag, $patient_reminder_flag, $access_control);
62 $cdra->update_table();
65 } // end of CdrAlertManager