Skip to content

Commit

Permalink
CDR Module: Administration screen that allows quick
Browse files Browse the repository at this point in the history
            toggling of rules.

  -Can be found at Administration->Alerts
  • Loading branch information
rreddy70 authored and bradymiller committed Apr 8, 2011
1 parent ba98c68 commit ac14c01
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 206 deletions.
1 change: 1 addition & 0 deletions interface/main/left_nav.php
Expand Up @@ -1113,6 +1113,7 @@ function selpopup(selobj) {
<?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
<?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
<?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Rules'),'super/rules/index.php?action=browse!list'); ?>
<?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Alerts'),'super/rules/index.php?action=alerts!listactmgr'); ?>
<?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Patient Reminders'),'patient_file/reminder/patient_reminders.php?mode=admin&patient_id='); ?>
<?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
<?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('Re Identification'),'de_identification_forms/re_identification_input_screen.php'); ?>
Expand Down
47 changes: 29 additions & 18 deletions interface/super/rules/controllers/alerts/controller.php
@@ -1,23 +1,37 @@
<?php
require_once( "model/CdrActivationManager.class.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.
//
class Controller_alerts extends BaseController {

function _action_default() {
$c = new CdrActivationManager();
function _action_listactmgr() {
$c = new CdrAlertManager();
$this->viewBean->rules = $c->populate();
$this->set_view("list.php");
$this->set_view("list_actmgr.php");
}

function _action_submit() {

//$this->viewBean->name = _post("name");
//$this->viewBean->age = _post("age");

function _action_submitactmgr() {

$ids = _post("id");
$actives = _post("active");
$passives = _post("passive");
$reminders = _post("reminder");

$ids = $_POST["id"];
$actives = $_POST["active"];
$passives = $_POST["passive"];
$reminders = $_POST["reminder"];


// The array of check-boxes we get from the POST are only those of the checked ones with value 'on'.
Expand Down Expand Up @@ -52,15 +66,12 @@ function _action_submit() {


}
//print_r($actives_final);
//print_r($passives_final);
//print_r($reminders_final);

// Reflect the changes to the database.
$c = new CdrActivationManager();
$c = new CdrAlertManager();
$c->update($ids, $actives_final, $passives_final, $reminders_final);

$this->forward("default");
$this->forward("listactmgr");
}

}
Expand Down
153 changes: 0 additions & 153 deletions interface/super/rules/controllers/alerts/model/CdrHelper.class.php

This file was deleted.

@@ -1,44 +1,56 @@
<form name="cdralertmgr" method="post" action="index.php?action=alerts!submit" >
<table class="header">
<tr>
<td class="title"><?php echo out( xl('Clinical Decision Rules Alert Manager') ); ?></td>

</tr>
<tr>
<td>
<a href="javascript:document.cdralertmgr.submit();" class="css_button"><span><?php echo out( xl('Save') ); ?></span></a><a href="javascript:document.cdralertmgr.reset();" class="css_button" ><span><?php echo out( xl('Reset') ); ?></span></a>
</td>
</tr>
</table>

&nbsp;

<form name="cdralertmgr" method="post" action="index.php?action=alerts!submitactmgr" >
<table cellpadding="1" cellspacing="0" class="showborder">
<tr class="showborder_head">
<th width="250px"><?php echo out( xl( 'Title' ) ); ?></th>
<th width="250px"><?php echo out( xl('Title') ); ?></th>
<th width="40px">&nbsp;</th>
<th width="10px"><?php echo out( xl( 'Active' ) );?></th>
<th width="10px"><?php echo out( xl('Active Alert') ); ?></th>
<th width="40px">&nbsp;</th>
<th width="10px"><?php echo out( xl( 'Passive' ) );?></th>
<th width="10px"><?php echo out( xl('Passive Alert') ); ?></th>
<th width="40px">&nbsp;</th>
<th width="10px"><?php echo out( xl( 'Reminders' ) );?></th>
<th width="10px"><?php echo out( xl('Patient Reminder') ); ?></th>
<th></th>
</tr>
<?php $index = -1; ?>
<?php foreach($viewBean->rules as $rule) {?>
<?php $index++; ?>
<tr height="22">
<td><?php echo out( xl( $rule->get_rule() ) );?></td>
<td><?php echo out( xl($rule->get_rule()) );?></td>
<td>&nbsp;</td>
<?php if ($rule->active_alert_flag() == "1"){ ?>
<td><input type="checkbox" name="active[<?php echo($index)?>]" checked="yes"></td>
<td><input type="checkbox" name="active[<?php echo $index ?>]" checked="yes"></td>
<?php }else {?>
<td><input type="checkbox" name="active[<?php echo($index)?>]" ></td>
<td><input type="checkbox" name="active[<?php echo $index ?>]" ></td>
<?php } ?>
<td>&nbsp;</td>
<?php if ($rule->passive_alert_flag() == "1"){ ?>
<td><input type="checkbox" name="passive[<?php echo($index)?>]]" checked="yes"></td>
<td><input type="checkbox" name="passive[<?php echo $index ?>]]" checked="yes"></td>
<?php }else {?>
<td><input type="checkbox" name="passive[<?php echo($index)?>]]"></td>
<td><input type="checkbox" name="passive[<?php echo $index ?>]]"></td>
<?php } ?>
<td>&nbsp;</td>
<?php if ($rule->patient_reminder_flag() == "1"){ ?>
<td><input type="checkbox" name="reminder[<?php echo($index)?>]]" checked="yes"></td>
<td><input type="checkbox" name="reminder[<?php echo $index ?>]]" checked="yes"></td>
<?php }else {?>
<td><input type="checkbox" name="reminder[<?php echo($index)?>]]"></td>
<td><input type="checkbox" name="reminder[<?php echo $index ?>]]"></td>
<?php } ?>
<td><input style="display:none" name="id[<?php echo($index)?>]]" value=<?php echo out( $rule->get_id() ); ?> /></td>
<td><input style="display:none" name="id[<?php echo $index ?>]]" value=<?php echo out($rule->get_id()); ?> /></td>
</tr>
<?php }?>
</table>
<br>
<a href="javascript:document.cdralertmgr.submit();" class="css_button"><span><?php echo out( xl( 'Save' ) ); ?></span></a><a href="javascript:document.cdralertmgr.reset();" class="css_button" ><span><?php echo out( xl( 'Cancel' ) ); ?></span></a>
</form>


@@ -1,17 +1,30 @@
<?php
/************************************************************************
CdrActivationManager.php - Copyright Ensoftek
**************************************************************************/
// 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 CdrActivationManager
* class CdrAlertManager
*
*/
class CdrActivationManager{
class CdrAlertManager{


/**
Expand All @@ -34,18 +47,6 @@ function populate() {
return $cdra;
}


function getrulenamefromid($rule_id) {
$rez = sqlStatement("SELECT `title` FROM `list_options` " .
"WHERE option_id=?", array($rule_id) );


for($iter=0; $row=sqlFetchArray($rez); $iter++) {
return $row['title'];
}

}

function update($rule_ids, $active_alert_flags, $passive_alert_flags, $patient_reminder_flags) {

for($index=0; $index < count($rule_ids); $index++) {
Expand All @@ -56,9 +57,8 @@ function update($rule_ids, $active_alert_flags, $passive_alert_flags, $patient_r
$cdra = new CdrResults($rule_id, $active_alert_flag, $passive_alert_flag, $patient_reminder_flag);
$cdra->update_table();
}


}

} // end of CdrActivationManager
} // end of CdrAlertManager
?>

0 comments on commit ac14c01

Please sign in to comment.