several user interface improvements
[openemr.git] / interface / main / left_nav.php
blob1500398cd801430198624794e15506c23184c139
1 <?php
2 use ESign\Api;
4 /* Copyright (C) 2006-2012 Rod Roark <rod@sunsetsystems.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
12 // This provides the left navigation frame.
13 // Following are notes as to what else was changed for this feature:
15 // * interface/main/main_screen.php: the top-level frameset.
16 // * interface/main/finder/patient_select.php: loads stuff when a new patient
17 // is selected.
18 // * interface/patient_file/summary/demographics.php: this is the first frame
19 // loaded when a new patient is chosen, and in turn sets the current pid and
20 // then loads the initial bottom frame.
21 // * interface/patient_file/summary/demographics_full.php: added support for
22 // setting a new pid, needed for going to demographics from billing.
23 // * interface/patient_file/summary/demographics_save.php: redisplay
24 // demographics.php and not the frameset.
25 // * interface/patient_file/summary/summary_bottom.php: new frameset for the
26 // summary, prescriptions and notes for a selected patient, cloned from
27 // patient_summary.php.
28 // * interface/patient_file/encounter/encounter_bottom.php: new frameset for
29 // the selected encounter, mosting coding/billing stuff, cloned from
30 // patient_encounter.php. This will also self-load the superbill pages
31 // as requested.
32 // * interface/usergroup/user_info.php: removed Back link.
33 // * interface/usergroup/admin_frameset.php: new frameset for Admin pages,
34 // cloned from usergroup.php.
35 // * interface/main/onotes/office_comments.php: removed Back link target.
36 // * interface/main/onotes/office_comments_full.php: changed Back link.
37 // * interface/billing/billing_report.php: removed Back link; added logic
38 // to properly go to demographics or to an encounter when requested.
39 // * interface/new/new.php: removed Back link and revised form target.
40 // * interface/new/new_patient_save.php: modified to load the demographics
41 // page to the current frame instead of loading a new frameset.
42 // * interface/patient_file/history/history.php: target change.
43 // * interface/patient_file/history/history_full.php: target changes.
44 // * interface/patient_file/history/history_save.php: target change.
45 // * interface/patient_file/history/encounters.php: link/target changes.
46 // * interface/patient_file/encounter/encounter_top.php: another new frameset
47 // cloned from patient_encounter.php.
48 // * interface/patient_file/encounter/forms.php: link target removal.
49 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
50 // changes.
51 // * interface/patient_file/summary/immunizations.php: removed back link.
52 // * interface/patient_file/summary/pnotes.php: changed link targets.
53 // * interface/patient_file/summary/pnotes_full.php: changed back link and
54 // added set_pid logic.
55 // * interface/patient_file/transaction/transactions.php: various changes.
56 // * interface/patient_file/transaction/add_transaction.php: new return js.
57 // * interface/patient_file/encounter/superbill_codes.php: target and link
58 // changes.
59 // * interface/patient_file/encounter/superbill_custom_full.php: target and
60 // link changes.
61 // * interface/patient_file/encounter/diagnosis.php: target changes.
62 // * interface/patient_file/encounter/diagnosis_full.php: target and link
63 // changes.
64 // * interface/main/authorizations/authorizations.php: link and target changes.
65 // * library/api.inc: url change.
66 // * interface/patient_file/summary/rx_frameset.php: new frameset.
67 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
68 // * all encounter forms: remove all instances of "target=Main" and change
69 // all instances of "patient_encounter.php" to "encounter_top.php".
71 // Our find_patient form, when submitted, invokes patient_select.php in the
72 // upper frame. When the patient is selected, demographics.php is invoked
73 // with the set_pid parameter, which establishes the new session pid and also
74 // calls the setPatient() function (below). In this case demographics.php
75 // will also load the summary frameset into the bottom frame, invoking our
76 // loadFrame() function.
78 // Similarly, we have the concept of selecting an encounter from the
79 // Encounters list, and then having that "stick" until some other encounter
80 // or a new encounter is chosen. We also have a navigation item for creating
81 // a new encounter. interface/patient_file/encounter/encounter_top.php
82 // supports set_encounter to establish an encounter.
84 // TBD: Include active_pid and/or active_encounter in relevant submitted
85 // form data, and add logic to the save routines to make sure they match
86 // the corresponding session values.
88 require_once("../globals.php");
89 require_once($GLOBALS['fileroot']."/library/acl.inc");
90 require_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
91 require_once($GLOBALS['fileroot']."/library/patient.inc");
92 require_once($GLOBALS['fileroot']."/library/lists.inc");
93 require_once($GLOBALS['fileroot']."/library/registry.inc");
94 require_once $GLOBALS['srcdir'].'/ESign/Api.php';
95 require_once $GLOBALS['srcdir'].'/user.inc';
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 'app' => array(xl('Portal Activity') , 0, '../myportal/index.php'),
115 'aop' => array(xl('Portal Dashboard') , 0, '../portal/patient/provider'),
116 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php?form_active=1'),
117 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
118 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
119 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
120 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
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 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
155 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
156 'erx' => array(xl('e-Rx') , 1, 'eRx.php'),
157 'err' => array(xl('e-Rx Renewal') , 1, 'eRx.php?page=status'),
158 'ere' => array(xl('e-Rx EPCS') , 1, 'eRx.php?page=epcs-admin'),
159 'pay' => array(xl('Payment') , 1, '../patient_file/front_payment.php'),
160 'edi' => array(xl('EDI History') , 0, 'billing/edih_view.php'),
161 'eob' => array(xl('Posting') , 0, 'billing/sl_eob_search.php'),
162 'dld' => array(xl('Display Documents'), 0, 'main/display_documents.php')
164 $disallowed = array();
167 $primary_docs['npa']=array(xl('Batch Payments') , 0, 'billing/new_payment.php');
168 if ($GLOBALS['use_charges_panel'] || $GLOBALS['menu_styling_vertical'] == 0) {
169 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
172 if ($GLOBALS['enable_group_therapy']) {
173 $disallowed['gng'] = !acl_check("groups", "gadd");
174 $disallowed['gdg'] = !acl_check("groups", "gadd");
175 $disallowed['gcv'] = !acl_check("groups", "gcalendar");
176 $disallowed['gce'] = !acl_check("groups", "glog");
177 $disallowed['gvh'] = !acl_check("groups", "glog");
179 $primary_docs['gng'] = array(xl('New') , 0, 'therapy_groups/index.php?method=addGroup');
180 $primary_docs['gdg'] = array(xl('Group Details') , 3, '/therapy_groups/index.php?method=groupDetails&group_id=from_session');
181 $primary_docs['gcv'] = array(xl('Create Visit'), 3, 'forms/newGroupEncounter/new.php?autoloaded=1&calenc=');
182 $primary_docs['gce'] = array(xl('Current') , 4, 'patient_file/encounter/encounter_top.php');
183 $primary_docs['gvh'] = array(xl('Visit History'), 3, 'patient_file/history/encounters.php');
187 $esignApi = new Api();
188 // This section decides which navigation items will not appear.
191 $disallowed['edi'] = !($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob'));
192 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
193 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
194 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
195 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
196 acl_check('admin', 'superbill') || acl_check('admin', 'drugs'));
198 $disallowed['bil'] = !(acl_check('acct', 'eob') || acl_check('acct', 'bill'));
200 $disallowed['new'] = !(acl_check('patients', 'demo', '', array('write','addonly')));
202 $disallowed['fax'] = !(($GLOBALS['enable_hylafax'] || $GLOBALS['enable_scanner']) && acl_check('patients', 'docs'));
204 $disallowed['iss'] = !((acl_check('encounters', 'notes', '', 'write') ||
205 acl_check('encounters', 'notes_a', '', 'write') ) &&
206 acl_check('patients', 'med', '', 'write') );
208 $disallowed['imp'] = $disallowed['new'] || !is_readable("$webserver_root/custom/import.php");
210 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
212 $disallowed['pre'] = !(acl_check('patients', 'med'));
213 $disallowed['eob'] = !(acl_check('acct', 'eob'));
215 // Helper functions for treeview generation.
216 function genTreeLink($frame, $name, $title, $mono = false)
218 global $primary_docs, $disallowed;
219 if (empty($disallowed[$name])) {
220 $id = $name . $primary_docs[$name][1];
221 echo "<li><a href='' id='$id' onclick=\"";
222 if ($mono) {
223 if ($frame == 'RTop') {
224 echo "forceSpec(true,false);";
225 } else {
226 echo "forceSpec(false,true);";
230 echo "return loadFrame2('$id','$frame','" .
231 $primary_docs[$name][2] . "')\">" . $title . ($name == 'msg' ? ' <span id="reminderCountSpan" class="bold"></span>' : '')."</a></li>";
234 function genMiscLink($frame, $name, $level, $title, $url, $mono = false)
236 global $disallowed;
237 if (empty($disallowed[$name])) {
238 $id = $name . $level;
239 echo "<li><a href='' id='$id' onclick=\"";
240 if ($mono) {
241 if ($frame == 'RTop') {
242 echo "forceSpec(true,false);";
243 } else {
244 echo "forceSpec(false,true);";
248 echo "return loadFrame2('$id','$frame','" .
249 $url . "')\">" . $title . "</a></li>";
252 function genMiscLink2($frame, $name, $level, $title, $url, $mono = false, $mouseovertext = "")
254 global $disallowed;
255 if (empty($disallowed[$name])) {
256 $id = $name . $level;
257 echo "<li><a href='' id='$id' title='$mouseovertext' onclick=\"";
258 if ($mono) {
259 if ($frame == 'RTop') {
260 echo "forceSpec(true,false);";
261 } else {
262 echo "forceSpec(false,true);";
266 echo "return loadFrame3('$id','$frame','" .
267 $url . "')\">" . $title . "</a></li>";
270 function genPopLink($title, $url, $linkid = '')
272 echo "<li><a href='' ";
273 if ($linkid) {
274 echo "id='$linkid' ";
277 echo "onclick=\"return repPopup('$url')\"" .
278 ">" . $title . "</a></li>";
280 function genDualLink($topname, $botname, $title)
282 global $primary_docs, $disallowed;
283 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
284 $topid = $topname . $primary_docs[$topname][1];
285 $botid = $botname . $primary_docs[$botname][1];
286 echo "<li><a href='' id='$topid' " .
287 "onclick=\"return loadFrameDual('$topid','$botid','" .
288 $primary_docs[$topname][2] . "','" .
289 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
293 function genPopupsList($style = '')
295 global $disallowed, $webserver_root;
297 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
298 <option value=''><?php xl('Popups', 'e'); ?></option>
299 <?php if (!$disallowed['iss']) { ?>
300 <option value='../patient_file/problem_encounter.php'><?php xl('Issues', 'e'); ?></option>
301 <?php } ?>
302 <?php if (!$GLOBALS['ippf_specific'] && acl_check('patients', 'demo')) { ?>
303 <option value='../../custom/export_xml.php'><?php xl('Export', 'e'); ?></option>
304 <?php if (acl_check('patients', 'demo', '', 'write')) { ?>
305 <option value='../../custom/import_xml.php'><?php xl('Import', 'e'); ?></option>
306 <?php }
309 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) { ?>
310 <option value='../reports/appointments_report.php?patient=<?php if (isset($pid)) {
311 echo $pid;
312 } ?>'><?php xl('Appts', 'e'); ?></option>
313 <?php } ?>
314 <?php if (acl_check('patients', 'med')) { ?>
315 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill', 'e'); ?></option>
316 <?php } ?>
317 <?php if (acl_check('acct', 'bill', '', 'write')) { ?>
318 <option value='../patient_file/front_payment.php'><?php xl('Payment', 'e'); ?></option>
319 <?php } ?>
320 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('acct', 'bill', '', 'write')) { ?>
321 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout', 'e'); ?></option>
322 <?php } ?>
323 <?php if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates") && acl_check('patients', 'med')) { ?>
324 <option value='../patient_file/letter.php'><?php xl('Letter', 'e'); ?></option>
325 <?php } ?>
326 <?php if ($GLOBALS['chart_label_type'] != '0' && acl_check('patients', 'demo')) { ?>
327 <option value='../patient_file/label.php'><?php xl('Chart Label', 'e'); ?></option>
328 <?php } ?>
329 <?php if ($GLOBALS['barcode_label_type'] != '0' && acl_check('patients', 'demo')) { ?>
330 <option value='../patient_file/barcode_label.php'><?php xl('Barcode Label', 'e'); ?></option>
331 <?php } ?>
332 <?php if ($GLOBALS['addr_label_type'] && acl_check('patients', 'demo')) { ?>
333 <option value='../patient_file/addr_label.php'><?php xl('Address Label', 'e'); ?></option>
334 <?php } ?>
335 </select>
336 <?php
339 function genFindBlock()
342 <table cellpadding='0' cellspacing='0' border='0'>
343 <tr>
344 <td class='smalltext'><?php xl('Find', 'e') ?>:&nbsp;</td>
345 <td class='smalltext' colspan='2'>
346 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
347 </td>
348 </tr>
349 <tr>
350 <td class='smalltext'><?php xl('by', 'e') ?>:</td>
351 <td class='smalltext'>
352 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name', 'e'); ?></a>
353 </td>
354 <td class='smalltext' align='right'>
355 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID', 'e'); ?></a>
356 </td>
357 </tr>
358 <tr>
359 <td class='smalltext'>&nbsp;</td>
360 <td class='smalltext'>
361 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN', 'e'); ?></a>
362 </td>
363 <td class='smalltext' align='right'>
364 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB', 'e'); ?></a>
365 </td>
366 </tr>
367 <tr>
368 <td class='smalltext'>&nbsp;</td>
369 <td class='smalltext'>
370 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
371 </td>
372 <td class='smalltext' align='right'>
373 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
374 </td>
375 </tr>
376 </table>
377 <?php
378 } // End function genFindBlock()
380 <html>
381 <head>
382 <title>Navigation</title>
384 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
385 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative'];?>/font-awesome-4-6-3/css/font-awesome.css" type="text/css">
386 <style type="text/css">
387 body {
388 font-size:8pt;
389 font-weight:normal;
390 padding: 5px 3px 5px 3px;
392 .smalltext {
393 font-family:sans-serif;
394 font-size:8pt;
395 font-weight:normal;
397 a.navitem, a.navitem:visited {
398 color:#0000ff;
399 font-family:sans-serif;
400 font-size:8pt;
401 font-weight:bold;
403 .inputtext {
404 font-size:9pt;
405 font-weight:normal;
406 border-style:solid;
407 border-width:1px;
408 padding-left:2px;
409 padding-right:2px;
410 border-color: #000000;
411 background-color:transparent;
414 #navigation ul {
415 background-color:transparent;
417 #navigation-slide ul {
418 background-color:transparent;
420 #navigation-slide a{
421 width: 92%;
423 .nav-menu-img{
424 width:25px;
425 height:25px;
426 border:none;
427 margin-right:5px;
428 vertical-align:middle;
430 </style>
432 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.4.1/jquery.treeview.css" />
433 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-7-2/index.js"></script>
434 <script type="text/javascript" src="../../library/js/jquery.treeview-1.4.1/jquery.treeview.js" ></script>
436 <script type="text/javascript" src="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
438 <script language='JavaScript'>
439 // User settings
440 var usrval = jQuery.parseJSON('<?php echo $usrval ?>');
442 // tajemo work by CB 2012/01/31 12:32:57 PM dated reminders counter
443 function getReminderCount(){
444 top.restoreSession();
445 // Send the skip_timeout_reset parameter to not count this as a manual entry in the
446 // timing out mechanism in OpenEMR.
447 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/dated_reminders_counter.php",
448 { skip_timeout_reset: "1" },
449 function(data) {
450 $("#reminderCountSpan").html(data);
451 // run updater every 60 seconds
452 var repeater = setTimeout("getReminderCount()", 60000);
454 //piggy-back on this repeater to run other background-services
455 //this is a silent task manager that returns no output
456 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/execute_background_services.php",
457 { skip_timeout_reset: "1", ajax: "1" });
460 $(document).ready(function (){
461 getReminderCount();//
462 parent.loadedFrameCount += 1;
463 for (var i = 0, len = usrval.length; i < len; i++) {
464 if (usrval[i] != "checked") toggleFrame(i+1);
467 // end of tajemo work dated reminders counter
469 // Master values for current pid and encounter.
470 var active_pid = 0;
471 var active_encounter = 0;
472 var encounter_locked = false;
473 //therapy group id
474 var active_gid = 0;
476 // Current selections in the top and bottom frames.
477 var topName = '';
478 var botName = '';
480 // Expand and/or collapse frames in response to checkbox clicks.
481 // fnum indicates which checkbox was clicked (1=left, 2=right).
482 function toggleFrame(fnum) {
483 var f = document.forms[0];
484 var fset = top.document.getElementById('fsright');
485 if (!f.cb_top.checked && !f.cb_bot.checked) {
486 if (fnum == 1) f.cb_bot.checked = true;
487 else f.cb_top.checked = true;
489 var rows = f.cb_top.checked ? '*' : '0';
490 rows += f.cb_bot.checked ? ',*' : ',0';
491 fset.rows = rows;
492 save_setting ([(f.cb_top.checked ? 'checked' : '&nbsp;'), (f.cb_bot.checked ? 'checked' : '&nbsp;')]);
495 // Load the specified url into the specified frame (RTop or RBot).
496 // The URL provided must be relative to interface.
497 function loadFrame(fname, frame, url) {
498 top.restoreSession();
499 var i = url.indexOf('{PID}');
500 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
501 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
502 if (frame == 'RTop') topName = fname; else botName = fname;
505 // Load the specified url into a frame to be determined, with the specified
506 // frame as the default; the url must be relative to interface.
507 function loadFrame2(fname, frame, url) {
508 var usage = fname.substring(3);
509 if (active_pid == 0 && active_gid == 0 && (usage > '0' && usage < '5')){
510 <?php if ($GLOBALS['enable_group_therapy']) { ?>
511 alert('<?php xl('You must first select or add a patient or therapy group.', 'e') ?>');
512 <?php } else { ?>
513 alert('<?php xl('You must first select or add a patient.', 'e') ?>');
514 <?php } ?>
515 return false;
517 if (active_encounter == 0 && (usage > '1' && usage < '3')) {
518 alert('<?php xl('You must first select or create an encounter.', 'e') ?>');
519 return false;
521 if (encounter_locked && usage > '1' && (usage > '1' && usage < '3')) {
522 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
523 return false;
525 var f = document.forms[0];
526 top.restoreSession();
527 var i = url.indexOf('{PID}');
528 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
529 if(f.sel_frame)
531 var fi = f.sel_frame.selectedIndex;
532 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
534 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
535 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
536 if (frame == 'RTop') topName = fname; else botName = fname;
537 return false;
540 function loadFrame3(fname, frame, url) {
541 var f = document.forms[0];
542 top.restoreSession();
543 var i = url.indexOf('{PID}');
544 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
545 if(f.sel_frame)
547 var fi = f.sel_frame.selectedIndex;
548 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
550 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
551 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
552 if (frame == 'RTop') topName = fname; else botName = fname;
553 return false;
556 // Make sure the the top and bottom frames are open or closed, as specified.
557 function forceSpec(istop, isbot) {
558 var f = document.forms[0];
559 if (f.cb_top.checked != istop) {
560 f.cb_top.checked = istop;
561 toggleFrame(1);
563 if (f.cb_bot.checked != isbot) {
564 f.cb_bot.checked = isbot;
565 toggleFrame(2);
569 // Make sure both frames are open.
570 function forceDual() {
571 forceSpec(true, true);
574 // Load the specified url into a frame to be determined, with the specified
575 // frame as the default; the url must be relative to interface.
576 function loadFrameDual(tname, bname, topurl, boturl) {
577 var topusage = tname.substring(3);
578 var botusage = bname.substring(3);
579 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
580 alert('<?php xl('You must first select or add a patient.', 'e') ?>');
581 return false;
583 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
584 alert('<?php xl('You must first select or create an encounter.', 'e') ?>');
585 return false;
587 if (encounter_locked && (topusage > '1' || botusage > '1')) {
588 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
589 return false;
591 var f = document.forms[0];
592 forceDual();
593 top.restoreSession();
594 var i = topurl.indexOf('{PID}');
595 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
596 i = boturl.indexOf('{PID}');
597 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
598 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
599 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
600 topName = tname;
601 botName = bname;
602 return false;
605 // Set disabled/enabled state of radio buttons and associated labels
606 // depending on whether there is an active patient or encounter.
607 function syncRadios() {
608 var f = document.forms[0];
609 encounter_locked = isEncounterLocked(active_encounter);
610 var nlinks = document.links.length;
611 for (var i = 0; i < nlinks; ++i) {
612 var lnk = document.links[i];
613 if (lnk.id.length != 4) continue;
614 var usage = lnk.id.substring(3);
615 if (usage == '1' || usage == '2') {
616 var da = false;
617 if (active_pid == 0) da = true;
618 if (active_encounter == 0 && usage > '1') da = true;
619 if (encounter_locked && usage > '1') da = true;
620 <?php
621 if ($GLOBALS['menu_styling_vertical'] == 0) {
622 $color = "'#0000ff'";
623 } else { // ($GLOBALS['menu_styling_vertical'] == 1)
624 $color = "'#000000'";
627 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
629 //for therapy groups menu
630 <?php if ($GLOBALS['enable_group_therapy']) { ?>
631 if (usage == '3' || usage == '4') {
632 var da = false;
633 if (active_gid == 0) da = true;
634 if (active_encounter == 0 && usage > '3') da = true;
635 if (encounter_locked && usage > '3') da = true;
636 <?php
637 if ($GLOBALS['menu_styling_vertical'] == 0) {
638 $color = "'#0000ff'";
639 } else { // ($GLOBALS['menu_styling_vertical'] == 1)
640 $color = "'#000000'";
643 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
645 <?php } ?>
648 f.popups.disabled = (active_pid == 0);
651 function goHome() {
652 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
653 top.frames['RBot'].location='messages/messages.php?form_active=1';
656 //Function to clear active patient and encounter in the server side
657 function clearactive() {
658 top.restoreSession();
659 //Ajax call to clear active patient in session
660 var method = (active_pid > 0) ? 'unset_pid' : 'unset_gid';
661 $.ajax({
662 type: "POST",
663 url: "<?php echo $GLOBALS['webroot'] ?>/library/ajax/unset_session_ajax.php",
664 data: { func: method},
665 success:function( msg ) {
666 clearPatient();
667 clearTherapyGroup();
668 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
669 top.frames['RBot'].location='messages/messages.php?form_active=1';
673 $(parent.Title.document.getElementById('clear_active')).hide();
674 $(parent.Title.document.getElementById('clear_active_group')).hide();
676 // Reference to the search.php window.
677 var my_window;
679 // Open the search.php window.
680 function initFilter() {
681 my_window = window.open("../../custom/search.php", "mywindow","status=1");
684 // This is called by the search.php (Filter) window.
685 function processFilter(fieldString, serviceCode) {
686 var f = document.forms[0];
687 document.getElementById('searchFields').value = fieldString;
688 f.search_service_code.value = serviceCode;
689 findPatient("Filter");
690 f.search_service_code.value = '';
691 my_window.close();
694 // Process the click to find a patient by name, id, ssn or dob.
695 function findPatient(findby) {
696 var f = document.forms[0];
697 if (! f.cb_top.checked) {
698 f.cb_top.checked = true;
699 toggleFrame(1);
701 f.findBy.value = findby;
702 top.restoreSession();
703 document.find_patient.submit();
706 // Helper function to set the contents of a div.
707 function setSomeContent(id, content, doc) {
708 if (doc.getElementById) {
709 var x = doc.getElementById(id);
710 x.innerHTML = '';
711 x.innerHTML = content;
713 else if (doc.all) {
714 var x = doc.all[id];
715 x.innerHTML = content;
718 function setDivContent(id, content) {
719 setSomeContent(id, content, document);
721 function setTitleContent(id, content) {
722 setSomeContent(id, content, parent.Title.document);
725 // This is called automatically when a new patient is set, to make sure
726 // there are no patient-specific documents showing stale data. If a frame
727 // was just loaded with data for the correct patient, its name is passed so
728 // that it will not be zapped. At this point the new server-side pid is not
729 // assumed to be set, so this function will only load global data.
730 function reloadPatient(frname) {
731 var f = document.forms[0];
732 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
733 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
735 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
736 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
740 // Reload encounter-specific frames, excluding a specified frame. At this
741 // point the new server-side encounter ID may not be set and loading the same
742 // document for the new encounter will not work, so load patient info instead.
743 function reloadEncounter(frname) {
744 var f = document.forms[0];
745 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
746 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
748 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
749 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
754 // Call this to announce that the patient has changed. You must call this
755 // if you change the session PID, so that the navigation frame will show the
756 // correct patient and so that the other frame will be reloaded if it contains
757 // patient-specific information from the previous patient. frname is the name
758 // of the frame that the call came from, so we know to only reload content
759 // from the *other* frame if it is patient-specific.
760 function setPatient(pname, pid, pubpid, frname, str_dob) {
761 clearTherapyGroup();
762 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
763 setDivContent('current_patient', str);
764 setTitleContent('current_patient', str + str_dob);
765 if (pid == active_pid) return;
766 setDivContent('current_encounter', '<b><?php xl('None', 'e'); ?></b>');
767 active_pid = pid;
768 active_encounter = 0;
769 encounter_locked = false;
770 if (frname) reloadPatient(frname);
771 syncRadios();
772 $(parent.Title.document.getElementById('current_patient_block')).show();
773 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
774 $(encounter_block).hide();
776 // zero out the encounter frame, replace it with the encounter list frame
777 var f = document.forms[0];
778 if ( f.cb_top.checked && f.cb_bot.checked ) {
779 var encounter_frame = getEncounterTargetFrame('enc');
780 if ( encounter_frame != undefined ) {
781 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
785 $(parent.Title.document.getElementById('clear_active')).show();//To display Clear Active Patient button on selecting a patient
786 $(parent.Title.document.getElementById('clear_active_group')).hide();//To hide Clear Active group button on selecting a patient
790 // Call this to announce that the therapy group has changed. You must call this
791 // if you change the session 'therapy_group', so that the navigation frame will show the
792 // correct group.
793 function setTherapyGroup(group_id, group_name) {
794 clearPatient();
796 $(parent.Title.document.querySelector('#current_patient_block span.text')).hide();
797 setTitleContent('current_patient', '<span><?php echo xls('Therapy Group');?> - <a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentGroupFromTitle(' + group_id +')">' + group_name + ' (' + group_id + ')<a></span>' );
798 if (group_id == active_gid) return;
799 setDivContent('current_encounter', '<b><?php xl('None', 'e'); ?></b>');
800 active_gid = group_id;
801 active_encounter = 0;
802 encounter_locked = false;
803 syncRadios();
804 $(parent.Title.document.getElementById('current_patient_block')).show();
805 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
806 $(encounter_block).hide();
808 // zero out the encounter frame, replace it with the encounter list frame
809 var f = document.forms[0];
810 if ( f.cb_top.checked && f.cb_bot.checked ) {
811 var encounter_frame = getEncounterTargetFrame('enc');
812 if ( encounter_frame != undefined ) {
813 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
817 $(parent.Title.document.getElementById('clear_active_group')).show();//To display Clear Active group button on selecting a patient
818 $(parent.Title.document.getElementById('clear_active')).hide();//To hide Clear Active Patient button on selecting a patient
821 function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) {
822 //This function lists all encounters of the patient.
823 //This function writes the drop down in the top frame.
824 //It is called when a new patient is create/selected from the search menu.
825 var str = '<Select class="text" id="EncounterHistory" onchange="{top.restoreSession();toencounter(this.options[this.selectedIndex].value)}">';
826 str+='<option value=""><?php echo htmlspecialchars(xl('Encounter History'), ENT_QUOTES) ?></option>';
827 <?php if (acl_check_form('newpatient', '', array('write', 'addonly'))) { ?>
828 str+='<option value="New Encounter"><?php echo htmlspecialchars(xl('New Encounter'), ENT_QUOTES) ?></option>';
829 <?php } ?>
830 str+='<option value="Past Encounter List"><?php echo htmlspecialchars(xl('Past Encounter List'), ENT_QUOTES) ?></option>';
831 for(CountEncounter=0;CountEncounter<EncounterDateArray.length;CountEncounter++)
833 str+='<option value="'+EncounterIdArray[CountEncounter]+'~'+EncounterDateArray[CountEncounter]+'">'+EncounterDateArray[CountEncounter]+'-'+CalendarCategoryArray[CountEncounter]+'</option>';
835 str+='</Select>';
836 $(parent.Title.document.getElementById('past_encounter_block')).show();
837 top.window.parent.Title.document.getElementById('past_encounter').innerHTML=str;
840 function loadCurrentPatientFromTitle() {
841 top.restoreSession();
842 top.frames['RTop'].location='../patient_file/summary/demographics.php';
845 function loadCurrentGroupFromTitle(gid) {
846 top.restoreSession();
847 top.frames['RTop'].location='../therapy_groups/index.php?method=groupDetails&group_id=' + gid;
850 function getEncounterTargetFrame( name ) {
851 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
852 var f = document.forms[0];
853 var r = 'RTop';
854 if (f.cb_top.checked && f.cb_bot.checked) {
855 if ( bias == 2 ) {
856 r = 'RBot';
857 } else {
858 r = 'RTop';
860 } else {
861 if ( f.cb_top.checked ) {
862 r = 'RTop';
863 } else if ( f.cb_bot.checked ) {
864 r = 'RBot';
867 return r;
870 function isEncounterLocked( encounterId ) {
871 <?php if ($esignApi->lockEncounters()) { ?>
872 // If encounter locking is enabled, make a syncronous call (async=false) to check the
873 // DB to see if the encounter is locked.
874 // Call restore session, just in case
875 top.restoreSession();
876 $.ajax({
877 type: 'POST',
878 url: '<?php echo $GLOBALS['webroot']?>/interface/esign/index.php?module=encounter&method=esign_is_encounter_locked',
879 data: { encounterId : encounterId },
880 success: function( data ) {
881 encounter_locked = data;
883 dataType: 'json',
884 async:false
886 return encounter_locked;
887 <?php } else { ?>
888 // If encounter locking isn't enabled, just tell the left_nav that the encounter
889 // isn't locked.
890 return false;
891 <?php } ?>
894 // Call this to announce that the encounter has changed. You must call this
895 // if you change the session encounter, so that the navigation frame will
896 // show the correct encounter and so that the other frame will be reloaded if
897 // it contains encounter-specific information from the previous encounter.
898 // frname is the name of the frame that the call came from, so we know to only
899 // reload encounter-specific content from the *other* frame.
900 function setEncounter(edate, eid, frname) {
901 if (eid == active_encounter) return;
902 if (!eid) edate = '<?php xl('None', 'e'); ?>';
903 var str = '<b>' + edate + '</b>';
904 setDivContent('current_encounter', str);
905 active_encounter = eid;
906 encounter_locked=isEncounterLocked(active_encounter);
907 reloadEncounter(frname);
908 syncRadios();
909 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
910 var encounter = $(parent.Title.document.getElementById('current_encounter'));
911 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
912 encounter.html( estr );
913 encounter_block.show();
916 function loadCurrentEncounterFromTitle() {
917 top.restoreSession();
918 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/encounter_top.php';
921 // You must call this if you delete the active patient (or if for any other
922 // reason you "close" the active patient without opening a new one), so that
923 // the appearance of the navigation frame will be correct and so that any
924 // stale content will be reloaded.
925 function clearPatient() {
926 if (active_pid == 0) return;
927 var f = document.forms[0];
928 active_pid = 0;
929 active_encounter = 0;
930 encounter_locked = false;
931 setDivContent('current_patient', '<b><?php xl('None', 'e'); ?></b>');
932 $(parent.Title.document.getElementById('current_patient_block')).hide();
933 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
934 $(parent.Title.document.getElementById('current_encounter_block')).hide();
935 reloadPatient('');
936 syncRadios();
939 // You must call this if you delete the active therapy group so that
940 // the appearance of the navigation frame will be correct and so that any
941 // stale content will be reloaded.
942 function clearTherapyGroup() {
943 if (active_gid == 0) return;
944 var f = document.forms[0];
945 active_gid = 0;
946 active_encounter = 0;
947 encounter_locked = false;
948 setDivContent('current_patient', '<b><?php xl('None', 'e'); ?></b>');
949 $(parent.Title.document.getElementById('current_patient_block')).hide();
950 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
951 $(parent.Title.document.getElementById('current_encounter_block')).hide();
952 syncRadios();
955 // You must call this if you delete the active encounter (or if for any other
956 // reason you "close" the active encounter without opening a new one), so that
957 // the appearance of the navigation frame will be correct and so that any
958 // stale content will be reloaded.
959 function clearEncounter() {
960 if (active_encounter == 0) return;
961 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars(xl('None'), ENT_QUOTES) ?></b>";
962 active_encounter = 0;
963 encounter_locked = false;
964 reloadEncounter('');
965 syncRadios();
968 function removeOptionSelected(EncounterId)
969 {//Removes an item from the Encounter drop down.
970 var elSel = top.window.parent.Title.document.getElementById('EncounterHistory');
971 var i;
972 for (i = elSel.length - 1; i>=2; i--) {
973 EncounterHistoryValue=elSel.options[i].value;
974 EncounterHistoryValueArray=EncounterHistoryValue.split('~');
975 if (EncounterHistoryValueArray[0]==EncounterId) {
976 elSel.remove(i);
981 // You can call this to make sure the session pid is what we expect.
982 function pidSanityCheck(pid) {
983 if (pid != active_pid) {
984 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
985 '. This session is unstable and should be abandoned. Do not use ' +
986 'OpenEMR in multiple browser windows!');
987 return false;
989 return true;
992 // You can call this to make sure the session encounter is what we expect.
993 function encounterSanityCheck(eid) {
994 if (eid != active_encounter) {
995 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
996 '. This session is unstable and should be abandoned. Do not use ' +
997 'OpenEMR in multiple browser windows!');
998 return false;
1000 return true;
1003 // Pop up a report.
1004 function repPopup(aurl) {
1005 top.restoreSession();
1006 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
1007 return false;
1010 // This is invoked to pop up some window when a popup item is selected.
1011 function selpopup(selobj) {
1012 var i = selobj.selectedIndex;
1013 var opt = selobj.options[i];
1014 if (i > 0) {
1015 var width = 750;
1016 var height = 550;
1017 if (opt.text == 'Export' || opt.text == 'Import') {
1018 width = 500;
1019 height = 400;
1021 dlgopen(opt.value, '_blank', width, height);
1023 selobj.selectedIndex = 0;
1026 // Treeview activation stuff:
1027 $(document).ready(function(){
1028 if(1 == <?php echo $GLOBALS['menu_styling_vertical'] ?>){
1029 $("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
1030 $("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
1031 $("#navigation-slide > li > ul > li > ul > li > a.collapsed_lv3 + ul").slideToggle("medium");
1032 $("#navigation-slide > li > a.expanded").click(function() {
1033 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1034 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1036 $("#navigation-slide > li > a.collapsed").click(function() {
1037 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1038 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1040 $("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
1041 $("#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");
1042 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1044 $("#navigation-slide > li > ul > li > ul > li > a.expanded_lv3").click(function() {
1045 $("#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");
1046 $(this).toggleClass("expanded_lv3").toggleClass("collapsed_lv3").parent().find('> ul').slideToggle("medium");
1048 $("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
1049 $("#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");
1050 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1052 $("#navigation-slide > li > ul > li > ul > li > a.collapsed_lv3").click(function() {
1053 $("#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");
1054 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1056 $("#navigation-slide > li > a#cal0").prepend('<i class="fa fa-fw fa-calendar fa-2x"></i>&nbsp;');
1057 $("#navigation-slide > li > a#pfb0").prepend('<i class="fa fa-fw fa-list-alt fa-2x"></i>&nbsp;');
1058 $("#navigation-slide > li > a#msg0").prepend('<i class="fa fa-fw fa-envelope-o fa-2x"></i>&nbsp;');
1059 $("#navigation-slide > li > a#app0").prepend('<i class="fa fa-fw fa-user fa-2x"></i>&nbsp;');
1060 $("#navigation-slide > li > a#aop0").prepend('<i class="fa fa-fw fa-tachometer fa-2x"></i>&nbsp;');
1061 $("#navigation-slide > li > a#ppo0").prepend('<i class="fa fa-fw fa-users fa-2x"></i>&nbsp;');
1062 $("#navigation-slide > li > a#repimg").prepend('<i class="fa fa-fw fa-area-chart fa-2x"></i>&nbsp;');
1063 $("#navigation-slide > li > a#feeimg").prepend('<i class="fa fa-fw fa-dollar fa-2x"></i>&nbsp;');
1064 $("#navigation-slide > li > a#adm0").prepend('<i class="fa fa-fw fa-list-ol fa-2x"></i>&nbsp;');
1065 $("#navigation-slide > li > a#invimg").prepend('<i class="fa fa-fw fa-list-ol fa-2x"></i>&nbsp;');
1066 $("#navigation-slide > li > a#admimg").prepend('<i class="fa fa-fw fa-cogs fa-2x"></i>&nbsp;');
1067 $("#navigation-slide > li > a#misimg").prepend('<i class="fa fa-fw fa-cog fa-2x"></i>&nbsp;');
1068 $("#navigation-slide > li > a#proimg").prepend('<i class="fa fa-fw fa-stethoscope fa-2x"></i>&nbsp;');
1069 $("#navigation-slide > li > a#modimg").prepend('<i class="fa fa-fw fa-puzzle-piece fa-2x"></i>&nbsp;');
1070 $("#navigation-slide > li").each(function(index) {
1071 if($(" > ul > li", this).size() == 0){
1072 $(" > a", this).addClass("collapsed");
1075 } else { // $GLOBALS['menu_styling_vertical'] == 0
1077 //Remove the links (used by the sliding menu) that will break treeview
1078 $('a.collapsed').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1079 $('a.collapsed_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1080 $('a.collapsed_lv3').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1081 $('a.expanded').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1082 $('a.expanded_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1083 $('a.expanded_lv3').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1085 // Initiate treeview
1086 $("#navigation").treeview({
1087 animated: "fast",
1088 collapsed: true,
1089 unique: true,
1090 toggle: function() {
1091 window.console && console.log("%o was toggled", this);
1097 </script>
1099 </head>
1101 <body class="body_nav main-left">
1103 <form method='post' name='find_patient' target='RTop'
1104 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
1106 <center>
1107 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:100;'>
1108 <option value='0'><?php xl('Default', 'e'); ?></option>
1109 <option value='1'><?php xl('Top', 'e'); ?></option>
1110 <option value='2'><?php xl('Bottom', 'e'); ?></option>
1111 </select>
1112 </center>
1114 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1115 <tr>
1116 <td class='smalltext' nowrap>
1117 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' <?php echo $cb_top_chk ?> />
1118 <b><?php xl('Top', 'e') ?></b>
1119 </td>
1120 <td class='smalltext' align='right' nowrap>
1121 <b><?php xl('Bot', 'e') ?></b>
1122 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php echo $cb_bot_chk ?> />
1123 </td>
1124 </tr>
1125 </table>
1127 <?php if ($GLOBALS['menu_styling_vertical'] == 1) { ?>
1128 <ul id="navigation-slide">
1129 <?php } else { // ($GLOBALS['menu_styling_vertical'] == 0) ?>
1130 <ul id="navigation">
1131 <?php } ?>
1133 <?php
1134 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1135 genTreeLink('RTop', 'cal', xl('Calendar'));
1138 if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1139 genTreeLink('RTop', 'pfb', xl('Flow Board'));
1142 if (acl_check('patients', 'notes')) {
1143 genTreeLink('RBot', 'msg', xl('Messages'));
1146 if ($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address'] && acl_check('patientportal', 'portal')) {
1147 genTreeLink('RTop', 'app', xl('Portal Activity'));
1150 if ($GLOBALS['portal_onsite_two_enable'] && acl_check('patientportal', 'portal')) {
1151 genTreeLink('RTop', 'aop', xl('Portal Dashboard'));
1154 if ($GLOBALS['gbl_portal_cms_enable'] && acl_check('patientportal', 'portal')) {
1155 genPopLink(xl('CMS Portal'), '../cmsportal/list_requests.php', 'ppo0');
1159 <li class="open"><a class="collapsed" id="patimg" ><i class="fa fa-fw fa-user fa-2x"></i>&nbsp;<span><?php xl('Patient/Client', 'e') ?></span></a>
1160 <ul>
1161 <?php if (acl_check('patients', 'demo')) {
1162 genMiscLink('RTop', 'fin', '0', xl('Patients'), 'main/finder/dynamic_finder.php');
1163 } ?>
1164 <?php if (acl_check('patients', 'demo', '', 'write') || acl_check('patients', 'demo', '', 'addonly')) {
1165 genTreeLink('RTop', 'new', ($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New')));
1166 } ?>
1167 <?php if (acl_check('patients', 'demo')) {
1168 genTreeLink('RTop', 'dem', xl('Summary'));
1169 } ?>
1171 <?php if (acl_check('patients', 'appt') || acl_check_form('newpatient', '', array('write', 'addonly'))) { ?>
1172 <li class="open"><a class="expanded_lv2"><span><?php xl('Visits', 'e') ?></span></a>
1173 <ul>
1174 <?php if (acl_check_form('newpatient', '', array('write', 'addonly'))) {
1175 genTreeLink('RBot', 'nen', xl('Create Visit'));
1176 } ?>
1177 <?php if (acl_check('patients', 'appt')) {
1178 genTreeLink('RBot', 'enc', xl('Current'));
1179 } ?>
1180 <?php if (acl_check('patients', 'appt')) {
1181 genTreeLink('RBot', 'ens', xl('Visit History'));
1182 } ?>
1183 </ul>
1184 </li>
1185 <?php } ?>
1187 <?php if (acl_check('patients', 'med')) { ?>
1188 <li><a class="collapsed_lv2"><span><?php xl('Records', 'e') ?></span></a>
1189 <ul>
1190 <?php genTreeLink('RTop', 'prq', xl('Patient Record Request')); ?>
1191 </ul>
1192 </li>
1193 <?php } ?>
1195 <?php if ($GLOBALS['gbl_nav_visit_forms'] && acl_check('patients', 'demo')) { ?>
1196 <li><a class="collapsed_lv2"><span><?php xl('Visit Forms', 'e') ?></span></a>
1197 <ul>
1198 <?php
1199 // Generate the items for visit forms, both traditional and LBF.
1201 $reglastcat = '';
1202 $regrows = getFormsByCategory(); // defined in registry.inc
1203 foreach ($regrows as $entry) {
1204 $option_id = $entry['directory'];
1205 $title = trim($entry['nickname']);
1206 if ($option_id == 'fee_sheet') {
1207 continue;
1209 if ($option_id == 'newpatient') {
1210 continue;
1212 // Check permission to create forms of this type.
1213 $tmp = explode('|', $entry['aco_spec']);
1214 if (!empty($tmp[1])) {
1215 if (!acl_check($tmp[0], $tmp[1], '', 'write') && !acl_check($tmp[0], $tmp[1], '', 'addonly')) {
1216 continue;
1219 if (empty($title)) {
1220 $title = $entry['name'];
1222 if ($entry['category'] != $reglastcat) {
1223 if ($reglastcat) {
1224 echo " </ul></li>\n";
1226 echo " <li><a class='collapsed_lv3'><span>" . xlt($entry['category']) . "</span></a><ul>\n";
1227 $reglastcat = $entry['category'];
1229 genMiscLink(
1230 'RBot',
1231 'cod',
1232 '2',
1233 xl_form_title($title),
1234 "patient_file/encounter/load_form.php?formname=" . urlencode($option_id)
1237 if ($reglastcat) {
1238 echo " </ul></li>\n";
1241 </ul>
1242 </li>
1243 <li class="collapsed" ><a class="collapsed_lv2"><span><?php echo xlt('Import') ?></span></a>
1244 <ul>
1245 <?php genMiscLink('RTop', 'ccr', '0', xlt('Upload'), 'patient_file/ccr_import.php'); ?>
1246 <?php genMiscLink('RTop', 'apr', '0', xlt('Pending Approval'), 'patient_file/ccr_pending_approval.php'); ?>
1247 </ul>
1248 </li>
1249 <?php } // end if gbl_nav_visit_forms ?>
1251 </ul>
1252 </li>
1254 <?php if ($GLOBALS['enable_group_therapy']) : ?>
1255 <li><a class="collapsed" id="groupimg" ><i class="fa fa-fw fa-users"></i>&nbsp;<span><?php xl('Group', 'e') ?></span></a>
1256 <ul>
1257 <?php genMiscLink('RTop', 'gfn', '0', xl('Groups'), 'therapy_groups/index.php?method=listGroups'); ?>
1258 <?php genTreeLink('RTop', 'gng', xl('New')); ?>
1259 <?php genTreeLink('RTop', 'gdg', xl('Group Details')); ?>
1260 <li><a class="collapsed_lv2"><span><?php xl('Visits', 'e') ?></span></a>
1261 <ul>
1262 <?php genTreeLink('RBot', 'gcv', xl('Create Visit')); ?>
1263 <?php genTreeLink('RBot', 'gce', xl('Current')); ?>
1264 <?php genTreeLink('RBot', 'gvh', xl('Visit History')); ?>
1265 </ul>
1266 </li>
1268 </ul>
1269 </li>
1270 <?php endif ?>
1272 <?php // TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1273 <?php if ((!isset($GLOBALS['enable_fees_in_left_menu']) || $GLOBALS['enable_fees_in_left_menu'] == 1) &&
1274 (acl_check('encounters', 'coding') || acl_check('acct', 'eob') || acl_check('acct', 'bill', '', 'write'))) { ?>
1275 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees', 'e') ?></span></a>
1276 <ul>
1277 <?php if (acl_check('encounters', 'coding')) {
1278 genMiscLink('RBot', 'cod', '2', xl('Fee Sheet'), 'patient_file/encounter/load_form.php?formname=fee_sheet');
1279 } ?>
1280 <?php if ($GLOBALS['use_charges_panel'] && acl_check('encounters', 'coding')) {
1281 genTreeLink('RBot', 'cod', xl('Charges'));
1282 } ?>
1283 <?php if (acl_check('acct', 'bill', '', 'write')) {
1284 genMiscLink('RBot', 'pay', '1', xl('Payment'), 'patient_file/front_payment.php');
1285 } ?>
1286 <?php if (acl_check('acct', 'bill', '', 'write')) {
1287 genMiscLink('RBot', 'bil', '1', xl('Checkout'), 'patient_file/pos_checkout.php?framed=1');
1288 } ?>
1289 <?php if (!$GLOBALS['simplified_demographics'] && (acl_check('acct', 'bill', '', 'write') || acl_check('acct', 'eob', '', 'write'))) {
1290 genTreeLink('RTop', 'bil', xl('Billing'));
1291 } ?>
1292 <?php if ($GLOBALS['enable_batch_payment'] && (acl_check('acct', 'bill', '', 'write') || acl_check('acct', 'eob', '', 'write'))) {
1293 genTreeLink('RTop', 'npa', xl('Batch Payments'), false, 2);
1295 <?php if ($GLOBALS['enable_posting'] && acl_check('acct', 'eob', '', 'write')) {
1296 genMiscLink('RTop', 'eob', '0', xl('Posting'), 'billing/sl_eob_search.php');
1297 } ?>
1298 <?php if ($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob')) {
1299 genTreeLink('RTop', 'edi', xl('EDI History'), false, 2);
1301 </ul>
1302 </li>
1303 <?php } ?>
1305 <?php if (acl_check('menus', 'modle')) {?>
1306 <li><a class="collapsed" id="modimg" ><span><?php echo xlt('Modules') ?></span></a>
1307 <ul>
1308 <?php genMiscLink('RTop', 'adm', '0', xl('Manage Modules'), 'modules/zend_modules/public/Installer'); ?>
1309 <?php //genTreeLink('RTop','ort',xl('Settings')); ?>
1310 <?php
1311 $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");
1312 if (sqlNumRows($module_query)) {
1313 while ($modulerow = sqlFetchArray($module_query)) {
1314 $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
1315 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1316 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']));
1318 $modulePath = "";
1319 $added = "";
1320 if ($modulerow['type'] == 0) {
1321 $modulePath = $GLOBALS['customModDir'];
1322 $added = "";
1323 } else {
1324 $added = "index";
1325 $modulePath = $GLOBALS['zendModDir'];
1328 if (sqlNumRows($module_hooks) == 0) {
1329 // module without hooks in module section
1330 $acl_section = strtolower($modulerow['mod_directory']);
1331 $disallowed[$acl_section] = zh_acl_check($_SESSION['authUserID'], $acl_section) ? "" : "1";
1333 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$added;
1334 $mod_nick_name = $modulerow['mod_nick_name'] ? $modulerow['mod_nick_name'] : $modulerow['mod_name'];
1335 genMiscLink2('RTop', $acl_section, '0', xlt($mod_nick_name), $relative_link);
1336 } else {
1337 // module with hooks in module section
1338 $jid = 0;
1339 $modid = '';
1340 while ($hookrow = sqlFetchArray($module_hooks)) {
1341 $disallowed[$hookrow['obj_name']] = !$disallowed['adm'] || zh_acl_check($_SESSION['authUserID'], $hookrow['obj_name']) ? "" : "1";
1343 $relative_link ="modules/".$modulePath."/".$hookrow['mod_relative_link'].$hookrow['path'];
1344 $mod_nick_name = $hookrow['menu_name'] ? $hookrow['menu_name'] : 'NoName';
1346 if ($jid==0 || ($modid!=$hookrow['mod_id'])) {
1347 if ($modid!='') {
1348 echo "</ul>";
1351 <li><a class="collapsed_lv2"><span><?php echo xlt($hookrow['mod_ui_name']); ?></span></a>
1352 <ul>
1353 <?php
1356 $jid++;
1357 $modid = $hookrow['mod_id'];
1358 genMiscLink('RTop', $hookrow['obj_name'], '0', xlt($mod_nick_name), $relative_link);
1361 echo "</ul>";
1365 <?php
1366 } ?>
1367 </ul>
1368 </li>
1370 <?php } ?>
1372 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1373 <li><a class="collapsed" id="invimg" ><span><?php xl('Inventory', 'e') ?></span></a>
1374 <ul>
1375 <?php genMiscLink('RTop', 'adm', '0', xl('Management'), 'drugs/drug_inventory.php'); ?>
1376 <?php genPopLink(xl('Destroyed'), 'destroyed_drugs_report.php'); ?>
1377 </ul>
1378 </li>
1379 <?php } ?>
1381 <?php if (acl_check('patients', 'lab')) { ?>
1382 <li><a class="collapsed" id="proimg" ><span><?php xl('Procedures', 'e') ?></span></a>
1383 <ul>
1384 <?php if (acl_check('admin', 'super')) {
1385 genTreeLink('RTop', 'orl', xl('Providers'));
1386 } ?>
1387 <?php if (acl_check('admin', 'super')) {
1388 genTreeLink('RTop', 'ort', xl('Configuration'));
1389 } ?>
1390 <?php if (acl_check('admin', 'super')) {
1391 genTreeLink('RTop', 'orc', xl('Load Compendium'));
1392 } ?>
1393 <?php genTreeLink('RTop', 'orp', xl('Pending Review')); ?>
1394 <?php genTreeLink('RTop', 'orr', xl('Patient Results')); ?>
1395 <?php genTreeLink('RTop', 'lda', xl('Lab Overview')); ?>
1396 <?php genTreeLink('RTop', 'orb', xl('Batch Results')); ?>
1397 <?php genTreeLink('RTop', 'ore', xl('Electronic Reports')); ?>
1398 <?php genTreeLink('RTop', 'dld', xl('Lab Documents'));?>
1399 </ul>
1400 </li>
1401 <?php } ?>
1403 <?php
1404 if ($GLOBALS['erx_enable'] && acl_check('patients', 'rx')) {
1405 $newcrop_user_role = sqlQuery("SELECT newcrop_user_role FROM users WHERE username = '".$_SESSION['authUser']."'");
1406 if ($newcrop_user_role['newcrop_user_role']) {
1408 <li><a class="collapsed" id="feeimg" ><span><?php xl('New Crop', 'e') ?></span></a>
1409 <ul>
1410 <li><a class="collapsed_lv2"><span><?php xl('Status', 'e') ?></span></a>
1411 <ul>
1412 <?php genTreeLink('RTop', 'erx', xl('e-Rx')); ?>
1413 <?php genMiscLink('RTop', 'err', '0', xl('e-Rx Renewal'), 'eRx.php?page=status'); ?>
1414 <?php if ($newcrop_user_role['newcrop_user_role'] === 'erxadmin') {
1415 genMiscLink('RTop', 'ere', '0', xl('e-Rx EPCS'), 'eRx.php?page=epcs-admin');
1416 } ?>
1417 </ul>
1418 </li>
1419 </ul>
1420 </li>
1421 <?php
1426 <?php if (!$disallowed['adm']) { ?>
1427 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration', 'e') ?></span></a>
1428 <ul>
1429 <?php if (acl_check('admin', 'super')) {
1430 genMiscLink('RTop', 'adm', '0', xl('Globals'), 'super/edit_globals.php');
1431 } ?>
1432 <?php if (acl_check('admin', 'users')) {
1433 genMiscLink('RTop', 'adm', '0', xl('Facilities'), 'usergroup/facilities.php');
1434 } ?>
1435 <?php if (acl_check('admin', 'users')) {
1436 genMiscLink('RTop', 'adm', '0', xl('Users'), 'usergroup/usergroup_admin.php');
1437 } ?>
1438 <?php if (acl_check('admin', 'practice')) {
1439 genTreeLink('RTop', 'adb', xl('Addr Book'));
1440 } ?>
1441 <?php
1442 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1443 if (acl_check('admin', 'practice')) {
1444 genMiscLink('RTop', 'adm', '0', xl('Practice'), '../controller.php?practice_settings&pharmacy&action=list');
1445 } ?>
1446 <?php if (acl_check('admin', 'superbill')) {
1447 genTreeLink('RTop', 'sup', xl('Codes'));
1448 } ?>
1449 <?php if (acl_check('admin', 'super')) {
1450 genMiscLink('RTop', 'adm', '0', xl('Layouts'), 'super/edit_layout.php');
1451 } ?>
1452 <?php if (acl_check('admin', 'super')) {
1453 genMiscLink('RTop', 'adm', '0', xl('Lists'), 'super/edit_list.php');
1454 } ?>
1455 <?php if (acl_check('admin', 'acl')) {
1456 genMiscLink('RTop', 'adm', '0', xl('ACL'), 'usergroup/adminacl.php');
1457 } ?>
1458 <?php if (acl_check('admin', 'super')) {
1459 genMiscLink('RTop', 'adm', '0', xl('Files'), 'super/manage_site_files.php');
1460 } ?>
1461 <?php if (acl_check('admin', 'super')) {
1462 genMiscLink('RTop', 'adm', '0', xl('Backup'), 'main/backup.php');
1463 } ?>
1464 <?php if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1465 genMiscLink('RTop', 'adm', '0', xl('Rules'), 'super/rules/index.php?action=browse!list');
1466 } ?>
1467 <?php if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1468 genMiscLink('RTop', 'adm', '0', xl('Alerts'), 'super/rules/index.php?action=alerts!listactmgr');
1469 } ?>
1470 <?php if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1471 genMiscLink('RTop', 'adm', '0', xl('Patient Reminders'), 'patient_file/reminder/patient_reminders.php?mode=admin&patient_id=');
1472 } ?>
1473 <?php if (($GLOBALS['include_de_identification']) && (acl_check('admin', 'super'))) {
1474 genMiscLink('RTop', 'adm', '0', xl('De Identification'), 'de_identification_forms/de_identification_screen1.php');
1475 } ?>
1476 <?php if (($GLOBALS['include_de_identification']) && (acl_check('admin', 'super'))) {
1477 genMiscLink('RTop', 'adm', '0', xl('Re Identification'), 'de_identification_forms/re_identification_input_screen.php');
1478 } ?>
1479 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) {
1480 genMiscLink('RTop', 'adm', '0', xl('Export'), 'main/ippf_export.php');
1481 } ?>
1482 <li><a class="collapsed_lv2"><span><?php xl('Other', 'e') ?></span></a>
1483 <ul>
1484 <?php if (acl_check('admin', 'language')) {
1485 genMiscLink('RTop', 'adm', '0', xl('Language'), 'language/language.php');
1486 } ?>
1487 <?php if (acl_check('admin', 'forms')) {
1488 genMiscLink('RTop', 'adm', '0', xl('Forms'), 'forms_admin/forms_admin.php');
1489 } ?>
1490 <?php if (acl_check('admin', 'calendar') && !$GLOBALS['disable_calendar']) {
1491 genMiscLink('RTop', 'adm', '0', xl('Calendar'), 'main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig');
1492 } ?>
1493 <?php if (acl_check('admin', 'users')) {
1494 genMiscLink('RTop', 'adm', '0', xl('Logs'), 'logview/logview.php');
1495 } ?>
1496 <?php
1497 if ($newcrop_user_role['newcrop_user_role'] || $GLOBALS['erx_enable']) {
1498 if (acl_check('admin', 'users')) {
1499 genMiscLink('RTop', 'adm', '0', xl('eRx Logs'), 'logview/erx_logview.php');
1503 <?php if (acl_check('admin', 'users')) {
1504 genMiscLink('RTop', 'adm', '0', xl('Certificates'), 'usergroup/ssl_certificates_admin.php');
1505 } ?>
1506 <?php if (acl_check('admin', 'super')) {
1507 genMiscLink('RTop', 'adm', '0', xl('Native Data Loads'), '../interface/super/load_codes.php');
1508 } ?>
1509 <?php if (acl_check('admin', 'super')) {
1510 genMiscLink('RTop', 'adm', '0', xl('External Data Loads'), '../interface/code_systems/dataloads_ajax.php');
1511 } ?>
1512 <?php if (acl_check('admin', 'super')) {
1513 genMiscLink('RTop', 'adm', '0', xl('Merge Patients'), 'patient_file/merge_patients.php');
1514 } ?>
1515 <?php if (acl_check('admin', 'super')) {
1516 genMiscLink('RTop', 'adm', '0', xl('Import Holidays'), '../interface/main/holidays/import_holidays.php');
1517 } ?>
1518 <?php if ($GLOBALS['enable_auditlog_encryption']) {
1519 genMiscLink('RTop', 'rep', '0', xl('Audit Log Tamper'), 'reports/audit_log_tamper_report.php');
1520 } ?>
1521 </ul>
1522 </li>
1523 </ul>
1524 </li>
1525 <?php } ?>
1527 <li><a class="collapsed" id="repimg" ><span><?php xl('Reports', 'e') ?></span></a>
1528 <ul>
1529 <?php
1530 $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
1531 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1532 WHERE fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='reports' ORDER BY mod_id");
1533 if (sqlNumRows($module_query)) {
1534 $jid = 0;
1535 $modid = '';
1536 while ($modulerow = sqlFetchArray($module_query)) {
1537 $modulePath = "";
1538 $added = "";
1539 if ($modulerow['type'] == 0) {
1540 $modulePath = $GLOBALS['customModDir'];
1541 $added = "";
1542 } else {
1543 $added = "index";
1544 $modulePath = $GLOBALS['zendModDir'];
1547 $disallowed[$modulerow['obj_name']] = !$disallowed['adm'] || zh_acl_check($_SESSION['authUserID'], $modulerow['obj_name']) ? "" : "1";
1549 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$modulerow['path'];
1550 $mod_nick_name = $modulerow['menu_name'] ? $modulerow['menu_name'] : 'NoName';
1552 if ($jid==0 || ($modid!=$modulerow['mod_id'])) {
1553 if ($modid!='') {
1554 echo "</ul>";
1557 <li><a class="collapsed_lv2"><span><?php echo xlt($modulerow['mod_ui_name']); ?></span></a>
1558 <ul>
1559 <?php
1562 $jid++;
1563 $modid = $modulerow['mod_id'];
1564 genMiscLink('RTop', $modulerow['obj_name'], '0', xlt($mod_nick_name), $relative_link);
1567 echo "</ul>";
1568 } ?>
1570 <?php if (acl_check('patients', 'demo') || acl_check('patients', 'med') ||
1571 (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions'])) { ?>
1572 <li><a class="collapsed_lv2"><span><?php xl('Clients', 'e') ?></span></a>
1573 <ul>
1574 <?php if (acl_check('patients', 'demo')) {
1575 genMiscLink('RTop', 'rep', '0', xl('List'), 'reports/patient_list.php');
1576 } ?>
1577 <?php if (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions']) {
1578 genMiscLink('RTop', 'rep', '0', xl('Rx'), 'reports/prescriptions_report.php');
1579 } ?>
1580 <?php if (acl_check('patients', 'med')) {
1581 genMiscLink('RTop', 'rep', '0', xl('Patient List Creation'), 'reports/patient_list_creation.php');
1582 } ?>
1583 <?php if (acl_check('patients', 'med')) {
1584 genMiscLink('RTop', 'rep', '0', xl('Clinical'), 'reports/clinical_reports.php');
1585 } ?>
1586 <?php if (acl_check('patients', 'med')) {
1587 genMiscLink('RTop', 'rep', '0', xl('Referrals'), 'reports/referrals_report.php');
1588 } ?>
1589 <?php if (acl_check('patients', 'med')) {
1590 genMiscLink('RTop', 'rep', '0', xl('Immunization Registry'), 'reports/immunization_report.php');
1591 } ?>
1592 </ul>
1593 </li>
1594 <?php } ?>
1596 <?php if (acl_check('patients', 'med')) { ?>
1597 <li><a class="collapsed_lv2"><span><?php xl('Clinic', 'e') ?></span></a>
1598 <ul>
1599 <?php if (($GLOBALS['enable_cdr'] || $GLOBALS['enable_cqm'] || $GLOBALS['enable_amc']) && acl_check('patients', 'med')) {
1600 genMiscLink('RTop', 'rep', '0', xl('Report Results'), 'reports/report_results.php');
1601 } ?>
1602 <?php if ($GLOBALS['enable_cdr'] && acl_check('patients', 'med')) {
1603 genMiscLink('RTop', 'rep', '0', xl('Standard Measures'), 'reports/cqm.php?type=standard');
1604 } ?>
1605 <?php if ($GLOBALS['enable_cqm'] && acl_check('patients', 'med')) {
1606 genMiscLink('RTop', 'rep', '0', xl('Quality Measures (CQM)'), 'reports/cqm.php?type=cqm');
1607 } ?>
1608 <?php if ($GLOBALS['enable_amc'] && acl_check('patients', 'med')) {
1609 genMiscLink('RTop', 'rep', '0', xl('Automated Measures (AMC)'), 'reports/cqm.php?type=amc');
1610 } ?>
1611 <?php if ($GLOBALS['enable_amc_tracking'] && acl_check('patients', 'med')) {
1612 genMiscLink('RTop', 'rep', '0', xl('AMC Tracking'), 'reports/amc_tracking.php');
1613 } ?>
1614 <?php if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_alert_log'] && acl_check('patients', 'med')) {
1615 genMiscLink('RTop', 'rep', '0', xl('Alerts Log'), 'reports/cdr_log.php');
1616 } ?>
1617 </ul>
1618 </li>
1619 <?php } ?>
1621 <li><a class="collapsed_lv2"><span><?php xl('Visits', 'e') ?></span></a>
1622 <ul>
1623 <?php if (acl_check('acct', 'rep_a')) {
1624 genMiscLink('RTop', 'rep', '0', xl('Daily Report'), 'reports/daily_summary_report.php');
1625 } ?>
1626 <?php if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1627 genMiscLink('RTop', 'rep', '0', xl('Appointments'), 'reports/appointments_report.php');
1628 } ?>
1629 <?php if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1630 genMiscLink('RTop', 'rep', '0', xl('Patient Flow Board'), 'reports/patient_flow_board_report.php');
1631 } ?>
1632 <?php if (acl_check('encounters', 'coding_a')) {
1633 genMiscLink('RTop', 'rep', '0', xl('Encounters'), 'reports/encounters_report.php');
1634 } ?>
1635 <?php if (!$GLOBALS['disable_calendar'] && acl_check('acct', 'rep_a')) {
1636 genMiscLink('RTop', 'rep', '0', xl('Appt-Enc'), 'reports/appt_encounter_report.php');
1637 } ?>
1638 <?php if (empty($GLOBALS['code_types']['IPPF']) && acl_check('encounters', 'coding_a')) {
1639 genMiscLink('RTop', 'rep', '0', xl('Superbill'), 'reports/custom_report_range.php');
1640 } ?>
1641 <?php if (acl_check('patients', 'demo')) {
1642 genMiscLink('RTop', 'rep', '0', xl('Eligibility'), 'reports/edi_270.php');
1643 } ?>
1644 <?php if (acl_check('patients', 'demo')) {
1645 genMiscLink('RTop', 'rep', '0', xl('Eligibility Response'), 'reports/edi_271.php');
1646 } ?>
1647 <?php if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1648 genMiscLink('RTop', 'rep', '0', xl('Chart Activity'), 'reports/chart_location_activity.php');
1649 } ?>
1650 <?php if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1651 genMiscLink('RTop', 'rep', '0', xl('Charts Out'), 'reports/charts_checked_out.php');
1652 } ?>
1653 <?php genMiscLink('RTop', 'rep', '0', xl('Services'), 'reports/services_by_category.php'); ?>
1654 <?php if (acl_check('patients', 'med')) {
1655 genMiscLink('RTop', 'rep', '0', xl('Syndromic Surveillance'), 'reports/non_reported.php');
1656 } ?>
1657 </ul>
1658 </li>
1660 <?php if (acl_check('acct', 'rep_a')) { ?>
1661 <li><a class="collapsed_lv2"><span><?php xl('Financial', 'e') ?></span></a>
1662 <ul>
1663 <?php genMiscLink('RTop', 'rep', '0', xl('Sales'), 'reports/sales_by_item.php'); ?>
1664 <?php genMiscLink('RTop', 'rep', '0', xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
1665 <?php genMiscLink('RTop', 'rep', '0', xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
1666 <?php genMiscLink('RTop', 'rep', '0', xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
1667 <?php genMiscLink('RTop', 'rep', '0', xl('Collections'), 'reports/collections_report.php'); ?>
1668 <?php genMiscLink('RTop', 'rep', '0', xl('Pat Ledger'), 'reports/pat_ledger.php?form=0'); ?>
1669 <?php genMiscLink('RTop', 'rep', '0', xl('Financial Summary by Service Code'), 'reports/svc_code_financial_report.php'); ?>
1670 </ul>
1671 </li>
1672 <?php } ?>
1674 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1675 <li><a class="collapsed_lv2"><span><?php xl('Inventory', 'e') ?></span></a>
1676 <ul>
1677 <?php genMiscLink('RTop', 'rep', '0', xl('List'), 'reports/inventory_list.php'); ?>
1678 <?php genMiscLink('RTop', 'rep', '0', xl('Activity'), 'reports/inventory_activity.php'); ?>
1679 <?php genMiscLink('RTop', 'rep', '0', xl('Transactions'), 'reports/inventory_transactions.php'); ?>
1680 </ul>
1681 </li>
1682 <?php } ?>
1684 <?php if (acl_check('patients', 'lab')) { ?>
1685 <li><a class="collapsed_lv2"><span><?php xl('Procedures', 'e') ?></span></a>
1686 <ul>
1687 <?php genPopLink(xl('Pending Res'), '../orders/pending_orders.php'); ?>
1688 <?php if (!empty($GLOBALS['code_types']['IPPF'])) {
1689 genPopLink(xl('Pending F/U'), '../orders/pending_followup.php');
1690 } ?>
1691 <?php genPopLink(xl('Statistics'), '../orders/procedure_stats.php'); ?>
1692 </ul>
1693 </li>
1694 <?php } ?>
1696 <?php if (!$GLOBALS['simplified_demographics'] && (acl_check('acct', 'rep_a') || acl_check('patients', 'demo'))) { ?>
1697 <li><a class="collapsed_lv2"><span><?php xl('Insurance', 'e') ?></span></a>
1698 <ul>
1699 <?php if (acl_check('acct', 'rep_a')) {
1700 genMiscLink('RTop', 'rep', '0', xl('Distribution'), 'reports/insurance_allocation_report.php');
1701 } ?>
1702 <?php if (acl_check('acct', 'rep_a')) {
1703 genMiscLink('RTop', 'rep', '0', xl('Indigents'), 'billing/indigent_patients_report.php');
1704 } ?>
1705 <?php if (acl_check('patients', 'demo')) {
1706 genMiscLink('RTop', 'rep', '0', xl('Unique SP'), 'reports/unique_seen_patients_report.php');
1707 } ?>
1708 </ul>
1709 </li>
1710 <?php } ?>
1712 <?php if (!empty($GLOBALS['code_types']['IPPF']) && acl_check('acct', 'rep_a')) { ?>
1713 <li><a class="collapsed_lv2"><span><?php xl('Statistics', 'e') ?></span></a>
1714 <ul>
1715 <?php genPopLink(xl('IPPF Stats'), 'ippf_statistics.php?t=i'); ?>
1716 <?php genPopLink(xl('GCAC Stats'), 'ippf_statistics.php?t=g'); ?>
1717 <?php genPopLink(xl('MA Stats'), 'ippf_statistics.php?t=m'); ?>
1718 <?php genPopLink(xl('CYP'), 'ippf_cyp_report.php'); ?>
1719 <?php genPopLink(xl('Daily Record'), 'ippf_daily.php'); ?>
1720 </ul>
1721 </li>
1722 <?php } // end ippf-specific ?>
1724 <li><a class="collapsed_lv2"><span><?php xl('Blank Forms', 'e') ?></span></a>
1725 <ul>
1726 <?php
1727 echo " <li><a class='collapsed_lv3'><span>" . xlt('Core') . "</span></a><ul>\n";
1728 genPopLink(xl('Demographics'), '../patient_file/summary/demographics_print.php');
1729 genPopLink(xl('Superbill/Fee Sheet'), '../patient_file/printed_fee_sheet.php');
1730 // genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php');
1731 echo " </ul></li>\n";
1733 // Generate the blank form items for LBF visit forms.
1735 $reglastcat = '';
1736 $regrows = getFormsByCategory('1', true); // defined in registry.inc
1737 foreach ($regrows as $entry) {
1738 $option_id = $entry['directory'];
1739 $title = trim($entry['nickname']);
1740 $tmp = explode('|', $entry['aco_spec']);
1741 if (!empty($tmp[1])) {
1742 if (!acl_check($tmp[0], $tmp[1])) {
1743 continue;
1746 if (empty($title)) {
1747 $title = $entry['name'];
1749 if ($entry['category'] != $reglastcat) {
1750 if ($reglastcat) {
1751 echo " </ul></li>\n";
1753 echo " <li><a class='collapsed_lv3'><span>" . xlt($entry['category']) . "</span></a><ul>\n";
1754 $reglastcat = $entry['category'];
1756 genPopLink(xl_form_title($title), "../forms/LBF/printable.php?formname=" . urlencode($option_id));
1758 if ($reglastcat) {
1759 echo " </ul></li>\n";
1762 </ul>
1763 </li>
1765 <?php if (acl_check('admin', 'batchcom')) { ?>
1766 <li><a class="collapsed_lv2"><span><?php echo xlt('Services') ?></span></a>
1767 <ul>
1768 <?php genMiscLink('RTop', 'rep', '0', xl('Background Services'), 'reports/background_services.php'); ?>
1769 <?php genMiscLink('RTop', 'rep', '0', xl('Direct Message Log'), 'reports/direct_message_log.php'); ?>
1770 </ul>
1771 </li>
1772 <?php } ?>
1774 </ul>
1775 </li>
1777 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous', 'e') ?></span></a>
1778 <ul>
1779 <?php genTreeLink('RTop', 'ped', xl('Patient Education')); ?>
1780 <?php if (acl_check('encounters', 'auth')) {
1781 genTreeLink('RBot', 'aun', xl('Authorizations'));
1782 } ?>
1783 <?php if (acl_check('patients', 'docs')) {
1784 genTreeLink('RTop', 'fax', xl('Fax/Scan'));
1785 } ?>
1786 <?php if (acl_check('admin', 'practice')) {
1787 genTreeLink('RTop', 'adb', xl('Addr Book'));
1788 } ?>
1789 <?php if (acl_check('admin', 'practice')) {
1790 genTreeLink('RTop', 'ort', xl('Order Catalog'));
1791 } ?>
1792 <?php if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1793 genTreeLink('RTop', 'cht', xl('Chart Tracker'));
1794 } ?>
1795 <?php if (acl_check('encounters', 'notes')) {
1796 genTreeLink('RTop', 'ono', xl('Ofc Notes'));
1797 } ?>
1798 <?php if (acl_check('admin', 'batchcom') || acl_check('admin', 'practice')) {
1799 genMiscLink('RTop', 'adm', '0', xl('BatchCom'), 'batchcom/batchcom.php');
1800 } ?>
1801 <?php $myrow = sqlQuery("SELECT state FROM registry WHERE directory = 'track_anything'");
1802 if ($myrow['state']=='1') {
1803 genTreeLink('RTop', 'tan', xl('Configure Tracks'));
1804 } ?>
1805 <?php if (!$GLOBALS['use_active_directory']) {
1806 genTreeLink('RTop', 'pwd', xl('Password'));
1807 } ?>
1808 <?php genMiscLink('RTop', 'prf', '0', xl('Preferences'), 'super/edit_globals.php?mode=user'); ?>
1809 <?php if (acl_check('patients', 'docs', '', 'write') || acl_check('patients', 'docs', '', 'addonly')) {
1810 genMiscLink('RTop', 'adm', '0', xl('New Documents'), '../controller.php?document&list&patient_id=00');
1811 } ?>
1812 <?php if (acl_check('admin', 'practice')) {
1813 genMiscLink('RTop', 'adm', '0', xl('Document Templates'), 'super/manage_document_templates.php');
1814 } ?>
1815 </ul>
1816 </li>
1818 </ul>
1820 <br /><hr />
1822 <div id='current_patient' style = 'display:none'>
1823 <b><?php xl('None', 'e'); ?></b>
1824 </div>
1826 <div id='current_encounter' style = 'display:none'>
1827 <b><?php xl('None', 'e'); ?></b>
1828 </div>
1829 <?php
1830 genPopupsList();
1831 echo "<hr />\n";
1832 genFindBlock();
1833 echo "<hr />\n";
1836 <input type='hidden' name='findBy' value='Last' />
1837 <input type="hidden" name="searchFields" id="searchFields"/>
1838 <input type="hidden" name="search_service_code" value='' />
1840 </form>
1842 <script language='JavaScript'>
1843 syncRadios();
1845 function save_setting (cb_frames) {
1846 for (var i = 0, len = cb_frames.length; i < len; i++) {
1847 try {
1848 var fref = '<?php echo $uspfx ?>frame' + i + '_chk';
1849 var ureq = $.post( "<?php echo $GLOBALS['webroot'] ?>/library/ajax/user_settings.php",
1850 { lab: fref, val: cb_frames[i] })
1851 .done(function(data) {
1852 // alert( "Data Loaded: " + data );
1854 .fail(function(xhr, textStatus, errorThrown) {
1855 alert("Error:"+xhr.responseText+"\n"+textStatus+"\n"+errorThrown);
1857 .always(function() {
1858 // alert( "finished" );
1861 } catch (err) {
1862 alert (err.message);
1866 </script>
1868 </body>
1869 </html>