Left menu navigations bug fixes:
[openemr.git] / interface / main / left_nav.php
blob39a8841971a869e03e6053310f973caef9601966
1 <?php
2 // Copyright (C) 2006-2010 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/encounter/encounter_top.php: another new frameset
44 // cloned from patient_encounter.php.
45 // * interface/patient_file/encounter/forms.php: link target removal.
46 // * interface/patient_file/encounter/new_form.php: target change.
47 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
48 // changes.
49 // * interface/patient_file/summary/immunizations.php: removed back link.
50 // * interface/patient_file/summary/pnotes.php: changed link targets.
51 // * interface/patient_file/summary/pnotes_full.php: changed back link and
52 // added set_pid logic.
53 // * interface/patient_file/transaction/transactions.php: various changes.
54 // * interface/patient_file/transaction/add_transaction.php: new return js.
55 // * interface/patient_file/encounter/superbill_codes.php: target and link
56 // changes.
57 // * interface/patient_file/encounter/superbill_custom_full.php: target and
58 // link changes.
59 // * interface/patient_file/encounter/diagnosis.php: target changes.
60 // * interface/patient_file/encounter/diagnosis_full.php: target and link
61 // changes.
62 // * interface/main/authorizations/authorizations.php: link and target changes.
63 // * library/api.inc: url change.
64 // * interface/patient_file/summary/rx_frameset.php: new frameset.
65 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
66 // * all encounter forms: remove all instances of "target=Main" and change
67 // all instances of "patient_encounter.php" to "encounter_top.php".
69 // Our find_patient form, when submitted, invokes patient_select.php in the
70 // upper frame. When the patient is selected, demographics.php is invoked
71 // with the set_pid parameter, which establishes the new session pid and also
72 // calls the setPatient() function (below). In this case demographics.php
73 // will also load the summary frameset into the bottom frame, invoking our
74 // loadFrame() and setRadio() functions.
76 // Similarly, we have the concept of selecting an encounter from the
77 // Encounters list, and then having that "stick" until some other encounter
78 // or a new encounter is chosen. We also have a navigation item for creating
79 // a new encounter. interface/patient_file/encounter/encounter_top.php
80 // supports set_encounter to establish an encounter.
82 // TBD: Include active_pid and/or active_encounter in relevant submitted
83 // form data, and add logic to the save routines to make sure they match
84 // the corresponding session values.
86 include_once("../globals.php");
87 include_once($GLOBALS['fileroot']."/library/acl.inc");
88 include_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
89 include_once($GLOBALS['fileroot']."/library/patient.inc");
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 $primary_docs = array(
100 'ros' => array(xl('Roster') , 0, 'reports/players_report.php?embed=1'),
101 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
102 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php'),
103 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
104 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
105 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
106 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
107 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
108 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
109 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
110 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
111 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
112 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
113 'imp' => array(xl('Import') , 0, '../custom/import.php'),
114 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
115 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
116 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
117 'new' => array(xl('New Pt') , 0, 'new/new.php'),
118 'lab' => array(xl('Check Lab Results') , 0, 'orders/lab_exchange.php'),
119 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
120 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
121 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
122 'nen' => array(xl('Create Visit'), 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 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
128 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
129 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
130 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
131 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
132 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
133 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
135 $primary_docs['npa']=array(xl('Payments') , 0, 'billing/new_payment.php');
136 if ($GLOBALS['use_charges_panel'] || $GLOBALS['concurrent_layout'] == 2) {
137 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
140 // This section decides which navigation items will not appear.
142 $disallowed = array();
144 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
145 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
146 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
147 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
148 acl_check('admin', 'superbill'));
150 $disallowed['bil'] = !(acl_check('acct', 'rep') || acl_check('acct', 'eob') ||
151 acl_check('acct', 'bill'));
153 $tmp = acl_check('patients', 'demo');
154 $disallowed['new'] = !($tmp == 'write' || $tmp == 'addonly');
156 $disallowed['fax'] = !($GLOBALS['enable_hylafax'] || $GLOBALS['enable_scanner']);
158 $disallowed['ros'] = !$GLOBALS['athletic_team'];
160 $disallowed['iss'] = !((acl_check('encounters', 'notes') == 'write' ||
161 acl_check('encounters', 'notes_a') == 'write') &&
162 acl_check('patients', 'med') == 'write');
164 $disallowed['imp'] = $disallowed['new'] ||
165 !is_readable("$webserver_root/custom/import.php");
167 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
169 $disallowed['pre'] = !(acl_check('patients', 'med'));
171 // Helper functions for treeview generation.
172 function genTreeLink($frame, $name, $title, $mono=false) {
173 global $primary_docs, $disallowed;
174 if (empty($disallowed[$name])) {
175 $id = $name . $primary_docs[$name][1];
176 echo "<li><a href='' id='$id' onclick=\"";
177 if ($mono) {
178 if ($frame == 'RTop')
179 echo "forceSpec(true,false);";
180 else
181 echo "forceSpec(false,true);";
183 echo "return loadFrame2('$id','$frame','" .
184 $primary_docs[$name][2] . "')\">" . $title . "</a></li>";
187 function genMiscLink($frame, $name, $level, $title, $url, $mono=false) {
188 global $disallowed;
189 if (empty($disallowed[$name])) {
190 $id = $name . $level;
191 echo "<li><a href='' id='$id' onclick=\"";
192 if ($mono) {
193 if ($frame == 'RTop')
194 echo "forceSpec(true,false);";
195 else
196 echo "forceSpec(false,true);";
198 echo "return loadFrame2('$id','$frame','" .
199 $url . "')\">" . $title . "</a></li>";
202 function genPopLink($title, $url, $linkid='') {
203 echo "<li><a href='' ";
204 if ($linkid) echo "id='$linkid' ";
205 echo "onclick=\"return repPopup('$url')\"" .
206 ">" . $title . "</a></li>";
208 function genDualLink($topname, $botname, $title) {
209 global $primary_docs, $disallowed;
210 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
211 $topid = $topname . $primary_docs[$topname][1];
212 $botid = $botname . $primary_docs[$botname][1];
213 echo "<li><a href='' id='$topid' " .
214 "onclick=\"return loadFrameDual('$topid','$botid','" .
215 $primary_docs[$topname][2] . "','" .
216 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
220 function genPopupsList($style='') {
221 global $disallowed, $webserver_root;
223 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
224 <option value=''><?php xl('Popups','e'); ?></option>
225 <?php if (!$disallowed['iss']) { ?>
226 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
227 <?php } ?>
228 <?php if (!$GLOBALS['ippf_specific']) { ?>
229 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
230 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
231 <?php } ?>
232 <?php if ($GLOBALS['athletic_team']) { ?>
233 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
234 <?php } ;
235 if (!$GLOBALS['disable_calendar']) { ?>
236 <option value='../reports/appointments_report.php?patient=<?php echo $pid ?>'><?php xl('Appts','e'); ?></option>
237 <?php } ;
238 if (file_exists("$webserver_root/custom/refer.php")) { ?>
239 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
240 <?php } ?>
241 <?php // if (file_exists("$webserver_root/custom/fee_sheet_codes.php")) { ?>
242 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill','e'); ?></option>
243 <?php // } ?>
244 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
245 <option value='../patient_file/front_payment.php'><?php xl('Prepay','e'); ?></option>
246 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
247 <?php } else { ?>
248 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
249 <?php } ?>
250 <?php if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates")) { ?>
251 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
252 <?php } ?>
253 </select>
254 <?php
258 <html>
259 <head>
260 <title>Navigation</title>
261 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
263 <style type="text/css">
264 body {
265 font-size:8pt;
266 font-weight:normal;
267 padding: 5px 3px 5px 3px;
269 .smalltext {
270 font-family:sans-serif;
271 font-size:8pt;
272 font-weight:normal;
274 a.navitem, a.navitem:visited {
275 color:#0000ff;
276 font-family:sans-serif;
277 font-size:8pt;
278 font-weight:bold;
280 .inputtext {
281 font-size:9pt;
282 font-weight:normal;
283 border-style:solid;
284 border-width:1px;
285 padding-left:2px;
286 padding-right:2px;
287 border-color: #000000;
288 background-color:transparent;
291 #navigation ul {
292 background-color:transparent;
294 #navigation-slide ul {
295 background-color:transparent;
297 .nav-menu-img{
298 width:25px;
299 height:25px;
300 border:none;
301 margin-right:5px;
302 vertical-align:middle;
304 </style>
306 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.3/jquery.treeview.css" />
307 <script src="../../library/js/jquery-1.2.2.min.js" type="text/javascript"></script>
308 <script src="../../library/js/jquery.treeview-1.3/jquery.treeview.min.js" type="text/javascript"></script>
310 <script type="text/javascript" src="../../library/dialog.js"></script>
312 <script language='JavaScript'>
314 // Master values for current pid and encounter.
315 var active_pid = 0;
316 var active_encounter = 0;
318 // Current selections in the top and bottom frames.
319 var topName = '';
320 var botName = '';
322 // Expand and/or collapse frames in response to checkbox clicks.
323 // fnum indicates which checkbox was clicked (1=left, 2=right).
324 function toggleFrame(fnum) {
325 var f = document.forms[0];
326 var fset = top.document.getElementById('fsright');
327 if (!f.cb_top.checked && !f.cb_bot.checked) {
328 if (fnum == 1) f.cb_bot.checked = true;
329 else f.cb_top.checked = true;
331 var rows = f.cb_top.checked ? '*' : '0';
332 rows += f.cb_bot.checked ? ',*' : ',0';
333 fset.rows = rows;
334 fset.rows = rows;
337 // Load the specified url into the specified frame (RTop or RBot).
338 // The URL provided must be relative to interface.
339 function loadFrame(fname, frame, url) {
340 top.restoreSession();
341 var i = url.indexOf('{PID}');
342 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
343 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
344 if (frame == 'RTop') topName = fname; else botName = fname;
347 // Load the specified url into a frame to be determined, with the specified
348 // frame as the default; the url must be relative to interface.
349 function loadFrame2(fname, frame, url) {
350 var usage = fname.substring(3);
351 if (active_pid == 0 && usage > '0') {
352 alert('<?php xl('You must first select or add a patient.','e') ?>');
353 return false;
355 if (active_encounter == 0 && usage > '1') {
356 alert('<?php xl('You must first select or create an encounter.','e') ?>');
357 return false;
359 var f = document.forms[0];
360 top.restoreSession();
361 var i = url.indexOf('{PID}');
362 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
363 if(f.sel_frame)
365 var fi = f.sel_frame.selectedIndex;
366 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
368 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
369 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
370 if (frame == 'RTop') topName = fname; else botName = fname;
371 return false;
374 // Make sure the the top and bottom frames are open or closed, as specified.
375 function forceSpec(istop, isbot) {
376 var f = document.forms[0];
377 if (f.cb_top.checked != istop) {
378 f.cb_top.checked = istop;
379 toggleFrame(1);
381 if (f.cb_bot.checked != isbot) {
382 f.cb_bot.checked = isbot;
383 toggleFrame(2);
387 // Make sure both frames are open.
388 function forceDual() {
389 forceSpec(true, true);
392 // Load the specified url into a frame to be determined, with the specified
393 // frame as the default; the url must be relative to interface.
394 function loadFrameDual(tname, bname, topurl, boturl) {
395 var topusage = tname.substring(3);
396 var botusage = bname.substring(3);
397 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
398 alert('<?php xl('You must first select or add a patient.','e') ?>');
399 return false;
401 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
402 alert('<?php xl('You must first select or create an encounter.','e') ?>');
403 return false;
405 var f = document.forms[0];
406 forceDual();
407 top.restoreSession();
408 var i = topurl.indexOf('{PID}');
409 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
410 i = boturl.indexOf('{PID}');
411 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
412 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
413 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
414 topName = tname;
415 botName = bname;
416 return false;
419 // Select a designated radio button. raname may be either the radio button
420 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
421 // You should call this if you directly load a document that does not
422 // correspond to the current radio button setting.
423 function setRadio(raname, rbid) {
424 <?php if ($GLOBALS['concurrent_layout'] < 2) { ?>
425 var f = document.forms[0];
426 if (raname == 'RTop') raname = 'rb_top';
427 if (raname == 'RBot') raname = 'rb_bot';
428 for (var i = 0; i < f[raname].length; ++i) {
429 if (f[raname][i].value.substring(0,3) == rbid) {
430 f[raname][i].checked = true;
431 return true;
434 <?php } ?>
435 return false;
438 // Set disabled/enabled state of radio buttons and associated labels
439 // depending on whether there is an active patient or encounter.
440 function syncRadios() {
441 var f = document.forms[0];
442 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
443 var nlinks = document.links.length;
444 for (var i = 0; i < nlinks; ++i) {
445 var lnk = document.links[i];
446 if (lnk.id.length != 4) continue;
447 var usage = lnk.id.substring(3);
448 if (usage == '1' || usage == '2') {
449 var da = false;
450 if (active_pid == 0) da = true;
451 if (active_encounter == 0 && usage > '1') da = true;
452 lnk.style.color = da ? '#888888' : '#0000ff';
455 <?php } else if ($GLOBALS['concurrent_layout'] < 2) { ?>
456 for (var i = 0; i < f.rb_top.length; ++i) {
457 var da = false;
458 var rb1 = f.rb_top[i];
459 var rb2 = f.rb_bot[i];
460 var rbid = rb1.value.substring(0,3);
461 var usage = rb1.value.substring(3);
462 if (active_pid == 0 && usage > '0') da = true;
463 if (active_encounter == 0 && usage > '1') da = true;
464 // daemon_frame can also set special label colors, so don't mess with
465 // them unless we have to.
466 if (rb1.disabled != da) {
467 rb1.disabled = da;
468 rb2.disabled = da;
469 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
472 <?php } ?>
473 f.popups.disabled = (active_pid == 0);
476 function goHome() {
477 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
478 top.frames['RBot'].location='messages/messages.php';
481 // Reference to the search.php window.
482 var my_window;
484 // Open the search.php window.
485 function initFilter() {
486 my_window = window.open("../../custom/search.php", "mywindow","status=1");
489 // This is called by the search.php (Filter) window.
490 function processFilter(fieldString, serviceCode) {
491 var f = document.forms[0];
492 document.getElementById('searchFields').value = fieldString;
493 f.search_service_code.value = serviceCode;
494 findPatient("Filter");
495 f.search_service_code.value = '';
496 my_window.close();
499 // Process the click to find a patient by name, id, ssn or dob.
500 function findPatient(findby) {
501 var f = document.forms[0];
502 if (! f.cb_top.checked) {
503 f.cb_top.checked = true;
504 toggleFrame(1);
506 f.findBy.value = findby;
507 setRadio('rb_top', 'dem');
508 top.restoreSession();
509 document.find_patient.submit();
512 // Helper function to set the contents of a div.
513 function setSomeContent(id, content, doc) {
514 if (doc.getElementById) {
515 var x = doc.getElementById(id);
516 x.innerHTML = '';
517 x.innerHTML = content;
519 else if (doc.all) {
520 var x = doc.all[id];
521 x.innerHTML = content;
524 function setDivContent(id, content) {
525 setSomeContent(id, content, document);
527 function setTitleContent(id, content) {
528 setSomeContent(id, content, parent.Title.document);
531 // This is called automatically when a new patient is set, to make sure
532 // there are no patient-specific documents showing stale data. If a frame
533 // was just loaded with data for the correct patient, its name is passed so
534 // that it will not be zapped. At this point the new server-side pid is not
535 // assumed to be set, so this function will only load global data.
536 function reloadPatient(frname) {
537 var f = document.forms[0];
538 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
539 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
540 setRadio('rb_top', 'cal');
542 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
543 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
544 setRadio('rb_bot', 'ens');
548 // Reload encounter-specific frames, excluding a specified frame. At this
549 // point the new server-side encounter ID may not be set and loading the same
550 // document for the new encounter will not work, so load patient info instead.
551 function reloadEncounter(frname) {
552 var f = document.forms[0];
553 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
554 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
555 setRadio('rb_top', 'dem');
557 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
558 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
559 setRadio('rb_bot', 'ens');
563 // Call this to announce that the patient has changed. You must call this
564 // if you change the session PID, so that the navigation frame will show the
565 // correct patient and so that the other frame will be reloaded if it contains
566 // patient-specific information from the previous patient. frname is the name
567 // of the frame that the call came from, so we know to only reload content
568 // from the *other* frame if it is patient-specific.
569 function setPatient(pname, pid, pubpid, frname, str_dob) {
570 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
571 setDivContent('current_patient', str);
572 setTitleContent('current_patient', str + str_dob);
573 if (pid == active_pid) return;
574 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
575 active_pid = pid;
576 active_encounter = 0;
577 if (frname) reloadPatient(frname);
578 <?php if ($GLOBALS['concurrent_layout'] < 3) { ?>
579 syncRadios();
580 <?php } ?>
581 $(parent.Title.document.getElementById('current_patient_block')).show();
582 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
583 $(encounter_block).hide();
585 // zero out the encounter frame, replace it with the encounter list frame
586 var f = document.forms[0];
587 if ( f.cb_top.checked && f.cb_bot.checked ) {
588 var encounter_frame = getEncounterTargetFrame('enc');
589 if ( encounter_frame != undefined ) {
590 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
591 setRadio(encounter_frame, 'ens');
595 function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) {
596 //This function lists all encounters of the patient.
597 //This function writes the drop down in the top frame.
598 //It is called when a new patient is create/selected from the search menu.
599 var str = '<Select class="text" id="EncounterHistory" onchange="toencounter(this.options[this.selectedIndex].value)">';
600 str+='<option value=""><?php echo htmlspecialchars( xl('Encounter History'), ENT_QUOTES) ?></option>';
601 str+='<option value="New Encounter"><?php echo htmlspecialchars( xl('New Encounter'), ENT_QUOTES) ?></option>';
602 str+='<option value="Past Encounter List"><?php echo htmlspecialchars( xl('Past Encounter List'), ENT_QUOTES) ?></option>';
603 for(CountEncounter=0;CountEncounter<EncounterDateArray.length;CountEncounter++)
605 str+='<option value="'+EncounterIdArray[CountEncounter]+'~'+EncounterDateArray[CountEncounter]+'">'+EncounterDateArray[CountEncounter]+'-'+CalendarCategoryArray[CountEncounter]+'</option>';
607 str+='</Select>';
608 $(parent.Title.document.getElementById('past_encounter_block')).show();
609 top.window.parent.Title.document.getElementById('past_encounter').innerHTML=str;
612 function loadCurrentPatientFromTitle() {
613 top.frames['RTop'].location='../patient_file/summary/demographics.php';
616 function getEncounterTargetFrame( name ) {
617 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
618 var f = document.forms[0];
619 var r = 'RTop';
620 if (f.cb_top.checked && f.cb_bot.checked) {
621 if ( bias == 2 ) {
622 r = 'RBot';
623 } else {
624 r = 'RTop';
626 } else {
627 if ( f.cb_top.checked ) {
628 r = 'RTop';
629 } else if ( f.cb_bot.checked ) {
630 r = 'RBot';
633 return r;
636 // Call this to announce that the encounter has changed. You must call this
637 // if you change the session encounter, so that the navigation frame will
638 // show the correct encounter and so that the other frame will be reloaded if
639 // it contains encounter-specific information from the previous encounter.
640 // frname is the name of the frame that the call came from, so we know to only
641 // reload encounter-specific content from the *other* frame.
642 function setEncounter(edate, eid, frname) {
643 if (eid == active_encounter) return;
644 if (!eid) edate = '<?php xl('None','e'); ?>';
645 var str = '<b>' + edate + '</b>';
646 setDivContent('current_encounter', str);
647 active_encounter = eid;
648 reloadEncounter(frname);
649 <?php if ($GLOBALS['concurrent_layout'] < 3) { ?>
650 syncRadios();
651 <?php } ?>
652 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
653 var encounter = $(parent.Title.document.getElementById('current_encounter'));
654 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
655 encounter.html( estr );
656 encounter_block.show();
659 function loadCurrentEncounterFromTitle() {
660 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/encounter_top.php';
663 // You must call this if you delete the active patient (or if for any other
664 // reason you "close" the active patient without opening a new one), so that
665 // the appearance of the navigation frame will be correct and so that any
666 // stale content will be reloaded.
667 function clearPatient() {
668 if (active_pid == 0) return;
669 var f = document.forms[0];
670 active_pid = 0;
671 active_encounter = 0;
672 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
673 setTitleContent('current_patient', '<b><?php xl('None','e'); ?></b>');
674 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
675 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
676 reloadPatient('');
677 <?php if ($GLOBALS['concurrent_layout'] < 3) { ?>
678 syncRadios();
679 <?php } ?>
682 // You must call this if you delete the active encounter (or if for any other
683 // reason you "close" the active encounter without opening a new one), so that
684 // the appearance of the navigation frame will be correct and so that any
685 // stale content will be reloaded.
686 function clearEncounter() {
687 if (active_encounter == 0) return;
688 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
689 active_encounter = 0;
690 reloadEncounter('');
691 <?php if ($GLOBALS['concurrent_layout'] < 3) { ?>
692 syncRadios();
693 <?php } ?>
695 function removeOptionSelected(EncounterId)
696 {//Removes an item from the Encounter drop down.
697 var elSel = top.window.parent.Title.document.getElementById('EncounterHistory');
698 var i;
699 for (i = elSel.length - 1; i>=2; i--) {
700 EncounterHistoryValue=elSel.options[i].value;
701 EncounterHistoryValueArray=EncounterHistoryValue.split('~');
702 if (EncounterHistoryValueArray[0]==EncounterId) {
703 elSel.remove(i);
708 // You can call this to make sure the session pid is what we expect.
709 function pidSanityCheck(pid) {
710 if (pid != active_pid) {
711 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
712 '. This session is unstable and should be abandoned. Do not use ' +
713 'OpenEMR in multiple browser windows!');
714 return false;
716 return true;
719 // You can call this to make sure the session encounter is what we expect.
720 function encounterSanityCheck(eid) {
721 if (eid != active_encounter) {
722 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
723 '. This session is unstable and should be abandoned. Do not use ' +
724 'OpenEMR in multiple browser windows!');
725 return false;
727 return true;
730 // Pop up a report.
731 function repPopup(aurl) {
732 top.restoreSession();
733 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
734 return false;
737 // This is invoked to pop up some window when a popup item is selected.
738 function selpopup(selobj) {
739 var i = selobj.selectedIndex;
740 var opt = selobj.options[i];
741 if (i > 0) {
742 var width = 750;
743 var height = 550;
744 if (opt.text == 'Export' || opt.text == 'Import') {
745 width = 500;
746 height = 400;
748 else if (opt.text == 'Refer') {
749 width = 700;
750 height = 500;
752 dlgopen(opt.value, '_blank', width, height);
754 selobj.selectedIndex = 0;
756 // Treeview activation stuff:
757 $(document).ready(function(){
758 if(3 == <?php echo $GLOBALS['concurrent_layout'] ?>){
759 $("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
760 $("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
761 $("#navigation-slide > li > a.expanded").click(function() {
762 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
763 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
765 $("#navigation-slide > li > a.collapsed").click(function() {
766 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
767 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
769 $("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
770 $("#navigation-slide > li > ul > li > a.expanded_lv2").not(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
771 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
773 $("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
774 $("#navigation-slide > li > ul > li > a.expanded_lv2").not(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
775 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
777 $("#cal0").prepend('<img src="../../images/calendar.png" class="nav-menu-img" />');
778 $("#msg0").prepend('<img src="../../images/messages.png" class="nav-menu-img" />');
779 $("#patimg").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
780 $("#repimg").prepend('<img src="../../images/reports.png" class="nav-menu-img" />');
781 $("#feeimg").prepend('<img src="../../images/fee.png" class="nav-menu-img" />');
782 $("#adm0").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
783 $("#invimg").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
784 $("#admimg").prepend('<img src="../../images/admin.png" class="nav-menu-img" />');
785 $("#misimg").prepend('<img src="../../images/misc.png" class="nav-menu-img" />');
786 $("#proimg").prepend('<img src="../../images/procedures.png" class="nav-menu-img" />');
787 $("#navigation-slide > li").each(function(index) {
788 if($(" > ul > li", this).size() == 0){
789 $(" > a", this).addClass("collapsed");
792 }else if(2 == <?php echo $GLOBALS['concurrent_layout'] ?>){
794 //Remove the links (used by the sliding menu) that will break treeview
795 $('a.collapsed').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
796 $('a.collapsed_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
797 $('a.expanded').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
798 $('a.expanded_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
800 // Initiate treeview
801 $("#navigation").treeview({
802 animated: "fast",
803 collapsed: true,
804 unique: <?php echo $GLOBALS['athletic_team'] ? 'false' : 'true' ?>,
805 toggle: function() {
806 window.console && console.log("%o was toggled", this);
812 </script>
814 </head>
816 <body class="body_nav">
818 <form method='post' name='find_patient' target='RTop'
819 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
820 <?php if ( ( $GLOBALS['concurrent_layout'] == 2) || ($GLOBALS['concurrent_layout'] == 3) ) { ?>
821 <center>
822 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:<?php echo $GLOBALS['athletic_team'] ? 47 : 100; ?>%;'>
823 <option value='0'><?php xl('Default','e'); ?></option>
824 <option value='1'><?php xl('Top','e'); ?></option>
825 <option value='2'><?php xl('Bottom','e'); ?></option>
826 </select>
827 <?php if ($GLOBALS['athletic_team']) genPopupsList('width:47%'); ?>
828 </center>
830 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
831 <tr>
832 <td class='smalltext' nowrap>
833 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked />
834 <b><?php xl('Top','e') ?></b>
835 </td>
836 <td class='smalltext' align='right' nowrap>
837 <b><?php xl('Bot','e') ?></b>
838 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php if (empty($GLOBALS['athletic_team'])) echo 'checked '; ?>/>
839 </td>
840 </tr>
841 </table>
843 <?php if ( $GLOBALS['concurrent_layout'] == 3) { ?>
844 <ul id="navigation-slide">
845 <?php } else { // ($GLOBALS['concurrent_layout'] == 2) ?>
846 <ul id="navigation">
847 <?php } ?>
849 <?php if ($GLOBALS['athletic_team']) { // Tree menu for athletic teams ?>
851 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
852 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Patient/Client','e') ?></span></a>
853 <ul>
854 <li class="open"><a class="expanded_lv2"><span><?php xl('Demographics','e') ?></span></a>
855 <ul>
856 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
857 <?php genTreeLink('RTop','dem',xl('Current')); ?>
858 </ul>
859 </li>
860 <li class="open"><a class="collapsed_lv2"><span><?php xl('Medical Records','e') ?></span></a>
861 <ul>
862 <?php // genPopLink (xl('Team Roster'),'players_report.php'); ?>
864 <?php genTreeLink('RTop','ros',xl('Weekly Exposures'),true); ?>
865 <?php genMiscLink('RTop','ros','0',xl('Team Roster'),'reports/old_players_report.php?embed=1',true); ?>
866 <?php if (!$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar'),true); ?>
868 <?php genDualLink('nen','ens',xl('New Consultation')); // with ens on bottom ?>
870 <?php // genDualLink('enc','ens','Current Consultation'); // with ens on bottom ?>
871 <?php genTreeLink('RTop','enc',xl('Current Consultation')); // encounter_top will itself load ens on bottom ?>
873 <?php // genDualLink('dem','ens',xl('Previous Consultations')); // with dem on top ?>
874 <?php genTreeLink('RBot','ens',xl('Previous Consultations'),true); ?>
875 <?php genDualLink('his','ens',xl('Prev Med/Surg Hx')); // with ens on bottom ?>
877 <?php // genTreeLink('RBot','nen',xl('New Allergy')); // nen with Allergy in chief complaint ?>
878 <?php genPopLink(xl('New Allergy'),'../patient_file/summary/add_edit_issue.php?thistype=allergy','xxx1'); ?>
880 <?php genTreeLink('RTop','iss',xl('View/Edit Allergies')); // somehow emphasizing allergies...? ?>
881 <?php genDualLink('iss','ens',xl('Problems/Issues')); // with ens on bottom ?>
882 <?php genDualLink('tra','ens',xl('Transactions/Referrals')); // new transaction form on top and tra list on bottom (or ens if no tra) ?>
883 <?php if (!$GLOBALS['disable_immunizations']) genDualLink('his','imm',xl('Immunizations')); // imm on bottom, his on top ?>
884 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genDualLink('his','pre',xl('Prescriptions')); // pre on bottom, his on top ?>
885 <?php genTreeLink('RTop','doc',xl('Document/Imaging Store'),true); ?>
886 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); ?>
887 <?php genDualLink('dem','pno',xl('Additional Notes')); // with dem on top ?>
888 <li><a href='' onClick="return repPopup('../patient_file/letter.php')" id='prp1'>Letter</a></li>
889 <?php genPopLink(xl('Address Book'),'../usergroup/addrbook_list.php?popup=1'); ?>
890 </ul>
891 </li>
892 </ul>
893 </li>
894 <li class="open"><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
895 <ul>
896 <li class="open"><a class="collapsed_lv2"><span><?php xl('Athletic/Injury','e') ?></span></a>
897 <ul>
898 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); // also appears above ?>
899 <?php genPopLink(xl('Games/Events Missed'),'absences_report.php'); ?>
900 <?php genPopLink(xl('Injury Surveillance'),'football_injury_report.php'); ?>
901 <?php genPopLink(xl('Team Injury Overview'),'injury_overview_report.php'); ?>
902 </ul>
903 </li>
904 <li><a class="collapsed_lv2"><span><?php xl('Patient/Client','e') ?></span></a>
905 <ul>
906 <?php genPopLink(xl('List'),'patient_list.php'); ?>
907 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genPopLink(xl('Prescriptions'),'prescriptions_report.php'); ?>
908 <?php genPopLink(xl('Referrals'),'referrals_report.php'); ?>
909 </ul>
910 </li>
911 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
912 <ul>
913 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appointments'),'appointments_report.php'); ?>
914 <?php genPopLink(xl('Encounters'),'encounters_report.php'); ?>
915 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appt-Enc'),'appt_encounter_report.php'); ?>
916 </ul>
917 </li>
918 <li><a class="collapsed_lv2"><span><?php xl('General','e') ?></span></a>
919 <ul>
920 <?php genPopLink(xl('Services'),'services_by_category.php'); ?>
921 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
922 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
923 </ul>
924 </li>
925 </ul>
926 </li>
927 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
928 <ul>
929 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
930 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
931 </ul>
932 </li>
933 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
934 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
935 <ul>
936 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
937 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
938 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
939 <?php genTreeLink('RTop','pwd','Users Password Change'); ?>
940 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings'); ?>
941 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
942 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
943 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
944 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
945 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
946 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('Re Identification'),'de_identification_forms/re_identification_input_screen.php'); ?>
947 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
948 <ul>
949 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
950 <?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'); ?>
951 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
952 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
953 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
954 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
955 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
956 </ul>
957 </li>
958 </ul>
959 </li>
960 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
961 <ul>
962 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
963 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
964 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
965 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
966 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
967 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
968 </ul>
969 </li>
970 </ul>
972 <?php } else { // not athletic team ?>
974 <?php if (!$GLOBALS['disable_calendar'] && !$GLOBALS['ippf_specific']) genTreeLink('RTop','cal',xl('Calendar')); ?>
975 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
976 <?php if ($GLOBALS['lab_exchange_enable']) genTreeLink('RTop', 'lab', xl('Check Lab Results'));?>
977 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Patient/Client','e') ?></span></a>
978 <ul>
979 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
980 <?php genTreeLink('RTop','dem',xl('Summary')); ?>
981 <li class="open"><a class="expanded_lv2"><span><?php xl('Visits','e') ?></span></a>
982 <ul>
983 <?php if ($GLOBALS['ippf_specific'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar')); ?>
984 <?php genTreeLink('RBot','nen',xl('Create Visit')); ?>
985 <?php genTreeLink('RBot','enc',xl('Current')); ?>
986 <?php genTreeLink('RBot','ens',xl('Visit History')); ?>
987 </ul>
988 </li>
989 <li><a class="collapsed_lv2"><span><?php xl('Visit Forms','e') ?></span></a>
990 <ul>
991 <?php
992 // Generate the items for visit forms, both traditional and LBF.
994 $lres = sqlStatement("SELECT * FROM list_options " .
995 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
996 if (sqlNumRows($lres)) {
997 while ($lrow = sqlFetchArray($lres)) {
998 $option_id = $lrow['option_id']; // should start with LBF
999 $title = $lrow['title'];
1000 genMiscLink('RBot','cod','2',xl_form_title($title),
1001 "patient_file/encounter/load_form.php?formname=$option_id");
1004 include_once("$srcdir/registry.inc");
1005 $reg = getRegistered();
1006 if (!empty($reg)) {
1007 foreach ($reg as $entry) {
1008 $option_id = $entry['directory'];
1009 $title = trim($entry['nickname']);
1010 if ($option_id == 'fee_sheet' ) continue;
1011 if ($option_id == 'newpatient') continue;
1012 if (empty($title)) $title = $entry['name'];
1013 genMiscLink('RBot','cod','2',xl_form_title($title),
1014 "patient_file/encounter/load_form.php?formname=" .
1015 urlencode($option_id));
1019 </ul>
1020 </li>
1021 </ul>
1022 </li>
1023 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
1024 <ul>
1025 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
1026 <?php if ($GLOBALS['use_charges_panel']) genTreeLink('RBot','cod',xl('Charges')); ?>
1027 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
1028 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil',xl('Billing')); ?>
1029 <?php genTreeLink('RTop','npa',xl('Payments'),false,2);?>
1030 </ul>
1031 </li>
1032 <?php // if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
1033 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1034 <li><a class="collapsed" id="invimg" ><span><?php xl('Inventory','e') ?></span></a>
1035 <ul>
1036 <?php genMiscLink('RTop','adm','0',xl('Management'),'drugs/drug_inventory.php'); ?>
1037 <?php genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
1038 </ul>
1039 </li>
1040 <?php } ?>
1041 <li><a class="collapsed" id="proimg" ><span><?php xl('Procedures','e') ?></span></a>
1042 <ul>
1043 <?php genTreeLink('RTop','ort',xl('Configuration')); ?>
1044 <?php genTreeLink('RTop','orp',xl('Pending Review')); ?>
1045 <?php genTreeLink('RTop','orr',xl('Patient Results')); ?>
1046 <?php genTreeLink('RTop','orb',xl('Batch Results')); ?>
1047 </ul>
1048 </li>
1049 <?php if (!$disallowed['adm']) { ?>
1050 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
1051 <ul>
1052 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
1053 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
1054 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
1055 <?php if (acl_check('admin', 'practice' )) genTreeLink('RTop','adb',xl('Addr Book')); ?>
1056 <?php
1057 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1058 if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings&pharmacy&action=list'); ?>
1059 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
1060 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
1061 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
1062 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
1063 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1064 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1065 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
1066 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('Re Identification'),'de_identification_forms/re_identification_input_screen.php'); ?>
1067 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) genMiscLink('RTop','adm','0',xl('Export'),'main/ippf_export.php'); ?>
1068 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
1069 <ul>
1070 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
1071 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1072 <?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'); ?>
1073 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1074 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1075 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1076 </ul>
1077 </li>
1078 </ul>
1079 </li>
1080 <?php } ?>
1081 <li><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
1082 <ul>
1083 <li><a class="collapsed_lv2"><span><?php xl('Clients','e') ?></span></a>
1084 <ul>
1085 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/patient_list.php'); ?>
1086 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genMiscLink('RTop','rep','0',xl('Rx'),'reports/prescriptions_report.php'); ?>
1087 <?php if (acl_check('patients', 'med')) genMiscLink('RTop','rep','0',xl('Clinical'),'reports/clinical_reports.php'); ?>
1088 <?php genMiscLink('RTop','rep','0',xl('Referrals'),'reports/referrals_report.php'); ?>
1089 </ul>
1090 </li>
1091 <li class="open"><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
1092 <ul>
1093 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appointments'),'reports/appointments_report.php'); ?>
1094 <?php genMiscLink('RTop','rep','0',xl('Encounters'),'reports/encounters_report.php'); ?>
1095 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appt-Enc'),'reports/appt_encounter_report.php'); ?>
1096 <?php if (empty($GLOBALS['code_types']['IPPF'])) { ?>
1097 <?php genMiscLink('RTop','rep','0',xl('Superbill'),'reports/custom_report_range.php'); ?>
1098 <?php } ?>
1099 <?php genMiscLink('RTop','rep','0',xl('Eligibility'),'reports/edi_270.php'); ?>
1100 <?php genMiscLink('RTop','rep','0',xl('Eligibility Response'),'reports/edi_271.php'); ?>
1103 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Chart Activity'),'reports/chart_location_activity.php'); ?>
1104 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Charts Out'),'reports/charts_checked_out.php'); ?>
1105 <?php genMiscLink('RTop','rep','0',xl('Services'), 'reports/services_by_category.php'); ?>
1106 <?php genMiscLink('RTop','rep','0',xl('Syndromic Surveillance'),'reports/non_reported.php'); ?>
1107 </ul>
1108 </li>
1109 <?php if (acl_check('acct', 'rep_a')) { ?>
1110 <li><a class="collapsed_lv2"><span><?php xl('Financial','e') ?></span></a>
1111 <ul>
1112 <?php genMiscLink('RTop','rep','0',xl('Sales'),'reports/sales_by_item.php'); ?>
1113 <?php genMiscLink('RTop','rep','0',xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
1114 <?php genMiscLink('RTop','rep','0',xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
1115 <?php genMiscLink('RTop','rep','0',xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
1116 <?php genMiscLink('RTop','rep','0',xl('Collections'), 'reports/collections_report.php'); ?>
1117 </ul>
1118 </li>
1119 <?php } ?>
1120 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
1121 <li><a class="collapsed_lv2"><span><?php xl('Inventory','e') ?></span></a>
1122 <ul>
1123 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/inventory_list.php'); ?>
1124 <?php genMiscLink('RTop','rep','0',xl('Activity'),'reports/inventory_activity.php'); ?>
1125 <?php genMiscLink('RTop','rep','0',xl('Transactions'),'reports/inventory_transactions.php'); ?>
1126 </ul>
1127 </li>
1128 <?php } ?>
1129 <li><a class="collapsed_lv2"><span><?php xl('Procedures','e') ?></span></a>
1130 <ul>
1131 <?php genPopLink(xl('Pending Res'),'../orders/pending_orders.php'); ?>
1132 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink(xl('Pending F/U'),'../orders/pending_followup.php'); ?>
1133 <?php genPopLink(xl('Statistics'),'../orders/procedure_stats.php'); ?>
1134 </ul>
1135 </li>
1136 <?php if (! $GLOBALS['simplified_demographics']) { ?>
1137 <li><a class="collapsed_lv2"><span><?php xl('Insurance','e') ?></span></a>
1138 <ul>
1139 <?php genMiscLink('RTop','rep','0',xl('Distribution'),'reports/insurance_allocation_report.php'); ?>
1140 <?php genMiscLink('RTop','rep','0',xl('Indigents'),'billing/indigent_patients_report.php'); ?>
1141 <?php genMiscLink('RTop','rep','0',xl('Unique SP'),'reports/unique_seen_patients_report.php'); ?>
1142 </ul>
1143 </li>
1144 <?php } ?>
1145 <?php if (!empty($GLOBALS['code_types']['IPPF'])) { ?>
1146 <li><a class="collapsed_lv2"><span><?php xl('Statistics','e') ?></span></a>
1147 <ul>
1148 <?php genPopLink(xl('IPPF Stats'),'ippf_statistics.php?t=i'); ?>
1149 <?php genPopLink(xl('GCAC Stats'),'ippf_statistics.php?t=g'); ?>
1150 <?php genPopLink(xl('MA Stats'),'ippf_statistics.php?t=m'); ?>
1151 <?php genPopLink(xl('CYP'),'ippf_cyp_report.php'); ?>
1152 <?php genPopLink(xl('Daily Record'),'ippf_daily.php'); ?>
1153 </ul>
1154 </li>
1155 <?php } // end ippf-specific ?>
1156 <li><a class="collapsed_lv2"><span><?php xl('Blank Forms','e') ?></span></a>
1157 <ul>
1158 <?php genPopLink(xl('Demographics'),'../patient_file/summary/demographics_print.php'); ?>
1159 <?php genPopLink(xl('Fee Sheet'),'../patient_file/printed_fee_sheet.php'); ?>
1160 <?php genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php'); ?>
1161 <?php
1162 $lres = sqlStatement("SELECT * FROM list_options " .
1163 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1164 while ($lrow = sqlFetchArray($lres)) {
1165 $option_id = $lrow['option_id']; // should start with LBF
1166 $title = $lrow['title'];
1167 genPopLink($title, "../forms/LBF/printable.php?formname=$option_id");
1170 </ul>
1171 </li>
1172 <?php // genTreeLink('RTop','rep','Other'); ?>
1173 </ul>
1174 </li>
1175 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1176 <ul>
1177 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1178 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1179 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1180 <?php genTreeLink('RTop','ort',xl('Order Catalog')); ?>
1181 <?php if (!$GLOBALS['disable_chart_tracker']) genTreeLink('RTop','cht',xl('Chart Tracker')); ?>
1182 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1183 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1184 <?php genTreeLink('RTop','pwd',xl('Password')); ?>
1185 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1186 </ul>
1187 </li>
1188 </ul>
1190 <?php } // end not athletic team ?>
1192 <?php } else { // end ($GLOBALS['concurrent_layout'] == 2 || $GLOBALS['concurrent_layout'] == 3) ?>
1194 <table cellpadding='0' cellspacing='0' border='0'>
1195 <tr>
1196 <td colspan='3'>
1197 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1198 <tr>
1199 <td class='smalltext' nowrap>
1200 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
1201 </td>
1202 <td class='smalltext' align='right' nowrap>
1203 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
1204 </td>
1205 </tr>
1206 </table>
1207 </td>
1208 </tr>
1209 <?php
1210 // Builds the table of radio buttons and their labels. Radio button values
1211 // are comprised of the 3-character document id and the 1-digit usage type,
1212 // so that JavaScript can easily access this information.
1213 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
1214 foreach ($primary_docs as $key => $varr) {
1215 if (!empty($disallowed[$key])) continue;
1216 $label = $varr[0];
1217 $usage = $varr[1];
1218 $url = $varr[2];
1219 echo " <tr>\n";
1220 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
1221 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
1222 if ($key == $default_top_rbid) echo " checked";
1223 echo " /></td>\n";
1224 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
1225 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
1226 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
1227 if ($key == 'msg') echo " checked";
1228 echo " /></td>\n";
1229 echo " </tr>\n";
1232 </table>
1234 <?php } ?>
1236 <br /><hr />
1238 <?php
1239 // To use RelayHealth, see comments and parameters in includes/config.php.
1240 if (!empty($GLOBALS['ssi']['rh'])) {
1241 include_once("../../library/ssi.inc");
1242 echo getRelayHealthLink() ."<br /><hr />\n";
1246 <div id='current_patient' style = 'display:none'>
1247 <b><?php xl('None','e'); ?></b>
1248 </div>
1250 <div id='current_encounter' style = 'display:none'>
1251 <b><?php xl('None','e'); ?></b>
1252 </div>
1254 <?php if (!$GLOBALS['athletic_team']) genPopupsList(); ?>
1256 <hr />
1258 <table cellpadding='0' cellspacing='0' border='0'>
1259 <tr>
1260 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
1261 <td class='smalltext' colspan='2'>
1262 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
1263 </td>
1264 </tr>
1265 <tr>
1266 <td class='smalltext'><?php xl('by','e') ?>:</td>
1267 <td class='smalltext'>
1268 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name','e'); ?></a>
1269 </td>
1270 <td class='smalltext' align='right'>
1271 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID','e'); ?></a>
1272 </td>
1273 </tr>
1274 <tr>
1275 <td class='smalltext'>&nbsp;</td>
1276 <td class='smalltext'>
1277 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN','e'); ?></a>
1278 </td>
1279 <td class='smalltext' align='right'>
1280 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB','e'); ?></a>
1281 </td>
1282 </tr>
1284 <tr>
1285 <td class='smalltext'>&nbsp;</td>
1286 <td class='smalltext'>
1287 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
1288 </td>
1289 <td class='smalltext' align='right'>
1290 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
1291 </td>
1292 </tr>
1294 </table>
1296 <hr />
1297 <?php if (!empty($GLOBALS['online_support_link'])) { ?>
1298 <a href='<?php echo $GLOBALS["online_support_link"]; ?>' target="_blank" id="support_link" class='css_button' onClick="top.restoreSession()"><span><?php xl('Online Support','e'); ?></span></a>
1299 <?php } ?>
1301 <input type='hidden' name='findBy' value='Last' />
1302 <input type="hidden" name="searchFields" id="searchFields"/>
1303 <input type="hidden" name="search_service_code" value='' />
1305 </form>
1307 <script language='JavaScript'>
1308 <?php if ($GLOBALS['concurrent_layout'] < 3) { ?>
1309 syncRadios();
1310 <?php } ?>
1311 </script>
1313 </body>
1314 </html>