forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clinical_reminders.php
278 lines (254 loc) · 9.87 KB
/
clinical_reminders.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<?php
/**
* clinical reminders gui
*
* @package OpenEMR
* @link http:https://www.open-emr.org
* @author Brady Miller <[email protected]>
* @author Ensofttek, LLC
* @copyright Copyright (c) 2011-2018 Brady Miller <[email protected]>
* @copyright Copyright (c) 2011 Ensofttek, LLC
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
*/
require_once("../../globals.php");
require_once("$srcdir/options.inc.php");
require_once("$srcdir/clinical_rules.php");
use OpenEMR\Core\Header;
?>
<html>
<head>
<?php Header::setupHeader(['common']); ?>
</head>
<?php
$patient_id = ($_GET['patient_id']) ? $_GET['patient_id'] : "";
?>
<body class='body_top'>
<div>
<span class='title'><?php echo xlt('Clinical Reminders'); ?></span>
</div>
<div id='namecontainer_creminders' class='namecontainer_creminders' style='float:left;margin-right:10px'>
<?php echo xlt('for');?>
<span class="title">
<a href="../summary/demographics.php" onclick="top.restoreSession()"><?php echo text(getPatientName($pid)); ?></a>
</span>
</div>
<div>
<a href="../summary/demographics.php" class="css_button" onclick="top.restoreSession()">
<span><?php echo xlt('Back To Patient');?></span>
</a>
</div>
<br>
<br>
<br>
<?php
// collect the pertinent plans and rules
$plans_default = resolve_plans_sql('', '0', true);
$rules_default = resolve_rules_sql('', '0', true, '', $_SESSION['authUser']);
?>
<ul class="tabNav">
<li class='current'><a href='#' onclick='top.restoreSession()'><?php echo xlt('Main'); ?></a></li>
<li><a href='#' onclick='top.restoreSession()'><?php echo xlt('Plans'); ?></a></li>
<li><a href='#' onclick='top.restoreSession()'><?php echo xlt('Admin'); ?></a></li>
</ul>
<div class="tabContainer">
<div class="tab current text" style="height:auto;width:97%;">
<?php
clinical_summary_widget($pid, "reminders-all", '', 'default', $_SESSION['authUser']);
?>
</div>
<div class="tab text" style="height:auto;width:97%;">
<?php
clinical_summary_widget($pid, "reminders-all", '', "plans", $_SESSION['authUser']);
?>
</div>
<div class="tab" style="height:auto;width:97%;">
<div id='report_results'>
<table>
<tr>
<th rowspan="2"><?php echo xlt('Plan'); ?></th>
<th colspan="2"><?php echo xlt('Show'); ?></th>
</tr>
<tr>
<th><?php echo xlt('Patient Setting'); ?></th>
<th style="left-margin:1em;"><?php echo xlt('Practice Default Setting'); ?></th>
</tr>
<?php foreach ($plans_default as $plan) { ?>
<?php
//only show the plan if there are any rules in it that the user has access to
$plan_check = resolve_rules_sql('', '0', true, $plan['id'], $_SESSION['authUser']);
if (empty($plan_check)) {
continue;
}
?>
<tr>
<td style="border-right:1px solid black;"><?php echo generate_display_field(array('data_type'=>'1','list_id'=>'clinical_plans'), $plan['id']); ?></td>
<td align="center">
<?php
$patient_plan = collect_plan($plan['id'], $patient_id);
// Set the patient specific setting for gui
if (empty($patient_plan)) {
$select = "default";
} else {
if ($patient_plan['normal_flag'] == "1") {
$select = "on";
} else if ($patient_plan['normal_flag'] == "0") {
$select = "off";
} else { // $patient_rule['normal_flag'] == NULL
$select = "default";
}
} ?>
<select class="plan_show" name="<?php echo attr($plan['id']); ?>">
<option value="default" <?php echo ($select == "default") ? "selected" : ""; ?>><?php echo xlt('Default'); ?></option>
<option value="on" <?php echo ($select == "on") ? "selected" : ""; ?>><?php echo xlt('On'); ?></option>
<option value="off" <?php echo ($select == "off") ? "selected" : ""; ?>><?php echo xlt('Off'); ?></option>
</select>
</td>
<td align="center" style="border-right:1px solid black;">
<?php
if ($plan['normal_flag'] == "1") {
echo xlt('On');
} else {
echo xlt('Off');
}
?>
</td>
</tr>
<?php } ?>
</table>
<br>
<br>
<table>
<tr>
<th rowspan="2"><?php echo xlt('Rule'); ?></th>
<th colspan="2"><?php echo xlt('Passive Alert'); ?></th>
<th colspan="2"><?php echo xlt('Active Alert'); ?></th>
</tr>
<tr>
<th><?php echo xlt('Patient Setting'); ?></th>
<th style="left-margin:1em;"><?php echo xlt('Practice Default Setting'); ?></th>
<th><?php echo xlt('Patient Setting'); ?></th>
<th style="left-margin:1em;"><?php echo xlt('Practice Default Setting'); ?></th>
</tr>
<?php foreach ($rules_default as $rule) { ?>
<tr>
<td style="border-right:1px solid black;"><?php echo generate_display_field(array('data_type'=>'1','list_id'=>'clinical_rules'), $rule['id']); ?></td>
<td align="center">
<?php
$patient_rule = collect_rule($rule['id'], $patient_id);
// Set the patient specific setting for gui
if (empty($patient_rule)) {
$select = "default";
} else {
if ($patient_rule['passive_alert_flag'] == "1") {
$select = "on";
} else if ($patient_rule['passive_alert_flag'] == "0") {
$select = "off";
} else { // $patient_rule['passive_alert_flag'] == NULL
$select = "default";
}
} ?>
<select class="passive_alert" name="<?php echo attr($rule['id']); ?>">
<option value="default" <?php echo ($select == "default") ? "selected" : ""; ?>><?php echo xlt('Default'); ?></option>
<option value="on" <?php echo ($select == "on") ? "selected" : ""; ?>><?php echo xlt('On'); ?></option>
<option value="off" <?php echo ($select == "off") ? "selected" : ""; ?>><?php echo xlt('Off'); ?></option>
</select>
</td>
<td align="center" style="border-right:1px solid black;">
<?php
if ($rule['passive_alert_flag'] == "1") {
echo xlt('On');
} else {
echo xlt('Off');
}
?>
</td>
<td align="center">
<?php
// Set the patient specific setting for gui
if (empty($patient_rule)) {
$select = "default";
} else {
if ($patient_rule['active_alert_flag'] == "1") {
$select = "on";
} else if ($patient_rule['active_alert_flag'] == "0") {
$select = "off";
} else { // $patient_rule['active_alert_flag'] == NULL
$select = "default";
}
} ?>
<select class="active_alert" name="<?php echo attr($rule['id']); ?>">
<option value="default" <?php echo ($select == "default") ? "selected" : ""; ?>><?php echo xlt('Default'); ?></option>
<option value="on" <?php echo ($select == "on") ? "selected" : ""; ?>><?php echo xlt('On'); ?></option>
<option value="off" <?php echo ($select == "off") ? "selected" : ""; ?>><?php echo xlt('Off'); ?></option>
</select>
</td>
<td align="center">
<?php
if ($rule['active_alert_flag'] == "1") {
echo xlt('On');
} else {
echo xlt('Off');
}
?>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
tabbify();
$(".passive_alert").change(function() {
top.restoreSession();
$.post( "../../../library/ajax/rule_setting.php", {
rule: this.name,
type: 'passive_alert',
setting: this.value,
patient_id: <?php echo js_escape($patient_id); ?>,
csrf_token_form: <?php echo js_escape(collectCsrfToken()); ?>
});
});
$(".active_alert").change(function() {
top.restoreSession();
$.post( "../../../library/ajax/rule_setting.php", {
rule: this.name,
type: 'active_alert',
setting: this.value,
patient_id: <?php echo js_escape($patient_id); ?>,
csrf_token_form: <?php echo js_escape(collectCsrfToken()); ?>
});
});
$(".plan_show").change(function() {
top.restoreSession();
$.post( "../../../library/ajax/plan_setting.php", {
plan: this.name,
type: 'normal',
setting: this.value,
patient_id: <?php echo js_escape($patient_id); ?>,
csrf_token_form: <?php echo js_escape(collectCsrfToken()); ?>
});
});
});
function refreshme() {
top.restoreSession();
location.reload();
}
$(".medium_modal").on('click', function(e) {
e.preventDefault();e.stopPropagation();
dlgopen('', '', 800, 200, '', '', {
buttons: [
{text: <?php echo xlj('Close'); ?>, close: true, style: 'default btn-sm'}
],
onClosed: 'refreshme',
allowResize: true,
allowDrag: true,
dialogId: 'reminders',
type: 'iframe',
url: $(this).attr('href')
});
});
</script>
</body>
</html>