forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 13
/
CdrAlertManager.class.php
64 lines (51 loc) · 2.18 KB
/
CdrAlertManager.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
// Copyright (C) 2011 Ensoftek, Inc
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// A copy of the GNU General Public License is included along with this program:
// openemr/interface/login/GnuGPL.html
// For more information write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
require_once( "CdrHelper.class.php");
require_once( $GLOBALS['fileroot'] . "/library/clinical_rules.php" );
/**
* class CdrAlertManager
*
*/
class CdrAlertManager{
/**
* Constructor
*/
function CdrActivationManager ($id = "", $prefix = "") {
}
function populate() {
$cdra = array();
$rules = resolve_rules_sql('', 0, TRUE);
foreach( $rules as $rowRule ) {
$rule_id = $rowRule['id'];
$cdra[] = new CdrResults($rule_id, $rowRule['active_alert_flag'], $rowRule['passive_alert_flag'], $rowRule['patient_reminder_flag']);
}
return $cdra;
}
function update($rule_ids, $active_alert_flags, $passive_alert_flags, $patient_reminder_flags) {
for($index=0; $index < count($rule_ids); $index++) {
$rule_id = $rule_ids[$index];
$active_alert_flag = $active_alert_flags[$index];
$passive_alert_flag = $passive_alert_flags[$index];
$patient_reminder_flag = $patient_reminder_flags[$index];
$cdra = new CdrResults($rule_id, $active_alert_flag, $passive_alert_flag, $patient_reminder_flag);
$cdra->update_table();
}
}
} // end of CdrAlertManager
?>