Fix for possible reporting of deductible or coinsurance when it is zero.
[openemr.git] / interface / main / left_nav.php
blobf0ff7d193b602d58fe6048db587af7419d526e4f
1 <?php
2 // Copyright (C) 2006-2010 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // This provides the left navigation frame when $GLOBALS['concurrent_layout']
10 // is true. Following are notes as to what else was changed for this feature:
12 // * interface/main/main_screen.php: the top-level frameset.
13 // * interface/main/finder/patient_select.php: loads stuff when a new patient
14 // is selected.
15 // * interface/patient_file/summary/demographics.php: this is the first frame
16 // loaded when a new patient is chosen, and in turn sets the current pid and
17 // then loads the initial bottom frame.
18 // * interface/patient_file/summary/demographics_full.php: added support for
19 // setting a new pid, needed for going to demographics from billing.
20 // * interface/patient_file/summary/demographics_save.php: redisplay
21 // demographics.php and not the frameset.
22 // * interface/patient_file/summary/summary_bottom.php: new frameset for the
23 // summary, prescriptions and notes for a selected patient, cloned from
24 // patient_summary.php.
25 // * interface/patient_file/encounter/encounter_bottom.php: new frameset for
26 // the selected encounter, mosting coding/billing stuff, cloned from
27 // patient_encounter.php. This will also self-load the superbill pages
28 // as requested.
29 // * interface/usergroup/user_info.php: removed Back link.
30 // * interface/usergroup/admin_frameset.php: new frameset for Admin pages,
31 // cloned from usergroup.php.
32 // * interface/main/onotes/office_comments.php: removed Back link target.
33 // * interface/main/onotes/office_comments_full.php: changed Back link.
34 // * interface/billing/billing_report.php: removed Back link; added logic
35 // to properly go to demographics or to an encounter when requested.
36 // * interface/new/new.php: removed Back link and revised form target.
37 // * interface/new/new_patient_save.php: modified to load the demographics
38 // page to the current frame instead of loading a new frameset.
39 // * interface/patient_file/history/history.php: target change.
40 // * interface/patient_file/history/history_full.php: target changes.
41 // * interface/patient_file/history/history_save.php: target change.
42 // * interface/patient_file/history/encounters.php: link/target changes.
43 // * interface/patient_file/encounter/encounter_top.php: another new frameset
44 // cloned from patient_encounter.php.
45 // * interface/patient_file/encounter/forms.php: link target removal.
46 // * interface/patient_file/encounter/new_form.php: target change.
47 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
48 // changes.
49 // * interface/patient_file/summary/immunizations.php: removed back link.
50 // * interface/patient_file/summary/pnotes.php: changed link targets.
51 // * interface/patient_file/summary/pnotes_full.php: changed back link and
52 // added set_pid logic.
53 // * interface/patient_file/transaction/transactions.php: various changes.
54 // * interface/patient_file/transaction/add_transaction.php: new return js.
55 // * interface/patient_file/encounter/superbill_codes.php: target and link
56 // changes.
57 // * interface/patient_file/encounter/superbill_custom_full.php: target and
58 // link changes.
59 // * interface/patient_file/encounter/diagnosis.php: target changes.
60 // * interface/patient_file/encounter/diagnosis_full.php: target and link
61 // changes.
62 // * interface/main/authorizations/authorizations.php: link and target changes.
63 // * library/api.inc: url change.
64 // * interface/patient_file/summary/rx_frameset.php: new frameset.
65 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
66 // * all encounter forms: remove all instances of "target=Main" and change
67 // all instances of "patient_encounter.php" to "encounter_top.php".
69 // Our find_patient form, when submitted, invokes patient_select.php in the
70 // upper frame. When the patient is selected, demographics.php is invoked
71 // with the set_pid parameter, which establishes the new session pid and also
72 // calls the setPatient() function (below). In this case demographics.php
73 // will also load the summary frameset into the bottom frame, invoking our
74 // loadFrame() and setRadio() functions.
76 // Similarly, we have the concept of selecting an encounter from the
77 // Encounters list, and then having that "stick" until some other encounter
78 // or a new encounter is chosen. We also have a navigation item for creating
79 // a new encounter. interface/patient_file/encounter/encounter_top.php
80 // supports set_encounter to establish an encounter.
82 // TBD: Include active_pid and/or active_encounter in relevant submitted
83 // form data, and add logic to the save routines to make sure they match
84 // the corresponding session values.
86 include_once("../globals.php");
87 include_once($GLOBALS['fileroot']."/library/acl.inc");
88 include_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
89 include_once($GLOBALS['fileroot']."/library/patient.inc");
91 // This array defines the list of primary documents that may be
92 // chosen. Each element value is an array of 3 values:
94 // * Name to appear in the navigation table
95 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific
96 // * The URL relative to the interface directory
99 $primary_docs = array(
100 'ros' => array(xl('Roster') , 0, 'reports/players_report.php?embed=1'),
101 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
102 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php'),
103 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
104 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
105 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
106 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
107 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
108 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
109 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
110 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
111 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
112 'imp' => array(xl('Import') , 0, '../custom/import.php'),
113 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
114 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
115 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
116 'new' => array(xl('New Pt') , 0, 'new/new.php'),
117 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
118 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
119 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
120 'nen' => array(xl('Create Visit'), 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
121 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
122 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
123 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
124 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
125 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
126 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
127 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
128 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
129 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
130 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
131 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
133 $primary_docs['npa']=array(xl('Payments') , 0, 'billing/new_payment.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 $disallowed['fax'] = !($GLOBALS['enable_hylafax'] || $GLOBALS['enable_scanner']);
156 $disallowed['ros'] = !$GLOBALS['athletic_team'];
158 $disallowed['iss'] = !((acl_check('encounters', 'notes') == 'write' ||
159 acl_check('encounters', 'notes_a') == 'write') &&
160 acl_check('patients', 'med') == 'write');
162 $disallowed['imp'] = $disallowed['new'] ||
163 !is_readable("$webserver_root/custom/import.php");
165 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
167 $disallowed['pre'] = !(acl_check('patients', 'med'));
169 // Helper functions for treeview generation.
170 function genTreeLink($frame, $name, $title, $mono=false) {
171 global $primary_docs, $disallowed;
172 if (empty($disallowed[$name])) {
173 $id = $name . $primary_docs[$name][1];
174 echo "<li><a href='' id='$id' onclick=\"";
175 if ($mono) {
176 if ($frame == 'RTop')
177 echo "forceSpec(true,false);";
178 else
179 echo "forceSpec(false,true);";
181 echo "return loadFrame2('$id','$frame','" .
182 $primary_docs[$name][2] . "')\">" . $title . "</a></li>";
185 function genMiscLink($frame, $name, $level, $title, $url, $mono=false) {
186 global $disallowed;
187 if (empty($disallowed[$name])) {
188 $id = $name . $level;
189 echo "<li><a href='' id='$id' onclick=\"";
190 if ($mono) {
191 if ($frame == 'RTop')
192 echo "forceSpec(true,false);";
193 else
194 echo "forceSpec(false,true);";
196 echo "return loadFrame2('$id','$frame','" .
197 $url . "')\">" . $title . "</a></li>";
200 function genPopLink($title, $url, $linkid='') {
201 echo "<li><a href='' ";
202 if ($linkid) echo "id='$linkid' ";
203 echo "onclick=\"return repPopup('$url')\"" .
204 ">" . $title . "</a></li>";
206 function genDualLink($topname, $botname, $title) {
207 global $primary_docs, $disallowed;
208 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
209 $topid = $topname . $primary_docs[$topname][1];
210 $botid = $botname . $primary_docs[$botname][1];
211 echo "<li><a href='' id='$topid' " .
212 "onclick=\"return loadFrameDual('$topid','$botid','" .
213 $primary_docs[$topname][2] . "','" .
214 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
218 function genPopupsList($style='') {
219 global $disallowed, $webserver_root;
221 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
222 <option value=''><?php xl('Popups','e'); ?></option>
223 <?php if (!$disallowed['iss']) { ?>
224 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
225 <?php } ?>
226 <?php if (!$GLOBALS['ippf_specific']) { ?>
227 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
228 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
229 <?php } ?>
230 <?php if ($GLOBALS['athletic_team']) { ?>
231 <option value='../reports/players_report.php'><?php xl('Roster','e'); ?></option>
232 <?php } ;
233 if (!$GLOBALS['disable_calendar']) { ?>
234 <option value='../reports/appointments_report.php?patient=<?php echo $pid ?>'><?php xl('Appts','e'); ?></option>
235 <?php } ;
236 if (file_exists("$webserver_root/custom/refer.php")) { ?>
237 <option value='../../custom/refer.php'><?php xl('Refer','e'); ?></option>
238 <?php } ?>
239 <?php // if (file_exists("$webserver_root/custom/fee_sheet_codes.php")) { ?>
240 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill','e'); ?></option>
241 <?php // } ?>
242 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
243 <option value='../patient_file/front_payment.php'><?php xl('Prepay','e'); ?></option>
244 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
245 <?php } else { ?>
246 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
247 <?php } ?>
248 <?php if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates")) { ?>
249 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
250 <?php } ?>
251 </select>
252 <?php
256 <html>
257 <head>
258 <title>Navigation</title>
259 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
261 <style type="text/css">
262 body {
263 font-size:8pt;
264 font-weight:normal;
265 padding: 5px 3px 5px 3px;
267 .smalltext {
268 font-family:sans-serif;
269 font-size:8pt;
270 font-weight:normal;
272 a.navitem, a.navitem:visited {
273 color:#0000ff;
274 font-family:sans-serif;
275 font-size:8pt;
276 font-weight:bold;
278 .inputtext {
279 font-size:9pt;
280 font-weight:normal;
281 border-style:solid;
282 border-width:1px;
283 padding-left:2px;
284 padding-right:2px;
285 border-color: #000000;
286 background-color:transparent;
289 #navigation ul {
290 background-color:transparent;
292 </style>
294 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.3/jquery.treeview.css" />
295 <script src="../../library/js/jquery-1.2.2.min.js" type="text/javascript"></script>
296 <script src="../../library/js/jquery.treeview-1.3/jquery.treeview.min.js" type="text/javascript"></script>
298 <script type="text/javascript" src="../../library/dialog.js"></script>
300 <script language='JavaScript'>
302 // Master values for current pid and encounter.
303 var active_pid = 0;
304 var active_encounter = 0;
306 // Current selections in the top and bottom frames.
307 var topName = '';
308 var botName = '';
310 // Expand and/or collapse frames in response to checkbox clicks.
311 // fnum indicates which checkbox was clicked (1=left, 2=right).
312 function toggleFrame(fnum) {
313 var f = document.forms[0];
314 var fset = top.document.getElementById('fsright');
315 if (!f.cb_top.checked && !f.cb_bot.checked) {
316 if (fnum == 1) f.cb_bot.checked = true;
317 else f.cb_top.checked = true;
319 var rows = f.cb_top.checked ? '*' : '0';
320 rows += f.cb_bot.checked ? ',*' : ',0';
321 fset.rows = rows;
322 fset.rows = rows;
325 // Load the specified url into the specified frame (RTop or RBot).
326 // The URL provided must be relative to interface.
327 function loadFrame(fname, frame, url) {
328 top.restoreSession();
329 var i = url.indexOf('{PID}');
330 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
331 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
332 if (frame == 'RTop') topName = fname; else botName = fname;
335 // Load the specified url into a frame to be determined, with the specified
336 // frame as the default; the url must be relative to interface.
337 function loadFrame2(fname, frame, url) {
338 var usage = fname.substring(3);
339 if (active_pid == 0 && usage > '0') {
340 alert('<?php xl('You must first select or add a patient.','e') ?>');
341 return false;
343 if (active_encounter == 0 && usage > '1') {
344 alert('<?php xl('You must first select or create an encounter.','e') ?>');
345 return false;
347 var f = document.forms[0];
348 top.restoreSession();
349 var i = url.indexOf('{PID}');
350 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
351 if(f.sel_frame)
353 var fi = f.sel_frame.selectedIndex;
354 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
356 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
357 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
358 if (frame == 'RTop') topName = fname; else botName = fname;
359 return false;
362 // Make sure the the top and bottom frames are open or closed, as specified.
363 function forceSpec(istop, isbot) {
364 var f = document.forms[0];
365 if (f.cb_top.checked != istop) {
366 f.cb_top.checked = istop;
367 toggleFrame(1);
369 if (f.cb_bot.checked != isbot) {
370 f.cb_bot.checked = isbot;
371 toggleFrame(2);
375 // Make sure both frames are open.
376 function forceDual() {
377 forceSpec(true, true);
380 // Load the specified url into a frame to be determined, with the specified
381 // frame as the default; the url must be relative to interface.
382 function loadFrameDual(tname, bname, topurl, boturl) {
383 var topusage = tname.substring(3);
384 var botusage = bname.substring(3);
385 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
386 alert('<?php xl('You must first select or add a patient.','e') ?>');
387 return false;
389 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
390 alert('<?php xl('You must first select or create an encounter.','e') ?>');
391 return false;
393 var f = document.forms[0];
394 forceDual();
395 top.restoreSession();
396 var i = topurl.indexOf('{PID}');
397 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
398 i = boturl.indexOf('{PID}');
399 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
400 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
401 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
402 topName = tname;
403 botName = bname;
404 return false;
407 // Select a designated radio button. raname may be either the radio button
408 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
409 // You should call this if you directly load a document that does not
410 // correspond to the current radio button setting.
411 function setRadio(raname, rbid) {
412 <?php if ($GLOBALS['concurrent_layout'] != 2) { ?>
413 var f = document.forms[0];
414 if (raname == 'RTop') raname = 'rb_top';
415 if (raname == 'RBot') raname = 'rb_bot';
416 for (var i = 0; i < f[raname].length; ++i) {
417 if (f[raname][i].value.substring(0,3) == rbid) {
418 f[raname][i].checked = true;
419 return true;
422 <?php } ?>
423 return false;
426 // Set disabled/enabled state of radio buttons and associated labels
427 // depending on whether there is an active patient or encounter.
428 function syncRadios() {
429 var f = document.forms[0];
430 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
431 var nlinks = document.links.length;
432 for (var i = 0; i < nlinks; ++i) {
433 var lnk = document.links[i];
434 if (lnk.id.length != 4) continue;
435 var usage = lnk.id.substring(3);
436 if (usage == '1' || usage == '2') {
437 var da = false;
438 if (active_pid == 0) da = true;
439 if (active_encounter == 0 && usage > '1') da = true;
440 lnk.style.color = da ? '#888888' : '#0000ff';
443 <?php } else { ?>
444 for (var i = 0; i < f.rb_top.length; ++i) {
445 var da = false;
446 var rb1 = f.rb_top[i];
447 var rb2 = f.rb_bot[i];
448 var rbid = rb1.value.substring(0,3);
449 var usage = rb1.value.substring(3);
450 if (active_pid == 0 && usage > '0') da = true;
451 if (active_encounter == 0 && usage > '1') da = true;
452 // daemon_frame can also set special label colors, so don't mess with
453 // them unless we have to.
454 if (rb1.disabled != da) {
455 rb1.disabled = da;
456 rb2.disabled = da;
457 document.getElementById('lbl_' + rbid).style.color = da ? '#888888' : '#000000';
460 <?php } ?>
461 f.popups.disabled = (active_pid == 0);
464 function goHome() {
465 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
466 top.frames['RBot'].location='messages/messages.php';
470 var my_window;
471 function initFilter() {
472 my_window = window.open("../../custom/search.php", "mywindow","status=1");
475 function processFilter( fieldString ) {
476 document.getElementById('searchFields').value=fieldString;
477 findPatient( "Filter" );
478 my_window.close();
482 // Process the click to find a patient by name, id, ssn or dob.
483 function findPatient(findby) {
484 var f = document.forms[0];
485 if (! f.cb_top.checked) {
486 f.cb_top.checked = true;
487 toggleFrame(1);
489 f.findBy.value = findby;
490 setRadio('rb_top', 'dem');
491 top.restoreSession();
492 document.find_patient.submit();
495 // Helper function to set the contents of a div.
496 function setSomeContent(id, content, doc) {
497 if (doc.getElementById) {
498 var x = doc.getElementById(id);
499 x.innerHTML = '';
500 x.innerHTML = content;
502 else if (doc.all) {
503 var x = doc.all[id];
504 x.innerHTML = content;
507 function setDivContent(id, content) {
508 setSomeContent(id, content, document);
510 function setTitleContent(id, content) {
511 setSomeContent(id, content, parent.Title.document);
514 // This is called automatically when a new patient is set, to make sure
515 // there are no patient-specific documents showing stale data. If a frame
516 // was just loaded with data for the correct patient, its name is passed so
517 // that it will not be zapped. At this point the new server-side pid is not
518 // assumed to be set, so this function will only load global data.
519 function reloadPatient(frname) {
520 var f = document.forms[0];
521 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
522 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
523 setRadio('rb_top', 'cal');
525 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
526 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
527 setRadio('rb_bot', 'ens');
531 // Reload encounter-specific frames, excluding a specified frame. At this
532 // point the new server-side encounter ID may not be set and loading the same
533 // document for the new encounter will not work, so load patient info instead.
534 function reloadEncounter(frname) {
535 var f = document.forms[0];
536 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
537 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
538 setRadio('rb_top', 'dem');
540 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
541 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
542 setRadio('rb_bot', 'ens');
546 // Call this to announce that the patient has changed. You must call this
547 // if you change the session PID, so that the navigation frame will show the
548 // correct patient and so that the other frame will be reloaded if it contains
549 // patient-specific information from the previous patient. frname is the name
550 // of the frame that the call came from, so we know to only reload content
551 // from the *other* frame if it is patient-specific.
552 function setPatient(pname, pid, pubpid, frname, str_dob) {
553 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
554 setDivContent('current_patient', str);
555 setTitleContent('current_patient', str + str_dob);
556 if (pid == active_pid) return;
557 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
558 active_pid = pid;
559 active_encounter = 0;
560 if (frname) reloadPatient(frname);
561 syncRadios();
562 $(parent.Title.document.getElementById('current_patient_block')).show();
563 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
564 $(encounter_block).hide();
566 // zero out the encounter frame, replace it with the encounter list frame
567 var f = document.forms[0];
568 if ( f.cb_top.checked && f.cb_bot.checked ) {
569 var encounter_frame = getEncounterTargetFrame('enc');
570 if ( encounter_frame != undefined ) {
571 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
572 setRadio(encounter_frame, 'ens');
576 function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) {
577 //This function lists all encounters of the patient.
578 //This function writes the drop down in the top frame.
579 //It is called when a new patient is create/selected from the search menu.
580 var str = '<Select class="text" id="EncounterHistory" onchange="toencounter(this.options[this.selectedIndex].value)">';
581 str+='<option value=""><?php echo htmlspecialchars( xl('Encounter History'), ENT_QUOTES) ?></option>';
582 str+='<option value="New Encounter"><?php echo htmlspecialchars( xl('New Encounter'), ENT_QUOTES) ?></option>';
583 str+='<option value="Past Encounter List"><?php echo htmlspecialchars( xl('Past Encounter List'), ENT_QUOTES) ?></option>';
584 for(CountEncounter=0;CountEncounter<EncounterDateArray.length;CountEncounter++)
586 str+='<option value="'+EncounterIdArray[CountEncounter]+'~'+EncounterDateArray[CountEncounter]+'">'+EncounterDateArray[CountEncounter]+'-'+CalendarCategoryArray[CountEncounter]+'</option>';
588 str+='</Select>';
589 $(parent.Title.document.getElementById('past_encounter_block')).show();
590 top.window.parent.Title.document.getElementById('past_encounter').innerHTML=str;
593 function loadCurrentPatientFromTitle() {
594 top.frames['RTop'].location='../patient_file/summary/demographics.php';
597 function getEncounterTargetFrame( name ) {
598 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
599 var f = document.forms[0];
600 var r = 'RTop';
601 if (f.cb_top.checked && f.cb_bot.checked) {
602 if ( bias == 2 ) {
603 r = 'RBot';
604 } else {
605 r = 'RTop';
607 } else {
608 if ( f.cb_top.checked ) {
609 r = 'RTop';
610 } else if ( f.cb_bot.checked ) {
611 r = 'RBot';
614 return r;
617 // Call this to announce that the encounter has changed. You must call this
618 // if you change the session encounter, so that the navigation frame will
619 // show the correct encounter and so that the other frame will be reloaded if
620 // it contains encounter-specific information from the previous encounter.
621 // frname is the name of the frame that the call came from, so we know to only
622 // reload encounter-specific content from the *other* frame.
623 function setEncounter(edate, eid, frname) {
624 if (eid == active_encounter) return;
625 if (!eid) edate = '<?php xl('None','e'); ?>';
626 var str = '<b>' + edate + '</b>';
627 setDivContent('current_encounter', str);
628 active_encounter = eid;
629 reloadEncounter(frname);
630 syncRadios();
631 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
632 var encounter = $(parent.Title.document.getElementById('current_encounter'));
633 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
634 encounter.html( estr );
635 encounter_block.show();
638 function loadCurrentEncounterFromTitle() {
639 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/encounter_top.php';
642 // You must call this if you delete the active patient (or if for any other
643 // reason you "close" the active patient without opening a new one), so that
644 // the appearance of the navigation frame will be correct and so that any
645 // stale content will be reloaded.
646 function clearPatient() {
647 if (active_pid == 0) return;
648 var f = document.forms[0];
649 active_pid = 0;
650 active_encounter = 0;
651 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
652 setTitleContent('current_patient', '<b><?php xl('None','e'); ?></b>');
653 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
654 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
655 reloadPatient('');
656 syncRadios();
659 // You must call this if you delete the active encounter (or if for any other
660 // reason you "close" the active encounter without opening a new one), so that
661 // the appearance of the navigation frame will be correct and so that any
662 // stale content will be reloaded.
663 function clearEncounter() {
664 if (active_encounter == 0) return;
665 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
666 active_encounter = 0;
667 reloadEncounter('');
668 syncRadios();
670 function removeOptionSelected(EncounterId)
671 {//Removes an item from the Encounter drop down.
672 var elSel = top.window.parent.Title.document.getElementById('EncounterHistory');
673 var i;
674 for (i = elSel.length - 1; i>=2; i--) {
675 EncounterHistoryValue=elSel.options[i].value;
676 EncounterHistoryValueArray=EncounterHistoryValue.split('~');
677 if (EncounterHistoryValueArray[0]==EncounterId) {
678 elSel.remove(i);
683 // You can call this to make sure the session pid is what we expect.
684 function pidSanityCheck(pid) {
685 if (pid != active_pid) {
686 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
687 '. This session is unstable and should be abandoned. Do not use ' +
688 'OpenEMR in multiple browser windows!');
689 return false;
691 return true;
694 // You can call this to make sure the session encounter is what we expect.
695 function encounterSanityCheck(eid) {
696 if (eid != active_encounter) {
697 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
698 '. This session is unstable and should be abandoned. Do not use ' +
699 'OpenEMR in multiple browser windows!');
700 return false;
702 return true;
705 // Pop up a report.
706 function repPopup(aurl) {
707 top.restoreSession();
708 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
709 return false;
712 // This is invoked to pop up some window when a popup item is selected.
713 function selpopup(selobj) {
714 var i = selobj.selectedIndex;
715 var opt = selobj.options[i];
716 if (i > 0) {
717 var width = 750;
718 var height = 550;
719 if (opt.text == 'Export' || opt.text == 'Import') {
720 width = 500;
721 height = 400;
723 else if (opt.text == 'Refer') {
724 width = 700;
725 height = 500;
727 dlgopen(opt.value, '_blank', width, height);
729 selobj.selectedIndex = 0;
732 // Treeview activation stuff:
733 $(document).ready(function(){
734 $("#navigation").treeview({
735 animated: "fast",
736 collapsed: true,
737 unique: <?php echo $GLOBALS['athletic_team'] ? 'false' : 'true' ?>,
738 toggle: function() {
739 window.console && console.log("%o was toggled", this);
744 </script>
746 </head>
748 <body class="body_nav">
750 <form method='post' name='find_patient' target='RTop'
751 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
753 <?php if ($GLOBALS['concurrent_layout'] == 2) { ?>
755 <center>
756 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:<?php echo $GLOBALS['athletic_team'] ? 47 : 100; ?>%;'>
757 <option value='0'><?php xl('Default','e'); ?></option>
758 <option value='1'><?php xl('Top','e'); ?></option>
759 <option value='2'><?php xl('Bottom','e'); ?></option>
760 </select>
761 <?php if ($GLOBALS['athletic_team']) genPopupsList('width:47%'); ?>
762 </center>
764 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
765 <tr>
766 <td class='smalltext' nowrap>
767 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked />
768 <b><?php xl('Top','e') ?></b>
769 </td>
770 <td class='smalltext' align='right' nowrap>
771 <b><?php xl('Bot','e') ?></b>
772 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php if (empty($GLOBALS['athletic_team'])) echo 'checked '; ?>/>
773 </td>
774 </tr>
775 </table>
777 <?php if ($GLOBALS['athletic_team']) { // Tree menu for athletic teams ?>
779 <ul id="navigation">
780 <li class="open"><span><?php xl('Patient/Client','e') ?></span>
781 <ul>
782 <li class="open"><span><?php xl('Demographics','e') ?></span>
783 <ul>
784 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
785 <?php genTreeLink('RTop','dem',xl('Current')); ?>
786 </ul>
787 </li>
788 <li class="open"><span><?php xl('Medical Records','e') ?></span>
789 <ul>
790 <?php // genPopLink (xl('Team Roster'),'players_report.php'); ?>
792 <?php genTreeLink('RTop','ros',xl('Weekly Exposures'),true); ?>
793 <?php genMiscLink('RTop','ros','0',xl('Team Roster'),'reports/old_players_report.php?embed=1',true); ?>
794 <?php if (!$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar'),true); ?>
796 <?php genDualLink('nen','ens',xl('New Consultation')); // with ens on bottom ?>
798 <?php // genDualLink('enc','ens','Current Consultation'); // with ens on bottom ?>
799 <?php genTreeLink('RTop','enc',xl('Current Consultation')); // encounter_top will itself load ens on bottom ?>
801 <?php // genDualLink('dem','ens',xl('Previous Consultations')); // with dem on top ?>
802 <?php genTreeLink('RBot','ens',xl('Previous Consultations'),true); ?>
803 <?php genDualLink('his','ens',xl('Prev Med/Surg Hx')); // with ens on bottom ?>
805 <?php // genTreeLink('RBot','nen',xl('New Allergy')); // nen with Allergy in chief complaint ?>
806 <?php genPopLink(xl('New Allergy'),'../patient_file/summary/add_edit_issue.php?thistype=allergy','xxx1'); ?>
808 <?php genTreeLink('RTop','iss',xl('View/Edit Allergies')); // somehow emphasizing allergies...? ?>
809 <?php genDualLink('iss','ens',xl('Problems/Issues')); // with ens on bottom ?>
810 <?php genDualLink('tra','ens',xl('Transactions/Referrals')); // new transaction form on top and tra list on bottom (or ens if no tra) ?>
811 <?php if (!$GLOBALS['disable_immunizations']) genDualLink('his','imm',xl('Immunizations')); // imm on bottom, his on top ?>
812 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genDualLink('his','pre',xl('Prescriptions')); // pre on bottom, his on top ?>
813 <?php genTreeLink('RTop','doc',xl('Document/Imaging Store'),true); ?>
814 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); ?>
815 <?php genDualLink('dem','pno',xl('Additional Notes')); // with dem on top ?>
816 <li><a href='' onClick="return repPopup('../patient_file/letter.php')" id='prp1'>Letter</a></li>
817 <?php genPopLink(xl('Address Book'),'../usergroup/addrbook_list.php?popup=1'); ?>
818 </ul>
819 </li>
820 </ul>
821 </li>
822 <li class="open"><span><?php xl('Reports','e') ?></span>
823 <ul>
824 <li class="open"><span><?php xl('Athletic/Injury','e') ?></span>
825 <ul>
826 <?php genTreeLink('RTop','prp',xl('Patient Printed Report')); // also appears above ?>
827 <?php genPopLink(xl('Games/Events Missed'),'absences_report.php'); ?>
828 <?php genPopLink(xl('Injury Surveillance'),'football_injury_report.php'); ?>
829 <?php genPopLink(xl('Team Injury Overview'),'injury_overview_report.php'); ?>
830 </ul>
831 </li>
832 <li><span><?php xl('Patient/Client','e') ?></span>
833 <ul>
834 <?php genPopLink(xl('List'),'patient_list.php'); ?>
835 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genPopLink(xl('Prescriptions'),'prescriptions_report.php'); ?>
836 <?php genPopLink(xl('Referrals'),'referrals_report.php'); ?>
837 </ul>
838 </li>
839 <li><span><?php xl('Visits','e') ?></span>
840 <ul>
841 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appointments'),'appointments_report.php'); ?>
842 <?php genPopLink(xl('Encounters'),'encounters_report.php'); ?>
843 <?php if (!$GLOBALS['disable_calendar']) genPopLink(xl('Appt-Enc'),'appt_encounter_report.php'); ?>
844 </ul>
845 </li>
846 <li><span><?php xl('General','e') ?></span>
847 <ul>
848 <?php genPopLink(xl('Services'),'services_by_category.php'); ?>
849 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Inventory'),'inventory_list.php'); ?>
850 <?php if ($GLOBALS['inhouse_pharmacy']) genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
851 </ul>
852 </li>
853 </ul>
854 </li>
855 <li><span><?php xl('Fees','e') ?></span>
856 <ul>
857 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
858 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
859 </ul>
860 </li>
861 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
862 <li><span><?php xl('Administration','e') ?></span>
863 <ul>
864 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
865 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
866 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
867 <?php genTreeLink('RTop','pwd','Users Password Change'); ?>
868 <?php if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings'); ?>
869 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
870 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
871 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
872 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
873 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
874 <?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'); ?>
875 <li><span><?php xl('Other','e') ?></span>
876 <ul>
877 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
878 <?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'); ?>
879 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
880 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
881 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
882 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
883 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
884 </ul>
885 </li>
886 </ul>
887 </li>
888 <li><span><?php xl('Miscellaneous','e') ?></span>
889 <ul>
890 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
891 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
892 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
893 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
894 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
895 </ul>
896 </li>
897 </ul>
899 <?php } else { // not athletic team ?>
901 <ul id="navigation">
902 <?php if (!$GLOBALS['disable_calendar'] && !$GLOBALS['ippf_specific']) genTreeLink('RTop','cal',xl('Calendar')); ?>
903 <?php genTreeLink('RBot','msg',xl('Messages')); ?>
904 <li class="open"><span><?php xl('Patient/Client','e') ?></span>
905 <ul>
906 <?php genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
907 <?php genTreeLink('RTop','dem',xl('Summary')); ?>
908 <li class="open"><span><?php xl('Visits','e') ?></span>
909 <ul>
910 <?php if ($GLOBALS['ippf_specific'] && !$GLOBALS['disable_calendar']) genTreeLink('RTop','cal',xl('Calendar')); ?>
911 <?php genTreeLink('RBot','nen',xl('Create Visit')); ?>
912 <?php genTreeLink('RBot','enc',xl('Current')); ?>
913 <?php genTreeLink('RBot','ens',xl('Visit History')); ?>
914 </ul>
915 </li>
916 <li><span><?php xl('Visit Forms','e') ?></span>
917 <ul>
918 <?php
919 // Generate the items for visit forms, both traditional and LBF.
921 $lres = sqlStatement("SELECT * FROM list_options " .
922 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
923 if (sqlNumRows($lres)) {
924 while ($lrow = sqlFetchArray($lres)) {
925 $option_id = $lrow['option_id']; // should start with LBF
926 $title = $lrow['title'];
927 genMiscLink('RBot','cod','2',xl_form_title($title),
928 "patient_file/encounter/load_form.php?formname=$option_id");
931 include_once("$srcdir/registry.inc");
932 $reg = getRegistered();
933 if (!empty($reg)) {
934 foreach ($reg as $entry) {
935 $option_id = $entry['directory'];
936 $title = trim($entry['nickname']);
937 if ($option_id == 'fee_sheet' ) continue;
938 if ($option_id == 'newpatient') continue;
939 if (empty($title)) $title = $entry['name'];
940 genMiscLink('RBot','cod','2',xl_form_title($title),
941 "patient_file/encounter/load_form.php?formname=" .
942 urlencode($option_id));
946 </ul>
947 </li>
948 </ul>
949 </li>
950 <li><span><?php xl('Fees','e') ?></span>
951 <ul>
952 <?php genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
953 <?php if ($GLOBALS['use_charges_panel']) genTreeLink('RBot','cod',xl('Charges')); ?>
954 <?php genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
955 <?php if (! $GLOBALS['simplified_demographics']) genTreeLink('RTop','bil',xl('Billing')); ?>
956 <?php genTreeLink('RTop','npa',xl('Payments'),false,2);?>
957 </ul>
958 </li>
959 <?php // if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0',xl('Inventory'),'drugs/drug_inventory.php'); ?>
960 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
961 <li><span><?php xl('Inventory','e') ?></span>
962 <ul>
963 <?php genMiscLink('RTop','adm','0',xl('Management'),'drugs/drug_inventory.php'); ?>
964 <?php genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
965 </ul>
966 </li>
967 <?php } ?>
968 <li><span><?php xl('Procedures','e') ?></span>
969 <ul>
970 <?php genTreeLink('RTop','ort',xl('Configuration')); ?>
971 <?php genTreeLink('RTop','orp',xl('Pending Review')); ?>
972 <?php genTreeLink('RTop','orr',xl('Patient Results')); ?>
973 <?php genTreeLink('RTop','orb',xl('Batch Results')); ?>
974 </ul>
975 </li>
976 <?php if (!$disallowed['adm']) { ?>
977 <li><span><?php xl('Administration','e') ?></span>
978 <ul>
979 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
980 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
981 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
982 <?php
983 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
984 if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings&pharmacy&action=list'); ?>
985 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Services')); ?>
986 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
987 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
988 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
989 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
990 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
991 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
992 <?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'); ?>
993 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) genMiscLink('RTop','adm','0',xl('Export'),'main/ippf_export.php'); ?>
994 <li><span><?php xl('Other','e') ?></span>
995 <ul>
996 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
997 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
998 <?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'); ?>
999 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1000 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1001 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1002 </ul>
1003 </li>
1004 </ul>
1005 </li>
1006 <?php } ?>
1007 <li><span><?php xl('Reports','e') ?></span>
1008 <ul>
1009 <li><span><?php xl('Clients','e') ?></span>
1010 <ul>
1011 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/patient_list.php'); ?>
1012 <?php if (acl_check('patients', 'med') && !$GLOBALS['disable_prescriptions']) genMiscLink('RTop','rep','0',xl('Rx'),'reports/prescriptions_report.php'); ?>
1013 <?php genMiscLink('RTop','rep','0',xl('Referrals'),'reports/referrals_report.php'); ?>
1014 </ul>
1015 </li>
1016 <li class="open"><span><?php xl('Visits','e') ?></span>
1017 <ul>
1018 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appointments'),'reports/appointments_report.php'); ?>
1019 <?php genMiscLink('RTop','rep','0',xl('Encounters'),'reports/encounters_report.php'); ?>
1020 <?php if (!$GLOBALS['disable_calendar']) genMiscLink('RTop','rep','0',xl('Appt-Enc'),'reports/appt_encounter_report.php'); ?>
1021 <?php if (empty($GLOBALS['code_types']['IPPF'])) { ?>
1022 <?php genMiscLink('RTop','rep','0',xl('Superbill'),'reports/custom_report_range.php'); ?>
1023 <?php } ?>
1024 <?php genMiscLink('RTop','rep','0',xl('Eligibility'),'reports/edi_270.php'); ?>
1025 <?php genMiscLink('RTop','rep','0',xl('Eligibility Response'),'reports/edi_271.php'); ?>
1028 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Chart Activity'),'reports/chart_location_activity.php'); ?>
1029 <?php if (!$GLOBALS['disable_chart_tracker']) genMiscLink('RTop','rep','0',xl('Charts Out'),'reports/charts_checked_out.php'); ?>
1030 <?php genMiscLink('RTop','rep','0',xl('Services'), 'reports/services_by_category.php'); ?>
1031 <?php genMiscLink('RTop','rep','0',xl('Syndromic Surveillance'),'reports/non_reported.php'); ?>
1032 </ul>
1033 </li>
1034 <?php if (acl_check('acct', 'rep_a')) { ?>
1035 <li><span><?php xl('Financial','e') ?></span>
1036 <ul>
1037 <?php genMiscLink('RTop','rep','0',xl('Sales'),'reports/sales_by_item.php'); ?>
1038 <?php genMiscLink('RTop','rep','0',xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
1039 <?php genMiscLink('RTop','rep','0',xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
1040 <?php genMiscLink('RTop','rep','0',xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
1041 <?php genMiscLink('RTop','rep','0',xl('Collections'), 'reports/collections_report.php'); ?>
1042 </ul>
1043 </li>
1044 <?php } ?>
1045 <?php if ($GLOBALS['inhouse_pharmacy']) { ?>
1046 <li><span><?php xl('Inventory','e') ?></span>
1047 <ul>
1048 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/inventory_list.php'); ?>
1049 <?php genMiscLink('RTop','rep','0',xl('Activity'),'reports/inventory_activity.php'); ?>
1050 <?php genMiscLink('RTop','rep','0',xl('Transactions'),'reports/inventory_transactions.php'); ?>
1051 </ul>
1052 </li>
1053 <?php } ?>
1054 <li><span><?php xl('Procedures','e') ?></span>
1055 <ul>
1056 <?php genPopLink(xl('Pending Res'),'../orders/pending_orders.php'); ?>
1057 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink(xl('Pending F/U'),'../orders/pending_followup.php'); ?>
1058 <?php genPopLink(xl('Statistics'),'../orders/procedure_stats.php'); ?>
1059 </ul>
1060 </li>
1061 <?php if (! $GLOBALS['simplified_demographics']) { ?>
1062 <li><span><?php xl('Insurance','e') ?></span>
1063 <ul>
1064 <?php genMiscLink('RTop','rep','0',xl('Distribution'),'reports/insurance_allocation_report.php'); ?>
1065 <?php genMiscLink('RTop','rep','0',xl('Indigents'),'billing/indigent_patients_report.php'); ?>
1066 <?php genMiscLink('RTop','rep','0',xl('Unique SP'),'reports/unique_seen_patients_report.php'); ?>
1067 </ul>
1068 </li>
1069 <?php } ?>
1070 <?php if (!empty($GLOBALS['code_types']['IPPF'])) { ?>
1071 <li><span><?php xl('Statistics','e') ?></span>
1072 <ul>
1073 <?php genPopLink(xl('IPPF Stats'),'ippf_statistics.php?t=i'); ?>
1074 <?php genPopLink(xl('GCAC Stats'),'ippf_statistics.php?t=g'); ?>
1075 <?php genPopLink(xl('MA Stats'),'ippf_statistics.php?t=m'); ?>
1076 <?php genPopLink(xl('CYP'),'ippf_cyp_report.php'); ?>
1077 <?php genPopLink(xl('Daily Record'),'ippf_daily.php'); ?>
1078 </ul>
1079 </li>
1080 <?php } // end ippf-specific ?>
1081 <li><span><?php xl('Blank Forms','e') ?></span>
1082 <ul>
1083 <?php genPopLink(xl('Demographics'),'../patient_file/summary/demographics_print.php'); ?>
1084 <?php genPopLink(xl('Fee Sheet'),'../patient_file/printed_fee_sheet.php'); ?>
1085 <?php genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php'); ?>
1086 <?php
1087 $lres = sqlStatement("SELECT * FROM list_options " .
1088 "WHERE list_id = 'lbfnames' ORDER BY seq, title");
1089 while ($lrow = sqlFetchArray($lres)) {
1090 $option_id = $lrow['option_id']; // should start with LBF
1091 $title = $lrow['title'];
1092 genPopLink($title, "../forms/LBF/printable.php?formname=$option_id");
1095 </ul>
1096 </li>
1097 <?php // genTreeLink('RTop','rep','Other'); ?>
1098 </ul>
1099 </li>
1100 <li><span><?php xl('Miscellaneous','e') ?></span>
1101 <ul>
1102 <?php genTreeLink('RBot','aun',xl('Authorizations')); ?>
1103 <?php genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1104 <?php genTreeLink('RTop','adb',xl('Addr Book')); ?>
1105 <?php genTreeLink('RTop','ort',xl('Order Catalog')); ?>
1106 <?php if (!$GLOBALS['disable_chart_tracker']) genTreeLink('RTop','cht',xl('Chart Tracker')); ?>
1107 <?php genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1108 <?php genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1109 <?php genTreeLink('RTop','pwd',xl('Password')); ?>
1110 </ul>
1111 </li>
1112 </ul>
1114 <?php } // end not athletic team ?>
1116 <?php } else { // end ($GLOBALS['concurrent_layout'] == 2) ?>
1118 <table cellpadding='0' cellspacing='0' border='0'>
1119 <tr>
1120 <td colspan='3'>
1121 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1122 <tr>
1123 <td class='smalltext' nowrap>
1124 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' checked /><b><?php xl('Top','e') ?></b>
1125 </td>
1126 <td class='smalltext' align='right' nowrap>
1127 <b><?php xl('Bot','e') ?></b><input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' checked />
1128 </td>
1129 </tr>
1130 </table>
1131 </td>
1132 </tr>
1133 <?php
1134 // Builds the table of radio buttons and their labels. Radio button values
1135 // are comprised of the 3-character document id and the 1-digit usage type,
1136 // so that JavaScript can easily access this information.
1137 $default_top_rbid = $GLOBALS['athletic_team'] ? 'ros' : 'cal';
1138 foreach ($primary_docs as $key => $varr) {
1139 if (!empty($disallowed[$key])) continue;
1140 $label = $varr[0];
1141 $usage = $varr[1];
1142 $url = $varr[2];
1143 echo " <tr>\n";
1144 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
1145 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
1146 if ($key == $default_top_rbid) echo " checked";
1147 echo " /></td>\n";
1148 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
1149 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
1150 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
1151 if ($key == 'msg') echo " checked";
1152 echo " /></td>\n";
1153 echo " </tr>\n";
1156 </table>
1158 <?php } ?>
1160 <br /><hr />
1162 <?php
1163 // To use RelayHealth, see comments and parameters in includes/config.php.
1164 if (!empty($GLOBALS['ssi']['rh'])) {
1165 include_once("../../library/ssi.inc");
1166 echo getRelayHealthLink() ."<br /><hr />\n";
1170 <div id='current_patient' style = 'display:none'>
1171 <b><?php xl('None','e'); ?></b>
1172 </div>
1174 <div id='current_encounter' style = 'display:none'>
1175 <b><?php xl('None','e'); ?></b>
1176 </div>
1178 <?php if (!$GLOBALS['athletic_team']) genPopupsList(); ?>
1180 <hr />
1182 <table cellpadding='0' cellspacing='0' border='0'>
1183 <tr>
1184 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
1185 <td class='smalltext' colspan='2'>
1186 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
1187 </td>
1188 </tr>
1189 <tr>
1190 <td class='smalltext'><?php xl('by','e') ?>:</td>
1191 <td class='smalltext'>
1192 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name','e'); ?></a>
1193 </td>
1194 <td class='smalltext' align='right'>
1195 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID','e'); ?></a>
1196 </td>
1197 </tr>
1198 <tr>
1199 <td class='smalltext'>&nbsp;</td>
1200 <td class='smalltext'>
1201 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN','e'); ?></a>
1202 </td>
1203 <td class='smalltext' align='right'>
1204 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB','e'); ?></a>
1205 </td>
1206 </tr>
1208 <tr>
1209 <td class='smalltext'>&nbsp;</td>
1210 <td class='smalltext'>
1211 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
1212 </td>
1213 <td class='smalltext' align='right'>
1214 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
1215 </td>
1216 </tr>
1218 </table>
1220 <hr />
1221 <?php if (!empty($GLOBALS['online_support_link'])) { ?>
1222 <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>
1223 <?php } ?>
1225 <input type='hidden' name='findBy' value='Last' />
1226 <input type="hidden" name="searchFields" id="searchFields"/>
1228 </form>
1230 <script language='JavaScript'>
1231 syncRadios();
1232 </script>
1234 </body>
1235 </html>