fix for pharmacy dispensory to work with correct Pharmacy Dispensary aco
[openemr.git] / interface / main / left_nav.php
blob7860c29fa8e3262332c9cda125ae781c1dff597a
1 <?php
2 use ESign\Api;
3 /* Copyright (C) 2006-2012 Rod Roark <rod@sunsetsystems.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 */
11 // This provides the left navigation frame when $GLOBALS['concurrent_layout']
12 // is true. Following are notes as to what else was changed for this feature:
14 // * interface/main/main_screen.php: the top-level frameset.
15 // * interface/main/finder/patient_select.php: loads stuff when a new patient
16 // is selected.
17 // * interface/patient_file/summary/demographics.php: this is the first frame
18 // loaded when a new patient is chosen, and in turn sets the current pid and
19 // then loads the initial bottom frame.
20 // * interface/patient_file/summary/demographics_full.php: added support for
21 // setting a new pid, needed for going to demographics from billing.
22 // * interface/patient_file/summary/demographics_save.php: redisplay
23 // demographics.php and not the frameset.
24 // * interface/patient_file/summary/summary_bottom.php: new frameset for the
25 // summary, prescriptions and notes for a selected patient, cloned from
26 // patient_summary.php.
27 // * interface/patient_file/encounter/encounter_bottom.php: new frameset for
28 // the selected encounter, mosting coding/billing stuff, cloned from
29 // patient_encounter.php. This will also self-load the superbill pages
30 // as requested.
31 // * interface/usergroup/user_info.php: removed Back link.
32 // * interface/usergroup/admin_frameset.php: new frameset for Admin pages,
33 // cloned from usergroup.php.
34 // * interface/main/onotes/office_comments.php: removed Back link target.
35 // * interface/main/onotes/office_comments_full.php: changed Back link.
36 // * interface/billing/billing_report.php: removed Back link; added logic
37 // to properly go to demographics or to an encounter when requested.
38 // * interface/new/new.php: removed Back link and revised form target.
39 // * interface/new/new_patient_save.php: modified to load the demographics
40 // page to the current frame instead of loading a new frameset.
41 // * interface/patient_file/history/history.php: target change.
42 // * interface/patient_file/history/history_full.php: target changes.
43 // * interface/patient_file/history/history_save.php: target change.
44 // * interface/patient_file/history/encounters.php: link/target changes.
45 // * interface/patient_file/encounter/encounter_top.php: another new frameset
46 // cloned from patient_encounter.php.
47 // * interface/patient_file/encounter/forms.php: link target removal.
48 // * interface/patient_file/encounter/new_form.php: target change.
49 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
50 // changes.
51 // * interface/patient_file/summary/immunizations.php: removed back link.
52 // * interface/patient_file/summary/pnotes.php: changed link targets.
53 // * interface/patient_file/summary/pnotes_full.php: changed back link and
54 // added set_pid logic.
55 // * interface/patient_file/transaction/transactions.php: various changes.
56 // * interface/patient_file/transaction/add_transaction.php: new return js.
57 // * interface/patient_file/encounter/superbill_codes.php: target and link
58 // changes.
59 // * interface/patient_file/encounter/superbill_custom_full.php: target and
60 // link changes.
61 // * interface/patient_file/encounter/diagnosis.php: target changes.
62 // * interface/patient_file/encounter/diagnosis_full.php: target and link
63 // changes.
64 // * interface/main/authorizations/authorizations.php: link and target changes.
65 // * library/api.inc: url change.
66 // * interface/patient_file/summary/rx_frameset.php: new frameset.
67 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
68 // * all encounter forms: remove all instances of "target=Main" and change
69 // all instances of "patient_encounter.php" to "encounter_top.php".
71 // Our find_patient form, when submitted, invokes patient_select.php in the
72 // upper frame. When the patient is selected, demographics.php is invoked
73 // with the set_pid parameter, which establishes the new session pid and also
74 // calls the setPatient() function (below). In this case demographics.php
75 // will also load the summary frameset into the bottom frame, invoking our
76 // loadFrame() and setRadio() functions.
78 // Similarly, we have the concept of selecting an encounter from the
79 // Encounters list, and then having that "stick" until some other encounter
80 // or a new encounter is chosen. We also have a navigation item for creating
81 // a new encounter. interface/patient_file/encounter/encounter_top.php
82 // supports set_encounter to establish an encounter.
84 // TBD: Include active_pid and/or active_encounter in relevant submitted
85 // form data, and add logic to the save routines to make sure they match
86 // the corresponding session values.
88 require_once("../globals.php");
89 require_once($GLOBALS['fileroot']."/library/acl.inc");
90 require_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
91 require_once($GLOBALS['fileroot']."/library/patient.inc");
92 require_once($GLOBALS['fileroot']."/library/lists.inc");
93 require_once $GLOBALS['srcdir'].'/ESign/Api.php';
95 // This array defines the list of primary documents that may be
96 // chosen. Each element value is an array of 3 values:
98 // * Name to appear in the navigation table
99 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific
100 // * The URL relative to the interface directory
103 $primary_docs = array(
104 'ros' => array(xl('Roster') , 0, 'reports/players_report.php?embed=1'),
105 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
106 'app' => array(xl('Portal Activity') , 0, '../myportal/index.php'),
107 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php?form_active=1'),
108 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
109 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
110 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
111 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
112 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
113 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
114 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
115 'orl' => array(xl('Proc Prov') , 0, 'orders/procedure_provider_list.php'),
116 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
117 'orc' => array(xl('Proc Load') , 0, 'orders/load_compendium.php'),
118 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
119 'ore' => array(xl('E-Reports') , 0, 'orders/list_reports.php'),
120 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
121 'imp' => array(xl('Import') , 0, '../custom/import.php'),
122 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
123 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
124 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
125 'new' => array(xl('New Pt') , 0, 'new/new.php'),
126 'ped' => array(xl('Patient Education'), 0, 'reports/patient_edu_web_lookup.php'),
127 'lab' => array(xl('Check Lab Results') , 0, 'orders/lab_exchange.php'),
128 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
129 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
130 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
131 'nen' => array(xl('Create Visit'), 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
132 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
133 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
134 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
135 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
136 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
137 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
138 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
139 'prq' => array(xl('Pt Rec Request') , 1, 'patient_file/transaction/record_request.php'),
140 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
141 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
142 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
143 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
144 'erx' => array(xl('e-Rx') , 1, 'eRx.php'),
145 'err' => array(xl('e-Rx Renewal') , 1, 'eRx.php?page=status'),
146 'pay' => array(xl('Payment') , 1, '../patient_file/front_payment.php'),
147 'edi' => array(xl('EDI History') , 0, 'billing/edih_view.php')
149 $primary_docs['npa']=array(xl('Batch Payments') , 0, 'billing/new_payment.php');
150 if ($GLOBALS['use_charges_panel'] || $GLOBALS['concurrent_layout'] == 2) {
151 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
154 $esignApi = new Api();
155 // This section decides which navigation items will not appear.
157 $disallowed = array();
158 $disallowed['edi'] = !($GLOBALS['enable_edihistory_in_left_menu'] || acl_check('acct', 'eob'));
159 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
160 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
161 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
162 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
163 acl_check('admin', 'superbill') || acl_check('admin', 'drugs'));
165 $disallowed['bil'] = !(acl_check('acct', 'rep') || acl_check('acct', 'eob') ||
166 acl_check('acct', 'bill'));
168 $disallowed['new'] = !(acl_check('patients','demo','',array('write','addonly') ));
170 $disallowed['fax'] = !($GLOBALS['enable_hylafax'] || $GLOBALS['enable_scanner']);
172 $disallowed['ros'] = !$GLOBALS['athletic_team'];
174 $disallowed['iss'] = !((acl_check('encounters','notes','','write') ||
175 acl_check('encounters','notes_a','','write') ) &&
176 acl_check('patients','med','','write') );
178 $disallowed['imp'] = $disallowed['new'] ||
179 !is_readable("$webserver_root/custom/import.php");
181 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
183 $disallowed['pre'] = !(acl_check('patients', 'med'));
185 // Helper functions for treeview generation.
186 function genTreeLink($frame, $name, $title, $mono=false) {
187 global $primary_docs, $disallowed;
188 if (empty($disallowed[$name])) {
189 $id = $name . $primary_docs[$name][1];
190 echo "<li><a href='' id='$id' onclick=\"";
191 if ($mono) {
192 if ($frame == 'RTop')
193 echo "forceSpec(true,false);";
194 else
195 echo "forceSpec(false,true);";
197 echo "return loadFrame2('$id','$frame','" .
198 $primary_docs[$name][2] . "')\">" . $title . ($name == 'msg' ? ' <span id="reminderCountSpan" class="bold"></span>' : '')."</a></li>";
201 function genMiscLink($frame, $name, $level, $title, $url, $mono=false) {
202 global $disallowed;
203 if (empty($disallowed[$name])) {
204 $id = $name . $level;
205 echo "<li><a href='' id='$id' onclick=\"";
206 if ($mono) {
207 if ($frame == 'RTop')
208 echo "forceSpec(true,false);";
209 else
210 echo "forceSpec(false,true);";
212 echo "return loadFrame2('$id','$frame','" .
213 $url . "')\">" . $title . "</a></li>";
216 function genPopLink($title, $url, $linkid='') {
217 echo "<li><a href='' ";
218 if ($linkid) echo "id='$linkid' ";
219 echo "onclick=\"return repPopup('$url')\"" .
220 ">" . $title . "</a></li>";
222 function genDualLink($topname, $botname, $title) {
223 global $primary_docs, $disallowed;
224 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
225 $topid = $topname . $primary_docs[$topname][1];
226 $botid = $botname . $primary_docs[$botname][1];
227 echo "<li><a href='' id='$topid' " .
228 "onclick=\"return loadFrameDual('$topid','$botid','" .
229 $primary_docs[$topname][2] . "','" .
230 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
234 function genPopupsList($style='') {
235 global $disallowed, $webserver_root;
237 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
238 <option value=''><?php xl('Popups','e'); ?></option>
239 <?php if (!$disallowed['iss']) { ?>
240 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
241 <?php } ?>
242 <?php if (!$GLOBALS['ippf_specific']) { ?>
243 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
244 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
245 <?php } ?>
246 <?php if ($GLOBALS['athletic_team']) { ?>
247 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
248 <?php } ;
249 if (!$GLOBALS['disable_calendar']) { ?>
250 <option value='../reports/appointments_report.php?patient=<?php if(isset($pid)) {echo $pid;} ?>'><?php xl('Appts','e'); ?></option>
251 <?php } ;
252 if (file_exists("$webserver_root/custom/refer.php")) { ?>
253 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
254 <?php } ?>
255 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill','e'); ?></option>
256 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
257 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
258 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
259 <?php } ?>
260 <?php if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates")) { ?>
261 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
262 <?php } ?>
263 </select>
264 <?php
267 function genFindBlock() {
269 <table cellpadding='0' cellspacing='0' border='0'>
270 <tr>
271 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
272 <td class='smalltext' colspan='2'>
273 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
274 </td>
275 </tr>
276 <tr>
277 <td class='smalltext'><?php xl('by','e') ?>:</td>
278 <td class='smalltext'>
279 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name','e'); ?></a>
280 </td>
281 <td class='smalltext' align='right'>
282 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID','e'); ?></a>
283 </td>
284 </tr>
285 <tr>
286 <td class='smalltext'>&nbsp;</td>
287 <td class='smalltext'>
288 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN','e'); ?></a>
289 </td>
290 <td class='smalltext' align='right'>
291 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB','e'); ?></a>
292 </td>
293 </tr>
294 <tr>
295 <td class='smalltext'>&nbsp;</td>
296 <td class='smalltext'>
297 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
298 </td>
299 <td class='smalltext' align='right'>
300 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
301 </td>
302 </tr>
303 </table>
304 <?php
305 } // End function genFindBlock()
308 <html>
309 <head>
310 <title>Navigation</title>
311 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
313 <style type="text/css">
314 body {
315 font-size:8pt;
316 font-weight:normal;
317 padding: 5px 3px 5px 3px;
319 .smalltext {
320 font-family:sans-serif;
321 font-size:8pt;
322 font-weight:normal;
324 a.navitem, a.navitem:visited {
325 color:#0000ff;
326 font-family:sans-serif;
327 font-size:8pt;
328 font-weight:bold;
330 .inputtext {
331 font-size:9pt;
332 font-weight:normal;
333 border-style:solid;
334 border-width:1px;
335 padding-left:2px;
336 padding-right:2px;
337 border-color: #000000;
338 background-color:transparent;
341 #navigation ul {
342 background-color:transparent;
344 #navigation-slide ul {
345 background-color:transparent;
347 #navigation-slide a{
348 width: 92%;
350 .nav-menu-img{
351 width:25px;
352 height:25px;
353 border:none;
354 margin-right:5px;
355 vertical-align:middle;
357 </style>
359 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.4.1/jquery.treeview.css" />
360 <script src="../../library/js/jquery-1.6.4.min.js" type="text/javascript"></script>
361 <script src="../../library/js/jquery.treeview-1.4.1/jquery.treeview.js" type="text/javascript"></script>
363 <script type="text/javascript" src="../../library/dialog.js"></script>
365 <script language='JavaScript'>
367 // tajemo work by CB 2012/01/31 12:32:57 PM dated reminders counter
368 function getReminderCount(){
369 top.restoreSession();
370 // Send the skip_timeout_reset parameter to not count this as a manual entry in the
371 // timing out mechanism in OpenEMR.
372 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/dated_reminders_counter.php",
373 { skip_timeout_reset: "1" },
374 function(data) {
375 $("#reminderCountSpan").html(data);
376 // run updater every 60 seconds
377 var repeater = setTimeout("getReminderCount()", 60000);
379 //piggy-back on this repeater to run other background-services
380 //this is a silent task manager that returns no output
381 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/execute_background_services.php",
382 { skip_timeout_reset: "1", ajax: "1" });
385 $(document).ready(function (){
386 getReminderCount();//
387 parent.loadedFrameCount += 1;
389 // end of tajemo work dated reminders counter
391 // Master values for current pid and encounter.
392 var active_pid = 0;
393 var active_encounter = 0;
394 var encounter_locked = false;
396 // Current selections in the top and bottom frames.
397 var topName = '';
398 var botName = '';
400 // Expand and/or collapse frames in response to checkbox clicks.
401 // fnum indicates which checkbox was clicked (1=left, 2=right).
402 function toggleFrame(fnum) {
403 var f = document.forms[0];
404 var fset = top.document.getElementById('fsright');
405 if (!f.cb_top.checked && !f.cb_bot.checked) {
406 if (fnum == 1) f.cb_bot.checked = true;
407 else f.cb_top.checked = true;
409 var rows = f.cb_top.checked ? '*' : '0';
410 rows += f.cb_bot.checked ? ',*' : ',0';
411 fset.rows = rows;
412 fset.rows = rows;
415 // Load the specified url into the specified frame (RTop or RBot).
416 // The URL provided must be relative to interface.
417 function loadFrame(fname, frame, url) {
418 top.restoreSession();
419 var i = url.indexOf('{PID}');
420 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
421 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
422 if (frame == 'RTop') topName = fname; else botName = fname;
425 // Load the specified url into a frame to be determined, with the specified
426 // frame as the default; the url must be relative to interface.
427 function loadFrame2(fname, frame, url) {
428 var usage = fname.substring(3);
429 if (active_pid == 0 && usage > '0') {
430 alert('<?php xl('You must first select or add a patient.','e') ?>');
431 return false;
433 if (active_encounter == 0 && usage > '1') {
434 alert('<?php xl('You must first select or create an encounter.','e') ?>');
435 return false;
437 if (encounter_locked && usage > '1') {
438 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
439 return false;
441 var f = document.forms[0];
442 top.restoreSession();
443 var i = url.indexOf('{PID}');
444 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
445 if(f.sel_frame)
447 var fi = f.sel_frame.selectedIndex;
448 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
450 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
451 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
452 if (frame == 'RTop') topName = fname; else botName = fname;
453 return false;
456 // Make sure the the top and bottom frames are open or closed, as specified.
457 function forceSpec(istop, isbot) {
458 var f = document.forms[0];
459 if (f.cb_top.checked != istop) {
460 f.cb_top.checked = istop;
461 toggleFrame(1);
463 if (f.cb_bot.checked != isbot) {
464 f.cb_bot.checked = isbot;
465 toggleFrame(2);
469 // Make sure both frames are open.
470 function forceDual() {
471 forceSpec(true, true);
474 // Load the specified url into a frame to be determined, with the specified
475 // frame as the default; the url must be relative to interface.
476 function loadFrameDual(tname, bname, topurl, boturl) {
477 var topusage = tname.substring(3);
478 var botusage = bname.substring(3);
479 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
480 alert('<?php xl('You must first select or add a patient.','e') ?>');
481 return false;
483 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
484 alert('<?php xl('You must first select or create an encounter.','e') ?>');
485 return false;
487 if (encounter_locked && (topusage > '1' || botusage > '1')) {
488 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
489 return false;
491 var f = document.forms[0];
492 forceDual();
493 top.restoreSession();
494 var i = topurl.indexOf('{PID}');
495 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
496 i = boturl.indexOf('{PID}');
497 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
498 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
499 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
500 topName = tname;
501 botName = bname;
502 return false;
505 // Select a designated radio button. raname may be either the radio button
506 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
507 // You should call this if you directly load a document that does not
508 // correspond to the current radio button setting.
509 function setRadio(raname, rbid) {
510 <?php if ($GLOBALS['concurrent_layout'] < 2) { ?>
511 var f = document.forms[0];
512 if (raname == 'RTop') raname = 'rb_top';
513 if (raname == 'RBot') raname = 'rb_bot';
514 for (var i = 0; i < f[raname].length; ++i) {
515 if (f[raname][i].value.substring(0,3) == rbid) {
516 f[raname][i].checked = true;
517 return true;
520 <?php } ?>
521 return false;
524 // Set disabled/enabled state of radio buttons and associated labels
525 // depending on whether there is an active patient or encounter.
526 function syncRadios() {
527 var f = document.forms[0];
528 encounter_locked = isEncounterLocked(active_encounter);
529 <?php if (($GLOBALS['concurrent_layout'] == 2)||($GLOBALS['concurrent_layout'] == 3)) { ?>
530 var nlinks = document.links.length;
531 for (var i = 0; i < nlinks; ++i) {
532 var lnk = document.links[i];
533 if (lnk.id.length != 4) continue;
534 var usage = lnk.id.substring(3);
535 if (usage == '1' || usage == '2') {
536 var da = false;
537 if (active_pid == 0) da = true;
538 if (active_encounter == 0 && usage > '1') da = true;
539 if (encounter_locked && usage > '1') da = true;
540 <?php
541 if ($GLOBALS['concurrent_layout'] == 2){
542 $color = "'#0000ff'";
543 }else{
544 $color = "'#000000'";
547 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
550 <?php } else if ($GLOBALS['concurrent_layout'] < 2) { ?>
551 for (var i = 0; i < f.rb_top.length; ++i) {
552 var da = false;
553 var rb1 = f.rb_top[i];
554 var rb2 = f.rb_bot[i];
555 var rbid = rb1.value.substring(0,3);
556 var usage = rb1.value.substring(3);
557 if (active_pid == 0 && usage > '0') da = true;
558 if (active_encounter == 0 && usage > '1') da = true;
559 if (encounter_locked && usage > '1') da = true;
560 // daemon_frame can also set special label colors, so don't mess with
561 // them unless we have to.
562 if (rb1.disabled != da) {
563 rb1.disabled = da;
564 rb2.disabled = da;
565 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
568 <?php } ?>
569 f.popups.disabled = (active_pid == 0);
572 function goHome() {
573 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
574 top.frames['RBot'].location='messages/messages.php?form_active=1';
577 //Function to clear active patient and encounter in the server side
578 function clearactive() {
579 top.restoreSession();
580 //Ajax call to clear active patient in session
581 $.ajax({
582 type: "POST",
583 url: "<?php echo $GLOBALS['webroot'] ?>/library/ajax/unset_session_ajax.php",
584 data: { func: "unset_pid"},
585 success:function( msg ) {
586 clearPatient();
587 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
588 top.frames['RBot'].location='messages/messages.php?form_active=1';
592 $(parent.Title.document.getElementById('clear_active')).hide();
594 // Reference to the search.php window.
595 var my_window;
597 // Open the search.php window.
598 function initFilter() {
599 my_window = window.open("../../custom/search.php", "mywindow","status=1");
602 // This is called by the search.php (Filter) window.
603 function processFilter(fieldString, serviceCode) {
604 var f = document.forms[0];
605 document.getElementById('searchFields').value = fieldString;
606 f.search_service_code.value = serviceCode;
607 findPatient("Filter");
608 f.search_service_code.value = '';
609 my_window.close();
612 // Process the click to find a patient by name, id, ssn or dob.
613 function findPatient(findby) {
614 var f = document.forms[0];
615 if (! f.cb_top.checked) {
616 f.cb_top.checked = true;
617 toggleFrame(1);
619 f.findBy.value = findby;
620 setRadio('rb_top', 'dem');
621 top.restoreSession();
622 document.find_patient.submit();
625 // Helper function to set the contents of a div.
626 function setSomeContent(id, content, doc) {
627 if (doc.getElementById) {
628 var x = doc.getElementById(id);
629 x.innerHTML = '';
630 x.innerHTML = content;
632 else if (doc.all) {
633 var x = doc.all[id];
634 x.innerHTML = content;
637 function setDivContent(id, content) {
638 setSomeContent(id, content, document);
640 function setTitleContent(id, content) {
641 setSomeContent(id, content, parent.Title.document);
644 // This is called automatically when a new patient is set, to make sure
645 // there are no patient-specific documents showing stale data. If a frame
646 // was just loaded with data for the correct patient, its name is passed so
647 // that it will not be zapped. At this point the new server-side pid is not
648 // assumed to be set, so this function will only load global data.
649 function reloadPatient(frname) {
650 var f = document.forms[0];
651 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
652 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
653 setRadio('rb_top', 'cal');
655 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
656 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
657 setRadio('rb_bot', 'ens');
661 // Reload encounter-specific frames, excluding a specified frame. At this
662 // point the new server-side encounter ID may not be set and loading the same
663 // document for the new encounter will not work, so load patient info instead.
664 function reloadEncounter(frname) {
665 var f = document.forms[0];
666 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
667 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
668 setRadio('rb_top', 'dem');
670 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
671 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
672 setRadio('rb_bot', 'ens');
676 // Clear and reload issue-related menu items for active_pid.
677 // Currently this only applies to athletic teams, but might be implemented
678 // in the general menu at some future time.
680 function reloadIssues() {
681 <?php
682 if ($GLOBALS['athletic_team']) {
683 // Generates a menu item for each active issue that this patient
684 // has of each issue type. Each one looks like this:
685 // Onset-Date [Add] Issue-Title
686 // where the first part is a link to open the issue dialog,
687 // [Add] is a link that auto-creates and opens a new encounter, and
688 // Issue-Title is a link that shows related encounters.
689 foreach ($ISSUE_TYPES as $key => $value) {
691 $('#icontainer_<?php echo $key ?>').empty();
692 if (active_pid != 0) {
693 $('#icontainer_<?php echo $key ?>').append("<li>" +
694 "<a href='' id='xxx1' onclick='return repPopup(" +
695 "\"../patient_file/summary/add_edit_issue.php?thistype=" +
696 "<?php echo $key; ?>\")' " +
697 "title='<?php echo xl('Create new issue'); ?>'>" +
698 "<?php echo xl('New') . " " . $value[1]; ?></a></li>");
699 top.restoreSession();
700 $.getScript('../../library/ajax/left_nav_issues_ajax.php?type=<?php echo $key; ?>');
702 <?php
706 } // end function reloadIssues
708 // This is referenced in left_nav_issues_ajax.php and is called when [Add]
709 // is clicked for an issue menu item to add a new encounter for the issue.
710 // So far this only applies to the Athletic Team version of the menu.
712 function addEncNotes(issue) {
714 // top.restoreSession();
715 // $.getScript('../../library/ajax/left_nav_encounter_ajax.php?createvisit=1&issue=' + issue);
717 // The above AJAX call was to create the encounter right away, but we later
718 // (2012-07-03) decided it's better to present the New Encounter form instead.
719 // Note the issue ID is passed so it will be pre-selected in that form.
720 loadFrame2('nen1','RBot','forms/newpatient/new.php?autoloaded=1&calenc=&issue=' + issue);
722 return false;
725 // Call this to announce that the patient has changed. You must call this
726 // if you change the session PID, so that the navigation frame will show the
727 // correct patient and so that the other frame will be reloaded if it contains
728 // patient-specific information from the previous patient. frname is the name
729 // of the frame that the call came from, so we know to only reload content
730 // from the *other* frame if it is patient-specific.
731 function setPatient(pname, pid, pubpid, frname, str_dob) {
732 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
733 setDivContent('current_patient', str);
734 setTitleContent('current_patient', str + str_dob);
735 if (pid == active_pid) return;
736 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
737 active_pid = pid;
738 active_encounter = 0;
739 encounter_locked = false;
740 if (frname) reloadPatient(frname);
741 syncRadios();
742 $(parent.Title.document.getElementById('current_patient_block')).show();
743 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
744 $(encounter_block).hide();
746 // zero out the encounter frame, replace it with the encounter list frame
747 var f = document.forms[0];
748 if ( f.cb_top.checked && f.cb_bot.checked ) {
749 var encounter_frame = getEncounterTargetFrame('enc');
750 if ( encounter_frame != undefined ) {
751 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
752 setRadio(encounter_frame, 'ens');
756 reloadIssues(pid);
757 $(parent.Title.document.getElementById('clear_active')).show();//To display Clear Active Patient button on selecting a patient
759 function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) {
760 //This function lists all encounters of the patient.
761 //This function writes the drop down in the top frame.
762 //It is called when a new patient is create/selected from the search menu.
763 var str = '<Select class="text" id="EncounterHistory" onchange="{top.restoreSession();toencounter(this.options[this.selectedIndex].value)}">';
764 str+='<option value=""><?php echo htmlspecialchars( xl('Encounter History'), ENT_QUOTES) ?></option>';
765 str+='<option value="New Encounter"><?php echo htmlspecialchars( xl('New Encounter'), ENT_QUOTES) ?></option>';
766 str+='<option value="Past Encounter List"><?php echo htmlspecialchars( xl('Past Encounter List'), ENT_QUOTES) ?></option>';
767 for(CountEncounter=0;CountEncounter<EncounterDateArray.length;CountEncounter++)
769 str+='<option value="'+EncounterIdArray[CountEncounter]+'~'+EncounterDateArray[CountEncounter]+'">'+EncounterDateArray[CountEncounter]+'-'+CalendarCategoryArray[CountEncounter]+'</option>';
771 str+='</Select>';
772 $(parent.Title.document.getElementById('past_encounter_block')).show();
773 top.window.parent.Title.document.getElementById('past_encounter').innerHTML=str;
776 function loadCurrentPatientFromTitle() {
777 top.restoreSession();
778 top.frames['RTop'].location='../patient_file/summary/demographics.php';
781 function getEncounterTargetFrame( name ) {
782 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
783 var f = document.forms[0];
784 var r = 'RTop';
785 if (f.cb_top.checked && f.cb_bot.checked) {
786 if ( bias == 2 ) {
787 r = 'RBot';
788 } else {
789 r = 'RTop';
791 } else {
792 if ( f.cb_top.checked ) {
793 r = 'RTop';
794 } else if ( f.cb_bot.checked ) {
795 r = 'RBot';
798 return r;
800 function isEncounterLocked( encounterId ) {
801 <?php if ( $esignApi->lockEncounters() ) { ?>
802 // If encounter locking is enabled, make a syncronous call (async=false) to check the
803 // DB to see if the encounter is locked.
804 // Call restore session, just in case
805 top.restoreSession();
806 $.ajax({
807 type: 'POST',
808 url: '<?php echo $GLOBALS['webroot']?>/interface/esign/index.php?module=encounter&method=esign_is_encounter_locked',
809 data: { encounterId : encounterId },
810 success: function( data ) {
811 encounter_locked = data;
813 dataType: 'json',
814 async:false
815 });
816 return encounter_locked;
817 <?php } else { ?>
818 // If encounter locking isn't enabled, just tell the left_nav that the encounter
819 // isn't locked.
820 return false;
821 <?php } ?>
823 // Call this to announce that the encounter has changed. You must call this
824 // if you change the session encounter, so that the navigation frame will
825 // show the correct encounter and so that the other frame will be reloaded if
826 // it contains encounter-specific information from the previous encounter.
827 // frname is the name of the frame that the call came from, so we know to only
828 // reload encounter-specific content from the *other* frame.
829 function setEncounter(edate, eid, frname) {
830 if (eid == active_encounter) return;
831 if (!eid) edate = '<?php xl('None','e'); ?>';
832 var str = '<b>' + edate + '</b>';
833 setDivContent('current_encounter', str);
834 active_encounter = eid;
835 encounter_locked=isEncounterLocked(active_encounter);
836 reloadEncounter(frname);
837 syncRadios();
838 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
839 var encounter = $(parent.Title.document.getElementById('current_encounter'));
840 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
841 encounter.html( estr );
842 encounter_block.show();
845 function loadCurrentEncounterFromTitle() {
846 top.restoreSession();
847 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/encounter_top.php';
850 // You must call this if you delete the active patient (or if for any other
851 // reason you "close" the active patient without opening a new one), so that
852 // the appearance of the navigation frame will be correct and so that any
853 // stale content will be reloaded.
854 function clearPatient() {
855 if (active_pid == 0) return;
856 var f = document.forms[0];
857 active_pid = 0;
858 active_encounter = 0;
859 encounter_locked = false;
860 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
861 $(parent.Title.document.getElementById('current_patient_block')).hide();
862 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
863 $(parent.Title.document.getElementById('current_encounter_block')).hide();
864 reloadPatient('');
865 syncRadios();
868 // You must call this if you delete the active encounter (or if for any other
869 // reason you "close" the active encounter without opening a new one), so that
870 // the appearance of the navigation frame will be correct and so that any
871 // stale content will be reloaded.
872 function clearEncounter() {
873 if (active_encounter == 0) return;
874 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
875 active_encounter = 0;
876 encounter_locked = false;
877 reloadEncounter('');
878 syncRadios();
880 function removeOptionSelected(EncounterId)
881 {//Removes an item from the Encounter drop down.
882 var elSel = top.window.parent.Title.document.getElementById('EncounterHistory');
883 var i;
884 for (i = elSel.length - 1; i>=2; i--) {
885 EncounterHistoryValue=elSel.options[i].value;
886 EncounterHistoryValueArray=EncounterHistoryValue.split('~');
887 if (EncounterHistoryValueArray[0]==EncounterId) {
888 elSel.remove(i);
893 // You can call this to make sure the session pid is what we expect.
894 function pidSanityCheck(pid) {
895 if (pid != active_pid) {
896 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
897 '. This session is unstable and should be abandoned. Do not use ' +
898 'OpenEMR in multiple browser windows!');
899 return false;
901 return true;
904 // You can call this to make sure the session encounter is what we expect.
905 function encounterSanityCheck(eid) {
906 if (eid != active_encounter) {
907 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
908 '. This session is unstable and should be abandoned. Do not use ' +
909 'OpenEMR in multiple browser windows!');
910 return false;
912 return true;
915 // Pop up a report.
916 function repPopup(aurl) {
917 top.restoreSession();
918 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
919 return false;
922 // This is invoked to pop up some window when a popup item is selected.
923 function selpopup(selobj) {
924 var i = selobj.selectedIndex;
925 var opt = selobj.options[i];
926 if (i > 0) {
927 var width = 750;
928 var height = 550;
929 if (opt.text == 'Export' || opt.text == 'Import') {
930 width = 500;
931 height = 400;
933 else if (opt.text == 'Refer') {
934 width = 700;
935 height = 500;
937 dlgopen(opt.value, '_blank', width, height);
939 selobj.selectedIndex = 0;
941 // Treeview activation stuff:
942 $(document).ready(function(){
943 if(3 == <?php echo $GLOBALS['concurrent_layout'] ?>){
944 $("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
945 $("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
946 $("#navigation-slide > li > a.expanded").click(function() {
947 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
948 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
950 $("#navigation-slide > li > a.collapsed").click(function() {
951 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
952 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
954 $("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
955 $("#navigation-slide > li > a.expanded").next("ul").find("li > a.expanded_lv2").not(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
956 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
958 $("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
959 $("#navigation-slide > li > a.expanded").next("ul").find("li > a.expanded_lv2").not(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
960 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
962 $("#navigation-slide > li > a#cal0").prepend('<img src="../../images/calendar.png" class="nav-menu-img" />');
963 $("#navigation-slide > li > a#msg0").prepend('<img src="../../images/messages.png" class="nav-menu-img" />');
964 $("#navigation-slide > li > a#patimg").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
965 $("#navigation-slide > li > a#app0").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
966 $("#navigation-slide > li > a#repimg").prepend('<img src="../../images/reports.png" class="nav-menu-img" />');
967 $("#navigation-slide > li > a#feeimg").prepend('<img src="../../images/fee.png" class="nav-menu-img" />');
968 $("#navigation-slide > li > a#adm0").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
969 $("#navigation-slide > li > a#invimg").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
970 $("#navigation-slide > li > a#admimg").prepend('<img src="../../images/admin.png" class="nav-menu-img" />');
971 $("#navigation-slide > li > a#misimg").prepend('<img src="../../images/misc.png" class="nav-menu-img" />');
972 $("#navigation-slide > li > a#proimg").prepend('<img src="../../images/procedures.png" class="nav-menu-img" />');
973 $("#navigation-slide > li").each(function(index) {
974 if($(" > ul > li", this).size() == 0){
975 $(" > a", this).addClass("collapsed");
978 }else if(2 == <?php echo $GLOBALS['concurrent_layout'] ?>){
980 //Remove the links (used by the sliding menu) that will break treeview
981 $('a.collapsed').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
982 $('a.collapsed_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
983 $('a.expanded').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
984 $('a.expanded_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
986 // Initiate treeview
987 $("#navigation").treeview({
988 animated: "fast",
989 collapsed: true,
990 unique: <?php echo $GLOBALS['athletic_team'] ? 'false' : 'true' ?>,
991 toggle: function() {
992 window.console && console.log("%o was toggled", this);
998 </script>
1000 </head>
1002 <body class="body_nav">
1004 <form method='post' name='find_patient' target='RTop'
1005 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
1007 <?php
1008 // Find widget is at the top for the athletic team layout.
1009 if ($GLOBALS['athletic_team']) {
1010 genFindBlock();
1011 echo "<hr />\n";
1015 <?php if ( ( $GLOBALS['concurrent_layout'] == 2) || ($GLOBALS['concurrent_layout'] == 3) ) { ?>
1016 <center>
1017 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:<?php echo $GLOBALS['athletic_team'] ? 47 : 100; ?>%;'>
1018 <option value='0'><?php xl('Default','e'); ?></option>
1019 <option value='1'><?php xl('Top','e'); ?></option>
1020 <option value='2'><?php xl('Bottom','e'); ?></option>
1021 </select>
1022 <?php if ($GLOBALS['athletic_team']) genPopupsList('width:47%'); ?>
1023 </center>
1025 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1026 <tr>
1027 <td class='smalltext' nowrap>
1028 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked />
1029 <b><?php xl('Top','e') ?></b>
1030 </td>
1031 <td class='smalltext' align='right' nowrap>
1032 <b><?php xl('Bot','e') ?></b>
1033 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php if (empty($GLOBALS['athletic_team'])) echo 'checked '; ?>/>
1034 </td>
1035 </tr>
1036 </table>
1038 <?php if ( $GLOBALS['concurrent_layout'] == 3) { ?>
1039 <ul id="navigation-slide">
1040 <?php } else { // ($GLOBALS['concurrent_layout'] == 2) ?>
1041 <ul id="navigation">
1042 <?php } ?>
1044 <?php if ($GLOBALS['athletic_team']) { // Tree menu for athletic teams ?>
1046 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
1047 <li><a class="collapsed" id="patimg" ><span><?php xl('View','e') ?></span></a>
1048 <ul>
1049 <?php genTreeLink('RTop','ros',xl('Weekly Exposures'),true); ?>
1050 <?php genMiscLink('RTop','ros','0',xl('Team Roster'),'reports/old_players_report.php?embed=1',true); ?>
1051 <?php if (!$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar'),true); ?>
1052 </ul>
1053 </li>
1054 <li class="open"><a class="collapsed" id="patimg" ><span><?php xl('Demographics','e') ?></span></a>
1055 <ul>
1056 <?php genMiscLink('RTop','fin','0',xl('Patients'),'main/finder/dynamic_finder.php'); ?>
1057 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
1058 <?php genTreeLink('RTop','dem',xl('Current')); ?>
1059 </ul>
1060 </li>
1061 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Medical Records','e') ?></span></a>
1062 <ul>
1063 <?php genDualLink('iss','ens',xl('All Injuries/Problems/Issues')); // with ens on bottom ?>
1064 <?php
1065 // Add a container for each issue type.
1066 foreach ($ISSUE_TYPES as $key => $value) {
1067 echo " <li class='open'><a class='collapsed_lv2'><span>" . xl('Active') . " " . $value[0] . "</span></a>\n";
1068 echo " <ul id='icontainer_$key'>\n";
1069 echo " </ul>\n";
1070 echo " </li>\n";
1073 <?php genDualLink('nen','ens',xl('New Consultation')); // with ens on bottom ?>
1074 <?php // genDualLink('enc','ens','Current Consultation'); // with ens on bottom ?>
1075 <?php genTreeLink('RTop','enc',xl('Current Consultation')); // encounter_top will itself load ens on bottom ?>
1076 <?php // genDualLink('dem','ens',xl('Previous Consultations')); // with dem on top ?>
1077 <?php genTreeLink('RBot','ens',xl('Previous Consultations'),true); ?>
1078 <?php genDualLink('his','ens',xl('Prev Med/Surg Hx')); // with ens on bottom ?>
1079 <?php // genPopLink(xl('New Allergy'),'../patient_file/summary/add_edit_issue.php?thistype=allergy','xxx1'); ?>
1080 <?php // genTreeLink('RTop','iss',xl('View/Edit Allergies')); // somehow emphasizing allergies...? ?>
1081 <?php if (!$GLOBALS['disable_immunizations']) genDualLink('his','imm',xl('Immunizations')); // imm on bottom, his on top ?>
1082 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genDualLink('his','pre',xl('Prescriptions')); // pre on bottom, his on top ?>
1083 <?php genTreeLink('RTop','doc',xl('Document/Imaging Store'),true); ?>
1084 <?php genDualLink('dem','pno',xl('Additional Notes')); // with dem on top ?>
1085 </ul>
1086 </li>
1087 <li class="open"><a class="collapsed" id="patimg" ><span><?php xl('Medical Administration','e') ?></span></a>
1088 <ul>
1089 <?php genDualLink('tra','ens',xl('Transactions/Referrals')); // new transaction form on top and tra list on bottom (or ens if no tra) ?>
1090 <?php genPopLink(xl('Address Book'),'../usergroup/addrbook_list.php?popup=1'); ?>
1091 <li><a href='' onClick="return repPopup('../patient_file/letter.php')" id='prp1'>Letter</a></li>
1092 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); ?>
1093 </ul>
1094 </li>
1095 <li class="open"><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
1096 <ul>
1097 <li class="open"><a class="collapsed_lv2"><span><?php xl('Athletic/Injury','e') ?></span></a>
1098 <ul>
1099 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); // also appears above ?>
1100 <?php genPopLink(xl('Games/Events Missed'),'absences_report.php'); ?>
1101 <?php genPopLink(xl('Injury Surveillance'),'football_injury_report.php'); ?>
1102 <?php genPopLink(xl('Team Injury Overview'),'injury_overview_report.php'); ?>
1103 </ul>
1104 </li>
1105 <li><a class="collapsed_lv2"><span><?php xl('Patient/Client','e') ?></span></a>
1106 <ul>
1107 <?php genPopLink(xl('List'),'patient_list.php'); ?>
1108 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genPopLink(xl('Prescriptions'),'prescriptions_report.php'); ?>
1109 <?php genPopLink(xl('Referrals'),'referrals_report.php'); ?>
1110 </ul>
1111 </li>
1112 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
1113 <ul>
1114 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appointments'),'appointments_report.php'); ?>
1115 <?php genPopLink(xl('Encounters'),'encounters_report.php'); ?>
1116 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appt-Enc'),'appt_encounter_report.php'); ?>
1117 </ul>
1118 </li>
1119 <li><a class="collapsed_lv2"><span><?php xl('General','e') ?></span></a>
1120 <ul>
1121 <?php genPopLink(xl('Services'),'services_by_category.php'); ?>
1122 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
1123 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
1124 </ul>
1125 </li>
1126 </ul>
1127 </li>
1128 <?php // TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1129 <?php if(!isset($GLOBALS['enable_fees_in_left_menu']) || $GLOBALS['enable_fees_in_left_menu'] == 1){ ?>
1130 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
1131 <ul>
1132 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
1133 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
1134 </ul>
1135 </li>
1136 <?php } ?>
1137 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
1138 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
1139 <ul>
1140 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
1141 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
1142 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
1143 <?php genTreeLink('RTop','pwd','Users Password Change'); ?>
1144 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings'); ?>
1145 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Codes')); ?>
1146 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
1147 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
1148 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
1149 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
1150 <?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'); ?>
1151 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
1152 <ul>
1153 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
1154 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1155 <?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'); ?>
1156 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1157 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1158 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1159 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1160 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1161 </ul>
1162 </li>
1163 </ul>
1164 </li>
1165 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1166 <ul>
1167 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1168 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1169 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1170 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1171 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1172 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1173 <?php if(acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('New Documents'),'../controller.php?document&list&patient_id=0'); ?>
1174 </ul>
1175 </li>
1177 <?php } else { // not athletic team ?>
1179 <?php if (!$GLOBALS['disable_calendar'] && !$GLOBALS['ippf_specific']) genTreeLink('RTop','cal',xl('Calendar')); ?>
1180 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
1181 <?php if ($GLOBALS['lab_exchange_enable']) genTreeLink('RTop', 'lab', xl('Check Lab Results'));?>
1182 <?php if($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address'] && acl_check('patientportal','portal')) genTreeLink('RTop','app',xl('Portal Activity')); ?>
1183 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Patient/Client','e') ?></span></a>
1184 <ul>
1185 <?php genMiscLink('RTop','fin','0',xl('Patients'),'main/finder/dynamic_finder.php'); ?>
1186 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
1187 <?php genTreeLink('RTop','dem',xl('Summary')); ?>
1188 <li class="open"><a class="expanded_lv2"><span><?php xl('Visits','e') ?></span></a>
1189 <ul>
1190 <?php if ($GLOBALS['ippf_specific'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar')); ?>
1191 <?php genTreeLink('RBot','nen',xl('Create Visit')); ?>
1192 <?php genTreeLink('RBot','enc',xl('Current')); ?>
1193 <?php genTreeLink('RBot','ens',xl('Visit History')); ?>
1194 </ul>
1195 </li>
1197 <li><a class="collapsed_lv2"><span><?php xl('Records','e') ?></span></a>
1198 <ul>
1199 <?php genTreeLink('RTop','prq',xl('Patient Record Request')); ?>
1200 </ul>
1201 </li>
1203 <?php if ($GLOBALS['gbl_nav_visit_forms']) { ?>
1204 <li><a class="collapsed_lv2"><span><?php xl('Visit Forms','e') ?></span></a>
1205 <ul>
1206 <?php
1207 // Generate the items for visit forms, both traditional and LBF.
1210 $lres = sqlStatement("SELECT * FROM list_options " .
1211 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1212 if (sqlNumRows($lres)) {
1213 while ($lrow = sqlFetchArray($lres)) {
1214 $option_id = $lrow['option_id']; // should start with LBF
1215 $title = $lrow['title'];
1216 genMiscLink('RBot','cod','2',xl_form_title($title),
1217 "patient_file/encounter/load_form.php?formname=$option_id");
1220 include_once("$srcdir/registry.inc");
1221 $reg = getRegistered();
1222 if (!empty($reg)) {
1223 foreach ($reg as $entry) {
1224 $option_id = $entry['directory'];
1225 $title = trim($entry['nickname']);
1226 if ($option_id == 'fee_sheet' ) continue;
1227 if ($option_id == 'newpatient') continue;
1228 if (empty($title)) $title = $entry['name'];
1229 genMiscLink('RBot','cod','2',xl_form_title($title),
1230 "patient_file/encounter/load_form.php?formname=" .
1231 urlencode($option_id));
1235 </ul>
1236 </li>
1237 <li class="collapsed" ><a class="collapsed_lv2"><span><?php echo xlt('Import') ?></span></a>
1238 <ul>
1239 <?php genMiscLink('RTop','ccr','0',xlt('Upload'),'patient_file/ccr_import.php'); ?>
1240 <?php genMiscLink('RTop','apr','0',xlt('Pending Approval'),'patient_file/ccr_pending_approval.php'); ?>
1241 </ul>
1242 </li>
1243 <?php } // end if gbl_nav_visit_forms ?>
1245 </ul>
1246 </li>
1247 <?php // TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1248 <?php if(!isset($GLOBALS['enable_fees_in_left_menu']) || $GLOBALS['enable_fees_in_left_menu'] == 1){ ?>
1249 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
1250 <ul>
1251 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
1252 <?php if ($GLOBALS['use_charges_panel']) genTreeLink('RBot','cod',xl('Charges')); ?>
1253 <?php genMiscLink('RBot','pay','1',xl('Payment'),'patient_file/front_payment.php'); ?>
1254 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
1255 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil',xl('Billing')); ?>
1256 <?php genTreeLink('RTop','npa',xl('Batch Payments'),false,2);?>
1257 <?php if ($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob')) genTreeLink('RTop','edi',xl('EDI History'),false,2);?>
1258 </ul>
1259 </li>
1260 <?php } ?>
1261 <?php // if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
1262 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1263 <li><a class="collapsed" id="invimg" ><span><?php xl('Inventory','e') ?></span></a>
1264 <ul>
1265 <?php genMiscLink('RTop','adm','0',xl('Management'),'drugs/drug_inventory.php'); ?>
1266 <?php genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
1267 </ul>
1268 </li>
1269 <?php } ?>
1270 <li><a class="collapsed" id="proimg" ><span><?php xl('Procedures','e') ?></span></a>
1271 <ul>
1272 <?php genTreeLink('RTop','orl',xl('Providers')); ?>
1273 <?php genTreeLink('RTop','ort',xl('Configuration')); ?>
1274 <?php genTreeLink('RTop','orc',xl('Load Compendium')); ?>
1275 <?php genTreeLink('RTop','orp',xl('Pending Review')); ?>
1276 <?php genTreeLink('RTop','orr',xl('Patient Results')); ?>
1277 <?php genTreeLink('RTop','orb',xl('Batch Results')); ?>
1278 <?php genTreeLink('RTop','ore',xl('Electronic Reports')); ?>
1279 </ul>
1280 </li>
1281 <?php
1282 $newcrop_user_role=sqlQuery("select newcrop_user_role from users where username='".$_SESSION['authUser']."'");
1283 if($newcrop_user_role['newcrop_user_role'] && $GLOBALS['erx_enable']) { ?>
1284 <li><a class="collapsed" id="feeimg" ><span><?php xl('New Crop','e') ?></span></a>
1285 <ul>
1286 <li><a class="collapsed_lv2"><span><?php xl('Status','e') ?></span></a>
1287 <ul>
1288 <?php genTreeLink('RTop','erx',xl('e-Rx')); ?>
1289 <?php //genTreeLink('RTop','err',xl('e-Rx Renewal')); ?>
1290 <?php genMiscLink('RTop','err','0',xl('e-Rx Renewal'),'eRx.php?page=status'); ?>
1291 </ul>
1292 </li>
1293 </ul>
1294 </li>
1295 <?php } ?>
1296 <?php if (!$disallowed['adm']) { ?>
1297 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
1298 <ul>
1299 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
1300 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
1301 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
1302 <?php if (acl_check('admin', 'practice' )) genTreeLink('RTop','adb',xl('Addr Book')); ?>
1303 <?php
1304 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1305 if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings&pharmacy&action=list'); ?>
1306 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Codes')); ?>
1307 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
1308 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
1309 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
1310 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1311 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1312 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Rules'),'super/rules/index.php?action=browse!list'); ?>
1313 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Alerts'),'super/rules/index.php?action=alerts!listactmgr'); ?>
1314 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Patient Reminders'),'patient_file/reminder/patient_reminders.php?mode=admin&patient_id='); ?>
1315 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
1316 <?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'); ?>
1317 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) genMiscLink('RTop','adm','0',xl('Export'),'main/ippf_export.php'); ?>
1318 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
1319 <ul>
1320 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
1321 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1322 <?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'); ?>
1323 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1324 <?php
1325 if($newcrop_user_role['newcrop_user_role'] || $GLOBALS['erx_enable']) {
1326 if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('eRx Logs'),'logview/erx_logview.php');
1329 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1330 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1331 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('External Data Loads'),'../interface/code_systems/dataloads_ajax.php'); ?>
1332 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Merge Patients'),'patient_file/merge_patients.php'); ?>
1333 </ul>
1334 </li>
1335 </ul>
1336 </li>
1337 <?php } ?>
1338 <li><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
1339 <ul>
1340 <li><a class="collapsed_lv2"><span><?php xl('Clients','e') ?></span></a>
1341 <ul>
1342 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/patient_list.php'); ?>
1343 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genMiscLink('RTop','rep','0',xl('Rx'),'reports/prescriptions_report.php'); ?>
1344 <?php if (acl_check('patients', 'med')) genMiscLink('RTop','rep','0',xl('Clinical'),'reports/clinical_reports.php'); ?>
1345 <?php genMiscLink('RTop','rep','0',xl('Referrals'),'reports/referrals_report.php'); ?>
1346 <?php genMiscLink('RTop','rep','0',xl('Immunization Registry'),'reports/immunization_report.php'); ?>
1347 </ul>
1348 </li>
1349 <li><a class="collapsed_lv2"><span><?php xl('Clinic','e') ?></span></a>
1350 <ul>
1351 <?php if ($GLOBALS['enable_cdr'] || $GLOBALS['enable_cqm'] || $GLOBALS['enable_amc']) genMiscLink('RTop','rep','0',xl('Report Results'),'reports/report_results.php'); ?>
1352 <?php if ($GLOBALS['enable_cdr']) genMiscLink('RTop','rep','0',xl('Standard Measures'),'reports/cqm.php?type=standard'); ?>
1353 <?php if ($GLOBALS['enable_cqm']) genMiscLink('RTop','rep','0',xl('Quality Measures (CQM)'),'reports/cqm.php?type=cqm'); ?>
1354 <?php if ($GLOBALS['enable_amc']) genMiscLink('RTop','rep','0',xl('Automated Measures (AMC)'),'reports/cqm.php?type=amc'); ?>
1355 <?php if ($GLOBALS['enable_amc_tracking']) genMiscLink('RTop','rep','0',xl('AMC Tracking'),'reports/amc_tracking.php'); ?>
1356 </ul>
1357 </li>
1358 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
1359 <ul>
1360 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appointments'),'reports/appointments_report.php'); ?>
1361 <?php genMiscLink('RTop','rep','0',xl('Encounters'),'reports/encounters_report.php'); ?>
1362 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appt-Enc'),'reports/appt_encounter_report.php'); ?>
1363 <?php if (empty($GLOBALS['code_types']['IPPF'])) { ?>
1364 <?php genMiscLink('RTop','rep','0',xl('Superbill'),'reports/custom_report_range.php'); ?>
1365 <?php } ?>
1366 <?php genMiscLink('RTop','rep','0',xl('Eligibility'),'reports/edi_270.php'); ?>
1367 <?php genMiscLink('RTop','rep','0',xl('Eligibility Response'),'reports/edi_271.php'); ?>
1370 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Chart Activity'),'reports/chart_location_activity.php'); ?>
1371 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Charts Out'),'reports/charts_checked_out.php'); ?>
1372 <?php genMiscLink('RTop','rep','0',xl('Services'), 'reports/services_by_category.php'); ?>
1373 <?php genMiscLink('RTop','rep','0',xl('Syndromic Surveillance'),'reports/non_reported.php'); ?>
1374 </ul>
1375 </li>
1376 <?php if (acl_check('acct', 'rep_a')) { ?>
1377 <li><a class="collapsed_lv2"><span><?php xl('Financial','e') ?></span></a>
1378 <ul>
1379 <?php genMiscLink('RTop','rep','0',xl('Sales'),'reports/sales_by_item.php'); ?>
1380 <?php genMiscLink('RTop','rep','0',xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
1381 <?php genMiscLink('RTop','rep','0',xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
1382 <?php genMiscLink('RTop','rep','0',xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
1383 <?php genMiscLink('RTop','rep','0',xl('Collections'), 'reports/collections_report.php'); ?>
1384 <?php genMiscLink('RTop','rep','0',xl('Financial Summary by Service Code'),'reports/svc_code_financial_report.php'); ?>
1385 </ul>
1386 </li>
1387 <?php } ?>
1388 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
1389 <li><a class="collapsed_lv2"><span><?php xl('Inventory','e') ?></span></a>
1390 <ul>
1391 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/inventory_list.php'); ?>
1392 <?php genMiscLink('RTop','rep','0',xl('Activity'),'reports/inventory_activity.php'); ?>
1393 <?php genMiscLink('RTop','rep','0',xl('Transactions'),'reports/inventory_transactions.php'); ?>
1394 </ul>
1395 </li>
1396 <?php } ?>
1397 <li><a class="collapsed_lv2"><span><?php xl('Procedures','e') ?></span></a>
1398 <ul>
1399 <?php genPopLink(xl('Pending Res'),'../orders/pending_orders.php'); ?>
1400 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink(xl('Pending F/U'),'../orders/pending_followup.php'); ?>
1401 <?php genPopLink(xl('Statistics'),'../orders/procedure_stats.php'); ?>
1402 </ul>
1403 </li>
1404 <?php if (! $GLOBALS['simplified_demographics']) { ?>
1405 <li><a class="collapsed_lv2"><span><?php xl('Insurance','e') ?></span></a>
1406 <ul>
1407 <?php genMiscLink('RTop','rep','0',xl('Distribution'),'reports/insurance_allocation_report.php'); ?>
1408 <?php genMiscLink('RTop','rep','0',xl('Indigents'),'billing/indigent_patients_report.php'); ?>
1409 <?php genMiscLink('RTop','rep','0',xl('Unique SP'),'reports/unique_seen_patients_report.php'); ?>
1410 </ul>
1411 </li>
1412 <?php } ?>
1413 <?php if (!empty($GLOBALS['code_types']['IPPF'])) { ?>
1414 <li><a class="collapsed_lv2"><span><?php xl('Statistics','e') ?></span></a>
1415 <ul>
1416 <?php genPopLink(xl('IPPF Stats'),'ippf_statistics.php?t=i'); ?>
1417 <?php genPopLink(xl('GCAC Stats'),'ippf_statistics.php?t=g'); ?>
1418 <?php genPopLink(xl('MA Stats'),'ippf_statistics.php?t=m'); ?>
1419 <?php genPopLink(xl('CYP'),'ippf_cyp_report.php'); ?>
1420 <?php genPopLink(xl('Daily Record'),'ippf_daily.php'); ?>
1421 </ul>
1422 </li>
1423 <?php } // end ippf-specific ?>
1424 <li><a class="collapsed_lv2"><span><?php xl('Blank Forms','e') ?></span></a>
1425 <ul>
1426 <?php genPopLink(xl('Demographics'),'../patient_file/summary/demographics_print.php'); ?>
1427 <?php genPopLink(xl('Superbill/Fee Sheet'),'../patient_file/printed_fee_sheet.php'); ?>
1428 <?php genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php'); ?>
1429 <?php
1430 $lres = sqlStatement("SELECT * FROM list_options " .
1431 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1432 while ($lrow = sqlFetchArray($lres)) {
1433 $option_id = $lrow['option_id']; // should start with LBF
1434 $title = $lrow['title'];
1435 genPopLink($title, "../forms/LBF/printable.php?formname=$option_id");
1438 </ul>
1439 </li>
1440 <?php if (acl_check('admin','super')) { ?>
1441 <li><a class="collapsed_lv2"><span><?php echo xlt('Services') ?></span></a>
1442 <ul>
1443 <?php genMiscLink('RTop','rep','0',xl('Background Services'),'reports/background_services.php'); ?>
1444 <?php genMiscLink('RTop','rep','0',xl('Direct Message Log'),'reports/direct_message_log.php'); ?>
1445 </ul>
1446 </li>
1447 <?php } ?>
1449 <?php // genTreeLink('RTop','rep','Other'); ?>
1450 </ul>
1451 </li>
1452 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1453 <ul>
1454 <?php genTreeLink('RTop','ped',xl('Patient Education')); ?>
1455 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1456 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1457 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1458 <?php genTreeLink('RTop','ort',xl('Order Catalog')); ?>
1459 <?php if (!$GLOBALS['disable_chart_tracker']) genTreeLink('RTop','cht',xl('Chart Tracker')); ?>
1460 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1461 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1462 <?php genTreeLink('RTop','pwd',xl('Password')); ?>
1463 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1464 <?php if(acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('New Documents'),'../controller.php?document&list&patient_id=00'); ?>
1465 </ul>
1466 </li>
1468 <?php } // end not athletic team ?>
1470 </ul>
1472 <?php } else { // end ($GLOBALS['concurrent_layout'] == 2 || $GLOBALS['concurrent_layout'] == 3) ?>
1474 <table cellpadding='0' cellspacing='0' border='0'>
1475 <tr>
1476 <td colspan='3'>
1477 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1478 <tr>
1479 <td class='smalltext' nowrap>
1480 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
1481 </td>
1482 <td class='smalltext' align='right' nowrap>
1483 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
1484 </td>
1485 </tr>
1486 </table>
1487 </td>
1488 </tr>
1489 <?php
1490 // Builds the table of radio buttons and their labels. Radio button values
1491 // are comprised of the 3-character document id and the 1-digit usage type,
1492 // so that JavaScript can easily access this information.
1493 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
1494 foreach ($primary_docs as $key => $varr) {
1495 if (!empty($disallowed[$key])) continue;
1496 $label = $varr[0];
1497 $usage = $varr[1];
1498 $url = $varr[2];
1499 echo " <tr>\n";
1500 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
1501 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
1502 if ($key == $default_top_rbid) echo " checked";
1503 echo " /></td>\n";
1504 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
1505 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
1506 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
1507 if ($key == 'msg') echo " checked";
1508 echo " /></td>\n";
1509 echo " </tr>\n";
1512 </table>
1514 <?php } ?>
1516 <br /><hr />
1518 <?php
1519 // To use RelayHealth, see comments and parameters in includes/config.php.
1520 if (!empty($GLOBALS['ssi']['rh'])) {
1521 include_once("../../library/ssi.inc");
1522 echo getRelayHealthLink() ."<br /><hr />\n";
1526 <div id='current_patient' style = 'display:none'>
1527 <b><?php xl('None','e'); ?></b>
1528 </div>
1530 <div id='current_encounter' style = 'display:none'>
1531 <b><?php xl('None','e'); ?></b>
1532 </div>
1534 <?php
1535 if (!$GLOBALS['athletic_team']) {
1536 genPopupsList();
1537 echo "<hr />\n";
1538 genFindBlock();
1539 echo "<hr />\n";
1543 <?php if (!empty($GLOBALS['online_support_link'])) { ?>
1544 <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>
1545 <?php } ?>
1547 <input type='hidden' name='findBy' value='Last' />
1548 <input type="hidden" name="searchFields" id="searchFields"/>
1549 <input type="hidden" name="search_service_code" value='' />
1551 </form>
1553 <script language='JavaScript'>
1554 syncRadios();
1555 </script>
1557 </body>
1558 </html>