fixed undo of checkouts
[openemr.git] / interface / main / left_nav.php
blob4825a566632cabf4b29a010279431313265f1a48
1 <?php
2 // Copyright (C) 2006-2009 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($GLOBALS['fileroot']."/library/acl.inc");
89 include_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
90 include_once($GLOBALS['fileroot']."/library/patient.inc");
92 // This array defines the list of primary documents that may be
93 // chosen. Each element value is an array of 3 values:
95 // * Name to appear in the navigation table
96 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific
97 // * The URL relative to the interface directory
100 // larry :: dbc insert
101 $demovarbase = ( $GLOBALS['dutchpc'] ) ? 'demographics_dutch.php' : 'demographics.php';
102 // larry :: end of dbc insert
104 $primary_docs = array(
105 'ros' => array(xl('Roster') , 0, 'reports/players_report.php?embed=1'),
106 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
107 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
108 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
109 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
110 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
111 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
112 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
113 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
114 'imp' => array(xl('Import') , 0, '../custom/import.php'),
115 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
116 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
117 'aun' => array(xl('Auth/notes'), 0, 'main/authorizations/authorizations.php'),
118 'new' => array(xl('New Pt') , 0, 'new/new.php'),
119 'dem' => array(xl('Patient') , 1, "patient_file/summary/$demovarbase"),
120 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
121 'ens' => array(xl('Encounters'), 1, 'patient_file/history/encounters.php'),
122 'nen' => array(xl('New Enctr') , 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
123 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
124 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
125 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
126 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
127 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
128 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
129 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
130 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
131 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
133 if ($GLOBALS['use_charges_panel'] || $GLOBALS['concurrent_layout'] == 2) {
134 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
137 // This section decides which navigation items will not appear.
139 $disallowed = array();
141 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
142 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
143 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
144 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
145 acl_check('admin', 'superbill'));
147 $disallowed['bil'] = !(acl_check('acct', 'rep') || acl_check('acct', 'eob') ||
148 acl_check('acct', 'bill'));
150 $tmp = acl_check('patients', 'demo');
151 $disallowed['new'] = !($tmp == 'write' || $tmp == 'addonly');
153 if ( isset ($GLOBALS['hylafax_server']) && isset ($GLOBALS['scanner_output_directory']) ) {
154 $disallowed['fax'] = !($GLOBALS['hylafax_server'] || $GLOBALS['scanner_output_directory']);
157 $disallowed['ros'] = !$GLOBALS['athletic_team'];
159 $disallowed['iss'] = !((acl_check('encounters', 'notes') == 'write' ||
160 acl_check('encounters', 'notes_a') == 'write') &&
161 acl_check('patients', 'med') == 'write');
163 $disallowed['imp'] = $disallowed['new'] ||
164 !is_readable("$webserver_root/custom/import.php");
166 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
168 $disallowed['pre'] = !(acl_check('patients', 'med'));
170 // Helper functions for treeview generation.
171 function genTreeLink($frame, $name, $title) {
172 global $primary_docs, $disallowed;
173 if (empty($disallowed[$name])) {
174 $id = $name . $primary_docs[$name][1];
175 echo "<li><a href='' id='$id' " .
176 "onclick=\"return loadFrame2('$id','$frame','" .
177 $primary_docs[$name][2] . "')\">" . $title . "</a></li>";
180 function genMiscLink($frame, $name, $level, $title, $url) {
181 global $primary_docs, $disallowed;
182 if (empty($disallowed[$name])) {
183 $id = $name . $level;
184 echo "<li><a href='' id='$id' " .
185 "onclick=\"return loadFrame2('$id','$frame','" .
186 $url . "')\">" . $title . "</a></li>";
189 function genPopLink($title, $url) {
190 echo "<li><a href='' " .
191 "onclick=\"return repPopup('$url')\"" .
192 ">" . $title . "</a></li>";
194 function genDualLink($topname, $botname, $title) {
195 global $primary_docs, $disallowed;
196 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
197 $topid = $topname . $primary_docs[$topname][1];
198 $botid = $botname . $primary_docs[$botname][1];
199 echo "<li><a href='' id='$topid' " .
200 "onclick=\"return loadFrameDual('$topid','$botid','" .
201 $primary_docs[$topname][2] . "','" .
202 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
206 function genPopupsList($style='') {
207 global $disallowed, $webserver_root;
209 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
210 <option value=''><?php xl('Popups','e'); ?></option>
211 <?php if (!$disallowed['iss']) { ?>
212 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
213 <?php } ?>
214 <?php if (!$GLOBALS['ippf_specific']) { ?>
215 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
216 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
217 <?php } ?>
218 <?php if ($GLOBALS['athletic_team']) { ?>
219 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
220 <?php } ;
221 if (!$GLOBALS['disable_calendar']) { ?>
222 <option value='../reports/appointments_report.php?patient=<?php echo $pid ?>'><?php xl('Appts','e'); ?></option>
223 <?php } ;
224 if (file_exists("$webserver_root/custom/refer.php")) { ?>
225 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
226 <?php } ?>
227 <?php // if (file_exists("$webserver_root/custom/fee_sheet_codes.php")) { ?>
228 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill','e'); ?></option>
229 <?php // } ?>
230 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
231 <option value='../patient_file/front_payment.php'><?php xl('Prepay','e'); ?></option>
232 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
233 <?php } else { ?>
234 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
235 <?php } ?>
236 <?php if (is_dir("$webserver_root/custom/letter_templates")) { ?>
237 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
238 <?php } ?>
239 </select>
240 <?php
244 <html>
245 <head>
246 <title>Navigation</title>
247 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
249 <style type="text/css">
250 body {
251 font-size:8pt;
252 font-weight:normal;
253 padding: 5px 3px 5px 3px;
255 .smalltext {
256 font-family:sans-serif;
257 font-size:8pt;
258 font-weight:normal;
260 a.navitem, a.navitem:visited {
261 color:#0000ff;
262 font-family:sans-serif;
263 font-size:8pt;
264 font-weight:bold;
266 .inputtext {
267 font-size:9pt;
268 font-weight:normal;
269 border-style:solid;
270 border-width:1px;
271 padding-left:2px;
272 padding-right:2px;
273 border-color: #000000;
274 background-color:transparent;
277 #navigation ul {
278 background-color:transparent;
280 </style>
282 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.3/jquery.treeview.css" />
283 <script src="../../library/js/jquery-1.2.2.min.js" type="text/javascript"></script>
284 <script src="../../library/js/jquery.treeview-1.3/jquery.treeview.min.js" type="text/javascript"></script>
286 <script type="text/javascript" src="../../library/dialog.js"></script>
288 <script language='JavaScript'>
290 // Master values for current pid and encounter.
291 var active_pid = 0;
292 var active_encounter = 0;
294 // Current selections in the top and bottom frames.
295 var topName = '';
296 var botName = '';
298 // Expand and/or collapse frames in response to checkbox clicks.
299 // fnum indicates which checkbox was clicked (1=left, 2=right).
300 function toggleFrame(fnum) {
301 var f = document.forms[0];
302 var fset = top.document.getElementById('fsright');
303 if (!f.cb_top.checked && !f.cb_bot.checked) {
304 if (fnum == 1) f.cb_bot.checked = true;
305 else f.cb_top.checked = true;
307 var rows = f.cb_top.checked ? '*' : '0';
308 rows += f.cb_bot.checked ? ',*' : ',0';
309 fset.rows = rows;
310 fset.rows = rows;
313 // Load the specified url into the specified frame (RTop or RBot).
314 // The URL provided must be relative to interface.
315 function loadFrame(fname, frame, url) {
316 top.restoreSession();
317 var i = url.indexOf('{PID}');
318 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
319 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
320 if (frame == 'RTop') topName = fname; else botName = fname;
323 // Load the specified url into a frame to be determined, with the specified
324 // frame as the default; the url must be relative to interface.
325 function loadFrame2(fname, frame, url) {
326 var usage = fname.substring(3);
327 if (active_pid == 0 && usage > '0') {
328 alert('<?php xl('You must first select or add a patient.','e') ?>');
329 return false;
331 if (active_encounter == 0 && usage > '1') {
332 alert('<?php xl('You must first select or create an encounter.','e') ?>');
333 return false;
335 var f = document.forms[0];
336 top.restoreSession();
337 var i = url.indexOf('{PID}');
338 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
339 var fi = f.sel_frame.selectedIndex;
340 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
341 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
342 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
343 if (frame == 'RTop') topName = fname; else botName = fname;
344 return false;
347 // Make sure both frames are open.
348 function forceDual() {
349 var f = document.forms[0];
350 if (!f.cb_top.checked) {
351 f.cb_top.checked = true;
352 toggleFrame(1);
354 if (!f.cb_bot.checked) {
355 f.cb_bot.checked = true;
356 toggleFrame(2);
360 // Load the specified url into a frame to be determined, with the specified
361 // frame as the default; the url must be relative to interface.
362 function loadFrameDual(tname, bname, topurl, boturl) {
363 var topusage = tname.substring(3);
364 var botusage = bname.substring(3);
365 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
366 alert('<?php xl('You must first select or add a patient.','e') ?>');
367 return false;
369 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
370 alert('<?php xl('You must first select or create an encounter.','e') ?>');
371 return false;
373 var f = document.forms[0];
374 forceDual();
375 top.restoreSession();
376 var i = topurl.indexOf('{PID}');
377 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
378 i = boturl.indexOf('{PID}');
379 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
380 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
381 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
382 topName = tname;
383 botName = bname;
384 return false;
387 // Select a designated radio button. raname may be either the radio button
388 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
389 // You should call this if you directly load a document that does not
390 // correspond to the current radio button setting.
391 function setRadio(raname, rbid) {
392 <?php if ($GLOBALS['concurrent_layout'] != 2) { ?>
393 var f = document.forms[0];
394 if (raname == 'RTop') raname = 'rb_top';
395 if (raname == 'RBot') raname = 'rb_bot';
396 for (var i = 0; i < f[raname].length; ++i) {
397 if (f[raname][i].value.substring(0,3) == rbid) {
398 f[raname][i].checked = true;
399 return true;
402 <?php } ?>
403 return false;
406 // Set disabled/enabled state of radio buttons and associated labels
407 // depending on whether there is an active patient or encounter.
408 function syncRadios() {
409 var f = document.forms[0];
410 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
411 var nlinks = document.links.length;
412 for (var i = 0; i < nlinks; ++i) {
413 var lnk = document.links[i];
414 if (lnk.id.length != 4) continue;
415 var usage = lnk.id.substring(3);
416 if (usage == '1' || usage == '2') {
417 var da = false;
418 if (active_pid == 0) da = true;
419 if (active_encounter == 0 && usage > '1') da = true;
420 lnk.style.color = da ? '#888888' : '#0000ff';
423 <?php } else { ?>
424 for (var i = 0; i < f.rb_top.length; ++i) {
425 var da = false;
426 var rb1 = f.rb_top[i];
427 var rb2 = f.rb_bot[i];
428 var rbid = rb1.value.substring(0,3);
429 var usage = rb1.value.substring(3);
430 if (active_pid == 0 && usage > '0') da = true;
431 if (active_encounter == 0 && usage > '1') da = true;
432 // daemon_frame can also set special label colors, so don't mess with
433 // them unless we have to.
434 if (rb1.disabled != da) {
435 rb1.disabled = da;
436 rb2.disabled = da;
437 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
440 <?php } ?>
441 f.popups.disabled = (active_pid == 0);
445 var my_window;
446 function initFilter() {
447 my_window = window.open("../../custom/search.php", "mywindow","status=1");
450 function processFilter( fieldString ) {
451 document.getElementById('searchFields').value=fieldString;
452 findPatient( "Filter" );
453 my_window.close();
457 // Process the click to find a patient by name, id, ssn or dob.
458 function findPatient(findby) {
459 var f = document.forms[0];
460 if (! f.cb_top.checked) {
461 f.cb_top.checked = true;
462 toggleFrame(1);
464 f.findBy.value = findby;
465 setRadio('rb_top', 'dem');
466 top.restoreSession();
467 document.find_patient.submit();
470 // Helper function to set the contents of a div.
471 function setSomeContent(id, content, doc) {
472 if (doc.getElementById) {
473 var x = doc.getElementById(id);
474 x.innerHTML = '';
475 x.innerHTML = content;
477 else if (doc.all) {
478 var x = doc.all[id];
479 x.innerHTML = content;
482 function setDivContent(id, content) {
483 setSomeContent(id, content, document);
485 function setTitleContent(id, content) {
486 setSomeContent(id, content, parent.Title.document);
489 // This is called automatically when a new patient is set, to make sure
490 // there are no patient-specific documents showing stale data. If a frame
491 // was just loaded with data for the correct patient, its name is passed so
492 // that it will not be zapped. At this point the new server-side pid is not
493 // assumed to be set, so this function will only load global data.
494 function reloadPatient(frname) {
495 var f = document.forms[0];
496 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
497 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
498 setRadio('rb_top', 'cal');
500 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
501 loadFrame('aun0','RBot', '<?php echo $primary_docs['aun'][2]; ?>');
502 setRadio('rb_bot', 'aun');
506 // Reload encounter-specific frames, excluding a specified frame. At this
507 // point the new server-side encounter ID may not be set and loading the same
508 // document for the new encounter will not work, so load patient info instead.
509 function reloadEncounter(frname) {
510 var f = document.forms[0];
511 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
512 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
513 setRadio('rb_top', 'dem');
515 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
516 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
517 setRadio('rb_bot', 'ens');
521 // Call this to announce that the patient has changed. You must call this
522 // if you change the session PID, so that the navigation frame will show the
523 // correct patient and so that the other frame will be reloaded if it contains
524 // patient-specific information from the previous patient. frname is the name
525 // of the frame that the call came from, so we know to only reload content
526 // from the *other* frame if it is patient-specific.
527 function setPatient(pname, pid, pubpid, frname, str_dob) {
528 var str = '<b>' + pname + ' (' + pubpid + ')</b>';
529 setDivContent('current_patient', str);
530 setTitleContent('current_patient', str + str_dob);
531 if (pid == active_pid) return;
532 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
533 active_pid = pid;
534 active_encounter = 0;
535 if (frname) reloadPatient(frname);
536 syncRadios();
539 // Call this to announce that the encounter has changed. You must call this
540 // if you change the session encounter, so that the navigation frame will
541 // show the correct encounter and so that the other frame will be reloaded if
542 // it contains encounter-specific information from the previous encounter.
543 // frname is the name of the frame that the call came from, so we know to only
544 // reload encounter-specific content from the *other* frame.
545 function setEncounter(edate, eid, frname) {
546 if (eid == active_encounter) return;
547 if (!eid) edate = '<?php xl('None','e'); ?>';
548 var str = '<b>' + edate + '</b>';
549 setDivContent('current_encounter', str);
550 active_encounter = eid;
551 reloadEncounter(frname);
552 syncRadios();
555 // You must call this if you delete the active patient (or if for any other
556 // reason you "close" the active patient without opening a new one), so that
557 // the appearance of the navigation frame will be correct and so that any
558 // stale content will be reloaded.
559 function clearPatient() {
560 if (active_pid == 0) return;
561 var f = document.forms[0];
562 active_pid = 0;
563 active_encounter = 0;
564 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
565 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
566 setTitleContent('current_patient', '<b><?php xl('None','e'); ?></b>');
567 reloadPatient('');
568 syncRadios();
571 // You must call this if you delete the active encounter (or if for any other
572 // reason you "close" the active encounter without opening a new one), so that
573 // the appearance of the navigation frame will be correct and so that any
574 // stale content will be reloaded.
575 function clearEncounter() {
576 if (active_encounter == 0) return;
577 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
578 active_encounter = 0;
579 reloadEncounter('');
580 syncRadios();
583 // You can call this to make sure the session pid is what we expect.
584 function pidSanityCheck(pid) {
585 if (pid != active_pid) {
586 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
587 '. This session is unstable and should be abandoned. Do not use ' +
588 'OpenEMR in multiple browser windows!');
589 return false;
591 return true;
594 // You can call this to make sure the session encounter is what we expect.
595 function encounterSanityCheck(eid) {
596 if (eid != active_encounter) {
597 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
598 '. This session is unstable and should be abandoned. Do not use ' +
599 'OpenEMR in multiple browser windows!');
600 return false;
602 return true;
605 // Pop up a report.
606 function repPopup(aurl) {
607 top.restoreSession();
608 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
609 return false;
612 // This is invoked to pop up some window when a popup item is selected.
613 function selpopup(selobj) {
614 var i = selobj.selectedIndex;
615 var opt = selobj.options[i];
616 if (i > 0) {
617 var width = 750;
618 var height = 550;
619 if (opt.text == 'Export' || opt.text == 'Import') {
620 width = 500;
621 height = 400;
623 else if (opt.text == 'Refer') {
624 width = 700;
625 height = 500;
627 dlgopen(opt.value, '_blank', width, height);
629 selobj.selectedIndex = 0;
632 // Treeview activation stuff:
633 $(document).ready(function(){
634 $("#navigation").treeview({
635 animated: "fast",
636 collapsed: true,
637 unique: <?php echo $GLOBALS['athletic_team'] ? 'false' : 'true' ?>,
638 toggle: function() {
639 window.console && console.log("%o was toggled", this);
644 </script>
646 </head>
648 <body class="body_nav">
650 <form method='post' name='find_patient' target='RTop'
651 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
653 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
655 <center>
656 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:<?php echo $GLOBALS['athletic_team'] ? 47 : 100; ?>%;'>
657 <option value='0'><?php xl('Default','e'); ?></option>
658 <option value='1'><?php xl('Top','e'); ?></option>
659 <option value='2'><?php xl('Bottom','e'); ?></option>
660 </select>
661 <?php if ($GLOBALS['athletic_team']) genPopupsList('width:47%'); ?>
662 </center>
664 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
665 <tr>
666 <td class='smalltext' nowrap>
667 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked />
668 <b><?php xl('Top','e') ?></b>
669 </td>
670 <td class='smalltext' align='right' nowrap>
671 <b><?php xl('Bot','e') ?></b>
672 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php if (empty($GLOBALS['athletic_team'])) echo 'checked '; ?>/>
673 </td>
674 </tr>
675 </table>
677 <?php if ($GLOBALS['athletic_team']) { // Tree menu for athletic teams ?>
679 <ul id="navigation">
680 <li class="open"><span><?php xl('Patient/Client','e') ?></span>
681 <ul>
682 <li class="open"><span><?php xl('Demographics','e') ?></span>
683 <ul>
684 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
685 <?php genTreeLink('RTop','dem',xl('Current')); ?>
686 <?php genDualLink('dem','sum',xl('Summary')); // with dem on top ?>
687 </ul>
688 </li>
689 <li class="open"><span><?php xl('Medical Records','e') ?></span>
690 <ul>
691 <?php genPopLink (xl('Team Roster'),'players_report.php'); ?>
692 <?php genDualLink('nen','ens',xl('New Consultation')); // with ens on bottom ?>
694 <?php // genDualLink('enc','ens','Current Consultation'); // with ens on bottom ?>
695 <?php genTreeLink('RTop','enc',xl('Current Consultation')); // encounter_top will itself load ens on bottom ?>
697 <?php genDualLink('dem','ens',xl('Previous Consultations')); // with dem on top ?>
698 <?php genDualLink('his','ens',xl('Previous History/Screening')); // with ens on bottom ?>
699 <?php genTreeLink('RBot','nen',xl('New Allergy')); // nen with Allergy in chief complaint ?>
700 <?php genTreeLink('RTop','iss',xl('Edit Allergies')); // somehow emphasizing allergies...? ?>
701 <?php genTreeLink('RTop','his',xl('View Allergies')); // his page with Allergies section open ?>
702 <?php genDualLink('iss','ens',xl('Problems/Issues')); // with ens on bottom ?>
703 <?php genDualLink('tra','ens',xl('Transactions/Referrals')); // new transaction form on top and tra list on bottom (or ens if no tra) ?>
704 <?php if (!$GLOBALS['disable_immunizations']) genDualLink('his','imm',xl('Immunizations')); // imm on bottom, his on top ?>
705 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genDualLink('his','pre',xl('Prescriptions')); // pre on bottom, his on top ?>
706 <?php genTreeLink('RTop','doc',xl('Document/Imaging Store')); ?>
707 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); ?>
708 <?php genDualLink('dem','pno',xl('Additional Notes')); // with dem on top ?>
709 <li><a href='' onclick="return repPopup('../patient_file/letter.php')" id='prp1'>Letter</a></li>
710 <?php genPopLink('Address Book','../usergroup/addrbook_list.php?popup=1'); ?>
711 </ul>
712 </li>
713 <li><span><?php xl('View','e') ?></span>
714 <ul>
715 <?php if (!$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar View')); ?>
716 <?php genTreeLink('RTop','ros',xl('Team Roster View')); // default; and minimize lower frame ?>
717 <?php genTreeLink('RTop','dem',xl('Current Patient')); // this also appears under Demographics ?>
718 </ul>
719 </li>
720 </ul>
721 </li>
722 <li class="open"><span><?php xl('Reports','e') ?></span>
723 <ul>
724 <li class="open"><span><?php xl('Athletic/Injury','e') ?></span>
725 <ul>
726 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); // also appears above ?>
727 <?php genPopLink(xl('Games/Events Missed'),'absences_report.php'); ?>
728 <?php genPopLink(xl('Injury Surveillance'),'football_injury_report.php'); ?>
729 <?php genPopLink(xl('Team Injury Overview'),'injury_overview_report.php'); ?>
730 </ul>
731 </li>
732 <li><span><?php xl('Patient/Client','e') ?></span>
733 <ul>
734 <?php genPopLink('List','patient_list.php'); ?>
735 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genPopLink(xl('Prescriptions'),'prescriptions_report.php'); ?>
736 <?php genPopLink(xl('Referrals'),'referrals_report.php'); ?>
737 </ul>
738 </li>
739 <li><span><?php xl('Visits','e') ?></span>
740 <ul>
741 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appointments'),'appointments_report.php'); ?>
742 <?php genPopLink(xl('Encounters'),'encounters_report.php'); ?>
743 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appt-Enc'),'appt_encounter_report.php'); ?>
744 </ul>
745 </li>
746 <li><span><?php xl('General','e') ?></span>
747 <ul>
748 <?php genPopLink(xl('Services'),'services_by_category.php'); ?>
749 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
750 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
751 </ul>
752 </li>
753 </ul>
754 </li>
755 <li><span><?php xl('Fees','e') ?></span>
756 <ul>
757 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
758 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
759 </ul>
760 </li>
761 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
762 <li><span><?php xl('Administration','e') ?></span>
763 <ul>
764 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
765 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
766 <?php genTreeLink('RTop','pwd','Users Password Change'); ?>
767 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings'); ?>
768 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
769 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
770 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
771 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
772 <li><span><?php xl('Other','e') ?></span>
773 <ul>
774 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
775 <?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'); ?>
776 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
777 <?php if (acl_check('admin', 'database')) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
778 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
779 </ul>
780 </li>
781 </ul>
782 </li>
783 <li><span><?php xl('Miscellaneous','e') ?></span>
784 <ul>
785 <?php genTreeLink('RBot','aun',xl('Pt Notes/Auth')); ?>
786 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
787 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
788 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
789 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
790 </ul>
791 </li>
792 </ul>
794 <?php } else { // not athletic team ?>
796 <ul id="navigation">
797 <?php if (!$GLOBALS['disable_calendar'] && !$GLOBALS['ippf_specific']) genTreeLink('RTop','cal',xl('Calendar')); ?>
798 <li class="open"><span><?php xl('Patient/Client','e') ?></span>
799 <ul>
800 <li><span><?php xl('Management','e') ?></span>
801 <ul>
802 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
803 <?php genTreeLink('RTop','dem',xl('Current')); ?>
804 <?php genTreeLink('RBot','sum',xl('Summary')); ?>
805 </ul>
806 </li>
807 <li class="open"><span><?php xl('Visits','e') ?></span>
808 <ul>
809 <?php if ($GLOBALS['ippf_specific'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar')); ?>
810 <?php genTreeLink('RBot','nen',xl('New Visit')); ?>
811 <?php genTreeLink('RBot','enc',xl('Current')); ?>
812 <?php genTreeLink('RBot','ens',xl('List')); ?>
813 <?php genTreeLink('RBot','tra',xl('Transact')); ?>
814 <?php if (!$GLOBALS['disable_chart_tracker']) genPopLink(xl('Chart Tracker'),'../../custom/chart_tracker.php'); ?>
815 </ul>
816 </li>
817 <li><span><?php xl('Visit Forms','e') ?></span>
818 <ul>
819 <?php
820 // Generate the items for visit forms, both traditional and LBF.
822 $lres = sqlStatement("SELECT * FROM list_options " .
823 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
824 if (sqlNumRows($lres)) {
825 while ($lrow = sqlFetchArray($lres)) {
826 $option_id = $lrow['option_id']; // should start with LBF
827 $title = $lrow['title'];
828 genMiscLink('RBot','cod','2',xl_form_title($title),
829 "patient_file/encounter/load_form.php?formname=$option_id");
832 include_once("$srcdir/registry.inc");
833 $reg = getRegistered();
834 if (!empty($reg)) {
835 foreach ($reg as $entry) {
836 $option_id = $entry['directory'];
837 $title = trim($entry['nickname']);
838 if ($option_id == 'fee_sheet' ) continue;
839 if ($option_id == 'newpatient') continue;
840 if (empty($title)) $title = $entry['name'];
841 genMiscLink('RBot','cod','2',xl_form_title($title),
842 "patient_file/encounter/load_form.php?formname=" .
843 urlencode($option_id));
847 </ul>
848 </li>
849 <li><span><?php xl('Medical Record','e') ?></span>
850 <ul>
851 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genTreeLink('RBot','pre',xl('Rx')); ?>
852 <?php genTreeLink('RTop','his',xl('History')); ?>
853 <?php genTreeLink('RTop','iss',xl('Issues')); ?>
854 <?php if (!$GLOBALS['disable_immunizations']) genTreeLink('RBot','imm',xl('Immunize')); ?>
855 <?php genTreeLink('RTop','doc',xl('Documents')); ?>
856 <?php genTreeLink('RBot','pno',xl('Notes')); ?>
857 <?php genTreeLink('RTop','prp',xl('Report')); ?>
858 </ul>
859 </li>
860 </ul>
861 </li>
862 <li><span><?php xl('Fees','e') ?></span>
863 <ul>
864 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
865 <?php if ($GLOBALS['use_charges_panel']) genTreeLink('RBot','cod',xl('Charges')); ?>
866 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
867 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil',xl('Billing')); ?>
868 </ul>
869 </li>
870 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
871 <?php if (!$disallowed['adm']) { ?>
872 <li><span><?php xl('Administration','e') ?></span>
873 <ul>
874 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
875 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
876 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings'); ?>
877 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
878 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
879 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
880 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
881 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
882 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) genMiscLink('RTop','adm','0',xl('Export'),'main/ippf_export.php'); ?>
883 <li><span><?php xl('Other','e') ?></span>
884 <ul>
885 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
886 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
887 <?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'); ?>
888 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
889 <?php if (acl_check('admin', 'database')) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
890 </ul>
891 </li>
892 </ul>
893 </li>
894 <?php } ?>
895 <li><span><?php xl('Reports','e') ?></span>
896 <ul>
897 <li><span><?php xl('Clients','e') ?></span>
898 <ul>
899 <?php genPopLink(xl('List'),'patient_list.php'); ?>
900 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genPopLink(xl('Rx'),'prescriptions_report.php'); ?>
901 <?php genPopLink(xl('Referrals'),'referrals_report.php'); ?>
902 </ul>
903 </li>
904 <li class="open"><span><?php xl('Visits','e') ?></span>
905 <ul>
906 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appointments'),'appointments_report.php'); ?>
907 <?php genPopLink(xl('Encounters'),'encounters_report.php'); ?>
908 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appt-Enc'),'appt_encounter_report.php'); ?>
909 <?php if (empty($GLOBALS['code_types']['IPPF'])) { ?>
910 <?php genPopLink(xl('Superbill'),'custom_report_range.php'); ?>
911 <?php } ?>
912 <?php if (!$GLOBALS['disable_chart_tracker']) genPopLink(xl('Chart Activity'),'chart_location_activity.php'); ?>
913 <?php if (!$GLOBALS['disable_chart_tracker']) genPopLink(xl('Charts Out'),'charts_checked_out.php'); ?>
914 </ul>
915 </li>
916 <?php if (acl_check('acct', 'rep_a')) { ?>
917 <li><span><?php xl('Financial','e') ?></span>
918 <ul>
919 <?php genPopLink(xl('Sales'),'sales_by_item.php'); ?>
920 <?php genPopLink(xl('Cash Rec'),'../billing/sl_receipts_report.php'); ?>
921 <?php genPopLink(xl('Front Rec'),'front_receipts_report.php'); ?>
922 <?php genPopLink(xl('Pmt Method'),'receipts_by_method_report.php'); ?>
923 <?php genPopLink(xl('Collections'),'collections_report.php'); ?>
924 </ul>
925 </li>
926 <?php } ?>
927 <li><span><?php xl('General','e') ?></span>
928 <ul>
929 <?php genPopLink(xl('Services'),'services_by_category.php'); ?>
930 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
931 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
932 </ul>
933 </li>
934 <?php if (! $GLOBALS['simplified_demographics']) { ?>
935 <li><span><?php xl('Insurance','e') ?></span>
936 <ul>
937 <?php genPopLink(xl('Distribution'),'insurance_allocation_report.php'); ?>
938 <?php genPopLink(xl('Indigents'),'../billing/indigent_patients_report.php'); ?>
939 <?php genPopLink(xl('Unique SP'),'unique_seen_patients_report.php'); ?>
940 </ul>
941 </li>
942 <?php } ?>
943 <?php if (!empty($GLOBALS['code_types']['IPPF'])) { ?>
944 <li><span><?php xl('Statistics','e') ?></span>
945 <ul>
946 <?php genPopLink('IPPF Stats','ippf_statistics.php?t=i'); ?>
947 <?php genPopLink('GCAC Stats','ippf_statistics.php?t=g'); ?>
948 <?php genPopLink('MA Stats','ippf_statistics.php?t=m'); ?>
949 <?php genPopLink('CYP','ippf_cyp_report.php'); ?>
950 <?php genPopLink('Daily Record','ippf_daily.php'); ?>
951 </ul>
952 </li>
953 <?php } // end ippf-specific ?>
954 <li><span><?php xl('Blank Forms','e') ?></span>
955 <ul>
956 <?php genPopLink(xl('Demographics'),'../patient_file/summary/demographics_print.php'); ?>
957 <?php genPopLink(xl('Fee Sheet'),'../patient_file/printed_fee_sheet.php'); ?>
958 <?php genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php'); ?>
959 <?php
960 $lres = sqlStatement("SELECT * FROM list_options " .
961 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
962 while ($lrow = sqlFetchArray($lres)) {
963 $option_id = $lrow['option_id']; // should start with LBF
964 $title = $lrow['title'];
965 genPopLink($title, "../forms/LBF/printable.php?formname=$option_id");
968 </ul>
969 </li>
970 <?php // genTreeLink('RTop','rep','Other'); ?>
971 </ul>
972 </li>
973 <li><span><?php xl('Miscellaneous','e') ?></span>
974 <ul>
975 <?php genTreeLink('RBot','aun',xl('Pt Notes/Auth')); ?>
976 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
977 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
978 <?php if (!$GLOBALS['disable_chart_tracker']) genTreeLink('RTop','cht',xl('Chart Tracker')); ?>
979 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
980 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
981 <?php genTreeLink('RTop','pwd',xl('Password')); ?>
982 </ul>
983 </li>
984 </ul>
986 <?php } // end not athletic team ?>
988 <?php } else { // end ($GLOBALS['concurrent_layout'] == 2) ?>
990 <table cellpadding='0' cellspacing='0' border='0'>
991 <tr>
992 <td colspan='3'>
993 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
994 <tr>
995 <td class='smalltext' nowrap>
996 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
997 </td>
998 <td class='smalltext' align='right' nowrap>
999 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
1000 </td>
1001 </tr>
1002 </table>
1003 </td>
1004 </tr>
1005 <?php
1006 // Builds the table of radio buttons and their labels. Radio button values
1007 // are comprised of the 3-character document id and the 1-digit usage type,
1008 // so that JavaScript can easily access this information.
1009 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
1010 foreach ($primary_docs as $key => $varr) {
1011 if (!empty($disallowed[$key])) continue;
1012 $label = $varr[0];
1013 $usage = $varr[1];
1014 $url = $varr[2];
1015 echo " <tr>\n";
1016 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
1017 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
1018 if ($key == $default_top_rbid) echo " checked";
1019 echo " /></td>\n";
1020 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
1021 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
1022 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
1023 if ($key == 'aun') echo " checked";
1024 echo " /></td>\n";
1025 echo " </tr>\n";
1028 </table>
1030 <?php } ?>
1032 <br /><hr />
1034 <?php
1035 // To use RelayHealth, see comments and parameters in includes/config.php.
1036 if (!empty($GLOBALS['ssi']['rh'])) {
1037 include_once("../../library/ssi.inc");
1038 echo getRelayHealthLink() ."<br /><hr />\n";
1042 <?php xl('Active Patient','e') ?>:<br />
1043 <div id='current_patient'>
1044 <b><?php xl('None','e'); ?></b>
1045 </div>
1047 <?php xl('Active Encounter','e') ?>:<br />
1048 <div id='current_encounter'>
1049 <b><?php xl('None','e'); ?></b>
1050 </div>
1052 <?php if (!$GLOBALS['athletic_team']) genPopupsList(); ?>
1054 <hr />
1056 <table cellpadding='0' cellspacing='0' border='0'>
1057 <tr>
1058 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
1059 <td class='smalltext' colspan='2'>
1060 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
1061 </td>
1062 </tr>
1063 <tr>
1064 <td class='smalltext'><?php xl('by','e') ?>:</td>
1065 <td class='smalltext'>
1066 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name','e'); ?></a>
1067 </td>
1068 <td class='smalltext' align='right'>
1069 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID','e'); ?></a>
1070 </td>
1071 </tr>
1072 <tr>
1073 <td class='smalltext'>&nbsp;</td>
1074 <td class='smalltext'>
1075 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN','e'); ?></a>
1076 </td>
1077 <td class='smalltext' align='right'>
1078 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB','e'); ?></a>
1079 </td>
1080 </tr>
1082 <tr>
1083 <td class='smalltext'>&nbsp;</td>
1084 <td class='smalltext'>
1085 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
1086 </td>
1087 <td class='smalltext' align='right'>
1088 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
1089 </td>
1090 </tr>
1092 </table>
1094 <hr />
1095 <a href="../../Documentation/User_Guide/" target="_blank" class="navitem" id="help_link"
1096 onclick="top.restoreSession()">
1097 <?php xl('User Manual','e'); ?></a>
1099 <?php if (!empty($GLOBALS['online_support_link'])) { ?>
1100 <br>
1101 <a href='<?php echo $GLOBALS["online_support_link"]; ?>' target="_blank" class="navitem" id="support_link"
1102 onclick="top.restoreSession()">
1103 <?php xl('Online Support','e'); ?></a>
1104 <?php
1108 <hr />
1109 <a href="../logout.php?auth=logout" target="_top" class="navitem" id="logout_link"
1110 onclick="top.restoreSession()">
1111 <?php xl('Logout','e'); ?></a>
1113 <input type='hidden' name='findBy' value='Last' />
1114 <input type="hidden" name="searchFields" id="searchFields"/>
1116 </form>
1118 <script language='JavaScript'>
1119 syncRadios();
1120 </script>
1122 </body>
1123 </html>