Fully responsive globals.php with vertical menu (#2460)
[openemr.git] / interface / main / left_nav.php
blobafd50879d346b312eb7a7ef9e474b3f1715314cb
1 <?php
2 /**
3 * left_nav.php
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Rod Roark <rod@sunsetsystems.com>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2006-2012 Rod Roark <rod@sunsetsystems.com>
10 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
14 // This provides the left navigation frame.
15 // Following are notes as to what else was changed for this feature:
17 // * interface/main/main_screen.php: the top-level frameset.
18 // * interface/main/finder/patient_select.php: loads stuff when a new patient
19 // is selected.
20 // * interface/patient_file/summary/demographics.php: this is the first frame
21 // loaded when a new patient is chosen, and in turn sets the current pid and
22 // then loads the initial bottom frame.
23 // * interface/patient_file/summary/demographics_full.php: added support for
24 // setting a new pid, needed for going to demographics from billing.
25 // * interface/patient_file/summary/demographics_save.php: redisplay
26 // demographics.php and not the frameset.
27 // * interface/patient_file/encounter/encounter_bottom.php: new frameset for
28 // the selected encounter, mosting coding/billing stuff, cloned from
29 // patient_encounter.php. This will also self-load the superbill pages
30 // as requested.
31 // * interface/usergroup/user_info.php: removed Back link.
32 // * interface/main/onotes/office_comments.php: removed Back link target.
33 // * interface/main/onotes/office_comments_full.php: changed Back link.
34 // * interface/billing/billing_report.php: removed Back link; added logic
35 // to properly go to demographics or to an encounter when requested.
36 // * interface/new/new.php: removed Back link and revised form target.
37 // * interface/new/new_patient_save.php: modified to load the demographics
38 // page to the current frame instead of loading a new frameset.
39 // * interface/patient_file/history/history.php: target change.
40 // * interface/patient_file/history/history_full.php: target changes.
41 // * interface/patient_file/history/history_save.php: target change.
42 // * interface/patient_file/history/encounters.php: link/target changes.
43 // * interface/patient_file/encounter/encounter_top.php: another new frameset
44 // cloned from patient_encounter.php.
45 // * interface/patient_file/encounter/forms.php: link target removal.
46 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
47 // changes.
48 // * interface/patient_file/summary/immunizations.php: removed back link.
49 // * interface/patient_file/summary/pnotes.php: changed link targets.
50 // * interface/patient_file/summary/pnotes_full.php: changed back link and
51 // added set_pid logic.
52 // * interface/patient_file/transaction/transactions.php: various changes.
53 // * interface/patient_file/transaction/add_transaction.php: new return js.
54 // * interface/patient_file/encounter/superbill_codes.php: target and link
55 // changes.
56 // * interface/patient_file/encounter/superbill_custom_full.php: target and
57 // link changes.
58 // * interface/patient_file/encounter/diagnosis.php: target changes.
59 // * interface/patient_file/encounter/diagnosis_full.php: target and link
60 // changes.
61 // * interface/main/authorizations/authorizations.php: link and target changes.
62 // * library/api.inc: url change.
63 // * interface/patient_file/summary/rx_frameset.php: new frameset.
64 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
65 // * all encounter forms: remove all instances of "target=Main" and change
66 // all instances of "patient_encounter.php" to "encounter_top.php".
68 // Our find_patient form, when submitted, invokes patient_select.php in the
69 // upper frame. When the patient is selected, demographics.php is invoked
70 // with the set_pid parameter, which establishes the new session pid and also
71 // calls the setPatient() function (below). In this case demographics.php
72 // will also load the summary frameset into the bottom frame, invoking our
73 // loadFrame() function.
75 // Similarly, we have the concept of selecting an encounter from the
76 // Encounters list, and then having that "stick" until some other encounter
77 // or a new encounter is chosen. We also have a navigation item for creating
78 // a new encounter. interface/patient_file/encounter/encounter_top.php
79 // supports set_encounter to establish an encounter.
81 // TBD: Include active_pid and/or active_encounter in relevant submitted
82 // form data, and add logic to the save routines to make sure they match
83 // the corresponding session values.
86 require_once("../globals.php");
87 require_once($GLOBALS['fileroot']."/library/acl.inc");
88 require_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
89 require_once($GLOBALS['fileroot']."/library/patient.inc");
90 require_once($GLOBALS['fileroot']."/library/lists.inc");
91 require_once($GLOBALS['fileroot']."/library/registry.inc");
92 require_once $GLOBALS['srcdir'].'/ESign/Api.php';
93 require_once $GLOBALS['srcdir'].'/user.inc';
95 use ESign\Api;
97 // Fetch user preferences saved from prior session
98 $uspfx = substr(__FILE__, strlen($GLOBALS['fileroot']."/")) . '.';
99 $cb_top_chk = prevSetting($uspfx, 'cb_top', 'frame0_chk', 'checked');
100 $cb_bot_chk = prevSetting($uspfx, 'cb_bot', 'frame1_chk', 'checked');
101 $usrval = json_encode(array ( $cb_top_chk, $cb_bot_chk ));
103 // This array defines the list of primary documents that may be
104 // chosen. Each element value is an array of 3 values:
106 // * Name to appear in the navigation table
107 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific, 3 = therapy group-specific, 4 = therapy group encounter - specific
108 // * The URL relative to the interface directory
111 $primary_docs = array(
112 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
113 'pfb' => array(xl('Patient Flow Board') , 0, '../interface/patient_tracker/patient_tracker.php?skip_timeout_reset=1'),
114 'rcb' => array(xl('Recall Board') , 0, '../interface/main/messages/messages.php?go=Recalls'),
115 'app' => array(xl('Portal Activity') , 0, '../myportal/index.php'),
116 'aop' => array(xl('Portal Dashboard') , 0, '../portal/patient/provider'),
117 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php?form_active=1'),
118 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
119 'mfa' => array(xl('MFA Management'), 0, 'usergroup/mfa_registrations.php'),
120 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
121 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
122 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
123 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
124 'orl' => array(xl('Proc Prov') , 0, 'orders/procedure_provider_list.php'),
125 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
126 'orc' => array(xl('Proc Load') , 0, 'orders/load_compendium.php'),
127 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
128 'ore' => array(xl('E-Reports') , 0, 'orders/list_reports.php'),
129 'ppo' => array(xl('CMS Portal'), 0, 'cmsportal/list_requests.php'),
130 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
131 'imp' => array(xl('Import') , 0, '../custom/import.php'),
132 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
133 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
134 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
135 'new' => array(xl('New Pt') , 0, 'new/new.php'),
136 'ped' => array(xl('Patient Education'), 0, 'reports/patient_edu_web_lookup.php'),
137 'lab' => array(xl('Check Lab Results') , 0, 'orders/lab_exchange.php'),
138 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
139 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
140 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
141 'nen' => array(xl('Create Visit'), 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
142 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
143 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
144 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
145 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
146 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
147 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
148 'lda' => array(xl('Lab overview') , 1, 'patient_file/summary/labdata.php'),
149 'tan' => array(xl('Configure Tracks') , 0, 'forms/track_anything/create.php'),
150 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
151 'prq' => array(xl('Pt Rec Request') , 1, 'patient_file/transaction/record_request.php'),
152 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
153 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
154 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
155 'erx' => array(xl('e-Rx') , 1, 'eRx.php'),
156 'err' => array(xl('e-Rx Renewal') , 1, 'eRx.php?page=status'),
157 'ere' => array(xl('e-Rx EPCS') , 1, 'eRx.php?page=epcs-admin'),
158 'pay' => array(xl('Payment') , 1, '../patient_file/front_payment.php'),
159 'edi' => array(xl('EDI History') , 0, 'billing/edih_view.php'),
160 'eob' => array(xl('Posting') , 0, 'billing/sl_eob_search.php'),
161 'dld' => array(xl('Display Documents'), 0, 'main/display_documents.php')
163 $disallowed = array();
166 $primary_docs['npa']=array(xl('Batch Payments') , 0, 'billing/new_payment.php');
167 if ($GLOBALS['use_charges_panel'] || $GLOBALS['menu_styling_vertical'] == 0) {
168 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
171 if ($GLOBALS['enable_group_therapy']) {
172 $disallowed['gng'] = !acl_check("groups", "gadd");
173 $disallowed['gdg'] = !acl_check("groups", "gadd");
174 $disallowed['gcv'] = !acl_check("groups", "gcalendar");
175 $disallowed['gce'] = !acl_check("groups", "glog");
176 $disallowed['gvh'] = !acl_check("groups", "glog");
178 $primary_docs['gng'] = array(xl('New') , 0, 'therapy_groups/index.php?method=addGroup');
179 $primary_docs['gdg'] = array(xl('Group Details') , 3, '/therapy_groups/index.php?method=groupDetails&group_id=from_session');
180 $primary_docs['gcv'] = array(xl('Create Visit'), 3, 'forms/newGroupEncounter/new.php?autoloaded=1&calenc=');
181 $primary_docs['gce'] = array(xl('Current') , 4, 'patient_file/encounter/encounter_top.php');
182 $primary_docs['gvh'] = array(xl('Visit History'), 3, 'patient_file/history/encounters.php');
186 $esignApi = new Api();
187 // This section decides which navigation items will not appear.
190 $disallowed['edi'] = !($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob'));
191 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
192 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
193 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
194 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
195 acl_check('admin', 'superbill') || acl_check('admin', 'drugs'));
197 $disallowed['bil'] = !(acl_check('acct', 'eob') || acl_check('acct', 'bill'));
199 $disallowed['new'] = !(acl_check('patients', 'demo', '', array('write','addonly')));
201 $disallowed['fax'] = !(($GLOBALS['enable_hylafax'] || $GLOBALS['enable_scanner']) && acl_check('patients', 'docs'));
203 $disallowed['iss'] = !((acl_check('encounters', 'notes', '', 'write') ||
204 acl_check('encounters', 'notes_a', '', 'write') ) &&
205 acl_check('patients', 'med', '', 'write') );
207 $disallowed['imp'] = $disallowed['new'] || !is_readable("$webserver_root/custom/import.php");
209 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
211 $disallowed['pre'] = !(acl_check('patients', 'med'));
212 $disallowed['eob'] = !(acl_check('acct', 'eob'));
214 // Helper functions for treeview generation.
215 function genTreeLink($frame, $name, $title, $mono = false)
217 global $primary_docs, $disallowed;
218 if (empty($disallowed[$name])) {
219 $id = $name . $primary_docs[$name][1];
220 echo "<li><a href='' id='" . attr($id) . "' onclick=\"";
221 if ($mono) {
222 if ($frame == 'RTop') {
223 echo "forceSpec(true,false);";
224 } else {
225 echo "forceSpec(false,true);";
229 echo "return loadFrame2(" . attr_js($id) . "," . attr_js($frame) . "," .
230 attr_js($primary_docs[$name][2]) . ")\">" . text($title) . ($name == 'msg' ? ' <span id="reminderCountSpan" class="bold"></span>' : '')."</a></li>";
234 function genMiscLink($frame, $name, $level, $title, $url, $mono = false, $encform = false)
236 global $disallowed;
237 if (empty($disallowed[$name])) {
238 $id = $name . $level;
239 echo "<li><a href='' id='" . attr($id) . "' onclick=\"";
240 if ($mono) {
241 if ($frame == 'RTop') {
242 echo "forceSpec(true,false);";
243 } else {
244 echo "forceSpec(false,true);";
247 if ($encform) {
248 // In this case $url is an encounter form name, not a URL.
249 echo "loadNewForm(" . attr_js(trim($url)) . ", " . attr_js(trim($title)) . ");";
250 } else {
251 echo "loadFrame2(" . attr_js($id) . "," . attr_js($frame) . "," . attr_js($url) . ");";
253 echo "return false;\">" . text($title) . "</a></li>";
257 function genMiscLink2($frame, $name, $level, $title, $url, $mono = false, $mouseovertext = "")
259 global $disallowed;
260 if (empty($disallowed[$name])) {
261 $id = $name . $level;
262 echo "<li><a href='' id='" . attr($id) . "' title='" . attr($mouseovertext) . "' onclick=\"";
263 if ($mono) {
264 if ($frame == 'RTop') {
265 echo "forceSpec(true,false);";
266 } else {
267 echo "forceSpec(false,true);";
271 echo "return loadFrame3(" . attr_js($id) . "," . attr_js($frame) . "," .
272 attr_js($url) . ")\">" . text($title) . "</a></li>";
275 function genPopLink($title, $url, $linkid = '')
277 echo "<li><a href='' ";
278 if ($linkid) {
279 echo "id='" . attr($linkid) . "' ";
282 echo "onclick=\"return repPopup(" . attr_js($url) . ")\"" .
283 ">" . text($title) . "</a></li>";
285 function genDualLink($topname, $botname, $title)
287 global $primary_docs, $disallowed;
288 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
289 $topid = $topname . $primary_docs[$topname][1];
290 $botid = $botname . $primary_docs[$botname][1];
291 echo "<li><a href='' id='" . attr($topid) . "' " .
292 "onclick=\"return loadFrameDual(" . attr_js($topid) . "," . attr_js($botid) . "," .
293 attr_js($primary_docs[$topname][2]) . "," .
294 attr_js($primary_docs[$botname][2]) . ")\">" . text($title) . "</a></li>";
298 function genPopupsList($style = '')
300 global $disallowed, $webserver_root;
302 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
303 <option value=''><?php echo xla('Popups'); ?></option>
304 <?php if (!$disallowed['iss']) { ?>
305 <option value='../patient_file/problem_encounter.php'><?php echo xlt('Issues'); ?></option>
306 <?php } ?>
307 <?php if (!$GLOBALS['ippf_specific'] && acl_check('patients', 'demo')) { ?>
308 <option value='../../custom/export_xml.php'><?php echo xlt('Export'); ?></option>
309 <?php if (acl_check('patients', 'demo', '', 'write')) { ?>
310 <option value='../../custom/import_xml.php'><?php echo xlt('Import'); ?></option>
311 <?php }
314 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) { ?>
315 <option value='../reports/appointments_report.php?patient=<?php if (isset($pid)) {
316 echo attr_url($pid);
317 } ?>'><?php echo xlt('Appts'); ?></option>
318 <?php } ?>
319 <?php if (acl_check('patients', 'med')) { ?>
320 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php echo xlt('Superbill'); ?></option>
321 <?php } ?>
322 <?php if (acl_check('acct', 'bill', '', 'write')) { ?>
323 <option value='../patient_file/front_payment.php'><?php echo xlt('Payment'); ?></option>
324 <?php } ?>
325 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('acct', 'bill', '', 'write')) { ?>
326 <option value='../patient_file/pos_checkout.php'><?php echo xlt('Checkout'); ?></option>
327 <?php } ?>
328 <?php if (is_dir($GLOBALS['OE_SITE_DIR'] . "/documents/letter_templates") && acl_check('patients', 'med')) { ?>
329 <option value='../patient_file/letter.php'><?php echo xlt('Letter'); ?></option>
330 <?php } ?>
331 <?php if ($GLOBALS['chart_label_type'] != '0' && acl_check('patients', 'demo')) { ?>
332 <option value='../patient_file/label.php'><?php echo xlt('Chart Label'); ?></option>
333 <?php } ?>
334 <?php if ($GLOBALS['barcode_label_type'] != '0' && acl_check('patients', 'demo')) { ?>
335 <option value='../patient_file/barcode_label.php'><?php echo xlt('Barcode Label'); ?></option>
336 <?php } ?>
337 <?php if ($GLOBALS['addr_label_type'] && acl_check('patients', 'demo')) { ?>
338 <option value='../patient_file/addr_label.php'><?php echo xlt('Address Label'); ?></option>
339 <?php } ?>
340 </select>
341 <?php
344 function genFindBlock()
347 <table cellpadding='0' cellspacing='0' border='0'>
348 <tr>
349 <td class='smalltext'><?php echo xlt('Find') ?>:&nbsp;</td>
350 <td class='smalltext' colspan='2'>
351 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
352 </td>
353 </tr>
354 <tr>
355 <td class='smalltext'><?php echo xlt('by') ?>:</td>
356 <td class='smalltext'>
357 <a href="javascript:findPatient('Last');" class="navitem"><?php echo xlt('Name'); ?></a>
358 </td>
359 <td class='smalltext' align='right'>
360 <a href="javascript:findPatient('ID');" class="navitem"><?php echo xlt('ID'); ?></a>
361 </td>
362 </tr>
363 <tr>
364 <td class='smalltext'>&nbsp;</td>
365 <td class='smalltext'>
366 <a href="javascript:findPatient('SSN');" class="navitem"><?php echo xlt('SSN'); ?></a>
367 </td>
368 <td class='smalltext' align='right'>
369 <a href="javascript:findPatient('DOB');" class="navitem"><?php echo xlt('DOB'); ?></a>
370 </td>
371 </tr>
372 <tr>
373 <td class='smalltext'>&nbsp;</td>
374 <td class='smalltext'>
375 <a href="javascript:findPatient('Any');" class="navitem"><?php echo xlt('Any'); ?></a>
376 </td>
377 <td class='smalltext' align='right'>
378 <a href="javascript:initFilter();" class="navitem"><?php echo xlt('Filter'); ?></a>
379 </td>
380 </tr>
381 </table>
382 <?php
383 } // End function genFindBlock()
385 <!DOCTYPE html>
386 <html>
387 <head>
388 <title>Navigation</title>
389 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative']; ?>/bootstrap/dist/css/bootstrap.min.css">
390 <?php if ($_SESSION['language_direction'] == 'rtl') { ?>
391 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative'] ?>/bootstrap-rtl/dist/css/bootstrap-rtl.min.css">
392 <?php } ?>
393 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
394 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative'];?>/font-awesome/css/font-awesome.css" type="text/css">
395 <style type="text/css">
396 html {
397 font-size: 1em;
399 body {
400 font-size:8pt;
401 font-weight:normal;
402 padding: 5px 3px 5px 3px;
404 .smalltext {
405 font-family:sans-serif;
406 font-size:8pt;
407 font-weight:normal;
409 a.navitem, a.navitem:visited {
410 color:#0000ff;
411 font-family:sans-serif;
412 font-size:8pt;
413 font-weight:bold;
415 .inputtext {
416 font-size:9pt;
417 font-weight:normal;
418 border-style:solid;
419 border-width:1px;
420 padding-left:2px;
421 padding-right:2px;
422 border-color: #000000;
423 background-color:transparent;
426 #navigation ul {
427 background-color:transparent;
429 #navigation-slide ul {
430 background-color:transparent;
432 #navigation-slide a{
433 width: 92%;
435 .nav-menu-img{
436 width:25px;
437 height:25px;
438 border:none;
439 margin-right:5px;
440 vertical-align:middle;
442 </style>
443 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.4.1/jquery.treeview.css" />
444 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-1-9-1/jquery.min.js"></script>
445 <script src="<?php echo $GLOBALS['assets_static_relative']; ?>/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
446 <script type="text/javascript" src="../../library/js/jquery.treeview-1.4.1/jquery.treeview.js" ></script>
448 <script type="text/javascript" src="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
450 <script language='JavaScript'>
451 // User settings
452 var usrval = jQuery.parseJSON('<?php echo $usrval ?>');
454 // tajemo work by CB 2012/01/31 12:32:57 PM dated reminders counter
455 function getReminderCount(){
456 top.restoreSession();
457 // Send the skip_timeout_reset parameter to not count this as a manual entry in the
458 // timing out mechanism in OpenEMR.
459 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/dated_reminders_counter.php",
461 skip_timeout_reset: "1",
462 csrf_token_form: "<?php echo attr(collectCsrfToken()); ?>"
464 function(data) {
465 $("#reminderCountSpan").html(data);
466 // run updater every 60 seconds
467 var repeater = setTimeout("getReminderCount()", 60000);
469 //piggy-back on this repeater to run other background-services
470 //this is a silent task manager that returns no output
471 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/execute_background_services.php",
473 skip_timeout_reset: "1",
474 ajax: "1",
475 csrf_token_form: "<?php echo attr(collectCsrfToken()); ?>"
479 $(function (){
480 getReminderCount();//
481 parent.loadedFrameCount += 1;
482 for (var i = 0, len = usrval.length; i < len; i++) {
483 if (usrval[i] != "checked") toggleFrame(i+1);
486 // end of tajemo work dated reminders counter
488 // Master values for current pid and encounter.
489 var active_pid = 0;
490 var active_encounter = 0;
491 var encounter_locked = false;
492 //therapy group id
493 var active_gid = 0;
495 // Current selections in the top and bottom frames.
496 var topName = '';
497 var botName = '';
499 // Expand and/or collapse frames in response to checkbox clicks.
500 // fnum indicates which checkbox was clicked (1=left, 2=right).
501 function toggleFrame(fnum) {
502 var f = document.forms[0];
503 var fset = top.document.getElementById('fsright');
504 if (!f.cb_top.checked && !f.cb_bot.checked) {
505 if (fnum == 1) f.cb_bot.checked = true;
506 else f.cb_top.checked = true;
508 var rows = f.cb_top.checked ? '*' : '0';
509 rows += f.cb_bot.checked ? ',*' : ',0';
510 fset.rows = rows;
511 save_setting ([(f.cb_top.checked ? 'checked' : '&nbsp;'), (f.cb_bot.checked ? 'checked' : '&nbsp;')]);
514 // Load the specified url into the specified frame (RTop or RBot).
515 // The URL provided must be relative to interface.
516 function loadFrame(fname, frame, url) {
517 top.restoreSession();
518 var i = url.indexOf('{PID}');
519 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
520 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
521 if (frame == 'RTop') topName = fname; else botName = fname;
524 // Load the specified url into a frame to be determined, with the specified
525 // frame as the default; the url must be relative to interface.
526 function loadFrame2(fname, frame, url) {
527 var usage = fname.substring(3);
528 if (active_pid == 0 && active_gid == 0 && (usage > '0' && usage < '5')){
529 <?php if ($GLOBALS['enable_group_therapy']) { ?>
530 alert(<?php echo xlj('You must first select or add a patient or therapy group.'); ?>);
531 <?php } else { ?>
532 alert(<?php echo xlj('You must first select or add a patient.'); ?>);
533 <?php } ?>
534 return false;
536 if (active_encounter == 0 && (usage > '1' && usage < '3')) {
537 alert(<?php echo xlj('You must first select or create an encounter.'); ?>);
538 return false;
540 if (encounter_locked && usage > '1' && (usage > '1' && usage < '3')) {
541 alert(<?php echo xlj('This encounter is locked. No new forms can be added.'); ?>);
542 return false;
544 var f = document.forms[0];
545 top.restoreSession();
546 var i = url.indexOf('{PID}');
547 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
548 if(f.sel_frame)
550 var fi = f.sel_frame.selectedIndex;
551 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
553 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
554 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
555 if (frame == 'RTop') topName = fname; else botName = fname;
556 return false;
559 function loadFrame3(fname, frame, url) {
560 var f = document.forms[0];
561 top.restoreSession();
562 var i = url.indexOf('{PID}');
563 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
564 if(f.sel_frame)
566 var fi = f.sel_frame.selectedIndex;
567 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
569 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
570 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
571 if (frame == 'RTop') topName = fname; else botName = fname;
572 return false;
575 // Special handling to load a new encounter form into an existing encounter.
576 function loadNewForm(formname, formdesc) {
577 var url = '<?php echo "$rootdir/patient_file/encounter/load_form.php?formname=" ?>' + encodeURIComponent(formname);
578 if (parent.RBot.twAddFrameTab) {
579 parent.RBot.twAddFrameTab('enctabs', formdesc, url);
581 else if (parent.RTop.twAddFrameTab) {
582 parent.RTop.twAddFrameTab('enctabs', formdesc, url);
584 else {
585 loadFrame2('enc2','RBot','patient_file/encounter/encounter_top.php' +
586 '?formname=' + encodeURIComponent(formname) + '&formdesc=' + encodeURIComponent(formdesc));
590 // Make sure the the top and bottom frames are open or closed, as specified.
591 function forceSpec(istop, isbot) {
592 var f = document.forms[0];
593 if (f.cb_top.checked != istop) {
594 f.cb_top.checked = istop;
595 toggleFrame(1);
597 if (f.cb_bot.checked != isbot) {
598 f.cb_bot.checked = isbot;
599 toggleFrame(2);
603 // Make sure both frames are open.
604 function forceDual() {
605 forceSpec(true, true);
608 // Load the specified url into a frame to be determined, with the specified
609 // frame as the default; the url must be relative to interface.
610 function loadFrameDual(tname, bname, topurl, boturl) {
611 var topusage = tname.substring(3);
612 var botusage = bname.substring(3);
613 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
614 alert(<?php echo xlj('You must first select or add a patient.'); ?>);
615 return false;
617 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
618 alert(<?php echo xlj('You must first select or create an encounter.'); ?>);
619 return false;
621 if (encounter_locked && (topusage > '1' || botusage > '1')) {
622 alert(<?php echo xlj('This encounter is locked. No new forms can be added.'); ?>);
623 return false;
625 var f = document.forms[0];
626 forceDual();
627 top.restoreSession();
628 var i = topurl.indexOf('{PID}');
629 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
630 i = boturl.indexOf('{PID}');
631 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
632 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
633 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
634 topName = tname;
635 botName = bname;
636 return false;
639 // Set disabled/enabled state of radio buttons and associated labels
640 // depending on whether there is an active patient or encounter.
641 function syncRadios() {
642 var f = document.forms[0];
643 encounter_locked = isEncounterLocked(active_encounter);
644 var nlinks = document.links.length;
645 for (var i = 0; i < nlinks; ++i) {
646 var lnk = document.links[i];
647 if (lnk.id.length != 4) continue;
648 var usage = lnk.id.substring(3);
649 if (usage == '1' || usage == '2') {
650 var da = false;
651 if (active_pid == 0) da = true;
652 if (active_encounter == 0 && usage > '1') da = true;
653 if (encounter_locked && usage > '1') da = true;
654 <?php
655 if ($GLOBALS['menu_styling_vertical'] == 0) {
656 $color = "'#0000ff'";
657 } else { // ($GLOBALS['menu_styling_vertical'] == 1)
658 $color = "'#000000'";
661 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
663 //for therapy groups menu
664 <?php if ($GLOBALS['enable_group_therapy']) { ?>
665 if (usage == '3' || usage == '4') {
666 var da = false;
667 if (active_gid == 0) da = true;
668 if (active_encounter == 0 && usage > '3') da = true;
669 if (encounter_locked && usage > '3') da = true;
670 <?php
671 if ($GLOBALS['menu_styling_vertical'] == 0) {
672 $color = "'#0000ff'";
673 } else { // ($GLOBALS['menu_styling_vertical'] == 1)
674 $color = "'#000000'";
677 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
679 <?php } ?>
682 f.popups.disabled = (active_pid == 0);
685 function goHome() {
686 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
687 top.frames['RBot'].location='messages/messages.php?form_active=1';
690 //Function to clear active patient and encounter in the server side
691 function clearactive() {
692 top.restoreSession();
693 //Ajax call to clear active patient in session
694 var method = (active_pid > 0) ? 'unset_pid' : 'unset_gid';
695 $.ajax({
696 type: "POST",
697 url: "<?php echo $GLOBALS['webroot'] ?>/library/ajax/unset_session_ajax.php",
698 data:
700 func: method,
701 csrf_token_form: "<?php echo attr(collectCsrfToken()); ?>"
704 success:function( msg ) {
705 clearPatient();
706 clearTherapyGroup();
707 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
708 top.frames['RBot'].location='messages/messages.php?form_active=1';
712 $(parent.Title.document.getElementById('clear_active')).hide();
713 $(parent.Title.document.getElementById('clear_active_group')).hide();
715 // Reference to the search.php window.
716 var my_window;
718 // Open the search.php window.
719 function initFilter() {
720 my_window = window.open("../../custom/search.php", "mywindow","status=1");
723 // This is called by the search.php (Filter) window.
724 function processFilter(fieldString, serviceCode) {
725 var f = document.forms[0];
726 document.getElementById('searchFields').value = fieldString;
727 f.search_service_code.value = serviceCode;
728 findPatient("Filter");
729 f.search_service_code.value = '';
730 my_window.close();
733 // Process the click to find a patient by name, id, ssn or dob.
734 function findPatient(findby) {
735 var f = document.forms[0];
736 if (! f.cb_top.checked) {
737 f.cb_top.checked = true;
738 toggleFrame(1);
740 f.findBy.value = findby;
741 top.restoreSession();
742 document.find_patient.submit();
745 // Helper function to set the contents of a div.
746 function setSomeContent(id, content, doc) {
747 if (doc.getElementById) {
748 var x = doc.getElementById(id);
749 x.innerHTML = '';
750 x.innerHTML = content;
752 else if (doc.all) {
753 var x = doc.all[id];
754 x.innerHTML = content;
757 function setDivContent(id, content) {
758 setSomeContent(id, content, document);
760 function setTitleContent(id, content) {
761 setSomeContent(id, content, parent.Title.document);
764 // This is called automatically when a new patient is set, to make sure
765 // there are no patient-specific documents showing stale data. If a frame
766 // was just loaded with data for the correct patient, its name is passed so
767 // that it will not be zapped. At this point the new server-side pid is not
768 // assumed to be set, so this function will only load global data.
769 function reloadPatient(frname) {
770 var f = document.forms[0];
771 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
772 loadFrame('cal0','RTop', '<?php echo attr($primary_docs['cal'][2]); ?>');
774 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
775 loadFrame('ens0','RBot', '<?php echo attr($primary_docs['ens'][2]); ?>');
779 // Reload encounter-specific frames, excluding a specified frame. At this
780 // point the new server-side encounter ID may not be set and loading the same
781 // document for the new encounter will not work, so load patient info instead.
782 function reloadEncounter(frname) {
783 var f = document.forms[0];
784 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
785 loadFrame('dem1','RTop', '<?php echo attr($primary_docs['dem'][2]); ?>');
787 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
788 loadFrame('ens1','RBot', '<?php echo attr($primary_docs['ens'][2]); ?>');
793 // Call this to announce that the patient has changed. You must call this
794 // if you change the session PID, so that the navigation frame will show the
795 // correct patient and so that the other frame will be reloaded if it contains
796 // patient-specific information from the previous patient. frname is the name
797 // of the frame that the call came from, so we know to only reload content
798 // from the *other* frame if it is patient-specific.
799 function setPatient(pname, pid, pubpid, frname, str_dob) {
800 clearTherapyGroup();
801 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
802 setDivContent('current_patient', str);
803 setTitleContent('current_patient', str + str_dob);
804 if (pid == active_pid) return;
805 setDivContent('current_encounter', '<b>' + <?php echo xlj('None'); ?> + '</b>');
806 active_pid = pid;
807 active_encounter = 0;
808 encounter_locked = false;
809 if (frname) reloadPatient(frname);
810 syncRadios();
811 $(parent.Title.document.getElementById('current_patient_block')).show();
812 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
813 $(encounter_block).hide();
815 // zero out the encounter frame, replace it with the encounter list frame
816 var f = document.forms[0];
817 if ( f.cb_top.checked && f.cb_bot.checked ) {
818 var encounter_frame = getEncounterTargetFrame('enc');
819 if ( encounter_frame != undefined ) {
820 loadFrame('ens0',encounter_frame, '<?php echo attr($primary_docs['ens'][2]); ?>');
824 $(parent.Title.document.getElementById('clear_active')).show();//To display Clear Active Patient button on selecting a patient
825 $(parent.Title.document.getElementById('clear_active_group')).hide();//To hide Clear Active group button on selecting a patient
829 // Call this to announce that the therapy group has changed. You must call this
830 // if you change the session 'therapy_group', so that the navigation frame will show the
831 // correct group.
832 function setTherapyGroup(group_id, group_name) {
833 clearPatient();
835 $(parent.Title.document.querySelector('#current_patient_block span.text')).hide();
836 setTitleContent('current_patient', '<span>' + <?php echo xlj('Therapy Group');?> + ' - <a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentGroupFromTitle(' + group_id +')">' + group_name + ' (' + group_id + ')<a></span>' );
837 if (group_id == active_gid) return;
838 setDivContent('current_encounter', '<b>' + <?php echo xlj('None'); ?> + '</b>');
839 active_gid = group_id;
840 active_encounter = 0;
841 encounter_locked = false;
842 syncRadios();
843 $(parent.Title.document.getElementById('current_patient_block')).show();
844 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
845 $(encounter_block).hide();
847 // zero out the encounter frame, replace it with the encounter list frame
848 var f = document.forms[0];
849 if ( f.cb_top.checked && f.cb_bot.checked ) {
850 var encounter_frame = getEncounterTargetFrame('enc');
851 if ( encounter_frame != undefined ) {
852 loadFrame('ens0',encounter_frame, '<?php echo attr($primary_docs['ens'][2]); ?>');
856 $(parent.Title.document.getElementById('clear_active_group')).show();//To display Clear Active group button on selecting a patient
857 $(parent.Title.document.getElementById('clear_active')).hide();//To hide Clear Active Patient button on selecting a patient
860 function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) {
861 //This function lists all encounters of the patient.
862 //This function writes the drop down in the top frame.
863 //It is called when a new patient is create/selected from the search menu.
864 var str = '<Select class="text" id="EncounterHistory" onchange="{top.restoreSession();toencounter(this.options[this.selectedIndex].value)}">';
865 str+='<option value=""><?php echo xlt('Encounter History'); ?></option>';
866 <?php if (acl_check_form('newpatient', '', array('write', 'addonly'))) { ?>
867 str+='<option value="New Encounter"><?php echo xlt('New Encounter'); ?></option>';
868 <?php } ?>
869 str+='<option value="Past Encounter List"><?php echo xlt('Past Encounter List'); ?></option>';
870 for(CountEncounter=0;CountEncounter<EncounterDateArray.length;CountEncounter++)
872 str+='<option value="'+EncounterIdArray[CountEncounter]+'~'+EncounterDateArray[CountEncounter]+'">'+EncounterDateArray[CountEncounter]+'-'+CalendarCategoryArray[CountEncounter]+'</option>';
874 str+='</Select>';
875 $(parent.Title.document.getElementById('past_encounter_block')).show();
876 top.window.parent.Title.document.getElementById('past_encounter').innerHTML=str;
879 function loadCurrentPatientFromTitle() {
880 top.restoreSession();
881 top.frames['RTop'].location='../patient_file/summary/demographics.php';
884 function loadCurrentGroupFromTitle(gid) {
885 top.restoreSession();
886 top.frames['RTop'].location='../therapy_groups/index.php?method=groupDetails&group_id=' + encodeURIComponent(gid);
889 function getEncounterTargetFrame( name ) {
890 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
891 var f = document.forms[0];
892 var r = 'RTop';
893 if (f.cb_top.checked && f.cb_bot.checked) {
894 if ( bias == 2 ) {
895 r = 'RBot';
896 } else {
897 r = 'RTop';
899 } else {
900 if ( f.cb_top.checked ) {
901 r = 'RTop';
902 } else if ( f.cb_bot.checked ) {
903 r = 'RBot';
906 return r;
909 function isEncounterLocked( encounterId ) {
910 <?php if ($esignApi->lockEncounters()) { ?>
911 // If encounter locking is enabled, make a syncronous call (async=false) to check the
912 // DB to see if the encounter is locked.
913 // Call restore session, just in case
914 top.restoreSession();
915 $.ajax({
916 type: 'POST',
917 url: '<?php echo $GLOBALS['webroot']?>/interface/esign/index.php?module=encounter&method=esign_is_encounter_locked',
918 data: { encounterId : encounterId },
919 success: function( data ) {
920 encounter_locked = data;
922 dataType: 'json',
923 async:false
925 return encounter_locked;
926 <?php } else { ?>
927 // If encounter locking isn't enabled, just tell the left_nav that the encounter
928 // isn't locked.
929 return false;
930 <?php } ?>
933 // Call this to announce that the encounter has changed. You must call this
934 // if you change the session encounter, so that the navigation frame will
935 // show the correct encounter and so that the other frame will be reloaded if
936 // it contains encounter-specific information from the previous encounter.
937 // frname is the name of the frame that the call came from, so we know to only
938 // reload encounter-specific content from the *other* frame.
939 function setEncounter(edate, eid, frname) {
940 if (eid == active_encounter) return;
941 if (!eid) edate = <?php echo xlj('None'); ?>;
942 var str = '<b>' + edate + '</b>';
943 setDivContent('current_encounter', str);
944 active_encounter = eid;
945 encounter_locked=isEncounterLocked(active_encounter);
946 reloadEncounter(frname);
947 syncRadios();
948 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
949 var encounter = $(parent.Title.document.getElementById('current_encounter'));
950 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
951 encounter.html( estr );
952 encounter_block.show();
955 function loadCurrentEncounterFromTitle() {
956 top.restoreSession();
957 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/encounter_top.php';
960 // You must call this if you delete the active patient (or if for any other
961 // reason you "close" the active patient without opening a new one), so that
962 // the appearance of the navigation frame will be correct and so that any
963 // stale content will be reloaded.
964 function clearPatient() {
965 if (active_pid == 0) return;
966 var f = document.forms[0];
967 active_pid = 0;
968 active_encounter = 0;
969 encounter_locked = false;
970 setDivContent('current_patient', '<b>' + <?php echo xlj('None'); ?> + '</b>');
971 $(parent.Title.document.getElementById('current_patient_block')).hide();
972 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
973 $(parent.Title.document.getElementById('current_encounter_block')).hide();
974 reloadPatient('');
975 syncRadios();
978 // You must call this if you delete the active therapy group so that
979 // the appearance of the navigation frame will be correct and so that any
980 // stale content will be reloaded.
981 function clearTherapyGroup() {
982 if (active_gid == 0) return;
983 var f = document.forms[0];
984 active_gid = 0;
985 active_encounter = 0;
986 encounter_locked = false;
987 setDivContent('current_patient', '<b>' + <?php echo xlj('None'); ?> + '</b>');
988 $(parent.Title.document.getElementById('current_patient_block')).hide();
989 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
990 $(parent.Title.document.getElementById('current_encounter_block')).hide();
991 syncRadios();
994 // You must call this if you delete the active encounter (or if for any other
995 // reason you "close" the active encounter without opening a new one), so that
996 // the appearance of the navigation frame will be correct and so that any
997 // stale content will be reloaded.
998 function clearEncounter() {
999 if (active_encounter == 0) return;
1000 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b>" + <?php echo xlj('None'); ?> + "</b>";
1001 active_encounter = 0;
1002 encounter_locked = false;
1003 reloadEncounter('');
1004 syncRadios();
1007 function removeOptionSelected(EncounterId)
1008 {//Removes an item from the Encounter drop down.
1009 var elSel = top.window.parent.Title.document.getElementById('EncounterHistory');
1010 var i;
1011 for (i = elSel.length - 1; i>=2; i--) {
1012 EncounterHistoryValue=elSel.options[i].value;
1013 EncounterHistoryValueArray=EncounterHistoryValue.split('~');
1014 if (EncounterHistoryValueArray[0]==EncounterId) {
1015 elSel.remove(i);
1020 // You can call this to make sure the session pid is what we expect.
1021 function pidSanityCheck(pid) {
1022 if (pid != active_pid) {
1023 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
1024 '. This session is unstable and should be abandoned. Do not use ' +
1025 'OpenEMR in multiple browser windows!');
1026 return false;
1028 return true;
1031 // You can call this to make sure the session encounter is what we expect.
1032 function encounterSanityCheck(eid) {
1033 if (eid != active_encounter) {
1034 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
1035 '. This session is unstable and should be abandoned. Do not use ' +
1036 'OpenEMR in multiple browser windows!');
1037 return false;
1039 return true;
1042 // Pop up a report.
1043 function repPopup(aurl) {
1044 top.restoreSession();
1045 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
1046 return false;
1049 // This is invoked to pop up some window when a popup item is selected.
1050 function selpopup(selobj) {
1051 var i = selobj.selectedIndex;
1052 var opt = selobj.options[i];
1053 if (i > 0) {
1054 var width = 750;
1055 var height = 550;
1056 if (opt.text == 'Export' || opt.text == 'Import') {
1057 width = 500;
1058 height = 400;
1060 dlgopen(opt.value, '_blank', width, height);
1062 selobj.selectedIndex = 0;
1065 // Treeview activation stuff:
1066 $(function (){
1067 if(1 == <?php echo $GLOBALS['menu_styling_vertical'] ?>){
1068 $("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
1069 $("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
1070 $("#navigation-slide > li > ul > li > ul > li > a.collapsed_lv3 + ul").slideToggle("medium");
1071 $("#navigation-slide > li > a.expanded").click(function() {
1072 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1073 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1075 $("#navigation-slide > li > a.collapsed").click(function() {
1076 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1077 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1079 $("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
1080 $("#navigation-slide > li > a.expanded").next("ul").find("li > a.expanded_lv2").not(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1081 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1083 $("#navigation-slide > li > ul > li > ul > li > a.expanded_lv3").click(function() {
1084 $("#navigation-slide > li > ul > li > a.expanded").next("ul").find("li > a.expanded_lv3").not(this).toggleClass("expanded_lv3").toggleClass("collapsed_lv3").parent().find('> ul').slideToggle("medium");
1085 $(this).toggleClass("expanded_lv3").toggleClass("collapsed_lv3").parent().find('> ul').slideToggle("medium");
1087 $("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
1088 $("#navigation-slide > li > a.expanded").next("ul").find("li > a.expanded_lv2").not(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1089 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1091 $("#navigation-slide > li > ul > li > ul > li > a.collapsed_lv3").click(function() {
1092 $("#navigation-slide > li > ul > li > a.expanded").next("ul").find("li > a.expanded_lv3").not(this).toggleClass("expanded_lv3").toggleClass("collapsed_lv3").parent().find('> ul').slideToggle("medium");
1093 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1095 $("#navigation-slide > li > a#cal0").prepend('<i class="fa fa-fw fa-calendar fa-2x"></i>&nbsp;');
1096 $("#navigation-slide > li > a#pfb0").prepend('<i class="fa fa-fw fa-list-alt fa-2x"></i>&nbsp;');
1097 $("#navigation-slide > li > a#rcb0").prepend('<i class="fa fa-fw fa-calendar-minus-o fa-2x"></i>&nbsp;');
1098 $("#navigation-slide > li > a#msg0").prepend('<i class="fa fa-fw fa-envelope-o fa-2x"></i>&nbsp;');
1099 $("#navigation-slide > li > a#app0").prepend('<i class="fa fa-fw fa-user fa-2x"></i>&nbsp;');
1100 $("#navigation-slide > li > a#aop0").prepend('<i class="fa fa-fw fa-tachometer fa-2x"></i>&nbsp;');
1101 $("#navigation-slide > li > a#ppo0").prepend('<i class="fa fa-fw fa-users fa-2x"></i>&nbsp;');
1102 $("#navigation-slide > li > a#repimg").prepend('<i class="fa fa-fw fa-area-chart fa-2x"></i>&nbsp;');
1103 $("#navigation-slide > li > a#feeimg").prepend('<i class="fa fa-fw fa-dollar fa-2x"></i>&nbsp;');
1104 $("#navigation-slide > li > a#adm0").prepend('<i class="fa fa-fw fa-list-ol fa-2x"></i>&nbsp;');
1105 $("#navigation-slide > li > a#invimg").prepend('<i class="fa fa-fw fa-list-ol fa-2x"></i>&nbsp;');
1106 $("#navigation-slide > li > a#admimg").prepend('<i class="fa fa-fw fa-cogs fa-2x"></i>&nbsp;');
1107 $("#navigation-slide > li > a#misimg").prepend('<i class="fa fa-fw fa-cog fa-2x"></i>&nbsp;');
1108 $("#navigation-slide > li > a#proimg").prepend('<i class="fa fa-fw fa-stethoscope fa-2x"></i>&nbsp;');
1109 $("#navigation-slide > li > a#modimg").prepend('<i class="fa fa-fw fa-puzzle-piece fa-2x"></i>&nbsp;');
1110 $("#navigation-slide > li").each(function(index) {
1111 if($(" > ul > li", this).size() == 0){
1112 $(" > a", this).addClass("collapsed");
1115 } else { // $GLOBALS['menu_styling_vertical'] == 0
1117 //Remove the links (used by the sliding menu) that will break treeview
1118 $('a.collapsed').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1119 $('a.collapsed_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1120 $('a.collapsed_lv3').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1121 $('a.expanded').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1122 $('a.expanded_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1123 $('a.expanded_lv3').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1125 // Initiate treeview
1126 $("#navigation").treeview({
1127 animated: "fast",
1128 collapsed: true,
1129 unique: true,
1130 toggle: function() {
1131 window.console && console.log("%o was toggled", this);
1137 </script>
1139 </head>
1141 <body class="body_nav main-left">
1143 <form method='post' name='find_patient' target='RTop'
1144 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
1145 <input type="hidden" name="csrf_token_form" value="<?php echo attr(collectCsrfToken()); ?>" />
1147 <center>
1148 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:100;'>
1149 <option value='0'><?php echo xlt('Default'); ?></option>
1150 <option value='1'><?php echo xlt('Top'); ?></option>
1151 <option value='2'><?php echo xlt('Bottom'); ?></option>
1152 </select>
1153 </center>
1155 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1156 <tr>
1157 <td class='smalltext' nowrap>
1158 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' <?php echo $cb_top_chk ?> />
1159 <b><?php echo xlt('Top') ?></b>
1160 </td>
1161 <td class='smalltext' align='right' nowrap>
1162 <b><?php echo xlt('Bot') ?></b>
1163 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php echo $cb_bot_chk ?> />
1164 </td>
1165 </tr>
1166 </table>
1168 <?php if ($GLOBALS['menu_styling_vertical'] == 1) { ?>
1169 <ul id="navigation-slide">
1170 <?php } else { // ($GLOBALS['menu_styling_vertical'] == 0) ?>
1171 <ul id="navigation">
1172 <?php } ?>
1174 <?php
1175 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1176 genTreeLink('RTop', 'cal', xl('Calendar'));
1179 if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1180 genTreeLink('RTop', 'pfb', xl('Flow Board'));
1182 if (!$GLOBALS['disable_rcb'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1183 genTreeLink('RBot', 'rcb', xl('Recall Board'));
1185 if (acl_check('patients', 'notes')) {
1186 genTreeLink('RBot', 'msg', xl('Messages'));
1189 if ($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address'] && acl_check('patientportal', 'portal')) {
1190 genTreeLink('RTop', 'app', xl('Portal Activity'));
1193 if ($GLOBALS['portal_onsite_two_enable'] && acl_check('patientportal', 'portal')) {
1194 genTreeLink('RTop', 'aop', xl('Portal Dashboard'));
1197 if ($GLOBALS['gbl_portal_cms_enable'] && acl_check('patientportal', 'portal')) {
1198 genPopLink(xl('CMS Portal'), '../cmsportal/list_requests.php', 'ppo0');
1202 <?php if (acl_check('patients', 'demo') || acl_check('patients', 'appt') || acl_check_form('newpatient', '', array('write', 'addonly')) || acl_check('patients', 'med')) { ?>
1204 <li class="open"><a class="collapsed" id="patimg" ><i class="fa fa-fw fa-user fa-2x"></i>&nbsp;<span><?php echo xlt('Patient/Client') ?></span></a>
1205 <ul>
1206 <?php if (acl_check('patients', 'demo')) {
1207 genMiscLink('RTop', 'fin', '0', xl('Patients'), 'main/finder/dynamic_finder.php');
1208 } ?>
1209 <?php if (acl_check('patients', 'demo', '', 'write') || acl_check('patients', 'demo', '', 'addonly')) {
1210 genTreeLink('RTop', 'new', ($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New')));
1211 } ?>
1212 <?php if (acl_check('patients', 'demo')) {
1213 genTreeLink('RTop', 'dem', xl('Summary'));
1214 } ?>
1216 <?php if (acl_check('patients', 'appt') || acl_check_form('newpatient', '', array('write', 'addonly'))) { ?>
1217 <li class="open"><a class="expanded_lv2"><span><?php echo xlt('Visits') ?></span></a>
1218 <ul>
1219 <?php if (acl_check_form('newpatient', '', array('write', 'addonly'))) {
1220 genTreeLink('RBot', 'nen', xl('Create Visit'));
1221 } ?>
1222 <?php if (acl_check('patients', 'appt')) {
1223 genTreeLink('RBot', 'enc', xl('Current'));
1224 } ?>
1225 <?php if (acl_check('patients', 'appt')) {
1226 genTreeLink('RBot', 'ens', xl('Visit History'));
1227 } ?>
1228 </ul>
1229 </li>
1230 <?php } ?>
1232 <?php if (acl_check('patients', 'med')) { ?>
1233 <li><a class="collapsed_lv2"><span><?php echo xlt('Records') ?></span></a>
1234 <ul>
1235 <?php genTreeLink('RTop', 'prq', xl('Patient Record Request')); ?>
1236 </ul>
1237 </li>
1238 <?php } ?>
1240 <?php if ($GLOBALS['gbl_nav_visit_forms'] && acl_check('patients', 'demo')) { ?>
1241 <li><a class="collapsed_lv2"><span><?php echo xlt('Visit Forms') ?></span></a>
1242 <ul>
1243 <?php
1244 // Generate the items for visit forms, both traditional and LBF.
1246 $reglastcat = '';
1247 $regrows = getFormsByCategory(); // defined in registry.inc
1248 foreach ($regrows as $entry) {
1249 $option_id = $entry['directory'];
1250 $title = trim($entry['nickname']);
1251 if ($option_id == 'fee_sheet') {
1252 continue;
1254 if ($option_id == 'newpatient') {
1255 continue;
1257 // Check permission to create forms of this type.
1258 $tmp = explode('|', $entry['aco_spec']);
1259 if (!empty($tmp[1])) {
1260 if (!acl_check($tmp[0], $tmp[1], '', 'write') && !acl_check($tmp[0], $tmp[1], '', 'addonly')) {
1261 continue;
1264 if (empty($title)) {
1265 $title = $entry['name'];
1267 if ($entry['category'] != $reglastcat) {
1268 if ($reglastcat) {
1269 echo " </ul></li>\n";
1271 echo " <li><a class='collapsed_lv3'><span>" . xlt($entry['category']) . "</span></a><ul>\n";
1272 $reglastcat = $entry['category'];
1274 genMiscLink(
1275 'RBot',
1276 'enc',
1277 '2',
1278 xl_form_title($title),
1279 $option_id,
1280 false,
1281 true
1284 if ($reglastcat) {
1285 echo " </ul></li>\n";
1288 </ul>
1289 </li>
1290 <li class="collapsed" ><a class="collapsed_lv2"><span><?php echo xlt('Import') ?></span></a>
1291 <ul>
1292 <?php genMiscLink('RTop', 'ccr', '0', xlt('Upload'), 'patient_file/ccr_import.php'); ?>
1293 <?php genMiscLink('RTop', 'apr', '0', xlt('Pending Approval'), 'patient_file/ccr_pending_approval.php'); ?>
1294 </ul>
1295 </li>
1296 <?php } // end if gbl_nav_visit_forms ?>
1298 </ul>
1299 </li>
1301 <?php } ?>
1303 <?php if ($GLOBALS['enable_group_therapy']) : ?>
1304 <li><a class="collapsed" id="groupimg" ><i class="fa fa-fw fa-users"></i>&nbsp;<span><?php echo xlt('Group') ?></span></a>
1305 <ul>
1306 <?php genMiscLink('RTop', 'gfn', '0', xl('Groups'), 'therapy_groups/index.php?method=listGroups'); ?>
1307 <?php genTreeLink('RTop', 'gng', xl('New')); ?>
1308 <?php genTreeLink('RTop', 'gdg', xl('Group Details')); ?>
1309 <li><a class="collapsed_lv2"><span><?php echo xlt('Visits') ?></span></a>
1310 <ul>
1311 <?php genTreeLink('RBot', 'gcv', xl('Create Visit')); ?>
1312 <?php genTreeLink('RBot', 'gce', xl('Current')); ?>
1313 <?php genTreeLink('RBot', 'gvh', xl('Visit History')); ?>
1314 </ul>
1315 </li>
1317 </ul>
1318 </li>
1319 <?php endif ?>
1321 <?php // TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1322 <?php if ((!isset($GLOBALS['enable_fees_in_left_menu']) || $GLOBALS['enable_fees_in_left_menu'] == 1) &&
1323 (acl_check('encounters', 'coding') || acl_check('acct', 'eob') || acl_check('acct', 'bill', '', 'write'))) { ?>
1324 <li><a class="collapsed" id="feeimg" ><span><?php echo xlt('Fees') ?></span></a>
1325 <ul>
1326 <?php if (acl_check('encounters', 'coding')) {
1327 genMiscLink('RBot', 'cod', '2', xl('Fee Sheet'), 'fee_sheet', false, true);
1328 } ?>
1329 <?php if ($GLOBALS['use_charges_panel'] && acl_check('encounters', 'coding')) {
1330 genTreeLink('RBot', 'cod', xl('Charges'));
1331 } ?>
1332 <?php if (acl_check('acct', 'bill', '', 'write')) {
1333 genMiscLink('RBot', 'pay', '1', xl('Payment'), 'patient_file/front_payment.php');
1334 } ?>
1335 <?php if (acl_check('acct', 'bill', '', 'write')) {
1336 genMiscLink('RBot', 'bil', '1', xl('Checkout'), 'patient_file/pos_checkout.php?framed=1');
1337 } ?>
1338 <?php if (!$GLOBALS['simplified_demographics'] && (acl_check('acct', 'bill', '', 'write') || acl_check('acct', 'eob', '', 'write'))) {
1339 genTreeLink('RTop', 'bil', xl('Billing'));
1340 } ?>
1341 <?php if ($GLOBALS['enable_batch_payment'] && (acl_check('acct', 'bill', '', 'write') || acl_check('acct', 'eob', '', 'write'))) {
1342 genTreeLink('RTop', 'npa', xl('Batch Payments'), false, 2);
1344 <?php if ($GLOBALS['enable_posting'] && acl_check('acct', 'eob', '', 'write')) {
1345 genMiscLink('RTop', 'eob', '0', xl('Posting'), 'billing/sl_eob_search.php');
1346 } ?>
1347 <?php if ($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob')) {
1348 genTreeLink('RTop', 'edi', xl('EDI History'), false, 2);
1350 </ul>
1351 </li>
1352 <?php } ?>
1354 <?php if (acl_check('menus', 'modle')) {?>
1355 <li><a class="collapsed" id="modimg" ><span><?php echo xlt('Modules') ?></span></a>
1356 <ul>
1357 <?php
1358 if (acl_check('admin', 'manage_modules')) {
1359 genMiscLink('RTop', 'adm', '0', xl('Manage Modules'), 'modules/zend_modules/public/Installer');
1363 <?php //genTreeLink('RTop','ort',xl('Settings')); ?>
1364 <?php
1365 $module_query = sqlStatement("select mod_id, mod_directory,mod_name,mod_nick_name,mod_relative_link,type from modules where mod_active = 1 AND sql_run= 1 order by mod_ui_order asc");
1366 if (sqlNumRows($module_query)) {
1367 while ($modulerow = sqlFetchArray($module_query)) {
1368 $module_hooks = sqlStatement("SELECT msh.*,ms.obj_name,ms.menu_name,ms.path,m.mod_ui_name,m.type FROM modules_hooks_settings AS msh LEFT OUTER JOIN modules_settings AS ms ON
1369 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1370 WHERE m.mod_id = ? AND fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='modules' ORDER BY m.mod_id", array($modulerow['mod_id']));
1372 $modulePath = "";
1373 $added = "";
1374 if ($modulerow['type'] == 0) {
1375 $modulePath = $GLOBALS['customModDir'];
1376 $added = "";
1377 } else {
1378 $added = "index";
1379 $modulePath = $GLOBALS['zendModDir'];
1382 if (sqlNumRows($module_hooks) == 0) {
1383 // module without hooks in module section
1384 $acl_section = strtolower($modulerow['mod_directory']);
1385 $disallowed[$acl_section] = zh_acl_check($_SESSION['authUserID'], $acl_section) ? "" : "1";
1387 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$added;
1388 $mod_nick_name = $modulerow['mod_nick_name'] ? $modulerow['mod_nick_name'] : $modulerow['mod_name'];
1389 genMiscLink2('RTop', $acl_section, '0', xl($mod_nick_name), $relative_link);
1390 } else {
1391 // module with hooks in module section
1392 $jid = 0;
1393 $modid = '';
1394 while ($hookrow = sqlFetchArray($module_hooks)) {
1395 $disallowed[$hookrow['obj_name']] = !$disallowed['adm'] || zh_acl_check($_SESSION['authUserID'], $hookrow['obj_name']) ? "" : "1";
1397 $relative_link ="modules/".$modulePath."/".$hookrow['mod_relative_link'].$hookrow['path'];
1398 $mod_nick_name = $hookrow['menu_name'] ? $hookrow['menu_name'] : 'NoName';
1400 if ($jid==0 || ($modid!=$hookrow['mod_id'])) {
1401 if ($modid!='') {
1402 echo "</ul>";
1405 <li><a class="collapsed_lv2"><span><?php echo xlt($hookrow['mod_ui_name']); ?></span></a>
1406 <ul>
1407 <?php
1410 $jid++;
1411 $modid = $hookrow['mod_id'];
1412 genMiscLink('RTop', $hookrow['obj_name'], '0', xl($mod_nick_name), $relative_link);
1415 echo "</ul>";
1419 <?php
1420 } ?>
1421 </ul>
1422 </li>
1424 <?php } ?>
1426 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1427 <li><a class="collapsed" id="invimg" ><span><?php echo xlt('Inventory') ?></span></a>
1428 <ul>
1429 <?php genMiscLink('RTop', 'adm', '0', xl('Management'), 'drugs/drug_inventory.php'); ?>
1430 <?php genPopLink(xl('Destroyed'), 'destroyed_drugs_report.php'); ?>
1431 </ul>
1432 </li>
1433 <?php } ?>
1435 <?php if (acl_check('patients', 'lab')) { ?>
1436 <li><a class="collapsed" id="proimg" ><span><?php echo xlt('Procedures') ?></span></a>
1437 <ul>
1438 <?php if (acl_check('admin', 'super')) {
1439 genTreeLink('RTop', 'orl', xl('Providers'));
1440 } ?>
1441 <?php if (acl_check('admin', 'super')) {
1442 genTreeLink('RTop', 'ort', xl('Configuration'));
1443 } ?>
1444 <?php if (acl_check('admin', 'super')) {
1445 genTreeLink('RTop', 'orc', xl('Load Compendium'));
1446 } ?>
1447 <?php genTreeLink('RTop', 'orp', xl('Pending Review')); ?>
1448 <?php genTreeLink('RTop', 'orr', xl('Patient Results')); ?>
1449 <?php genTreeLink('RTop', 'lda', xl('Lab Overview')); ?>
1450 <?php genTreeLink('RTop', 'orb', xl('Batch Results')); ?>
1451 <?php genTreeLink('RTop', 'ore', xl('Electronic Reports')); ?>
1452 <?php genTreeLink('RTop', 'dld', xl('Lab Documents'));?>
1453 </ul>
1454 </li>
1455 <?php } ?>
1457 <?php
1458 if ($GLOBALS['erx_enable'] && acl_check('patients', 'rx')) {
1459 $newcrop_user_role = sqlQuery("SELECT newcrop_user_role FROM users WHERE username = ?", array($_SESSION['authUser']));
1460 if ($newcrop_user_role['newcrop_user_role']) {
1462 <li><a class="collapsed" id="feeimg" ><span><?php echo xlt('New Crop') ?></span></a>
1463 <ul>
1464 <li><a class="collapsed_lv2"><span><?php echo xlt('Status') ?></span></a>
1465 <ul>
1466 <?php genTreeLink('RTop', 'erx', xl('e-Rx')); ?>
1467 <?php genMiscLink('RTop', 'err', '0', xl('e-Rx Renewal'), 'eRx.php?page=status'); ?>
1468 <?php if ($newcrop_user_role['newcrop_user_role'] === 'erxadmin') {
1469 genMiscLink('RTop', 'ere', '0', xl('e-Rx EPCS'), 'eRx.php?page=epcs-admin');
1470 } ?>
1471 </ul>
1472 </li>
1473 </ul>
1474 </li>
1475 <?php
1480 <?php if (!$disallowed['adm']) { ?>
1481 <li><a class="collapsed" id="admimg" ><span><?php echo xlt('Administration') ?></span></a>
1482 <ul>
1483 <?php if (acl_check('admin', 'super')) {
1484 genMiscLink('RTop', 'adm', '0', xl('Globals'), 'super/edit_globals.php');
1485 } ?>
1486 <?php if (acl_check('admin', 'users')) {
1487 genMiscLink('RTop', 'adm', '0', xl('Facilities'), 'usergroup/facilities.php');
1488 } ?>
1489 <?php if (acl_check('admin', 'users')) {
1490 genMiscLink('RTop', 'adm', '0', xl('Users'), 'usergroup/usergroup_admin.php');
1491 } ?>
1492 <?php if (acl_check('admin', 'practice')) {
1493 genTreeLink('RTop', 'adb', xl('Addr Book'));
1494 } ?>
1495 <?php
1496 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1497 if (acl_check('admin', 'practice')) {
1498 genMiscLink('RTop', 'adm', '0', xl('Practice'), '../controller.php?practice_settings&pharmacy&action=list');
1499 } ?>
1500 <?php if (acl_check('admin', 'superbill')) {
1501 genTreeLink('RTop', 'sup', xl('Codes'));
1502 } ?>
1503 <?php if (acl_check('admin', 'super')) {
1504 genMiscLink('RTop', 'adm', '0', xl('Layouts'), 'super/edit_layout.php');
1505 } ?>
1506 <?php if (acl_check('admin', 'super')) {
1507 genMiscLink('RTop', 'adm', '0', xl('Lists'), 'super/edit_list.php');
1508 } ?>
1509 <?php if (acl_check('admin', 'acl')) {
1510 genMiscLink('RTop', 'adm', '0', xl('ACL'), 'usergroup/adminacl.php');
1511 } ?>
1512 <?php if (acl_check('admin', 'super')) {
1513 genMiscLink('RTop', 'adm', '0', xl('Files'), 'super/manage_site_files.php');
1514 } ?>
1515 <?php if (acl_check('admin', 'super')) {
1516 genMiscLink('RTop', 'adm', '0', xl('Backup'), 'main/backup.php');
1517 } ?>
1518 <?php if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1519 genMiscLink('RTop', 'adm', '0', xl('Rules'), 'super/rules/index.php?action=browse!list');
1520 } ?>
1521 <?php if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1522 genMiscLink('RTop', 'adm', '0', xl('Alerts'), 'super/rules/index.php?action=alerts!listactmgr');
1523 } ?>
1524 <?php if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1525 genMiscLink('RTop', 'adm', '0', xl('Patient Reminders'), 'patient_file/reminder/patient_reminders.php?mode=admin&patient_id=');
1526 } ?>
1527 <?php if (($GLOBALS['include_de_identification']) && (acl_check('admin', 'super'))) {
1528 genMiscLink('RTop', 'adm', '0', xl('De Identification'), 'de_identification_forms/de_identification_screen1.php');
1529 } ?>
1530 <?php if (($GLOBALS['include_de_identification']) && (acl_check('admin', 'super'))) {
1531 genMiscLink('RTop', 'adm', '0', xl('Re Identification'), 'de_identification_forms/re_identification_input_screen.php');
1532 } ?>
1533 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) {
1534 genMiscLink('RTop', 'adm', '0', xl('Export'), 'main/ippf_export.php');
1535 } ?>
1536 <li><a class="collapsed_lv2"><span><?php echo xlt('Other') ?></span></a>
1537 <ul>
1538 <?php if (acl_check('admin', 'language')) {
1539 genMiscLink('RTop', 'adm', '0', xl('Language'), 'language/language.php');
1540 } ?>
1541 <?php if (acl_check('admin', 'forms')) {
1542 genMiscLink('RTop', 'adm', '0', xl('Forms'), 'forms_admin/forms_admin.php');
1543 } ?>
1544 <?php if (acl_check('admin', 'calendar') && !$GLOBALS['disable_calendar']) {
1545 genMiscLink('RTop', 'adm', '0', xl('Calendar'), 'main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig');
1546 } ?>
1547 <?php if (acl_check('admin', 'users')) {
1548 genMiscLink('RTop', 'adm', '0', xl('Logs'), 'logview/logview.php');
1549 } ?>
1550 <?php
1551 if ($newcrop_user_role['newcrop_user_role'] || $GLOBALS['erx_enable']) {
1552 if (acl_check('admin', 'users')) {
1553 genMiscLink('RTop', 'adm', '0', xl('eRx Logs'), 'logview/erx_logview.php');
1557 <?php if (acl_check('admin', 'users')) {
1558 genMiscLink('RTop', 'adm', '0', xl('Certificates'), 'usergroup/ssl_certificates_admin.php');
1559 } ?>
1560 <?php if (acl_check('admin', 'super')) {
1561 genMiscLink('RTop', 'adm', '0', xl('Native Data Loads'), '../interface/super/load_codes.php');
1562 } ?>
1563 <?php if (acl_check('admin', 'super')) {
1564 genMiscLink('RTop', 'adm', '0', xl('External Data Loads'), '../interface/code_systems/dataloads_ajax.php');
1565 } ?>
1566 <?php if (acl_check('admin', 'super')) {
1567 genMiscLink('RTop', 'adm', '0', xl('Merge Patients'), 'patient_file/merge_patients.php');
1568 } ?>
1569 <?php if (acl_check('admin', 'super')) {
1570 genMiscLink('RTop', 'adm', '0', xl('Import Holidays'), '../interface/main/holidays/import_holidays.php');
1571 } ?>
1572 <?php if ($GLOBALS['enable_auditlog_encryption']) {
1573 genMiscLink('RTop', 'rep', '0', xl('Audit Log Tamper'), 'reports/audit_log_tamper_report.php');
1574 } ?>
1575 </ul>
1576 </li>
1577 </ul>
1578 </li>
1579 <?php } ?>
1581 <li><a class="collapsed" id="repimg" ><span><?php echo xlt('Reports') ?></span></a>
1582 <ul>
1583 <?php
1584 $module_query = sqlStatement("SELECT msh.*,ms.obj_name,ms.menu_name,ms.path,m.mod_ui_name,m.type FROM modules_hooks_settings AS msh LEFT OUTER JOIN modules_settings AS ms ON
1585 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1586 WHERE fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='reports' ORDER BY mod_id");
1587 if (sqlNumRows($module_query)) {
1588 $jid = 0;
1589 $modid = '';
1590 while ($modulerow = sqlFetchArray($module_query)) {
1591 $modulePath = "";
1592 $added = "";
1593 if ($modulerow['type'] == 0) {
1594 $modulePath = $GLOBALS['customModDir'];
1595 $added = "";
1596 } else {
1597 $added = "index";
1598 $modulePath = $GLOBALS['zendModDir'];
1601 $disallowed[$modulerow['obj_name']] = !$disallowed['adm'] || zh_acl_check($_SESSION['authUserID'], $modulerow['obj_name']) ? "" : "1";
1603 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$modulerow['path'];
1604 $mod_nick_name = $modulerow['menu_name'] ? $modulerow['menu_name'] : 'NoName';
1606 if ($jid==0 || ($modid!=$modulerow['mod_id'])) {
1607 if ($modid!='') {
1608 echo "</ul>";
1611 <li><a class="collapsed_lv2"><span><?php echo xlt($modulerow['mod_ui_name']); ?></span></a>
1612 <ul>
1613 <?php
1616 $jid++;
1617 $modid = $modulerow['mod_id'];
1618 genMiscLink('RTop', $modulerow['obj_name'], '0', xl($mod_nick_name), $relative_link);
1621 echo "</ul>";
1622 } ?>
1624 <?php if (acl_check('patients', 'demo') || acl_check('patients', 'med') ||
1625 (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions'])) { ?>
1626 <li><a class="collapsed_lv2"><span><?php echo xlt('Clients') ?></span></a>
1627 <ul>
1628 <?php if (acl_check('patients', 'demo')) {
1629 genMiscLink('RTop', 'rep', '0', xl('List'), 'reports/patient_list.php');
1630 } ?>
1631 <?php if (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions']) {
1632 genMiscLink('RTop', 'rep', '0', xl('Rx'), 'reports/prescriptions_report.php');
1633 } ?>
1634 <?php if (acl_check('patients', 'med')) {
1635 genMiscLink('RTop', 'rep', '0', xl('Patient List Creation'), 'reports/patient_list_creation.php');
1636 } ?>
1637 <?php if (acl_check('patients', 'med')) {
1638 genMiscLink('RTop', 'rep', '0', xl('Clinical'), 'reports/clinical_reports.php');
1639 } ?>
1640 <?php if (acl_check('patients', 'med')) {
1641 genMiscLink('RTop', 'rep', '0', xl('Referrals'), 'reports/referrals_report.php');
1642 } ?>
1643 <?php if (acl_check('patients', 'med')) {
1644 genMiscLink('RTop', 'rep', '0', xl('Immunization Registry'), 'reports/immunization_report.php');
1645 } ?>
1646 </ul>
1647 </li>
1648 <?php } ?>
1650 <?php if (acl_check('patients', 'med')) { ?>
1651 <li><a class="collapsed_lv2"><span><?php echo xlt('Clinic') ?></span></a>
1652 <ul>
1653 <?php if (($GLOBALS['enable_cdr'] || $GLOBALS['enable_cqm'] || $GLOBALS['enable_amc']) && acl_check('patients', 'med')) {
1654 genMiscLink('RTop', 'rep', '0', xl('Report Results'), 'reports/report_results.php');
1655 } ?>
1656 <?php if ($GLOBALS['enable_cdr'] && acl_check('patients', 'med')) {
1657 genMiscLink('RTop', 'rep', '0', xl('Standard Measures'), 'reports/cqm.php?type=standard');
1658 } ?>
1659 <?php if ($GLOBALS['enable_cqm'] && acl_check('patients', 'med')) {
1660 genMiscLink('RTop', 'rep', '0', xl('Quality Measures (CQM)'), 'reports/cqm.php?type=cqm');
1661 } ?>
1662 <?php if ($GLOBALS['enable_amc'] && acl_check('patients', 'med')) {
1663 genMiscLink('RTop', 'rep', '0', xl('Automated Measures (AMC)'), 'reports/cqm.php?type=amc');
1664 } ?>
1665 <?php if ($GLOBALS['enable_amc_tracking'] && acl_check('patients', 'med')) {
1666 genMiscLink('RTop', 'rep', '0', xl('AMC Tracking'), 'reports/amc_tracking.php');
1667 } ?>
1668 <?php if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_alert_log'] && acl_check('patients', 'med')) {
1669 genMiscLink('RTop', 'rep', '0', xl('Alerts Log'), 'reports/cdr_log.php');
1670 } ?>
1671 </ul>
1672 </li>
1673 <?php } ?>
1675 <li><a class="collapsed_lv2"><span><?php echo xlt('Visits') ?></span></a>
1676 <ul>
1677 <?php if (acl_check('acct', 'rep_a')) {
1678 genMiscLink('RTop', 'rep', '0', xl('Daily Report'), 'reports/daily_summary_report.php');
1679 } ?>
1680 <?php if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1681 genMiscLink('RTop', 'rep', '0', xl('Appointments'), 'reports/appointments_report.php');
1682 } ?>
1683 <?php if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1684 genMiscLink('RTop', 'rep', '0', xl('Patient Flow Board'), 'reports/patient_flow_board_report.php');
1685 } ?>
1686 <?php if (acl_check('encounters', 'coding_a')) {
1687 genMiscLink('RTop', 'rep', '0', xl('Encounters'), 'reports/encounters_report.php');
1688 } ?>
1689 <?php if (!$GLOBALS['disable_calendar'] && acl_check('acct', 'rep_a')) {
1690 genMiscLink('RTop', 'rep', '0', xl('Appt-Enc'), 'reports/appt_encounter_report.php');
1691 } ?>
1692 <?php if (empty($GLOBALS['code_types']['IPPF']) && acl_check('encounters', 'coding_a')) {
1693 genMiscLink('RTop', 'rep', '0', xl('Superbill'), 'reports/custom_report_range.php');
1694 } ?>
1695 <?php if (acl_check('patients', 'demo')) {
1696 genMiscLink('RTop', 'rep', '0', xl('Eligibility'), 'reports/edi_270.php');
1697 } ?>
1698 <?php if (acl_check('patients', 'demo')) {
1699 genMiscLink('RTop', 'rep', '0', xl('Eligibility Response'), 'reports/edi_271.php');
1700 } ?>
1701 <?php if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1702 genMiscLink('RTop', 'rep', '0', xl('Chart Activity'), 'reports/chart_location_activity.php');
1703 } ?>
1704 <?php if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1705 genMiscLink('RTop', 'rep', '0', xl('Charts Out'), 'reports/charts_checked_out.php');
1706 } ?>
1707 <?php genMiscLink('RTop', 'rep', '0', xl('Services'), 'reports/services_by_category.php'); ?>
1708 <?php if (acl_check('patients', 'med')) {
1709 genMiscLink('RTop', 'rep', '0', xl('Syndromic Surveillance'), 'reports/non_reported.php');
1710 } ?>
1711 </ul>
1712 </li>
1714 <?php if (acl_check('acct', 'rep_a')) { ?>
1715 <li><a class="collapsed_lv2"><span><?php echo xlt('Financial') ?></span></a>
1716 <ul>
1717 <?php genMiscLink('RTop', 'rep', '0', xl('Sales'), 'reports/sales_by_item.php'); ?>
1718 <?php genMiscLink('RTop', 'rep', '0', xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
1719 <?php genMiscLink('RTop', 'rep', '0', xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
1720 <?php genMiscLink('RTop', 'rep', '0', xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
1721 <?php genMiscLink('RTop', 'rep', '0', xl('Collections'), 'reports/collections_report.php'); ?>
1722 <?php genMiscLink('RTop', 'rep', '0', xl('Pat Ledger'), 'reports/pat_ledger.php?form=0'); ?>
1723 <?php genMiscLink('RTop', 'rep', '0', xl('Financial Summary by Service Code'), 'reports/svc_code_financial_report.php'); ?>
1724 </ul>
1725 </li>
1726 <?php } ?>
1728 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1729 <li><a class="collapsed_lv2"><span><?php echo xlt('Inventory') ?></span></a>
1730 <ul>
1731 <?php genMiscLink('RTop', 'rep', '0', xl('List'), 'reports/inventory_list.php'); ?>
1732 <?php genMiscLink('RTop', 'rep', '0', xl('Activity'), 'reports/inventory_activity.php'); ?>
1733 <?php genMiscLink('RTop', 'rep', '0', xl('Transactions'), 'reports/inventory_transactions.php'); ?>
1734 </ul>
1735 </li>
1736 <?php } ?>
1738 <?php if (acl_check('patients', 'lab')) { ?>
1739 <li><a class="collapsed_lv2"><span><?php echo xlt('Procedures') ?></span></a>
1740 <ul>
1741 <?php genPopLink(xl('Pending Res'), '../orders/pending_orders.php'); ?>
1742 <?php if (!empty($GLOBALS['code_types']['IPPF'])) {
1743 genPopLink(xl('Pending F/U'), '../orders/pending_followup.php');
1744 } ?>
1745 <?php genPopLink(xl('Statistics'), '../orders/procedure_stats.php'); ?>
1746 </ul>
1747 </li>
1748 <?php } ?>
1750 <?php if (!$GLOBALS['simplified_demographics'] && (acl_check('acct', 'rep_a') || acl_check('patients', 'demo'))) { ?>
1751 <li><a class="collapsed_lv2"><span><?php echo xlt('Insurance') ?></span></a>
1752 <ul>
1753 <?php if (acl_check('acct', 'rep_a')) {
1754 genMiscLink('RTop', 'rep', '0', xl('Distribution'), 'reports/insurance_allocation_report.php');
1755 } ?>
1756 <?php if (acl_check('acct', 'rep_a')) {
1757 genMiscLink('RTop', 'rep', '0', xl('Indigents'), 'billing/indigent_patients_report.php');
1758 } ?>
1759 <?php if (acl_check('patients', 'demo')) {
1760 genMiscLink('RTop', 'rep', '0', xl('Unique SP'), 'reports/unique_seen_patients_report.php');
1761 } ?>
1762 </ul>
1763 </li>
1764 <?php } ?>
1766 <?php if (!empty($GLOBALS['code_types']['IPPF']) && acl_check('acct', 'rep_a')) { ?>
1767 <li><a class="collapsed_lv2"><span><?php echo xlt('Statistics') ?></span></a>
1768 <ul>
1769 <?php genPopLink(xl('IPPF Stats'), 'ippf_statistics.php?t=i'); ?>
1770 <?php genPopLink(xl('GCAC Stats'), 'ippf_statistics.php?t=g'); ?>
1771 <?php genPopLink(xl('MA Stats'), 'ippf_statistics.php?t=m'); ?>
1772 <?php genPopLink(xl('CYP'), 'ippf_cyp_report.php'); ?>
1773 <?php genPopLink(xl('Daily Record'), 'ippf_daily.php'); ?>
1774 </ul>
1775 </li>
1776 <?php } // end ippf-specific ?>
1778 <li><a class="collapsed_lv2"><span><?php echo xlt('Blank Forms') ?></span></a>
1779 <ul>
1780 <?php
1781 echo " <li><a class='collapsed_lv3'><span>" . xlt('Core') . "</span></a><ul>\n";
1782 genPopLink(xl('Demographics'), '../patient_file/summary/demographics_print.php');
1783 genPopLink(xl('Superbill/Fee Sheet'), '../patient_file/printed_fee_sheet.php');
1784 // genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php');
1785 echo " </ul></li>\n";
1787 // Generate the blank form items for LBF visit forms.
1789 $reglastcat = '';
1790 $regrows = getFormsByCategory('1', true); // defined in registry.inc
1791 foreach ($regrows as $entry) {
1792 $option_id = $entry['directory'];
1793 $title = trim($entry['nickname']);
1794 $tmp = explode('|', $entry['aco_spec']);
1795 if (!empty($tmp[1])) {
1796 if (!acl_check($tmp[0], $tmp[1])) {
1797 continue;
1800 if (empty($title)) {
1801 $title = $entry['name'];
1803 if ($entry['category'] != $reglastcat) {
1804 if ($reglastcat) {
1805 echo " </ul></li>\n";
1807 echo " <li><a class='collapsed_lv3'><span>" . xlt($entry['category']) . "</span></a><ul>\n";
1808 $reglastcat = $entry['category'];
1810 genPopLink(xl_form_title($title), "../forms/LBF/printable.php?formname=" . urlencode($option_id));
1812 if ($reglastcat) {
1813 echo " </ul></li>\n";
1816 </ul>
1817 </li>
1819 <?php if (acl_check('admin', 'batchcom')) { ?>
1820 <li><a class="collapsed_lv2"><span><?php echo xlt('Services') ?></span></a>
1821 <ul>
1822 <?php genMiscLink('RTop', 'rep', '0', xl('Background Services'), 'reports/background_services.php'); ?>
1823 <?php genMiscLink('RTop', 'rep', '0', xl('Direct Message Log'), 'reports/direct_message_log.php'); ?>
1824 </ul>
1825 </li>
1826 <?php } ?>
1828 </ul>
1829 </li>
1831 <li><a class="collapsed" id="misimg" ><span><?php echo xlt('Miscellaneous') ?></span></a>
1832 <ul>
1833 <?php genTreeLink('RTop', 'ped', xl('Patient Education')); ?>
1834 <?php if (acl_check('encounters', 'auth')) {
1835 genTreeLink('RBot', 'aun', xl('Authorizations'));
1836 } ?>
1837 <?php if (acl_check('patients', 'docs')) {
1838 genTreeLink('RTop', 'fax', xl('Fax/Scan'));
1839 } ?>
1840 <?php if (acl_check('admin', 'practice')) {
1841 genTreeLink('RTop', 'adb', xl('Addr Book'));
1842 } ?>
1843 <?php if (acl_check('admin', 'practice')) {
1844 genTreeLink('RTop', 'ort', xl('Order Catalog'));
1845 } ?>
1846 <?php if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1847 genTreeLink('RTop', 'cht', xl('Chart Tracker'));
1848 } ?>
1849 <?php if (acl_check('encounters', 'notes')) {
1850 genTreeLink('RTop', 'ono', xl('Ofc Notes'));
1851 } ?>
1852 <?php if (acl_check('admin', 'batchcom') || acl_check('admin', 'practice')) {
1853 genMiscLink('RTop', 'adm', '0', xl('BatchCom'), 'batchcom/batchcom.php');
1854 } ?>
1855 <?php $myrow = sqlQuery("SELECT state FROM registry WHERE directory = 'track_anything'");
1856 if ($myrow['state']=='1') {
1857 genTreeLink('RTop', 'tan', xl('Configure Tracks'));
1858 } ?>
1859 <?php if (!$GLOBALS['use_active_directory']) {
1860 genTreeLink('RTop', 'pwd', xl('Password'));
1861 } ?>
1862 <?php genTreeLink('RTop', 'mfa', xl('MFA Manaagement')); ?>
1863 <?php genMiscLink('RTop', 'prf', '0', xl('Preferences'), 'super/edit_globals.php?mode=user'); ?>
1864 <?php if (acl_check('patients', 'docs', '', 'write') || acl_check('patients', 'docs', '', 'addonly')) {
1865 genMiscLink('RTop', 'adm', '0', xl('New Documents'), '../controller.php?document&list&patient_id=00');
1866 } ?>
1867 <?php if (acl_check('admin', 'practice')) {
1868 genMiscLink('RTop', 'adm', '0', xl('Document Templates'), 'super/manage_document_templates.php');
1869 } ?>
1870 </ul>
1871 </li>
1873 </ul>
1875 <br /><hr />
1877 <div id='current_patient' style = 'display:none'>
1878 <b><?php echo xlt('None'); ?></b>
1879 </div>
1881 <div id='current_encounter' style = 'display:none'>
1882 <b><?php echo xlt('None'); ?></b>
1883 </div>
1884 <?php
1885 genPopupsList();
1886 echo "<hr />\n";
1887 genFindBlock();
1888 echo "<hr />\n";
1891 <input type='hidden' name='findBy' value='Last' />
1892 <input type="hidden" name="searchFields" id="searchFields"/>
1893 <input type="hidden" name="search_service_code" value='' />
1895 </form>
1897 <script language='JavaScript'>
1898 syncRadios();
1900 function save_setting (cb_frames) {
1901 for (var i = 0, len = cb_frames.length; i < len; i++) {
1902 try {
1903 var fref = '<?php echo $uspfx ?>frame' + i + '_chk';
1904 var ureq = $.post( "<?php echo $GLOBALS['webroot'] ?>/library/ajax/user_settings.php",
1906 lab: fref,
1907 val: cb_frames[i],
1908 csrf_token_form: "<?php echo attr(collectCsrfToken()); ?>"
1911 .done(function(data) {
1912 // alert( "Data Loaded: " + data );
1914 .fail(function(xhr, textStatus, errorThrown) {
1915 alert("Error:"+xhr.responseText+"\n"+textStatus+"\n"+errorThrown);
1917 .always(function() {
1918 // alert( "finished" );
1921 } catch (err) {
1922 alert (err.message);
1926 </script>
1928 </body>
1929 </html>