DBC Dutch System
[openemr.git] / interface / main / left_nav.php
blob4e818c709416ffc7750e6ce1f6ccaaf2a935ffc3
1 <?php
2 // Copyright (C) 2006, 2008 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // This provides the left navigation frame when $GLOBALS['concurrent_layout']
10 // is true. Following are notes as to what else was changed for this feature:
12 // * interface/main/main_screen.php: the top-level frameset.
13 // * interface/main/finder/patient_select.php: loads stuff when a new patient
14 // is selected.
15 // * interface/patient_file/summary/demographics.php: this is the first frame
16 // loaded when a new patient is chosen, and in turn sets the current pid and
17 // then loads the initial bottom frame.
18 // * interface/patient_file/summary/demographics_full.php: added support for
19 // setting a new pid, needed for going to demographics from billing.
20 // * interface/patient_file/summary/demographics_save.php: redisplay
21 // demographics.php and not the frameset.
22 // * interface/patient_file/summary/summary_bottom.php: new frameset for the
23 // summary, prescriptions and notes for a selected patient, cloned from
24 // patient_summary.php.
25 // * interface/patient_file/encounter/encounter_bottom.php: new frameset for
26 // the selected encounter, mosting coding/billing stuff, cloned from
27 // patient_encounter.php. This will also self-load the superbill pages
28 // as requested.
29 // * interface/usergroup/user_info.php: removed Back link.
30 // * interface/usergroup/admin_frameset.php: new frameset for Admin pages,
31 // cloned from usergroup.php.
32 // * interface/main/onotes/office_comments.php: removed Back link target.
33 // * interface/main/onotes/office_comments_full.php: changed Back link.
34 // * interface/billing/billing_report.php: removed Back link; added logic
35 // to properly go to demographics or to an encounter when requested.
36 // * interface/new/new.php: removed Back link and revised form target.
37 // * interface/new/new_patient_save.php: modified to load the demographics
38 // page to the current frame instead of loading a new frameset.
39 // * interface/patient_file/history/history.php: target change.
40 // * interface/patient_file/history/history_full.php: target changes.
41 // * interface/patient_file/history/history_save.php: target change.
42 // * interface/patient_file/history/encounters.php: link/target changes.
43 // * interface/patient_file/history/encounters_full.php: link/target changes.
44 // * interface/patient_file/encounter/encounter_top.php: another new frameset
45 // cloned from patient_encounter.php.
46 // * interface/patient_file/encounter/forms.php: link target removal.
47 // * interface/patient_file/encounter/new_form.php: target change.
48 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
49 // changes.
50 // * interface/patient_file/summary/immunizations.php: removed back link.
51 // * interface/patient_file/summary/pnotes.php: changed link targets.
52 // * interface/patient_file/summary/pnotes_full.php: changed back link and
53 // added set_pid logic.
54 // * interface/patient_file/transaction/transactions.php: various changes.
55 // * interface/patient_file/transaction/add_transaction.php: new return js.
56 // * interface/patient_file/encounter/superbill_codes.php: target and link
57 // changes.
58 // * interface/patient_file/encounter/superbill_custom_full.php: target and
59 // link changes.
60 // * interface/patient_file/encounter/diagnosis.php: target changes.
61 // * interface/patient_file/encounter/diagnosis_full.php: target and link
62 // changes.
63 // * interface/main/authorizations/authorizations.php: link and target changes.
64 // * library/api.inc: url change.
65 // * interface/patient_file/summary/rx_frameset.php: new frameset.
66 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
67 // * all encounter forms: remove all instances of "target=Main" and change
68 // all instances of "patient_encounter.php" to "encounter_top.php".
70 // Our find_patient form, when submitted, invokes patient_select.php in the
71 // upper frame. When the patient is selected, demographics.php is invoked
72 // with the set_pid parameter, which establishes the new session pid and also
73 // calls the setPatient() function (below). In this case demographics.php
74 // will also load the summary frameset into the bottom frame, invoking our
75 // loadFrame() and setRadio() functions.
77 // Similarly, we have the concept of selecting an encounter from the
78 // Encounters list, and then having that "stick" until some other encounter
79 // or a new encounter is chosen. We also have a navigation item for creating
80 // a new encounter. interface/patient_file/encounter/encounter_top.php
81 // supports set_encounter to establish an encounter.
83 // TBD: Include active_pid and/or active_encounter in relevant submitted
84 // form data, and add logic to the save routines to make sure they match
85 // the corresponding session values.
87 include_once("../globals.php");
88 include_once("../../library/acl.inc");
89 include_once("../../custom/code_types.inc.php");
91 // This array defines the list of primary documents that may be
92 // chosen. Each element value is an array of 3 values:
94 // * Name to appear in the navigation table
95 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific
96 // * The URL relative to the interface directory
99 // larry :: dbc insert
100 $demovarbase = ( $GLOBALS['dutchpc'] ) ? 'demographics_dutch.php' : 'demographics.php';
101 // larry :: end of dbc insert
104 $primary_docs = array(
105 'ros' => array('Roster' , 0, 'reports/players_report.php?embed=1'),
106 'cal' => array('Calendar' , 0, 'main/main_info.php'),
107 'pwd' => array('Password' , 0, 'usergroup/user_info.php'),
108 'adm' => array('Admin' , 0, 'usergroup/admin_frameset.php'),
109 'rep' => array('Reports' , 0, 'reports/index.php'),
110 'ono' => array('Ofc Notes' , 0, 'main/onotes/office_comments.php'),
111 'fax' => array('Fax/Scan' , 0, 'fax/faxq.php'),
112 'adb' => array('Addr Bk' , 0, 'usergroup/addrbook_list.php'),
113 'imp' => array('Import' , 0, '../custom/import.php'),
114 'bil' => array('Billing' , 0, 'billing/billing_report.php'),
115 'sup' => array('Superbill' , 0, 'patient_file/encounter/superbill_custom_full.php'),
116 'aun' => array('Auth/notes', 0, 'main/authorizations/authorizations.php'),
117 'new' => array('New Pt' , 0, 'new/new.php'),
118 'dem' => array('Patient' , 1, $demovarbase ),
119 'his' => array('History' , 1, 'patient_file/history/history.php'),
120 'ens' => array('Encounters', 1, 'patient_file/history/encounters.php'),
121 'nen' => array('New Enctr' , 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
122 'pre' => array('Rx' , 1, 'patient_file/summary/rx_frameset.php'),
123 'iss' => array('Issues' , 1, 'patient_file/summary/stats_full.php?active=all'),
124 'imm' => array('Immunize' , 1, 'patient_file/summary/immunizations.php'),
125 'doc' => array('Documents' , 1, '../controller.php?document&list&patient_id={PID}'),
126 'prp' => array('Pt Report' , 1, 'patient_file/report/patient_report.php'),
127 'pno' => array('Pt Notes' , 1, 'patient_file/summary/pnotes.php'),
128 'tra' => array('Transact' , 1, 'patient_file/transaction/transactions.php'),
129 'sum' => array('Summary' , 1, 'patient_file/summary/summary_bottom.php'),
130 'enc' => array('Encounter' , 2, 'patient_file/encounter/encounter_top.php'),
131 'cod' => array('Charges' , 2, 'patient_file/encounter/encounter_bottom.php'),
134 // This section decides which navigation items will not appear.
136 $disallowed = array();
138 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
139 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
140 acl_check('admin', 'practice') || acl_check('admin', 'users'));
142 $disallowed['bil'] = !(acl_check('acct', 'rep') || acl_check('acct', 'eob') ||
143 acl_check('acct', 'bill'));
145 $tmp = acl_check('patients', 'demo');
146 $disallowed['new'] = !($tmp == 'write' || $tmp == 'addonly');
148 if ( isset ($GLOBALS['hylafax_server']) && isset ($GLOBALS['scanner_output_directory']) ) {
149 $disallowed['fax'] = !($GLOBALS['hylafax_server'] || $GLOBALS['scanner_output_directory']);
152 $disallowed['ros'] = !$GLOBALS['athletic_team'];
154 $disallowed['iss'] = !((acl_check('encounters', 'notes') == 'write' ||
155 acl_check('encounters', 'notes_a') == 'write') &&
156 acl_check('patients', 'med') == 'write');
158 $disallowed['imp'] = $disallowed['new'] ||
159 !is_readable("$webserver_root/custom/import.php");
161 // Helper functions for treeview generation.
162 function genTreeLink($frame, $name, $title) {
163 global $primary_docs, $disallowed;
164 if (empty($disallowed[$name])) {
165 $id = $name . $primary_docs[$name][1];
166 echo "<li><a href='' id='$id' " .
167 "onclick=\"return loadFrame2('$id','$frame','" .
168 $primary_docs[$name][2] . "')\">" . xl($title) . "</a></li>";
171 function genMiscLink($frame, $name, $level, $title, $url) {
172 global $primary_docs, $disallowed;
173 if (empty($disallowed[$name])) {
174 $id = $name . $level;
175 echo "<li><a href='' id='$id' " .
176 "onclick=\"return loadFrame2('$id','$frame','" .
177 $url . "')\">" . xl($title) . "</a></li>";
180 function genPopLink($title, $url) {
181 echo "<li><a href='' " .
182 "onclick=\"return repPopup('$url')\"" .
183 ">" . xl($title) . "</a></li>";
186 <html>
187 <head>
188 <title>Navigation</title>
189 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
191 <style type="text/css">
192 body {
193 font-size:8pt;
194 font-weight:normal;
195 padding: 5px 3px 5px 3px;
197 .smalltext {
198 font-family:sans-serif;
199 font-size:8pt;
200 font-weight:normal;
202 a.navitem, a.navitem:visited {
203 color:#0000ff;
204 font-family:sans-serif;
205 font-size:8pt;
206 font-weight:bold;
208 .inputtext {
209 font-size:9pt;
210 font-weight:normal;
211 border-style:solid;
212 border-width:1px;
213 padding-left:2px;
214 padding-right:2px;
215 border-color: #000000;
216 background-color:transparent;
219 #navigation ul {
220 background-color:transparent;
222 </style>
224 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.3/jquery.treeview.css" />
225 <script src="../../library/js/jquery-1.2.2.min.js" type="text/javascript"></script>
226 <script src="../../library/js/jquery.treeview-1.3/jquery.treeview.min.js" type="text/javascript"></script>
228 <script type="text/javascript" src="../../library/dialog.js"></script>
230 <script language='JavaScript'>
232 // Master values for current pid and encounter.
233 var active_pid = 0;
234 var active_encounter = 0;
236 // Current selections in the top and bottom frames.
237 var topName = '';
238 var botName = '';
240 // Expand and/or collapse frames in response to checkbox clicks.
241 // fnum indicates which checkbox was clicked (1=left, 2=right).
242 function toggleFrame(fnum) {
243 var f = document.forms[0];
244 var fset = top.document.getElementById('fsright');
245 if (!f.cb_top.checked && !f.cb_bot.checked) {
246 if (fnum == 1) f.cb_bot.checked = true;
247 else f.cb_top.checked = true;
249 var rows = f.cb_top.checked ? '*' : '0';
250 rows += f.cb_bot.checked ? ',*' : ',0';
251 fset.rows = rows;
252 fset.rows = rows;
255 // Load the specified url into the specified frame (RTop or RBot).
256 // The URL provided must be relative to interface.
257 function loadFrame(fname, frame, url) {
258 top.restoreSession();
259 var i = url.indexOf('{PID}');
260 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
261 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
262 if (frame == 'RTop') topName = fname; else botName = fname;
265 // Load the specified url into a frame to be determined, with the specified
266 // frame as the default; the url must be relative to interface.
267 function loadFrame2(fname, frame, url) {
268 var usage = fname.substring(3);
269 if (active_pid == 0 && usage > '0') {
270 alert('<?php xl('You must first select or add a patient.','e') ?>');
271 return false;
273 if (active_encounter == 0 && usage > '1') {
274 alert('<?php xl('You must first select or create an encounter.','e') ?>');
275 return false;
277 var f = document.forms[0];
278 top.restoreSession();
279 var i = url.indexOf('{PID}');
280 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
281 var fi = f.sel_frame.selectedIndex;
282 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
283 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
284 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
285 if (frame == 'RTop') topName = fname; else botName = fname;
286 return false;
289 // Select a designated radio button. raname may be either the radio button
290 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
291 // You should call this if you directly load a document that does not
292 // correspond to the current radio button setting.
293 function setRadio(raname, rbid) {
294 <?php if ($GLOBALS['concurrent_layout'] != 2) { ?>
295 var f = document.forms[0];
296 if (raname == 'RTop') raname = 'rb_top';
297 if (raname == 'RBot') raname = 'rb_bot';
298 for (var i = 0; i < f[raname].length; ++i) {
299 if (f[raname][i].value.substring(0,3) == rbid) {
300 f[raname][i].checked = true;
301 return true;
304 <?php } ?>
305 return false;
308 // Set disabled/enabled state of radio buttons and associated labels
309 // depending on whether there is an active patient or encounter.
310 function syncRadios() {
311 var f = document.forms[0];
312 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
313 var nlinks = document.links.length;
314 for (var i = 0; i < nlinks; ++i) {
315 var lnk = document.links[i];
316 if (lnk.id.length != 4) continue;
317 var usage = lnk.id.substring(3);
318 if (usage == '1' || usage == '2') {
319 var da = false;
320 if (active_pid == 0) da = true;
321 if (active_encounter == 0 && usage > '1') da = true;
322 lnk.style.color = da ? '#888888' : '#0000ff';
325 <?php } else { ?>
326 for (var i = 0; i < f.rb_top.length; ++i) {
327 var da = false;
328 var rb1 = f.rb_top[i];
329 var rb2 = f.rb_bot[i];
330 var rbid = rb1.value.substring(0,3);
331 var usage = rb1.value.substring(3);
332 if (active_pid == 0 && usage > '0') da = true;
333 if (active_encounter == 0 && usage > '1') da = true;
334 // daemon_frame can also set special label colors, so don't mess with
335 // them unless we have to.
336 if (rb1.disabled != da) {
337 rb1.disabled = da;
338 rb2.disabled = da;
339 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
342 <?php } ?>
343 f.popups.disabled = (active_pid == 0);
346 // Process the click to find a patient by name, id, ssn or dob.
347 function findPatient(findby) {
348 var f = document.forms[0];
349 if (! f.cb_top.checked) {
350 f.cb_top.checked = true;
351 toggleFrame(1);
353 f.findBy.value = findby;
354 setRadio('rb_top', 'dem');
355 top.restoreSession();
356 document.find_patient.submit();
359 // Helper function to set the contents of a div.
360 function setDivContent(id, content) {
361 if (document.getElementById) {
362 var x = document.getElementById(id);
363 x.innerHTML = '';
364 x.innerHTML = content;
366 else if (document.all) {
367 var x = document.all[id];
368 x.innerHTML = content;
372 // This is called automatically when a new patient is set, to make sure
373 // there are no patient-specific documents showing stale data. If a frame
374 // was just loaded with data for the correct patient, its name is passed so
375 // that it will not be zapped. At this point the new server-side pid is not
376 // assumed to be set, so this function will only load global data.
377 function reloadPatient(frname) {
378 var f = document.forms[0];
379 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
380 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
381 setRadio('rb_top', 'cal');
383 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
384 loadFrame('aun0','RBot', '<?php echo $primary_docs['aun'][2]; ?>');
385 setRadio('rb_bot', 'aun');
389 // Reload encounter-specific frames, excluding a specified frame. At this
390 // point the new server-side encounter ID may not be set and loading the same
391 // document for the new encounter will not work, so load patient info instead.
392 function reloadEncounter(frname) {
393 var f = document.forms[0];
394 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
395 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
396 setRadio('rb_top', 'dem');
398 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
399 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
400 setRadio('rb_bot', 'ens');
404 // Call this to announce that the patient has changed. You must call this
405 // if you change the session PID, so that the navigation frame will show the
406 // correct patient and so that the other frame will be reloaded if it contains
407 // patient-specific information from the previous patient. frname is the name
408 // of the frame that the call came from, so we know to only reload content
409 // from the *other* frame if it is patient-specific.
410 function setPatient(pname, pid, frname) {
411 if (pid == active_pid) return;
412 var str = '<b>' + pname + ' (' + pid + ')</b>';
413 setDivContent('current_patient', str);
414 setDivContent('current_encounter', '<b>None</b>');
415 active_pid = pid;
416 active_encounter = 0;
417 if (frname) reloadPatient(frname);
418 syncRadios();
421 // Call this to announce that the encounter has changed. You must call this
422 // if you change the session encounter, so that the navigation frame will
423 // show the correct encounter and so that the other frame will be reloaded if
424 // it contains encounter-specific information from the previous encounter.
425 // frname is the name of the frame that the call came from, so we know to only
426 // reload encounter-specific content from the *other* frame.
427 function setEncounter(edate, eid, frname) {
428 if (eid == active_encounter) return;
429 if (!eid) edate = 'None';
430 var str = '<b>' + edate + '</b>';
431 setDivContent('current_encounter', str);
432 active_encounter = eid;
433 reloadEncounter(frname);
434 syncRadios();
437 // You must call this if you delete the active patient (or if for any other
438 // reason you "close" the active patient without opening a new one), so that
439 // the appearance of the navigation frame will be correct and so that any
440 // stale content will be reloaded.
441 function clearPatient() {
442 if (active_pid == 0) return;
443 var f = document.forms[0];
444 active_pid = 0;
445 active_encounter = 0;
446 setDivContent('current_encounter', '<b>None</b>');
447 setDivContent('current_patient', '<b>None</b>');
448 reloadPatient('');
449 syncRadios();
452 // You must call this if you delete the active encounter (or if for any other
453 // reason you "close" the active encounter without opening a new one), so that
454 // the appearance of the navigation frame will be correct and so that any
455 // stale content will be reloaded.
456 function clearEncounter() {
457 if (active_encounter == 0) return;
458 setDivContent('current_encounter', '<b>None</b>');
459 active_encounter = 0;
460 reloadEncounter('');
461 syncRadios();
464 // You can call this to make sure the session pid is what we expect.
465 function pidSanityCheck(pid) {
466 if (pid != active_pid) {
467 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
468 '. This session is unstable and should be abandoned. Do not use ' +
469 'OpenEMR in multiple browser windows!');
470 return false;
472 return true;
475 // You can call this to make sure the session encounter is what we expect.
476 function encounterSanityCheck(eid) {
477 if (eid != active_encounter) {
478 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
479 '. This session is unstable and should be abandoned. Do not use ' +
480 'OpenEMR in multiple browser windows!');
481 return false;
483 return true;
486 // Pop up a report.
487 function repPopup(aurl) {
488 top.restoreSession();
489 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
490 return false;
493 // This is invoked to pop up some window when a popup item is selected.
494 function selpopup(selobj) {
495 var i = selobj.selectedIndex;
496 var opt = selobj.options[i];
497 if (i > 0) {
498 var width = 750;
499 var height = 550;
500 if (opt.text == 'Export' || opt.text == 'Import') {
501 width = 500;
502 height = 400;
504 else if (opt.text == 'Refer') {
505 width = 700;
506 height = 500;
508 dlgopen(opt.value, '_blank', width, height);
510 selobj.selectedIndex = 0;
513 // Treeview activation stuff:
514 $(document).ready(function(){
515 $("#navigation").treeview({
516 animated: "fast",
517 collapsed: true,
518 unique: true,
519 toggle: function() {
520 window.console && console.log("%o was toggled", this);
525 </script>
527 </head>
529 <body class="body_nav">
531 <form method='post' name='find_patient' target='RTop'
532 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
534 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
536 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:100%;'>
537 <option value='0'><?php xl('Default','e'); ?></option>
538 <option value='1'><?php xl('Top','e'); ?></option>
539 <option value='2'><?php xl('Bottom','e'); ?></option>
540 </select>
542 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
543 <tr>
544 <td class='smalltext' nowrap>
545 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
546 </td>
547 <td class='smalltext' align='right' nowrap>
548 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
549 </td>
550 </tr>
551 </table>
553 <ul id="navigation">
554 <li class="open"><span><?php xl('Patient/Client','e') ?></span>
555 <ul>
556 <li><span><?php xl('Management','e') ?></span>
557 <ul>
558 <?php genTreeLink('RTop','new','New'); ?>
559 <?php genTreeLink('RTop','dem','Current'); ?>
560 <?php genTreeLink('RBot','sum','Summary'); ?>
561 </ul>
562 </li>
563 <li class="open"><span><?php xl('Visits','e') ?></span>
564 <ul>
565 <?php genTreeLink('RTop','cal','Calendar'); ?>
566 <?php genTreeLink('RBot','nen','New'); ?>
567 <?php genTreeLink('RBot','enc','Current'); ?>
568 <?php genTreeLink('RBot','ens','List'); ?>
569 <?php genTreeLink('RBot','tra','Transact'); ?>
570 </ul>
571 </li>
572 <li><span><?php xl('Medical Record','e') ?></span>
573 <ul>
574 <?php genTreeLink('RBot','pre','Rx'); ?>
575 <?php genTreeLink('RTop','his','History'); ?>
576 <?php genTreeLink('RTop','iss','Issues'); ?>
577 <?php genTreeLink('RBot','imm','Immunize'); ?>
578 <?php genTreeLink('RTop','doc','Documents'); ?>
579 <?php genTreeLink('RBot','pno','Notes'); ?>
580 <?php genTreeLink('RTop','prp','Report'); ?>
581 </ul>
582 </li>
583 </ul>
584 </li>
585 <li><span><?php xl('Fees','e') ?></span>
586 <ul>
587 <?php genMiscLink('RBot','cod','2','Fee Sheet','patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
588 <?php if (false) genTreeLink('RBot','cod','Charges'); ?>
589 <?php genMiscLink('RBot','bil','1','Checkout','patient_file/pos_checkout.php?framed=1'); ?>
590 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil','Billing'); ?>
591 </ul>
592 </li>
593 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0','Inventory','drugs/drug_inventory.php'); ?>
594 <li><span><?php xl('Administration','e') ?></span>
595 <ul>
596 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0','Users','usergroup/usergroup_admin.php'); ?>
597 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0','Practice','../controller.php?practice_settings'); ?>
598 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup','Services'); ?>
599 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0','Layouts','super/edit_layout.php'); ?>
600 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0','Lists','super/edit_list.php'); ?>
601 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0','ACL','usergroup/adminacl.php'); ?>
602 <li><span><?php xl('Other','e') ?></span>
603 <ul>
604 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0','Language','language/language.php'); ?>
605 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0','Forms','forms_admin/forms_admin.php'); ?>
606 <?php if (acl_check('admin', 'calendar')) genMiscLink('RTop','adm','0','Calendar','main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig'); ?>
607 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0','Logs','logview/logview.php'); ?>
608 <?php if (acl_check('admin', 'database')) genMiscLink('RTop','adm','0','Database','main/myadmin/index.php'); ?>
609 </ul>
610 </li>
611 </ul>
612 </li>
613 <li><span><?php xl('Reports','e') ?></span>
614 <ul>
615 <li><span><?php xl('Clients','e') ?></span>
616 <ul>
617 <?php genPopLink('List','patient_list.php'); ?>
618 <?php genPopLink('Rx','prescriptions_report.php'); ?>
619 <?php genPopLink('Referrals','referrals_report.php'); ?>
620 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink('IPPF Stats','ippf_statistics.php?t=i'); ?>
621 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink('MA Stats','ippf_statistics.php?t=m'); ?>
622 </ul>
623 </li>
624 <li class="open"><span><?php xl('Visits','e') ?></span>
625 <ul>
626 <?php genPopLink('Appointments','appointments_report.php'); ?>
627 <?php genPopLink('Encounters','encounters_report.php'); ?>
628 <?php genPopLink('Appt-Enc','appt_encounter_report.php'); ?>
629 </ul>
630 </li>
631 <?php if (acl_check('acct', 'rep_a')) { ?>
632 <li><span><?php xl('Financial','e') ?></span>
633 <ul>
634 <?php genPopLink('Sales','sales_by_item.php'); ?>
635 <?php genPopLink('Cash Rec','../billing/sl_receipts_report.php'); ?>
636 <?php genPopLink('Front Rec','front_receipts_report.php'); ?>
637 <?php genPopLink('Pmt Method','receipts_by_method_report.php'); ?>
638 <?php genPopLink('Collections','collections_report.php'); ?>
639 </ul>
640 </li>
641 <?php } ?>
642 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
643 <li><span><?php xl('Inventory','e') ?></span>
644 <ul>
645 <?php genPopLink('Destroyed','destroyed_drugs_report.php'); ?>
646 </ul>
647 </li>
648 <?php } ?>
649 <?php if (! $GLOBALS['simplified_demographics']) { ?>
650 <li><span><?php xl('Insurance','e') ?></span>
651 <ul>
652 <?php genPopLink('Distribution','insurance_allocation_report.php'); ?>
653 <?php genPopLink('Indigents','../billing/indigent_patients_report.php'); ?>
654 <?php genPopLink('Unique SP','unique_seen_patients_report.php'); ?>
655 </ul>
656 </li>
657 <?php } ?>
658 <?php if ($GLOBALS['athletic_team']) { ?>
659 <li><span><?php xl('Athletic','e') ?></span>
660 <ul>
661 <?php genPopLink('Roster','players_report.php'); ?>
662 <?php genPopLink('Missed','absences_report.php'); ?>
663 <?php genPopLink('Injuries','football_injury_report.php'); ?>
664 <?php genPopLink('Inj Ov','injury_overview_report.php'); ?>
665 </ul>
666 </li>
667 <?php } ?>
668 <?php // genTreeLink('RTop','rep','Other'); ?>
669 </ul>
670 </li>
671 <li><span><?php xl('Miscellaneous','e') ?></span>
672 <ul>
673 <?php genTreeLink('RBot','aun','Pt Notes/Auth'); ?>
674 <?php genTreeLink('RTop','fax','Fax/Scan'); ?>
675 <?php genTreeLink('RTop','adb','Addr Book'); ?>
676 <?php genTreeLink('RTop','ono','Ofc Notes'); ?>
677 <?php genMiscLink('RTop','adm','0','BatchCom','batchcom/batchcom.php'); ?>
678 <?php genTreeLink('RTop','pwd','Password'); ?>
679 </ul>
680 </li>
681 </ul>
683 <?php } else { ?>
685 <table cellpadding='0' cellspacing='0' border='0'>
686 <tr>
687 <td colspan='3'>
688 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
689 <tr>
690 <td class='smalltext' nowrap>
691 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
692 </td>
693 <td class='smalltext' align='right' nowrap>
694 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
695 </td>
696 </tr>
697 </table>
698 </td>
699 </tr>
700 <?php
701 // Builds the table of radio buttons and their labels. Radio button values
702 // are comprised of the 3-character document id and the 1-digit usage type,
703 // so that JavaScript can easily access this information.
704 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
705 foreach ($primary_docs as $key => $varr) {
706 if (!empty($disallowed[$key])) continue;
707 $label = $varr[0];
708 $usage = $varr[1];
709 $url = $varr[2];
710 echo " <tr>\n";
711 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
712 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
713 if ($key == $default_top_rbid) echo " checked";
714 echo " /></td>\n";
715 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
716 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
717 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
718 if ($key == 'aun') echo " checked";
719 echo " /></td>\n";
720 echo " </tr>\n";
723 </table>
725 <?php } ?>
727 <br /><hr />
729 <?php xl('Active Patient','e') ?>:<br />
730 <div id='current_patient'>
731 <b>None</b>
732 </div>
734 <?php xl('Active Encounter','e') ?>:<br />
735 <div id='current_encounter'>
736 <b>None</b>
737 </div>
739 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;'>
740 <option value=''><?php xl('Popups','e'); ?></option>
741 <?php if (!$disallowed['iss']) { ?>
742 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
743 <?php } ?>
744 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
745 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
746 <?php if ($GLOBALS['athletic_team']) { ?>
747 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
748 <?php } ?>
749 <option value='../reports/appointments_report.php?patient=<?php echo $pid ?>'><?php xl('Appts','e'); ?></option>
750 <?php if (file_exists("$webserver_root/custom/refer.php")) { ?>
751 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
752 <?php } ?>
753 <?php if (file_exists("$webserver_root/custom/fee_sheet_codes.php")) { ?>
754 <option value='../patient_file/printed_fee_sheet.php'><?php xl('Superbill','e'); ?></option>
755 <?php } ?>
756 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
757 <option value='../patient_file/front_payment.php'><?php xl('Prepay','e'); ?></option>
758 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
759 <?php } else { ?>
760 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
761 <?php } ?>
762 </select>
764 <hr />
766 <table cellpadding='0' cellspacing='0' border='0'>
767 <tr>
768 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
769 <td class='smalltext' colspan='2'>
770 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
771 </td>
772 </tr>
773 <tr>
774 <td class='smalltext'><?php xl('by','e') ?>:</td>
775 <td class='smalltext'>
776 <a href="javascript:findPatient('Last');" class="navitem">Name</a>
777 </td>
778 <td class='smalltext' align='right'>
779 <a href="javascript:findPatient('ID');" class="navitem">ID</a>
780 </td>
781 </tr>
782 <tr>
783 <td class='smalltext'>&nbsp;</td>
784 <td class='smalltext'>
785 <a href="javascript:findPatient('SSN');" class="navitem">SSN</a>
786 </td>
787 <td class='smalltext' align='right'>
788 <a href="javascript:findPatient('DOB');" class="navitem">DOB</a>
789 </td>
790 </tr>
791 </table>
793 <hr />
794 <a href="../logout.php?auth=logout" target="_top" class="navitem" id="logout_link"
795 onclick="top.restoreSession()">
796 <?php xl('Logout','e'); ?></a>
798 <input type='hidden' name='findBy' value='Last' />
800 </form>
802 <script language='JavaScript'>
803 syncRadios();
804 </script>
806 </body>
807 </html>