The Third Reminders email bug fix - contributed by arnabnaha
[openemr.git] / interface / patient_file / reminder / clinical_reminders.php
blobe024244d93dc8fccb492b76fc7b30726e4c753c4
1 <?php
2 // Copyright (C) 2011 by following authors:
3 // -Brady Miller <brady@sparmy.com>
4 // -Ensofttek, LLC
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 //SANITIZE ALL ESCAPES
12 $sanitize_all_escapes=true;
14 //STOP FAKE REGISTER GLOBALS
15 $fake_register_globals=false;
17 require_once("../../globals.php");
18 require_once("$srcdir/options.inc.php");
19 require_once("$srcdir/clinical_rules.php");
22 <html>
23 <head>
24 <?php html_header_show();?>
25 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
26 <link rel="stylesheet" type="text/css" href="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
27 <style type="text/css">@import url(../../../library/dynarch_calendar.css);</style>
28 <script type="text/javascript" src="../../../library/dialog.js"></script>
29 <script type="text/javascript" src="../../../library/textformat.js"></script>
30 <script type="text/javascript" src="../../../library/dynarch_calendar.js"></script>
31 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
32 <script type="text/javascript" src="../../../library/dynarch_calendar_setup.js"></script>
33 <script type="text/javascript" src="../../../library/js/jquery.1.3.2.js"></script>
34 <script type="text/javascript" src="../../../library/js/common.js"></script>
35 <script type="text/javascript" src="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
36 </head>
38 <?php
39 $patient_id = ($_GET['patient_id']) ? $_GET['patient_id'] : "";
42 <body class='body_top'>
43 <div>
44 <span class='title'><?php echo htmlspecialchars( xl('Clinical Reminders'), ENT_NOQUOTES); ?></span>
45 </div>
46 <div style='float:left;margin-right:10px'>
47 <?php echo htmlspecialchars( xl('for'), ENT_NOQUOTES);?>&nbsp;
48 <span class="title">
49 <a href="../summary/demographics.php" onclick="top.restoreSession()"><?php echo htmlspecialchars( getPatientName($pid), ENT_NOQUOTES); ?></a>
50 </span>
51 </div>
52 <div>
53 <a href="../summary/demographics.php" <?php if (!$GLOBALS['concurrent_layout']) echo "target='Main'"; ?> class="css_button" onclick="top.restoreSession()">
54 <span><?php echo htmlspecialchars( xl('Back To Patient'), ENT_NOQUOTES);?></span>
55 </a>
56 </div>
58 <br>
59 <br>
60 <br>
62 <?php
63 // collect the pertinent plans and rules
64 $plans_default = resolve_plans_sql('','0',TRUE);
65 $rules_default = resolve_rules_sql('','0',TRUE);
68 <ul class="tabNav">
69 <li class='current'><a href='/play/javascript-tabbed-navigation/' onclick='top.restoreSession()'><?php echo htmlspecialchars( xl('Main'), ENT_NOQUOTES); ?></a></li>
70 <li><a href='/play/javascript-tabbed-navigation/' onclick='top.restoreSession()'><?php echo htmlspecialchars( xl('Plans'), ENT_NOQUOTES); ?></a></li>
71 <li><a href='/play/javascript-tabbed-navigation/' onclick='top.restoreSession()'><?php echo htmlspecialchars( xl('Admin'), ENT_NOQUOTES); ?></a></li>
72 </ul>
74 <div class="tabContainer">
75 <div class="tab current text" style="height:auto;width:97%;">
76 <?php
77 clinical_summary_widget($pid,"reminders-all");
79 </div>
81 <div class="tab text" style="height:auto;width:97%;">
82 <?php
83 clinical_summary_widget($pid,"reminders-all",'',"plans");
85 </div>
87 <div class="tab" style="height:auto;width:97%;">
88 <div id='report_results'>
89 <table>
90 <tr>
91 <th rowspan="2"><?php echo htmlspecialchars( xl('Plan'), ENT_NOQUOTES); ?></th>
92 <th colspan="2"><?php echo htmlspecialchars( xl('Show'), ENT_NOQUOTES); ?></th>
93 </tr>
94 <tr>
95 <th><?php echo htmlspecialchars( xl('Patient Setting'), ENT_NOQUOTES); ?></th>
96 <th style="left-margin:1em;"><?php echo htmlspecialchars( xl('Practice Default Setting'), ENT_NOQUOTES); ?></th>
97 </tr>
98 <?php foreach ($plans_default as $plan) { ?>
99 <tr>
100 <td style="border-right:1px solid black;"><?php echo generate_display_field(array('data_type'=>'1','list_id'=>'clinical_plans'), $plan['id']); ?></td>
101 <td align="center">
102 <?php
103 $patient_plan = collect_plan($plan['id'],$patient_id);
104 // Set the patient specific setting for gui
105 if (empty($patient_plan)) {
106 $select = "default";
108 else {
109 if ($patient_plan['normal_flag'] == "1") {
110 $select = "on";
112 else if ($patient_plan['normal_flag'] == "0"){
113 $select = "off";
115 else { // $patient_rule['normal_flag'] == NULL
116 $select = "default";
118 } ?>
119 <select class="plan_show" name="<?php echo htmlspecialchars( $plan['id'], ENT_NOQUOTES); ?>">
120 <option value="default" <?php if ($select == "default") echo "selected"; ?>><?php echo htmlspecialchars( xl('Default'), ENT_NOQUOTES); ?></option>
121 <option value="on" <?php if ($select == "on") echo "selected"; ?>><?php echo htmlspecialchars( xl('On'), ENT_NOQUOTES); ?></option>
122 <option value="off" <?php if ($select == "off") echo "selected"; ?>><?php echo htmlspecialchars( xl('Off'), ENT_NOQUOTES); ?></option>
123 </select>
124 </td>
125 <td align="center" style="border-right:1px solid black;">
126 <?php if ($plan['normal_flag'] == "1") {
127 echo htmlspecialchars( xl('On'), ENT_NOQUOTES);
129 else {
130 echo htmlspecialchars( xl('Off'), ENT_NOQUOTES);
131 } ?>
132 </td>
133 </tr>
134 <?php } ?>
135 </table>
136 <br>
137 <br>
138 <table>
139 <tr>
140 <th rowspan="2"><?php echo htmlspecialchars( xl('Rule'), ENT_NOQUOTES); ?></th>
141 <th colspan="2"><?php echo htmlspecialchars( xl('Passive Alert'), ENT_NOQUOTES); ?></th>
142 <th colspan="2"><?php echo htmlspecialchars( xl('Active Alert'), ENT_NOQUOTES); ?></th>
143 </tr>
144 <tr>
145 <th><?php echo htmlspecialchars( xl('Patient Setting'), ENT_NOQUOTES); ?></th>
146 <th style="left-margin:1em;"><?php echo htmlspecialchars( xl('Practice Default Setting'), ENT_NOQUOTES); ?></th>
147 <th><?php echo htmlspecialchars( xl('Patient Setting'), ENT_NOQUOTES); ?></th>
148 <th style="left-margin:1em;"><?php echo htmlspecialchars( xl('Practice Default Setting'), ENT_NOQUOTES); ?></th>
149 </tr>
150 <?php foreach ($rules_default as $rule) { ?>
151 <tr>
152 <td style="border-right:1px solid black;"><?php echo generate_display_field(array('data_type'=>'1','list_id'=>'clinical_rules'), $rule['id']); ?></td>
153 <td align="center">
154 <?php
155 $patient_rule = collect_rule($rule['id'],$patient_id);
156 // Set the patient specific setting for gui
157 if (empty($patient_rule)) {
158 $select = "default";
160 else {
161 if ($patient_rule['passive_alert_flag'] == "1") {
162 $select = "on";
164 else if ($patient_rule['passive_alert_flag'] == "0"){
165 $select = "off";
167 else { // $patient_rule['passive_alert_flag'] == NULL
168 $select = "default";
170 } ?>
171 <select class="passive_alert" name="<?php echo htmlspecialchars( $rule['id'], ENT_NOQUOTES); ?>">
172 <option value="default" <?php if ($select == "default") echo "selected"; ?>><?php echo htmlspecialchars( xl('Default'), ENT_NOQUOTES); ?></option>
173 <option value="on" <?php if ($select == "on") echo "selected"; ?>><?php echo htmlspecialchars( xl('On'), ENT_NOQUOTES); ?></option>
174 <option value="off" <?php if ($select == "off") echo "selected"; ?>><?php echo htmlspecialchars( xl('Off'), ENT_NOQUOTES); ?></option>
175 </select>
176 </td>
177 <td align="center" style="border-right:1px solid black;">
178 <?php if ($rule['passive_alert_flag'] == "1") {
179 echo htmlspecialchars( xl('On'), ENT_NOQUOTES);
181 else {
182 echo htmlspecialchars( xl('Off'), ENT_NOQUOTES);
183 } ?>
184 </td>
185 <td align="center">
186 <?php
187 // Set the patient specific setting for gui
188 if (empty($patient_rule)) {
189 $select = "default";
191 else {
192 if ($patient_rule['active_alert_flag'] == "1") {
193 $select = "on";
195 else if ($patient_rule['active_alert_flag'] == "0"){
196 $select = "off";
198 else { // $patient_rule['active_alert_flag'] == NULL
199 $select = "default";
201 } ?>
202 <select class="active_alert" name="<?php echo htmlspecialchars( $rule['id'], ENT_NOQUOTES); ?>">
203 <option value="default" <?php if ($select == "default") echo "selected"; ?>><?php echo htmlspecialchars( xl('Default'), ENT_NOQUOTES); ?></option>
204 <option value="on" <?php if ($select == "on") echo "selected"; ?>><?php echo htmlspecialchars( xl('On'), ENT_NOQUOTES); ?></option>
205 <option value="off" <?php if ($select == "off") echo "selected"; ?>><?php echo htmlspecialchars( xl('Off'), ENT_NOQUOTES); ?></option>
206 </select>
207 </td>
208 <td align="center">
209 <?php if ($rule['active_alert_flag'] == "1") {
210 echo htmlspecialchars( xl('On'), ENT_NOQUOTES);
212 else {
213 echo htmlspecialchars( xl('Off'), ENT_NOQUOTES);
214 } ?>
215 </td>
216 </tr>
217 <?php } ?>
218 </table>
219 </div>
220 </div>
221 </div>
223 <script type="text/javascript">
224 $(document).ready(function() {
226 enable_modals();
228 tabbify();
230 $(".passive_alert").change(function() {
231 top.restoreSession();
232 $.post( "../../../library/ajax/rule_setting.php", {
233 rule: this.name,
234 type: 'passive_alert',
235 setting: this.value,
236 patient_id: '<?php echo htmlspecialchars($patient_id, ENT_QUOTES); ?>'
240 $(".active_alert").change(function() {
241 top.restoreSession();
242 $.post( "../../../library/ajax/rule_setting.php", {
243 rule: this.name,
244 type: 'active_alert',
245 setting: this.value,
246 patient_id: '<?php echo htmlspecialchars($patient_id, ENT_QUOTES); ?>'
250 $(".plan_show").change(function() {
251 top.restoreSession();
252 $.post( "../../../library/ajax/plan_setting.php", {
253 plan: this.name,
254 type: 'normal',
255 setting: this.value,
256 patient_id: '<?php echo htmlspecialchars($patient_id, ENT_QUOTES); ?>'
260 $(".medium_modal").fancybox( {
261 'overlayOpacity' : 0.0,
262 'showCloseButton' : true,
263 'frameHeight' : 500,
264 'frameWidth' : 800,
265 'centerOnScroll' : false,
266 'callbackOnClose' : function() {
267 refreshme();
271 function refreshme() {
272 top.restoreSession();
273 location.reload();
277 </script>
279 </body>
280 </html>