added custom menu for sports teams
[openemr.git] / interface / main / left_nav.php
blob1ea99c15fbe011263735297babe3f6a717c60d77
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
103 $primary_docs = array(
104 'ros' => array('Roster' , 0, 'reports/players_report.php?embed=1'),
105 'cal' => array('Calendar' , 0, 'main/main_info.php'),
106 'pwd' => array('Password' , 0, 'usergroup/user_info.php'),
107 'adm' => array('Admin' , 0, 'usergroup/admin_frameset.php'),
108 'rep' => array('Reports' , 0, 'reports/index.php'),
109 'ono' => array('Ofc Notes' , 0, 'main/onotes/office_comments.php'),
110 'fax' => array('Fax/Scan' , 0, 'fax/faxq.php'),
111 'adb' => array('Addr Bk' , 0, 'usergroup/addrbook_list.php'),
112 'imp' => array('Import' , 0, '../custom/import.php'),
113 'bil' => array('Billing' , 0, 'billing/billing_report.php'),
114 'sup' => array('Superbill' , 0, 'patient_file/encounter/superbill_custom_full.php'),
115 'aun' => array('Auth/notes', 0, 'main/authorizations/authorizations.php'),
116 'new' => array('New Pt' , 0, 'new/new.php'),
117 'dem' => array('Patient' , 1, "patient_file/summary/$demovarbase"),
118 'his' => array('History' , 1, 'patient_file/history/history.php'),
119 'ens' => array('Encounters', 1, 'patient_file/history/encounters.php'),
120 'nen' => array('New Enctr' , 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
121 'pre' => array('Rx' , 1, 'patient_file/summary/rx_frameset.php'),
122 'iss' => array('Issues' , 1, 'patient_file/summary/stats_full.php?active=all'),
123 'imm' => array('Immunize' , 1, 'patient_file/summary/immunizations.php'),
124 'doc' => array('Documents' , 1, '../controller.php?document&list&patient_id={PID}'),
125 'prp' => array('Pt Report' , 1, 'patient_file/report/patient_report.php'),
126 'pno' => array('Pt Notes' , 1, 'patient_file/summary/pnotes.php'),
127 'tra' => array('Transact' , 1, 'patient_file/transaction/transactions.php'),
128 'sum' => array('Summary' , 1, 'patient_file/summary/summary_bottom.php'),
129 'enc' => array('Encounter' , 2, 'patient_file/encounter/encounter_top.php'),
130 'cod' => array('Charges' , 2, 'patient_file/encounter/encounter_bottom.php'),
133 // This section decides which navigation items will not appear.
135 $disallowed = array();
137 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
138 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
139 acl_check('admin', 'practice') || acl_check('admin', 'users'));
141 $disallowed['bil'] = !(acl_check('acct', 'rep') || acl_check('acct', 'eob') ||
142 acl_check('acct', 'bill'));
144 $tmp = acl_check('patients', 'demo');
145 $disallowed['new'] = !($tmp == 'write' || $tmp == 'addonly');
147 if ( isset ($GLOBALS['hylafax_server']) && isset ($GLOBALS['scanner_output_directory']) ) {
148 $disallowed['fax'] = !($GLOBALS['hylafax_server'] || $GLOBALS['scanner_output_directory']);
151 $disallowed['ros'] = !$GLOBALS['athletic_team'];
153 $disallowed['iss'] = !((acl_check('encounters', 'notes') == 'write' ||
154 acl_check('encounters', 'notes_a') == 'write') &&
155 acl_check('patients', 'med') == 'write');
157 $disallowed['imp'] = $disallowed['new'] ||
158 !is_readable("$webserver_root/custom/import.php");
160 // Helper functions for treeview generation.
161 function genTreeLink($frame, $name, $title) {
162 global $primary_docs, $disallowed;
163 if (empty($disallowed[$name])) {
164 $id = $name . $primary_docs[$name][1];
165 echo "<li><a href='' id='$id' " .
166 "onclick=\"return loadFrame2('$id','$frame','" .
167 $primary_docs[$name][2] . "')\">" . xl($title) . "</a></li>";
170 function genMiscLink($frame, $name, $level, $title, $url) {
171 global $primary_docs, $disallowed;
172 if (empty($disallowed[$name])) {
173 $id = $name . $level;
174 echo "<li><a href='' id='$id' " .
175 "onclick=\"return loadFrame2('$id','$frame','" .
176 $url . "')\">" . xl($title) . "</a></li>";
179 function genPopLink($title, $url) {
180 echo "<li><a href='' " .
181 "onclick=\"return repPopup('$url')\"" .
182 ">" . xl($title) . "</a></li>";
184 function genDualLink($topname, $botname, $title) {
185 global $primary_docs, $disallowed;
186 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
187 $topid = $topname . $primary_docs[$topname][1];
188 $botid = $botname . $primary_docs[$botname][1];
189 echo "<li><a href='' id='$topid' " .
190 "onclick=\"return loadFrameDual('$topid','$botid','" .
191 $primary_docs[$topname][2] . "','" .
192 $primary_docs[$botname][2] . "')\">" . xl($title) . "</a></li>";
196 <html>
197 <head>
198 <title>Navigation</title>
199 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
201 <style type="text/css">
202 body {
203 font-size:8pt;
204 font-weight:normal;
205 padding: 5px 3px 5px 3px;
207 .smalltext {
208 font-family:sans-serif;
209 font-size:8pt;
210 font-weight:normal;
212 a.navitem, a.navitem:visited {
213 color:#0000ff;
214 font-family:sans-serif;
215 font-size:8pt;
216 font-weight:bold;
218 .inputtext {
219 font-size:9pt;
220 font-weight:normal;
221 border-style:solid;
222 border-width:1px;
223 padding-left:2px;
224 padding-right:2px;
225 border-color: #000000;
226 background-color:transparent;
229 #navigation ul {
230 background-color:transparent;
232 </style>
234 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.3/jquery.treeview.css" />
235 <script src="../../library/js/jquery-1.2.2.min.js" type="text/javascript"></script>
236 <script src="../../library/js/jquery.treeview-1.3/jquery.treeview.min.js" type="text/javascript"></script>
238 <script type="text/javascript" src="../../library/dialog.js"></script>
240 <script language='JavaScript'>
242 // Master values for current pid and encounter.
243 var active_pid = 0;
244 var active_encounter = 0;
246 // Current selections in the top and bottom frames.
247 var topName = '';
248 var botName = '';
250 // Expand and/or collapse frames in response to checkbox clicks.
251 // fnum indicates which checkbox was clicked (1=left, 2=right).
252 function toggleFrame(fnum) {
253 var f = document.forms[0];
254 var fset = top.document.getElementById('fsright');
255 if (!f.cb_top.checked && !f.cb_bot.checked) {
256 if (fnum == 1) f.cb_bot.checked = true;
257 else f.cb_top.checked = true;
259 var rows = f.cb_top.checked ? '*' : '0';
260 rows += f.cb_bot.checked ? ',*' : ',0';
261 fset.rows = rows;
262 fset.rows = rows;
265 // Load the specified url into the specified frame (RTop or RBot).
266 // The URL provided must be relative to interface.
267 function loadFrame(fname, frame, url) {
268 top.restoreSession();
269 var i = url.indexOf('{PID}');
270 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
271 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
272 if (frame == 'RTop') topName = fname; else botName = fname;
275 // Load the specified url into a frame to be determined, with the specified
276 // frame as the default; the url must be relative to interface.
277 function loadFrame2(fname, frame, url) {
278 var usage = fname.substring(3);
279 if (active_pid == 0 && usage > '0') {
280 alert('<?php xl('You must first select or add a patient.','e') ?>');
281 return false;
283 if (active_encounter == 0 && usage > '1') {
284 alert('<?php xl('You must first select or create an encounter.','e') ?>');
285 return false;
287 var f = document.forms[0];
288 top.restoreSession();
289 var i = url.indexOf('{PID}');
290 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
291 var fi = f.sel_frame.selectedIndex;
292 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
293 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
294 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
295 if (frame == 'RTop') topName = fname; else botName = fname;
296 return false;
299 // Load the specified url into a frame to be determined, with the specified
300 // frame as the default; the url must be relative to interface.
301 function loadFrameDual(tname, bname, topurl, boturl) {
302 var topusage = tname.substring(3);
303 var botusage = bname.substring(3);
304 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
305 alert('<?php xl('You must first select or add a patient.','e') ?>');
306 return false;
308 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
309 alert('<?php xl('You must first select or create an encounter.','e') ?>');
310 return false;
312 var f = document.forms[0];
313 top.restoreSession();
314 var i = topurl.indexOf('{PID}');
315 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
316 i = boturl.indexOf('{PID}');
317 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
318 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
319 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
320 topName = tname;
321 botName = bname;
322 return false;
325 // Select a designated radio button. raname may be either the radio button
326 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
327 // You should call this if you directly load a document that does not
328 // correspond to the current radio button setting.
329 function setRadio(raname, rbid) {
330 <?php if ($GLOBALS['concurrent_layout'] != 2) { ?>
331 var f = document.forms[0];
332 if (raname == 'RTop') raname = 'rb_top';
333 if (raname == 'RBot') raname = 'rb_bot';
334 for (var i = 0; i < f[raname].length; ++i) {
335 if (f[raname][i].value.substring(0,3) == rbid) {
336 f[raname][i].checked = true;
337 return true;
340 <?php } ?>
341 return false;
344 // Set disabled/enabled state of radio buttons and associated labels
345 // depending on whether there is an active patient or encounter.
346 function syncRadios() {
347 var f = document.forms[0];
348 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
349 var nlinks = document.links.length;
350 for (var i = 0; i < nlinks; ++i) {
351 var lnk = document.links[i];
352 if (lnk.id.length != 4) continue;
353 var usage = lnk.id.substring(3);
354 if (usage == '1' || usage == '2') {
355 var da = false;
356 if (active_pid == 0) da = true;
357 if (active_encounter == 0 && usage > '1') da = true;
358 lnk.style.color = da ? '#888888' : '#0000ff';
361 <?php } else { ?>
362 for (var i = 0; i < f.rb_top.length; ++i) {
363 var da = false;
364 var rb1 = f.rb_top[i];
365 var rb2 = f.rb_bot[i];
366 var rbid = rb1.value.substring(0,3);
367 var usage = rb1.value.substring(3);
368 if (active_pid == 0 && usage > '0') da = true;
369 if (active_encounter == 0 && usage > '1') da = true;
370 // daemon_frame can also set special label colors, so don't mess with
371 // them unless we have to.
372 if (rb1.disabled != da) {
373 rb1.disabled = da;
374 rb2.disabled = da;
375 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
378 <?php } ?>
379 f.popups.disabled = (active_pid == 0);
382 // Process the click to find a patient by name, id, ssn or dob.
383 function findPatient(findby) {
384 var f = document.forms[0];
385 if (! f.cb_top.checked) {
386 f.cb_top.checked = true;
387 toggleFrame(1);
389 f.findBy.value = findby;
390 setRadio('rb_top', 'dem');
391 top.restoreSession();
392 document.find_patient.submit();
395 // Helper function to set the contents of a div.
396 function setDivContent(id, content) {
397 if (document.getElementById) {
398 var x = document.getElementById(id);
399 x.innerHTML = '';
400 x.innerHTML = content;
402 else if (document.all) {
403 var x = document.all[id];
404 x.innerHTML = content;
408 // This is called automatically when a new patient is set, to make sure
409 // there are no patient-specific documents showing stale data. If a frame
410 // was just loaded with data for the correct patient, its name is passed so
411 // that it will not be zapped. At this point the new server-side pid is not
412 // assumed to be set, so this function will only load global data.
413 function reloadPatient(frname) {
414 var f = document.forms[0];
415 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
416 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
417 setRadio('rb_top', 'cal');
419 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
420 loadFrame('aun0','RBot', '<?php echo $primary_docs['aun'][2]; ?>');
421 setRadio('rb_bot', 'aun');
425 // Reload encounter-specific frames, excluding a specified frame. At this
426 // point the new server-side encounter ID may not be set and loading the same
427 // document for the new encounter will not work, so load patient info instead.
428 function reloadEncounter(frname) {
429 var f = document.forms[0];
430 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
431 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
432 setRadio('rb_top', 'dem');
434 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
435 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
436 setRadio('rb_bot', 'ens');
440 // Call this to announce that the patient has changed. You must call this
441 // if you change the session PID, so that the navigation frame will show the
442 // correct patient and so that the other frame will be reloaded if it contains
443 // patient-specific information from the previous patient. frname is the name
444 // of the frame that the call came from, so we know to only reload content
445 // from the *other* frame if it is patient-specific.
446 function setPatient(pname, pid, pubpid, frname) {
447 var str = '<b>' + pname + ' (' + pubpid + ')</b>';
448 setDivContent('current_patient', str);
449 if (pid == active_pid) return;
450 setDivContent('current_encounter', '<b>None</b>');
451 active_pid = pid;
452 active_encounter = 0;
453 if (frname) reloadPatient(frname);
454 syncRadios();
457 // Call this to announce that the encounter has changed. You must call this
458 // if you change the session encounter, so that the navigation frame will
459 // show the correct encounter and so that the other frame will be reloaded if
460 // it contains encounter-specific information from the previous encounter.
461 // frname is the name of the frame that the call came from, so we know to only
462 // reload encounter-specific content from the *other* frame.
463 function setEncounter(edate, eid, frname) {
464 if (eid == active_encounter) return;
465 if (!eid) edate = 'None';
466 var str = '<b>' + edate + '</b>';
467 setDivContent('current_encounter', str);
468 active_encounter = eid;
469 reloadEncounter(frname);
470 syncRadios();
473 // You must call this if you delete the active patient (or if for any other
474 // reason you "close" the active patient without opening a new one), so that
475 // the appearance of the navigation frame will be correct and so that any
476 // stale content will be reloaded.
477 function clearPatient() {
478 if (active_pid == 0) return;
479 var f = document.forms[0];
480 active_pid = 0;
481 active_encounter = 0;
482 setDivContent('current_encounter', '<b>None</b>');
483 setDivContent('current_patient', '<b>None</b>');
484 reloadPatient('');
485 syncRadios();
488 // You must call this if you delete the active encounter (or if for any other
489 // reason you "close" the active encounter without opening a new one), so that
490 // the appearance of the navigation frame will be correct and so that any
491 // stale content will be reloaded.
492 function clearEncounter() {
493 if (active_encounter == 0) return;
494 setDivContent('current_encounter', '<b>None</b>');
495 active_encounter = 0;
496 reloadEncounter('');
497 syncRadios();
500 // You can call this to make sure the session pid is what we expect.
501 function pidSanityCheck(pid) {
502 if (pid != active_pid) {
503 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
504 '. This session is unstable and should be abandoned. Do not use ' +
505 'OpenEMR in multiple browser windows!');
506 return false;
508 return true;
511 // You can call this to make sure the session encounter is what we expect.
512 function encounterSanityCheck(eid) {
513 if (eid != active_encounter) {
514 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
515 '. This session is unstable and should be abandoned. Do not use ' +
516 'OpenEMR in multiple browser windows!');
517 return false;
519 return true;
522 // Pop up a report.
523 function repPopup(aurl) {
524 top.restoreSession();
525 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
526 return false;
529 // This is invoked to pop up some window when a popup item is selected.
530 function selpopup(selobj) {
531 var i = selobj.selectedIndex;
532 var opt = selobj.options[i];
533 if (i > 0) {
534 var width = 750;
535 var height = 550;
536 if (opt.text == 'Export' || opt.text == 'Import') {
537 width = 500;
538 height = 400;
540 else if (opt.text == 'Refer') {
541 width = 700;
542 height = 500;
544 dlgopen(opt.value, '_blank', width, height);
546 selobj.selectedIndex = 0;
549 // Treeview activation stuff:
550 $(document).ready(function(){
551 $("#navigation").treeview({
552 animated: "fast",
553 collapsed: true,
554 unique: <?php echo $GLOBALS['athletic_team'] ? 'false' : 'true' ?>,
555 toggle: function() {
556 window.console && console.log("%o was toggled", this);
561 </script>
563 </head>
565 <body class="body_nav">
567 <form method='post' name='find_patient' target='RTop'
568 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
570 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
572 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:100%;'>
573 <option value='0'><?php xl('Default','e'); ?></option>
574 <option value='1'><?php xl('Top','e'); ?></option>
575 <option value='2'><?php xl('Bottom','e'); ?></option>
576 </select>
578 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
579 <tr>
580 <td class='smalltext' nowrap>
581 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked />
582 <b><?php xl('Top','e') ?></b>
583 </td>
584 <td class='smalltext' align='right' nowrap>
585 <b><?php xl('Bot','e') ?></b>
586 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php if (empty($GLOBALS['athletic_team'])) echo 'checked '; ?>/>
587 </td>
588 </tr>
589 </table>
591 <?php if ($GLOBALS['athletic_team']) { // Tree menu for athletic teams ?>
593 <ul id="navigation">
594 <li class="open"><span><?php xl('Patient/Client','e') ?></span>
595 <ul>
596 <li class="open"><span><?php xl('Demographics','e') ?></span>
597 <ul>
598 <?php genTreeLink('RTop','new','New'); ?>
599 <?php genTreeLink('RTop','dem','Current'); ?>
600 <?php genTreeLink('RBot','sum','Summary'); // james did not ask for this one ?>
601 </ul>
602 </li>
603 <li class="open"><span><?php xl('Medical Records','e') ?></span>
604 <ul>
605 <?php genDualLink('nen','ens','New Consultation'); // with ens on bottom ?>
606 <?php genDualLink('enc','ens','Current Consultation'); // with ens on bottom ?>
607 <?php genTreeLink('RBot','ens','Previous Consultations'); // james did not ask for this one ?>
608 <?php genDualLink('his','ens','Previous History/Screening'); // with ens on bottom ?>
609 <?php genTreeLink('RBot','nen','New Allergy'); // nen with Allergy in chief complaint ?>
610 <?php genTreeLink('RTop','iss','Edit Allergies'); // somehow emphasizing allergies...? ?>
611 <?php genTreeLink('RTop','his','View Allergies'); // his page with Allergies section open ?>
612 <?php genDualLink('iss','ens','Problems/Issues'); // with ens on bottom ?>
613 <?php genDualLink('tra','ens','Transactions/Referrals'); // new transaction form on top and tra list on bottom (or ens if no tra) ?>
614 <?php genDualLink('his','imm','Immunizations'); // imm on bottom, his on top ?>
615 <?php genDualLink('his','pre','Prescriptions'); // pre on bottom, his on top ?>
616 <?php genTreeLink('RTop','doc','Document/Imaging Store'); ?>
617 <?php genTreeLink('RTop','prp','Patient Printed Report'); ?>
618 <?php genDualLink('dem','pno','Additional Notes'); // with dem on top ?>
619 <li><a href='' onclick="return repPopup('../patient_file/letter.php')" id='prp1'>Letter</a></li>
620 </ul>
621 </li>
622 <li><span><?php xl('View','e') ?></span>
623 <ul>
624 <?php genTreeLink('RTop','cal','Calendar View'); ?>
625 <?php genTreeLink('RTop','ros','Team Roster View'); // default; and minimize lower frame ?>
626 <?php genTreeLink('RTop','dem','Current Patient'); // this also appears under Demographics ?>
627 </ul>
628 </li>
629 </ul>
630 </li>
631 <li class="open"><span><?php xl('Reports','e') ?></span>
632 <ul>
633 <li class="open"><span><?php xl('Athletic/Injury','e') ?></span>
634 <ul>
635 <?php genTreeLink('RTop','prp','Patient Printed Report'); // also appears above ?>
636 <?php genPopLink('Games/Events Missed','absences_report.php'); ?>
637 <?php genPopLink('Injury Surveillance','football_injury_report.php'); ?>
638 <?php genPopLink('Team Injury Overview','injury_overview_report.php'); ?>
639 <?php genPopLink('Roster','players_report.php'); ?>
640 </ul>
641 </li>
642 <li><span><?php xl('Patient/Client','e') ?></span>
643 <ul>
644 <?php genPopLink('List','patient_list.php'); ?>
645 <?php genPopLink('Prescriptions','prescriptions_report.php'); ?>
646 <?php genPopLink('Referrals','referrals_report.php'); ?>
647 </ul>
648 </li>
649 <li><span><?php xl('Visits','e') ?></span>
650 <ul>
651 <?php genPopLink('Appointments','appointments_report.php'); ?>
652 <?php genPopLink('Encounters','encounters_report.php'); ?>
653 <?php genPopLink('Appt-Enc','appt_encounter_report.php'); ?>
654 </ul>
655 </li>
656 <li><span><?php xl('General','e') ?></span>
657 <ul>
658 <?php genPopLink('Services','services_by_category.php'); ?>
659 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink('Inventory','inventory_list.php'); ?>
660 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink('Destroyed','destroyed_drugs_report.php'); ?>
661 </ul>
662 </li>
663 </ul>
664 </li>
665 <li><span><?php xl('Fees','e') ?></span>
666 <ul>
667 <?php genMiscLink('RBot','cod','2','Fee Sheet','patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
668 <?php genMiscLink('RBot','bil','1','Checkout','patient_file/pos_checkout.php?framed=1'); ?>
669 </ul>
670 </li>
671 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0','Inventory','drugs/drug_inventory.php'); ?>
672 <li><span><?php xl('Administration','e') ?></span>
673 <ul>
674 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0','Users','usergroup/usergroup_admin.php'); ?>
675 <?php genTreeLink('RTop','pwd','Users Password Change'); ?>
676 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0','Practice','../controller.php?practice_settings'); ?>
677 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup','Services'); ?>
678 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0','Layouts','super/edit_layout.php'); ?>
679 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0','Lists','super/edit_list.php'); ?>
680 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0','ACL','usergroup/adminacl.php'); ?>
681 <li><span><?php xl('Other','e') ?></span>
682 <ul>
683 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0','Forms','forms_admin/forms_admin.php'); ?>
684 <?php if (acl_check('admin', 'calendar')) genMiscLink('RTop','adm','0','Calendar','main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig'); ?>
685 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0','Logs','logview/logview.php'); ?>
686 <?php if (acl_check('admin', 'database')) genMiscLink('RTop','adm','0','Database','main/myadmin/index.php'); ?>
687 </ul>
688 </li>
689 </ul>
690 </li>
691 <li><span><?php xl('Miscellaneous','e') ?></span>
692 <ul>
693 <?php genTreeLink('RBot','aun','Pt Notes/Auth'); ?>
694 <?php genTreeLink('RTop','fax','Fax/Scan'); ?>
695 <?php genTreeLink('RTop','adb','Addr Book'); ?>
696 <?php genTreeLink('RTop','ono','Ofc Notes'); ?>
697 <?php genMiscLink('RTop','adm','0','BatchCom','batchcom/batchcom.php'); ?>
698 </ul>
699 </li>
700 </ul>
702 <?php } else { // not athletic team ?>
704 <ul id="navigation">
705 <li class="open"><span><?php xl('Patient/Client','e') ?></span>
706 <ul>
707 <li><span><?php xl('Management','e') ?></span>
708 <ul>
709 <?php genTreeLink('RTop','new','New'); ?>
710 <?php genTreeLink('RTop','dem','Current'); ?>
711 <?php genTreeLink('RBot','sum','Summary'); ?>
712 </ul>
713 </li>
714 <li class="open"><span><?php xl('Visits','e') ?></span>
715 <ul>
716 <?php genTreeLink('RTop','cal','Calendar'); ?>
717 <?php if ($GLOBALS['athletic_team']) genTreeLink('RTop','ros','Roster'); ?>
718 <?php genTreeLink('RBot','nen','New Visit'); ?>
719 <?php genTreeLink('RBot','enc','Current'); ?>
720 <?php genTreeLink('RBot','ens','List'); ?>
721 <?php genTreeLink('RBot','tra','Transact'); ?>
722 </ul>
723 </li>
724 <li><span><?php xl('Medical Record','e') ?></span>
725 <ul>
726 <?php genTreeLink('RBot','pre','Rx'); ?>
727 <?php genTreeLink('RTop','his','History'); ?>
728 <?php genTreeLink('RTop','iss','Issues'); ?>
729 <?php genTreeLink('RBot','imm','Immunize'); ?>
730 <?php genTreeLink('RTop','doc','Documents'); ?>
731 <?php genTreeLink('RBot','pno','Notes'); ?>
732 <?php genTreeLink('RTop','prp','Report'); ?>
733 </ul>
734 </li>
735 </ul>
736 </li>
737 <li><span><?php xl('Fees','e') ?></span>
738 <ul>
739 <?php genMiscLink('RBot','cod','2','Fee Sheet','patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
740 <?php if (false) genTreeLink('RBot','cod','Charges'); ?>
741 <?php genMiscLink('RBot','bil','1','Checkout','patient_file/pos_checkout.php?framed=1'); ?>
742 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil','Billing'); ?>
743 </ul>
744 </li>
745 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0','Inventory','drugs/drug_inventory.php'); ?>
746 <li><span><?php xl('Administration','e') ?></span>
747 <ul>
748 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0','Users','usergroup/usergroup_admin.php'); ?>
749 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0','Practice','../controller.php?practice_settings'); ?>
750 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup','Services'); ?>
751 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0','Layouts','super/edit_layout.php'); ?>
752 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0','Lists','super/edit_list.php'); ?>
753 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0','ACL','usergroup/adminacl.php'); ?>
754 <li><span><?php xl('Other','e') ?></span>
755 <ul>
756 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0','Language','language/language.php'); ?>
757 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0','Forms','forms_admin/forms_admin.php'); ?>
758 <?php if (acl_check('admin', 'calendar')) genMiscLink('RTop','adm','0','Calendar','main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig'); ?>
759 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0','Logs','logview/logview.php'); ?>
760 <?php if (acl_check('admin', 'database')) genMiscLink('RTop','adm','0','Database','main/myadmin/index.php'); ?>
761 </ul>
762 </li>
763 </ul>
764 </li>
765 <li><span><?php xl('Reports','e') ?></span>
766 <ul>
767 <li><span><?php xl('Clients','e') ?></span>
768 <ul>
769 <?php genPopLink('List','patient_list.php'); ?>
770 <?php genPopLink('Rx','prescriptions_report.php'); ?>
771 <?php genPopLink('Referrals','referrals_report.php'); ?>
772 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink('IPPF Stats','ippf_statistics.php?t=i'); ?>
773 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink('MA Stats','ippf_statistics.php?t=m'); ?>
774 </ul>
775 </li>
776 <li class="open"><span><?php xl('Visits','e') ?></span>
777 <ul>
778 <?php genPopLink('Appointments','appointments_report.php'); ?>
779 <?php genPopLink('Encounters','encounters_report.php'); ?>
780 <?php genPopLink('Appt-Enc','appt_encounter_report.php'); ?>
781 </ul>
782 </li>
783 <?php if (acl_check('acct', 'rep_a')) { ?>
784 <li><span><?php xl('Financial','e') ?></span>
785 <ul>
786 <?php genPopLink('Sales','sales_by_item.php'); ?>
787 <?php genPopLink('Cash Rec','../billing/sl_receipts_report.php'); ?>
788 <?php genPopLink('Front Rec','front_receipts_report.php'); ?>
789 <?php genPopLink('Pmt Method','receipts_by_method_report.php'); ?>
790 <?php genPopLink('Collections','collections_report.php'); ?>
791 </ul>
792 </li>
793 <?php } ?>
794 <li><span><?php xl('General','e') ?></span>
795 <ul>
796 <?php genPopLink('Services','services_by_category.php'); ?>
797 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink('Inventory','inventory_list.php'); ?>
798 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink('Destroyed','destroyed_drugs_report.php'); ?>
799 </ul>
800 </li>
801 <?php if (! $GLOBALS['simplified_demographics']) { ?>
802 <li><span><?php xl('Insurance','e') ?></span>
803 <ul>
804 <?php genPopLink('Distribution','insurance_allocation_report.php'); ?>
805 <?php genPopLink('Indigents','../billing/indigent_patients_report.php'); ?>
806 <?php genPopLink('Unique SP','unique_seen_patients_report.php'); ?>
807 </ul>
808 </li>
809 <?php } ?>
810 <?php // genTreeLink('RTop','rep','Other'); ?>
811 </ul>
812 </li>
813 <li><span><?php xl('Miscellaneous','e') ?></span>
814 <ul>
815 <?php genTreeLink('RBot','aun','Pt Notes/Auth'); ?>
816 <?php genTreeLink('RTop','fax','Fax/Scan'); ?>
817 <?php genTreeLink('RTop','adb','Addr Book'); ?>
818 <?php genTreeLink('RTop','ono','Ofc Notes'); ?>
819 <?php genMiscLink('RTop','adm','0','BatchCom','batchcom/batchcom.php'); ?>
820 <?php genTreeLink('RTop','pwd','Password'); ?>
821 </ul>
822 </li>
823 </ul>
825 <?php } // end not athletic team ?>
827 <?php } else { // end ($GLOBALS['concurrent_layout'] == 2) ?>
829 <table cellpadding='0' cellspacing='0' border='0'>
830 <tr>
831 <td colspan='3'>
832 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
833 <tr>
834 <td class='smalltext' nowrap>
835 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
836 </td>
837 <td class='smalltext' align='right' nowrap>
838 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
839 </td>
840 </tr>
841 </table>
842 </td>
843 </tr>
844 <?php
845 // Builds the table of radio buttons and their labels. Radio button values
846 // are comprised of the 3-character document id and the 1-digit usage type,
847 // so that JavaScript can easily access this information.
848 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
849 foreach ($primary_docs as $key => $varr) {
850 if (!empty($disallowed[$key])) continue;
851 $label = $varr[0];
852 $usage = $varr[1];
853 $url = $varr[2];
854 echo " <tr>\n";
855 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
856 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
857 if ($key == $default_top_rbid) echo " checked";
858 echo " /></td>\n";
859 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
860 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
861 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
862 if ($key == 'aun') echo " checked";
863 echo " /></td>\n";
864 echo " </tr>\n";
867 </table>
869 <?php } ?>
871 <br /><hr />
873 <?php xl('Active Patient','e') ?>:<br />
874 <div id='current_patient'>
875 <b>None</b>
876 </div>
878 <?php xl('Active Encounter','e') ?>:<br />
879 <div id='current_encounter'>
880 <b>None</b>
881 </div>
883 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;'>
884 <option value=''><?php xl('Popups','e'); ?></option>
885 <?php if (!$disallowed['iss']) { ?>
886 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
887 <?php } ?>
888 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
889 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
890 <?php if ($GLOBALS['athletic_team']) { ?>
891 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
892 <?php } ?>
893 <option value='../reports/appointments_report.php?patient=<?php echo $pid ?>'><?php xl('Appts','e'); ?></option>
894 <?php if (file_exists("$webserver_root/custom/refer.php")) { ?>
895 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
896 <?php } ?>
897 <?php // if (file_exists("$webserver_root/custom/fee_sheet_codes.php")) { ?>
898 <option value='../patient_file/printed_fee_sheet.php'><?php xl('Superbill','e'); ?></option>
899 <?php // } ?>
900 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
901 <option value='../patient_file/front_payment.php'><?php xl('Prepay','e'); ?></option>
902 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
903 <?php } else { ?>
904 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
905 <?php } ?>
906 <?php if (is_dir("$webserver_root/custom/letter_templates")) { ?>
907 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
908 <?php } ?>
909 </select>
911 <hr />
913 <table cellpadding='0' cellspacing='0' border='0'>
914 <tr>
915 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
916 <td class='smalltext' colspan='2'>
917 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
918 </td>
919 </tr>
920 <tr>
921 <td class='smalltext'><?php xl('by','e') ?>:</td>
922 <td class='smalltext'>
923 <a href="javascript:findPatient('Last');" class="navitem">Name</a>
924 </td>
925 <td class='smalltext' align='right'>
926 <a href="javascript:findPatient('ID');" class="navitem">ID</a>
927 </td>
928 </tr>
929 <tr>
930 <td class='smalltext'>&nbsp;</td>
931 <td class='smalltext'>
932 <a href="javascript:findPatient('SSN');" class="navitem">SSN</a>
933 </td>
934 <td class='smalltext' align='right'>
935 <a href="javascript:findPatient('DOB');" class="navitem">DOB</a>
936 </td>
937 </tr>
938 </table>
940 <hr />
941 <a href="../logout.php?auth=logout" target="_top" class="navitem" id="logout_link"
942 onclick="top.restoreSession()">
943 <?php xl('Logout','e'); ?></a>
945 <input type='hidden' name='findBy' value='Last' />
947 </form>
949 <script language='JavaScript'>
950 syncRadios();
951 </script>
953 </body>
954 </html>