Navigation area rearrangment with issues added, and some other things specific to...
[openemr.git] / interface / main / left_nav.php
blob15a93dd158e7f69c41aee23845d56462ffad0257
1 <?php
2 // Copyright (C) 2006-2011 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // This provides the left navigation frame when $GLOBALS['concurrent_layout']
10 // is true. Following are notes as to what else was changed for this feature:
12 // * interface/main/main_screen.php: the top-level frameset.
13 // * interface/main/finder/patient_select.php: loads stuff when a new patient
14 // is selected.
15 // * interface/patient_file/summary/demographics.php: this is the first frame
16 // loaded when a new patient is chosen, and in turn sets the current pid and
17 // then loads the initial bottom frame.
18 // * interface/patient_file/summary/demographics_full.php: added support for
19 // setting a new pid, needed for going to demographics from billing.
20 // * interface/patient_file/summary/demographics_save.php: redisplay
21 // demographics.php and not the frameset.
22 // * interface/patient_file/summary/summary_bottom.php: new frameset for the
23 // summary, prescriptions and notes for a selected patient, cloned from
24 // patient_summary.php.
25 // * interface/patient_file/encounter/encounter_bottom.php: new frameset for
26 // the selected encounter, mosting coding/billing stuff, cloned from
27 // patient_encounter.php. This will also self-load the superbill pages
28 // as requested.
29 // * interface/usergroup/user_info.php: removed Back link.
30 // * interface/usergroup/admin_frameset.php: new frameset for Admin pages,
31 // cloned from usergroup.php.
32 // * interface/main/onotes/office_comments.php: removed Back link target.
33 // * interface/main/onotes/office_comments_full.php: changed Back link.
34 // * interface/billing/billing_report.php: removed Back link; added logic
35 // to properly go to demographics or to an encounter when requested.
36 // * interface/new/new.php: removed Back link and revised form target.
37 // * interface/new/new_patient_save.php: modified to load the demographics
38 // page to the current frame instead of loading a new frameset.
39 // * interface/patient_file/history/history.php: target change.
40 // * interface/patient_file/history/history_full.php: target changes.
41 // * interface/patient_file/history/history_save.php: target change.
42 // * interface/patient_file/history/encounters.php: link/target changes.
43 // * interface/patient_file/encounter/encounter_top.php: another new frameset
44 // cloned from patient_encounter.php.
45 // * interface/patient_file/encounter/forms.php: link target removal.
46 // * interface/patient_file/encounter/new_form.php: target change.
47 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
48 // changes.
49 // * interface/patient_file/summary/immunizations.php: removed back link.
50 // * interface/patient_file/summary/pnotes.php: changed link targets.
51 // * interface/patient_file/summary/pnotes_full.php: changed back link and
52 // added set_pid logic.
53 // * interface/patient_file/transaction/transactions.php: various changes.
54 // * interface/patient_file/transaction/add_transaction.php: new return js.
55 // * interface/patient_file/encounter/superbill_codes.php: target and link
56 // changes.
57 // * interface/patient_file/encounter/superbill_custom_full.php: target and
58 // link changes.
59 // * interface/patient_file/encounter/diagnosis.php: target changes.
60 // * interface/patient_file/encounter/diagnosis_full.php: target and link
61 // changes.
62 // * interface/main/authorizations/authorizations.php: link and target changes.
63 // * library/api.inc: url change.
64 // * interface/patient_file/summary/rx_frameset.php: new frameset.
65 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
66 // * all encounter forms: remove all instances of "target=Main" and change
67 // all instances of "patient_encounter.php" to "encounter_top.php".
69 // Our find_patient form, when submitted, invokes patient_select.php in the
70 // upper frame. When the patient is selected, demographics.php is invoked
71 // with the set_pid parameter, which establishes the new session pid and also
72 // calls the setPatient() function (below). In this case demographics.php
73 // will also load the summary frameset into the bottom frame, invoking our
74 // loadFrame() and setRadio() functions.
76 // Similarly, we have the concept of selecting an encounter from the
77 // Encounters list, and then having that "stick" until some other encounter
78 // or a new encounter is chosen. We also have a navigation item for creating
79 // a new encounter. interface/patient_file/encounter/encounter_top.php
80 // supports set_encounter to establish an encounter.
82 // TBD: Include active_pid and/or active_encounter in relevant submitted
83 // form data, and add logic to the save routines to make sure they match
84 // the corresponding session values.
86 require_once("../globals.php");
87 require_once($GLOBALS['fileroot']."/library/acl.inc");
88 require_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
89 require_once($GLOBALS['fileroot']."/library/patient.inc");
90 require_once($GLOBALS['fileroot']."/library/lists.inc");
92 // This array defines the list of primary documents that may be
93 // chosen. Each element value is an array of 3 values:
95 // * Name to appear in the navigation table
96 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific
97 // * The URL relative to the interface directory
100 $primary_docs = array(
101 'ros' => array(xl('Roster') , 0, 'reports/players_report.php?embed=1'),
102 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
103 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php'),
104 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
105 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
106 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
107 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
108 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
109 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
110 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
111 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
112 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
113 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
114 'imp' => array(xl('Import') , 0, '../custom/import.php'),
115 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
116 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
117 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
118 'new' => array(xl('New Pt') , 0, 'new/new.php'),
119 'lab' => array(xl('Check Lab Results') , 0, 'orders/lab_exchange.php'),
120 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
121 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
122 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
123 'nen' => array(xl('Create Visit'), 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
124 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
125 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
126 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
127 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
128 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
129 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
130 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
131 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
132 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
133 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
134 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
136 $primary_docs['npa']=array(xl('Payments') , 0, 'billing/new_payment.php');
137 if ($GLOBALS['use_charges_panel'] || $GLOBALS['concurrent_layout'] == 2) {
138 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
141 // This section decides which navigation items will not appear.
143 $disallowed = array();
145 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
146 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
147 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
148 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
149 acl_check('admin', 'superbill'));
151 $disallowed['bil'] = !(acl_check('acct', 'rep') || acl_check('acct', 'eob') ||
152 acl_check('acct', 'bill'));
154 $tmp = acl_check('patients', 'demo');
155 $disallowed['new'] = !($tmp == 'write' || $tmp == 'addonly');
157 $disallowed['fax'] = !($GLOBALS['enable_hylafax'] || $GLOBALS['enable_scanner']);
159 $disallowed['ros'] = !$GLOBALS['athletic_team'];
161 $disallowed['iss'] = !((acl_check('encounters', 'notes') == 'write' ||
162 acl_check('encounters', 'notes_a') == 'write') &&
163 acl_check('patients', 'med') == 'write');
165 $disallowed['imp'] = $disallowed['new'] ||
166 !is_readable("$webserver_root/custom/import.php");
168 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
170 $disallowed['pre'] = !(acl_check('patients', 'med'));
172 // Helper functions for treeview generation.
173 function genTreeLink($frame, $name, $title, $mono=false) {
174 global $primary_docs, $disallowed;
175 if (empty($disallowed[$name])) {
176 $id = $name . $primary_docs[$name][1];
177 echo "<li><a href='' id='$id' onclick=\"";
178 if ($mono) {
179 if ($frame == 'RTop')
180 echo "forceSpec(true,false);";
181 else
182 echo "forceSpec(false,true);";
184 echo "return loadFrame2('$id','$frame','" .
185 $primary_docs[$name][2] . "')\">" . $title . "</a></li>";
188 function genMiscLink($frame, $name, $level, $title, $url, $mono=false) {
189 global $disallowed;
190 if (empty($disallowed[$name])) {
191 $id = $name . $level;
192 echo "<li><a href='' id='$id' onclick=\"";
193 if ($mono) {
194 if ($frame == 'RTop')
195 echo "forceSpec(true,false);";
196 else
197 echo "forceSpec(false,true);";
199 echo "return loadFrame2('$id','$frame','" .
200 $url . "')\">" . $title . "</a></li>";
203 function genPopLink($title, $url, $linkid='') {
204 echo "<li><a href='' ";
205 if ($linkid) echo "id='$linkid' ";
206 echo "onclick=\"return repPopup('$url')\"" .
207 ">" . $title . "</a></li>";
209 function genDualLink($topname, $botname, $title) {
210 global $primary_docs, $disallowed;
211 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
212 $topid = $topname . $primary_docs[$topname][1];
213 $botid = $botname . $primary_docs[$botname][1];
214 echo "<li><a href='' id='$topid' " .
215 "onclick=\"return loadFrameDual('$topid','$botid','" .
216 $primary_docs[$topname][2] . "','" .
217 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
221 function genPopupsList($style='') {
222 global $disallowed, $webserver_root;
224 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
225 <option value=''><?php xl('Popups','e'); ?></option>
226 <?php if (!$disallowed['iss']) { ?>
227 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
228 <?php } ?>
229 <?php if (!$GLOBALS['ippf_specific']) { ?>
230 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
231 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
232 <?php } ?>
233 <?php if ($GLOBALS['athletic_team']) { ?>
234 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
235 <?php } ;
236 if (!$GLOBALS['disable_calendar']) { ?>
237 <option value='../reports/appointments_report.php?patient=<?php echo $pid ?>'><?php xl('Appts','e'); ?></option>
238 <?php } ;
239 if (file_exists("$webserver_root/custom/refer.php")) { ?>
240 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
241 <?php } ?>
242 <?php // if (file_exists("$webserver_root/custom/fee_sheet_codes.php")) { ?>
243 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill','e'); ?></option>
244 <?php // } ?>
245 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
246 <option value='../patient_file/front_payment.php'><?php xl('Prepay','e'); ?></option>
247 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
248 <?php } else { ?>
249 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
250 <?php } ?>
251 <?php if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates")) { ?>
252 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
253 <?php } ?>
254 </select>
255 <?php
259 <html>
260 <head>
261 <title>Navigation</title>
262 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
264 <style type="text/css">
265 body {
266 font-size:8pt;
267 font-weight:normal;
268 padding: 5px 3px 5px 3px;
270 .smalltext {
271 font-family:sans-serif;
272 font-size:8pt;
273 font-weight:normal;
275 a.navitem, a.navitem:visited {
276 color:#0000ff;
277 font-family:sans-serif;
278 font-size:8pt;
279 font-weight:bold;
281 .inputtext {
282 font-size:9pt;
283 font-weight:normal;
284 border-style:solid;
285 border-width:1px;
286 padding-left:2px;
287 padding-right:2px;
288 border-color: #000000;
289 background-color:transparent;
292 #navigation ul {
293 background-color:transparent;
295 #navigation-slide ul {
296 background-color:transparent;
298 .nav-menu-img{
299 width:25px;
300 height:25px;
301 border:none;
302 margin-right:5px;
303 vertical-align:middle;
305 </style>
307 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.3/jquery.treeview.css" />
308 <script src="../../library/js/jquery-1.2.2.min.js" type="text/javascript"></script>
309 <script src="../../library/js/jquery.treeview-1.3/jquery.treeview.min.js" type="text/javascript"></script>
311 <script type="text/javascript" src="../../library/dialog.js"></script>
313 <script language='JavaScript'>
315 // Master values for current pid and encounter.
316 var active_pid = 0;
317 var active_encounter = 0;
319 // Current selections in the top and bottom frames.
320 var topName = '';
321 var botName = '';
323 // Expand and/or collapse frames in response to checkbox clicks.
324 // fnum indicates which checkbox was clicked (1=left, 2=right).
325 function toggleFrame(fnum) {
326 var f = document.forms[0];
327 var fset = top.document.getElementById('fsright');
328 if (!f.cb_top.checked && !f.cb_bot.checked) {
329 if (fnum == 1) f.cb_bot.checked = true;
330 else f.cb_top.checked = true;
332 var rows = f.cb_top.checked ? '*' : '0';
333 rows += f.cb_bot.checked ? ',*' : ',0';
334 fset.rows = rows;
335 fset.rows = rows;
338 // Load the specified url into the specified frame (RTop or RBot).
339 // The URL provided must be relative to interface.
340 function loadFrame(fname, frame, url) {
341 top.restoreSession();
342 var i = url.indexOf('{PID}');
343 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
344 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
345 if (frame == 'RTop') topName = fname; else botName = fname;
348 // Load the specified url into a frame to be determined, with the specified
349 // frame as the default; the url must be relative to interface.
350 function loadFrame2(fname, frame, url) {
351 var usage = fname.substring(3);
352 if (active_pid == 0 && usage > '0') {
353 alert('<?php xl('You must first select or add a patient.','e') ?>');
354 return false;
356 if (active_encounter == 0 && usage > '1') {
357 alert('<?php xl('You must first select or create an encounter.','e') ?>');
358 return false;
360 var f = document.forms[0];
361 top.restoreSession();
362 var i = url.indexOf('{PID}');
363 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
364 if(f.sel_frame)
366 var fi = f.sel_frame.selectedIndex;
367 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
369 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
370 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
371 if (frame == 'RTop') topName = fname; else botName = fname;
372 return false;
375 // Make sure the the top and bottom frames are open or closed, as specified.
376 function forceSpec(istop, isbot) {
377 var f = document.forms[0];
378 if (f.cb_top.checked != istop) {
379 f.cb_top.checked = istop;
380 toggleFrame(1);
382 if (f.cb_bot.checked != isbot) {
383 f.cb_bot.checked = isbot;
384 toggleFrame(2);
388 // Make sure both frames are open.
389 function forceDual() {
390 forceSpec(true, true);
393 // Load the specified url into a frame to be determined, with the specified
394 // frame as the default; the url must be relative to interface.
395 function loadFrameDual(tname, bname, topurl, boturl) {
396 var topusage = tname.substring(3);
397 var botusage = bname.substring(3);
398 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
399 alert('<?php xl('You must first select or add a patient.','e') ?>');
400 return false;
402 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
403 alert('<?php xl('You must first select or create an encounter.','e') ?>');
404 return false;
406 var f = document.forms[0];
407 forceDual();
408 top.restoreSession();
409 var i = topurl.indexOf('{PID}');
410 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
411 i = boturl.indexOf('{PID}');
412 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
413 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
414 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
415 topName = tname;
416 botName = bname;
417 return false;
420 // Select a designated radio button. raname may be either the radio button
421 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
422 // You should call this if you directly load a document that does not
423 // correspond to the current radio button setting.
424 function setRadio(raname, rbid) {
425 <?php if ($GLOBALS['concurrent_layout'] < 2) { ?>
426 var f = document.forms[0];
427 if (raname == 'RTop') raname = 'rb_top';
428 if (raname == 'RBot') raname = 'rb_bot';
429 for (var i = 0; i < f[raname].length; ++i) {
430 if (f[raname][i].value.substring(0,3) == rbid) {
431 f[raname][i].checked = true;
432 return true;
435 <?php } ?>
436 return false;
439 // Set disabled/enabled state of radio buttons and associated labels
440 // depending on whether there is an active patient or encounter.
441 function syncRadios() {
442 var f = document.forms[0];
443 <?php if (($GLOBALS['concurrent_layout'] == 2)||($GLOBALS['concurrent_layout'] == 3)) { ?>
444 var nlinks = document.links.length;
445 for (var i = 0; i < nlinks; ++i) {
446 var lnk = document.links[i];
447 if (lnk.id.length != 4) continue;
448 var usage = lnk.id.substring(3);
449 if (usage == '1' || usage == '2') {
450 var da = false;
451 if (active_pid == 0) da = true;
452 if (active_encounter == 0 && usage > '1') da = true;
453 <?php
454 if ($GLOBALS['concurrent_layout'] == 2){
455 $color = "'#0000ff'";
456 }else{
457 $color = "'#000000'";
460 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
463 <?php } else if ($GLOBALS['concurrent_layout'] < 2) { ?>
464 for (var i = 0; i < f.rb_top.length; ++i) {
465 var da = false;
466 var rb1 = f.rb_top[i];
467 var rb2 = f.rb_bot[i];
468 var rbid = rb1.value.substring(0,3);
469 var usage = rb1.value.substring(3);
470 if (active_pid == 0 && usage > '0') da = true;
471 if (active_encounter == 0 && usage > '1') da = true;
472 // daemon_frame can also set special label colors, so don't mess with
473 // them unless we have to.
474 if (rb1.disabled != da) {
475 rb1.disabled = da;
476 rb2.disabled = da;
477 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
480 <?php } ?>
481 f.popups.disabled = (active_pid == 0);
484 function goHome() {
485 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
486 top.frames['RBot'].location='messages/messages.php';
489 // Reference to the search.php window.
490 var my_window;
492 // Open the search.php window.
493 function initFilter() {
494 my_window = window.open("../../custom/search.php", "mywindow","status=1");
497 // This is called by the search.php (Filter) window.
498 function processFilter(fieldString, serviceCode) {
499 var f = document.forms[0];
500 document.getElementById('searchFields').value = fieldString;
501 f.search_service_code.value = serviceCode;
502 findPatient("Filter");
503 f.search_service_code.value = '';
504 my_window.close();
507 // Process the click to find a patient by name, id, ssn or dob.
508 function findPatient(findby) {
509 var f = document.forms[0];
510 if (! f.cb_top.checked) {
511 f.cb_top.checked = true;
512 toggleFrame(1);
514 f.findBy.value = findby;
515 setRadio('rb_top', 'dem');
516 top.restoreSession();
517 document.find_patient.submit();
520 // Helper function to set the contents of a div.
521 function setSomeContent(id, content, doc) {
522 if (doc.getElementById) {
523 var x = doc.getElementById(id);
524 x.innerHTML = '';
525 x.innerHTML = content;
527 else if (doc.all) {
528 var x = doc.all[id];
529 x.innerHTML = content;
532 function setDivContent(id, content) {
533 setSomeContent(id, content, document);
535 function setTitleContent(id, content) {
536 setSomeContent(id, content, parent.Title.document);
539 // This is called automatically when a new patient is set, to make sure
540 // there are no patient-specific documents showing stale data. If a frame
541 // was just loaded with data for the correct patient, its name is passed so
542 // that it will not be zapped. At this point the new server-side pid is not
543 // assumed to be set, so this function will only load global data.
544 function reloadPatient(frname) {
545 var f = document.forms[0];
546 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
547 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
548 setRadio('rb_top', 'cal');
550 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
551 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
552 setRadio('rb_bot', 'ens');
556 // Reload encounter-specific frames, excluding a specified frame. At this
557 // point the new server-side encounter ID may not be set and loading the same
558 // document for the new encounter will not work, so load patient info instead.
559 function reloadEncounter(frname) {
560 var f = document.forms[0];
561 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
562 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
563 setRadio('rb_top', 'dem');
565 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
566 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
567 setRadio('rb_bot', 'ens');
571 // Clear and reload issue-related menu items for active_pid.
572 // Currently this only applies to athletic teams, but might be implemented
573 // in the general menu at some future time.
575 function reloadIssues() {
576 <?php
577 if ($GLOBALS['athletic_team']) {
578 // Generates a menu item for each active issue that this patient
579 // has of each issue type. Each one looks like this:
580 // Onset-Date Issue-Title [List] [Add]
581 // where the first part is a link to open the issue dialog,
582 // [List] is a link that shows related encounters, and
583 // [Add] is a link that auto-creates and opens a new encounter.
584 foreach ($ISSUE_TYPES as $key => $value) {
586 $('#icontainer_<?php echo $key ?>').empty();
587 if (active_pid != 0) {
588 $('#icontainer_<?php echo $key ?>').append("<li>" +
589 "<a href='' id='xxx1' onclick='return repPopup(" +
590 "\"../patient_file/summary/add_edit_issue.php?thistype=" +
591 "<?php echo $key; ?>\")' " +
592 "title='<?php echo xl('Create new issue'); ?>'>" +
593 "<?php echo xl('New') . " " . $value[1]; ?></a></li>");
594 top.restoreSession();
595 $.getScript('../../library/ajax/left_nav_issues_ajax.php?type=<?php echo $key; ?>');
597 <?php
601 } // end function reloadIssues
603 // This is referenced in left_nav_issues_ajax.php and is called when [Add]
604 // is clicked for an issue menu item to add encounter notes to a new or
605 // existing encounter linked to that issue. So far this only applies to
606 // the Athletic Team version of the menu.
608 function addEncNotes(issue) {
609 top.restoreSession();
610 $.getScript('../../library/ajax/left_nav_encounter_ajax.php?issue=' + issue);
611 return false;
614 // Call this to announce that the patient has changed. You must call this
615 // if you change the session PID, so that the navigation frame will show the
616 // correct patient and so that the other frame will be reloaded if it contains
617 // patient-specific information from the previous patient. frname is the name
618 // of the frame that the call came from, so we know to only reload content
619 // from the *other* frame if it is patient-specific.
620 function setPatient(pname, pid, pubpid, frname, str_dob) {
621 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
622 setDivContent('current_patient', str);
623 setTitleContent('current_patient', str + str_dob);
624 if (pid == active_pid) return;
625 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
626 active_pid = pid;
627 active_encounter = 0;
628 if (frname) reloadPatient(frname);
629 syncRadios();
630 $(parent.Title.document.getElementById('current_patient_block')).show();
631 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
632 $(encounter_block).hide();
634 // zero out the encounter frame, replace it with the encounter list frame
635 var f = document.forms[0];
636 if ( f.cb_top.checked && f.cb_bot.checked ) {
637 var encounter_frame = getEncounterTargetFrame('enc');
638 if ( encounter_frame != undefined ) {
639 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
640 setRadio(encounter_frame, 'ens');
644 reloadIssues(pid);
646 function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) {
647 //This function lists all encounters of the patient.
648 //This function writes the drop down in the top frame.
649 //It is called when a new patient is create/selected from the search menu.
650 var str = '<Select class="text" id="EncounterHistory" onchange="toencounter(this.options[this.selectedIndex].value)">';
651 str+='<option value=""><?php echo htmlspecialchars( xl('Encounter History'), ENT_QUOTES) ?></option>';
652 str+='<option value="New Encounter"><?php echo htmlspecialchars( xl('New Encounter'), ENT_QUOTES) ?></option>';
653 str+='<option value="Past Encounter List"><?php echo htmlspecialchars( xl('Past Encounter List'), ENT_QUOTES) ?></option>';
654 for(CountEncounter=0;CountEncounter<EncounterDateArray.length;CountEncounter++)
656 str+='<option value="'+EncounterIdArray[CountEncounter]+'~'+EncounterDateArray[CountEncounter]+'">'+EncounterDateArray[CountEncounter]+'-'+CalendarCategoryArray[CountEncounter]+'</option>';
658 str+='</Select>';
659 $(parent.Title.document.getElementById('past_encounter_block')).show();
660 top.window.parent.Title.document.getElementById('past_encounter').innerHTML=str;
663 function loadCurrentPatientFromTitle() {
664 top.frames['RTop'].location='../patient_file/summary/demographics.php';
667 function getEncounterTargetFrame( name ) {
668 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
669 var f = document.forms[0];
670 var r = 'RTop';
671 if (f.cb_top.checked && f.cb_bot.checked) {
672 if ( bias == 2 ) {
673 r = 'RBot';
674 } else {
675 r = 'RTop';
677 } else {
678 if ( f.cb_top.checked ) {
679 r = 'RTop';
680 } else if ( f.cb_bot.checked ) {
681 r = 'RBot';
684 return r;
687 // Call this to announce that the encounter has changed. You must call this
688 // if you change the session encounter, so that the navigation frame will
689 // show the correct encounter and so that the other frame will be reloaded if
690 // it contains encounter-specific information from the previous encounter.
691 // frname is the name of the frame that the call came from, so we know to only
692 // reload encounter-specific content from the *other* frame.
693 function setEncounter(edate, eid, frname) {
694 if (eid == active_encounter) return;
695 if (!eid) edate = '<?php xl('None','e'); ?>';
696 var str = '<b>' + edate + '</b>';
697 setDivContent('current_encounter', str);
698 active_encounter = eid;
699 reloadEncounter(frname);
700 syncRadios();
701 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
702 var encounter = $(parent.Title.document.getElementById('current_encounter'));
703 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
704 encounter.html( estr );
705 encounter_block.show();
708 function loadCurrentEncounterFromTitle() {
709 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/encounter_top.php';
712 // You must call this if you delete the active patient (or if for any other
713 // reason you "close" the active patient without opening a new one), so that
714 // the appearance of the navigation frame will be correct and so that any
715 // stale content will be reloaded.
716 function clearPatient() {
717 if (active_pid == 0) return;
718 var f = document.forms[0];
719 active_pid = 0;
720 active_encounter = 0;
721 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
722 setTitleContent('current_patient', '<b><?php xl('None','e'); ?></b>');
723 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
724 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
725 reloadPatient('');
726 syncRadios();
729 // You must call this if you delete the active encounter (or if for any other
730 // reason you "close" the active encounter without opening a new one), so that
731 // the appearance of the navigation frame will be correct and so that any
732 // stale content will be reloaded.
733 function clearEncounter() {
734 if (active_encounter == 0) return;
735 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
736 active_encounter = 0;
737 reloadEncounter('');
738 syncRadios();
740 function removeOptionSelected(EncounterId)
741 {//Removes an item from the Encounter drop down.
742 var elSel = top.window.parent.Title.document.getElementById('EncounterHistory');
743 var i;
744 for (i = elSel.length - 1; i>=2; i--) {
745 EncounterHistoryValue=elSel.options[i].value;
746 EncounterHistoryValueArray=EncounterHistoryValue.split('~');
747 if (EncounterHistoryValueArray[0]==EncounterId) {
748 elSel.remove(i);
753 // You can call this to make sure the session pid is what we expect.
754 function pidSanityCheck(pid) {
755 if (pid != active_pid) {
756 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
757 '. This session is unstable and should be abandoned. Do not use ' +
758 'OpenEMR in multiple browser windows!');
759 return false;
761 return true;
764 // You can call this to make sure the session encounter is what we expect.
765 function encounterSanityCheck(eid) {
766 if (eid != active_encounter) {
767 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
768 '. This session is unstable and should be abandoned. Do not use ' +
769 'OpenEMR in multiple browser windows!');
770 return false;
772 return true;
775 // Pop up a report.
776 function repPopup(aurl) {
777 top.restoreSession();
778 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
779 return false;
782 // This is invoked to pop up some window when a popup item is selected.
783 function selpopup(selobj) {
784 var i = selobj.selectedIndex;
785 var opt = selobj.options[i];
786 if (i > 0) {
787 var width = 750;
788 var height = 550;
789 if (opt.text == 'Export' || opt.text == 'Import') {
790 width = 500;
791 height = 400;
793 else if (opt.text == 'Refer') {
794 width = 700;
795 height = 500;
797 dlgopen(opt.value, '_blank', width, height);
799 selobj.selectedIndex = 0;
801 // Treeview activation stuff:
802 $(document).ready(function(){
803 if(3 == <?php echo $GLOBALS['concurrent_layout'] ?>){
804 $("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
805 $("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
806 $("#navigation-slide > li > a.expanded").click(function() {
807 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
808 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
810 $("#navigation-slide > li > a.collapsed").click(function() {
811 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
812 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
814 $("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
815 $("#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");
816 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
818 $("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
819 $("#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");
820 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
822 $("#navigation-slide > li > a#cal0").prepend('<img src="../../images/calendar.png" class="nav-menu-img" />');
823 $("#navigation-slide > li > a#msg0").prepend('<img src="../../images/messages.png" class="nav-menu-img" />');
824 $("#navigation-slide > li > a#patimg").prepend('<img src="../../images/patient.png" class="nav-menu-img" />');
825 $("#navigation-slide > li > a#repimg").prepend('<img src="../../images/reports.png" class="nav-menu-img" />');
826 $("#navigation-slide > li > a#feeimg").prepend('<img src="../../images/fee.png" class="nav-menu-img" />');
827 $("#navigation-slide > li > a#adm0").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
828 $("#navigation-slide > li > a#invimg").prepend('<img src="../../images/inventory.png" class="nav-menu-img" />');
829 $("#navigation-slide > li > a#admimg").prepend('<img src="../../images/admin.png" class="nav-menu-img" />');
830 $("#navigation-slide > li > a#misimg").prepend('<img src="../../images/misc.png" class="nav-menu-img" />');
831 $("#navigation-slide > li > a#proimg").prepend('<img src="../../images/procedures.png" class="nav-menu-img" />');
832 $("#navigation-slide > li").each(function(index) {
833 if($(" > ul > li", this).size() == 0){
834 $(" > a", this).addClass("collapsed");
837 }else if(2 == <?php echo $GLOBALS['concurrent_layout'] ?>){
839 //Remove the links (used by the sliding menu) that will break treeview
840 $('a.collapsed').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
841 $('a.collapsed_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
842 $('a.expanded').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
843 $('a.expanded_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
845 // Initiate treeview
846 $("#navigation").treeview({
847 animated: "fast",
848 collapsed: true,
849 unique: <?php echo $GLOBALS['athletic_team'] ? 'false' : 'true' ?>,
850 toggle: function() {
851 window.console && console.log("%o was toggled", this);
857 </script>
859 </head>
861 <body class="body_nav">
863 <form method='post' name='find_patient' target='RTop'
864 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
865 <?php if ( ( $GLOBALS['concurrent_layout'] == 2) || ($GLOBALS['concurrent_layout'] == 3) ) { ?>
866 <center>
867 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:<?php echo $GLOBALS['athletic_team'] ? 47 : 100; ?>%;'>
868 <option value='0'><?php xl('Default','e'); ?></option>
869 <option value='1'><?php xl('Top','e'); ?></option>
870 <option value='2'><?php xl('Bottom','e'); ?></option>
871 </select>
872 <?php if ($GLOBALS['athletic_team']) genPopupsList('width:47%'); ?>
873 </center>
875 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
876 <tr>
877 <td class='smalltext' nowrap>
878 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked />
879 <b><?php xl('Top','e') ?></b>
880 </td>
881 <td class='smalltext' align='right' nowrap>
882 <b><?php xl('Bot','e') ?></b>
883 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php if (empty($GLOBALS['athletic_team'])) echo 'checked '; ?>/>
884 </td>
885 </tr>
886 </table>
888 <?php if ( $GLOBALS['concurrent_layout'] == 3) { ?>
889 <ul id="navigation-slide">
890 <?php } else { // ($GLOBALS['concurrent_layout'] == 2) ?>
891 <ul id="navigation">
892 <?php } ?>
894 <?php if ($GLOBALS['athletic_team']) { // Tree menu for athletic teams ?>
896 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
897 <li><a class="collapsed" id="patimg" ><span><?php xl('View','e') ?></span></a>
898 <ul>
899 <?php genTreeLink('RTop','ros',xl('Weekly Exposures'),true); ?>
900 <?php genMiscLink('RTop','ros','0',xl('Team Roster'),'reports/old_players_report.php?embed=1',true); ?>
901 <?php if (!$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar'),true); ?>
902 </ul>
903 </li>
904 <li class="open"><a class="collapsed" id="patimg" ><span><?php xl('Demographics','e') ?></span></a>
905 <ul>
906 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
907 <?php genTreeLink('RTop','dem',xl('Current')); ?>
908 </ul>
909 </li>
910 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Medical Records','e') ?></span></a>
911 <ul>
912 <?php genDualLink('iss','ens',xl('All Injuries/Problems/Issues')); // with ens on bottom ?>
913 <?php
914 // Add a container for each issue type.
915 foreach ($ISSUE_TYPES as $key => $value) {
916 echo " <li class='open'><a class='collapsed_lv2'><span>" . xl('Active') . " " . $value[0] . "</span></a>\n";
917 echo " <ul id='icontainer_$key'>\n";
918 echo " </ul>\n";
919 echo " </li>\n";
922 <?php genDualLink('nen','ens',xl('New Consultation')); // with ens on bottom ?>
923 <?php // genDualLink('enc','ens','Current Consultation'); // with ens on bottom ?>
924 <?php genTreeLink('RTop','enc',xl('Current Consultation')); // encounter_top will itself load ens on bottom ?>
925 <?php // genDualLink('dem','ens',xl('Previous Consultations')); // with dem on top ?>
926 <?php genTreeLink('RBot','ens',xl('Previous Consultations'),true); ?>
927 <?php genDualLink('his','ens',xl('Prev Med/Surg Hx')); // with ens on bottom ?>
928 <?php // genPopLink(xl('New Allergy'),'../patient_file/summary/add_edit_issue.php?thistype=allergy','xxx1'); ?>
929 <?php // genTreeLink('RTop','iss',xl('View/Edit Allergies')); // somehow emphasizing allergies...? ?>
930 <?php if (!$GLOBALS['disable_immunizations']) genDualLink('his','imm',xl('Immunizations')); // imm on bottom, his on top ?>
931 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genDualLink('his','pre',xl('Prescriptions')); // pre on bottom, his on top ?>
932 <?php genTreeLink('RTop','doc',xl('Document/Imaging Store'),true); ?>
933 <?php genDualLink('dem','pno',xl('Additional Notes')); // with dem on top ?>
934 </ul>
935 </li>
936 <li class="open"><a class="collapsed" id="patimg" ><span><?php xl('Medical Administration','e') ?></span></a>
937 <ul>
938 <?php genDualLink('tra','ens',xl('Transactions/Referrals')); // new transaction form on top and tra list on bottom (or ens if no tra) ?>
939 <?php genPopLink(xl('Address Book'),'../usergroup/addrbook_list.php?popup=1'); ?>
940 <li><a href='' onClick="return repPopup('../patient_file/letter.php')" id='prp1'>Letter</a></li>
941 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); ?>
942 </ul>
943 </li>
944 <li class="open"><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
945 <ul>
946 <li class="open"><a class="collapsed_lv2"><span><?php xl('Athletic/Injury','e') ?></span></a>
947 <ul>
948 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); // also appears above ?>
949 <?php genPopLink(xl('Games/Events Missed'),'absences_report.php'); ?>
950 <?php genPopLink(xl('Injury Surveillance'),'football_injury_report.php'); ?>
951 <?php genPopLink(xl('Team Injury Overview'),'injury_overview_report.php'); ?>
952 </ul>
953 </li>
954 <li><a class="collapsed_lv2"><span><?php xl('Patient/Client','e') ?></span></a>
955 <ul>
956 <?php genPopLink(xl('List'),'patient_list.php'); ?>
957 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genPopLink(xl('Prescriptions'),'prescriptions_report.php'); ?>
958 <?php genPopLink(xl('Referrals'),'referrals_report.php'); ?>
959 </ul>
960 </li>
961 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
962 <ul>
963 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appointments'),'appointments_report.php'); ?>
964 <?php genPopLink(xl('Encounters'),'encounters_report.php'); ?>
965 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appt-Enc'),'appt_encounter_report.php'); ?>
966 </ul>
967 </li>
968 <li><a class="collapsed_lv2"><span><?php xl('General','e') ?></span></a>
969 <ul>
970 <?php genPopLink(xl('Services'),'services_by_category.php'); ?>
971 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
972 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
973 </ul>
974 </li>
975 </ul>
976 </li>
977 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
978 <ul>
979 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
980 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
981 </ul>
982 </li>
983 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
984 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
985 <ul>
986 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
987 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
988 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
989 <?php genTreeLink('RTop','pwd','Users Password Change'); ?>
990 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings'); ?>
991 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
992 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
993 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
994 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
995 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
996 <?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'); ?>
997 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
998 <ul>
999 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1000 <?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'); ?>
1001 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1002 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1003 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1004 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1005 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1006 </ul>
1007 </li>
1008 </ul>
1009 </li>
1010 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1011 <ul>
1012 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1013 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1014 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1015 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1016 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1017 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1018 </ul>
1019 </li>
1020 </ul>
1022 <?php } else { // not athletic team ?>
1024 <?php if (!$GLOBALS['disable_calendar'] && !$GLOBALS['ippf_specific']) genTreeLink('RTop','cal',xl('Calendar')); ?>
1025 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
1026 <?php if ($GLOBALS['lab_exchange_enable']) genTreeLink('RTop', 'lab', xl('Check Lab Results'));?>
1027 <li class="open"><a class="expanded" id="patimg" ><span><?php xl('Patient/Client','e') ?></span></a>
1028 <ul>
1029 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
1030 <?php genTreeLink('RTop','dem',xl('Summary')); ?>
1031 <li class="open"><a class="expanded_lv2"><span><?php xl('Visits','e') ?></span></a>
1032 <ul>
1033 <?php if ($GLOBALS['ippf_specific'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar')); ?>
1034 <?php genTreeLink('RBot','nen',xl('Create Visit')); ?>
1035 <?php genTreeLink('RBot','enc',xl('Current')); ?>
1036 <?php genTreeLink('RBot','ens',xl('Visit History')); ?>
1037 </ul>
1038 </li>
1039 <li><a class="collapsed_lv2"><span><?php xl('Visit Forms','e') ?></span></a>
1040 <ul>
1041 <?php
1042 // Generate the items for visit forms, both traditional and LBF.
1044 $lres = sqlStatement("SELECT * FROM list_options " .
1045 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1046 if (sqlNumRows($lres)) {
1047 while ($lrow = sqlFetchArray($lres)) {
1048 $option_id = $lrow['option_id']; // should start with LBF
1049 $title = $lrow['title'];
1050 genMiscLink('RBot','cod','2',xl_form_title($title),
1051 "patient_file/encounter/load_form.php?formname=$option_id");
1054 include_once("$srcdir/registry.inc");
1055 $reg = getRegistered();
1056 if (!empty($reg)) {
1057 foreach ($reg as $entry) {
1058 $option_id = $entry['directory'];
1059 $title = trim($entry['nickname']);
1060 if ($option_id == 'fee_sheet' ) continue;
1061 if ($option_id == 'newpatient') continue;
1062 if (empty($title)) $title = $entry['name'];
1063 genMiscLink('RBot','cod','2',xl_form_title($title),
1064 "patient_file/encounter/load_form.php?formname=" .
1065 urlencode($option_id));
1069 </ul>
1070 </li>
1071 </ul>
1072 </li>
1073 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
1074 <ul>
1075 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
1076 <?php if ($GLOBALS['use_charges_panel']) genTreeLink('RBot','cod',xl('Charges')); ?>
1077 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
1078 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil',xl('Billing')); ?>
1079 <?php genTreeLink('RTop','npa',xl('Payments'),false,2);?>
1080 </ul>
1081 </li>
1082 <?php // if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
1083 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1084 <li><a class="collapsed" id="invimg" ><span><?php xl('Inventory','e') ?></span></a>
1085 <ul>
1086 <?php genMiscLink('RTop','adm','0',xl('Management'),'drugs/drug_inventory.php'); ?>
1087 <?php genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
1088 </ul>
1089 </li>
1090 <?php } ?>
1091 <li><a class="collapsed" id="proimg" ><span><?php xl('Procedures','e') ?></span></a>
1092 <ul>
1093 <?php genTreeLink('RTop','ort',xl('Configuration')); ?>
1094 <?php genTreeLink('RTop','orp',xl('Pending Review')); ?>
1095 <?php genTreeLink('RTop','orr',xl('Patient Results')); ?>
1096 <?php genTreeLink('RTop','orb',xl('Batch Results')); ?>
1097 </ul>
1098 </li>
1099 <?php if (!$disallowed['adm']) { ?>
1100 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
1101 <ul>
1102 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
1103 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
1104 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
1105 <?php if (acl_check('admin', 'practice' )) genTreeLink('RTop','adb',xl('Addr Book')); ?>
1106 <?php
1107 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1108 if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings&pharmacy&action=list'); ?>
1109 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
1110 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
1111 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
1112 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
1113 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1114 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1115 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
1116 <?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'); ?>
1117 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) genMiscLink('RTop','adm','0',xl('Export'),'main/ippf_export.php'); ?>
1118 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
1119 <ul>
1120 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
1121 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1122 <?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'); ?>
1123 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1124 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1125 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1126 </ul>
1127 </li>
1128 </ul>
1129 </li>
1130 <?php } ?>
1131 <li><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
1132 <ul>
1133 <li><a class="collapsed_lv2"><span><?php xl('Clients','e') ?></span></a>
1134 <ul>
1135 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/patient_list.php'); ?>
1136 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genMiscLink('RTop','rep','0',xl('Rx'),'reports/prescriptions_report.php'); ?>
1137 <?php if (acl_check('patients', 'med')) genMiscLink('RTop','rep','0',xl('Clinical'),'reports/clinical_reports.php'); ?>
1138 <?php genMiscLink('RTop','rep','0',xl('Referrals'),'reports/referrals_report.php'); ?>
1139 </ul>
1140 </li>
1141 <li class="open"><a class="expanded_lv2"><span><?php xl('Visits','e') ?></span></a>
1142 <ul>
1143 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appointments'),'reports/appointments_report.php'); ?>
1144 <?php genMiscLink('RTop','rep','0',xl('Encounters'),'reports/encounters_report.php'); ?>
1145 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appt-Enc'),'reports/appt_encounter_report.php'); ?>
1146 <?php if (empty($GLOBALS['code_types']['IPPF'])) { ?>
1147 <?php genMiscLink('RTop','rep','0',xl('Superbill'),'reports/custom_report_range.php'); ?>
1148 <?php } ?>
1149 <?php genMiscLink('RTop','rep','0',xl('Eligibility'),'reports/edi_270.php'); ?>
1150 <?php genMiscLink('RTop','rep','0',xl('Eligibility Response'),'reports/edi_271.php'); ?>
1153 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Chart Activity'),'reports/chart_location_activity.php'); ?>
1154 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Charts Out'),'reports/charts_checked_out.php'); ?>
1155 <?php genMiscLink('RTop','rep','0',xl('Services'), 'reports/services_by_category.php'); ?>
1156 <?php genMiscLink('RTop','rep','0',xl('Syndromic Surveillance'),'reports/non_reported.php'); ?>
1157 </ul>
1158 </li>
1159 <?php if (acl_check('acct', 'rep_a')) { ?>
1160 <li><a class="collapsed_lv2"><span><?php xl('Financial','e') ?></span></a>
1161 <ul>
1162 <?php genMiscLink('RTop','rep','0',xl('Sales'),'reports/sales_by_item.php'); ?>
1163 <?php genMiscLink('RTop','rep','0',xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
1164 <?php genMiscLink('RTop','rep','0',xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
1165 <?php genMiscLink('RTop','rep','0',xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
1166 <?php genMiscLink('RTop','rep','0',xl('Collections'), 'reports/collections_report.php'); ?>
1167 </ul>
1168 </li>
1169 <?php } ?>
1170 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
1171 <li><a class="collapsed_lv2"><span><?php xl('Inventory','e') ?></span></a>
1172 <ul>
1173 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/inventory_list.php'); ?>
1174 <?php genMiscLink('RTop','rep','0',xl('Activity'),'reports/inventory_activity.php'); ?>
1175 <?php genMiscLink('RTop','rep','0',xl('Transactions'),'reports/inventory_transactions.php'); ?>
1176 </ul>
1177 </li>
1178 <?php } ?>
1179 <li><a class="collapsed_lv2"><span><?php xl('Procedures','e') ?></span></a>
1180 <ul>
1181 <?php genPopLink(xl('Pending Res'),'../orders/pending_orders.php'); ?>
1182 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink(xl('Pending F/U'),'../orders/pending_followup.php'); ?>
1183 <?php genPopLink(xl('Statistics'),'../orders/procedure_stats.php'); ?>
1184 </ul>
1185 </li>
1186 <?php if (! $GLOBALS['simplified_demographics']) { ?>
1187 <li><a class="collapsed_lv2"><span><?php xl('Insurance','e') ?></span></a>
1188 <ul>
1189 <?php genMiscLink('RTop','rep','0',xl('Distribution'),'reports/insurance_allocation_report.php'); ?>
1190 <?php genMiscLink('RTop','rep','0',xl('Indigents'),'billing/indigent_patients_report.php'); ?>
1191 <?php genMiscLink('RTop','rep','0',xl('Unique SP'),'reports/unique_seen_patients_report.php'); ?>
1192 </ul>
1193 </li>
1194 <?php } ?>
1195 <?php if (!empty($GLOBALS['code_types']['IPPF'])) { ?>
1196 <li><a class="collapsed_lv2"><span><?php xl('Statistics','e') ?></span></a>
1197 <ul>
1198 <?php genPopLink(xl('IPPF Stats'),'ippf_statistics.php?t=i'); ?>
1199 <?php genPopLink(xl('GCAC Stats'),'ippf_statistics.php?t=g'); ?>
1200 <?php genPopLink(xl('MA Stats'),'ippf_statistics.php?t=m'); ?>
1201 <?php genPopLink(xl('CYP'),'ippf_cyp_report.php'); ?>
1202 <?php genPopLink(xl('Daily Record'),'ippf_daily.php'); ?>
1203 </ul>
1204 </li>
1205 <?php } // end ippf-specific ?>
1206 <li><a class="collapsed_lv2"><span><?php xl('Blank Forms','e') ?></span></a>
1207 <ul>
1208 <?php genPopLink(xl('Demographics'),'../patient_file/summary/demographics_print.php'); ?>
1209 <?php genPopLink(xl('Fee Sheet'),'../patient_file/printed_fee_sheet.php'); ?>
1210 <?php genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php'); ?>
1211 <?php
1212 $lres = sqlStatement("SELECT * FROM list_options " .
1213 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1214 while ($lrow = sqlFetchArray($lres)) {
1215 $option_id = $lrow['option_id']; // should start with LBF
1216 $title = $lrow['title'];
1217 genPopLink($title, "../forms/LBF/printable.php?formname=$option_id");
1220 </ul>
1221 </li>
1222 <?php // genTreeLink('RTop','rep','Other'); ?>
1223 </ul>
1224 </li>
1225 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1226 <ul>
1227 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1228 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1229 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1230 <?php genTreeLink('RTop','ort',xl('Order Catalog')); ?>
1231 <?php if (!$GLOBALS['disable_chart_tracker']) genTreeLink('RTop','cht',xl('Chart Tracker')); ?>
1232 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1233 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1234 <?php genTreeLink('RTop','pwd',xl('Password')); ?>
1235 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1236 </ul>
1237 </li>
1238 </ul>
1240 <?php } // end not athletic team ?>
1242 <?php } else { // end ($GLOBALS['concurrent_layout'] == 2 || $GLOBALS['concurrent_layout'] == 3) ?>
1244 <table cellpadding='0' cellspacing='0' border='0'>
1245 <tr>
1246 <td colspan='3'>
1247 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1248 <tr>
1249 <td class='smalltext' nowrap>
1250 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
1251 </td>
1252 <td class='smalltext' align='right' nowrap>
1253 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
1254 </td>
1255 </tr>
1256 </table>
1257 </td>
1258 </tr>
1259 <?php
1260 // Builds the table of radio buttons and their labels. Radio button values
1261 // are comprised of the 3-character document id and the 1-digit usage type,
1262 // so that JavaScript can easily access this information.
1263 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
1264 foreach ($primary_docs as $key => $varr) {
1265 if (!empty($disallowed[$key])) continue;
1266 $label = $varr[0];
1267 $usage = $varr[1];
1268 $url = $varr[2];
1269 echo " <tr>\n";
1270 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
1271 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
1272 if ($key == $default_top_rbid) echo " checked";
1273 echo " /></td>\n";
1274 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
1275 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
1276 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
1277 if ($key == 'msg') echo " checked";
1278 echo " /></td>\n";
1279 echo " </tr>\n";
1282 </table>
1284 <?php } ?>
1286 <br /><hr />
1288 <?php
1289 // To use RelayHealth, see comments and parameters in includes/config.php.
1290 if (!empty($GLOBALS['ssi']['rh'])) {
1291 include_once("../../library/ssi.inc");
1292 echo getRelayHealthLink() ."<br /><hr />\n";
1296 <div id='current_patient' style = 'display:none'>
1297 <b><?php xl('None','e'); ?></b>
1298 </div>
1300 <div id='current_encounter' style = 'display:none'>
1301 <b><?php xl('None','e'); ?></b>
1302 </div>
1304 <?php if (!$GLOBALS['athletic_team']) genPopupsList(); ?>
1306 <hr />
1308 <table cellpadding='0' cellspacing='0' border='0'>
1309 <tr>
1310 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
1311 <td class='smalltext' colspan='2'>
1312 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
1313 </td>
1314 </tr>
1315 <tr>
1316 <td class='smalltext'><?php xl('by','e') ?>:</td>
1317 <td class='smalltext'>
1318 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name','e'); ?></a>
1319 </td>
1320 <td class='smalltext' align='right'>
1321 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID','e'); ?></a>
1322 </td>
1323 </tr>
1324 <tr>
1325 <td class='smalltext'>&nbsp;</td>
1326 <td class='smalltext'>
1327 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN','e'); ?></a>
1328 </td>
1329 <td class='smalltext' align='right'>
1330 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB','e'); ?></a>
1331 </td>
1332 </tr>
1334 <tr>
1335 <td class='smalltext'>&nbsp;</td>
1336 <td class='smalltext'>
1337 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
1338 </td>
1339 <td class='smalltext' align='right'>
1340 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
1341 </td>
1342 </tr>
1344 </table>
1346 <hr />
1347 <?php if (!empty($GLOBALS['online_support_link'])) { ?>
1348 <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>
1349 <?php } ?>
1351 <input type='hidden' name='findBy' value='Last' />
1352 <input type="hidden" name="searchFields" id="searchFields"/>
1353 <input type="hidden" name="search_service_code" value='' />
1355 </form>
1357 <script language='JavaScript'>
1358 syncRadios();
1359 </script>
1361 </body>
1362 </html>