2 // Copyright (C) 2006, 2008 Rod Roark <rod@sunsetsystems.com>
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
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
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
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
58 // * interface/patient_file/encounter/superbill_custom_full.php: target and
60 // * interface/patient_file/encounter/diagnosis.php: target changes.
61 // * interface/patient_file/encounter/diagnosis_full.php: target and link
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("../../library/acl.inc");
89 include_once("../../custom/code_types.inc.php");
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
98 $primary_docs = array(
99 'ros' => array('Roster' , 0, 'reports/players_report.php?embed=1'),
100 'cal' => array('Calendar' , 0, 'main/main_info.php'),
101 'pwd' => array('Password' , 0, 'usergroup/user_info.php'),
102 'adm' => array('Admin' , 0, 'usergroup/admin_frameset.php'),
103 'rep' => array('Reports' , 0, 'reports/index.php'),
104 'ono' => array('Ofc Notes' , 0, 'main/onotes/office_comments.php'),
105 'fax' => array('Fax/Scan' , 0, 'fax/faxq.php'),
106 'adb' => array('Addr Bk' , 0, 'usergroup/addrbook_list.php'),
107 'imp' => array('Import' , 0, '../custom/import.php'),
108 'bil' => array('Billing' , 0, 'billing/billing_report.php'),
109 'sup' => array('Superbill' , 0, 'patient_file/encounter/superbill_custom_full.php'),
110 'aun' => array('Auth/notes', 0, 'main/authorizations/authorizations.php'),
111 'new' => array('New Pt' , 0, 'new/new.php'),
112 'dem' => array('Patient' , 1, 'patient_file/summary/demographics.php'),
113 'his' => array('History' , 1, 'patient_file/history/history.php'),
114 'ens' => array('Encounters', 1, 'patient_file/history/encounters.php'),
115 'nen' => array('New Enctr' , 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
116 'pre' => array('Rx' , 1, 'patient_file/summary/rx_frameset.php'),
117 'iss' => array('Issues' , 1, 'patient_file/summary/stats_full.php?active=all'),
118 'imm' => array('Immunize' , 1, 'patient_file/summary/immunizations.php'),
119 'doc' => array('Documents' , 1, '../controller.php?document&list&patient_id={PID}'),
120 'prp' => array('Pt Report' , 1, 'patient_file/report/patient_report.php'),
121 'pno' => array('Pt Notes' , 1, 'patient_file/summary/pnotes.php'),
122 'tra' => array('Transact' , 1, 'patient_file/transaction/transactions.php'),
123 'sum' => array('Summary' , 1, 'patient_file/summary/summary_bottom.php'),
124 'enc' => array('Encounter' , 2, 'patient_file/encounter/encounter_top.php'),
125 'cod' => array('Charges' , 2, 'patient_file/encounter/encounter_bottom.php'),
128 // This section decides which navigation items will not appear.
130 $disallowed = array();
132 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
133 acl_check('admin', 'database') ||
acl_check('admin', 'forms') ||
134 acl_check('admin', 'practice') ||
acl_check('admin', 'users'));
136 $disallowed['bil'] = !(acl_check('acct', 'rep') ||
acl_check('acct', 'eob') ||
137 acl_check('acct', 'bill'));
139 $tmp = acl_check('patients', 'demo');
140 $disallowed['new'] = !($tmp == 'write' ||
$tmp == 'addonly');
142 if ( isset ($GLOBALS['hylafax_server']) && isset ($GLOBALS['scanner_output_directory']) ) {
143 $disallowed['fax'] = !($GLOBALS['hylafax_server'] ||
$GLOBALS['scanner_output_directory']);
146 $disallowed['ros'] = !$GLOBALS['athletic_team'];
148 $disallowed['iss'] = !((acl_check('encounters', 'notes') == 'write' ||
149 acl_check('encounters', 'notes_a') == 'write') &&
150 acl_check('patients', 'med') == 'write');
152 $disallowed['imp'] = $disallowed['new'] ||
153 !is_readable("$webserver_root/custom/import.php");
155 // Helper functions for treeview generation.
156 function genTreeLink($frame, $name, $title) {
157 global $primary_docs, $disallowed;
158 if (empty($disallowed[$name])) {
159 $id = $name . $primary_docs[$name][1];
160 echo "<li><a href='' id='$id' " .
161 "onclick=\"return loadFrame2('$id','$frame','" .
162 $primary_docs[$name][2] . "')\">" . xl($title) . "</a></li>";
165 function genMiscLink($frame, $name, $level, $title, $url) {
166 global $primary_docs, $disallowed;
167 if (empty($disallowed[$name])) {
168 $id = $name . $level;
169 echo "<li><a href='' id='$id' " .
170 "onclick=\"return loadFrame2('$id','$frame','" .
171 $url . "')\">" . xl($title) . "</a></li>";
174 function genPopLink($title, $url) {
175 echo "<li><a href='' " .
176 "onclick=\"return repPopup('$url')\"" .
177 ">" . xl($title) . "</a></li>";
182 <title
>Navigation
</title
>
183 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
185 <style type
="text/css">
189 padding
: 5px
3px
5px
3px
;
192 font
-family
:sans
-serif
;
196 a
.navitem
, a
.navitem
:visited
{
198 font
-family
:sans
-serif
;
209 border
-color
: #000000;
210 background
-color
:transparent
;
214 background
-color
:transparent
;
218 <link rel
="stylesheet" href
="../../library/js/jquery.treeview-1.3/jquery.treeview.css" />
219 <script src
="../../library/js/jquery-1.2.2.min.js" type
="text/javascript"></script
>
220 <script src
="../../library/js/jquery.treeview-1.3/jquery.treeview.min.js" type
="text/javascript"></script
>
222 <script type
="text/javascript" src
="../../library/dialog.js"></script
>
224 <script language
='JavaScript'>
226 // Master values for current pid and encounter.
228 var active_encounter
= 0;
230 // Current selections in the top and bottom frames.
234 // Expand and/or collapse frames in response to checkbox clicks.
235 // fnum indicates which checkbox was clicked (1=left, 2=right).
236 function toggleFrame(fnum
) {
237 var f
= document
.forms
[0];
238 var fset
= top
.document
.getElementById('fsright');
239 if (!f
.cb_top
.checked
&& !f
.cb_bot
.checked
) {
240 if (fnum
== 1) f
.cb_bot
.checked
= true;
241 else f
.cb_top
.checked
= true;
243 var rows
= f
.cb_top
.checked ?
'*' : '0';
244 rows +
= f
.cb_bot
.checked ?
',*' : ',0';
249 // Load the specified url into the specified frame (RTop or RBot).
250 // The URL provided must be relative to interface.
251 function loadFrame(fname
, frame
, url
) {
252 top
.restoreSession();
253 var i
= url
.indexOf('{PID}');
254 if (i
>= 0) url
= url
.substring(0,i
) + active_pid + url
.substring(i+
5);
255 top
.frames
[frame
].location
= '<?php echo "$web_root/interface/" ?>' + url
;
256 if (frame
== 'RTop') topName
= fname
; else botName
= fname
;
259 // Load the specified url into a frame to be determined, with the specified
260 // frame as the default; the url must be relative to interface.
261 function loadFrame2(fname
, frame
, url
) {
262 var usage
= fname
.substring(3);
263 if (active_pid
== 0 && usage
> '0') {
264 alert('<?php xl('You must first select
or add a patient
.','e
') ?>');
267 if (active_encounter
== 0 && usage
> '1') {
268 alert('<?php xl('You must first select
or create an encounter
.','e
') ?>');
271 var f
= document
.forms
[0];
272 top
.restoreSession();
273 var i
= url
.indexOf('{PID}');
274 if (i
>= 0) url
= url
.substring(0,i
) + active_pid + url
.substring(i+
5);
275 var fi
= f
.sel_frame
.selectedIndex
;
276 if (fi
== 1) frame
= 'RTop'; else if (fi
== 2) frame
= 'RBot';
277 if (!f
.cb_bot
.checked
) frame
= 'RTop'; else if (!f
.cb_top
.checked
) frame
= 'RBot';
278 top
.frames
[frame
].location
= '<?php echo "$web_root/interface/" ?>' + url
;
279 if (frame
== 'RTop') topName
= fname
; else botName
= fname
;
283 // Select a designated radio button. raname may be either the radio button
284 // array name (rb_top or rb_bot), or the frame name (RTop or RBot).
285 // You should call this if you directly load a document that does not
286 // correspond to the current radio button setting.
287 function setRadio(raname
, rbid
) {
288 <?php
if ($GLOBALS['concurrent_layout'] != 2) { ?
>
289 var f
= document
.forms
[0];
290 if (raname
== 'RTop') raname
= 'rb_top';
291 if (raname
== 'RBot') raname
= 'rb_bot';
292 for (var i
= 0; i
< f
[raname
].length
; ++i
) {
293 if (f
[raname
][i
].value
.substring(0,3) == rbid
) {
294 f
[raname
][i
].checked
= true;
302 // Set disabled/enabled state of radio buttons and associated labels
303 // depending on whether there is an active patient or encounter.
304 function syncRadios() {
305 var f
= document
.forms
[0];
306 <?php
if ($GLOBALS['concurrent_layout'] == 2) { ?
>
307 var nlinks
= document
.links
.length
;
308 for (var i
= 0; i
< nlinks
; ++i
) {
309 var lnk
= document
.links
[i
];
310 if (lnk
.id
.length
!= 4) continue;
311 var usage
= lnk
.id
.substring(3);
312 if (usage
== '1' || usage
== '2') {
314 if (active_pid
== 0) da
= true;
315 if (active_encounter
== 0 && usage
> '1') da
= true;
316 lnk
.style
.color
= da ?
'#888888' : '#0000ff';
320 for (var i
= 0; i
< f
.rb_top
.length
; ++i
) {
322 var rb1
= f
.rb_top
[i
];
323 var rb2
= f
.rb_bot
[i
];
324 var rbid
= rb1
.value
.substring(0,3);
325 var usage
= rb1
.value
.substring(3);
326 if (active_pid
== 0 && usage
> '0') da
= true;
327 if (active_encounter
== 0 && usage
> '1') da
= true;
328 // daemon_frame can also set special label colors, so don't mess with
329 // them unless we have to.
330 if (rb1
.disabled
!= da
) {
333 document
.getElementById('lbl_' + rbid
).style
.color
= da ?
'#888888' : '#000000';
337 f
.popups
.disabled
= (active_pid
== 0);
340 // Process the click to find a patient by name, id, ssn or dob.
341 function findPatient(findby
) {
342 var f
= document
.forms
[0];
343 if (! f
.cb_top
.checked
) {
344 f
.cb_top
.checked
= true;
347 f
.findBy
.value
= findby
;
348 setRadio('rb_top', 'dem');
349 top
.restoreSession();
350 document
.find_patient
.submit();
353 // Helper function to set the contents of a div.
354 function setDivContent(id
, content
) {
355 if (document
.getElementById
) {
356 var x
= document
.getElementById(id
);
358 x
.innerHTML
= content
;
360 else if (document
.all
) {
361 var x
= document
.all
[id
];
362 x
.innerHTML
= content
;
366 // This is called automatically when a new patient is set, to make sure
367 // there are no patient-specific documents showing stale data. If a frame
368 // was just loaded with data for the correct patient, its name is passed so
369 // that it will not be zapped. At this point the new server-side pid is not
370 // assumed to be set, so this function will only load global data.
371 function reloadPatient(frname
) {
372 var f
= document
.forms
[0];
373 if (topName
.length
> 3 && topName
.substring(3) > '0' && frname
!= 'RTop') {
374 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal
'][2]; ?>');
375 setRadio('rb_top', 'cal');
377 if (botName
.length
> 3 && botName
.substring(3) > '0' && frname
!= 'RBot') {
378 loadFrame('aun0','RBot', '<?php echo $primary_docs['aun
'][2]; ?>');
379 setRadio('rb_bot', 'aun');
383 // Reload encounter-specific frames, excluding a specified frame. At this
384 // point the new server-side encounter ID may not be set and loading the same
385 // document for the new encounter will not work, so load patient info instead.
386 function reloadEncounter(frname
) {
387 var f
= document
.forms
[0];
388 if (topName
.length
> 3 && topName
.substring(3) > '1' && frname
!= 'RTop') {
389 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem
'][2]; ?>');
390 setRadio('rb_top', 'dem');
392 if (botName
.length
> 3 && botName
.substring(3) > '1' && frname
!= 'RBot') {
393 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens
'][2]; ?>');
394 setRadio('rb_bot', 'ens');
398 // Call this to announce that the patient has changed. You must call this
399 // if you change the session PID, so that the navigation frame will show the
400 // correct patient and so that the other frame will be reloaded if it contains
401 // patient-specific information from the previous patient. frname is the name
402 // of the frame that the call came from, so we know to only reload content
403 // from the *other* frame if it is patient-specific.
404 function setPatient(pname
, pid
, frname
) {
405 if (pid
== active_pid
) return;
406 var str
= '<b>' + pname +
' (' + pid +
')</b>';
407 setDivContent('current_patient', str
);
408 setDivContent('current_encounter', '<b>None</b>');
410 active_encounter
= 0;
411 if (frname
) reloadPatient(frname
);
415 // Call this to announce that the encounter has changed. You must call this
416 // if you change the session encounter, so that the navigation frame will
417 // show the correct encounter and so that the other frame will be reloaded if
418 // it contains encounter-specific information from the previous encounter.
419 // frname is the name of the frame that the call came from, so we know to only
420 // reload encounter-specific content from the *other* frame.
421 function setEncounter(edate
, eid
, frname
) {
422 if (eid
== active_encounter
) return;
423 if (!eid
) edate
= 'None';
424 var str
= '<b>' + edate +
'</b>';
425 setDivContent('current_encounter', str
);
426 active_encounter
= eid
;
427 reloadEncounter(frname
);
431 // You must call this if you delete the active patient (or if for any other
432 // reason you "close" the active patient without opening a new one), so that
433 // the appearance of the navigation frame will be correct and so that any
434 // stale content will be reloaded.
435 function clearPatient() {
436 if (active_pid
== 0) return;
437 var f
= document
.forms
[0];
439 active_encounter
= 0;
440 setDivContent('current_encounter', '<b>None</b>');
441 setDivContent('current_patient', '<b>None</b>');
446 // You must call this if you delete the active encounter (or if for any other
447 // reason you "close" the active encounter without opening a new one), so that
448 // the appearance of the navigation frame will be correct and so that any
449 // stale content will be reloaded.
450 function clearEncounter() {
451 if (active_encounter
== 0) return;
452 setDivContent('current_encounter', '<b>None</b>');
453 active_encounter
= 0;
458 // You can call this to make sure the session pid is what we expect.
459 function pidSanityCheck(pid
) {
460 if (pid
!= active_pid
) {
461 alert('Session patient ID is ' + pid +
', expecting ' + active_pid +
462 '. This session is unstable and should be abandoned. Do not use ' +
463 'OpenEMR in multiple browser windows!');
469 // You can call this to make sure the session encounter is what we expect.
470 function encounterSanityCheck(eid
) {
471 if (eid
!= active_encounter
) {
472 alert('Session encounter ID is ' + eid +
', expecting ' + active_encounter +
473 '. This session is unstable and should be abandoned. Do not use ' +
474 'OpenEMR in multiple browser windows!');
481 function repPopup(aurl
) {
482 top
.restoreSession();
483 window
.open('<?php echo "$web_root/interface/reports/" ?>' + aurl
, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
487 // This is invoked to pop up some window when a popup item is selected.
488 function selpopup(selobj
) {
489 var i
= selobj
.selectedIndex
;
490 var opt
= selobj
.options
[i
];
494 if (opt
.text
== 'Export' || opt
.text
== 'Import') {
498 else if (opt
.text
== 'Refer') {
502 dlgopen(opt
.value
, '_blank', width
, height
);
504 selobj
.selectedIndex
= 0;
507 // Treeview activation stuff:
508 $
(document
).ready(function(){
509 $
("#navigation").treeview({
514 window
.console
&& console
.log("%o was toggled", this
);
523 <body
class="body_nav">
525 <form method
='post' name
='find_patient' target
='RTop'
526 action
='<?php echo $rootdir ?>/main/finder/patient_select.php'>
528 <?php
if ($GLOBALS['concurrent_layout'] == 2) { ?
>
530 <select name
='sel_frame' style
='background-color:transparent;font-size:9pt;width:100%;'>
531 <option value
='0'><?php
xl('Default','e'); ?
></option
>
532 <option value
='1'><?php
xl('Top','e'); ?
></option
>
533 <option value
='2'><?php
xl('Bottom','e'); ?
></option
>
536 <table cellpadding
='0' cellspacing
='0' border
='0' width
='100%'>
538 <td
class='smalltext' nowrap
>
539 <input type
='checkbox' name
='cb_top' onclick
='toggleFrame(1)' checked
/><b
><?php
xl('Top','e') ?
></b
>
541 <td
class='smalltext' align
='right' nowrap
>
542 <b
><?php
xl('Bot','e') ?
></b
><input type
='checkbox' name
='cb_bot' onclick
='toggleFrame(2)' checked
/>
548 <li
class="open"><span
><?php
xl('Patient/Client','e') ?
></span
>
550 <li
><span
><?php
xl('Management','e') ?
></span
>
552 <?php
genTreeLink('RTop','new','New'); ?
>
553 <?php
genTreeLink('RTop','dem','Current'); ?
>
554 <?php
genTreeLink('RBot','sum','Summary'); ?
>
557 <li
class="open"><span
><?php
xl('Visits','e') ?
></span
>
559 <?php
genTreeLink('RTop','cal','Calendar'); ?
>
560 <?php
genTreeLink('RBot','nen','New'); ?
>
561 <?php
genTreeLink('RBot','enc','Current'); ?
>
562 <?php
genTreeLink('RBot','ens','List'); ?
>
563 <?php
genTreeLink('RBot','tra','Transact'); ?
>
566 <li
><span
><?php
xl('Medical Record','e') ?
></span
>
568 <?php
genTreeLink('RBot','pre','Rx'); ?
>
569 <?php
genTreeLink('RTop','his','History'); ?
>
570 <?php
genTreeLink('RTop','iss','Issues'); ?
>
571 <?php
genTreeLink('RBot','imm','Immunize'); ?
>
572 <?php
genTreeLink('RTop','doc','Documents'); ?
>
573 <?php
genTreeLink('RBot','pno','Notes'); ?
>
574 <?php
genTreeLink('RTop','prp','Report'); ?
>
579 <li
><span
><?php
xl('Fees','e') ?
></span
>
581 <?php
genMiscLink('RBot','cod','2','Fee Sheet','patient_file/encounter/load_form.php?formname=fee_sheet'); ?
>
582 <?php
if (false) genTreeLink('RBot','cod','Charges'); ?
>
583 <?php
genMiscLink('RBot','bil','1','Checkout','patient_file/pos_checkout.php?framed=1'); ?
>
584 <?php
genTreeLink('RTop','bil','Billing'); ?
>
587 <?php
if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) genMiscLink('RTop','adm','0','Inventory','drugs/drug_inventory.php'); ?
>
588 <li
><span
><?php
xl('Administration','e') ?
></span
>
590 <?php
if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0','Users','usergroup/usergroup_admin.php'); ?
>
591 <?php
if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0','Practice','../controller.php?practice_settings'); ?
>
592 <?php
if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup','Services'); ?
>
593 <?php
if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0','Layouts','super/edit_layout.php'); ?
>
594 <?php
if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0','Lists','super/edit_list.php'); ?
>
595 <?php
if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0','ACL','usergroup/adminacl.php'); ?
>
596 <li
><span
><?php
xl('Other','e') ?
></span
>
598 <?php
if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0','Language','language/language.php'); ?
>
599 <?php
if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0','Forms','forms_admin/forms_admin.php'); ?
>
600 <?php
if (acl_check('admin', 'calendar')) genMiscLink('RTop','adm','0','Calendar','main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig'); ?
>
601 <?php
if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0','Logs','logview/logview.php'); ?
>
602 <?php
if (acl_check('admin', 'database')) genMiscLink('RTop','adm','0','Database','main/myadmin/index.php'); ?
>
607 <li
><span
><?php
xl('Reports','e') ?
></span
>
609 <li
><span
><?php
xl('Clients','e') ?
></span
>
611 <?php
genPopLink('List','patient_list.php'); ?
>
612 <?php
genPopLink('Rx','prescriptions_report.php'); ?
>
613 <?php
genPopLink('Referrals','referrals_report.php'); ?
>
614 <?php
if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink('IPPF Stats','ippf_statistics.php?t=i'); ?
>
615 <?php
if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink('MA Stats','ippf_statistics.php?t=m'); ?
>
618 <li
class="open"><span
><?php
xl('Visits','e') ?
></span
>
620 <?php
genPopLink('Appointments','appointments_report.php'); ?
>
621 <?php
genPopLink('Encounters','encounters_report.php'); ?
>
622 <?php
genPopLink('Appt-Enc','appt_encounter_report.php'); ?
>
625 <?php
if (acl_check('acct', 'rep_a')) { ?
>
626 <li
><span
><?php
xl('Financial','e') ?
></span
>
628 <?php
genPopLink('Sales','sales_by_item.php'); ?
>
629 <?php
genPopLink('Cash Rec','../billing/sl_receipts_report.php'); ?
>
630 <?php
genPopLink('Front Rec','front_receipts_report.php'); ?
>
631 <?php
genPopLink('Pmt Method','receipts_by_method_report.php'); ?
>
632 <?php
genPopLink('Collections','collections_report.php'); ?
>
636 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
637 <li
><span
><?php
xl('Inventory','e') ?
></span
>
639 <?php
genPopLink('Destroyed','destroyed_drugs_report.php'); ?
>
643 <?php
if (! $GLOBALS['simplified_demographics']) { ?
>
644 <li
><span
><?php
xl('Insurance','e') ?
></span
>
646 <?php
genPopLink('Distribution','insurance_allocation_report.php'); ?
>
647 <?php
genPopLink('Indigents','../billing/indigent_patients_report.php'); ?
>
648 <?php
genPopLink('Unique SP','unique_seen_patients_report.php'); ?
>
652 <?php
if ($GLOBALS['athletic_team']) { ?
>
653 <li
><span
><?php
xl('Athletic','e') ?
></span
>
655 <?php
genPopLink('Roster','players_report.php'); ?
>
656 <?php
genPopLink('Missed','absences_report.php'); ?
>
657 <?php
genPopLink('Injuries','football_injury_report.php'); ?
>
658 <?php
genPopLink('Inj Ov','injury_overview_report.php'); ?
>
662 <?php
// genTreeLink('RTop','rep','Other'); ?>
665 <li
><span
><?php
xl('Miscellaneous','e') ?
></span
>
667 <?php
genTreeLink('RBot','aun','Pt Notes/Auth'); ?
>
668 <?php
genTreeLink('RTop','fax','Fax/Scan'); ?
>
669 <?php
genTreeLink('RTop','adb','Addr Book'); ?
>
670 <?php
genTreeLink('RTop','ono','Ofc Notes'); ?
>
671 <?php
genMiscLink('RTop','adm','0','BatchCom','batchcom/batchcom.php'); ?
>
672 <?php
genTreeLink('RTop','pwd','Password'); ?
>
679 <table cellpadding
='0' cellspacing
='0' border
='0'>
682 <table cellpadding
='0' cellspacing
='0' border
='0' width
='100%'>
684 <td
class='smalltext' nowrap
>
685 <input type
='checkbox' name
='cb_top' onclick
='toggleFrame(1)' checked
/><b
><?php
xl('Top','e') ?
></b
>
687 <td
class='smalltext' align
='right' nowrap
>
688 <b
><?php
xl('Bot','e') ?
></b
><input type
='checkbox' name
='cb_bot' onclick
='toggleFrame(2)' checked
/>
695 // Builds the table of radio buttons and their labels. Radio button values
696 // are comprised of the 3-character document id and the 1-digit usage type,
697 // so that JavaScript can easily access this information.
698 $default_top_rbid = $GLOBALS['athletic_team'] ?
'ros' : 'cal';
699 foreach ($primary_docs as $key => $varr) {
700 if (!empty($disallowed[$key])) continue;
705 echo " <td class='smalltext'><input type='radio' name='rb_top' value='$key$usage' " .
706 "onclick=\"loadFrame('$key$usage','RTop','$url')\"";
707 if ($key == $default_top_rbid) echo " checked";
709 echo " <td class='smalltext' id='lbl_$key'>$label</td>\n";
710 echo " <td class='smalltext'><input type='radio' name='rb_bot' value='$key$usage' " .
711 "onclick=\"loadFrame('$key$usage','RBot','$url')\"";
712 if ($key == 'aun') echo " checked";
723 <?php
xl('Active Patient','e') ?
>:<br
/>
724 <div id
='current_patient'>
728 <?php
xl('Active Encounter','e') ?
>:<br
/>
729 <div id
='current_encounter'>
733 <select name
='popups' onchange
='selpopup(this)' style
='background-color:transparent;font-size:9pt;'>
734 <option value
=''><?php
xl('Popups','e'); ?
></option
>
735 <?php
if (!$disallowed['iss']) { ?
>
736 <option value
='../patient_file/problem_encounter.php'><?php
xl('Issues','e'); ?
></option
>
738 <option value
='../../custom/export_xml.php'><?php
xl('Export','e'); ?
></option
>
739 <option value
='../../custom/import_xml.php'><?php
xl('Import','e'); ?
></option
>
740 <?php
if ($GLOBALS['athletic_team']) { ?
>
741 <option value
='../reports/players_report.php'><?php
xl('Roster','e'); ?
></option
>
743 <option value
='../reports/appointments_report.php?patient=<?php echo $pid ?>'><?php
xl('Appts','e'); ?
></option
>
744 <?php
if (file_exists("$webserver_root/custom/refer.php")) { ?
>
745 <option value
='../../custom/refer.php'><?php
xl('Refer','e'); ?
></option
>
747 <?php
if (file_exists("$webserver_root/custom/fee_sheet_codes.php")) { ?
>
748 <option value
='../patient_file/printed_fee_sheet.php'><?php
xl('Superbill','e'); ?
></option
>
750 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
751 <option value
='../patient_file/front_payment.php'><?php
xl('Prepay','e'); ?
></option
>
752 <option value
='../patient_file/pos_checkout.php'><?php
xl('Checkout','e'); ?
></option
>
754 <option value
='../patient_file/front_payment.php'><?php
xl('Payment','e'); ?
></option
>
760 <table cellpadding
='0' cellspacing
='0' border
='0'>
762 <td
class='smalltext'><?php
xl('Find','e') ?
>: 
;</td
>
763 <td
class='smalltext' colspan
='2'>
764 <input type
="entry" size
="7" name
="patient" class='inputtext' style
='width:65px;' />
768 <td
class='smalltext'><?php
xl('by','e') ?
>:</td
>
769 <td
class='smalltext'>
770 <a href
="javascript:findPatient('Last');" class="navitem">Name
</a
>
772 <td
class='smalltext' align
='right'>
773 <a href
="javascript:findPatient('ID');" class="navitem">ID
</a
>
777 <td
class='smalltext'> 
;</td
>
778 <td
class='smalltext'>
779 <a href
="javascript:findPatient('SSN');" class="navitem">SSN
</a
>
781 <td
class='smalltext' align
='right'>
782 <a href
="javascript:findPatient('DOB');" class="navitem">DOB
</a
>
788 <a href
="../logout.php?auth=logout" target
="_top" class="navitem" id
="logout_link"
789 onclick
="top.restoreSession()">
790 <?php
xl('Logout','e'); ?
></a
>
792 <input type
='hidden' name
='findBy' value
='Last' />
796 <script language
='JavaScript'>