Support for Active Directory (#463)
[openemr.git] / interface / main / left_nav.php
blob10c6a0ca9d4becf04d10653a11a86e18895e8b87
1 <?php
2 use ESign\Api;
3 /* Copyright (C) 2006-2012 Rod Roark <rod@sunsetsystems.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 */
11 // This provides the left navigation frame.
12 // Following are notes as to what else was changed for this feature:
14 // * interface/main/main_screen.php: the top-level frameset.
15 // * interface/main/finder/patient_select.php: loads stuff when a new patient
16 // is selected.
17 // * interface/patient_file/summary/demographics.php: this is the first frame
18 // loaded when a new patient is chosen, and in turn sets the current pid and
19 // then loads the initial bottom frame.
20 // * interface/patient_file/summary/demographics_full.php: added support for
21 // setting a new pid, needed for going to demographics from billing.
22 // * interface/patient_file/summary/demographics_save.php: redisplay
23 // demographics.php and not the frameset.
24 // * interface/patient_file/summary/summary_bottom.php: new frameset for the
25 // summary, prescriptions and notes for a selected patient, cloned from
26 // patient_summary.php.
27 // * interface/patient_file/encounter/encounter_bottom.php: new frameset for
28 // the selected encounter, mosting coding/billing stuff, cloned from
29 // patient_encounter.php. This will also self-load the superbill pages
30 // as requested.
31 // * interface/usergroup/user_info.php: removed Back link.
32 // * interface/usergroup/admin_frameset.php: new frameset for Admin pages,
33 // cloned from usergroup.php.
34 // * interface/main/onotes/office_comments.php: removed Back link target.
35 // * interface/main/onotes/office_comments_full.php: changed Back link.
36 // * interface/billing/billing_report.php: removed Back link; added logic
37 // to properly go to demographics or to an encounter when requested.
38 // * interface/new/new.php: removed Back link and revised form target.
39 // * interface/new/new_patient_save.php: modified to load the demographics
40 // page to the current frame instead of loading a new frameset.
41 // * interface/patient_file/history/history.php: target change.
42 // * interface/patient_file/history/history_full.php: target changes.
43 // * interface/patient_file/history/history_save.php: target change.
44 // * interface/patient_file/history/encounters.php: link/target changes.
45 // * interface/patient_file/encounter/encounter_top.php: another new frameset
46 // cloned from patient_encounter.php.
47 // * interface/patient_file/encounter/forms.php: link target removal.
48 // * interface/patient_file/encounter/new_form.php: target change.
49 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
50 // changes.
51 // * interface/patient_file/summary/immunizations.php: removed back link.
52 // * interface/patient_file/summary/pnotes.php: changed link targets.
53 // * interface/patient_file/summary/pnotes_full.php: changed back link and
54 // added set_pid logic.
55 // * interface/patient_file/transaction/transactions.php: various changes.
56 // * interface/patient_file/transaction/add_transaction.php: new return js.
57 // * interface/patient_file/encounter/superbill_codes.php: target and link
58 // changes.
59 // * interface/patient_file/encounter/superbill_custom_full.php: target and
60 // link changes.
61 // * interface/patient_file/encounter/diagnosis.php: target changes.
62 // * interface/patient_file/encounter/diagnosis_full.php: target and link
63 // changes.
64 // * interface/main/authorizations/authorizations.php: link and target changes.
65 // * library/api.inc: url change.
66 // * interface/patient_file/summary/rx_frameset.php: new frameset.
67 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
68 // * all encounter forms: remove all instances of "target=Main" and change
69 // all instances of "patient_encounter.php" to "encounter_top.php".
71 // Our find_patient form, when submitted, invokes patient_select.php in the
72 // upper frame. When the patient is selected, demographics.php is invoked
73 // with the set_pid parameter, which establishes the new session pid and also
74 // calls the setPatient() function (below). In this case demographics.php
75 // will also load the summary frameset into the bottom frame, invoking our
76 // loadFrame() function.
78 // Similarly, we have the concept of selecting an encounter from the
79 // Encounters list, and then having that "stick" until some other encounter
80 // or a new encounter is chosen. We also have a navigation item for creating
81 // a new encounter. interface/patient_file/encounter/encounter_top.php
82 // supports set_encounter to establish an encounter.
84 // TBD: Include active_pid and/or active_encounter in relevant submitted
85 // form data, and add logic to the save routines to make sure they match
86 // the corresponding session values.
88 require_once("../globals.php");
89 require_once($GLOBALS['fileroot']."/library/acl.inc");
90 require_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
91 require_once($GLOBALS['fileroot']."/library/patient.inc");
92 require_once($GLOBALS['fileroot']."/library/lists.inc");
93 require_once $GLOBALS['srcdir'].'/ESign/Api.php';
94 require_once $GLOBALS['srcdir'].'/user.inc';
96 // Fetch user preferences saved from prior session
97 $uspfx = substr(__FILE__, strlen($GLOBALS['fileroot']."/")) . '.';
98 $cb_top_chk = prevSetting($uspfx, 'cb_top', 'frame0_chk', 'checked');
99 $cb_bot_chk = prevSetting($uspfx, 'cb_bot', 'frame1_chk', 'checked');
100 $usrval = json_encode( array ( $cb_top_chk, $cb_bot_chk ) );
102 // This array defines the list of primary documents that may be
103 // chosen. Each element value is an array of 3 values:
105 // * Name to appear in the navigation table
106 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific, 3 = therapy group-specific, 4 = therapy group encounter - specific
107 // * The URL relative to the interface directory
110 $primary_docs = array(
111 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
112 'pfb' => array(xl('Patient Flow Board') , 0, '../interface/patient_tracker/patient_tracker.php?skip_timeout_reset=1'),
113 'app' => array(xl('Portal Activity') , 0, '../myportal/index.php'),
114 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php?form_active=1'),
115 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
116 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
117 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
118 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
119 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
120 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
121 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
122 'orl' => array(xl('Proc Prov') , 0, 'orders/procedure_provider_list.php'),
123 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
124 'orc' => array(xl('Proc Load') , 0, 'orders/load_compendium.php'),
125 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
126 'ore' => array(xl('E-Reports') , 0, 'orders/list_reports.php'),
127 'ppo' => array(xl('CMS Portal'), 0, 'cmsportal/list_requests.php'),
128 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
129 'imp' => array(xl('Import') , 0, '../custom/import.php'),
130 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
131 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
132 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
133 'new' => array(xl('New Pt') , 0, 'new/new.php'),
134 'ped' => array(xl('Patient Education'), 0, 'reports/patient_edu_web_lookup.php'),
135 'lab' => array(xl('Check Lab Results') , 0, 'orders/lab_exchange.php'),
136 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
137 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
138 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
139 'nen' => array(xl('Create Visit'), 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
140 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
141 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
142 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
143 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
144 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
145 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
146 'lda' => array(xl('Lab overview') , 1, 'patient_file/summary/labdata.php'),
147 'tan' => array(xl('Configure Tracks') , 0, 'forms/track_anything/create.php'),
148 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
149 'prq' => array(xl('Pt Rec Request') , 1, 'patient_file/transaction/record_request.php'),
150 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
151 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
152 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
153 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
154 'erx' => array(xl('e-Rx') , 1, 'eRx.php'),
155 'err' => array(xl('e-Rx Renewal') , 1, 'eRx.php?page=status'),
156 'ere' => array(xl('e-Rx EPCS') , 1, 'eRx.php?page=epcs-admin'),
157 'pay' => array(xl('Payment') , 1, '../patient_file/front_payment.php'),
158 'edi' => array(xl('EDI History') , 0, 'billing/edih_view.php'),
159 'eob' => array(xl('Posting') , 0, 'billing/sl_eob_search.php'),
160 'dld' => array(xl('Display Documents'), 0, 'main/display_documents.php')
162 $primary_docs['npa']=array(xl('Batch Payments') , 0, 'billing/new_payment.php');
163 if ($GLOBALS['use_charges_panel'] || $GLOBALS['menu_styling_vertical'] == 0) {
164 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
167 if($GLOBALS['enable_group_therapy']){
168 $primary_docs['gng'] = array(xl('New') , 0, 'therapy_groups/index.php?method=addGroup');
169 $primary_docs['gdg'] = array(xl('Group Details') , 3, '/therapy_groups/index.php?method=groupDetails&group_id=from_session');
170 $primary_docs['gcv'] = array(xl('Create Visit'), 3, 'forms/newGroupEncounter/new.php?autoloaded=1&calenc=');
171 $primary_docs['gce'] = array(xl('Current') , 4, 'patient_file/encounter/encounter_top.php');
172 $primary_docs['gvh'] = array(xl('Visit History'), 3, 'patient_file/history/encounters.php');
175 $esignApi = new Api();
176 // This section decides which navigation items will not appear.
178 $disallowed = array();
179 $disallowed['edi'] = !($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob'));
180 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
181 acl_check('admin', 'database') || acl_check('admin', 'forms') ||
182 acl_check('admin', 'practice') || acl_check('admin', 'users') ||
183 acl_check('admin', 'acl') || acl_check('admin', 'super') ||
184 acl_check('admin', 'superbill') || acl_check('admin', 'drugs'));
186 $disallowed['bil'] = !(acl_check('acct', 'eob') || acl_check('acct', 'bill'));
188 $disallowed['new'] = !(acl_check('patients','demo','',array('write','addonly') ));
190 $disallowed['fax'] = !(($GLOBALS['enable_hylafax'] || $GLOBALS['enable_scanner']) && acl_check('patients', 'docs'));
192 $disallowed['iss'] = !((acl_check('encounters','notes','','write') ||
193 acl_check('encounters','notes_a','','write') ) &&
194 acl_check('patients','med','','write') );
196 $disallowed['imp'] = $disallowed['new'] || !is_readable("$webserver_root/custom/import.php");
198 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
200 $disallowed['pre'] = !(acl_check('patients', 'med'));
201 $disallowed['eob'] = !(acl_check('acct', 'eob'));
203 // Helper functions for treeview generation.
204 function genTreeLink($frame, $name, $title, $mono=false) {
205 global $primary_docs, $disallowed;
206 if (empty($disallowed[$name])) {
207 $id = $name . $primary_docs[$name][1];
208 echo "<li><a href='' id='$id' onclick=\"";
209 if ($mono) {
210 if ($frame == 'RTop')
211 echo "forceSpec(true,false);";
212 else
213 echo "forceSpec(false,true);";
215 echo "return loadFrame2('$id','$frame','" .
216 $primary_docs[$name][2] . "')\">" . $title . ($name == 'msg' ? ' <span id="reminderCountSpan" class="bold"></span>' : '')."</a></li>";
219 function genMiscLink($frame, $name, $level, $title, $url, $mono=false) {
220 global $disallowed;
221 if (empty($disallowed[$name])) {
222 $id = $name . $level;
223 echo "<li><a href='' id='$id' onclick=\"";
224 if ($mono) {
225 if ($frame == 'RTop')
226 echo "forceSpec(true,false);";
227 else
228 echo "forceSpec(false,true);";
230 echo "return loadFrame2('$id','$frame','" .
231 $url . "')\">" . $title . "</a></li>";
234 function genMiscLink2($frame, $name, $level, $title, $url, $mono=false,$mouseovertext="") {
235 global $disallowed;
236 if (empty($disallowed[$name])) {
238 $id = $name . $level;
239 echo "<li><a href='' id='$id' title='$mouseovertext' onclick=\"";
240 if ($mono) {
241 if ($frame == 'RTop')
242 echo "forceSpec(true,false);";
243 else
244 echo "forceSpec(false,true);";
246 echo "return loadFrame3('$id','$frame','" .
247 $url . "')\">" . $title . "</a></li>";
250 function genPopLink($title, $url, $linkid='') {
251 echo "<li><a href='' ";
252 if ($linkid) echo "id='$linkid' ";
253 echo "onclick=\"return repPopup('$url')\"" .
254 ">" . $title . "</a></li>";
256 function genDualLink($topname, $botname, $title) {
257 global $primary_docs, $disallowed;
258 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
259 $topid = $topname . $primary_docs[$topname][1];
260 $botid = $botname . $primary_docs[$botname][1];
261 echo "<li><a href='' id='$topid' " .
262 "onclick=\"return loadFrameDual('$topid','$botid','" .
263 $primary_docs[$topname][2] . "','" .
264 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
268 function genPopupsList($style='') {
269 global $disallowed, $webserver_root;
271 <select name='popups' onchange='selpopup(this)' style='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
272 <option value=''><?php xl('Popups','e'); ?></option>
273 <?php if (!$disallowed['iss']) { ?>
274 <option value='../patient_file/problem_encounter.php'><?php xl('Issues','e'); ?></option>
275 <?php } ?>
276 <?php if (!$GLOBALS['ippf_specific'] && acl_check('patients', 'demo')) { ?>
277 <option value='../../custom/export_xml.php'><?php xl('Export','e'); ?></option>
278 <?php if (acl_check('patients', 'demo', '', 'write')) { ?>
279 <option value='../../custom/import_xml.php'><?php xl('Import','e'); ?></option>
280 <?php }}
281 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) { ?>
282 <option value='../reports/appointments_report.php?patient=<?php if(isset($pid)) {echo $pid;} ?>'><?php xl('Appts','e'); ?></option>
283 <?php } ?>
284 <?php if (acl_check('patients', 'med')) { ?>
285 <option value='../patient_file/printed_fee_sheet.php?fill=1'><?php xl('Superbill','e'); ?></option>
286 <?php } ?>
287 <?php if (acl_check('acct', 'bill', '', 'write')) { ?>
288 <option value='../patient_file/front_payment.php'><?php xl('Payment','e'); ?></option>
289 <?php } ?>
290 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('acct', 'bill', '', 'write')) { ?>
291 <option value='../patient_file/pos_checkout.php'><?php xl('Checkout','e'); ?></option>
292 <?php } ?>
293 <?php if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates") && acl_check('patients', 'med')) { ?>
294 <option value='../patient_file/letter.php'><?php xl('Letter','e'); ?></option>
295 <?php } ?>
296 <?php if ($GLOBALS['chart_label_type'] != '0' && acl_check('patients', 'demo')) { ?>
297 <option value='../patient_file/label.php'><?php xl('Chart Label','e'); ?></option>
298 <?php } ?>
299 <?php if ($GLOBALS['barcode_label_type'] != '0' && acl_check('patients', 'demo')) { ?>
300 <option value='../patient_file/barcode_label.php'><?php xl('Barcode Label','e'); ?></option>
301 <?php } ?>
302 <?php if ($GLOBALS['addr_label_type'] && acl_check('patients', 'demo')) { ?>
303 <option value='../patient_file/addr_label.php'><?php xl('Address Label','e'); ?></option>
304 <?php } ?>
305 </select>
306 <?php
309 function genFindBlock() {
311 <table cellpadding='0' cellspacing='0' border='0'>
312 <tr>
313 <td class='smalltext'><?php xl('Find','e') ?>:&nbsp;</td>
314 <td class='smalltext' colspan='2'>
315 <input type="entry" size="7" name="patient" class='inputtext' style='width:65px;' />
316 </td>
317 </tr>
318 <tr>
319 <td class='smalltext'><?php xl('by','e') ?>:</td>
320 <td class='smalltext'>
321 <a href="javascript:findPatient('Last');" class="navitem"><?php xl('Name','e'); ?></a>
322 </td>
323 <td class='smalltext' align='right'>
324 <a href="javascript:findPatient('ID');" class="navitem"><?php xl('ID','e'); ?></a>
325 </td>
326 </tr>
327 <tr>
328 <td class='smalltext'>&nbsp;</td>
329 <td class='smalltext'>
330 <a href="javascript:findPatient('SSN');" class="navitem"><?php xl('SSN','e'); ?></a>
331 </td>
332 <td class='smalltext' align='right'>
333 <a href="javascript:findPatient('DOB');" class="navitem"><?php xl('DOB','e'); ?></a>
334 </td>
335 </tr>
336 <tr>
337 <td class='smalltext'>&nbsp;</td>
338 <td class='smalltext'>
339 <a href="javascript:findPatient('Any');" class="navitem"><?php xl('Any', 'e'); ?></a>
340 </td>
341 <td class='smalltext' align='right'>
342 <a href="javascript:initFilter();" class="navitem"><?php xl('Filter', 'e'); ?></a>
343 </td>
344 </tr>
345 </table>
346 <?php
347 } // End function genFindBlock()
350 <html>
351 <head>
352 <title>Navigation</title>
354 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
355 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative'];?>/font-awesome-4-6-3/css/font-awesome.css" type="text/css">
356 <style type="text/css">
357 body {
358 font-size:8pt;
359 font-weight:normal;
360 padding: 5px 3px 5px 3px;
362 .smalltext {
363 font-family:sans-serif;
364 font-size:8pt;
365 font-weight:normal;
367 a.navitem, a.navitem:visited {
368 color:#0000ff;
369 font-family:sans-serif;
370 font-size:8pt;
371 font-weight:bold;
373 .inputtext {
374 font-size:9pt;
375 font-weight:normal;
376 border-style:solid;
377 border-width:1px;
378 padding-left:2px;
379 padding-right:2px;
380 border-color: #000000;
381 background-color:transparent;
384 #navigation ul {
385 background-color:transparent;
387 #navigation-slide ul {
388 background-color:transparent;
390 #navigation-slide a{
391 width: 92%;
393 .nav-menu-img{
394 width:25px;
395 height:25px;
396 border:none;
397 margin-right:5px;
398 vertical-align:middle;
400 </style>
402 <link rel="stylesheet" href="../../library/js/jquery.treeview-1.4.1/jquery.treeview.css" />
403 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-6-4/index.js"></script>
404 <script type="text/javascript" src="../../library/js/jquery.treeview-1.4.1/jquery.treeview.js" ></script>
406 <script type="text/javascript" src="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
408 <script language='JavaScript'>
409 // User settings
410 var usrval = jQuery.parseJSON('<?php echo $usrval ?>');
412 // tajemo work by CB 2012/01/31 12:32:57 PM dated reminders counter
413 function getReminderCount(){
414 top.restoreSession();
415 // Send the skip_timeout_reset parameter to not count this as a manual entry in the
416 // timing out mechanism in OpenEMR.
417 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/dated_reminders_counter.php",
418 { skip_timeout_reset: "1" },
419 function(data) {
420 $("#reminderCountSpan").html(data);
421 // run updater every 60 seconds
422 var repeater = setTimeout("getReminderCount()", 60000);
424 //piggy-back on this repeater to run other background-services
425 //this is a silent task manager that returns no output
426 $.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/execute_background_services.php",
427 { skip_timeout_reset: "1", ajax: "1" });
430 $(document).ready(function (){
431 getReminderCount();//
432 parent.loadedFrameCount += 1;
433 for (var i = 0, len = usrval.length; i < len; i++) {
434 if (usrval[i] != "checked") toggleFrame(i+1);
437 // end of tajemo work dated reminders counter
439 // Master values for current pid and encounter.
440 var active_pid = 0;
441 var active_encounter = 0;
442 var encounter_locked = false;
443 //therapy group id
444 var active_gid = 0;
446 // Current selections in the top and bottom frames.
447 var topName = '';
448 var botName = '';
450 // Expand and/or collapse frames in response to checkbox clicks.
451 // fnum indicates which checkbox was clicked (1=left, 2=right).
452 function toggleFrame(fnum) {
453 var f = document.forms[0];
454 var fset = top.document.getElementById('fsright');
455 if (!f.cb_top.checked && !f.cb_bot.checked) {
456 if (fnum == 1) f.cb_bot.checked = true;
457 else f.cb_top.checked = true;
459 var rows = f.cb_top.checked ? '*' : '0';
460 rows += f.cb_bot.checked ? ',*' : ',0';
461 fset.rows = rows;
462 save_setting ([(f.cb_top.checked ? 'checked' : '&nbsp;'), (f.cb_bot.checked ? 'checked' : '&nbsp;')]);
465 // Load the specified url into the specified frame (RTop or RBot).
466 // The URL provided must be relative to interface.
467 function loadFrame(fname, frame, url) {
468 top.restoreSession();
469 var i = url.indexOf('{PID}');
470 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
471 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
472 if (frame == 'RTop') topName = fname; else botName = fname;
475 // Load the specified url into a frame to be determined, with the specified
476 // frame as the default; the url must be relative to interface.
477 function loadFrame2(fname, frame, url) {
478 var usage = fname.substring(3);
479 if (active_pid == 0 && active_gid == 0 && (usage > '0' && usage < '5')){
480 <?php if($GLOBALS['enable_group_therapy']) { ?>
481 alert('<?php xl('You must first select or add a patient or therapy group.','e') ?>');
482 <?php } else { ?>
483 alert('<?php xl('You must first select or add a patient.','e') ?>');
484 <?php } ?>
485 return false;
487 if (active_encounter == 0 && (usage > '1' && usage < '3')) {
488 alert('<?php xl('You must first select or create an encounter.','e') ?>');
489 return false;
491 if (encounter_locked && usage > '1' && (usage > '1' && usage < '3')) {
492 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
493 return false;
495 var f = document.forms[0];
496 top.restoreSession();
497 var i = url.indexOf('{PID}');
498 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
499 if(f.sel_frame)
501 var fi = f.sel_frame.selectedIndex;
502 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
504 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
505 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
506 if (frame == 'RTop') topName = fname; else botName = fname;
507 return false;
510 function loadFrame3(fname, frame, url) {
511 var f = document.forms[0];
512 top.restoreSession();
513 var i = url.indexOf('{PID}');
514 if (i >= 0) url = url.substring(0,i) + active_pid + url.substring(i+5);
515 if(f.sel_frame)
517 var fi = f.sel_frame.selectedIndex;
518 if (fi == 1) frame = 'RTop'; else if (fi == 2) frame = 'RBot';
520 if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';
521 top.frames[frame].location = '<?php echo "$web_root/interface/" ?>' + url;
522 if (frame == 'RTop') topName = fname; else botName = fname;
523 return false;
526 // Make sure the the top and bottom frames are open or closed, as specified.
527 function forceSpec(istop, isbot) {
528 var f = document.forms[0];
529 if (f.cb_top.checked != istop) {
530 f.cb_top.checked = istop;
531 toggleFrame(1);
533 if (f.cb_bot.checked != isbot) {
534 f.cb_bot.checked = isbot;
535 toggleFrame(2);
539 // Make sure both frames are open.
540 function forceDual() {
541 forceSpec(true, true);
544 // Load the specified url into a frame to be determined, with the specified
545 // frame as the default; the url must be relative to interface.
546 function loadFrameDual(tname, bname, topurl, boturl) {
547 var topusage = tname.substring(3);
548 var botusage = bname.substring(3);
549 if (active_pid == 0 && (topusage > '0' || botusage > '0')) {
550 alert('<?php xl('You must first select or add a patient.','e') ?>');
551 return false;
553 if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
554 alert('<?php xl('You must first select or create an encounter.','e') ?>');
555 return false;
557 if (encounter_locked && (topusage > '1' || botusage > '1')) {
558 alert('<?php echo xls('This encounter is locked. No new forms can be added.') ?>');
559 return false;
561 var f = document.forms[0];
562 forceDual();
563 top.restoreSession();
564 var i = topurl.indexOf('{PID}');
565 if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
566 i = boturl.indexOf('{PID}');
567 if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
568 top.frames.RTop.location = '<?php echo "$web_root/interface/" ?>' + topurl;
569 top.frames.RBot.location = '<?php echo "$web_root/interface/" ?>' + boturl;
570 topName = tname;
571 botName = bname;
572 return false;
575 // Set disabled/enabled state of radio buttons and associated labels
576 // depending on whether there is an active patient or encounter.
577 function syncRadios() {
578 var f = document.forms[0];
579 encounter_locked = isEncounterLocked(active_encounter);
580 var nlinks = document.links.length;
581 for (var i = 0; i < nlinks; ++i) {
582 var lnk = document.links[i];
583 if (lnk.id.length != 4) continue;
584 var usage = lnk.id.substring(3);
585 if (usage == '1' || usage == '2') {
586 var da = false;
587 if (active_pid == 0) da = true;
588 if (active_encounter == 0 && usage > '1') da = true;
589 if (encounter_locked && usage > '1') da = true;
590 <?php
591 if ($GLOBALS['menu_styling_vertical'] == 0){
592 $color = "'#0000ff'";
593 }else{ // ($GLOBALS['menu_styling_vertical'] == 1)
594 $color = "'#000000'";
597 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
599 //for therapy groups menu
600 <?php if($GLOBALS['enable_group_therapy']) { ?>
601 if (usage == '3' || usage == '4') {
602 var da = false;
603 if (active_gid == 0) da = true;
604 if (active_encounter == 0 && usage > '3') da = true;
605 if (encounter_locked && usage > '3') da = true;
606 <?php
607 if ($GLOBALS['menu_styling_vertical'] == 0){
608 $color = "'#0000ff'";
609 }else{ // ($GLOBALS['menu_styling_vertical'] == 1)
610 $color = "'#000000'";
613 lnk.style.color = da ? '#888888' : <?php echo $color; ?>;
615 <?php } ?>
618 f.popups.disabled = (active_pid == 0);
621 function goHome() {
622 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
623 top.frames['RBot'].location='messages/messages.php?form_active=1';
626 //Function to clear active patient and encounter in the server side
627 function clearactive() {
628 top.restoreSession();
629 //Ajax call to clear active patient in session
630 var method = (active_pid > 0) ? 'unset_pid' : 'unset_gid';
631 $.ajax({
632 type: "POST",
633 url: "<?php echo $GLOBALS['webroot'] ?>/library/ajax/unset_session_ajax.php",
634 data: { func: method},
635 success:function( msg ) {
636 clearPatient();
637 clearTherapyGroup();
638 top.frames['RTop'].location='<?php echo $GLOBALS['default_top_pane']?>';
639 top.frames['RBot'].location='messages/messages.php?form_active=1';
643 $(parent.Title.document.getElementById('clear_active')).hide();
644 $(parent.Title.document.getElementById('clear_active_group')).hide();
646 // Reference to the search.php window.
647 var my_window;
649 // Open the search.php window.
650 function initFilter() {
651 my_window = window.open("../../custom/search.php", "mywindow","status=1");
654 // This is called by the search.php (Filter) window.
655 function processFilter(fieldString, serviceCode) {
656 var f = document.forms[0];
657 document.getElementById('searchFields').value = fieldString;
658 f.search_service_code.value = serviceCode;
659 findPatient("Filter");
660 f.search_service_code.value = '';
661 my_window.close();
664 // Process the click to find a patient by name, id, ssn or dob.
665 function findPatient(findby) {
666 var f = document.forms[0];
667 if (! f.cb_top.checked) {
668 f.cb_top.checked = true;
669 toggleFrame(1);
671 f.findBy.value = findby;
672 top.restoreSession();
673 document.find_patient.submit();
676 // Helper function to set the contents of a div.
677 function setSomeContent(id, content, doc) {
678 if (doc.getElementById) {
679 var x = doc.getElementById(id);
680 x.innerHTML = '';
681 x.innerHTML = content;
683 else if (doc.all) {
684 var x = doc.all[id];
685 x.innerHTML = content;
688 function setDivContent(id, content) {
689 setSomeContent(id, content, document);
691 function setTitleContent(id, content) {
692 setSomeContent(id, content, parent.Title.document);
695 // This is called automatically when a new patient is set, to make sure
696 // there are no patient-specific documents showing stale data. If a frame
697 // was just loaded with data for the correct patient, its name is passed so
698 // that it will not be zapped. At this point the new server-side pid is not
699 // assumed to be set, so this function will only load global data.
700 function reloadPatient(frname) {
701 var f = document.forms[0];
702 if (topName.length > 3 && topName.substring(3) > '0' && frname != 'RTop') {
703 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal'][2]; ?>');
705 if (botName.length > 3 && botName.substring(3) > '0' && frname != 'RBot') {
706 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
710 // Reload encounter-specific frames, excluding a specified frame. At this
711 // point the new server-side encounter ID may not be set and loading the same
712 // document for the new encounter will not work, so load patient info instead.
713 function reloadEncounter(frname) {
714 var f = document.forms[0];
715 if (topName.length > 3 && topName.substring(3) > '1' && frname != 'RTop') {
716 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem'][2]; ?>');
718 if (botName.length > 3 && botName.substring(3) > '1' && frname != 'RBot') {
719 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens'][2]; ?>');
724 // Call this to announce that the patient has changed. You must call this
725 // if you change the session PID, so that the navigation frame will show the
726 // correct patient and so that the other frame will be reloaded if it contains
727 // patient-specific information from the previous patient. frname is the name
728 // of the frame that the call came from, so we know to only reload content
729 // from the *other* frame if it is patient-specific.
730 function setPatient(pname, pid, pubpid, frname, str_dob) {
731 clearTherapyGroup();
732 var str = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid + '"><b>' + pname + ' (' + pubpid + ')<br /></b></a>';
733 setDivContent('current_patient', str);
734 setTitleContent('current_patient', str + str_dob);
735 if (pid == active_pid) return;
736 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
737 active_pid = pid;
738 active_encounter = 0;
739 encounter_locked = false;
740 if (frname) reloadPatient(frname);
741 syncRadios();
742 $(parent.Title.document.getElementById('current_patient_block')).show();
743 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
744 $(encounter_block).hide();
746 // zero out the encounter frame, replace it with the encounter list frame
747 var f = document.forms[0];
748 if ( f.cb_top.checked && f.cb_bot.checked ) {
749 var encounter_frame = getEncounterTargetFrame('enc');
750 if ( encounter_frame != undefined ) {
751 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
755 $(parent.Title.document.getElementById('clear_active')).show();//To display Clear Active Patient button on selecting a patient
756 $(parent.Title.document.getElementById('clear_active_group')).hide();//To hide Clear Active group button on selecting a patient
760 // Call this to announce that the therapy group has changed. You must call this
761 // if you change the session 'therapy_group', so that the navigation frame will show the
762 // correct group.
763 function setTherapyGroup(group_id, group_name) {
764 clearPatient();
766 $(parent.Title.document.querySelector('#current_patient_block span.text')).hide();
767 setTitleContent('current_patient', '<span><?php echo xls('Therapy Group -');?> <a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentGroupFromTitle(' + group_id +')">' + group_name + ' (' + group_id + ')<a></span>' );
768 if (group_id == active_gid) return;
769 setDivContent('current_encounter', '<b><?php xl('None','e'); ?></b>');
770 active_gid = group_id;
771 active_encounter = 0;
772 encounter_locked = false;
773 syncRadios();
774 $(parent.Title.document.getElementById('current_patient_block')).show();
775 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
776 $(encounter_block).hide();
778 // zero out the encounter frame, replace it with the encounter list frame
779 var f = document.forms[0];
780 if ( f.cb_top.checked && f.cb_bot.checked ) {
781 var encounter_frame = getEncounterTargetFrame('enc');
782 if ( encounter_frame != undefined ) {
783 loadFrame('ens0',encounter_frame, '<?php echo $primary_docs['ens'][2]; ?>');
787 $(parent.Title.document.getElementById('clear_active_group')).show();//To display Clear Active group button on selecting a patient
788 $(parent.Title.document.getElementById('clear_active')).hide();//To hide Clear Active Patient button on selecting a patient
791 function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) {
792 //This function lists all encounters of the patient.
793 //This function writes the drop down in the top frame.
794 //It is called when a new patient is create/selected from the search menu.
795 var str = '<Select class="text" id="EncounterHistory" onchange="{top.restoreSession();toencounter(this.options[this.selectedIndex].value)}">';
796 str+='<option value=""><?php echo htmlspecialchars( xl('Encounter History'), ENT_QUOTES) ?></option>';
797 str+='<option value="New Encounter"><?php echo htmlspecialchars( xl('New Encounter'), ENT_QUOTES) ?></option>';
798 str+='<option value="Past Encounter List"><?php echo htmlspecialchars( xl('Past Encounter List'), ENT_QUOTES) ?></option>';
799 for(CountEncounter=0;CountEncounter<EncounterDateArray.length;CountEncounter++)
801 str+='<option value="'+EncounterIdArray[CountEncounter]+'~'+EncounterDateArray[CountEncounter]+'">'+EncounterDateArray[CountEncounter]+'-'+CalendarCategoryArray[CountEncounter]+'</option>';
803 str+='</Select>';
804 $(parent.Title.document.getElementById('past_encounter_block')).show();
805 top.window.parent.Title.document.getElementById('past_encounter').innerHTML=str;
808 function loadCurrentPatientFromTitle() {
809 top.restoreSession();
810 top.frames['RTop'].location='../patient_file/summary/demographics.php';
813 function loadCurrentGroupFromTitle(gid) {
814 top.restoreSession();
815 top.frames['RTop'].location='../therapy_groups/index.php?method=groupDetails&group_id=' + gid;
818 function getEncounterTargetFrame( name ) {
819 var bias = <?php echo $primary_docs[ 'enc' ][ 1 ]?>;
820 var f = document.forms[0];
821 var r = 'RTop';
822 if (f.cb_top.checked && f.cb_bot.checked) {
823 if ( bias == 2 ) {
824 r = 'RBot';
825 } else {
826 r = 'RTop';
828 } else {
829 if ( f.cb_top.checked ) {
830 r = 'RTop';
831 } else if ( f.cb_bot.checked ) {
832 r = 'RBot';
835 return r;
838 function isEncounterLocked( encounterId ) {
839 <?php if ( $esignApi->lockEncounters() ) { ?>
840 // If encounter locking is enabled, make a syncronous call (async=false) to check the
841 // DB to see if the encounter is locked.
842 // Call restore session, just in case
843 top.restoreSession();
844 $.ajax({
845 type: 'POST',
846 url: '<?php echo $GLOBALS['webroot']?>/interface/esign/index.php?module=encounter&method=esign_is_encounter_locked',
847 data: { encounterId : encounterId },
848 success: function( data ) {
849 encounter_locked = data;
851 dataType: 'json',
852 async:false
853 });
854 return encounter_locked;
855 <?php } else { ?>
856 // If encounter locking isn't enabled, just tell the left_nav that the encounter
857 // isn't locked.
858 return false;
859 <?php } ?>
862 // Call this to announce that the encounter has changed. You must call this
863 // if you change the session encounter, so that the navigation frame will
864 // show the correct encounter and so that the other frame will be reloaded if
865 // it contains encounter-specific information from the previous encounter.
866 // frname is the name of the frame that the call came from, so we know to only
867 // reload encounter-specific content from the *other* frame.
868 function setEncounter(edate, eid, frname) {
869 if (eid == active_encounter) return;
870 if (!eid) edate = '<?php xl('None','e'); ?>';
871 var str = '<b>' + edate + '</b>';
872 setDivContent('current_encounter', str);
873 active_encounter = eid;
874 encounter_locked=isEncounterLocked(active_encounter);
875 reloadEncounter(frname);
876 syncRadios();
877 var encounter_block = $(parent.Title.document.getElementById('current_encounter_block'));
878 var encounter = $(parent.Title.document.getElementById('current_encounter'));
879 var estr = '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate + ' (' + eid + ')</b></a>';
880 encounter.html( estr );
881 encounter_block.show();
884 function loadCurrentEncounterFromTitle() {
885 top.restoreSession();
886 top.frames[ parent.left_nav.getEncounterTargetFrame('enc') ].location='../patient_file/encounter/encounter_top.php';
889 // You must call this if you delete the active patient (or if for any other
890 // reason you "close" the active patient without opening a new one), so that
891 // the appearance of the navigation frame will be correct and so that any
892 // stale content will be reloaded.
893 function clearPatient() {
894 if (active_pid == 0) return;
895 var f = document.forms[0];
896 active_pid = 0;
897 active_encounter = 0;
898 encounter_locked = false;
899 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
900 $(parent.Title.document.getElementById('current_patient_block')).hide();
901 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
902 $(parent.Title.document.getElementById('current_encounter_block')).hide();
903 reloadPatient('');
904 syncRadios();
907 // You must call this if you delete the active therapy group so that
908 // the appearance of the navigation frame will be correct and so that any
909 // stale content will be reloaded.
910 function clearTherapyGroup() {
911 if (active_gid == 0) return;
912 var f = document.forms[0];
913 active_gid = 0;
914 active_encounter = 0;
915 encounter_locked = false;
916 setDivContent('current_patient', '<b><?php xl('None','e'); ?></b>');
917 $(parent.Title.document.getElementById('current_patient_block')).hide();
918 top.window.parent.Title.document.getElementById('past_encounter').innerHTML='';
919 $(parent.Title.document.getElementById('current_encounter_block')).hide();
920 syncRadios();
923 // You must call this if you delete the active encounter (or if for any other
924 // reason you "close" the active encounter without opening a new one), so that
925 // the appearance of the navigation frame will be correct and so that any
926 // stale content will be reloaded.
927 function clearEncounter() {
928 if (active_encounter == 0) return;
929 top.window.parent.Title.document.getElementById('current_encounter').innerHTML="<b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b>";
930 active_encounter = 0;
931 encounter_locked = false;
932 reloadEncounter('');
933 syncRadios();
936 function removeOptionSelected(EncounterId)
937 {//Removes an item from the Encounter drop down.
938 var elSel = top.window.parent.Title.document.getElementById('EncounterHistory');
939 var i;
940 for (i = elSel.length - 1; i>=2; i--) {
941 EncounterHistoryValue=elSel.options[i].value;
942 EncounterHistoryValueArray=EncounterHistoryValue.split('~');
943 if (EncounterHistoryValueArray[0]==EncounterId) {
944 elSel.remove(i);
949 // You can call this to make sure the session pid is what we expect.
950 function pidSanityCheck(pid) {
951 if (pid != active_pid) {
952 alert('Session patient ID is ' + pid + ', expecting ' + active_pid +
953 '. This session is unstable and should be abandoned. Do not use ' +
954 'OpenEMR in multiple browser windows!');
955 return false;
957 return true;
960 // You can call this to make sure the session encounter is what we expect.
961 function encounterSanityCheck(eid) {
962 if (eid != active_encounter) {
963 alert('Session encounter ID is ' + eid + ', expecting ' + active_encounter +
964 '. This session is unstable and should be abandoned. Do not use ' +
965 'OpenEMR in multiple browser windows!');
966 return false;
968 return true;
971 // Pop up a report.
972 function repPopup(aurl) {
973 top.restoreSession();
974 window.open('<?php echo "$web_root/interface/reports/" ?>' + aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
975 return false;
978 // This is invoked to pop up some window when a popup item is selected.
979 function selpopup(selobj) {
980 var i = selobj.selectedIndex;
981 var opt = selobj.options[i];
982 if (i > 0) {
983 var width = 750;
984 var height = 550;
985 if (opt.text == 'Export' || opt.text == 'Import') {
986 width = 500;
987 height = 400;
989 dlgopen(opt.value, '_blank', width, height);
991 selobj.selectedIndex = 0;
994 // Treeview activation stuff:
995 $(document).ready(function(){
996 if(1 == <?php echo $GLOBALS['menu_styling_vertical'] ?>){
997 $("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
998 $("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
999 $("#navigation-slide > li > a.expanded").click(function() {
1000 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1001 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1003 $("#navigation-slide > li > a.collapsed").click(function() {
1004 $("#navigation-slide > li > a.expanded").not(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1005 $(this).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1007 $("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
1008 $("#navigation-slide > li > a.expanded").next("ul").find("li > a.expanded_lv2").not(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1009 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1011 $("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
1012 $("#navigation-slide > li > a.expanded").next("ul").find("li > a.expanded_lv2").not(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1013 $(this).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1015 $("#navigation-slide > li > a#cal0").prepend('<i class="fa fa-fw fa-calendar"></i>&nbsp;');
1016 $("#navigation-slide > li > a#pfb0").prepend('<i class="fa fa-fw fa-list-alt"></i>&nbsp;');
1017 $("#navigation-slide > li > a#msg0").prepend('<i class="fa fa-fw fa-envelope-o"></i>&nbsp;');
1018 $("#navigation-slide > li > a#app0").prepend('<i class="fa fa-fw fa-user"></i>&nbsp;');
1019 $("#navigation-slide > li > a#ppo0").prepend('<i class="fa fa-fw fa-users"></i>&nbsp;');
1020 $("#navigation-slide > li > a#repimg").prepend('<i class="fa fa-fw fa-area-chart"></i>&nbsp;');
1021 $("#navigation-slide > li > a#feeimg").prepend('<i class="fa fa-fw fa-dollar"></i>&nbsp;');
1022 $("#navigation-slide > li > a#adm0").prepend('<i class="fa fa-fw fa-list-ol"></i>&nbsp;');
1023 $("#navigation-slide > li > a#invimg").prepend('<i class="fa fa-fw fa-list-ol"></i>&nbsp;');
1024 $("#navigation-slide > li > a#admimg").prepend('<i class="fa fa-fw fa-cogs"></i>&nbsp;');
1025 $("#navigation-slide > li > a#misimg").prepend('<i class="fa fa-fw fa-cog"></i>&nbsp;');
1026 $("#navigation-slide > li > a#proimg").prepend('<i class="fa fa-fw fa-stethoscope"></i>&nbsp;');
1027 $("#navigation-slide > li > a#modimg").prepend('<i class="fa fa-fw fa-puzzle-piece"></i>&nbsp;');
1028 $("#navigation-slide > li").each(function(index) {
1029 if($(" > ul > li", this).size() == 0){
1030 $(" > a", this).addClass("collapsed");
1033 } else { // $GLOBALS['menu_styling_vertical'] == 0
1035 //Remove the links (used by the sliding menu) that will break treeview
1036 $('a.collapsed').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1037 $('a.collapsed_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1038 $('a.expanded').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1039 $('a.expanded_lv2').each(function() { $(this).replaceWith('<span>'+$(this).text()+'</span>'); });
1041 // Initiate treeview
1042 $("#navigation").treeview({
1043 animated: "fast",
1044 collapsed: true,
1045 unique: true,
1046 toggle: function() {
1047 window.console && console.log("%o was toggled", this);
1053 </script>
1055 </head>
1057 <body class="body_nav main-left">
1059 <form method='post' name='find_patient' target='RTop'
1060 action='<?php echo $rootdir ?>/main/finder/patient_select.php'>
1062 <center>
1063 <select name='sel_frame' style='background-color:transparent;font-size:9pt;width:100;'>
1064 <option value='0'><?php xl('Default','e'); ?></option>
1065 <option value='1'><?php xl('Top','e'); ?></option>
1066 <option value='2'><?php xl('Bottom','e'); ?></option>
1067 </select>
1068 </center>
1070 <table cellpadding='0' cellspacing='0' border='0' width='100%'>
1071 <tr>
1072 <td class='smalltext' nowrap>
1073 <input type='checkbox' name='cb_top' onclick='toggleFrame(1)' <?php echo $cb_top_chk ?> />
1074 <b><?php xl('Top','e') ?></b>
1075 </td>
1076 <td class='smalltext' align='right' nowrap>
1077 <b><?php xl('Bot','e') ?></b>
1078 <input type='checkbox' name='cb_bot' onclick='toggleFrame(2)' <?php echo $cb_bot_chk ?> />
1079 </td>
1080 </tr>
1081 </table>
1083 <?php if ( $GLOBALS['menu_styling_vertical'] == 1) { ?>
1084 <ul id="navigation-slide">
1085 <?php } else { // ($GLOBALS['menu_styling_vertical'] == 0) ?>
1086 <ul id="navigation">
1087 <?php } ?>
1089 <?php
1090 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1091 genTreeLink('RTop','cal',xl('Calendar'));
1093 if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1094 genTreeLink('RTop','pfb',xl('Flow Board'));
1096 if (acl_check('patients', 'notes')) {
1097 genTreeLink('RBot','msg',xl('Messages'));
1099 if($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address'] && acl_check('patientportal','portal')) {
1100 genTreeLink('RTop','app',xl('Portal Activity'));
1102 if ($GLOBALS['gbl_portal_cms_enable'] && acl_check('patientportal','portal')) {
1103 genPopLink(xl('CMS Portal'),'../cmsportal/list_requests.php','ppo0');
1107 <li class="open"><a class="expanded" id="patimg" ><i class="fa fa-fw fa-user"></i>&nbsp;<span><?php xl('Patient/Client','e') ?></span></a>
1108 <ul>
1109 <?php if (acl_check('patients','demo'))
1110 genMiscLink('RTop','fin','0',xl('Patients'),'main/finder/dynamic_finder.php'); ?>
1111 <?php if (acl_check('patients','demo', '', 'write') || acl_check('patients','demo', '', 'addonly'))
1112 genTreeLink('RTop','new',($GLOBALS['full_new_patient_form'] ? xl('New/Search') : xl('New'))); ?>
1113 <?php if (acl_check('patients','demo'))
1114 genTreeLink('RTop','dem',xl('Summary')); ?>
1116 <?php if (acl_check('patients','appt')) { ?>
1117 <li class="open"><a class="expanded_lv2"><span><?php xl('Visits','e') ?></span></a>
1118 <ul>
1119 <?php if (acl_check('patients','appt', '', 'write') || acl_check('patients','appt', '', 'addonly'))
1120 genTreeLink('RBot','nen',xl('Create Visit')); ?>
1121 <?php if (acl_check('patients','appt'))
1122 genTreeLink('RBot','enc',xl('Current')); ?>
1123 <?php if (acl_check('patients','appt'))
1124 genTreeLink('RBot','ens',xl('Visit History')); ?>
1125 </ul>
1126 </li>
1127 <?php } ?>
1129 <?php if (acl_check('patients','med')) { ?>
1130 <li><a class="collapsed_lv2"><span><?php xl('Records','e') ?></span></a>
1131 <ul>
1132 <?php genTreeLink('RTop','prq',xl('Patient Record Request')); ?>
1133 </ul>
1134 </li>
1135 <?php } ?>
1137 <?php if ($GLOBALS['gbl_nav_visit_forms'] && acl_check('patients','demo')) { ?>
1138 <li><a class="collapsed_lv2"><span><?php xl('Visit Forms','e') ?></span></a>
1139 <ul>
1140 <?php
1141 // Generate the items for visit forms, both traditional and LBF.
1144 $lres = sqlStatement("SELECT * FROM list_options " .
1145 "WHERE list_id = 'lbfnames' AND activity = 1 ORDER BY seq, title");
1146 while ($lrow = sqlFetchArray($lres)) {
1147 $option_id = $lrow['option_id']; // should start with LBF
1148 $title = $lrow['title'];
1149 // Check ACO attribute, if any, of this LBF.
1150 $jobj = json_decode($lrow['notes'], true);
1151 if (!empty($jobj['aco'])) {
1152 $tmp = explode('|', $jobj['aco']);
1153 if (!acl_check($tmp[0], $tmp[1])) continue;
1155 genMiscLink('RBot','cod','2',xl_form_title($title),
1156 "patient_file/encounter/load_form.php?formname=$option_id");
1158 include_once("$srcdir/registry.inc");
1159 $reg = getRegistered();
1160 if (!empty($reg)) {
1161 foreach ($reg as $entry) {
1162 $option_id = $entry['directory'];
1163 $title = trim($entry['nickname']);
1164 if ($option_id == 'fee_sheet' ) continue;
1165 if ($option_id == 'newpatient') continue;
1166 if (empty($title)) $title = $entry['name'];
1167 genMiscLink('RBot','cod','2',xl_form_title($title),
1168 "patient_file/encounter/load_form.php?formname=" .
1169 urlencode($option_id));
1173 </ul>
1174 </li>
1175 <li class="collapsed" ><a class="collapsed_lv2"><span><?php echo xlt('Import') ?></span></a>
1176 <ul>
1177 <?php genMiscLink('RTop','ccr','0',xlt('Upload'),'patient_file/ccr_import.php'); ?>
1178 <?php genMiscLink('RTop','apr','0',xlt('Pending Approval'),'patient_file/ccr_pending_approval.php'); ?>
1179 </ul>
1180 </li>
1181 <?php } // end if gbl_nav_visit_forms ?>
1183 </ul>
1184 </li>
1186 <?php if ($GLOBALS['enable_group_therapy']) : ?>
1187 <li><a class="collapsed" id="groupimg" ><i class="fa fa-fw fa-users"></i>&nbsp;<span><?php xl('Group','e') ?></span></a>
1188 <ul>
1189 <?php genMiscLink('RTop','gfn','0',xl('Groups'),'therapy_groups/index.php?method=listGroups'); ?>
1190 <?php genTreeLink('RTop','gng', xl('New')); ?>
1191 <?php genTreeLink('RTop','gdg',xl('Group Details')); ?>
1192 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
1193 <ul>
1194 <?php genTreeLink('RBot','gcv',xl('Create Visit')); ?>
1195 <?php genTreeLink('RBot','gce',xl('Current')); ?>
1196 <?php genTreeLink('RBot','gvh',xl('Visit History')); ?>
1197 </ul>
1198 </li>
1200 </ul>
1201 </li>
1202 <?php endif ?>
1204 <?php // TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1205 <?php if((!isset($GLOBALS['enable_fees_in_left_menu']) || $GLOBALS['enable_fees_in_left_menu'] == 1) &&
1206 (acl_check('encounters','coding') || acl_check('acct', 'eob') || acl_check('acct','bill','','write'))) { ?>
1207 <li><a class="collapsed" id="feeimg" ><span><?php xl('Fees','e') ?></span></a>
1208 <ul>
1209 <?php if (acl_check('encounters','coding'))
1210 genMiscLink('RBot','cod','2',xl('Fee Sheet'),'patient_file/encounter/load_form.php?formname=fee_sheet'); ?>
1211 <?php if ($GLOBALS['use_charges_panel'] && acl_check('encounters','coding'))
1212 genTreeLink('RBot','cod', xl('Charges')); ?>
1213 <?php if (acl_check('acct','bill','','write'))
1214 genMiscLink('RBot','pay','1',xl('Payment'),'patient_file/front_payment.php'); ?>
1215 <?php if (acl_check('acct','bill','','write'))
1216 genMiscLink('RBot','bil','1',xl('Checkout'),'patient_file/pos_checkout.php?framed=1'); ?>
1217 <?php if (!$GLOBALS['simplified_demographics'] && (acl_check('acct','bill','','write') || acl_check('acct','eob','','write')))
1218 genTreeLink('RTop','bil',xl('Billing')); ?>
1219 <?php if ($GLOBALS['enable_batch_payment'] && (acl_check('acct','bill','','write') || acl_check('acct','eob','','write')))
1220 genTreeLink('RTop','npa',xl('Batch Payments'),false,2);?>
1221 <?php if ($GLOBALS['enable_posting'] && acl_check('acct','eob','','write'))
1222 genMiscLink('RTop','eob','0',xl('Posting'), 'billing/sl_eob_search.php'); ?>
1223 <?php if ($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob'))
1224 genTreeLink('RTop','edi',xl('EDI History'),false,2);?>
1225 </ul>
1226 </li>
1227 <?php } ?>
1229 <?php if (acl_check('menus', 'modle')) {?>
1230 <li><a class="collapsed" id="modimg" ><span><?php echo xlt('Modules') ?></span></a>
1231 <ul>
1232 <?php genMiscLink('RTop','adm','0',xl('Manage Modules'),'modules/zend_modules/public/Installer'); ?>
1233 <?php //genTreeLink('RTop','ort',xl('Settings')); ?>
1234 <?php
1235 $module_query = sqlStatement("select mod_directory,mod_name,mod_nick_name,mod_relative_link,type from modules where mod_active = 1 AND sql_run= 1 order by mod_ui_order asc");
1236 if (sqlNumRows($module_query)) {
1237 while ($modulerow = sqlFetchArray($module_query)) {
1238 $acl_section = strtolower($modulerow['mod_directory']);
1239 $disallowed[$acl_section] = zh_acl_check($_SESSION['authUserID'],$acl_section) ? "" : "1";
1240 $modulePath = "";
1241 $added = "";
1242 if($modulerow['type'] == 0) {
1243 $modulePath = $GLOBALS['customModDir'];
1244 $added = "";
1246 else{
1247 $added = "index";
1248 $modulePath = $GLOBALS['zendModDir'];
1251 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$added;
1252 $mod_nick_name = $modulerow['mod_nick_name'] ? $modulerow['mod_nick_name'] : $modulerow['mod_name'];
1254 <?php genMiscLink2('RTop',$acl_section,'0',xlt($mod_nick_name),$relative_link);?>
1255 <?php }
1256 } ?>
1257 </ul>
1258 </li>
1259 <?php } ?>
1261 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1262 <li><a class="collapsed" id="invimg" ><span><?php xl('Inventory','e') ?></span></a>
1263 <ul>
1264 <?php genMiscLink('RTop','adm','0',xl('Management'),'drugs/drug_inventory.php'); ?>
1265 <?php genPopLink(xl('Destroyed'),'destroyed_drugs_report.php'); ?>
1266 </ul>
1267 </li>
1268 <?php } ?>
1270 <?php if (acl_check('patients', 'lab')) { ?>
1271 <li><a class="collapsed" id="proimg" ><span><?php xl('Procedures','e') ?></span></a>
1272 <ul>
1273 <?php if (acl_check('admin', 'super')) genTreeLink('RTop','orl',xl('Providers')); ?>
1274 <?php if (acl_check('admin', 'super')) genTreeLink('RTop','ort',xl('Configuration')); ?>
1275 <?php if (acl_check('admin', 'super')) genTreeLink('RTop','orc',xl('Load Compendium')); ?>
1276 <?php genTreeLink('RTop','orp',xl('Pending Review')); ?>
1277 <?php genTreeLink('RTop','orr',xl('Patient Results')); ?>
1278 <?php genTreeLink('RTop','lda',xl('Lab Overview')); ?>
1279 <?php genTreeLink('RTop','orb',xl('Batch Results')); ?>
1280 <?php genTreeLink('RTop','ore',xl('Electronic Reports')); ?>
1281 <?php genTreeLink('RTop','dld',xl('Lab Documents'));?>
1282 </ul>
1283 </li>
1284 <?php } ?>
1286 <?php
1287 if($GLOBALS['erx_enable'] && acl_check('patients', 'rx')) {
1288 $newcrop_user_role = sqlQuery("SELECT newcrop_user_role FROM users WHERE username = '".$_SESSION['authUser']."'");
1289 if($newcrop_user_role['newcrop_user_role']) {
1291 <li><a class="collapsed" id="feeimg" ><span><?php xl('New Crop','e') ?></span></a>
1292 <ul>
1293 <li><a class="collapsed_lv2"><span><?php xl('Status','e') ?></span></a>
1294 <ul>
1295 <?php genTreeLink('RTop','erx',xl('e-Rx')); ?>
1296 <?php genMiscLink('RTop','err','0',xl('e-Rx Renewal'),'eRx.php?page=status'); ?>
1297 <?php if($newcrop_user_role['newcrop_user_role'] === 'erxadmin') genMiscLink('RTop','ere','0',xl('e-Rx EPCS'),'eRx.php?page=epcs-admin'); ?>
1298 </ul>
1299 </li>
1300 </ul>
1301 </li>
1302 <?php
1307 <?php if (!$disallowed['adm']) { ?>
1308 <li><a class="collapsed" id="admimg" ><span><?php xl('Administration','e') ?></span></a>
1309 <ul>
1310 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Globals'),'super/edit_globals.php'); ?>
1311 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Facilities'),'usergroup/facilities.php'); ?>
1312 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Users'),'usergroup/usergroup_admin.php'); ?>
1313 <?php if (acl_check('admin', 'practice' )) genTreeLink('RTop','adb',xl('Addr Book')); ?>
1314 <?php
1315 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1316 if (acl_check('admin', 'practice' )) genMiscLink('RTop','adm','0',xl('Practice'),'../controller.php?practice_settings&pharmacy&action=list'); ?>
1317 <?php if (acl_check('admin', 'superbill')) genTreeLink('RTop','sup',xl('Codes')); ?>
1318 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Layouts'),'super/edit_layout.php'); ?>
1319 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Lists'),'super/edit_list.php'); ?>
1320 <?php if (acl_check('admin', 'acl' )) genMiscLink('RTop','adm','0',xl('ACL'),'usergroup/adminacl.php'); ?>
1321 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Files'),'super/manage_site_files.php'); ?>
1322 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Backup'),'main/backup.php'); ?>
1323 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Rules'),'super/rules/index.php?action=browse!list'); ?>
1324 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Alerts'),'super/rules/index.php?action=alerts!listactmgr'); ?>
1325 <?php if (acl_check('admin', 'super' ) && $GLOBALS['enable_cdr']) genMiscLink('RTop','adm','0',xl('Patient Reminders'),'patient_file/reminder/patient_reminders.php?mode=admin&patient_id='); ?>
1326 <?php if ( ($GLOBALS['include_de_identification']) && (acl_check('admin', 'super' )) ) genMiscLink('RTop','adm','0',xl('De Identification'),'de_identification_forms/de_identification_screen1.php'); ?>
1327 <?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'); ?>
1328 <?php if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) genMiscLink('RTop','adm','0',xl('Export'),'main/ippf_export.php'); ?>
1329 <li><a class="collapsed_lv2"><span><?php xl('Other','e') ?></span></a>
1330 <ul>
1331 <?php if (acl_check('admin', 'language')) genMiscLink('RTop','adm','0',xl('Language'),'language/language.php'); ?>
1332 <?php if (acl_check('admin', 'forms' )) genMiscLink('RTop','adm','0',xl('Forms'),'forms_admin/forms_admin.php'); ?>
1333 <?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'); ?>
1334 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Logs'),'logview/logview.php'); ?>
1335 <?php
1336 if($newcrop_user_role['newcrop_user_role'] || $GLOBALS['erx_enable']) {
1337 if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('eRx Logs'),'logview/erx_logview.php');
1340 <?php if ( (!$GLOBALS['disable_phpmyadmin_link']) && (acl_check('admin', 'database')) ) genMiscLink('RTop','adm','0',xl('Database'),'../phpmyadmin/index.php'); ?>
1341 <?php if (acl_check('admin', 'users' )) genMiscLink('RTop','adm','0',xl('Certificates'),'usergroup/ssl_certificates_admin.php'); ?>
1342 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Native Data Loads'),'../interface/super/load_codes.php'); ?>
1343 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('External Data Loads'),'../interface/code_systems/dataloads_ajax.php'); ?>
1344 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Merge Patients'),'patient_file/merge_patients.php'); ?>
1345 <?php if (acl_check('admin', 'super' )) genMiscLink('RTop','adm','0',xl('Import Holidays'),'../interface/main/holidays/import_holidays.php'); ?>
1346 <?php if ($GLOBALS['enable_auditlog_encryption']) genMiscLink('RTop','rep','0',xl('Audit Log Tamper'),'reports/audit_log_tamper_report.php'); ?>
1347 </ul>
1348 </li>
1349 </ul>
1350 </li>
1351 <?php } ?>
1353 <li><a class="collapsed" id="repimg" ><span><?php xl('Reports','e') ?></span></a>
1354 <ul>
1355 <?php
1356 $module_query = sqlStatement("SELECT msh.*,ms.menu_name,ms.path,m.mod_ui_name,m.type FROM modules_hooks_settings AS msh LEFT OUTER JOIN modules_settings AS ms ON
1357 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1358 WHERE fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='reports' ORDER BY mod_id");
1359 if (sqlNumRows($module_query)) {
1360 $jid = 0;
1361 $modid = '';
1362 while ($modulerow = sqlFetchArray($module_query)) {
1363 $modulePath = "";
1364 $added = "";
1365 if($modulerow['type'] == 0) {
1366 $modulePath = $GLOBALS['customModDir'];
1367 $added = "";
1369 else{
1370 $added = "index";
1371 $modulePath = $GLOBALS['zendModDir'];
1374 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$modulerow['path'];
1375 $mod_nick_name = $modulerow['menu_name'] ? $modulerow['menu_name'] : 'NoName';
1377 if($jid==0 || ($modid!=$modulerow['mod_id'])){
1378 if($modid!='')
1379 echo "</ul>";
1381 <li><a class="collapsed_lv2"><span><?php echo xlt($modulerow['mod_ui_name']); ?></span></a>
1382 <ul>
1383 <?php
1385 $jid++;
1386 $modid = $modulerow['mod_id'];
1387 genMiscLink('RTop','adm','0',xlt($mod_nick_name),$relative_link);
1389 echo "</ul>";
1390 } ?>
1392 <?php if (acl_check('patients', 'demo') || acl_check('patients', 'med') ||
1393 (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions'])) { ?>
1394 <li><a class="collapsed_lv2"><span><?php xl('Clients','e') ?></span></a>
1395 <ul>
1396 <?php if (acl_check('patients', 'demo'))
1397 genMiscLink('RTop','rep','0',xl('List'),'reports/patient_list.php'); ?>
1398 <?php if (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions'])
1399 genMiscLink('RTop','rep','0',xl('Rx'),'reports/prescriptions_report.php'); ?>
1400 <?php if (acl_check('patients', 'med'))
1401 genMiscLink('RTop','rep','0',xl('Patient List Creation'),'reports/patient_list_creation.php'); ?>
1402 <?php if (acl_check('patients', 'med'))
1403 genMiscLink('RTop','rep','0',xl('Clinical'),'reports/clinical_reports.php'); ?>
1404 <?php if (acl_check('patients', 'med'))
1405 genMiscLink('RTop','rep','0',xl('Referrals'),'reports/referrals_report.php'); ?>
1406 <?php if (acl_check('patients', 'med'))
1407 genMiscLink('RTop','rep','0',xl('Immunization Registry'),'reports/immunization_report.php'); ?>
1408 </ul>
1409 </li>
1410 <?php } ?>
1412 <?php if (acl_check('patients', 'med')) { ?>
1413 <li><a class="collapsed_lv2"><span><?php xl('Clinic','e') ?></span></a>
1414 <ul>
1415 <?php if (($GLOBALS['enable_cdr'] || $GLOBALS['enable_cqm'] || $GLOBALS['enable_amc']) && acl_check('patients', 'med'))
1416 genMiscLink('RTop','rep','0',xl('Report Results'),'reports/report_results.php'); ?>
1417 <?php if ($GLOBALS['enable_cdr'] && acl_check('patients', 'med'))
1418 genMiscLink('RTop','rep','0',xl('Standard Measures'),'reports/cqm.php?type=standard'); ?>
1419 <?php if ($GLOBALS['enable_cqm'] && acl_check('patients', 'med'))
1420 genMiscLink('RTop','rep','0',xl('Quality Measures (CQM)'),'reports/cqm.php?type=cqm'); ?>
1421 <?php if ($GLOBALS['enable_amc'] && acl_check('patients', 'med'))
1422 genMiscLink('RTop','rep','0',xl('Automated Measures (AMC)'),'reports/cqm.php?type=amc'); ?>
1423 <?php if ($GLOBALS['enable_amc_tracking'] && acl_check('patients', 'med'))
1424 genMiscLink('RTop','rep','0',xl('AMC Tracking'),'reports/amc_tracking.php'); ?>
1425 <?php if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_alert_log'] && acl_check('patients', 'med'))
1426 genMiscLink('RTop','rep','0',xl('Alerts Log'),'reports/cdr_log.php'); ?>
1427 </ul>
1428 </li>
1429 <?php } ?>
1431 <li><a class="collapsed_lv2"><span><?php xl('Visits','e') ?></span></a>
1432 <ul>
1433 <?php if (acl_check('acct', 'rep_a'))
1434 genMiscLink('RTop','rep','0',xl('Daily Report'),'reports/daily_summary_report.php'); ?>
1435 <?php if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt'))
1436 genMiscLink('RTop','rep','0',xl('Appointments'),'reports/appointments_report.php'); ?>
1437 <?php if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt'))
1438 genMiscLink('RTop','rep','0',xl('Patient Flow Board'),'reports/patient_flow_board_report.php'); ?>
1439 <?php if (acl_check('encounters', 'coding_a'))
1440 genMiscLink('RTop','rep','0',xl('Encounters'),'reports/encounters_report.php'); ?>
1441 <?php if (!$GLOBALS['disable_calendar'] && acl_check('acct', 'rep_a'))
1442 genMiscLink('RTop','rep','0',xl('Appt-Enc'),'reports/appt_encounter_report.php'); ?>
1443 <?php if (empty($GLOBALS['code_types']['IPPF']) && acl_check('encounters', 'coding_a'))
1444 genMiscLink('RTop','rep','0',xl('Superbill'),'reports/custom_report_range.php'); ?>
1445 <?php if (acl_check('patients', 'demo'))
1446 genMiscLink('RTop','rep','0',xl('Eligibility'),'reports/edi_270.php'); ?>
1447 <?php if (acl_check('patients', 'demo'))
1448 genMiscLink('RTop','rep','0',xl('Eligibility Response'),'reports/edi_271.php'); ?>
1449 <?php if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt'))
1450 genMiscLink('RTop','rep','0',xl('Chart Activity'),'reports/chart_location_activity.php'); ?>
1451 <?php if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt'))
1452 genMiscLink('RTop','rep','0',xl('Charts Out'),'reports/charts_checked_out.php'); ?>
1453 <?php genMiscLink('RTop','rep','0',xl('Services'), 'reports/services_by_category.php'); ?>
1454 <?php if (acl_check('patients', 'med'))
1455 genMiscLink('RTop','rep','0',xl('Syndromic Surveillance'),'reports/non_reported.php'); ?>
1456 </ul>
1457 </li>
1459 <?php if (acl_check('acct', 'rep_a')) { ?>
1460 <li><a class="collapsed_lv2"><span><?php xl('Financial','e') ?></span></a>
1461 <ul>
1462 <?php genMiscLink('RTop','rep','0',xl('Sales'),'reports/sales_by_item.php'); ?>
1463 <?php genMiscLink('RTop','rep','0',xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?>
1464 <?php genMiscLink('RTop','rep','0',xl('Front Rec'), 'reports/front_receipts_report.php'); ?>
1465 <?php genMiscLink('RTop','rep','0',xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?>
1466 <?php genMiscLink('RTop','rep','0',xl('Collections'), 'reports/collections_report.php'); ?>
1467 <?php genMiscLink('RTop','rep','0',xl('Pat Ledger'),'reports/pat_ledger.php?form=0'); ?>
1468 <?php genMiscLink('RTop','rep','0',xl('Financial Summary by Service Code'),'reports/svc_code_financial_report.php'); ?>
1469 </ul>
1470 </li>
1471 <?php } ?>
1473 <?php if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?>
1474 <li><a class="collapsed_lv2"><span><?php xl('Inventory','e') ?></span></a>
1475 <ul>
1476 <?php genMiscLink('RTop','rep','0',xl('List'),'reports/inventory_list.php'); ?>
1477 <?php genMiscLink('RTop','rep','0',xl('Activity'),'reports/inventory_activity.php'); ?>
1478 <?php genMiscLink('RTop','rep','0',xl('Transactions'),'reports/inventory_transactions.php'); ?>
1479 </ul>
1480 </li>
1481 <?php } ?>
1483 <?php if (acl_check('patients', 'lab')) { ?>
1484 <li><a class="collapsed_lv2"><span><?php xl('Procedures','e') ?></span></a>
1485 <ul>
1486 <?php genPopLink(xl('Pending Res'),'../orders/pending_orders.php'); ?>
1487 <?php if (!empty($GLOBALS['code_types']['IPPF'])) genPopLink(xl('Pending F/U'),'../orders/pending_followup.php'); ?>
1488 <?php genPopLink(xl('Statistics'),'../orders/procedure_stats.php'); ?>
1489 </ul>
1490 </li>
1491 <?php } ?>
1493 <?php if (!$GLOBALS['simplified_demographics'] && (acl_check('acct', 'rep_a') || acl_check('patients', 'demo'))) { ?>
1494 <li><a class="collapsed_lv2"><span><?php xl('Insurance','e') ?></span></a>
1495 <ul>
1496 <?php if (acl_check('acct', 'rep_a'))
1497 genMiscLink('RTop','rep','0',xl('Distribution'),'reports/insurance_allocation_report.php'); ?>
1498 <?php if (acl_check('acct', 'rep_a'))
1499 genMiscLink('RTop','rep','0',xl('Indigents'),'billing/indigent_patients_report.php'); ?>
1500 <?php if (acl_check('patients', 'demo'))
1501 genMiscLink('RTop','rep','0',xl('Unique SP'),'reports/unique_seen_patients_report.php'); ?>
1502 </ul>
1503 </li>
1504 <?php } ?>
1506 <?php if (!empty($GLOBALS['code_types']['IPPF']) && acl_check('acct', 'rep_a')) { ?>
1507 <li><a class="collapsed_lv2"><span><?php xl('Statistics','e') ?></span></a>
1508 <ul>
1509 <?php genPopLink(xl('IPPF Stats'),'ippf_statistics.php?t=i'); ?>
1510 <?php genPopLink(xl('GCAC Stats'),'ippf_statistics.php?t=g'); ?>
1511 <?php genPopLink(xl('MA Stats'),'ippf_statistics.php?t=m'); ?>
1512 <?php genPopLink(xl('CYP'),'ippf_cyp_report.php'); ?>
1513 <?php genPopLink(xl('Daily Record'),'ippf_daily.php'); ?>
1514 </ul>
1515 </li>
1516 <?php } // end ippf-specific ?>
1518 <li><a class="collapsed_lv2"><span><?php xl('Blank Forms','e') ?></span></a>
1519 <ul>
1520 <?php genPopLink(xl('Demographics'),'../patient_file/summary/demographics_print.php'); ?>
1521 <?php genPopLink(xl('Superbill/Fee Sheet'),'../patient_file/printed_fee_sheet.php'); ?>
1522 <?php genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php'); ?>
1523 <?php
1524 $lres = sqlStatement("SELECT * FROM list_options " .
1525 "WHERE list_id = 'lbfnames' AND activity = 1 ORDER BY seq, title");
1526 while ($lrow = sqlFetchArray($lres)) {
1527 $option_id = $lrow['option_id']; // should start with LBF
1528 $title = $lrow['title'];
1529 // Check ACO attribute, if any, of this LBF.
1530 $jobj = json_decode($lrow['notes'], true);
1531 if (!empty($jobj['aco'])) {
1532 $tmp = explode('|', $jobj['aco']);
1533 if (!acl_check($tmp[0], $tmp[1])) continue;
1535 genPopLink($title, "../forms/LBF/printable.php?formname=$option_id");
1538 </ul>
1539 </li>
1541 <?php if (acl_check('admin','batchcom')) { ?>
1542 <li><a class="collapsed_lv2"><span><?php echo xlt('Services') ?></span></a>
1543 <ul>
1544 <?php genMiscLink('RTop','rep','0',xl('Background Services'),'reports/background_services.php'); ?>
1545 <?php genMiscLink('RTop','rep','0',xl('Direct Message Log'),'reports/direct_message_log.php'); ?>
1546 </ul>
1547 </li>
1548 <?php } ?>
1550 </ul>
1551 </li>
1553 <li><a class="collapsed" id="misimg" ><span><?php xl('Miscellaneous','e') ?></span></a>
1554 <ul>
1555 <?php genTreeLink('RTop','ped',xl('Patient Education')); ?>
1556 <?php if (acl_check('encounters','auth'))
1557 genTreeLink('RBot','aun',xl('Authorizations')); ?>
1558 <?php if (acl_check('patients','docs'))
1559 genTreeLink('RTop','fax',xl('Fax/Scan')); ?>
1560 <?php if (acl_check('admin','practice'))
1561 genTreeLink('RTop','adb',xl('Addr Book')); ?>
1562 <?php if (acl_check('admin','practice'))
1563 genTreeLink('RTop','ort',xl('Order Catalog')); ?>
1564 <?php if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients','appt'))
1565 genTreeLink('RTop','cht',xl('Chart Tracker')); ?>
1566 <?php if (acl_check('encounters','notes'))
1567 genTreeLink('RTop','ono',xl('Ofc Notes')); ?>
1568 <?php if (acl_check('admin','batchcom') || acl_check('admin','practice'))
1569 genMiscLink('RTop','adm','0',xl('BatchCom'),'batchcom/batchcom.php'); ?>
1570 <?php $myrow = sqlQuery("SELECT state FROM registry WHERE directory = 'track_anything'");
1571 if($myrow['state']=='1') { genTreeLink('RTop','tan',xl('Configure Tracks')); } ?>
1572 <?php if(!$GLOBALS['use_active_directory']) { genTreeLink('RTop','pwd',xl('Password')); } ?>
1573 <?php genMiscLink('RTop','prf','0',xl('Preferences'),'super/edit_globals.php?mode=user'); ?>
1574 <?php if(acl_check('patients','docs','','write') || acl_check('patients','docs','','addonly'))
1575 genMiscLink('RTop','adm','0',xl('New Documents'),'../controller.php?document&list&patient_id=00'); ?>
1576 <?php if (acl_check('admin','practice'))
1577 genMiscLink('RTop','adm','0',xl('Document Templates'),'super/manage_document_templates.php'); ?>
1578 </ul>
1579 </li>
1581 </ul>
1583 <br /><hr />
1585 <div id='current_patient' style = 'display:none'>
1586 <b><?php xl('None','e'); ?></b>
1587 </div>
1589 <div id='current_encounter' style = 'display:none'>
1590 <b><?php xl('None','e'); ?></b>
1591 </div>
1592 <?php
1593 genPopupsList();
1594 echo "<hr />\n";
1595 genFindBlock();
1596 echo "<hr />\n";
1599 <input type='hidden' name='findBy' value='Last' />
1600 <input type="hidden" name="searchFields" id="searchFields"/>
1601 <input type="hidden" name="search_service_code" value='' />
1603 </form>
1605 <script language='JavaScript'>
1606 syncRadios();
1608 function save_setting (cb_frames) {
1609 for (var i = 0, len = cb_frames.length; i < len; i++) {
1610 try {
1611 var fref = '<?php echo $uspfx ?>frame' + i + '_chk';
1612 var ureq = $.post( "<?php echo $GLOBALS['webroot'] ?>/library/ajax/user_settings.php",
1613 { lab: fref, val: cb_frames[i] })
1614 .done(function(data) {
1615 // alert( "Data Loaded: " + data );
1617 .fail(function(xhr, textStatus, errorThrown) {
1618 alert("Error:"+xhr.responseText+"\n"+textStatus+"\n"+errorThrown);
1620 .always(function() {
1621 // alert( "finished" );
1624 } catch (err) {
1625 alert (err.message);
1629 </script>
1631 </body>
1632 </html>