Changes for SSL Configuration and Client side certificates
[openemr.git] / interface / main / left_nav.php
blob83379e124591cc6a70a523bed9e1abd2bad59fe5
1 <?php
2 // Copyright (C) 2006-2010 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // This provides the left navigation frame when $GLOBALS['concurrent_layout']
10 // is true. Following are notes as to what else was changed for this feature:
12 // * interface/main/main_screen.php: the top-level frameset.
13 // * interface/main/finder/patient_select.php: loads stuff when a new patient
14 // is selected.
15 // * interface/patient_file/summary/demographics.php: this is the first frame
16 // loaded when a new patient is chosen, and in turn sets the current pid and
17 // then loads the initial bottom frame.
18 // * interface/patient_file/summary/demographics_full.php: added support for
19 // setting a new pid, needed for going to demographics from billing.
20 // * interface/patient_file/summary/demographics_save.php: redisplay
21 // demographics.php and not the frameset.
22 // * interface/patient_file/summary/summary_bottom.php: new frameset for the
23 // summary, prescriptions and notes for a selected patient, cloned from
24 // patient_summary.php.
25 // * interface/patient_file/encounter/encounter_bottom.php: new frameset for
26 // the selected encounter, mosting coding/billing stuff, cloned from
27 // patient_encounter.php. This will also self-load the superbill pages
28 // as requested.
29 // * interface/usergroup/user_info.php: removed Back link.
30 // * interface/usergroup/admin_frameset.php: new frameset for Admin pages,
31 // cloned from usergroup.php.
32 // * interface/main/onotes/office_comments.php: removed Back link target.
33 // * interface/main/onotes/office_comments_full.php: changed Back link.
34 // * interface/billing/billing_report.php: removed Back link; added logic
35 // to properly go to demographics or to an encounter when requested.
36 // * interface/new/new.php: removed Back link and revised form target.
37 // * interface/new/new_patient_save.php: modified to load the demographics
38 // page to the current frame instead of loading a new frameset.
39 // * interface/patient_file/history/history.php: target change.
40 // * interface/patient_file/history/history_full.php: target changes.
41 // * interface/patient_file/history/history_save.php: target change.
42 // * interface/patient_file/history/encounters.php: link/target changes.
43 // * interface/patient_file/history/encounters_full.php: link/target changes.
44 // * interface/patient_file/encounter/encounter_top.php: another new frameset
45 // cloned from patient_encounter.php.
46 // * interface/patient_file/encounter/forms.php: link target removal.
47 // * interface/patient_file/encounter/new_form.php: target change.
48 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
49 // changes.
50 // * interface/patient_file/summary/immunizations.php: removed back link.
51 // * interface/patient_file/summary/pnotes.php: changed link targets.
52 // * interface/patient_file/summary/pnotes_full.php: changed back link and
53 // added set_pid logic.
54 // * interface/patient_file/transaction/transactions.php: various changes.
55 // * interface/patient_file/transaction/add_transaction.php: new return js.
56 // * interface/patient_file/encounter/superbill_codes.php: target and link
57 // changes.
58 // * interface/patient_file/encounter/superbill_custom_full.php: target and
59 // link changes.
60 // * interface/patient_file/encounter/diagnosis.php: target changes.
61 // * interface/patient_file/encounter/diagnosis_full.php: target and link
62 // changes.
63 // * interface/main/authorizations/authorizations.php: link and target changes.
64 // * library/api.inc: url change.
65 // * interface/patient_file/summary/rx_frameset.php: new frameset.
66 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
67 // * all encounter forms: remove all instances of "target=Main" and change
68 // all instances of "patient_encounter.php" to "encounter_top.php".
70 // Our find_patient form, when submitted, invokes patient_select.php in the
71 // upper frame. When the patient is selected, demographics.php is invoked
72 // with the set_pid parameter, which establishes the new session pid and also
73 // calls the setPatient() function (below). In this case demographics.php
74 // will also load the summary frameset into the bottom frame, invoking our
75 // loadFrame() and setRadio() functions.
77 // Similarly, we have the concept of selecting an encounter from the
78 // Encounters list, and then having that "stick" until some other encounter
79 // or a new encounter is chosen. We also have a navigation item for creating
80 // a new encounter. interface/patient_file/encounter/encounter_top.php
81 // supports set_encounter to establish an encounter.
83 // TBD: Include active_pid and/or active_encounter in relevant submitted
84 // form data, and add logic to the save routines to make sure they match
85 // the corresponding session values.
87 include_once("../globals.php");
88 include_once($GLOBALS['fileroot']."/library/acl.inc");
89 include_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
90 include_once($GLOBALS['fileroot']."/library/patient.inc");
92 // This array defines the list of primary documents that may be
93 // chosen. Each element value is an array of 3 values:
95 // * Name to appear in the navigation table
96 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific
97 // * The URL relative to the interface directory
100 // larry :: dbc insert
101 $demovarbase = ( $GLOBALS['dutchpc'] ) ? 'demographics_dutch.php' : 'demographics.php';
102 // larry :: end of dbc insert
104 $primary_docs = array(
105 'ros' => array(xl('Roster') , 0, 'reports/players_report.php?embed=1'),
106 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
107 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
108 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
109 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
110 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
111 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
112 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
113 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
114 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
115 'imp' => array(xl('Import') , 0, '../custom/import.php'),
116 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
117 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
118 'aun' => array(xl('Auth/notes'), 0, 'main/authorizations/authorizations.php'),
119 'new' => array(xl('New Pt') , 0, 'new/new.php'),
120 'dem' => array(xl('Patient') , 1, "patient_file/summary/$demovarbase"),
121 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
122 'ens' => array(xl('Encounters'), 1, 'patient_file/history/encounters.php'),
123 'nen' => array(xl('New Enctr') , 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 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
129 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
130 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
131 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
132 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
134 if ($GLOBALS['use_charges_panel'] || $GLOBALS['concurrent_layout'] == 2) {
135 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
138 // This section decides which navigation items will not appear.
140 $disallowed = array();
142 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
143 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
144 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
145 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
146 acl_check('admin', 'superbill'));
148 $disallowed['bil'] = !(acl_check('acct', 'rep') || acl_check('acct', 'eob') ||
149 acl_check('acct', 'bill'));
151 $tmp = acl_check('patients', 'demo');
152 $disallowed['new'] = !($tmp == 'write' || $tmp == 'addonly');
154 if ( isset ($GLOBALS['hylafax_server']) && isset ($GLOBALS['scanner_output_directory']) ) {
155 $disallowed['fax'] = !($GLOBALS['hylafax_server'] || $GLOBALS['scanner_output_directory']);
158 $disallowed['ros'] = !$GLOBALS['athletic_team'];
160 $disallowed['iss'] = !((acl_check('encounters', 'notes') == 'write' ||
161 acl_check('encounters', 'notes_a') == 'write') &&
162 acl_check('patients', 'med') == 'write');
164 $disallowed['imp'] = $disallowed['new'] ||
165 !is_readable("$webserver_root/custom/import.php");
167 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
169 $disallowed['pre'] = !(acl_check('patients', 'med'));
171 // Helper functions for treeview generation.
172 function genTreeLink($frame, $name, $title, $mono=false) {
173 global $primary_docs, $disallowed;
174 if (empty($disallowed[$name])) {
175 $id = $name . $primary_docs[$name][1];
176 echo "<li><a href='' id='$id' onclick=\"";
177 if ($mono) {
178 if ($frame == 'RTop')
179 echo "forceSpec(true,false);";
180 else
181 echo "forceSpec(false,true);";
183 echo "return loadFrame2('$id','$frame','" .
184 $primary_docs[$name][2] . "')\">" . $title . "</a></li>";
187 function genMiscLink($frame, $name, $level, $title, $url, $mono=false) {
188 global $disallowed;
189 if (empty($disallowed[$name])) {
190 $id = $name . $level;
191 echo "<li><a href='' id='$id' onclick=\"";
192 if ($mono) {
193 if ($frame == 'RTop')
194 echo "forceSpec(true,false);";
195 else
196 echo "forceSpec(false,true);";
198 echo "return loadFrame2('$id','$frame','" .
199 $url . "')\">" . $title . "</a></li>";
202 function genPopLink($title, $url, $linkid='') {
203 echo "<li><a href='' ";
204 if ($linkid) echo "id='$linkid' ";
205 echo "onclick=\"return repPopup('$url')\"" .
206 ">" . $title . "</a></li>";
208 function genDualLink($topname, $botname, $title) {
209 global $primary_docs, $disallowed;
210 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
211 $topid = $topname . $primary_docs[$topname][1];
212 $botid = $botname . $primary_docs[$botname][1];
213 echo "<li><a href='' id='$topid' " .
214 "onclick=\"return loadFrameDual('$topid','$botid','" .
215 $primary_docs[$topname][2] . "','" .
216 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
220 function genPopupsList($style='') {
221 global $disallowed, $webserver_root;
223 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
224 <option value=''><?php xl('Popups','e'); ?></option>
225 <?php if (!$disallowed['iss']) { ?>
226 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
227 <?php } ?>
228 <?php if (!$GLOBALS['ippf_specific']) { ?>
229 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
230 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
231 <?php } ?>
232 <?php if ($GLOBALS['athletic_team']) { ?>
233 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
234 <?php } ;
235 if (!$GLOBALS['disable_calendar']) { ?>
236 <option value='../reports/appointments_report.php?patient=<?php echo $pid ?>'><?php xl('Appts','e'); ?></option>
237 <?php } ;
238 if (file_exists("$webserver_root/custom/refer.php")) { ?>
239 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
240 <?php } ?>
241 <?php // if (file_exists("$webserver_root/custom/fee_sheet_codes.php")) { ?>
242 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill','e'); ?></option>
243 <?php // } ?>
244 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
245 <option value='../patient_file/front_payment.php'><?php xl('Prepay','e'); ?></option>
246 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
247 <?php } else { ?>
248 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
249 <?php } ?>
250 <?php if (is_dir("$webserver_root/custom/letter_templates")) { ?>
251 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
252 <?php } ?>
253 </select>
254 <?php
258 <html>
259 <head>
260 <title>Navigation</title>
261 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
263 <style type="text/css">
264 body {
265 font-size:8pt;
266 font-weight:normal;
267 padding: 5px 3px 5px 3px;
269 .smalltext {
270 font-family:sans-serif;
271 font-size:8pt;
272 font-weight:normal;
274 a.navitem, a.navitem:visited {
275 color:#0000ff;
276 font-family:sans-serif;
277 font-size:8pt;
278 font-weight:bold;
280 .inputtext {
281 font-size:9pt;
282 font-weight:normal;
283 border-style:solid;
284 border-width:1px;
285 padding-left:2px;
286 padding-right:2px;
287 border-color: #000000;
288 background-color:transparent;
291 #navigation ul {
292 background-color:transparent;
294 </style>
296 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.3/jquery.treeview.css" />
297 <script src="../../library/js/jquery-1.2.2.min.js" type="text/javascript"></script>
298 <script src="../../library/js/jquery.treeview-1.3/jquery.treeview.min.js" type="text/javascript"></script>
300 <script type="text/javascript" src="../../library/dialog.js"></script>
302 <script language='JavaScript'>
304 // Master values for current pid and encounter.
305 var active_pid = 0;
306 var active_encounter = 0;
308 // Current selections in the top and bottom frames.
309 var topName = '';
310 var botName = '';
312 // Expand and/or collapse frames in response to checkbox clicks.
313 // fnum indicates which checkbox was clicked (1=left, 2=right).
314 function toggleFrame(fnum) {
315 var f = document.forms[0];
316 var fset = top.document.getElementById('fsright');
317 if (!f.cb_top.checked && !f.cb_bot.checked) {
318 if (fnum == 1) f.cb_bot.checked = true;
319 else f.cb_top.checked = true;
321 var rows = f.cb_top.checked ? '*' : '0';
322 rows += f.cb_bot.checked ? ',*' : ',0';
323 fset.rows = rows;
324 fset.rows = rows;
327 // Load the specified url into the specified frame (RTop or RBot).
328 // The URL provided must be relative to interface.
329 function loadFrame(fname, frame, url) {
330 top.restoreSession();
331 var i = url.indexOf('{PID}');
332 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
333 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
334 if (frame == 'RTop') topName = fname; else botName = fname;
337 // Load the specified url into a frame to be determined, with the specified
338 // frame as the default; the url must be relative to interface.
339 function loadFrame2(fname, frame, url) {
340 var usage = fname.substring(3);
341 if (active_pid == 0 && usage > '0') {
342 alert('<?php xl('You must first select or add a patient.','e') ?>');
343 return false;
345 if (active_encounter == 0 && usage > '1') {
346 alert('<?php xl('You must first select or create an encounter.','e') ?>');
347 return false;
349 var f = document.forms[0];
350 top.restoreSession();
351 var i = url.indexOf('{PID}');
352 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
353 var fi = f.sel_frame.selectedIndex;
354 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
355 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
356 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
357 if (frame == 'RTop') topName = fname; else botName = fname;
358 return false;
361 // Make sure the the top and bottom frames are open or closed, as specified.
362 function forceSpec(istop, isbot) {
363 var f = document.forms[0];
364 if (f.cb_top.checked != istop) {
365 f.cb_top.checked = istop;
366 toggleFrame(1);
368 if (f.cb_bot.checked != isbot) {
369 f.cb_bot.checked = isbot;
370 toggleFrame(2);
374 // Make sure both frames are open.
375 function forceDual() {
376 forceSpec(true, true);
379 // Load the specified url into a frame to be determined, with the specified
380 // frame as the default; the url must be relative to interface.
381 function loadFrameDual(tname, bname, topurl, boturl) {
382 var topusage = tname.substring(3);
383 var botusage = bname.substring(3);
384 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
385 alert('<?php xl('You must first select or add a patient.','e') ?>');
386 return false;
388 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
389 alert('<?php xl('You must first select or create an encounter.','e') ?>');
390 return false;
392 var f = document.forms[0];
393 forceDual();
394 top.restoreSession();
395 var i = topurl.indexOf('{PID}');
396 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
397 i = boturl.indexOf('{PID}');
398 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
399 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
400 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
401 topName = tname;
402 botName = bname;
403 return false;
406 // Select a designated radio button. raname may be either the radio button
407 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
408 // You should call this if you directly load a document that does not
409 // correspond to the current radio button setting.
410 function setRadio(raname, rbid) {
411 <?php if ($GLOBALS['concurrent_layout'] != 2) { ?>
412 var f = document.forms[0];
413 if (raname == 'RTop') raname = 'rb_top';
414 if (raname == 'RBot') raname = 'rb_bot';
415 for (var i = 0; i < f[raname].length; ++i) {
416 if (f[raname][i].value.substring(0,3) == rbid) {
417 f[raname][i].checked = true;
418 return true;
421 <?php } ?>
422 return false;
425 // Set disabled/enabled state of radio buttons and associated labels
426 // depending on whether there is an active patient or encounter.
427 function syncRadios() {
428 var f = document.forms[0];
429 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
430 var nlinks = document.links.length;
431 for (var i = 0; i < nlinks; ++i) {
432 var lnk = document.links[i];
433 if (lnk.id.length != 4) continue;
434 var usage = lnk.id.substring(3);
435 if (usage == '1' || usage == '2') {
436 var da = false;
437 if (active_pid == 0) da = true;
438 if (active_encounter == 0 && usage > '1') da = true;
439 lnk.style.color = da ? '#888888' : '#0000ff';
442 <?php } else { ?>
443 for (var i = 0; i < f.rb_top.length; ++i) {
444 var da = false;
445 var rb1 = f.rb_top[i];
446 var rb2 = f.rb_bot[i];
447 var rbid = rb1.value.substring(0,3);
448 var usage = rb1.value.substring(3);
449 if (active_pid == 0 && usage > '0') da = true;
450 if (active_encounter == 0 && usage > '1') da = true;
451 // daemon_frame can also set special label colors, so don't mess with
452 // them unless we have to.
453 if (rb1.disabled != da) {
454 rb1.disabled = da;
455 rb2.disabled = da;
456 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
459 <?php } ?>
460 f.popups.disabled = (active_pid == 0);
463 function goHome() {
464 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
465 top.frames['RBot'].location='authorizations/authorizations.php';
469 var my_window;
470 function initFilter() {
471 my_window = window.open("../../custom/search.php", "mywindow","status=1");
474 function processFilter( fieldString ) {
475 document.getElementById('searchFields').value=fieldString;
476 findPatient( "Filter" );
477 my_window.close();
481 // Process the click to find a patient by name, id, ssn or dob.
482 function findPatient(findby) {
483 var f = document.forms[0];
484 if (! f.cb_top.checked) {
485 f.cb_top.checked = true;
486 toggleFrame(1);
488 f.findBy.value = findby;
489 setRadio('rb_top', 'dem');
490 top.restoreSession();
491 document.find_patient.submit();
494 // Helper function to set the contents of a div.
495 function setSomeContent(id, content, doc) {
496 if (doc.getElementById) {
497 var x = doc.getElementById(id);
498 x.innerHTML = '';
499 x.innerHTML = content;
501 else if (doc.all) {
502 var x = doc.all[id];
503 x.innerHTML = content;
506 function setDivContent(id, content) {
507 setSomeContent(id, content, document);
509 function setTitleContent(id, content) {
510 setSomeContent(id, content, parent.Title.document);
513 // This is called automatically when a new patient is set, to make sure
514 // there are no patient-specific documents showing stale data. If a frame
515 // was just loaded with data for the correct patient, its name is passed so
516 // that it will not be zapped. At this point the new server-side pid is not
517 // assumed to be set, so this function will only load global data.
518 function reloadPatient(frname) {
519 var f = document.forms[0];
520 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
521 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
522 setRadio('rb_top', 'cal');
524 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
525 loadFrame('aun0','RBot', '<?php echo $primary_docs['aun'][2]; ?>');
526 setRadio('rb_bot', 'aun');
530 // Reload encounter-specific frames, excluding a specified frame. At this
531 // point the new server-side encounter ID may not be set and loading the same
532 // document for the new encounter will not work, so load patient info instead.
533 function reloadEncounter(frname) {
534 var f = document.forms[0];
535 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
536 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
537 setRadio('rb_top', 'dem');
539 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
540 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
541 setRadio('rb_bot', 'ens');
545 // Call this to announce that the patient has changed. You must call this
546 // if you change the session PID, so that the navigation frame will show the
547 // correct patient and so that the other frame will be reloaded if it contains
548 // patient-specific information from the previous patient. frname is the name
549 // of the frame that the call came from, so we know to only reload content
550 // from the *other* frame if it is patient-specific.
551 function setPatient(pname, pid, pubpid, frname, str_dob) {
552 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()"><b>' + pname + ' (' + pubpid + ')</b></a>';
553 setDivContent('current_patient', str);
554 setTitleContent('current_patient', str + str_dob);
555 if (pid == active_pid) return;
556 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
557 active_pid = pid;
558 active_encounter = 0;
559 if (frname) reloadPatient(frname);
560 syncRadios();
561 $(parent.Title.document.getElementById('current_patient_block')).show();
562 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
563 $(encounter_block).hide();
566 function loadCurrentPatientFromTitle() {
567 top.frames['RTop'].location='../patient_file/summary/demographics.php';
570 function getEncounterTargetFrame( name ) {
571 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
572 var f = document.forms[0];
573 var r = 'RTop';
574 if (f.cb_top.checked && f.cb_bot.checked) {
575 if ( bias == 2 ) {
576 r = 'RBot';
577 } else {
578 r = 'RTop';
580 } else {
581 if ( f.cb_top.checked ) {
582 r = 'RTop';
583 } else if ( f.cb_bot.checked ) {
584 r = 'RBot';
587 return r;
590 // Call this to announce that the encounter has changed. You must call this
591 // if you change the session encounter, so that the navigation frame will
592 // show the correct encounter and so that the other frame will be reloaded if
593 // it contains encounter-specific information from the previous encounter.
594 // frname is the name of the frame that the call came from, so we know to only
595 // reload encounter-specific content from the *other* frame.
596 function setEncounter(edate, eid, frname) {
597 if (eid == active_encounter) return;
598 if (!eid) edate = '<?php xl('None','e'); ?>';
599 var str = '<b>' + edate + '</b>';
600 setDivContent('current_encounter', str);
601 active_encounter = eid;
602 reloadEncounter(frname);
603 syncRadios();
604 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
605 var encounter = $(parent.Title.document.getElementById('current_encounter'));
606 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
607 encounter.html( estr );
608 encounter_block.show();
611 function loadCurrentEncounterFromTitle() {
612 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/forms.php';
615 // You must call this if you delete the active patient (or if for any other
616 // reason you "close" the active patient without opening a new one), so that
617 // the appearance of the navigation frame will be correct and so that any
618 // stale content will be reloaded.
619 function clearPatient() {
620 if (active_pid == 0) return;
621 var f = document.forms[0];
622 active_pid = 0;
623 active_encounter = 0;
624 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
625 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
626 setTitleContent('current_patient', '<b><?php xl('None','e'); ?></b>');
627 reloadPatient('');
628 syncRadios();
631 // You must call this if you delete the active encounter (or if for any other
632 // reason you "close" the active encounter without opening a new one), so that
633 // the appearance of the navigation frame will be correct and so that any
634 // stale content will be reloaded.
635 function clearEncounter() {
636 if (active_encounter == 0) return;
637 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
638 active_encounter = 0;
639 reloadEncounter('');
640 syncRadios();
643 // You can call this to make sure the session pid is what we expect.
644 function pidSanityCheck(pid) {
645 if (pid != active_pid) {
646 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
647 '. This session is unstable and should be abandoned. Do not use ' +
648 'OpenEMR in multiple browser windows!');
649 return false;
651 return true;
654 // You can call this to make sure the session encounter is what we expect.
655 function encounterSanityCheck(eid) {
656 if (eid != active_encounter) {
657 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
658 '. This session is unstable and should be abandoned. Do not use ' +
659 'OpenEMR in multiple browser windows!');
660 return false;
662 return true;
665 // Pop up a report.
666 function repPopup(aurl) {
667 top.restoreSession();
668 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
669 return false;
672 // This is invoked to pop up some window when a popup item is selected.
673 function selpopup(selobj) {
674 var i = selobj.selectedIndex;
675 var opt = selobj.options[i];
676 if (i > 0) {
677 var width = 750;
678 var height = 550;
679 if (opt.text == 'Export' || opt.text == 'Import') {
680 width = 500;
681 height = 400;
683 else if (opt.text == 'Refer') {
684 width = 700;
685 height = 500;
687 dlgopen(opt.value, '_blank', width, height);
689 selobj.selectedIndex = 0;
692 // Treeview activation stuff:
693 $(document).ready(function(){
694 $("#navigation").treeview({
695 animated: "fast",
696 collapsed: true,
697 unique: <?php echo $GLOBALS['athletic_team'] ? 'false' : 'true' ?>,
698 toggle: function() {
699 window.console && console.log("%o was toggled", this);
704 </script>
706 </head>
708 <body class="body_nav">
710 <form method='post' name='find_patient' target='RTop'
711 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
713 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
715 <center>
716 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:<?php echo $GLOBALS['athletic_team'] ? 47 : 100; ?>%;'>
717 <option value='0'><?php xl('Default','e'); ?></option>
718 <option value='1'><?php xl('Top','e'); ?></option>
719 <option value='2'><?php xl('Bottom','e'); ?></option>
720 </select>
721 <?php if ($GLOBALS['athletic_team']) genPopupsList('width:47%'); ?>
722 </center>
724 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
725 <tr>
726 <td class='smalltext' nowrap>
727 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked />
728 <b><?php xl('Top','e') ?></b>
729 </td>
730 <td class='smalltext' align='right' nowrap>
731 <b><?php xl('Bot','e') ?></b>
732 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php if (empty($GLOBALS['athletic_team'])) echo 'checked '; ?>/>
733 </td>
734 </tr>
735 </table>
737 <?php if ($GLOBALS['athletic_team']) { // Tree menu for athletic teams ?>
739 <ul id="navigation">
740 <li class="open"><span><?php xl('Patient/Client','e') ?></span>
741 <ul>
742 <li class="open"><span><?php xl('Demographics','e') ?></span>
743 <ul>
744 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
745 <?php genTreeLink('RTop','dem',xl('Current')); ?>
746 </ul>
747 </li>
748 <li class="open"><span><?php xl('Medical Records','e') ?></span>
749 <ul>
750 <?php // genPopLink (xl('Team Roster'),'players_report.php'); ?>
752 <?php genTreeLink('RTop','ros',xl('Weekly Exposures'),true); ?>
753 <?php genMiscLink('RTop','ros','0',xl('Team Roster'),'reports/old_players_report.php?embed=1',true); ?>
754 <?php if (!$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar'),true); ?>
756 <?php genDualLink('nen','ens',xl('New Consultation')); // with ens on bottom ?>
758 <?php // genDualLink('enc','ens','Current Consultation'); // with ens on bottom ?>
759 <?php genTreeLink('RTop','enc',xl('Current Consultation')); // encounter_top will itself load ens on bottom ?>
761 <?php // genDualLink('dem','ens',xl('Previous Consultations')); // with dem on top ?>
762 <?php genTreeLink('RBot','ens',xl('Previous Consultations'),true); ?>
763 <?php genDualLink('his','ens',xl('PPE + Prev Med/Surg Hx')); // with ens on bottom ?>
765 <?php // genTreeLink('RBot','nen',xl('New Allergy')); // nen with Allergy in chief complaint ?>
766 <?php genPopLink('New Allergy','../patient_file/summary/add_edit_issue.php?thistype=allergy','xxx1'); ?>
768 <?php genTreeLink('RTop','iss',xl('View/Edit Allergies')); // somehow emphasizing allergies...? ?>
769 <?php genDualLink('iss','ens',xl('Problems/Issues')); // with ens on bottom ?>
770 <?php genDualLink('tra','ens',xl('Transactions/Referrals')); // new transaction form on top and tra list on bottom (or ens if no tra) ?>
771 <?php if (!$GLOBALS['disable_immunizations']) genDualLink('his','imm',xl('Immunizations')); // imm on bottom, his on top ?>
772 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genDualLink('his','pre',xl('Prescriptions')); // pre on bottom, his on top ?>
773 <?php genTreeLink('RTop','doc',xl('Document/Imaging Store'),true); ?>
774 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); ?>
775 <?php genDualLink('dem','pno',xl('Additional Notes')); // with dem on top ?>
776 <li><a href='' onclick="return repPopup('../patient_file/letter.php')" id='prp1'>Letter</a></li>
777 <?php genPopLink('Address Book','../usergroup/addrbook_list.php?popup=1'); ?>
778 </ul>
779 </li>
780 </ul>
781 </li>
782 <li class="open"><span><?php xl('Reports','e') ?></span>
783 <ul>
784 <li class="open"><span><?php xl('Athletic/Injury','e') ?></span>
785 <ul>
786 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); // also appears above ?>
787 <?php genPopLink(xl('Games/Events Missed'),'absences_report.php'); ?>
788 <?php genPopLink(xl('Injury Surveillance'),'football_injury_report.php'); ?>
789 <?php genPopLink(xl('Team Injury Overview'),'injury_overview_report.php'); ?>
790 </ul>
791 </li>
792 <li><span><?php xl('Patient/Client','e') ?></span>
793 <ul>
794 <?php genPopLink('List','patient_list.php'); ?>
795 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genPopLink(xl('Prescriptions'),'prescriptions_report.php'); ?>
796 <?php genPopLink(xl('Referrals'),'referrals_report.php'); ?>
797 </ul>
798 </li>
799 <li><span><?php xl('Visits','e') ?></span>
800 <ul>
801 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appointments'),'appointments_report.php'); ?>
802 <?php genPopLink(xl('Encounters'),'encounters_report.php'); ?>
803 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appt-Enc'),'appt_encounter_report.php'); ?>
804 </ul>
805 </li>
806 <li><span><?php xl('General','e') ?></span>
807 <ul>
808 <?php genPopLink(xl('Services'),'services_by_category.php'); ?>
809 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
810 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
811 </ul>
812 </li>
813 </ul>
814 </li>
815 <li><span><?php xl('Fees','e') ?></span>
816 <ul>
817 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
818 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
819 </ul>
820 </li>
821 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
822 <li><span><?php xl('Administration','e') ?></span>
823 <ul>
824 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
825 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
826 <?php genTreeLink('RTop','pwd','Users Password Change'); ?>
827 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings'); ?>
828 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
829 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
830 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
831 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
832 <li><span><?php xl('Other','e') ?></span>
833 <ul>
834 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
835 <?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'); ?>
836 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
837 <?php if (acl_check('admin', 'database')) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
838 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
839 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
840 </ul>
841 </li>
842 </ul>
843 </li>
844 <li><span><?php xl('Miscellaneous','e') ?></span>
845 <ul>
846 <?php genTreeLink('RBot','aun',xl('Pt Notes/Auth')); ?>
847 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
848 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
849 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
850 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
851 </ul>
852 </li>
853 </ul>
855 <?php } else { // not athletic team ?>
857 <ul id="navigation">
858 <?php if (!$GLOBALS['disable_calendar'] && !$GLOBALS['ippf_specific']) genTreeLink('RTop','cal',xl('Calendar')); ?>
859 <li class="open"><span><?php xl('Patient/Client','e') ?></span>
860 <ul>
861 <li><span><?php xl('Management','e') ?></span>
862 <ul>
863 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
864 <?php genTreeLink('RTop','dem',xl('Current')); ?>
865 </ul>
866 </li>
867 <li class="open"><span><?php xl('Visits','e') ?></span>
868 <ul>
869 <?php if ($GLOBALS['ippf_specific'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar')); ?>
870 <?php genTreeLink('RBot','nen',xl('New Visit')); ?>
871 <?php genTreeLink('RBot','enc',xl('Current')); ?>
872 <?php genTreeLink('RBot','ens',xl('List')); ?>
873 <?php if (!$GLOBALS['disable_chart_tracker']) genPopLink(xl('Chart Tracker'),'../../custom/chart_tracker.php'); ?>
874 </ul>
875 </li>
876 <li><span><?php xl('Visit Forms','e') ?></span>
877 <ul>
878 <?php
879 // Generate the items for visit forms, both traditional and LBF.
881 $lres = sqlStatement("SELECT * FROM list_options " .
882 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
883 if (sqlNumRows($lres)) {
884 while ($lrow = sqlFetchArray($lres)) {
885 $option_id = $lrow['option_id']; // should start with LBF
886 $title = $lrow['title'];
887 genMiscLink('RBot','cod','2',xl_form_title($title),
888 "patient_file/encounter/load_form.php?formname=$option_id");
891 include_once("$srcdir/registry.inc");
892 $reg = getRegistered();
893 if (!empty($reg)) {
894 foreach ($reg as $entry) {
895 $option_id = $entry['directory'];
896 $title = trim($entry['nickname']);
897 if ($option_id == 'fee_sheet' ) continue;
898 if ($option_id == 'newpatient') continue;
899 if (empty($title)) $title = $entry['name'];
900 genMiscLink('RBot','cod','2',xl_form_title($title),
901 "patient_file/encounter/load_form.php?formname=" .
902 urlencode($option_id));
906 </ul>
907 </li>
908 </ul>
909 </li>
910 <li><span><?php xl('Fees','e') ?></span>
911 <ul>
912 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
913 <?php if ($GLOBALS['use_charges_panel']) genTreeLink('RBot','cod',xl('Charges')); ?>
914 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
915 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil',xl('Billing')); ?>
916 </ul>
917 </li>
918 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
919 <?php if (!$disallowed['adm']) { ?>
920 <li><span><?php xl('Administration','e') ?></span>
921 <ul>
922 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
923 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
924 <?php
925 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
926 if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings&pharmacy&action=list'); ?>
927 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
928 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
929 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
930 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
931 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
932 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) genMiscLink('RTop','adm','0',xl('Export'),'main/ippf_export.php'); ?>
933 <li><span><?php xl('Other','e') ?></span>
934 <ul>
935 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
936 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
937 <?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'); ?>
938 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
939 <?php if (acl_check('admin', 'database')) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
940 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
941 </ul>
942 </li>
943 </ul>
944 </li>
945 <?php } ?>
946 <li><span><?php xl('Reports','e') ?></span>
947 <ul>
948 <li><span><?php xl('Clients','e') ?></span>
949 <ul>
950 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/patient_list.php'); ?>
951 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genMiscLink('RTop','rep','0',xl('Rx'),'reports/prescriptions_report.php'); ?>
952 <?php genMiscLink('RTop','rep','0',xl('Referrals'),'reports/referrals_report.php'); ?>
953 </ul>
954 </li>
955 <li class="open"><span><?php xl('Visits','e') ?></span>
956 <ul>
957 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appointments'),'reports/appointments_report.php'); ?>
958 <?php genMiscLink('RTop','rep','0',xl('Encounters'),'reports/encounters_report.php'); ?>
959 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appt-Enc'),'reports/appt_encounter_report.php'); ?>
960 <?php if (empty($GLOBALS['code_types']['IPPF'])) { ?>
961 <?php genMiscLink('RTop','rep','0',xl('Superbill'),'reports/custom_report_range.php'); ?>
962 <?php } ?>
963 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Chart Activity'),'reports/chart_location_activity.php'); ?>
964 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Charts Out'),'reports/charts_checked_out.php'); ?>
965 </ul>
966 </li>
967 <?php if (acl_check('acct', 'rep_a')) { ?>
968 <li><span><?php xl('Financial','e') ?></span>
969 <ul>
970 <?php genMiscLink('RTop','rep','0',xl('Sales'),'reports/sales_by_item.php'); ?>
971 <?php genMiscLink('RTop','rep','0',xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
972 <?php genMiscLink('RTop','rep','0',xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
973 <?php genMiscLink('RTop','rep','0',xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
974 <?php genMiscLink('RTop','rep','0',xl('Collections'), 'reports/collections_report.php'); ?>
975 </ul>
976 </li>
977 <?php } ?>
978 <li><span><?php xl('General','e') ?></span>
979 <ul>
980 <?php genMiscLink('RTop','rep','0',xl('Services'), 'reports/services_by_category.php'); ?>
981 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
982 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
983 </ul>
984 </li>
985 <?php if (! $GLOBALS['simplified_demographics']) { ?>
986 <li><span><?php xl('Insurance','e') ?></span>
987 <ul>
988 <?php genMiscLink('RTop','rep','0',xl('Distribution'),'reports/insurance_allocation_report.php'); ?>
989 <?php genMiscLink('RTop','rep','0',xl('Indigents'),'billing/indigent_patients_report.php'); ?>
990 <?php genMiscLink('RTop','rep','0',xl('Unique SP'),'reports/unique_seen_patients_report.php'); ?>
991 </ul>
992 </li>
993 <?php } ?>
994 <?php if (!empty($GLOBALS['code_types']['IPPF'])) { ?>
995 <li><span><?php xl('Statistics','e') ?></span>
996 <ul>
997 <?php genPopLink('IPPF Stats','ippf_statistics.php?t=i'); ?>
998 <?php genPopLink('GCAC Stats','ippf_statistics.php?t=g'); ?>
999 <?php genPopLink('MA Stats','ippf_statistics.php?t=m'); ?>
1000 <?php genPopLink('CYP','ippf_cyp_report.php'); ?>
1001 <?php genPopLink('Daily Record','ippf_daily.php'); ?>
1002 </ul>
1003 </li>
1004 <?php } // end ippf-specific ?>
1005 <li><span><?php xl('Blank Forms','e') ?></span>
1006 <ul>
1007 <?php genPopLink(xl('Demographics'),'../patient_file/summary/demographics_print.php'); ?>
1008 <?php genPopLink(xl('Fee Sheet'),'../patient_file/printed_fee_sheet.php'); ?>
1009 <?php genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php'); ?>
1010 <?php
1011 $lres = sqlStatement("SELECT * FROM list_options " .
1012 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1013 while ($lrow = sqlFetchArray($lres)) {
1014 $option_id = $lrow['option_id']; // should start with LBF
1015 $title = $lrow['title'];
1016 genPopLink($title, "../forms/LBF/printable.php?formname=$option_id");
1019 </ul>
1020 </li>
1021 <?php // genTreeLink('RTop','rep','Other'); ?>
1022 </ul>
1023 </li>
1024 <li><span><?php xl('Miscellaneous','e') ?></span>
1025 <ul>
1026 <?php genTreeLink('RBot','aun',xl('Pt Notes/Auth')); ?>
1027 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1028 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1029 <?php genTreeLink('RTop','ort',xl('Order Catalog')); ?>
1030 <?php if (!$GLOBALS['disable_chart_tracker']) genTreeLink('RTop','cht',xl('Chart Tracker')); ?>
1031 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1032 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1033 <?php genTreeLink('RTop','pwd',xl('Password')); ?>
1034 </ul>
1035 </li>
1036 </ul>
1038 <?php } // end not athletic team ?>
1040 <?php } else { // end ($GLOBALS['concurrent_layout'] == 2) ?>
1042 <table cellpadding='0' cellspacing='0' border='0'>
1043 <tr>
1044 <td colspan='3'>
1045 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1046 <tr>
1047 <td class='smalltext' nowrap>
1048 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
1049 </td>
1050 <td class='smalltext' align='right' nowrap>
1051 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
1052 </td>
1053 </tr>
1054 </table>
1055 </td>
1056 </tr>
1057 <?php
1058 // Builds the table of radio buttons and their labels. Radio button values
1059 // are comprised of the 3-character document id and the 1-digit usage type,
1060 // so that JavaScript can easily access this information.
1061 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
1062 foreach ($primary_docs as $key => $varr) {
1063 if (!empty($disallowed[$key])) continue;
1064 $label = $varr[0];
1065 $usage = $varr[1];
1066 $url = $varr[2];
1067 echo " <tr>\n";
1068 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
1069 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
1070 if ($key == $default_top_rbid) echo " checked";
1071 echo " /></td>\n";
1072 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
1073 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
1074 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
1075 if ($key == 'aun') echo " checked";
1076 echo " /></td>\n";
1077 echo " </tr>\n";
1080 </table>
1082 <?php } ?>
1084 <br /><hr />
1086 <?php
1087 // To use RelayHealth, see comments and parameters in includes/config.php.
1088 if (!empty($GLOBALS['ssi']['rh'])) {
1089 include_once("../../library/ssi.inc");
1090 echo getRelayHealthLink() ."<br /><hr />\n";
1094 <div id='current_patient' style = 'display:none'>
1095 <b><?php xl('None','e'); ?></b>
1096 </div>
1098 <div id='current_encounter' style = 'display:none'>
1099 <b><?php xl('None','e'); ?></b>
1100 </div>
1102 <?php if (!$GLOBALS['athletic_team']) genPopupsList(); ?>
1104 <hr />
1106 <table cellpadding='0' cellspacing='0' border='0'>
1107 <tr>
1108 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
1109 <td class='smalltext' colspan='2'>
1110 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
1111 </td>
1112 </tr>
1113 <tr>
1114 <td class='smalltext'><?php xl('by','e') ?>:</td>
1115 <td class='smalltext'>
1116 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name','e'); ?></a>
1117 </td>
1118 <td class='smalltext' align='right'>
1119 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID','e'); ?></a>
1120 </td>
1121 </tr>
1122 <tr>
1123 <td class='smalltext'>&nbsp;</td>
1124 <td class='smalltext'>
1125 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN','e'); ?></a>
1126 </td>
1127 <td class='smalltext' align='right'>
1128 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB','e'); ?></a>
1129 </td>
1130 </tr>
1132 <tr>
1133 <td class='smalltext'>&nbsp;</td>
1134 <td class='smalltext'>
1135 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
1136 </td>
1137 <td class='smalltext' align='right'>
1138 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
1139 </td>
1140 </tr>
1142 </table>
1144 <hr />
1145 <?php if (!empty($GLOBALS['online_support_link'])) { ?>
1146 <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>
1147 <?php } ?>
1149 <input type='hidden' name='findBy' value='Last' />
1150 <input type="hidden" name="searchFields" id="searchFields"/>
1152 </form>
1154 <script language='JavaScript'>
1155 syncRadios();
1156 </script>
1158 </body>
1159 </html>