change eligibility batch from ssn to policy number, minor fix to filename with extra...
[openemr.git] / library / ajax / execute_pat_reminder.php
blobab576fe82f059178b9182a92c6a115e59e821bdc
1 <?php
2 /**
3 * Process/send clinical reminders.
5 * Copyright (C) 2012 Brady Miller <brady.g.miller@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>;.
18 * @package OpenEMR
19 * @author Brady Miller <brady.g.miller@gmail.com>
20 * @link http://www.open-emr.org
25 require_once(dirname(__FILE__) . "/../../interface/globals.php");
26 require_once(dirname(__FILE__) . "/../reminders.php");
28 //To improve performance and not freeze the session when running this
29 // report, turn off session writing. Note that php session variables
30 // can not be modified after the line below. So, if need to do any php
31 // session work in the future, then will need to remove this line.
32 session_write_close();
34 //Remove time limit, since script can take many minutes
35 set_time_limit(0);
37 // Set the "nice" level of the process for these reports. When the "nice" level
38 // is increased, these cpu intensive reports will have less affect on the performance
39 // of other server activities, albeit it may negatively impact the performance
40 // of this report (note this is only applicable for linux).
41 if (!empty($GLOBALS['pat_rem_clin_nice'])) {
42 proc_nice($GLOBALS['pat_rem_clin_nice']);
45 // Start a report, which will be stored in the report_results sql table..
46 if ((!empty($_POST['execute_report_id']) && !empty($_POST['process_type'])) && (($_POST['process_type'] == "process" ) || ($_POST['process_type'] == "process_send"))) {
47 if ($_POST['process_type'] == "process_send") {
48 update_reminders_batch_method('', '', $_POST['execute_report_id'], true);
49 } else { // $_POST['process_type'] == "process"
50 update_reminders_batch_method('', '', $_POST['execute_report_id']);
52 } else {
53 echo "ERROR";