Setup script bootstrapped with new theme selector - Take 2 (#2139)
[openemr.git] / library / ajax / execute_pat_reminder.php
blobbb91516ad6b8c9d5880158436e3892c71c49bab1
1 <?php
2 /**
3 * Process/send clinical reminders.
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Brady Miller <brady.g.miller@gmail.com>
8 * @copyright Copyright (c) 2012-2018 Brady Miller <brady.g.miller@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once(dirname(__FILE__) . "/../../interface/globals.php");
14 require_once(dirname(__FILE__) . "/../reminders.php");
16 if (!verifyCsrfToken($_POST["csrf_token_form"])) {
17 csrfNotVerified();
20 //To improve performance and not freeze the session when running this
21 // report, turn off session writing. Note that php session variables
22 // can not be modified after the line below. So, if need to do any php
23 // session work in the future, then will need to remove this line.
24 session_write_close();
26 //Remove time limit, since script can take many minutes
27 set_time_limit(0);
29 // Set the "nice" level of the process for these reports. When the "nice" level
30 // is increased, these cpu intensive reports will have less affect on the performance
31 // of other server activities, albeit it may negatively impact the performance
32 // of this report (note this is only applicable for linux).
33 if (!empty($GLOBALS['pat_rem_clin_nice'])) {
34 proc_nice($GLOBALS['pat_rem_clin_nice']);
37 // Start a report, which will be stored in the report_results sql table..
38 if ((!empty($_POST['execute_report_id']) && !empty($_POST['process_type'])) && (($_POST['process_type'] == "process" ) || ($_POST['process_type'] == "process_send"))) {
39 if ($_POST['process_type'] == "process_send") {
40 update_reminders_batch_method('', '', $_POST['execute_report_id'], true);
41 } else { // $_POST['process_type'] == "process"
42 update_reminders_batch_method('', '', $_POST['execute_report_id']);
44 } else {
45 echo "ERROR";