some clean up of unused package includes and associated changes
[openemr.git] / interface / patient_file / reminder / clinical_reminders.php
blob755e123926809b44f6cacd3ba199d2f297691574
1 <?php
2 /**
3 * clinical reminders gui
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Brady Miller <brady.g.miller@gmail.com>
8 * @author Ensofttek, LLC
9 * @copyright Copyright (c) 2011-2017 Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2011 Ensofttek, LLC
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../../globals.php");
16 require_once("$srcdir/options.inc.php");
17 require_once("$srcdir/clinical_rules.php");
20 <html>
21 <head>
22 <?php html_header_show();?>
23 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
24 <link rel="stylesheet" type="text/css" href="../../../library/js/fancybox/jquery.fancybox-1.2.6.css" media="screen" />
25 <script type="text/javascript" src="../../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
26 <script type="text/javascript" src="../../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script>
27 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-7-2/index.js"></script>
28 <script type="text/javascript" src="../../../library/js/common.js?v=<?php echo $v_js_includes; ?>"></script>
29 <script type="text/javascript" src="../../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script>
30 </head>
32 <?php
33 $patient_id = ($_GET['patient_id']) ? $_GET['patient_id'] : "";
36 <body class='body_top'>
37 <div>
38 <span class='title'><?php echo htmlspecialchars( xl('Clinical Reminders'), ENT_NOQUOTES); ?></span>
39 </div>
40 <div id='namecontainer_creminders' class='namecontainer_creminders' style='float:left;margin-right:10px'>
41 <?php echo htmlspecialchars( xl('for'), ENT_NOQUOTES);?>&nbsp;
42 <span class="title">
43 <a href="../summary/demographics.php" onclick="top.restoreSession()"><?php echo htmlspecialchars( getPatientName($pid), ENT_NOQUOTES); ?></a>
44 </span>
45 </div>
46 <div>
47 <a href="../summary/demographics.php" class="css_button" onclick="top.restoreSession()">
48 <span><?php echo htmlspecialchars( xl('Back To Patient'), ENT_NOQUOTES);?></span>
49 </a>
50 </div>
52 <br>
53 <br>
54 <br>
56 <?php
57 // collect the pertinent plans and rules
58 $plans_default = resolve_plans_sql('','0',TRUE);
59 $rules_default = resolve_rules_sql('','0',TRUE,'',$_SESSION['authUser']);
62 <ul class="tabNav">
63 <li class='current'><a href='#' onclick='top.restoreSession()'><?php echo htmlspecialchars( xl('Main'), ENT_NOQUOTES); ?></a></li>
64 <li><a href='#' onclick='top.restoreSession()'><?php echo htmlspecialchars( xl('Plans'), ENT_NOQUOTES); ?></a></li>
65 <li><a href='#' onclick='top.restoreSession()'><?php echo htmlspecialchars( xl('Admin'), ENT_NOQUOTES); ?></a></li>
66 </ul>
68 <div class="tabContainer">
69 <div class="tab current text" style="height:auto;width:97%;">
70 <?php
71 clinical_summary_widget($pid,"reminders-all",'','default',$_SESSION['authUser']);
73 </div>
75 <div class="tab text" style="height:auto;width:97%;">
76 <?php
77 clinical_summary_widget($pid,"reminders-all",'',"plans",$_SESSION['authUser']);
79 </div>
81 <div class="tab" style="height:auto;width:97%;">
82 <div id='report_results'>
83 <table>
84 <tr>
85 <th rowspan="2"><?php echo htmlspecialchars( xl('Plan'), ENT_NOQUOTES); ?></th>
86 <th colspan="2"><?php echo htmlspecialchars( xl('Show'), ENT_NOQUOTES); ?></th>
87 </tr>
88 <tr>
89 <th><?php echo htmlspecialchars( xl('Patient Setting'), ENT_NOQUOTES); ?></th>
90 <th style="left-margin:1em;"><?php echo htmlspecialchars( xl('Practice Default Setting'), ENT_NOQUOTES); ?></th>
91 </tr>
92 <?php foreach ($plans_default as $plan) { ?>
93 <?php
94 //only show the plan if there are any rules in it that the user has access to
95 $plan_check = resolve_rules_sql('','0',TRUE,$plan['id'],$_SESSION['authUser']);
96 if (empty($plan_check)) {
97 continue;
100 <tr>
101 <td style="border-right:1px solid black;"><?php echo generate_display_field(array('data_type'=>'1','list_id'=>'clinical_plans'), $plan['id']); ?></td>
102 <td align="center">
103 <?php
105 $patient_plan = collect_plan($plan['id'],$patient_id);
107 // Set the patient specific setting for gui
108 if (empty($patient_plan)) {
109 $select = "default";
111 else {
112 if ($patient_plan['normal_flag'] == "1") {
113 $select = "on";
115 else if ($patient_plan['normal_flag'] == "0"){
116 $select = "off";
118 else { // $patient_rule['normal_flag'] == NULL
119 $select = "default";
121 } ?>
122 <select class="plan_show" name="<?php echo htmlspecialchars( $plan['id'], ENT_NOQUOTES); ?>">
123 <option value="default" <?php if ($select == "default") echo "selected"; ?>><?php echo htmlspecialchars( xl('Default'), ENT_NOQUOTES); ?></option>
124 <option value="on" <?php if ($select == "on") echo "selected"; ?>><?php echo htmlspecialchars( xl('On'), ENT_NOQUOTES); ?></option>
125 <option value="off" <?php if ($select == "off") echo "selected"; ?>><?php echo htmlspecialchars( xl('Off'), ENT_NOQUOTES); ?></option>
126 </select>
127 </td>
128 <td align="center" style="border-right:1px solid black;">
129 <?php if ($plan['normal_flag'] == "1") {
130 echo htmlspecialchars( xl('On'), ENT_NOQUOTES);
132 else {
133 echo htmlspecialchars( xl('Off'), ENT_NOQUOTES);
134 } ?>
135 </td>
136 </tr>
137 <?php } ?>
138 </table>
139 <br>
140 <br>
141 <table>
142 <tr>
143 <th rowspan="2"><?php echo htmlspecialchars( xl('Rule'), ENT_NOQUOTES); ?></th>
144 <th colspan="2"><?php echo htmlspecialchars( xl('Passive Alert'), ENT_NOQUOTES); ?></th>
145 <th colspan="2"><?php echo htmlspecialchars( xl('Active Alert'), ENT_NOQUOTES); ?></th>
146 </tr>
147 <tr>
148 <th><?php echo htmlspecialchars( xl('Patient Setting'), ENT_NOQUOTES); ?></th>
149 <th style="left-margin:1em;"><?php echo htmlspecialchars( xl('Practice Default Setting'), ENT_NOQUOTES); ?></th>
150 <th><?php echo htmlspecialchars( xl('Patient Setting'), ENT_NOQUOTES); ?></th>
151 <th style="left-margin:1em;"><?php echo htmlspecialchars( xl('Practice Default Setting'), ENT_NOQUOTES); ?></th>
152 </tr>
153 <?php foreach ($rules_default as $rule) { ?>
154 <tr>
155 <td style="border-right:1px solid black;"><?php echo generate_display_field(array('data_type'=>'1','list_id'=>'clinical_rules'), $rule['id']); ?></td>
156 <td align="center">
157 <?php
158 $patient_rule = collect_rule($rule['id'],$patient_id);
159 // Set the patient specific setting for gui
160 if (empty($patient_rule)) {
161 $select = "default";
163 else {
164 if ($patient_rule['passive_alert_flag'] == "1") {
165 $select = "on";
167 else if ($patient_rule['passive_alert_flag'] == "0"){
168 $select = "off";
170 else { // $patient_rule['passive_alert_flag'] == NULL
171 $select = "default";
173 } ?>
174 <select class="passive_alert" name="<?php echo htmlspecialchars( $rule['id'], ENT_NOQUOTES); ?>">
175 <option value="default" <?php if ($select == "default") echo "selected"; ?>><?php echo htmlspecialchars( xl('Default'), ENT_NOQUOTES); ?></option>
176 <option value="on" <?php if ($select == "on") echo "selected"; ?>><?php echo htmlspecialchars( xl('On'), ENT_NOQUOTES); ?></option>
177 <option value="off" <?php if ($select == "off") echo "selected"; ?>><?php echo htmlspecialchars( xl('Off'), ENT_NOQUOTES); ?></option>
178 </select>
179 </td>
180 <td align="center" style="border-right:1px solid black;">
181 <?php if ($rule['passive_alert_flag'] == "1") {
182 echo htmlspecialchars( xl('On'), ENT_NOQUOTES);
184 else {
185 echo htmlspecialchars( xl('Off'), ENT_NOQUOTES);
186 } ?>
187 </td>
188 <td align="center">
189 <?php
190 // Set the patient specific setting for gui
191 if (empty($patient_rule)) {
192 $select = "default";
194 else {
195 if ($patient_rule['active_alert_flag'] == "1") {
196 $select = "on";
198 else if ($patient_rule['active_alert_flag'] == "0"){
199 $select = "off";
201 else { // $patient_rule['active_alert_flag'] == NULL
202 $select = "default";
204 } ?>
205 <select class="active_alert" name="<?php echo htmlspecialchars( $rule['id'], ENT_NOQUOTES); ?>">
206 <option value="default" <?php if ($select == "default") echo "selected"; ?>><?php echo htmlspecialchars( xl('Default'), ENT_NOQUOTES); ?></option>
207 <option value="on" <?php if ($select == "on") echo "selected"; ?>><?php echo htmlspecialchars( xl('On'), ENT_NOQUOTES); ?></option>
208 <option value="off" <?php if ($select == "off") echo "selected"; ?>><?php echo htmlspecialchars( xl('Off'), ENT_NOQUOTES); ?></option>
209 </select>
210 </td>
211 <td align="center">
212 <?php if ($rule['active_alert_flag'] == "1") {
213 echo htmlspecialchars( xl('On'), ENT_NOQUOTES);
215 else {
216 echo htmlspecialchars( xl('Off'), ENT_NOQUOTES);
217 } ?>
218 </td>
219 </tr>
220 <?php } ?>
221 </table>
222 </div>
223 </div>
224 </div>
226 <script type="text/javascript">
227 $(document).ready(function() {
229 enable_modals();
231 tabbify();
233 $(".passive_alert").change(function() {
234 top.restoreSession();
235 $.post( "../../../library/ajax/rule_setting.php", {
236 rule: this.name,
237 type: 'passive_alert',
238 setting: this.value,
239 patient_id: '<?php echo htmlspecialchars($patient_id, ENT_QUOTES); ?>'
243 $(".active_alert").change(function() {
244 top.restoreSession();
245 $.post( "../../../library/ajax/rule_setting.php", {
246 rule: this.name,
247 type: 'active_alert',
248 setting: this.value,
249 patient_id: '<?php echo htmlspecialchars($patient_id, ENT_QUOTES); ?>'
253 $(".plan_show").change(function() {
254 top.restoreSession();
255 $.post( "../../../library/ajax/plan_setting.php", {
256 plan: this.name,
257 type: 'normal',
258 setting: this.value,
259 patient_id: '<?php echo htmlspecialchars($patient_id, ENT_QUOTES); ?>'
263 $(".medium_modal").fancybox( {
264 'overlayOpacity' : 0.0,
265 'showCloseButton' : true,
266 'frameHeight' : 500,
267 'frameWidth' : 800,
268 'centerOnScroll' : false,
269 'callbackOnClose' : function() {
270 refreshme();
274 function refreshme() {
275 top.restoreSession();
276 location.reload();
280 </script>
282 </body>
283 </html>