Billing screen change, take 2.
[openemr.git] / interface / main / left_nav.php
blobe63f2463fe72ae9dca144c648079b5913dba5f19
1 <?php
2 use ESign\Api;
3 /* Copyright (C) 2006-2012 Rod Roark <rod@sunsetsystems.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 */
11 // This provides the left navigation frame when $GLOBALS['concurrent_layout']
12 // is true. Following are notes as to what else was changed for this feature:
14 // * interface/main/main_screen.php: the top-level frameset.
15 // * interface/main/finder/patient_select.php: loads stuff when a new patient
16 // is selected.
17 // * interface/patient_file/summary/demographics.php: this is the first frame
18 // loaded when a new patient is chosen, and in turn sets the current pid and
19 // then loads the initial bottom frame.
20 // * interface/patient_file/summary/demographics_full.php: added support for
21 // setting a new pid, needed for going to demographics from billing.
22 // * interface/patient_file/summary/demographics_save.php: redisplay
23 // demographics.php and not the frameset.
24 // * interface/patient_file/summary/summary_bottom.php: new frameset for the
25 // summary, prescriptions and notes for a selected patient, cloned from
26 // patient_summary.php.
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/usergroup/admin_frameset.php: new frameset for Admin pages,
33 // cloned from usergroup.php.
34 // * interface/main/onotes/office_comments.php: removed Back link target.
35 // * interface/main/onotes/office_comments_full.php: changed Back link.
36 // * interface/billing/billing_report.php: removed Back link; added logic
37 // to properly go to demographics or to an encounter when requested.
38 // * interface/new/new.php: removed Back link and revised form target.
39 // * interface/new/new_patient_save.php: modified to load the demographics
40 // page to the current frame instead of loading a new frameset.
41 // * interface/patient_file/history/history.php: target change.
42 // * interface/patient_file/history/history_full.php: target changes.
43 // * interface/patient_file/history/history_save.php: target change.
44 // * interface/patient_file/history/encounters.php: link/target changes.
45 // * interface/patient_file/encounter/encounter_top.php: another new frameset
46 // cloned from patient_encounter.php.
47 // * interface/patient_file/encounter/forms.php: link target removal.
48 // * interface/patient_file/encounter/new_form.php: target change.
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() and setRadio() functions.
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['srcdir'].'/ESign/Api.php';
95 // This array defines the list of primary documents that may be
96 // chosen. Each element value is an array of 3 values:
98 // * Name to appear in the navigation table
99 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific
100 // * The URL relative to the interface directory
103 $primary_docs = array(
104 'ros' => array(xl('Roster') , 0, 'reports/players_report.php?embed=1'),
105 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
106 'pfb' => array(xl('Patient Flow Board') , 0, '../interface/patient_tracker/patient_tracker.php?skip_timeout_reset=1'),
107 'app' => array(xl('Portal Activity') , 0, '../myportal/index.php'),
108 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php?form_active=1'),
109 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
110 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
111 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
112 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
113 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
114 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
115 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
116 'orl' => array(xl('Proc Prov') , 0, 'orders/procedure_provider_list.php'),
117 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
118 'orc' => array(xl('Proc Load') , 0, 'orders/load_compendium.php'),
119 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
120 'ore' => array(xl('E-Reports') , 0, 'orders/list_reports.php'),
121 'ppo' => array(xl('CMS Portal'), 0, 'cmsportal/list_requests.php'),
122 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
123 'imp' => array(xl('Import') , 0, '../custom/import.php'),
124 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
125 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
126 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
127 'new' => array(xl('New Pt') , 0, 'new/new.php'),
128 'ped' => array(xl('Patient Education'), 0, 'reports/patient_edu_web_lookup.php'),
129 'lab' => array(xl('Check Lab Results') , 0, 'orders/lab_exchange.php'),
130 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
131 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
132 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
133 'nen' => array(xl('Create Visit'), 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
134 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
135 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
136 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
137 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
138 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
139 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
140 'lda' => array(xl('Lab overview') , 1, 'patient_file/summary/labdata.php'),
141 'tan' => array(xl('Configure Tracks') , 0, 'forms/track_anything/create.php'),
142 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
143 'prq' => array(xl('Pt Rec Request') , 1, 'patient_file/transaction/record_request.php'),
144 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
145 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
146 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
147 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
148 'erx' => array(xl('e-Rx') , 1, 'eRx.php'),
149 'err' => array(xl('e-Rx Renewal') , 1, 'eRx.php?page=status'),
150 'ere' => array(xl('e-Rx EPCS') , 1, 'eRx.php?page=epcs-admin'),
151 'pay' => array(xl('Payment') , 1, '../patient_file/front_payment.php'),
152 'edi' => array(xl('EDI History') , 0, 'billing/edih_view.php'),
153 'eob' => array(xl('Posting') , 0, 'billing/sl_eob_search.php'),
154 'dld' => array(xl('Display Documents'), 0, 'main/display_documents.php')
156 $primary_docs['npa']=array(xl('Batch Payments') , 0, 'billing/new_payment.php');
157 if ($GLOBALS['use_charges_panel'] || $GLOBALS['concurrent_layout'] == 2) {
158 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
161 $esignApi = new Api();
162 // This section decides which navigation items will not appear.
164 $disallowed = array();
165 $disallowed['edi'] = !($GLOBALS['enable_edihistory_in_left_menu'] || acl_check('acct', 'eob'));
166 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
167 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
168 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
169 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
170 acl_check('admin', 'superbill') || acl_check('admin', 'drugs'));
172 $disallowed['bil'] = !(acl_check('acct', 'rep') || acl_check('acct', 'eob') ||
173 acl_check('acct', 'bill'));
175 $disallowed['new'] = !(acl_check('patients','demo','',array('write','addonly') ));
177 $disallowed['fax'] = !($GLOBALS['enable_hylafax'] || $GLOBALS['enable_scanner']);
179 $disallowed['ros'] = !$GLOBALS['athletic_team'];
181 $disallowed['iss'] = !((acl_check('encounters','notes','','write') ||
182 acl_check('encounters','notes_a','','write') ) &&
183 acl_check('patients','med','','write') );
185 $disallowed['imp'] = $disallowed['new'] ||
186 !is_readable("$webserver_root/custom/import.php");
188 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
190 $disallowed['pre'] = !(acl_check('patients', 'med'));
191 $disallowed['eob'] = !(acl_check('acct', 'eob'));
193 // Helper functions for treeview generation.
194 function genTreeLink($frame, $name, $title, $mono=false) {
195 global $primary_docs, $disallowed;
196 if (empty($disallowed[$name])) {
197 $id = $name . $primary_docs[$name][1];
198 echo "<li><a href='' id='$id' onclick=\"";
199 if ($mono) {
200 if ($frame == 'RTop')
201 echo "forceSpec(true,false);";
202 else
203 echo "forceSpec(false,true);";
205 echo "return loadFrame2('$id','$frame','" .
206 $primary_docs[$name][2] . "')\">" . $title . ($name == 'msg' ? ' <span id="reminderCountSpan" class="bold"></span>' : '')."</a></li>";
209 function genMiscLink($frame, $name, $level, $title, $url, $mono=false) {
210 global $disallowed;
211 if (empty($disallowed[$name])) {
212 $id = $name . $level;
213 echo "<li><a href='' id='$id' onclick=\"";
214 if ($mono) {
215 if ($frame == 'RTop')
216 echo "forceSpec(true,false);";
217 else
218 echo "forceSpec(false,true);";
220 echo "return loadFrame2('$id','$frame','" .
221 $url . "')\">" . $title . "</a></li>";
224 function genMiscLink2($frame, $name, $level, $title, $url, $mono=false,$mouseovertext="") {
225 global $disallowed;
226 if (empty($disallowed[$name])) {
228 $id = $name . $level;
229 echo "<li><a href='' id='$id' title='$mouseovertext' onclick=\"";
230 if ($mono) {
231 if ($frame == 'RTop')
232 echo "forceSpec(true,false);";
233 else
234 echo "forceSpec(false,true);";
236 echo "return loadFrame3('$id','$frame','" .
237 $url . "')\">" . $title . "</a></li>";
240 function genPopLink($title, $url, $linkid='') {
241 echo "<li><a href='' ";
242 if ($linkid) echo "id='$linkid' ";
243 echo "onclick=\"return repPopup('$url')\"" .
244 ">" . $title . "</a></li>";
246 function genDualLink($topname, $botname, $title) {
247 global $primary_docs, $disallowed;
248 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
249 $topid = $topname . $primary_docs[$topname][1];
250 $botid = $botname . $primary_docs[$botname][1];
251 echo "<li><a href='' id='$topid' " .
252 "onclick=\"return loadFrameDual('$topid','$botid','" .
253 $primary_docs[$topname][2] . "','" .
254 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
258 function genPopupsList($style='') {
259 global $disallowed, $webserver_root;
261 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
262 <option value=''><?php xl('Popups','e'); ?></option>
263 <?php if (!$disallowed['iss']) { ?>
264 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
265 <?php } ?>
266 <?php if (!$GLOBALS['ippf_specific']) { ?>
267 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
268 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
269 <?php } ?>
270 <?php if ($GLOBALS['athletic_team']) { ?>
271 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
272 <?php } ;
273 if (!$GLOBALS['disable_calendar']) { ?>
274 <option value='../reports/appointments_report.php?patient=<?php if(isset($pid)) {echo $pid;} ?>'><?php xl('Appts','e'); ?></option>
275 <?php } ;
276 if (file_exists("$webserver_root/custom/refer.php")) { ?>
277 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
278 <?php } ?>
279 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill','e'); ?></option>
280 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
281 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
282 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
283 <?php } ?>
284 <?php if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates")) { ?>
285 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
286 <?php } ?>
287 <?php if ($GLOBALS['chart_label_type'] != '0') { ?>
288 <option value='../patient_file/label.php'><?php xl('Chart Label','e'); ?></option>
289 <?php } ?>
290 <?php if ($GLOBALS['barcode_label_type'] != '0') { ?>
291 <option value='../patient_file/barcode_label.php'><?php xl('Barcode Label','e'); ?></option>
292 <?php } ?>
293 <?php if ($GLOBALS['addr_label_type']) { ?>
294 <option value='../patient_file/addr_label.php'><?php xl('Address Label','e'); ?></option>
295 <?php } ?>
296 </select>
297 <?php
300 function genFindBlock() {
302 <table cellpadding='0' cellspacing='0' border='0'>
303 <tr>
304 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
305 <td class='smalltext' colspan='2'>
306 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
307 </td>
308 </tr>
309 <tr>
310 <td class='smalltext'><?php xl('by','e') ?>:</td>
311 <td class='smalltext'>
312 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name','e'); ?></a>
313 </td>
314 <td class='smalltext' align='right'>
315 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID','e'); ?></a>
316 </td>
317 </tr>
318 <tr>
319 <td class='smalltext'>&nbsp;</td>
320 <td class='smalltext'>
321 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN','e'); ?></a>
322 </td>
323 <td class='smalltext' align='right'>
324 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB','e'); ?></a>
325 </td>
326 </tr>
327 <tr>
328 <td class='smalltext'>&nbsp;</td>
329 <td class='smalltext'>
330 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
331 </td>
332 <td class='smalltext' align='right'>
333 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
334 </td>
335 </tr>
336 </table>
337 <?php
338 } // End function genFindBlock()
341 <html>
342 <head>
343 <title>Navigation</title>
345 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
347 <style type="text/css">
348 body {
349 font-size:8pt;
350 font-weight:normal;
351 padding: 5px 3px 5px 3px;
353 .smalltext {
354 font-family:sans-serif;
355 font-size:8pt;
356 font-weight:normal;
358 a.navitem, a.navitem:visited {
359 color:#0000ff;
360 font-family:sans-serif;
361 font-size:8pt;
362 font-weight:bold;
364 .inputtext {
365 font-size:9pt;
366 font-weight:normal;
367 border-style:solid;
368 border-width:1px;
369 padding-left:2px;
370 padding-right:2px;
371 border-color: #000000;
372 background-color:transparent;
375 #navigation ul {
376 background-color:transparent;
378 #navigation-slide ul {
379 background-color:transparent;
381 #navigation-slide a{
382 width: 92%;
384 .nav-menu-img{
385 width:25px;
386 height:25px;
387 border:none;
388 margin-right:5px;
389 vertical-align:middle;
391 </style>
393 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.4.1/jquery.treeview.css" />
394 <script src="../../library/js/jquery-1.6.4.min.js" type="text/javascript"></script>
395 <script src="../../library/js/jquery.treeview-1.4.1/jquery.treeview.js" type="text/javascript"></script>
397 <script type="text/javascript" src="../../library/dialog.js"></script>
399 <script language='JavaScript'>
401 // tajemo work by CB 2012/01/31 12:32:57 PM dated reminders counter
402 function getReminderCount(){
403 top.restoreSession();
404 // Send the skip_timeout_reset parameter to not count this as a manual entry in the
405 // timing out mechanism in OpenEMR.
406 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/dated_reminders_counter.php",
407 { skip_timeout_reset: "1" },
408 function(data) {
409 $("#reminderCountSpan").html(data);
410 // run updater every 60 seconds
411 var repeater = setTimeout("getReminderCount()", 60000);
413 //piggy-back on this repeater to run other background-services
414 //this is a silent task manager that returns no output
415 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/execute_background_services.php",
416 { skip_timeout_reset: "1", ajax: "1" });
419 $(document).ready(function (){
420 getReminderCount();//
421 parent.loadedFrameCount += 1;
422 <?php if ($GLOBALS['drop_bottom'] ==1) { ?>
423 $("input[name=cb_bot]").trigger('click');
424 toggleFrame(2);
425 <?php } ?>
427 // end of tajemo work dated reminders counter
429 // Master values for current pid and encounter.
430 var active_pid = 0;
431 var active_encounter = 0;
432 var encounter_locked = false;
434 // Current selections in the top and bottom frames.
435 var topName = '';
436 var botName = '';
438 // Expand and/or collapse frames in response to checkbox clicks.
439 // fnum indicates which checkbox was clicked (1=left, 2=right).
440 function toggleFrame(fnum) {
441 var f = document.forms[0];
442 var fset = top.document.getElementById('fsright');
443 if (!f.cb_top.checked && !f.cb_bot.checked) {
444 if (fnum == 1) f.cb_bot.checked = true;
445 else f.cb_top.checked = true;
447 var rows = f.cb_top.checked ? '*' : '0';
448 rows += f.cb_bot.checked ? ',*' : ',0';
449 fset.rows = rows;
450 fset.rows = rows;
453 // Load the specified url into the specified frame (RTop or RBot).
454 // The URL provided must be relative to interface.
455 function loadFrame(fname, frame, url) {
456 top.restoreSession();
457 var i = url.indexOf('{PID}');
458 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
459 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
460 if (frame == 'RTop') topName = fname; else botName = fname;
463 // Load the specified url into a frame to be determined, with the specified
464 // frame as the default; the url must be relative to interface.
465 function loadFrame2(fname, frame, url) {
466 var usage = fname.substring(3);
467 if (active_pid == 0 && usage > '0') {
468 alert('<?php xl('You must first select or add a patient.','e') ?>');
469 return false;
471 if (active_encounter == 0 && usage > '1') {
472 alert('<?php xl('You must first select or create an encounter.','e') ?>');
473 return false;
475 if (encounter_locked && usage > '1') {
476 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
477 return false;
479 var f = document.forms[0];
480 top.restoreSession();
481 var i = url.indexOf('{PID}');
482 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
483 if(f.sel_frame)
485 var fi = f.sel_frame.selectedIndex;
486 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
488 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
489 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
490 if (frame == 'RTop') topName = fname; else botName = fname;
491 return false;
494 function loadFrame3(fname, frame, url) {
495 var f = document.forms[0];
496 top.restoreSession();
497 var i = url.indexOf('{PID}');
498 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
499 if(f.sel_frame)
501 var fi = f.sel_frame.selectedIndex;
502 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
504 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
505 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
506 if (frame == 'RTop') topName = fname; else botName = fname;
507 return false;
510 // Make sure the the top and bottom frames are open or closed, as specified.
511 function forceSpec(istop, isbot) {
512 var f = document.forms[0];
513 if (f.cb_top.checked != istop) {
514 f.cb_top.checked = istop;
515 toggleFrame(1);
517 if (f.cb_bot.checked != isbot) {
518 f.cb_bot.checked = isbot;
519 toggleFrame(2);
523 // Make sure both frames are open.
524 function forceDual() {
525 forceSpec(true, true);
528 // Load the specified url into a frame to be determined, with the specified
529 // frame as the default; the url must be relative to interface.
530 function loadFrameDual(tname, bname, topurl, boturl) {
531 var topusage = tname.substring(3);
532 var botusage = bname.substring(3);
533 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
534 alert('<?php xl('You must first select or add a patient.','e') ?>');
535 return false;
537 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
538 alert('<?php xl('You must first select or create an encounter.','e') ?>');
539 return false;
541 if (encounter_locked && (topusage > '1' || botusage > '1')) {
542 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
543 return false;
545 var f = document.forms[0];
546 forceDual();
547 top.restoreSession();
548 var i = topurl.indexOf('{PID}');
549 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
550 i = boturl.indexOf('{PID}');
551 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
552 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
553 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
554 topName = tname;
555 botName = bname;
556 return false;
559 // Select a designated radio button. raname may be either the radio button
560 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
561 // You should call this if you directly load a document that does not
562 // correspond to the current radio button setting.
563 function setRadio(raname, rbid) {
564 <?php if ($GLOBALS['concurrent_layout'] < 2) { ?>
565 var f = document.forms[0];
566 if (raname == 'RTop') raname = 'rb_top';
567 if (raname == 'RBot') raname = 'rb_bot';
568 for (var i = 0; i < f[raname].length; ++i) {
569 if (f[raname][i].value.substring(0,3) == rbid) {
570 f[raname][i].checked = true;
571 return true;
574 <?php } ?>
575 return false;
578 // Set disabled/enabled state of radio buttons and associated labels
579 // depending on whether there is an active patient or encounter.
580 function syncRadios() {
581 var f = document.forms[0];
582 encounter_locked = isEncounterLocked(active_encounter);
583 <?php if (($GLOBALS['concurrent_layout'] == 2)||($GLOBALS['concurrent_layout'] == 3)) { ?>
584 var nlinks = document.links.length;
585 for (var i = 0; i < nlinks; ++i) {
586 var lnk = document.links[i];
587 if (lnk.id.length != 4) continue;
588 var usage = lnk.id.substring(3);
589 if (usage == '1' || usage == '2') {
590 var da = false;
591 if (active_pid == 0) da = true;
592 if (active_encounter == 0 && usage > '1') da = true;
593 if (encounter_locked && usage > '1') da = true;
594 <?php
595 if ($GLOBALS['concurrent_layout'] == 2){
596 $color = "'#0000ff'";
597 }else{
598 $color = "'#000000'";
601 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
604 <?php } else if ($GLOBALS['concurrent_layout'] < 2) { ?>
605 for (var i = 0; i < f.rb_top.length; ++i) {
606 var da = false;
607 var rb1 = f.rb_top[i];
608 var rb2 = f.rb_bot[i];
609 var rbid = rb1.value.substring(0,3);
610 var usage = rb1.value.substring(3);
611 if (active_pid == 0 && usage > '0') da = true;
612 if (active_encounter == 0 && usage > '1') da = true;
613 if (encounter_locked && usage > '1') da = true;
614 // daemon_frame can also set special label colors, so don't mess with
615 // them unless we have to.
616 if (rb1.disabled != da) {
617 rb1.disabled = da;
618 rb2.disabled = da;
619 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
622 <?php } ?>
623 f.popups.disabled = (active_pid == 0);
626 function goHome() {
627 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
628 top.frames['RBot'].location='messages/messages.php?form_active=1';
631 //Function to clear active patient and encounter in the server side
632 function clearactive() {
633 top.restoreSession();
634 //Ajax call to clear active patient in session
635 $.ajax({
636 type: "POST",
637 url: "<?php echo $GLOBALS['webroot'] ?>/library/ajax/unset_session_ajax.php",
638 data: { func: "unset_pid"},
639 success:function( msg ) {
640 clearPatient();
641 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
642 top.frames['RBot'].location='messages/messages.php?form_active=1';
646 $(parent.Title.document.getElementById('clear_active')).hide();
648 // Reference to the search.php window.
649 var my_window;
651 // Open the search.php window.
652 function initFilter() {
653 my_window = window.open("../../custom/search.php", "mywindow","status=1");
656 // This is called by the search.php (Filter) window.
657 function processFilter(fieldString, serviceCode) {
658 var f = document.forms[0];
659 document.getElementById('searchFields').value = fieldString;
660 f.search_service_code.value = serviceCode;
661 findPatient("Filter");
662 f.search_service_code.value = '';
663 my_window.close();
666 // Process the click to find a patient by name, id, ssn or dob.
667 function findPatient(findby) {
668 var f = document.forms[0];
669 if (! f.cb_top.checked) {
670 f.cb_top.checked = true;
671 toggleFrame(1);
673 f.findBy.value = findby;
674 setRadio('rb_top', 'dem');
675 top.restoreSession();
676 document.find_patient.submit();
679 // Helper function to set the contents of a div.
680 function setSomeContent(id, content, doc) {
681 if (doc.getElementById) {
682 var x = doc.getElementById(id);
683 x.innerHTML = '';
684 x.innerHTML = content;
686 else if (doc.all) {
687 var x = doc.all[id];
688 x.innerHTML = content;
691 function setDivContent(id, content) {
692 setSomeContent(id, content, document);
694 function setTitleContent(id, content) {
695 setSomeContent(id, content, parent.Title.document);
698 // This is called automatically when a new patient is set, to make sure
699 // there are no patient-specific documents showing stale data. If a frame
700 // was just loaded with data for the correct patient, its name is passed so
701 // that it will not be zapped. At this point the new server-side pid is not
702 // assumed to be set, so this function will only load global data.
703 function reloadPatient(frname) {
704 var f = document.forms[0];
705 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
706 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
707 setRadio('rb_top', 'cal');
709 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
710 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
711 setRadio('rb_bot', 'ens');
715 // Reload encounter-specific frames, excluding a specified frame. At this
716 // point the new server-side encounter ID may not be set and loading the same
717 // document for the new encounter will not work, so load patient info instead.
718 function reloadEncounter(frname) {
719 var f = document.forms[0];
720 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
721 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
722 setRadio('rb_top', 'dem');
724 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
725 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
726 setRadio('rb_bot', 'ens');
730 // Clear and reload issue-related menu items for active_pid.
731 // Currently this only applies to athletic teams, but might be implemented
732 // in the general menu at some future time.
734 function reloadIssues() {
735 <?php
736 if ($GLOBALS['athletic_team']) {
737 // Generates a menu item for each active issue that this patient
738 // has of each issue type. Each one looks like this:
739 // Onset-Date [Add] Issue-Title
740 // where the first part is a link to open the issue dialog,
741 // [Add] is a link that auto-creates and opens a new encounter, and
742 // Issue-Title is a link that shows related encounters.
743 foreach ($ISSUE_TYPES as $key => $value) {
745 $('#icontainer_<?php echo $key ?>').empty();
746 if (active_pid != 0) {
747 $('#icontainer_<?php echo $key ?>').append("<li>" +
748 "<a href='' id='xxx1' onclick='return repPopup(" +
749 "\"../patient_file/summary/add_edit_issue.php?thistype=" +
750 "<?php echo $key; ?>\")' " +
751 "title='<?php echo xl('Create new issue'); ?>'>" +
752 "<?php echo xl('New') . " " . $value[1]; ?></a></li>");
753 top.restoreSession();
754 $.getScript('../../library/ajax/left_nav_issues_ajax.php?type=<?php echo $key; ?>');
756 <?php
760 } // end function reloadIssues
762 // This is referenced in left_nav_issues_ajax.php and is called when [Add]
763 // is clicked for an issue menu item to add a new encounter for the issue.
764 // So far this only applies to the Athletic Team version of the menu.
766 function addEncNotes(issue) {
768 // top.restoreSession();
769 // $.getScript('../../library/ajax/left_nav_encounter_ajax.php?createvisit=1&issue=' + issue);
771 // The above AJAX call was to create the encounter right away, but we later
772 // (2012-07-03) decided it's better to present the New Encounter form instead.
773 // Note the issue ID is passed so it will be pre-selected in that form.
774 loadFrame2('nen1','RBot','forms/newpatient/new.php?autoloaded=1&calenc=&issue=' + issue);
776 return false;
779 // Call this to announce that the patient has changed. You must call this
780 // if you change the session PID, so that the navigation frame will show the
781 // correct patient and so that the other frame will be reloaded if it contains
782 // patient-specific information from the previous patient. frname is the name
783 // of the frame that the call came from, so we know to only reload content
784 // from the *other* frame if it is patient-specific.
785 function setPatient(pname, pid, pubpid, frname, str_dob) {
786 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
787 setDivContent('current_patient', str);
788 setTitleContent('current_patient', str + str_dob);
789 if (pid == active_pid) return;
790 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
791 active_pid = pid;
792 active_encounter = 0;
793 encounter_locked = false;
794 if (frname) reloadPatient(frname);
795 syncRadios();
796 $(parent.Title.document.getElementById('current_patient_block')).show();
797 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
798 $(encounter_block).hide();
800 // zero out the encounter frame, replace it with the encounter list frame
801 var f = document.forms[0];
802 if ( f.cb_top.checked && f.cb_bot.checked ) {
803 var encounter_frame = getEncounterTargetFrame('enc');
804 if ( encounter_frame != undefined ) {
805 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
806 setRadio(encounter_frame, 'ens');
810 reloadIssues(pid);
811 $(parent.Title.document.getElementById('clear_active')).show();//To display Clear Active Patient button on selecting a patient
813 function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) {
814 //This function lists all encounters of the patient.
815 //This function writes the drop down in the top frame.
816 //It is called when a new patient is create/selected from the search menu.
817 var str = '<Select class="text" id="EncounterHistory" onchange="{top.restoreSession();toencounter(this.options[this.selectedIndex].value)}">';
818 str+='<option value=""><?php echo htmlspecialchars( xl('Encounter History'), ENT_QUOTES) ?></option>';
819 str+='<option value="New Encounter"><?php echo htmlspecialchars( xl('New Encounter'), ENT_QUOTES) ?></option>';
820 str+='<option value="Past Encounter List"><?php echo htmlspecialchars( xl('Past Encounter List'), ENT_QUOTES) ?></option>';
821 for(CountEncounter=0;CountEncounter<EncounterDateArray.length;CountEncounter++)
823 str+='<option value="'+EncounterIdArray[CountEncounter]+'~'+EncounterDateArray[CountEncounter]+'">'+EncounterDateArray[CountEncounter]+'-'+CalendarCategoryArray[CountEncounter]+'</option>';
825 str+='</Select>';
826 $(parent.Title.document.getElementById('past_encounter_block')).show();
827 top.window.parent.Title.document.getElementById('past_encounter').innerHTML=str;
830 function loadCurrentPatientFromTitle() {
831 top.restoreSession();
832 top.frames['RTop'].location='../patient_file/summary/demographics.php';
835 function getEncounterTargetFrame( name ) {
836 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
837 var f = document.forms[0];
838 var r = 'RTop';
839 if (f.cb_top.checked && f.cb_bot.checked) {
840 if ( bias == 2 ) {
841 r = 'RBot';
842 } else {
843 r = 'RTop';
845 } else {
846 if ( f.cb_top.checked ) {
847 r = 'RTop';
848 } else if ( f.cb_bot.checked ) {
849 r = 'RBot';
852 return r;
854 function isEncounterLocked( encounterId ) {
855 <?php if ( $esignApi->lockEncounters() ) { ?>
856 // If encounter locking is enabled, make a syncronous call (async=false) to check the
857 // DB to see if the encounter is locked.
858 // Call restore session, just in case
859 top.restoreSession();
860 $.ajax({
861 type: 'POST',
862 url: '<?php echo $GLOBALS['webroot']?>/interface/esign/index.php?module=encounter&method=esign_is_encounter_locked',
863 data: { encounterId : encounterId },
864 success: function( data ) {
865 encounter_locked = data;
867 dataType: 'json',
868 async:false
869 });
870 return encounter_locked;
871 <?php } else { ?>
872 // If encounter locking isn't enabled, just tell the left_nav that the encounter
873 // isn't locked.
874 return false;
875 <?php } ?>
877 // Call this to announce that the encounter has changed. You must call this
878 // if you change the session encounter, so that the navigation frame will
879 // show the correct encounter and so that the other frame will be reloaded if
880 // it contains encounter-specific information from the previous encounter.
881 // frname is the name of the frame that the call came from, so we know to only
882 // reload encounter-specific content from the *other* frame.
883 function setEncounter(edate, eid, frname) {
884 if (eid == active_encounter) return;
885 if (!eid) edate = '<?php xl('None','e'); ?>';
886 var str = '<b>' + edate + '</b>';
887 setDivContent('current_encounter', str);
888 active_encounter = eid;
889 encounter_locked=isEncounterLocked(active_encounter);
890 reloadEncounter(frname);
891 syncRadios();
892 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
893 var encounter = $(parent.Title.document.getElementById('current_encounter'));
894 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
895 encounter.html( estr );
896 encounter_block.show();
899 function loadCurrentEncounterFromTitle() {
900 top.restoreSession();
901 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/encounter_top.php';
904 // You must call this if you delete the active patient (or if for any other
905 // reason you "close" the active patient without opening a new one), so that
906 // the appearance of the navigation frame will be correct and so that any
907 // stale content will be reloaded.
908 function clearPatient() {
909 if (active_pid == 0) return;
910 var f = document.forms[0];
911 active_pid = 0;
912 active_encounter = 0;
913 encounter_locked = false;
914 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
915 $(parent.Title.document.getElementById('current_patient_block')).hide();
916 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
917 $(parent.Title.document.getElementById('current_encounter_block')).hide();
918 reloadPatient('');
919 syncRadios();
922 // You must call this if you delete the active encounter (or if for any other
923 // reason you "close" the active encounter without opening a new one), so that
924 // the appearance of the navigation frame will be correct and so that any
925 // stale content will be reloaded.
926 function clearEncounter() {
927 if (active_encounter == 0) return;
928 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
929 active_encounter = 0;
930 encounter_locked = false;
931 reloadEncounter('');
932 syncRadios();
934 function removeOptionSelected(EncounterId)
935 {//Removes an item from the Encounter drop down.
936 var elSel = top.window.parent.Title.document.getElementById('EncounterHistory');
937 var i;
938 for (i = elSel.length - 1; i>=2; i--) {
939 EncounterHistoryValue=elSel.options[i].value;
940 EncounterHistoryValueArray=EncounterHistoryValue.split('~');
941 if (EncounterHistoryValueArray[0]==EncounterId) {
942 elSel.remove(i);
947 // You can call this to make sure the session pid is what we expect.
948 function pidSanityCheck(pid) {
949 if (pid != active_pid) {
950 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
951 '. This session is unstable and should be abandoned. Do not use ' +
952 'OpenEMR in multiple browser windows!');
953 return false;
955 return true;
958 // You can call this to make sure the session encounter is what we expect.
959 function encounterSanityCheck(eid) {
960 if (eid != active_encounter) {
961 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
962 '. This session is unstable and should be abandoned. Do not use ' +
963 'OpenEMR in multiple browser windows!');
964 return false;
966 return true;
969 // Pop up a report.
970 function repPopup(aurl) {
971 top.restoreSession();
972 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
973 return false;
976 // This is invoked to pop up some window when a popup item is selected.
977 function selpopup(selobj) {
978 var i = selobj.selectedIndex;
979 var opt = selobj.options[i];
980 if (i > 0) {
981 var width = 750;
982 var height = 550;
983 if (opt.text == 'Export' || opt.text == 'Import') {
984 width = 500;
985 height = 400;
987 else if (opt.text == 'Refer') {
988 width = 700;
989 height = 500;
991 dlgopen(opt.value, '_blank', width, height);
993 selobj.selectedIndex = 0;
995 // Treeview activation stuff:
996 $(document).ready(function(){
997 if(3 == <?php echo $GLOBALS['concurrent_layout'] ?>){
998 $("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
999 $("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
1000 $("#navigation-slide > li > a.expanded").click(function() {
1001 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1002 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1004 $("#navigation-slide > li > a.collapsed").click(function() {
1005 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1006 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1008 $("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
1009 $("#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");
1010 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1012 $("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
1013 $("#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");
1014 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1016 $("#navigation-slide > li > a#cal0").prepend('<img src="../../images/calendar.png" class="nav-menu-img" />');
1017 $("#navigation-slide > li > a#pfb0").prepend('<img src="../../images/pfb.png" class="nav-menu-img" />');
1018 $("#navigation-slide > li > a#msg0").prepend('<img src="../../images/messages.png" class="nav-menu-img" />');
1019 $("#navigation-slide > li > a#patimg").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
1020 $("#navigation-slide > li > a#app0").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
1021 $("#navigation-slide > li > a#ppo0").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
1022 $("#navigation-slide > li > a#repimg").prepend('<img src="../../images/reports.png" class="nav-menu-img" />');
1023 $("#navigation-slide > li > a#feeimg").prepend('<img src="../../images/fee.png" class="nav-menu-img" />');
1024 $("#navigation-slide > li > a#adm0").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
1025 $("#navigation-slide > li > a#invimg").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
1026 $("#navigation-slide > li > a#admimg").prepend('<img src="../../images/admin.png" class="nav-menu-img" />');
1027 $("#navigation-slide > li > a#misimg").prepend('<img src="../../images/misc.png" class="nav-menu-img" />');
1028 $("#navigation-slide > li > a#proimg").prepend('<img src="../../images/procedures.png" class="nav-menu-img" />');
1029 $("#navigation-slide > li > a#modimg").prepend('<img src="../../images/module.png" class="nav-menu-img" />');
1030 $("#navigation-slide > li").each(function(index) {
1031 if($(" > ul > li", this).size() == 0){
1032 $(" > a", this).addClass("collapsed");
1035 }else if(2 == <?php echo $GLOBALS['concurrent_layout'] ?>){
1037 //Remove the links (used by the sliding menu) that will break treeview
1038 $('a.collapsed').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1039 $('a.collapsed_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1040 $('a.expanded').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1041 $('a.expanded_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1043 // Initiate treeview
1044 $("#navigation").treeview({
1045 animated: "fast",
1046 collapsed: true,
1047 unique: <?php echo $GLOBALS['athletic_team'] ? 'false' : 'true' ?>,
1048 toggle: function() {
1049 window.console && console.log("%o was toggled", this);
1055 </script>
1057 </head>
1059 <body class="body_nav">
1061 <form method='post' name='find_patient' target='RTop'
1062 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
1064 <?php
1065 // Find widget is at the top for the athletic team layout.
1066 if ($GLOBALS['athletic_team']) {
1067 genFindBlock();
1068 echo "<hr />\n";
1072 <?php if ( ( $GLOBALS['concurrent_layout'] == 2) || ($GLOBALS['concurrent_layout'] == 3) ) { ?>
1073 <center>
1074 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:<?php echo $GLOBALS['athletic_team'] ? 47 : 100; ?>%;'>
1075 <option value='0'><?php xl('Default','e'); ?></option>
1076 <option value='1'><?php xl('Top','e'); ?></option>
1077 <option value='2'><?php xl('Bottom','e'); ?></option>
1078 </select>
1079 <?php if ($GLOBALS['athletic_team']) genPopupsList('width:47%'); ?>
1080 </center>
1082 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1083 <tr>
1084 <td class='smalltext' nowrap>
1085 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked />
1086 <b><?php xl('Top','e') ?></b>
1087 </td>
1088 <td class='smalltext' align='right' nowrap>
1089 <b><?php xl('Bot','e') ?></b>
1090 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php if (empty($GLOBALS['athletic_team'])) echo 'checked '; ?>/>
1091 </td>
1092 </tr>
1093 </table>
1095 <?php if ( $GLOBALS['concurrent_layout'] == 3) { ?>
1096 <ul id="navigation-slide">
1097 <?php } else { // ($GLOBALS['concurrent_layout'] == 2) ?>
1098 <ul id="navigation">
1099 <?php } ?>
1101 <?php if ($GLOBALS['athletic_team']) { // Tree menu for athletic teams ?>
1103 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
1104 <li><a class="collapsed" id="patimg" ><span><?php xl('View','e') ?></span></a>
1105 <ul>
1106 <?php genTreeLink('RTop','ros',xl('Weekly Exposures'),true); ?>
1107 <?php genMiscLink('RTop','ros','0',xl('Team Roster'),'reports/old_players_report.php?embed=1',true); ?>
1108 <?php if (!$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar'),true); ?>
1109 </ul>
1110 </li>
1111 <li class="open"><a class="collapsed" id="patimg" ><span><?php xl('Demographics','e') ?></span></a>
1112 <ul>
1113 <?php genMiscLink('RTop','fin','0',xl('Patients'),'main/finder/dynamic_finder.php'); ?>
1114 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
1115 <?php genTreeLink('RTop','dem',xl('Current')); ?>
1116 </ul>
1117 </li>
1118 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Medical Records','e') ?></span></a>
1119 <ul>
1120 <?php genDualLink('iss','ens',xl('All Injuries/Problems/Issues')); // with ens on bottom ?>
1121 <?php
1122 // Add a container for each issue type.
1123 foreach ($ISSUE_TYPES as $key => $value) {
1124 echo " <li class='open'><a class='collapsed_lv2'><span>" . xl('Active') . " " . $value[0] . "</span></a>\n";
1125 echo " <ul id='icontainer_$key'>\n";
1126 echo " </ul>\n";
1127 echo " </li>\n";
1130 <?php genDualLink('nen','ens',xl('New Consultation')); // with ens on bottom ?>
1131 <?php // genDualLink('enc','ens','Current Consultation'); // with ens on bottom ?>
1132 <?php genTreeLink('RTop','enc',xl('Current Consultation')); // encounter_top will itself load ens on bottom ?>
1133 <?php // genDualLink('dem','ens',xl('Previous Consultations')); // with dem on top ?>
1134 <?php genTreeLink('RBot','ens',xl('Previous Consultations'),true); ?>
1135 <?php genDualLink('his','ens',xl('Prev Med/Surg Hx')); // with ens on bottom ?>
1136 <?php // genPopLink(xl('New Allergy'),'../patient_file/summary/add_edit_issue.php?thistype=allergy','xxx1'); ?>
1137 <?php // genTreeLink('RTop','iss',xl('View/Edit Allergies')); // somehow emphasizing allergies...? ?>
1138 <?php if (!$GLOBALS['disable_immunizations']) genDualLink('his','imm',xl('Immunizations')); // imm on bottom, his on top ?>
1139 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genDualLink('his','pre',xl('Prescriptions')); // pre on bottom, his on top ?>
1140 <?php genTreeLink('RTop','doc',xl('Document/Imaging Store'),true); ?>
1141 <?php genDualLink('dem','pno',xl('Additional Notes')); // with dem on top ?>
1142 </ul>
1143 </li>
1144 <li class="open"><a class="collapsed" id="patimg" ><span><?php xl('Medical Administration','e') ?></span></a>
1145 <ul>
1146 <?php genDualLink('tra','ens',xl('Transactions/Referrals')); // new transaction form on top and tra list on bottom (or ens if no tra) ?>
1147 <?php genPopLink(xl('Address Book'),'../usergroup/addrbook_list.php?popup=1'); ?>
1148 <li><a href='' onClick="return repPopup('../patient_file/letter.php')" id='prp1'>Letter</a></li>
1149 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); ?>
1150 </ul>
1151 </li>
1152 <li class="open"><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
1153 <ul>
1154 <li class="open"><a class="collapsed_lv2"><span><?php xl('Athletic/Injury','e') ?></span></a>
1155 <ul>
1156 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); // also appears above ?>
1157 <?php genPopLink(xl('Games/Events Missed'),'absences_report.php'); ?>
1158 <?php genPopLink(xl('Injury Surveillance'),'football_injury_report.php'); ?>
1159 <?php genPopLink(xl('Team Injury Overview'),'injury_overview_report.php'); ?>
1160 </ul>
1161 </li>
1162 <li><a class="collapsed_lv2"><span><?php xl('Patient/Client','e') ?></span></a>
1163 <ul>
1164 <?php genPopLink(xl('List'),'patient_list.php'); ?>
1165 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genPopLink(xl('Prescriptions'),'prescriptions_report.php'); ?>
1166 <?php genPopLink(xl('Referrals'),'referrals_report.php'); ?>
1167 </ul>
1168 </li>
1169 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
1170 <ul>
1171 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appointments'),'appointments_report.php'); ?>
1172 <?php genPopLink(xl('Encounters'),'encounters_report.php'); ?>
1173 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appt-Enc'),'appt_encounter_report.php'); ?>
1174 </ul>
1175 </li>
1176 <li><a class="collapsed_lv2"><span><?php xl('General','e') ?></span></a>
1177 <ul>
1178 <?php genPopLink(xl('Services'),'services_by_category.php'); ?>
1179 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
1180 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
1181 </ul>
1182 </li>
1183 </ul>
1184 </li>
1185 <?php // TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1186 <?php if(!isset($GLOBALS['enable_fees_in_left_menu']) || $GLOBALS['enable_fees_in_left_menu'] == 1){ ?>
1187 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
1188 <ul>
1189 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
1190 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
1191 </ul>
1192 </li>
1193 <?php } ?>
1194 <?php if (acl_check('menus', 'modle')) {?>
1195 <li><a class="collapsed" id="modimg" ><span><?php echo xlt('Modules') ?></span></a>
1196 <ul>
1197 <?php genMiscLink('RTop','adm','0',xl('Manage Modules'),'modules/zend_modules/public/Installer'); ?>
1198 <?php //genTreeLink('RTop','ort',xl('Settings')); ?>
1200 <?php
1201 $module_query = sqlStatement("select 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");
1202 if (sqlNumRows($module_query)) {
1203 while ($modulerow = sqlFetchArray($module_query)) {
1204 $acl_section = strtolower($modulerow['mod_directory']);
1205 $disallowed[$acl_section] = zh_acl_check($_SESSION['authUserID'],$acl_section) ? "" : "1";
1206 $modulePath = "";
1207 $added = "";
1208 if($modulerow['type'] == 0) {
1209 $modulePath = $GLOBALS['customModDir'];
1210 $added = "";
1212 else{
1213 $added = "index";
1214 $modulePath = $GLOBALS['zendModDir'];
1217 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$added;
1218 $mod_nick_name = $modulerow['mod_nick_name'] ? $modulerow['mod_nick_name'] : $modulerow['mod_name'];
1220 <?php genMiscLink2('RTop',$acl_section,'0',xlt($mod_nick_name),$relative_link);
1222 } ?>
1223 </ul>
1224 </li>
1225 <?php }?>
1226 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
1227 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
1228 <ul>
1229 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
1230 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
1231 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
1232 <?php genTreeLink('RTop','pwd','Users Password Change'); ?>
1233 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings'); ?>
1234 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Codes')); ?>
1235 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
1236 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
1237 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
1238 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
1239 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('Re Identification'),'de_identification_forms/re_identification_input_screen.php'); ?>
1240 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
1241 <ul>
1242 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
1243 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1244 <?php if (acl_check('admin', 'calendar') && !$GLOBALS['disable_calendar']) genMiscLink('RTop','adm','0',xl('Calendar'),'main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig'); ?>
1245 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1246 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1247 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1248 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1249 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1250 </ul>
1251 </li>
1252 </ul>
1253 </li>
1254 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1255 <ul>
1256 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1257 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1258 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1259 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1260 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1261 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1262 <?php if(acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('New Documents'),'../controller.php?document&list&patient_id=0'); ?>
1263 <?php if (acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('Document Templates'),'super/manage_document_templates.php'); ?>
1264 </ul>
1265 </li>
1267 <?php } else { // not athletic team ?>
1268 <?php if (!$GLOBALS['disable_calendar'] && !$GLOBALS['ippf_specific']) genTreeLink('RTop','cal',xl('Calendar')); ?>
1269 <?php if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','pfb',xl('Flow Board')); ?>
1270 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
1271 <?php if ($GLOBALS['lab_exchange_enable']) genTreeLink('RTop', 'lab', xl('Check Lab Results'));?>
1272 <?php if($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address'] && acl_check('patientportal','portal')) genTreeLink('RTop','app',xl('Portal Activity')); ?>
1273 <?php
1274 if ($GLOBALS['gbl_portal_cms_enable'] && acl_check('patientportal','portal')) {
1275 // genTreeLink('RTop','ppo',xl('WordPress Portal'));
1276 genPopLink(xl('CMS Portal'),'../cmsportal/list_requests.php','ppo0');
1280 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Patient/Client','e') ?></span></a>
1281 <ul>
1282 <?php genMiscLink('RTop','fin','0',xl('Patients'),'main/finder/dynamic_finder.php'); ?>
1283 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
1284 <?php genTreeLink('RTop','dem',xl('Summary')); ?>
1285 <li class="open"><a class="expanded_lv2"><span><?php xl('Visits','e') ?></span></a>
1286 <ul>
1287 <?php if ($GLOBALS['ippf_specific'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar')); ?>
1288 <?php genTreeLink('RBot','nen',xl('Create Visit')); ?>
1289 <?php genTreeLink('RBot','enc',xl('Current')); ?>
1290 <?php genTreeLink('RBot','ens',xl('Visit History')); ?>
1291 </ul>
1292 </li>
1294 <li><a class="collapsed_lv2"><span><?php xl('Records','e') ?></span></a>
1295 <ul>
1296 <?php genTreeLink('RTop','prq',xl('Patient Record Request')); ?>
1297 </ul>
1298 </li>
1300 <?php if ($GLOBALS['gbl_nav_visit_forms']) { ?>
1301 <li><a class="collapsed_lv2"><span><?php xl('Visit Forms','e') ?></span></a>
1302 <ul>
1303 <?php
1304 // Generate the items for visit forms, both traditional and LBF.
1307 $lres = sqlStatement("SELECT * FROM list_options " .
1308 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1309 if (sqlNumRows($lres)) {
1310 while ($lrow = sqlFetchArray($lres)) {
1311 $option_id = $lrow['option_id']; // should start with LBF
1312 $title = $lrow['title'];
1313 genMiscLink('RBot','cod','2',xl_form_title($title),
1314 "patient_file/encounter/load_form.php?formname=$option_id");
1317 include_once("$srcdir/registry.inc");
1318 $reg = getRegistered();
1319 if (!empty($reg)) {
1320 foreach ($reg as $entry) {
1321 $option_id = $entry['directory'];
1322 $title = trim($entry['nickname']);
1323 if ($option_id == 'fee_sheet' ) continue;
1324 if ($option_id == 'newpatient') continue;
1325 if (empty($title)) $title = $entry['name'];
1326 genMiscLink('RBot','cod','2',xl_form_title($title),
1327 "patient_file/encounter/load_form.php?formname=" .
1328 urlencode($option_id));
1332 </ul>
1333 </li>
1334 <li class="collapsed" ><a class="collapsed_lv2"><span><?php echo xlt('Import') ?></span></a>
1335 <ul>
1336 <?php genMiscLink('RTop','ccr','0',xlt('Upload'),'patient_file/ccr_import.php'); ?>
1337 <?php genMiscLink('RTop','apr','0',xlt('Pending Approval'),'patient_file/ccr_pending_approval.php'); ?>
1338 </ul>
1339 </li>
1340 <?php } // end if gbl_nav_visit_forms ?>
1342 </ul>
1343 </li>
1344 <?php // TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1345 <?php if(!isset($GLOBALS['enable_fees_in_left_menu']) || $GLOBALS['enable_fees_in_left_menu'] == 1){ ?>
1346 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
1347 <ul>
1348 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
1349 <?php if ($GLOBALS['use_charges_panel']) genTreeLink('RBot','cod',xl('Charges')); ?>
1350 <?php genMiscLink('RBot','pay','1',xl('Payment'),'patient_file/front_payment.php'); ?>
1351 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
1352 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil',xl('Billing')); ?>
1353 <?php genTreeLink('RTop','npa',xl('Batch Payments'),false,2);?>
1354 <?php genMiscLink('RTop','eob','0',xl('Posting'), 'billing/sl_eob_search.php'); ?>
1355 <?php if ($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob')) genTreeLink('RTop','edi',xl('EDI History'),false,2);?>
1356 </ul>
1357 </li>
1358 <?php } ?>
1359 <?php if (acl_check('menus', 'modle')) {?>
1360 <li><a class="collapsed" id="modimg" ><span><?php echo xlt('Modules') ?></span></a>
1361 <ul>
1362 <?php genMiscLink('RTop','adm','0',xl('Manage Modules'),'modules/zend_modules/public/Installer'); ?>
1363 <?php //genTreeLink('RTop','ort',xl('Settings')); ?>
1365 <?php
1366 $module_query = sqlStatement("select 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");
1367 if (sqlNumRows($module_query)) {
1368 while ($modulerow = sqlFetchArray($module_query)) {
1369 $acl_section = strtolower($modulerow['mod_directory']);
1370 $disallowed[$acl_section] = zh_acl_check($_SESSION['authUserID'],$acl_section) ? "" : "1";
1371 $modulePath = "";
1372 $added = "";
1373 if($modulerow['type'] == 0) {
1374 $modulePath = $GLOBALS['customModDir'];
1375 $added = "";
1377 else{
1378 $added = "index";
1379 $modulePath = $GLOBALS['zendModDir'];
1382 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$added;
1383 $mod_nick_name = $modulerow['mod_nick_name'] ? $modulerow['mod_nick_name'] : $modulerow['mod_name'];
1385 <?php genMiscLink2('RTop',$acl_section,'0',xlt($mod_nick_name),$relative_link);?>
1386 <?php }
1387 } ?>
1388 </ul>
1389 </li>
1390 <?php }?>
1391 <?php // if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
1392 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1393 <li><a class="collapsed" id="invimg" ><span><?php xl('Inventory','e') ?></span></a>
1394 <ul>
1395 <?php genMiscLink('RTop','adm','0',xl('Management'),'drugs/drug_inventory.php'); ?>
1396 <?php genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
1397 </ul>
1398 </li>
1399 <?php } ?>
1400 <li><a class="collapsed" id="proimg" ><span><?php xl('Procedures','e') ?></span></a>
1401 <ul>
1402 <?php genTreeLink('RTop','orl',xl('Providers')); ?>
1403 <?php genTreeLink('RTop','ort',xl('Configuration')); ?>
1404 <?php genTreeLink('RTop','orc',xl('Load Compendium')); ?>
1405 <?php genTreeLink('RTop','orp',xl('Pending Review')); ?>
1406 <?php genTreeLink('RTop','orr',xl('Patient Results')); ?>
1407 <?php genTreeLink('RTop','lda',xl('Lab Overview')); ?>
1408 <?php genTreeLink('RTop','orb',xl('Batch Results')); ?>
1409 <?php genTreeLink('RTop','ore',xl('Electronic Reports')); ?>
1410 <?php genTreeLink('RTop','dld',xl('Lab Documents'));?>
1411 </ul>
1412 </li>
1413 <?php
1414 if($GLOBALS['erx_enable']) {
1415 $newcrop_user_role = sqlQuery("SELECT newcrop_user_role FROM users WHERE username = '".$_SESSION['authUser']."'");
1416 if($newcrop_user_role['newcrop_user_role']) {
1418 <li><a class="collapsed" id="feeimg" ><span><?php xl('New Crop','e') ?></span></a>
1419 <ul>
1420 <li><a class="collapsed_lv2"><span><?php xl('Status','e') ?></span></a>
1421 <ul>
1422 <?php genTreeLink('RTop','erx',xl('e-Rx')); ?>
1423 <?php genMiscLink('RTop','err','0',xl('e-Rx Renewal'),'eRx.php?page=status'); ?>
1424 <?php if($newcrop_user_role['newcrop_user_role'] === 'erxadmin') genMiscLink('RTop','ere','0',xl('e-Rx EPCS'),'eRx.php?page=epcs-admin'); ?>
1425 </ul>
1426 </li>
1427 </ul>
1428 </li>
1429 <?php
1433 <?php if (!$disallowed['adm']) { ?>
1434 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
1435 <ul>
1436 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
1437 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
1438 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
1439 <?php if (acl_check('admin', 'practice' )) genTreeLink('RTop','adb',xl('Addr Book')); ?>
1440 <?php
1441 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1442 if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings&pharmacy&action=list'); ?>
1443 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Codes')); ?>
1444 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
1445 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
1446 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
1447 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1448 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1449 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Rules'),'super/rules/index.php?action=browse!list'); ?>
1450 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Alerts'),'super/rules/index.php?action=alerts!listactmgr'); ?>
1451 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Patient Reminders'),'patient_file/reminder/patient_reminders.php?mode=admin&patient_id='); ?>
1452 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
1453 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('Re Identification'),'de_identification_forms/re_identification_input_screen.php'); ?>
1454 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) genMiscLink('RTop','adm','0',xl('Export'),'main/ippf_export.php'); ?>
1455 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
1456 <ul>
1457 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
1458 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1459 <?php if (acl_check('admin', 'calendar') && !$GLOBALS['disable_calendar']) genMiscLink('RTop','adm','0',xl('Calendar'),'main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig'); ?>
1460 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1461 <?php
1462 if($newcrop_user_role['newcrop_user_role'] || $GLOBALS['erx_enable']) {
1463 if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('eRx Logs'),'logview/erx_logview.php');
1466 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1467 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1468 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Native Data Loads'),'../interface/super/load_codes.php'); ?>
1469 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('External Data Loads'),'../interface/code_systems/dataloads_ajax.php'); ?>
1470 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Merge Patients'),'patient_file/merge_patients.php'); ?>
1471 <?php if ($GLOBALS['enable_auditlog_encryption']) genMiscLink('RTop','rep','0',xl('Audit Log Tamper'),'reports/audit_log_tamper_report.php'); ?>
1472 </ul>
1473 </li>
1474 </ul>
1475 </li>
1476 <?php } ?>
1477 <li><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
1478 <ul>
1479 <?php
1480 $module_query = sqlStatement("SELECT msh.*,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
1481 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1482 WHERE fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='reports' ORDER BY mod_id");
1483 if (sqlNumRows($module_query)) {
1484 $jid = 0;
1485 $modid = '';
1486 while ($modulerow = sqlFetchArray($module_query)) {
1487 $modulePath = "";
1488 $added = "";
1489 if($modulerow['type'] == 0) {
1490 $modulePath = $GLOBALS['customModDir'];
1491 $added = "";
1493 else{
1494 $added = "index";
1495 $modulePath = $GLOBALS['zendModDir'];
1498 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$modulerow['path'];
1499 $mod_nick_name = $modulerow['menu_name'] ? $modulerow['menu_name'] : 'NoName';
1501 if($jid==0 || ($modid!=$modulerow['mod_id'])){
1502 if($modid!='')
1503 echo "</ul>";
1505 <li><a class="collapsed_lv2"><span><?php echo xlt($modulerow['mod_ui_name']); ?></span></a>
1506 <ul>
1507 <?php
1509 $jid++;
1510 $modid = $modulerow['mod_id'];
1511 genMiscLink('RTop','adm','0',xlt($mod_nick_name),$relative_link);
1513 echo "</ul>";
1514 } ?>
1515 <li><a class="collapsed_lv2"><span><?php xl('Clients','e') ?></span></a>
1516 <ul>
1517 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/patient_list.php'); ?>
1518 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genMiscLink('RTop','rep','0',xl('Rx'),'reports/prescriptions_report.php'); ?>
1519 <?php if (acl_check('patients', 'med')) genMiscLink('RTop','rep','0',xl('Patient List Creation'),'reports/patient_list_creation.php'); ?>
1520 <?php if (acl_check('patients', 'med')) genMiscLink('RTop','rep','0',xl('Clinical'),'reports/clinical_reports.php'); ?>
1521 <?php genMiscLink('RTop','rep','0',xl('Referrals'),'reports/referrals_report.php'); ?>
1522 <?php genMiscLink('RTop','rep','0',xl('Immunization Registry'),'reports/immunization_report.php'); ?>
1523 </ul>
1524 </li>
1525 <li><a class="collapsed_lv2"><span><?php xl('Clinic','e') ?></span></a>
1526 <ul>
1527 <?php if ($GLOBALS['enable_cdr'] || $GLOBALS['enable_cqm'] || $GLOBALS['enable_amc']) genMiscLink('RTop','rep','0',xl('Report Results'),'reports/report_results.php'); ?>
1528 <?php if ($GLOBALS['enable_cdr']) genMiscLink('RTop','rep','0',xl('Standard Measures'),'reports/cqm.php?type=standard'); ?>
1529 <?php if ($GLOBALS['enable_cqm']) genMiscLink('RTop','rep','0',xl('Quality Measures (CQM)'),'reports/cqm.php?type=cqm'); ?>
1530 <?php if ($GLOBALS['enable_amc']) genMiscLink('RTop','rep','0',xl('Automated Measures (AMC)'),'reports/cqm.php?type=amc'); ?>
1531 <?php if ($GLOBALS['enable_amc_tracking']) genMiscLink('RTop','rep','0',xl('AMC Tracking'),'reports/amc_tracking.php'); ?>
1532 <?php if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_alert_log'] ) genMiscLink('RTop','rep','0',xl('Alerts Log'),'reports/cdr_log.php'); ?>
1533 </ul>
1534 </li>
1535 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
1536 <ul>
1537 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appointments'),'reports/appointments_report.php'); ?>
1538 <?php if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Patient Flow Board'),'reports/patient_flow_board_report.php'); ?>
1539 <?php genMiscLink('RTop','rep','0',xl('Encounters'),'reports/encounters_report.php'); ?>
1540 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appt-Enc'),'reports/appt_encounter_report.php'); ?>
1541 <?php if (empty($GLOBALS['code_types']['IPPF'])) { ?>
1542 <?php genMiscLink('RTop','rep','0',xl('Superbill'),'reports/custom_report_range.php'); ?>
1543 <?php } ?>
1544 <?php genMiscLink('RTop','rep','0',xl('Eligibility'),'reports/edi_270.php'); ?>
1545 <?php genMiscLink('RTop','rep','0',xl('Eligibility Response'),'reports/edi_271.php'); ?>
1548 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Chart Activity'),'reports/chart_location_activity.php'); ?>
1549 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Charts Out'),'reports/charts_checked_out.php'); ?>
1550 <?php genMiscLink('RTop','rep','0',xl('Services'), 'reports/services_by_category.php'); ?>
1551 <?php genMiscLink('RTop','rep','0',xl('Syndromic Surveillance'),'reports/non_reported.php'); ?>
1552 </ul>
1553 </li>
1554 <?php if (acl_check('acct', 'rep_a')) { ?>
1555 <li><a class="collapsed_lv2"><span><?php xl('Financial','e') ?></span></a>
1556 <ul>
1557 <?php genMiscLink('RTop','rep','0',xl('Sales'),'reports/sales_by_item.php'); ?>
1558 <?php genMiscLink('RTop','rep','0',xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
1559 <?php genMiscLink('RTop','rep','0',xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
1560 <?php genMiscLink('RTop','rep','0',xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
1561 <?php genMiscLink('RTop','rep','0',xl('Collections'), 'reports/collections_report.php'); ?>
1562 <?php genMiscLink('RTop','rep','0',xl('Pat Ledger'),'reports/pat_ledger.php?form=0'); ?>
1563 <?php genMiscLink('RTop','rep','0',xl('Financial Summary by Service Code'),'reports/svc_code_financial_report.php'); ?>
1564 </ul>
1565 </li>
1566 <?php } ?>
1567 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
1568 <li><a class="collapsed_lv2"><span><?php xl('Inventory','e') ?></span></a>
1569 <ul>
1570 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/inventory_list.php'); ?>
1571 <?php genMiscLink('RTop','rep','0',xl('Activity'),'reports/inventory_activity.php'); ?>
1572 <?php genMiscLink('RTop','rep','0',xl('Transactions'),'reports/inventory_transactions.php'); ?>
1573 </ul>
1574 </li>
1575 <?php } ?>
1576 <li><a class="collapsed_lv2"><span><?php xl('Procedures','e') ?></span></a>
1577 <ul>
1578 <?php genPopLink(xl('Pending Res'),'../orders/pending_orders.php'); ?>
1579 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink(xl('Pending F/U'),'../orders/pending_followup.php'); ?>
1580 <?php genPopLink(xl('Statistics'),'../orders/procedure_stats.php'); ?>
1581 </ul>
1582 </li>
1583 <?php if (! $GLOBALS['simplified_demographics']) { ?>
1584 <li><a class="collapsed_lv2"><span><?php xl('Insurance','e') ?></span></a>
1585 <ul>
1586 <?php genMiscLink('RTop','rep','0',xl('Distribution'),'reports/insurance_allocation_report.php'); ?>
1587 <?php genMiscLink('RTop','rep','0',xl('Indigents'),'billing/indigent_patients_report.php'); ?>
1588 <?php genMiscLink('RTop','rep','0',xl('Unique SP'),'reports/unique_seen_patients_report.php'); ?>
1589 </ul>
1590 </li>
1591 <?php } ?>
1592 <?php if (!empty($GLOBALS['code_types']['IPPF'])) { ?>
1593 <li><a class="collapsed_lv2"><span><?php xl('Statistics','e') ?></span></a>
1594 <ul>
1595 <?php genPopLink(xl('IPPF Stats'),'ippf_statistics.php?t=i'); ?>
1596 <?php genPopLink(xl('GCAC Stats'),'ippf_statistics.php?t=g'); ?>
1597 <?php genPopLink(xl('MA Stats'),'ippf_statistics.php?t=m'); ?>
1598 <?php genPopLink(xl('CYP'),'ippf_cyp_report.php'); ?>
1599 <?php genPopLink(xl('Daily Record'),'ippf_daily.php'); ?>
1600 </ul>
1601 </li>
1602 <?php } // end ippf-specific ?>
1603 <li><a class="collapsed_lv2"><span><?php xl('Blank Forms','e') ?></span></a>
1604 <ul>
1605 <?php genPopLink(xl('Demographics'),'../patient_file/summary/demographics_print.php'); ?>
1606 <?php genPopLink(xl('Superbill/Fee Sheet'),'../patient_file/printed_fee_sheet.php'); ?>
1607 <?php genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php'); ?>
1608 <?php
1609 $lres = sqlStatement("SELECT * FROM list_options " .
1610 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1611 while ($lrow = sqlFetchArray($lres)) {
1612 $option_id = $lrow['option_id']; // should start with LBF
1613 $title = $lrow['title'];
1614 genPopLink($title, "../forms/LBF/printable.php?formname=$option_id");
1617 </ul>
1618 </li>
1619 <?php if (acl_check('admin','super')) { ?>
1620 <li><a class="collapsed_lv2"><span><?php echo xlt('Services') ?></span></a>
1621 <ul>
1622 <?php genMiscLink('RTop','rep','0',xl('Background Services'),'reports/background_services.php'); ?>
1623 <?php genMiscLink('RTop','rep','0',xl('Direct Message Log'),'reports/direct_message_log.php'); ?>
1624 </ul>
1625 </li>
1626 <?php } ?>
1628 <?php // genTreeLink('RTop','rep','Other'); ?>
1629 </ul>
1630 </li>
1631 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1632 <ul>
1633 <?php genTreeLink('RTop','ped',xl('Patient Education')); ?>
1634 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1635 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1636 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1637 <?php genTreeLink('RTop','ort',xl('Order Catalog')); ?>
1638 <?php if (!$GLOBALS['disable_chart_tracker']) genTreeLink('RTop','cht',xl('Chart Tracker')); ?>
1639 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1640 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1641 <?php $myrow = sqlQuery("SELECT state FROM registry WHERE directory = 'track_anything'");
1642 if($myrow['state']=='1') { genTreeLink('RTop','tan',xl('Configure Tracks')); } ?>
1643 <?php genTreeLink('RTop','pwd',xl('Password')); ?>
1644 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1645 <?php if(acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('New Documents'),'../controller.php?document&list&patient_id=00'); ?>
1646 <?php if (acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('Document Templates'),'super/manage_document_templates.php'); ?>
1647 </ul>
1648 </li>
1650 <?php } // end not athletic team ?>
1652 </ul>
1654 <?php } else { // end ($GLOBALS['concurrent_layout'] == 2 || $GLOBALS['concurrent_layout'] == 3) ?>
1656 <table cellpadding='0' cellspacing='0' border='0'>
1657 <tr>
1658 <td colspan='3'>
1659 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1660 <tr>
1661 <td class='smalltext' nowrap>
1662 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
1663 </td>
1664 <td class='smalltext' align='right' nowrap>
1665 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
1666 </td>
1667 </tr>
1668 </table>
1669 </td>
1670 </tr>
1671 <?php
1672 // Builds the table of radio buttons and their labels. Radio button values
1673 // are comprised of the 3-character document id and the 1-digit usage type,
1674 // so that JavaScript can easily access this information.
1675 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
1676 foreach ($primary_docs as $key => $varr) {
1677 if (!empty($disallowed[$key])) continue;
1678 $label = $varr[0];
1679 $usage = $varr[1];
1680 $url = $varr[2];
1681 echo " <tr>\n";
1682 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
1683 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
1684 if ($key == $default_top_rbid) echo " checked";
1685 echo " /></td>\n";
1686 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
1687 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
1688 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
1689 if ($key == 'msg') echo " checked";
1690 echo " /></td>\n";
1691 echo " </tr>\n";
1694 </table>
1696 <?php } ?>
1698 <br /><hr />
1700 <?php
1701 // To use RelayHealth, see comments and parameters in includes/config.php.
1702 if (!empty($GLOBALS['ssi']['rh'])) {
1703 include_once("../../library/ssi.inc");
1704 echo getRelayHealthLink() ."<br /><hr />\n";
1708 <div id='current_patient' style = 'display:none'>
1709 <b><?php xl('None','e'); ?></b>
1710 </div>
1712 <div id='current_encounter' style = 'display:none'>
1713 <b><?php xl('None','e'); ?></b>
1714 </div>
1716 <?php
1717 if (!$GLOBALS['athletic_team']) {
1718 genPopupsList();
1719 echo "<hr />\n";
1720 genFindBlock();
1721 echo "<hr />\n";
1725 <input type='hidden' name='findBy' value='Last' />
1726 <input type="hidden" name="searchFields" id="searchFields"/>
1727 <input type="hidden" name="search_service_code" value='' />
1729 </form>
1731 <script language='JavaScript'>
1732 syncRadios();
1733 </script>
1735 </body>
1736 </html>