PHP7 bug fix 4
[openemr.git] / interface / main / left_nav.php
blob1767d0f8742004997f78d24daade26a39ab5d8ed
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 'pfb' => array(xl('Patient Flow Board') , 0, '../interface/patient_tracker/patient_tracker.php?skip_timeout_reset=1'),
107 'app' => array(xl('Portal Activity') , 0, '../myportal/index.php'),
108 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php?form_active=1'),
109 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
110 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
111 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
112 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
113 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
114 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
115 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
116 'orl' => array(xl('Proc Prov') , 0, 'orders/procedure_provider_list.php'),
117 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
118 'orc' => array(xl('Proc Load') , 0, 'orders/load_compendium.php'),
119 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
120 'ore' => array(xl('E-Reports') , 0, 'orders/list_reports.php'),
121 'ppo' => array(xl('CMS Portal'), 0, 'cmsportal/list_requests.php'),
122 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
123 'imp' => array(xl('Import') , 0, '../custom/import.php'),
124 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
125 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
126 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
127 'new' => array(xl('New Pt') , 0, 'new/new.php'),
128 'ped' => array(xl('Patient Education'), 0, 'reports/patient_edu_web_lookup.php'),
129 'lab' => array(xl('Check Lab Results') , 0, 'orders/lab_exchange.php'),
130 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
131 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
132 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
133 'nen' => array(xl('Create Visit'), 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
134 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
135 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
136 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
137 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
138 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
139 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
140 'lda' => array(xl('Lab overview') , 1, 'patient_file/summary/labdata.php'),
141 'tan' => array(xl('Configure Tracks') , 0, 'forms/track_anything/create.php'),
142 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
143 'prq' => array(xl('Pt Rec Request') , 1, 'patient_file/transaction/record_request.php'),
144 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
145 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
146 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
147 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
148 'erx' => array(xl('e-Rx') , 1, 'eRx.php'),
149 'err' => array(xl('e-Rx Renewal') , 1, 'eRx.php?page=status'),
150 'ere' => array(xl('e-Rx EPCS') , 1, 'eRx.php?page=epcs-admin'),
151 'pay' => array(xl('Payment') , 1, '../patient_file/front_payment.php'),
152 'edi' => array(xl('EDI History') , 0, 'billing/edih_view.php'),
153 'dld' => array(xl('Display Documents'), 0, 'main/display_documents.php')
155 $primary_docs['npa']=array(xl('Batch Payments') , 0, 'billing/new_payment.php');
156 if ($GLOBALS['use_charges_panel'] || $GLOBALS['concurrent_layout'] == 2) {
157 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
160 $esignApi = new Api();
161 // This section decides which navigation items will not appear.
163 $disallowed = array();
164 $disallowed['edi'] = !($GLOBALS['enable_edihistory_in_left_menu'] || acl_check('acct', 'eob'));
165 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
166 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
167 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
168 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
169 acl_check('admin', 'superbill') || acl_check('admin', 'drugs'));
171 $disallowed['bil'] = !(acl_check('acct', 'rep') || acl_check('acct', 'eob') ||
172 acl_check('acct', 'bill'));
174 $disallowed['new'] = !(acl_check('patients','demo','',array('write','addonly') ));
176 $disallowed['fax'] = !($GLOBALS['enable_hylafax'] || $GLOBALS['enable_scanner']);
178 $disallowed['ros'] = !$GLOBALS['athletic_team'];
180 $disallowed['iss'] = !((acl_check('encounters','notes','','write') ||
181 acl_check('encounters','notes_a','','write') ) &&
182 acl_check('patients','med','','write') );
184 $disallowed['imp'] = $disallowed['new'] ||
185 !is_readable("$webserver_root/custom/import.php");
187 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
189 $disallowed['pre'] = !(acl_check('patients', 'med'));
191 // Helper functions for treeview generation.
192 function genTreeLink($frame, $name, $title, $mono=false) {
193 global $primary_docs, $disallowed;
194 if (empty($disallowed[$name])) {
195 $id = $name . $primary_docs[$name][1];
196 echo "<li><a href='' id='$id' onclick=\"";
197 if ($mono) {
198 if ($frame == 'RTop')
199 echo "forceSpec(true,false);";
200 else
201 echo "forceSpec(false,true);";
203 echo "return loadFrame2('$id','$frame','" .
204 $primary_docs[$name][2] . "')\">" . $title . ($name == 'msg' ? ' <span id="reminderCountSpan" class="bold"></span>' : '')."</a></li>";
207 function genMiscLink($frame, $name, $level, $title, $url, $mono=false) {
208 global $disallowed;
209 if (empty($disallowed[$name])) {
210 $id = $name . $level;
211 echo "<li><a href='' id='$id' onclick=\"";
212 if ($mono) {
213 if ($frame == 'RTop')
214 echo "forceSpec(true,false);";
215 else
216 echo "forceSpec(false,true);";
218 echo "return loadFrame2('$id','$frame','" .
219 $url . "')\">" . $title . "</a></li>";
222 function genMiscLink2($frame, $name, $level, $title, $url, $mono=false,$mouseovertext="") {
223 global $disallowed;
224 if (empty($disallowed[$name])) {
226 $id = $name . $level;
227 echo "<li><a href='' id='$id' title='$mouseovertext' onclick=\"";
228 if ($mono) {
229 if ($frame == 'RTop')
230 echo "forceSpec(true,false);";
231 else
232 echo "forceSpec(false,true);";
234 echo "return loadFrame3('$id','$frame','" .
235 $url . "')\">" . $title . "</a></li>";
238 function genPopLink($title, $url, $linkid='') {
239 echo "<li><a href='' ";
240 if ($linkid) echo "id='$linkid' ";
241 echo "onclick=\"return repPopup('$url')\"" .
242 ">" . $title . "</a></li>";
244 function genDualLink($topname, $botname, $title) {
245 global $primary_docs, $disallowed;
246 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
247 $topid = $topname . $primary_docs[$topname][1];
248 $botid = $botname . $primary_docs[$botname][1];
249 echo "<li><a href='' id='$topid' " .
250 "onclick=\"return loadFrameDual('$topid','$botid','" .
251 $primary_docs[$topname][2] . "','" .
252 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
256 function genPopupsList($style='') {
257 global $disallowed, $webserver_root;
259 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
260 <option value=''><?php xl('Popups','e'); ?></option>
261 <?php if (!$disallowed['iss']) { ?>
262 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
263 <?php } ?>
264 <?php if (!$GLOBALS['ippf_specific']) { ?>
265 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
266 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
267 <?php } ?>
268 <?php if ($GLOBALS['athletic_team']) { ?>
269 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
270 <?php } ;
271 if (!$GLOBALS['disable_calendar']) { ?>
272 <option value='../reports/appointments_report.php?patient=<?php if(isset($pid)) {echo $pid;} ?>'><?php xl('Appts','e'); ?></option>
273 <?php } ;
274 if (file_exists("$webserver_root/custom/refer.php")) { ?>
275 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
276 <?php } ?>
277 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill','e'); ?></option>
278 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
279 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
280 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
281 <?php } ?>
282 <?php if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates")) { ?>
283 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
284 <?php } ?>
285 <?php if ($GLOBALS['chart_label_type'] != '0') { ?>
286 <option value='../patient_file/label.php'><?php xl('Chart Label','e'); ?></option>
287 <?php } ?>
288 <?php if ($GLOBALS['barcode_label_type'] != '0') { ?>
289 <option value='../patient_file/barcode_label.php'><?php xl('Barcode Label','e'); ?></option>
290 <?php } ?>
291 <?php if ($GLOBALS['addr_label_type']) { ?>
292 <option value='../patient_file/addr_label.php'><?php xl('Address Label','e'); ?></option>
293 <?php } ?>
294 </select>
295 <?php
298 function genFindBlock() {
300 <table cellpadding='0' cellspacing='0' border='0'>
301 <tr>
302 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
303 <td class='smalltext' colspan='2'>
304 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
305 </td>
306 </tr>
307 <tr>
308 <td class='smalltext'><?php xl('by','e') ?>:</td>
309 <td class='smalltext'>
310 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name','e'); ?></a>
311 </td>
312 <td class='smalltext' align='right'>
313 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID','e'); ?></a>
314 </td>
315 </tr>
316 <tr>
317 <td class='smalltext'>&nbsp;</td>
318 <td class='smalltext'>
319 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN','e'); ?></a>
320 </td>
321 <td class='smalltext' align='right'>
322 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB','e'); ?></a>
323 </td>
324 </tr>
325 <tr>
326 <td class='smalltext'>&nbsp;</td>
327 <td class='smalltext'>
328 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
329 </td>
330 <td class='smalltext' align='right'>
331 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
332 </td>
333 </tr>
334 </table>
335 <?php
336 } // End function genFindBlock()
339 <html>
340 <head>
341 <title>Navigation</title>
343 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
345 <style type="text/css">
346 body {
347 font-size:8pt;
348 font-weight:normal;
349 padding: 5px 3px 5px 3px;
351 .smalltext {
352 font-family:sans-serif;
353 font-size:8pt;
354 font-weight:normal;
356 a.navitem, a.navitem:visited {
357 color:#0000ff;
358 font-family:sans-serif;
359 font-size:8pt;
360 font-weight:bold;
362 .inputtext {
363 font-size:9pt;
364 font-weight:normal;
365 border-style:solid;
366 border-width:1px;
367 padding-left:2px;
368 padding-right:2px;
369 border-color: #000000;
370 background-color:transparent;
373 #navigation ul {
374 background-color:transparent;
376 #navigation-slide ul {
377 background-color:transparent;
379 #navigation-slide a{
380 width: 92%;
382 .nav-menu-img{
383 width:25px;
384 height:25px;
385 border:none;
386 margin-right:5px;
387 vertical-align:middle;
389 </style>
391 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.4.1/jquery.treeview.css" />
392 <script src="../../library/js/jquery-1.6.4.min.js" type="text/javascript"></script>
393 <script src="../../library/js/jquery.treeview-1.4.1/jquery.treeview.js" type="text/javascript"></script>
395 <script type="text/javascript" src="../../library/dialog.js"></script>
397 <script language='JavaScript'>
399 // tajemo work by CB 2012/01/31 12:32:57 PM dated reminders counter
400 function getReminderCount(){
401 top.restoreSession();
402 // Send the skip_timeout_reset parameter to not count this as a manual entry in the
403 // timing out mechanism in OpenEMR.
404 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/dated_reminders_counter.php",
405 { skip_timeout_reset: "1" },
406 function(data) {
407 $("#reminderCountSpan").html(data);
408 // run updater every 60 seconds
409 var repeater = setTimeout("getReminderCount()", 60000);
411 //piggy-back on this repeater to run other background-services
412 //this is a silent task manager that returns no output
413 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/execute_background_services.php",
414 { skip_timeout_reset: "1", ajax: "1" });
417 $(document).ready(function (){
418 getReminderCount();//
419 parent.loadedFrameCount += 1;
420 <?php if ($GLOBALS['drop_bottom'] ==1) { ?>
421 $("input[name=cb_bot]").trigger('click');
422 toggleFrame(2);
423 <?php } ?>
425 // end of tajemo work dated reminders counter
427 // Master values for current pid and encounter.
428 var active_pid = 0;
429 var active_encounter = 0;
430 var encounter_locked = false;
432 // Current selections in the top and bottom frames.
433 var topName = '';
434 var botName = '';
436 // Expand and/or collapse frames in response to checkbox clicks.
437 // fnum indicates which checkbox was clicked (1=left, 2=right).
438 function toggleFrame(fnum) {
439 var f = document.forms[0];
440 var fset = top.document.getElementById('fsright');
441 if (!f.cb_top.checked && !f.cb_bot.checked) {
442 if (fnum == 1) f.cb_bot.checked = true;
443 else f.cb_top.checked = true;
445 var rows = f.cb_top.checked ? '*' : '0';
446 rows += f.cb_bot.checked ? ',*' : ',0';
447 fset.rows = rows;
448 fset.rows = rows;
451 // Load the specified url into the specified frame (RTop or RBot).
452 // The URL provided must be relative to interface.
453 function loadFrame(fname, frame, url) {
454 top.restoreSession();
455 var i = url.indexOf('{PID}');
456 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
457 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
458 if (frame == 'RTop') topName = fname; else botName = fname;
461 // Load the specified url into a frame to be determined, with the specified
462 // frame as the default; the url must be relative to interface.
463 function loadFrame2(fname, frame, url) {
464 var usage = fname.substring(3);
465 if (active_pid == 0 && usage > '0') {
466 alert('<?php xl('You must first select or add a patient.','e') ?>');
467 return false;
469 if (active_encounter == 0 && usage > '1') {
470 alert('<?php xl('You must first select or create an encounter.','e') ?>');
471 return false;
473 if (encounter_locked && usage > '1') {
474 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
475 return false;
477 var f = document.forms[0];
478 top.restoreSession();
479 var i = url.indexOf('{PID}');
480 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
481 if(f.sel_frame)
483 var fi = f.sel_frame.selectedIndex;
484 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
486 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
487 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
488 if (frame == 'RTop') topName = fname; else botName = fname;
489 return false;
492 function loadFrame3(fname, frame, url) {
493 var f = document.forms[0];
494 top.restoreSession();
495 var i = url.indexOf('{PID}');
496 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
497 if(f.sel_frame)
499 var fi = f.sel_frame.selectedIndex;
500 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
502 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
503 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
504 if (frame == 'RTop') topName = fname; else botName = fname;
505 return false;
508 // Make sure the the top and bottom frames are open or closed, as specified.
509 function forceSpec(istop, isbot) {
510 var f = document.forms[0];
511 if (f.cb_top.checked != istop) {
512 f.cb_top.checked = istop;
513 toggleFrame(1);
515 if (f.cb_bot.checked != isbot) {
516 f.cb_bot.checked = isbot;
517 toggleFrame(2);
521 // Make sure both frames are open.
522 function forceDual() {
523 forceSpec(true, true);
526 // Load the specified url into a frame to be determined, with the specified
527 // frame as the default; the url must be relative to interface.
528 function loadFrameDual(tname, bname, topurl, boturl) {
529 var topusage = tname.substring(3);
530 var botusage = bname.substring(3);
531 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
532 alert('<?php xl('You must first select or add a patient.','e') ?>');
533 return false;
535 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
536 alert('<?php xl('You must first select or create an encounter.','e') ?>');
537 return false;
539 if (encounter_locked && (topusage > '1' || botusage > '1')) {
540 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
541 return false;
543 var f = document.forms[0];
544 forceDual();
545 top.restoreSession();
546 var i = topurl.indexOf('{PID}');
547 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
548 i = boturl.indexOf('{PID}');
549 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
550 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
551 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
552 topName = tname;
553 botName = bname;
554 return false;
557 // Select a designated radio button. raname may be either the radio button
558 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
559 // You should call this if you directly load a document that does not
560 // correspond to the current radio button setting.
561 function setRadio(raname, rbid) {
562 <?php if ($GLOBALS['concurrent_layout'] < 2) { ?>
563 var f = document.forms[0];
564 if (raname == 'RTop') raname = 'rb_top';
565 if (raname == 'RBot') raname = 'rb_bot';
566 for (var i = 0; i < f[raname].length; ++i) {
567 if (f[raname][i].value.substring(0,3) == rbid) {
568 f[raname][i].checked = true;
569 return true;
572 <?php } ?>
573 return false;
576 // Set disabled/enabled state of radio buttons and associated labels
577 // depending on whether there is an active patient or encounter.
578 function syncRadios() {
579 var f = document.forms[0];
580 encounter_locked = isEncounterLocked(active_encounter);
581 <?php if (($GLOBALS['concurrent_layout'] == 2)||($GLOBALS['concurrent_layout'] == 3)) { ?>
582 var nlinks = document.links.length;
583 for (var i = 0; i < nlinks; ++i) {
584 var lnk = document.links[i];
585 if (lnk.id.length != 4) continue;
586 var usage = lnk.id.substring(3);
587 if (usage == '1' || usage == '2') {
588 var da = false;
589 if (active_pid == 0) da = true;
590 if (active_encounter == 0 && usage > '1') da = true;
591 if (encounter_locked && usage > '1') da = true;
592 <?php
593 if ($GLOBALS['concurrent_layout'] == 2){
594 $color = "'#0000ff'";
595 }else{
596 $color = "'#000000'";
599 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
602 <?php } else if ($GLOBALS['concurrent_layout'] < 2) { ?>
603 for (var i = 0; i < f.rb_top.length; ++i) {
604 var da = false;
605 var rb1 = f.rb_top[i];
606 var rb2 = f.rb_bot[i];
607 var rbid = rb1.value.substring(0,3);
608 var usage = rb1.value.substring(3);
609 if (active_pid == 0 && usage > '0') da = true;
610 if (active_encounter == 0 && usage > '1') da = true;
611 if (encounter_locked && usage > '1') da = true;
612 // daemon_frame can also set special label colors, so don't mess with
613 // them unless we have to.
614 if (rb1.disabled != da) {
615 rb1.disabled = da;
616 rb2.disabled = da;
617 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
620 <?php } ?>
621 f.popups.disabled = (active_pid == 0);
624 function goHome() {
625 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
626 top.frames['RBot'].location='messages/messages.php?form_active=1';
629 //Function to clear active patient and encounter in the server side
630 function clearactive() {
631 top.restoreSession();
632 //Ajax call to clear active patient in session
633 $.ajax({
634 type: "POST",
635 url: "<?php echo $GLOBALS['webroot'] ?>/library/ajax/unset_session_ajax.php",
636 data: { func: "unset_pid"},
637 success:function( msg ) {
638 clearPatient();
639 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
640 top.frames['RBot'].location='messages/messages.php?form_active=1';
644 $(parent.Title.document.getElementById('clear_active')).hide();
646 // Reference to the search.php window.
647 var my_window;
649 // Open the search.php window.
650 function initFilter() {
651 my_window = window.open("../../custom/search.php", "mywindow","status=1");
654 // This is called by the search.php (Filter) window.
655 function processFilter(fieldString, serviceCode) {
656 var f = document.forms[0];
657 document.getElementById('searchFields').value = fieldString;
658 f.search_service_code.value = serviceCode;
659 findPatient("Filter");
660 f.search_service_code.value = '';
661 my_window.close();
664 // Process the click to find a patient by name, id, ssn or dob.
665 function findPatient(findby) {
666 var f = document.forms[0];
667 if (! f.cb_top.checked) {
668 f.cb_top.checked = true;
669 toggleFrame(1);
671 f.findBy.value = findby;
672 setRadio('rb_top', 'dem');
673 top.restoreSession();
674 document.find_patient.submit();
677 // Helper function to set the contents of a div.
678 function setSomeContent(id, content, doc) {
679 if (doc.getElementById) {
680 var x = doc.getElementById(id);
681 x.innerHTML = '';
682 x.innerHTML = content;
684 else if (doc.all) {
685 var x = doc.all[id];
686 x.innerHTML = content;
689 function setDivContent(id, content) {
690 setSomeContent(id, content, document);
692 function setTitleContent(id, content) {
693 setSomeContent(id, content, parent.Title.document);
696 // This is called automatically when a new patient is set, to make sure
697 // there are no patient-specific documents showing stale data. If a frame
698 // was just loaded with data for the correct patient, its name is passed so
699 // that it will not be zapped. At this point the new server-side pid is not
700 // assumed to be set, so this function will only load global data.
701 function reloadPatient(frname) {
702 var f = document.forms[0];
703 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
704 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
705 setRadio('rb_top', 'cal');
707 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
708 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
709 setRadio('rb_bot', 'ens');
713 // Reload encounter-specific frames, excluding a specified frame. At this
714 // point the new server-side encounter ID may not be set and loading the same
715 // document for the new encounter will not work, so load patient info instead.
716 function reloadEncounter(frname) {
717 var f = document.forms[0];
718 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
719 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
720 setRadio('rb_top', 'dem');
722 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
723 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
724 setRadio('rb_bot', 'ens');
728 // Clear and reload issue-related menu items for active_pid.
729 // Currently this only applies to athletic teams, but might be implemented
730 // in the general menu at some future time.
732 function reloadIssues() {
733 <?php
734 if ($GLOBALS['athletic_team']) {
735 // Generates a menu item for each active issue that this patient
736 // has of each issue type. Each one looks like this:
737 // Onset-Date [Add] Issue-Title
738 // where the first part is a link to open the issue dialog,
739 // [Add] is a link that auto-creates and opens a new encounter, and
740 // Issue-Title is a link that shows related encounters.
741 foreach ($ISSUE_TYPES as $key => $value) {
743 $('#icontainer_<?php echo $key ?>').empty();
744 if (active_pid != 0) {
745 $('#icontainer_<?php echo $key ?>').append("<li>" +
746 "<a href='' id='xxx1' onclick='return repPopup(" +
747 "\"../patient_file/summary/add_edit_issue.php?thistype=" +
748 "<?php echo $key; ?>\")' " +
749 "title='<?php echo xl('Create new issue'); ?>'>" +
750 "<?php echo xl('New') . " " . $value[1]; ?></a></li>");
751 top.restoreSession();
752 $.getScript('../../library/ajax/left_nav_issues_ajax.php?type=<?php echo $key; ?>');
754 <?php
758 } // end function reloadIssues
760 // This is referenced in left_nav_issues_ajax.php and is called when [Add]
761 // is clicked for an issue menu item to add a new encounter for the issue.
762 // So far this only applies to the Athletic Team version of the menu.
764 function addEncNotes(issue) {
766 // top.restoreSession();
767 // $.getScript('../../library/ajax/left_nav_encounter_ajax.php?createvisit=1&issue=' + issue);
769 // The above AJAX call was to create the encounter right away, but we later
770 // (2012-07-03) decided it's better to present the New Encounter form instead.
771 // Note the issue ID is passed so it will be pre-selected in that form.
772 loadFrame2('nen1','RBot','forms/newpatient/new.php?autoloaded=1&calenc=&issue=' + issue);
774 return false;
777 // Call this to announce that the patient has changed. You must call this
778 // if you change the session PID, so that the navigation frame will show the
779 // correct patient and so that the other frame will be reloaded if it contains
780 // patient-specific information from the previous patient. frname is the name
781 // of the frame that the call came from, so we know to only reload content
782 // from the *other* frame if it is patient-specific.
783 function setPatient(pname, pid, pubpid, frname, str_dob) {
784 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
785 setDivContent('current_patient', str);
786 setTitleContent('current_patient', str + str_dob);
787 if (pid == active_pid) return;
788 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
789 active_pid = pid;
790 active_encounter = 0;
791 encounter_locked = false;
792 if (frname) reloadPatient(frname);
793 syncRadios();
794 $(parent.Title.document.getElementById('current_patient_block')).show();
795 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
796 $(encounter_block).hide();
798 // zero out the encounter frame, replace it with the encounter list frame
799 var f = document.forms[0];
800 if ( f.cb_top.checked && f.cb_bot.checked ) {
801 var encounter_frame = getEncounterTargetFrame('enc');
802 if ( encounter_frame != undefined ) {
803 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
804 setRadio(encounter_frame, 'ens');
808 reloadIssues(pid);
809 $(parent.Title.document.getElementById('clear_active')).show();//To display Clear Active Patient button on selecting a patient
811 function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) {
812 //This function lists all encounters of the patient.
813 //This function writes the drop down in the top frame.
814 //It is called when a new patient is create/selected from the search menu.
815 var str = '<Select class="text" id="EncounterHistory" onchange="{top.restoreSession();toencounter(this.options[this.selectedIndex].value)}">';
816 str+='<option value=""><?php echo htmlspecialchars( xl('Encounter History'), ENT_QUOTES) ?></option>';
817 str+='<option value="New Encounter"><?php echo htmlspecialchars( xl('New Encounter'), ENT_QUOTES) ?></option>';
818 str+='<option value="Past Encounter List"><?php echo htmlspecialchars( xl('Past Encounter List'), ENT_QUOTES) ?></option>';
819 for(CountEncounter=0;CountEncounter<EncounterDateArray.length;CountEncounter++)
821 str+='<option value="'+EncounterIdArray[CountEncounter]+'~'+EncounterDateArray[CountEncounter]+'">'+EncounterDateArray[CountEncounter]+'-'+CalendarCategoryArray[CountEncounter]+'</option>';
823 str+='</Select>';
824 $(parent.Title.document.getElementById('past_encounter_block')).show();
825 top.window.parent.Title.document.getElementById('past_encounter').innerHTML=str;
828 function loadCurrentPatientFromTitle() {
829 top.restoreSession();
830 top.frames['RTop'].location='../patient_file/summary/demographics.php';
833 function getEncounterTargetFrame( name ) {
834 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
835 var f = document.forms[0];
836 var r = 'RTop';
837 if (f.cb_top.checked && f.cb_bot.checked) {
838 if ( bias == 2 ) {
839 r = 'RBot';
840 } else {
841 r = 'RTop';
843 } else {
844 if ( f.cb_top.checked ) {
845 r = 'RTop';
846 } else if ( f.cb_bot.checked ) {
847 r = 'RBot';
850 return r;
852 function isEncounterLocked( encounterId ) {
853 <?php if ( $esignApi->lockEncounters() ) { ?>
854 // If encounter locking is enabled, make a syncronous call (async=false) to check the
855 // DB to see if the encounter is locked.
856 // Call restore session, just in case
857 top.restoreSession();
858 $.ajax({
859 type: 'POST',
860 url: '<?php echo $GLOBALS['webroot']?>/interface/esign/index.php?module=encounter&method=esign_is_encounter_locked',
861 data: { encounterId : encounterId },
862 success: function( data ) {
863 encounter_locked = data;
865 dataType: 'json',
866 async:false
867 });
868 return encounter_locked;
869 <?php } else { ?>
870 // If encounter locking isn't enabled, just tell the left_nav that the encounter
871 // isn't locked.
872 return false;
873 <?php } ?>
875 // Call this to announce that the encounter has changed. You must call this
876 // if you change the session encounter, so that the navigation frame will
877 // show the correct encounter and so that the other frame will be reloaded if
878 // it contains encounter-specific information from the previous encounter.
879 // frname is the name of the frame that the call came from, so we know to only
880 // reload encounter-specific content from the *other* frame.
881 function setEncounter(edate, eid, frname) {
882 if (eid == active_encounter) return;
883 if (!eid) edate = '<?php xl('None','e'); ?>';
884 var str = '<b>' + edate + '</b>';
885 setDivContent('current_encounter', str);
886 active_encounter = eid;
887 encounter_locked=isEncounterLocked(active_encounter);
888 reloadEncounter(frname);
889 syncRadios();
890 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
891 var encounter = $(parent.Title.document.getElementById('current_encounter'));
892 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
893 encounter.html( estr );
894 encounter_block.show();
897 function loadCurrentEncounterFromTitle() {
898 top.restoreSession();
899 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/encounter_top.php';
902 // You must call this if you delete the active patient (or if for any other
903 // reason you "close" the active patient without opening a new one), so that
904 // the appearance of the navigation frame will be correct and so that any
905 // stale content will be reloaded.
906 function clearPatient() {
907 if (active_pid == 0) return;
908 var f = document.forms[0];
909 active_pid = 0;
910 active_encounter = 0;
911 encounter_locked = false;
912 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
913 $(parent.Title.document.getElementById('current_patient_block')).hide();
914 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
915 $(parent.Title.document.getElementById('current_encounter_block')).hide();
916 reloadPatient('');
917 syncRadios();
920 // You must call this if you delete the active encounter (or if for any other
921 // reason you "close" the active encounter without opening a new one), so that
922 // the appearance of the navigation frame will be correct and so that any
923 // stale content will be reloaded.
924 function clearEncounter() {
925 if (active_encounter == 0) return;
926 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
927 active_encounter = 0;
928 encounter_locked = false;
929 reloadEncounter('');
930 syncRadios();
932 function removeOptionSelected(EncounterId)
933 {//Removes an item from the Encounter drop down.
934 var elSel = top.window.parent.Title.document.getElementById('EncounterHistory');
935 var i;
936 for (i = elSel.length - 1; i>=2; i--) {
937 EncounterHistoryValue=elSel.options[i].value;
938 EncounterHistoryValueArray=EncounterHistoryValue.split('~');
939 if (EncounterHistoryValueArray[0]==EncounterId) {
940 elSel.remove(i);
945 // You can call this to make sure the session pid is what we expect.
946 function pidSanityCheck(pid) {
947 if (pid != active_pid) {
948 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
949 '. This session is unstable and should be abandoned. Do not use ' +
950 'OpenEMR in multiple browser windows!');
951 return false;
953 return true;
956 // You can call this to make sure the session encounter is what we expect.
957 function encounterSanityCheck(eid) {
958 if (eid != active_encounter) {
959 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
960 '. This session is unstable and should be abandoned. Do not use ' +
961 'OpenEMR in multiple browser windows!');
962 return false;
964 return true;
967 // Pop up a report.
968 function repPopup(aurl) {
969 top.restoreSession();
970 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
971 return false;
974 // This is invoked to pop up some window when a popup item is selected.
975 function selpopup(selobj) {
976 var i = selobj.selectedIndex;
977 var opt = selobj.options[i];
978 if (i > 0) {
979 var width = 750;
980 var height = 550;
981 if (opt.text == 'Export' || opt.text == 'Import') {
982 width = 500;
983 height = 400;
985 else if (opt.text == 'Refer') {
986 width = 700;
987 height = 500;
989 dlgopen(opt.value, '_blank', width, height);
991 selobj.selectedIndex = 0;
993 // Treeview activation stuff:
994 $(document).ready(function(){
995 if(3 == <?php echo $GLOBALS['concurrent_layout'] ?>){
996 $("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
997 $("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
998 $("#navigation-slide > li > a.expanded").click(function() {
999 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1000 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1002 $("#navigation-slide > li > a.collapsed").click(function() {
1003 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1004 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1006 $("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
1007 $("#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");
1008 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1010 $("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
1011 $("#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");
1012 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1014 $("#navigation-slide > li > a#cal0").prepend('<img src="../../images/calendar.png" class="nav-menu-img" />');
1015 $("#navigation-slide > li > a#pfb0").prepend('<img src="../../images/pfb.png" class="nav-menu-img" />');
1016 $("#navigation-slide > li > a#msg0").prepend('<img src="../../images/messages.png" class="nav-menu-img" />');
1017 $("#navigation-slide > li > a#patimg").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
1018 $("#navigation-slide > li > a#app0").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
1019 $("#navigation-slide > li > a#ppo0").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
1020 $("#navigation-slide > li > a#repimg").prepend('<img src="../../images/reports.png" class="nav-menu-img" />');
1021 $("#navigation-slide > li > a#feeimg").prepend('<img src="../../images/fee.png" class="nav-menu-img" />');
1022 $("#navigation-slide > li > a#adm0").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
1023 $("#navigation-slide > li > a#invimg").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
1024 $("#navigation-slide > li > a#admimg").prepend('<img src="../../images/admin.png" class="nav-menu-img" />');
1025 $("#navigation-slide > li > a#misimg").prepend('<img src="../../images/misc.png" class="nav-menu-img" />');
1026 $("#navigation-slide > li > a#proimg").prepend('<img src="../../images/procedures.png" class="nav-menu-img" />');
1027 $("#navigation-slide > li > a#modimg").prepend('<img src="../../images/module.png" class="nav-menu-img" />');
1028 $("#navigation-slide > li").each(function(index) {
1029 if($(" > ul > li", this).size() == 0){
1030 $(" > a", this).addClass("collapsed");
1033 }else if(2 == <?php echo $GLOBALS['concurrent_layout'] ?>){
1035 //Remove the links (used by the sliding menu) that will break treeview
1036 $('a.collapsed').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1037 $('a.collapsed_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1038 $('a.expanded').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1039 $('a.expanded_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1041 // Initiate treeview
1042 $("#navigation").treeview({
1043 animated: "fast",
1044 collapsed: true,
1045 unique: <?php echo $GLOBALS['athletic_team'] ? 'false' : 'true' ?>,
1046 toggle: function() {
1047 window.console && console.log("%o was toggled", this);
1053 </script>
1055 </head>
1057 <body class="body_nav">
1059 <form method='post' name='find_patient' target='RTop'
1060 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
1062 <?php
1063 // Find widget is at the top for the athletic team layout.
1064 if ($GLOBALS['athletic_team']) {
1065 genFindBlock();
1066 echo "<hr />\n";
1070 <?php if ( ( $GLOBALS['concurrent_layout'] == 2) || ($GLOBALS['concurrent_layout'] == 3) ) { ?>
1071 <center>
1072 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:<?php echo $GLOBALS['athletic_team'] ? 47 : 100; ?>%;'>
1073 <option value='0'><?php xl('Default','e'); ?></option>
1074 <option value='1'><?php xl('Top','e'); ?></option>
1075 <option value='2'><?php xl('Bottom','e'); ?></option>
1076 </select>
1077 <?php if ($GLOBALS['athletic_team']) genPopupsList('width:47%'); ?>
1078 </center>
1080 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1081 <tr>
1082 <td class='smalltext' nowrap>
1083 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked />
1084 <b><?php xl('Top','e') ?></b>
1085 </td>
1086 <td class='smalltext' align='right' nowrap>
1087 <b><?php xl('Bot','e') ?></b>
1088 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php if (empty($GLOBALS['athletic_team'])) echo 'checked '; ?>/>
1089 </td>
1090 </tr>
1091 </table>
1093 <?php if ( $GLOBALS['concurrent_layout'] == 3) { ?>
1094 <ul id="navigation-slide">
1095 <?php } else { // ($GLOBALS['concurrent_layout'] == 2) ?>
1096 <ul id="navigation">
1097 <?php } ?>
1099 <?php if ($GLOBALS['athletic_team']) { // Tree menu for athletic teams ?>
1101 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
1102 <li><a class="collapsed" id="patimg" ><span><?php xl('View','e') ?></span></a>
1103 <ul>
1104 <?php genTreeLink('RTop','ros',xl('Weekly Exposures'),true); ?>
1105 <?php genMiscLink('RTop','ros','0',xl('Team Roster'),'reports/old_players_report.php?embed=1',true); ?>
1106 <?php if (!$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar'),true); ?>
1107 </ul>
1108 </li>
1109 <li class="open"><a class="collapsed" id="patimg" ><span><?php xl('Demographics','e') ?></span></a>
1110 <ul>
1111 <?php genMiscLink('RTop','fin','0',xl('Patients'),'main/finder/dynamic_finder.php'); ?>
1112 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
1113 <?php genTreeLink('RTop','dem',xl('Current')); ?>
1114 </ul>
1115 </li>
1116 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Medical Records','e') ?></span></a>
1117 <ul>
1118 <?php genDualLink('iss','ens',xl('All Injuries/Problems/Issues')); // with ens on bottom ?>
1119 <?php
1120 // Add a container for each issue type.
1121 foreach ($ISSUE_TYPES as $key => $value) {
1122 echo " <li class='open'><a class='collapsed_lv2'><span>" . xl('Active') . " " . $value[0] . "</span></a>\n";
1123 echo " <ul id='icontainer_$key'>\n";
1124 echo " </ul>\n";
1125 echo " </li>\n";
1128 <?php genDualLink('nen','ens',xl('New Consultation')); // with ens on bottom ?>
1129 <?php // genDualLink('enc','ens','Current Consultation'); // with ens on bottom ?>
1130 <?php genTreeLink('RTop','enc',xl('Current Consultation')); // encounter_top will itself load ens on bottom ?>
1131 <?php // genDualLink('dem','ens',xl('Previous Consultations')); // with dem on top ?>
1132 <?php genTreeLink('RBot','ens',xl('Previous Consultations'),true); ?>
1133 <?php genDualLink('his','ens',xl('Prev Med/Surg Hx')); // with ens on bottom ?>
1134 <?php // genPopLink(xl('New Allergy'),'../patient_file/summary/add_edit_issue.php?thistype=allergy','xxx1'); ?>
1135 <?php // genTreeLink('RTop','iss',xl('View/Edit Allergies')); // somehow emphasizing allergies...? ?>
1136 <?php if (!$GLOBALS['disable_immunizations']) genDualLink('his','imm',xl('Immunizations')); // imm on bottom, his on top ?>
1137 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genDualLink('his','pre',xl('Prescriptions')); // pre on bottom, his on top ?>
1138 <?php genTreeLink('RTop','doc',xl('Document/Imaging Store'),true); ?>
1139 <?php genDualLink('dem','pno',xl('Additional Notes')); // with dem on top ?>
1140 </ul>
1141 </li>
1142 <li class="open"><a class="collapsed" id="patimg" ><span><?php xl('Medical Administration','e') ?></span></a>
1143 <ul>
1144 <?php genDualLink('tra','ens',xl('Transactions/Referrals')); // new transaction form on top and tra list on bottom (or ens if no tra) ?>
1145 <?php genPopLink(xl('Address Book'),'../usergroup/addrbook_list.php?popup=1'); ?>
1146 <li><a href='' onClick="return repPopup('../patient_file/letter.php')" id='prp1'>Letter</a></li>
1147 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); ?>
1148 </ul>
1149 </li>
1150 <li class="open"><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
1151 <ul>
1152 <li class="open"><a class="collapsed_lv2"><span><?php xl('Athletic/Injury','e') ?></span></a>
1153 <ul>
1154 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); // also appears above ?>
1155 <?php genPopLink(xl('Games/Events Missed'),'absences_report.php'); ?>
1156 <?php genPopLink(xl('Injury Surveillance'),'football_injury_report.php'); ?>
1157 <?php genPopLink(xl('Team Injury Overview'),'injury_overview_report.php'); ?>
1158 </ul>
1159 </li>
1160 <li><a class="collapsed_lv2"><span><?php xl('Patient/Client','e') ?></span></a>
1161 <ul>
1162 <?php genPopLink(xl('List'),'patient_list.php'); ?>
1163 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genPopLink(xl('Prescriptions'),'prescriptions_report.php'); ?>
1164 <?php genPopLink(xl('Referrals'),'referrals_report.php'); ?>
1165 </ul>
1166 </li>
1167 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
1168 <ul>
1169 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appointments'),'appointments_report.php'); ?>
1170 <?php genPopLink(xl('Encounters'),'encounters_report.php'); ?>
1171 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appt-Enc'),'appt_encounter_report.php'); ?>
1172 </ul>
1173 </li>
1174 <li><a class="collapsed_lv2"><span><?php xl('General','e') ?></span></a>
1175 <ul>
1176 <?php genPopLink(xl('Services'),'services_by_category.php'); ?>
1177 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
1178 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
1179 </ul>
1180 </li>
1181 </ul>
1182 </li>
1183 <?php // TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1184 <?php if(!isset($GLOBALS['enable_fees_in_left_menu']) || $GLOBALS['enable_fees_in_left_menu'] == 1){ ?>
1185 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
1186 <ul>
1187 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
1188 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
1189 </ul>
1190 </li>
1191 <?php } ?>
1192 <?php if (acl_check('menus', 'modle')) {?>
1193 <li><a class="collapsed" id="modimg" ><span><?php echo xlt('Modules') ?></span></a>
1194 <ul>
1195 <?php genMiscLink('RTop','adm','0',xl('Manage Modules'),'modules/zend_modules/public/Installer'); ?>
1196 <?php //genTreeLink('RTop','ort',xl('Settings')); ?>
1198 <?php
1199 $module_query = sqlStatement("select mod_directory,mod_name,mod_nick_name,mod_relative_link,type from modules where mod_active = 1 AND sql_run= 1 order by mod_ui_order asc");
1200 if (sqlNumRows($module_query)) {
1201 while ($modulerow = sqlFetchArray($module_query)) {
1202 $acl_section = strtolower($modulerow['mod_directory']);
1203 $disallowed[$acl_section] = zh_acl_check($_SESSION['authUserID'],$acl_section) ? "" : "1";
1204 $modulePath = "";
1205 $added = "";
1206 if($modulerow['type'] == 0) {
1207 $modulePath = $GLOBALS['customModDir'];
1208 $added = "";
1210 else{
1211 $added = "index";
1212 $modulePath = $GLOBALS['zendModDir'];
1215 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$added;
1216 $mod_nick_name = $modulerow['mod_nick_name'] ? $modulerow['mod_nick_name'] : $modulerow['mod_name'];
1218 <?php genMiscLink2('RTop',$acl_section,'0',xlt($mod_nick_name),$relative_link);
1220 } ?>
1221 </ul>
1222 </li>
1223 <?php }?>
1224 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
1225 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
1226 <ul>
1227 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
1228 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
1229 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
1230 <?php genTreeLink('RTop','pwd','Users Password Change'); ?>
1231 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings'); ?>
1232 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Codes')); ?>
1233 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
1234 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
1235 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
1236 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
1237 <?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'); ?>
1238 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
1239 <ul>
1240 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
1241 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1242 <?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'); ?>
1243 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1244 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1245 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1246 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1247 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1248 </ul>
1249 </li>
1250 </ul>
1251 </li>
1252 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1253 <ul>
1254 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1255 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1256 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1257 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1258 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1259 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1260 <?php if(acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('New Documents'),'../controller.php?document&list&patient_id=0'); ?>
1261 <?php if (acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('Document Templates'),'super/manage_document_templates.php'); ?>
1262 </ul>
1263 </li>
1265 <?php } else { // not athletic team ?>
1266 <?php if (!$GLOBALS['disable_calendar'] && !$GLOBALS['ippf_specific']) genTreeLink('RTop','cal',xl('Calendar')); ?>
1267 <?php if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','pfb',xl('Flow Board')); ?>
1268 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
1269 <?php if ($GLOBALS['lab_exchange_enable']) genTreeLink('RTop', 'lab', xl('Check Lab Results'));?>
1270 <?php if($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address'] && acl_check('patientportal','portal')) genTreeLink('RTop','app',xl('Portal Activity')); ?>
1271 <?php
1272 if ($GLOBALS['gbl_portal_cms_enable'] && acl_check('patientportal','portal')) {
1273 // genTreeLink('RTop','ppo',xl('WordPress Portal'));
1274 genPopLink(xl('CMS Portal'),'../cmsportal/list_requests.php','ppo0');
1278 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Patient/Client','e') ?></span></a>
1279 <ul>
1280 <?php genMiscLink('RTop','fin','0',xl('Patients'),'main/finder/dynamic_finder.php'); ?>
1281 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
1282 <?php genTreeLink('RTop','dem',xl('Summary')); ?>
1283 <li class="open"><a class="expanded_lv2"><span><?php xl('Visits','e') ?></span></a>
1284 <ul>
1285 <?php if ($GLOBALS['ippf_specific'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar')); ?>
1286 <?php genTreeLink('RBot','nen',xl('Create Visit')); ?>
1287 <?php genTreeLink('RBot','enc',xl('Current')); ?>
1288 <?php genTreeLink('RBot','ens',xl('Visit History')); ?>
1289 </ul>
1290 </li>
1292 <li><a class="collapsed_lv2"><span><?php xl('Records','e') ?></span></a>
1293 <ul>
1294 <?php genTreeLink('RTop','prq',xl('Patient Record Request')); ?>
1295 </ul>
1296 </li>
1298 <?php if ($GLOBALS['gbl_nav_visit_forms']) { ?>
1299 <li><a class="collapsed_lv2"><span><?php xl('Visit Forms','e') ?></span></a>
1300 <ul>
1301 <?php
1302 // Generate the items for visit forms, both traditional and LBF.
1305 $lres = sqlStatement("SELECT * FROM list_options " .
1306 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1307 if (sqlNumRows($lres)) {
1308 while ($lrow = sqlFetchArray($lres)) {
1309 $option_id = $lrow['option_id']; // should start with LBF
1310 $title = $lrow['title'];
1311 genMiscLink('RBot','cod','2',xl_form_title($title),
1312 "patient_file/encounter/load_form.php?formname=$option_id");
1315 include_once("$srcdir/registry.inc");
1316 $reg = getRegistered();
1317 if (!empty($reg)) {
1318 foreach ($reg as $entry) {
1319 $option_id = $entry['directory'];
1320 $title = trim($entry['nickname']);
1321 if ($option_id == 'fee_sheet' ) continue;
1322 if ($option_id == 'newpatient') continue;
1323 if (empty($title)) $title = $entry['name'];
1324 genMiscLink('RBot','cod','2',xl_form_title($title),
1325 "patient_file/encounter/load_form.php?formname=" .
1326 urlencode($option_id));
1330 </ul>
1331 </li>
1332 <li class="collapsed" ><a class="collapsed_lv2"><span><?php echo xlt('Import') ?></span></a>
1333 <ul>
1334 <?php genMiscLink('RTop','ccr','0',xlt('Upload'),'patient_file/ccr_import.php'); ?>
1335 <?php genMiscLink('RTop','apr','0',xlt('Pending Approval'),'patient_file/ccr_pending_approval.php'); ?>
1336 </ul>
1337 </li>
1338 <?php } // end if gbl_nav_visit_forms ?>
1340 </ul>
1341 </li>
1342 <?php // TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1343 <?php if(!isset($GLOBALS['enable_fees_in_left_menu']) || $GLOBALS['enable_fees_in_left_menu'] == 1){ ?>
1344 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
1345 <ul>
1346 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
1347 <?php if ($GLOBALS['use_charges_panel']) genTreeLink('RBot','cod',xl('Charges')); ?>
1348 <?php genMiscLink('RBot','pay','1',xl('Payment'),'patient_file/front_payment.php'); ?>
1349 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
1350 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil',xl('Billing')); ?>
1351 <?php genTreeLink('RTop','npa',xl('Batch Payments'),false,2);?>
1352 <?php if ($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob')) genTreeLink('RTop','edi',xl('EDI History'),false,2);?>
1353 </ul>
1354 </li>
1355 <?php } ?>
1356 <?php if (acl_check('menus', 'modle')) {?>
1357 <li><a class="collapsed" id="modimg" ><span><?php echo xlt('Modules') ?></span></a>
1358 <ul>
1359 <?php genMiscLink('RTop','adm','0',xl('Manage Modules'),'modules/zend_modules/public/Installer'); ?>
1360 <?php //genTreeLink('RTop','ort',xl('Settings')); ?>
1362 <?php
1363 $module_query = sqlStatement("select mod_directory,mod_name,mod_nick_name,mod_relative_link,type from modules where mod_active = 1 AND sql_run= 1 order by mod_ui_order asc");
1364 if (sqlNumRows($module_query)) {
1365 while ($modulerow = sqlFetchArray($module_query)) {
1366 $acl_section = strtolower($modulerow['mod_directory']);
1367 $disallowed[$acl_section] = zh_acl_check($_SESSION['authUserID'],$acl_section) ? "" : "1";
1368 $modulePath = "";
1369 $added = "";
1370 if($modulerow['type'] == 0) {
1371 $modulePath = $GLOBALS['customModDir'];
1372 $added = "";
1374 else{
1375 $added = "index";
1376 $modulePath = $GLOBALS['zendModDir'];
1379 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$added;
1380 $mod_nick_name = $modulerow['mod_nick_name'] ? $modulerow['mod_nick_name'] : $modulerow['mod_name'];
1382 <?php genMiscLink2('RTop',$acl_section,'0',xlt($mod_nick_name),$relative_link);?>
1383 <?php }
1384 } ?>
1385 </ul>
1386 </li>
1387 <?php }?>
1388 <?php // if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
1389 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1390 <li><a class="collapsed" id="invimg" ><span><?php xl('Inventory','e') ?></span></a>
1391 <ul>
1392 <?php genMiscLink('RTop','adm','0',xl('Management'),'drugs/drug_inventory.php'); ?>
1393 <?php genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
1394 </ul>
1395 </li>
1396 <?php } ?>
1397 <li><a class="collapsed" id="proimg" ><span><?php xl('Procedures','e') ?></span></a>
1398 <ul>
1399 <?php genTreeLink('RTop','orl',xl('Providers')); ?>
1400 <?php genTreeLink('RTop','ort',xl('Configuration')); ?>
1401 <?php genTreeLink('RTop','orc',xl('Load Compendium')); ?>
1402 <?php genTreeLink('RTop','orp',xl('Pending Review')); ?>
1403 <?php genTreeLink('RTop','orr',xl('Patient Results')); ?>
1404 <?php genTreeLink('RTop','lda',xl('Lab Overview')); ?>
1405 <?php genTreeLink('RTop','orb',xl('Batch Results')); ?>
1406 <?php genTreeLink('RTop','ore',xl('Electronic Reports')); ?>
1407 <?php genTreeLink('RTop','dld',xl('Lab Documents'));?>
1408 </ul>
1409 </li>
1410 <?php
1411 if($GLOBALS['erx_enable']) {
1412 $newcrop_user_role = sqlQuery("SELECT newcrop_user_role FROM users WHERE username = '".$_SESSION['authUser']."'");
1413 if($newcrop_user_role['newcrop_user_role']) {
1415 <li><a class="collapsed" id="feeimg" ><span><?php xl('New Crop','e') ?></span></a>
1416 <ul>
1417 <li><a class="collapsed_lv2"><span><?php xl('Status','e') ?></span></a>
1418 <ul>
1419 <?php genTreeLink('RTop','erx',xl('e-Rx')); ?>
1420 <?php genMiscLink('RTop','err','0',xl('e-Rx Renewal'),'eRx.php?page=status'); ?>
1421 <?php if($newcrop_user_role['newcrop_user_role'] === 'erxadmin') genMiscLink('RTop','ere','0',xl('e-Rx EPCS'),'eRx.php?page=epcs-admin'); ?>
1422 </ul>
1423 </li>
1424 </ul>
1425 </li>
1426 <?php
1430 <?php if (!$disallowed['adm']) { ?>
1431 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
1432 <ul>
1433 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
1434 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
1435 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
1436 <?php if (acl_check('admin', 'practice' )) genTreeLink('RTop','adb',xl('Addr Book')); ?>
1437 <?php
1438 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1439 if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings&pharmacy&action=list'); ?>
1440 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Codes')); ?>
1441 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
1442 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
1443 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
1444 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1445 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1446 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Rules'),'super/rules/index.php?action=browse!list'); ?>
1447 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Alerts'),'super/rules/index.php?action=alerts!listactmgr'); ?>
1448 <?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='); ?>
1449 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
1450 <?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'); ?>
1451 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) genMiscLink('RTop','adm','0',xl('Export'),'main/ippf_export.php'); ?>
1452 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
1453 <ul>
1454 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
1455 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1456 <?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'); ?>
1457 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1458 <?php
1459 if($newcrop_user_role['newcrop_user_role'] || $GLOBALS['erx_enable']) {
1460 if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('eRx Logs'),'logview/erx_logview.php');
1463 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1464 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1465 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Native Data Loads'),'../interface/super/load_codes.php'); ?>
1466 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('External Data Loads'),'../interface/code_systems/dataloads_ajax.php'); ?>
1467 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Merge Patients'),'patient_file/merge_patients.php'); ?>
1468 <?php if ($GLOBALS['enable_auditlog_encryption']) genMiscLink('RTop','rep','0',xl('Audit Log Tamper'),'reports/audit_log_tamper_report.php'); ?>
1469 </ul>
1470 </li>
1471 </ul>
1472 </li>
1473 <?php } ?>
1474 <li><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
1475 <ul>
1476 <?php
1477 $module_query = sqlStatement("SELECT msh.*,ms.menu_name,ms.path,m.mod_ui_name,m.type FROM modules_hooks_settings AS msh LEFT OUTER JOIN modules_settings AS ms ON
1478 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1479 WHERE fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='reports' ORDER BY mod_id");
1480 if (sqlNumRows($module_query)) {
1481 $jid = 0;
1482 $modid = '';
1483 while ($modulerow = sqlFetchArray($module_query)) {
1484 $modulePath = "";
1485 $added = "";
1486 if($modulerow['type'] == 0) {
1487 $modulePath = $GLOBALS['customModDir'];
1488 $added = "";
1490 else{
1491 $added = "index";
1492 $modulePath = $GLOBALS['zendModDir'];
1495 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$modulerow['path'];
1496 $mod_nick_name = $modulerow['menu_name'] ? $modulerow['menu_name'] : 'NoName';
1498 if($jid==0 || ($modid!=$modulerow['mod_id'])){
1499 if($modid!='')
1500 echo "</ul>";
1502 <li><a class="collapsed_lv2"><span><?php echo xlt($modulerow['mod_ui_name']); ?></span></a>
1503 <ul>
1504 <?php
1506 $jid++;
1507 $modid = $modulerow['mod_id'];
1508 genMiscLink('RTop','adm','0',xlt($mod_nick_name),$relative_link);
1510 echo "</ul>";
1511 } ?>
1512 <li><a class="collapsed_lv2"><span><?php xl('Clients','e') ?></span></a>
1513 <ul>
1514 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/patient_list.php'); ?>
1515 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genMiscLink('RTop','rep','0',xl('Rx'),'reports/prescriptions_report.php'); ?>
1516 <?php if (acl_check('patients', 'med')) genMiscLink('RTop','rep','0',xl('Patient List Creation'),'reports/patient_list_creation.php'); ?>
1517 <?php if (acl_check('patients', 'med')) genMiscLink('RTop','rep','0',xl('Clinical'),'reports/clinical_reports.php'); ?>
1518 <?php genMiscLink('RTop','rep','0',xl('Referrals'),'reports/referrals_report.php'); ?>
1519 <?php genMiscLink('RTop','rep','0',xl('Immunization Registry'),'reports/immunization_report.php'); ?>
1520 </ul>
1521 </li>
1522 <li><a class="collapsed_lv2"><span><?php xl('Clinic','e') ?></span></a>
1523 <ul>
1524 <?php if ($GLOBALS['enable_cdr'] || $GLOBALS['enable_cqm'] || $GLOBALS['enable_amc']) genMiscLink('RTop','rep','0',xl('Report Results'),'reports/report_results.php'); ?>
1525 <?php if ($GLOBALS['enable_cdr']) genMiscLink('RTop','rep','0',xl('Standard Measures'),'reports/cqm.php?type=standard'); ?>
1526 <?php if ($GLOBALS['enable_cqm']) genMiscLink('RTop','rep','0',xl('Quality Measures (CQM)'),'reports/cqm.php?type=cqm'); ?>
1527 <?php if ($GLOBALS['enable_amc']) genMiscLink('RTop','rep','0',xl('Automated Measures (AMC)'),'reports/cqm.php?type=amc'); ?>
1528 <?php if ($GLOBALS['enable_amc_tracking']) genMiscLink('RTop','rep','0',xl('AMC Tracking'),'reports/amc_tracking.php'); ?>
1529 <?php if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_alert_log'] ) genMiscLink('RTop','rep','0',xl('Alerts Log'),'reports/cdr_log.php'); ?>
1530 </ul>
1531 </li>
1532 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
1533 <ul>
1534 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appointments'),'reports/appointments_report.php'); ?>
1535 <?php if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Patient Flow Board'),'reports/patient_flow_board_report.php'); ?>
1536 <?php genMiscLink('RTop','rep','0',xl('Encounters'),'reports/encounters_report.php'); ?>
1537 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appt-Enc'),'reports/appt_encounter_report.php'); ?>
1538 <?php if (empty($GLOBALS['code_types']['IPPF'])) { ?>
1539 <?php genMiscLink('RTop','rep','0',xl('Superbill'),'reports/custom_report_range.php'); ?>
1540 <?php } ?>
1541 <?php genMiscLink('RTop','rep','0',xl('Eligibility'),'reports/edi_270.php'); ?>
1542 <?php genMiscLink('RTop','rep','0',xl('Eligibility Response'),'reports/edi_271.php'); ?>
1545 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Chart Activity'),'reports/chart_location_activity.php'); ?>
1546 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Charts Out'),'reports/charts_checked_out.php'); ?>
1547 <?php genMiscLink('RTop','rep','0',xl('Services'), 'reports/services_by_category.php'); ?>
1548 <?php genMiscLink('RTop','rep','0',xl('Syndromic Surveillance'),'reports/non_reported.php'); ?>
1549 </ul>
1550 </li>
1551 <?php if (acl_check('acct', 'rep_a')) { ?>
1552 <li><a class="collapsed_lv2"><span><?php xl('Financial','e') ?></span></a>
1553 <ul>
1554 <?php genMiscLink('RTop','rep','0',xl('Sales'),'reports/sales_by_item.php'); ?>
1555 <?php genMiscLink('RTop','rep','0',xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
1556 <?php genMiscLink('RTop','rep','0',xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
1557 <?php genMiscLink('RTop','rep','0',xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
1558 <?php genMiscLink('RTop','rep','0',xl('Collections'), 'reports/collections_report.php'); ?>
1559 <?php genMiscLink('RTop','rep','0',xl('Pat Ledger'),'reports/pat_ledger.php?form=0'); ?>
1560 <?php genMiscLink('RTop','rep','0',xl('Financial Summary by Service Code'),'reports/svc_code_financial_report.php'); ?>
1561 </ul>
1562 </li>
1563 <?php } ?>
1564 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
1565 <li><a class="collapsed_lv2"><span><?php xl('Inventory','e') ?></span></a>
1566 <ul>
1567 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/inventory_list.php'); ?>
1568 <?php genMiscLink('RTop','rep','0',xl('Activity'),'reports/inventory_activity.php'); ?>
1569 <?php genMiscLink('RTop','rep','0',xl('Transactions'),'reports/inventory_transactions.php'); ?>
1570 </ul>
1571 </li>
1572 <?php } ?>
1573 <li><a class="collapsed_lv2"><span><?php xl('Procedures','e') ?></span></a>
1574 <ul>
1575 <?php genPopLink(xl('Pending Res'),'../orders/pending_orders.php'); ?>
1576 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink(xl('Pending F/U'),'../orders/pending_followup.php'); ?>
1577 <?php genPopLink(xl('Statistics'),'../orders/procedure_stats.php'); ?>
1578 </ul>
1579 </li>
1580 <?php if (! $GLOBALS['simplified_demographics']) { ?>
1581 <li><a class="collapsed_lv2"><span><?php xl('Insurance','e') ?></span></a>
1582 <ul>
1583 <?php genMiscLink('RTop','rep','0',xl('Distribution'),'reports/insurance_allocation_report.php'); ?>
1584 <?php genMiscLink('RTop','rep','0',xl('Indigents'),'billing/indigent_patients_report.php'); ?>
1585 <?php genMiscLink('RTop','rep','0',xl('Unique SP'),'reports/unique_seen_patients_report.php'); ?>
1586 </ul>
1587 </li>
1588 <?php } ?>
1589 <?php if (!empty($GLOBALS['code_types']['IPPF'])) { ?>
1590 <li><a class="collapsed_lv2"><span><?php xl('Statistics','e') ?></span></a>
1591 <ul>
1592 <?php genPopLink(xl('IPPF Stats'),'ippf_statistics.php?t=i'); ?>
1593 <?php genPopLink(xl('GCAC Stats'),'ippf_statistics.php?t=g'); ?>
1594 <?php genPopLink(xl('MA Stats'),'ippf_statistics.php?t=m'); ?>
1595 <?php genPopLink(xl('CYP'),'ippf_cyp_report.php'); ?>
1596 <?php genPopLink(xl('Daily Record'),'ippf_daily.php'); ?>
1597 </ul>
1598 </li>
1599 <?php } // end ippf-specific ?>
1600 <li><a class="collapsed_lv2"><span><?php xl('Blank Forms','e') ?></span></a>
1601 <ul>
1602 <?php genPopLink(xl('Demographics'),'../patient_file/summary/demographics_print.php'); ?>
1603 <?php genPopLink(xl('Superbill/Fee Sheet'),'../patient_file/printed_fee_sheet.php'); ?>
1604 <?php genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php'); ?>
1605 <?php
1606 $lres = sqlStatement("SELECT * FROM list_options " .
1607 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1608 while ($lrow = sqlFetchArray($lres)) {
1609 $option_id = $lrow['option_id']; // should start with LBF
1610 $title = $lrow['title'];
1611 genPopLink($title, "../forms/LBF/printable.php?formname=$option_id");
1614 </ul>
1615 </li>
1616 <?php if (acl_check('admin','super')) { ?>
1617 <li><a class="collapsed_lv2"><span><?php echo xlt('Services') ?></span></a>
1618 <ul>
1619 <?php genMiscLink('RTop','rep','0',xl('Background Services'),'reports/background_services.php'); ?>
1620 <?php genMiscLink('RTop','rep','0',xl('Direct Message Log'),'reports/direct_message_log.php'); ?>
1621 </ul>
1622 </li>
1623 <?php } ?>
1625 <?php // genTreeLink('RTop','rep','Other'); ?>
1626 </ul>
1627 </li>
1628 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1629 <ul>
1630 <?php genTreeLink('RTop','ped',xl('Patient Education')); ?>
1631 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1632 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1633 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1634 <?php genTreeLink('RTop','ort',xl('Order Catalog')); ?>
1635 <?php if (!$GLOBALS['disable_chart_tracker']) genTreeLink('RTop','cht',xl('Chart Tracker')); ?>
1636 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1637 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1638 <?php $myrow = sqlQuery("SELECT state FROM registry WHERE directory = 'track_anything'");
1639 if($myrow['state']=='1') { genTreeLink('RTop','tan',xl('Configure Tracks')); } ?>
1640 <?php genTreeLink('RTop','pwd',xl('Password')); ?>
1641 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1642 <?php if(acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('New Documents'),'../controller.php?document&list&patient_id=00'); ?>
1643 <?php if (acl_check('patients','docs')) genMiscLink('RTop','adm','0',xl('Document Templates'),'super/manage_document_templates.php'); ?>
1644 </ul>
1645 </li>
1647 <?php } // end not athletic team ?>
1649 </ul>
1651 <?php } else { // end ($GLOBALS['concurrent_layout'] == 2 || $GLOBALS['concurrent_layout'] == 3) ?>
1653 <table cellpadding='0' cellspacing='0' border='0'>
1654 <tr>
1655 <td colspan='3'>
1656 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1657 <tr>
1658 <td class='smalltext' nowrap>
1659 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
1660 </td>
1661 <td class='smalltext' align='right' nowrap>
1662 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
1663 </td>
1664 </tr>
1665 </table>
1666 </td>
1667 </tr>
1668 <?php
1669 // Builds the table of radio buttons and their labels. Radio button values
1670 // are comprised of the 3-character document id and the 1-digit usage type,
1671 // so that JavaScript can easily access this information.
1672 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
1673 foreach ($primary_docs as $key => $varr) {
1674 if (!empty($disallowed[$key])) continue;
1675 $label = $varr[0];
1676 $usage = $varr[1];
1677 $url = $varr[2];
1678 echo " <tr>\n";
1679 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
1680 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
1681 if ($key == $default_top_rbid) echo " checked";
1682 echo " /></td>\n";
1683 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
1684 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
1685 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
1686 if ($key == 'msg') echo " checked";
1687 echo " /></td>\n";
1688 echo " </tr>\n";
1691 </table>
1693 <?php } ?>
1695 <br /><hr />
1697 <?php
1698 // To use RelayHealth, see comments and parameters in includes/config.php.
1699 if (!empty($GLOBALS['ssi']['rh'])) {
1700 include_once("../../library/ssi.inc");
1701 echo getRelayHealthLink() ."<br /><hr />\n";
1705 <div id='current_patient' style = 'display:none'>
1706 <b><?php xl('None','e'); ?></b>
1707 </div>
1709 <div id='current_encounter' style = 'display:none'>
1710 <b><?php xl('None','e'); ?></b>
1711 </div>
1713 <?php
1714 if (!$GLOBALS['athletic_team']) {
1715 genPopupsList();
1716 echo "<hr />\n";
1717 genFindBlock();
1718 echo "<hr />\n";
1722 <input type='hidden' name='findBy' value='Last' />
1723 <input type="hidden" name="searchFields" id="searchFields"/>
1724 <input type="hidden" name="search_service_code" value='' />
1726 </form>
1728 <script language='JavaScript'>
1729 syncRadios();
1730 </script>
1732 </body>
1733 </html>