4 /* Copyright (C) 2006-2012 Rod Roark <rod@sunsetsystems.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
12 // This provides the left navigation frame.
13 // Following are notes as to what else was changed for this feature:
15 // * interface/main/main_screen.php: the top-level frameset.
16 // * interface/main/finder/patient_select.php: loads stuff when a new patient
18 // * interface/patient_file/summary/demographics.php: this is the first frame
19 // loaded when a new patient is chosen, and in turn sets the current pid and
20 // then loads the initial bottom frame.
21 // * interface/patient_file/summary/demographics_full.php: added support for
22 // setting a new pid, needed for going to demographics from billing.
23 // * interface/patient_file/summary/demographics_save.php: redisplay
24 // demographics.php and not the frameset.
25 // * interface/patient_file/summary/summary_bottom.php: new frameset for the
26 // summary, prescriptions and notes for a selected patient, cloned from
27 // patient_summary.php.
28 // * interface/patient_file/encounter/encounter_bottom.php: new frameset for
29 // the selected encounter, mosting coding/billing stuff, cloned from
30 // patient_encounter.php. This will also self-load the superbill pages
32 // * interface/usergroup/user_info.php: removed Back link.
33 // * interface/usergroup/admin_frameset.php: new frameset for Admin pages,
34 // cloned from usergroup.php.
35 // * interface/main/onotes/office_comments.php: removed Back link target.
36 // * interface/main/onotes/office_comments_full.php: changed Back link.
37 // * interface/billing/billing_report.php: removed Back link; added logic
38 // to properly go to demographics or to an encounter when requested.
39 // * interface/new/new.php: removed Back link and revised form target.
40 // * interface/new/new_patient_save.php: modified to load the demographics
41 // page to the current frame instead of loading a new frameset.
42 // * interface/patient_file/history/history.php: target change.
43 // * interface/patient_file/history/history_full.php: target changes.
44 // * interface/patient_file/history/history_save.php: target change.
45 // * interface/patient_file/history/encounters.php: link/target changes.
46 // * interface/patient_file/encounter/encounter_top.php: another new frameset
47 // cloned from patient_encounter.php.
48 // * interface/patient_file/encounter/forms.php: link target removal.
49 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
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
59 // * interface/patient_file/encounter/superbill_custom_full.php: target and
61 // * interface/patient_file/encounter/diagnosis.php: target changes.
62 // * interface/patient_file/encounter/diagnosis_full.php: target and link
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['fileroot']."/library/registry.inc");
94 require_once $GLOBALS['srcdir'].'/ESign/Api.php';
95 require_once $GLOBALS['srcdir'].'/user.inc';
97 // Fetch user preferences saved from prior session
98 $uspfx = substr(__FILE__
, strlen($GLOBALS['fileroot']."/")) . '.';
99 $cb_top_chk = prevSetting($uspfx, 'cb_top', 'frame0_chk', 'checked');
100 $cb_bot_chk = prevSetting($uspfx, 'cb_bot', 'frame1_chk', 'checked');
101 $usrval = json_encode(array ( $cb_top_chk, $cb_bot_chk ));
103 // This array defines the list of primary documents that may be
104 // chosen. Each element value is an array of 3 values:
106 // * Name to appear in the navigation table
107 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific, 3 = therapy group-specific, 4 = therapy group encounter - specific
108 // * The URL relative to the interface directory
111 $primary_docs = array(
112 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
113 'pfb' => array(xl('Patient Flow Board') , 0, '../interface/patient_tracker/patient_tracker.php?skip_timeout_reset=1'),
114 'rcb' => array(xl('Recall Board') , 0, '../interface/main/messages/messages.php?go=Recalls'),
115 'app' => array(xl('Portal Activity') , 0, '../myportal/index.php'),
116 'aop' => array(xl('Portal Dashboard') , 0, '../portal/patient/provider'),
117 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php?form_active=1'),
118 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
119 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
120 'adm' => array(xl('Admin') , 0, 'usergroup/admin_frameset.php'),
121 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
122 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
123 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
124 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
125 'orl' => array(xl('Proc Prov') , 0, 'orders/procedure_provider_list.php'),
126 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
127 'orc' => array(xl('Proc Load') , 0, 'orders/load_compendium.php'),
128 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
129 'ore' => array(xl('E-Reports') , 0, 'orders/list_reports.php'),
130 'ppo' => array(xl('CMS Portal'), 0, 'cmsportal/list_requests.php'),
131 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
132 'imp' => array(xl('Import') , 0, '../custom/import.php'),
133 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
134 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
135 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
136 'new' => array(xl('New Pt') , 0, 'new/new.php'),
137 'ped' => array(xl('Patient Education'), 0, 'reports/patient_edu_web_lookup.php'),
138 'lab' => array(xl('Check Lab Results') , 0, 'orders/lab_exchange.php'),
139 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
140 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
141 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
142 'nen' => array(xl('Create Visit'), 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
143 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
144 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
145 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
146 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
147 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
148 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
149 'lda' => array(xl('Lab overview') , 1, 'patient_file/summary/labdata.php'),
150 'tan' => array(xl('Configure Tracks') , 0, 'forms/track_anything/create.php'),
151 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
152 'prq' => array(xl('Pt Rec Request') , 1, 'patient_file/transaction/record_request.php'),
153 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
154 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
155 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
156 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
157 'erx' => array(xl('e-Rx') , 1, 'eRx.php'),
158 'err' => array(xl('e-Rx Renewal') , 1, 'eRx.php?page=status'),
159 'ere' => array(xl('e-Rx EPCS') , 1, 'eRx.php?page=epcs-admin'),
160 'pay' => array(xl('Payment') , 1, '../patient_file/front_payment.php'),
161 'edi' => array(xl('EDI History') , 0, 'billing/edih_view.php'),
162 'eob' => array(xl('Posting') , 0, 'billing/sl_eob_search.php'),
163 'dld' => array(xl('Display Documents'), 0, 'main/display_documents.php')
165 $disallowed = array();
168 $primary_docs['npa']=array(xl('Batch Payments') , 0, 'billing/new_payment.php');
169 if ($GLOBALS['use_charges_panel'] ||
$GLOBALS['menu_styling_vertical'] == 0) {
170 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
173 if ($GLOBALS['enable_group_therapy']) {
174 $disallowed['gng'] = !acl_check("groups", "gadd");
175 $disallowed['gdg'] = !acl_check("groups", "gadd");
176 $disallowed['gcv'] = !acl_check("groups", "gcalendar");
177 $disallowed['gce'] = !acl_check("groups", "glog");
178 $disallowed['gvh'] = !acl_check("groups", "glog");
180 $primary_docs['gng'] = array(xl('New') , 0, 'therapy_groups/index.php?method=addGroup');
181 $primary_docs['gdg'] = array(xl('Group Details') , 3, '/therapy_groups/index.php?method=groupDetails&group_id=from_session');
182 $primary_docs['gcv'] = array(xl('Create Visit'), 3, 'forms/newGroupEncounter/new.php?autoloaded=1&calenc=');
183 $primary_docs['gce'] = array(xl('Current') , 4, 'patient_file/encounter/encounter_top.php');
184 $primary_docs['gvh'] = array(xl('Visit History'), 3, 'patient_file/history/encounters.php');
188 $esignApi = new Api();
189 // This section decides which navigation items will not appear.
192 $disallowed['edi'] = !($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob'));
193 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
194 acl_check('admin', 'database') ||
acl_check('admin', 'forms') ||
195 acl_check('admin', 'practice') ||
acl_check('admin', 'users') ||
196 acl_check('admin', 'acl') ||
acl_check('admin', 'super') ||
197 acl_check('admin', 'superbill') ||
acl_check('admin', 'drugs'));
199 $disallowed['bil'] = !(acl_check('acct', 'eob') ||
acl_check('acct', 'bill'));
201 $disallowed['new'] = !(acl_check('patients', 'demo', '', array('write','addonly')));
203 $disallowed['fax'] = !(($GLOBALS['enable_hylafax'] ||
$GLOBALS['enable_scanner']) && acl_check('patients', 'docs'));
205 $disallowed['iss'] = !((acl_check('encounters', 'notes', '', 'write') ||
206 acl_check('encounters', 'notes_a', '', 'write') ) &&
207 acl_check('patients', 'med', '', 'write') );
209 $disallowed['imp'] = $disallowed['new'] ||
!is_readable("$webserver_root/custom/import.php");
211 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
213 $disallowed['pre'] = !(acl_check('patients', 'med'));
214 $disallowed['eob'] = !(acl_check('acct', 'eob'));
216 // Helper functions for treeview generation.
217 function genTreeLink($frame, $name, $title, $mono = false)
219 global $primary_docs, $disallowed;
220 if (empty($disallowed[$name])) {
221 $id = $name . $primary_docs[$name][1];
222 echo "<li><a href='' id='$id' onclick=\"";
224 if ($frame == 'RTop') {
225 echo "forceSpec(true,false);";
227 echo "forceSpec(false,true);";
231 echo "return loadFrame2('$id','$frame','" .
232 $primary_docs[$name][2] . "')\">" . $title . ($name == 'msg' ?
' <span id="reminderCountSpan" class="bold"></span>' : '')."</a></li>";
236 function genMiscLink($frame, $name, $level, $title, $url, $mono = false, $encform = false)
239 if (empty($disallowed[$name])) {
240 $id = $name . $level;
241 echo "<li><a href='' id='$id' onclick=\"";
243 if ($frame == 'RTop') {
244 echo "forceSpec(true,false);";
246 echo "forceSpec(false,true);";
250 // In this case $url is an encounter form name, not a URL.
251 echo "loadNewForm('" . addslashes(trim($url)) . "', '" . addslashes(trim($title)) . "');";
253 echo "loadFrame2('$id','$frame','" . $url . "');";
255 echo "return false;\">" . text($title) . "</a></li>";
259 function genMiscLink2($frame, $name, $level, $title, $url, $mono = false, $mouseovertext = "")
262 if (empty($disallowed[$name])) {
263 $id = $name . $level;
264 echo "<li><a href='' id='$id' title='$mouseovertext' onclick=\"";
266 if ($frame == 'RTop') {
267 echo "forceSpec(true,false);";
269 echo "forceSpec(false,true);";
273 echo "return loadFrame3('$id','$frame','" .
274 $url . "')\">" . $title . "</a></li>";
277 function genPopLink($title, $url, $linkid = '')
279 echo "<li><a href='' ";
281 echo "id='$linkid' ";
284 echo "onclick=\"return repPopup('$url')\"" .
285 ">" . $title . "</a></li>";
287 function genDualLink($topname, $botname, $title)
289 global $primary_docs, $disallowed;
290 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
291 $topid = $topname . $primary_docs[$topname][1];
292 $botid = $botname . $primary_docs[$botname][1];
293 echo "<li><a href='' id='$topid' " .
294 "onclick=\"return loadFrameDual('$topid','$botid','" .
295 $primary_docs[$topname][2] . "','" .
296 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
300 function genPopupsList($style = '')
302 global $disallowed, $webserver_root;
304 <select name
='popups' onchange
='selpopup(this)' style
='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
305 <option value
=''><?php
xl('Popups', 'e'); ?
></option
>
306 <?php
if (!$disallowed['iss']) { ?
>
307 <option value
='../patient_file/problem_encounter.php'><?php
xl('Issues', 'e'); ?
></option
>
309 <?php
if (!$GLOBALS['ippf_specific'] && acl_check('patients', 'demo')) { ?
>
310 <option value
='../../custom/export_xml.php'><?php
xl('Export', 'e'); ?
></option
>
311 <?php
if (acl_check('patients', 'demo', '', 'write')) { ?
>
312 <option value
='../../custom/import_xml.php'><?php
xl('Import', 'e'); ?
></option
>
316 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) { ?
>
317 <option value
='../reports/appointments_report.php?patient=<?php if (isset($pid)) {
319 } ?>'><?php
xl('Appts', 'e'); ?
></option
>
321 <?php
if (acl_check('patients', 'med')) { ?
>
322 <option value
='../patient_file/printed_fee_sheet.php?fill=1'><?php
xl('Superbill', 'e'); ?
></option
>
324 <?php
if (acl_check('acct', 'bill', '', 'write')) { ?
>
325 <option value
='../patient_file/front_payment.php'><?php
xl('Payment', 'e'); ?
></option
>
327 <?php
if ($GLOBALS['inhouse_pharmacy'] && acl_check('acct', 'bill', '', 'write')) { ?
>
328 <option value
='../patient_file/pos_checkout.php'><?php
xl('Checkout', 'e'); ?
></option
>
330 <?php
if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates") && acl_check('patients', 'med')) { ?
>
331 <option value
='../patient_file/letter.php'><?php
xl('Letter', 'e'); ?
></option
>
333 <?php
if ($GLOBALS['chart_label_type'] != '0' && acl_check('patients', 'demo')) { ?
>
334 <option value
='../patient_file/label.php'><?php
xl('Chart Label', 'e'); ?
></option
>
336 <?php
if ($GLOBALS['barcode_label_type'] != '0' && acl_check('patients', 'demo')) { ?
>
337 <option value
='../patient_file/barcode_label.php'><?php
xl('Barcode Label', 'e'); ?
></option
>
339 <?php
if ($GLOBALS['addr_label_type'] && acl_check('patients', 'demo')) { ?
>
340 <option value
='../patient_file/addr_label.php'><?php
xl('Address Label', 'e'); ?
></option
>
346 function genFindBlock()
349 <table cellpadding
='0' cellspacing
='0' border
='0'>
351 <td
class='smalltext'><?php
xl('Find', 'e') ?
>: 
;</td
>
352 <td
class='smalltext' colspan
='2'>
353 <input type
="entry" size
="7" name
="patient" class='inputtext' style
='width:65px;' />
357 <td
class='smalltext'><?php
xl('by', 'e') ?
>:</td
>
358 <td
class='smalltext'>
359 <a href
="javascript:findPatient('Last');" class="navitem"><?php
xl('Name', 'e'); ?
></a
>
361 <td
class='smalltext' align
='right'>
362 <a href
="javascript:findPatient('ID');" class="navitem"><?php
xl('ID', 'e'); ?
></a
>
366 <td
class='smalltext'> 
;</td
>
367 <td
class='smalltext'>
368 <a href
="javascript:findPatient('SSN');" class="navitem"><?php
xl('SSN', 'e'); ?
></a
>
370 <td
class='smalltext' align
='right'>
371 <a href
="javascript:findPatient('DOB');" class="navitem"><?php
xl('DOB', 'e'); ?
></a
>
375 <td
class='smalltext'> 
;</td
>
376 <td
class='smalltext'>
377 <a href
="javascript:findPatient('Any');" class="navitem"><?php
xl('Any', 'e'); ?
></a
>
379 <td
class='smalltext' align
='right'>
380 <a href
="javascript:initFilter();" class="navitem"><?php
xl('Filter', 'e'); ?
></a
>
385 } // End function genFindBlock()
390 <title
>Navigation
</title
>
391 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/bootstrap-3-3-4/dist/css/bootstrap.min.css">
392 <?php
if ($_SESSION['language_direction'] == 'rtl') { ?
>
393 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative'] ?>/bootstrap-rtl-3-3-4/dist/css/bootstrap-rtl.min.css">
395 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
396 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative'];?>/font-awesome-4-6-3/css/font-awesome.css" type
="text/css">
397 <style type
="text/css">
404 padding
: 5px
3px
5px
3px
;
407 font
-family
:sans
-serif
;
411 a
.navitem
, a
.navitem
:visited
{
413 font
-family
:sans
-serif
;
424 border
-color
: #000000;
425 background
-color
:transparent
;
429 background
-color
:transparent
;
431 #navigation-slide ul {
432 background
-color
:transparent
;
442 vertical
-align
:middle
;
445 <link rel
="stylesheet" href
="../../library/js/jquery.treeview-1.4.1/jquery.treeview.css" />
446 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-9-1/index.js"></script
>
447 <script src
="<?php echo $GLOBALS['assets_static_relative']; ?>/bootstrap-3-3-4/dist/js/bootstrap.min.js" type
="text/javascript"></script
>
448 <script type
="text/javascript" src
="../../library/js/jquery.treeview-1.4.1/jquery.treeview.js" ></script
>
450 <script type
="text/javascript" src
="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
452 <script language
='JavaScript'>
454 var usrval
= jQuery
.parseJSON('<?php echo $usrval ?>');
456 // tajemo work by CB 2012/01/31 12:32:57 PM dated reminders counter
457 function getReminderCount(){
458 top
.restoreSession();
459 // Send the skip_timeout_reset parameter to not count this as a manual entry in the
460 // timing out mechanism in OpenEMR.
461 $
.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/dated_reminders_counter.php",
462 { skip_timeout_reset
: "1" },
464 $
("#reminderCountSpan").html(data
);
465 // run updater every 60 seconds
466 var repeater
= setTimeout("getReminderCount()", 60000);
468 //piggy-back on this repeater to run other background-services
469 //this is a silent task manager that returns no output
470 $
.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/execute_background_services.php",
471 { skip_timeout_reset
: "1", ajax
: "1" });
474 $
(document
).ready(function (){
475 getReminderCount();//
476 parent
.loadedFrameCount +
= 1;
477 for (var i
= 0, len
= usrval
.length
; i
< len
; i++
) {
478 if (usrval
[i
] != "checked") toggleFrame(i+
1);
481 // end of tajemo work dated reminders counter
483 // Master values for current pid and encounter.
485 var active_encounter
= 0;
486 var encounter_locked
= false;
490 // Current selections in the top and bottom frames.
494 // Expand and/or collapse frames in response to checkbox clicks.
495 // fnum indicates which checkbox was clicked (1=left, 2=right).
496 function toggleFrame(fnum
) {
497 var f
= document
.forms
[0];
498 var fset
= top
.document
.getElementById('fsright');
499 if (!f
.cb_top
.checked
&& !f
.cb_bot
.checked
) {
500 if (fnum
== 1) f
.cb_bot
.checked
= true;
501 else f
.cb_top
.checked
= true;
503 var rows
= f
.cb_top
.checked ?
'*' : '0';
504 rows +
= f
.cb_bot
.checked ?
',*' : ',0';
506 save_setting ([(f
.cb_top
.checked ?
'checked' : ' '), (f
.cb_bot
.checked ?
'checked' : ' ')]);
509 // Load the specified url into the specified frame (RTop or RBot).
510 // The URL provided must be relative to interface.
511 function loadFrame(fname
, frame
, url
) {
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 top
.frames
[frame
].location
= '<?php echo "$web_root/interface/" ?>' + url
;
516 if (frame
== 'RTop') topName
= fname
; else botName
= fname
;
519 // Load the specified url into a frame to be determined, with the specified
520 // frame as the default; the url must be relative to interface.
521 function loadFrame2(fname
, frame
, url
) {
522 var usage
= fname
.substring(3);
523 if (active_pid
== 0 && active_gid
== 0 && (usage
> '0' && usage
< '5')){
524 <?php
if ($GLOBALS['enable_group_therapy']) { ?
>
525 alert('<?php xl('You must first select
or add a patient
or therapy group
.', 'e
') ?>');
527 alert('<?php xl('You must first select
or add a patient
.', 'e
') ?>');
531 if (active_encounter
== 0 && (usage
> '1' && usage
< '3')) {
532 alert('<?php xl('You must first select
or create an encounter
.', 'e
') ?>');
535 if (encounter_locked
&& usage
> '1' && (usage
> '1' && usage
< '3')) {
536 alert('<?php echo xls('This encounter is locked
. No
new forms can be added
.') ?>');
539 var f
= document
.forms
[0];
540 top
.restoreSession();
541 var i
= url
.indexOf('{PID}');
542 if (i
>= 0) url
= url
.substring(0,i
) + active_pid + url
.substring(i+
5);
545 var fi
= f
.sel_frame
.selectedIndex
;
546 if (fi
== 1) frame
= 'RTop'; else if (fi
== 2) frame
= 'RBot';
548 if (!f
.cb_bot
.checked
) frame
= 'RTop'; else if (!f
.cb_top
.checked
) frame
= 'RBot';
549 top
.frames
[frame
].location
= '<?php echo "$web_root/interface/" ?>' + url
;
550 if (frame
== 'RTop') topName
= fname
; else botName
= fname
;
554 function loadFrame3(fname
, frame
, url
) {
555 var f
= document
.forms
[0];
556 top
.restoreSession();
557 var i
= url
.indexOf('{PID}');
558 if (i
>= 0) url
= url
.substring(0,i
) + active_pid + url
.substring(i+
5);
561 var fi
= f
.sel_frame
.selectedIndex
;
562 if (fi
== 1) frame
= 'RTop'; else if (fi
== 2) frame
= 'RBot';
564 if (!f
.cb_bot
.checked
) frame
= 'RTop'; else if (!f
.cb_top
.checked
) frame
= 'RBot';
565 top
.frames
[frame
].location
= '<?php echo "$web_root/interface/" ?>' + url
;
566 if (frame
== 'RTop') topName
= fname
; else botName
= fname
;
570 // Special handling to load a new encounter form into an existing encounter.
571 function loadNewForm(formname
, formdesc
) {
572 var url
= '<?php echo "$rootdir/patient_file/encounter/load_form.php?formname=" ?>' + formname
;
573 if (parent
.RBot
.twAddFrameTab
) {
574 parent
.RBot
.twAddFrameTab('enctabs', formdesc
, url
);
576 else if (parent
.RTop
.twAddFrameTab
) {
577 parent
.RTop
.twAddFrameTab('enctabs', formdesc
, url
);
580 loadFrame2('enc2','RBot','patient_file/encounter/encounter_top.php' +
581 '?formname=' + formname +
'&formdesc=' + formdesc
);
585 // Make sure the the top and bottom frames are open or closed, as specified.
586 function forceSpec(istop
, isbot
) {
587 var f
= document
.forms
[0];
588 if (f
.cb_top
.checked
!= istop
) {
589 f
.cb_top
.checked
= istop
;
592 if (f
.cb_bot
.checked
!= isbot
) {
593 f
.cb_bot
.checked
= isbot
;
598 // Make sure both frames are open.
599 function forceDual() {
600 forceSpec(true, true);
603 // Load the specified url into a frame to be determined, with the specified
604 // frame as the default; the url must be relative to interface.
605 function loadFrameDual(tname
, bname
, topurl
, boturl
) {
606 var topusage
= tname
.substring(3);
607 var botusage
= bname
.substring(3);
608 if (active_pid
== 0 && (topusage
> '0' || botusage
> '0')) {
609 alert('<?php xl('You must first select
or add a patient
.', 'e
') ?>');
612 if (active_encounter
== 0 && (topusage
> '1' || botusage
> '1')) {
613 alert('<?php xl('You must first select
or create an encounter
.', 'e
') ?>');
616 if (encounter_locked
&& (topusage
> '1' || botusage
> '1')) {
617 alert('<?php echo xls('This encounter is locked
. No
new forms can be added
.') ?>');
620 var f
= document
.forms
[0];
622 top
.restoreSession();
623 var i
= topurl
.indexOf('{PID}');
624 if (i
>= 0) topurl
= topurl
.substring(0,i
) + active_pid + topurl
.substring(i+
5);
625 i
= boturl
.indexOf('{PID}');
626 if (i
>= 0) boturl
= boturl
.substring(0,i
) + active_pid + boturl
.substring(i+
5);
627 top
.frames
.RTop
.location
= '<?php echo "$web_root/interface/" ?>' + topurl
;
628 top
.frames
.RBot
.location
= '<?php echo "$web_root/interface/" ?>' + boturl
;
634 // Set disabled/enabled state of radio buttons and associated labels
635 // depending on whether there is an active patient or encounter.
636 function syncRadios() {
637 var f
= document
.forms
[0];
638 encounter_locked
= isEncounterLocked(active_encounter
);
639 var nlinks
= document
.links
.length
;
640 for (var i
= 0; i
< nlinks
; ++i
) {
641 var lnk
= document
.links
[i
];
642 if (lnk
.id
.length
!= 4) continue;
643 var usage
= lnk
.id
.substring(3);
644 if (usage
== '1' || usage
== '2') {
646 if (active_pid
== 0) da
= true;
647 if (active_encounter
== 0 && usage
> '1') da
= true;
648 if (encounter_locked
&& usage
> '1') da
= true;
650 if ($GLOBALS['menu_styling_vertical'] == 0) {
651 $color = "'#0000ff'";
652 } else { // ($GLOBALS['menu_styling_vertical'] == 1)
653 $color = "'#000000'";
656 lnk
.style
.color
= da ?
'#888888' : <?php
echo $color; ?
>;
658 //for therapy groups menu
659 <?php
if ($GLOBALS['enable_group_therapy']) { ?
>
660 if (usage
== '3' || usage
== '4') {
662 if (active_gid
== 0) da
= true;
663 if (active_encounter
== 0 && usage
> '3') da
= true;
664 if (encounter_locked
&& usage
> '3') da
= true;
666 if ($GLOBALS['menu_styling_vertical'] == 0) {
667 $color = "'#0000ff'";
668 } else { // ($GLOBALS['menu_styling_vertical'] == 1)
669 $color = "'#000000'";
672 lnk
.style
.color
= da ?
'#888888' : <?php
echo $color; ?
>;
677 f
.popups
.disabled
= (active_pid
== 0);
681 top
.frames
['RTop'].location
='<?php echo $GLOBALS['default_top_pane
']?>';
682 top
.frames
['RBot'].location
='messages/messages.php?form_active=1';
685 //Function to clear active patient and encounter in the server side
686 function clearactive() {
687 top
.restoreSession();
688 //Ajax call to clear active patient in session
689 var method
= (active_pid
> 0) ?
'unset_pid' : 'unset_gid';
692 url
: "<?php echo $GLOBALS['webroot'] ?>/library/ajax/unset_session_ajax.php",
693 data
: { func
: method
},
694 success
:function( msg
) {
697 top
.frames
['RTop'].location
='<?php echo $GLOBALS['default_top_pane
']?>';
698 top
.frames
['RBot'].location
='messages/messages.php?form_active=1';
702 $
(parent
.Title
.document
.getElementById('clear_active')).hide();
703 $
(parent
.Title
.document
.getElementById('clear_active_group')).hide();
705 // Reference to the search.php window.
708 // Open the search.php window.
709 function initFilter() {
710 my_window
= window
.open("../../custom/search.php", "mywindow","status=1");
713 // This is called by the search.php (Filter) window.
714 function processFilter(fieldString
, serviceCode
) {
715 var f
= document
.forms
[0];
716 document
.getElementById('searchFields').value
= fieldString
;
717 f
.search_service_code
.value
= serviceCode
;
718 findPatient("Filter");
719 f
.search_service_code
.value
= '';
723 // Process the click to find a patient by name, id, ssn or dob.
724 function findPatient(findby
) {
725 var f
= document
.forms
[0];
726 if (! f
.cb_top
.checked
) {
727 f
.cb_top
.checked
= true;
730 f
.findBy
.value
= findby
;
731 top
.restoreSession();
732 document
.find_patient
.submit();
735 // Helper function to set the contents of a div.
736 function setSomeContent(id
, content
, doc
) {
737 if (doc
.getElementById
) {
738 var x
= doc
.getElementById(id
);
740 x
.innerHTML
= content
;
744 x
.innerHTML
= content
;
747 function setDivContent(id
, content
) {
748 setSomeContent(id
, content
, document
);
750 function setTitleContent(id
, content
) {
751 setSomeContent(id
, content
, parent
.Title
.document
);
754 // This is called automatically when a new patient is set, to make sure
755 // there are no patient-specific documents showing stale data. If a frame
756 // was just loaded with data for the correct patient, its name is passed so
757 // that it will not be zapped. At this point the new server-side pid is not
758 // assumed to be set, so this function will only load global data.
759 function reloadPatient(frname
) {
760 var f
= document
.forms
[0];
761 if (topName
.length
> 3 && topName
.substring(3) > '0' && frname
!= 'RTop') {
762 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal
'][2]; ?>');
764 if (botName
.length
> 3 && botName
.substring(3) > '0' && frname
!= 'RBot') {
765 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens
'][2]; ?>');
769 // Reload encounter-specific frames, excluding a specified frame. At this
770 // point the new server-side encounter ID may not be set and loading the same
771 // document for the new encounter will not work, so load patient info instead.
772 function reloadEncounter(frname
) {
773 var f
= document
.forms
[0];
774 if (topName
.length
> 3 && topName
.substring(3) > '1' && frname
!= 'RTop') {
775 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem
'][2]; ?>');
777 if (botName
.length
> 3 && botName
.substring(3) > '1' && frname
!= 'RBot') {
778 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens
'][2]; ?>');
783 // Call this to announce that the patient has changed. You must call this
784 // if you change the session PID, so that the navigation frame will show the
785 // correct patient and so that the other frame will be reloaded if it contains
786 // patient-specific information from the previous patient. frname is the name
787 // of the frame that the call came from, so we know to only reload content
788 // from the *other* frame if it is patient-specific.
789 function setPatient(pname
, pid
, pubpid
, frname
, str_dob
) {
791 var str
= '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid +
'"><b>' + pname +
' (' + pubpid +
')<br /></b></a>';
792 setDivContent('current_patient', str
);
793 setTitleContent('current_patient', str + str_dob
);
794 if (pid
== active_pid
) return;
795 setDivContent('current_encounter', '<b><?php xl('None
', 'e
'); ?></b>');
797 active_encounter
= 0;
798 encounter_locked
= false;
799 if (frname
) reloadPatient(frname
);
801 $
(parent
.Title
.document
.getElementById('current_patient_block')).show();
802 var encounter_block
= $
(parent
.Title
.document
.getElementById('current_encounter_block'));
803 $
(encounter_block
).hide();
805 // zero out the encounter frame, replace it with the encounter list frame
806 var f
= document
.forms
[0];
807 if ( f
.cb_top
.checked
&& f
.cb_bot
.checked
) {
808 var encounter_frame
= getEncounterTargetFrame('enc');
809 if ( encounter_frame
!= undefined
) {
810 loadFrame('ens0',encounter_frame
, '<?php echo $primary_docs['ens
'][2]; ?>');
814 $
(parent
.Title
.document
.getElementById('clear_active')).show();//To display Clear Active Patient button on selecting a patient
815 $
(parent
.Title
.document
.getElementById('clear_active_group')).hide();//To hide Clear Active group button on selecting a patient
819 // Call this to announce that the therapy group has changed. You must call this
820 // if you change the session 'therapy_group', so that the navigation frame will show the
822 function setTherapyGroup(group_id
, group_name
) {
825 $
(parent
.Title
.document
.querySelector('#current_patient_block span.text')).hide();
826 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>' );
827 if (group_id
== active_gid
) return;
828 setDivContent('current_encounter', '<b><?php xl('None
', 'e
'); ?></b>');
829 active_gid
= group_id
;
830 active_encounter
= 0;
831 encounter_locked
= false;
833 $
(parent
.Title
.document
.getElementById('current_patient_block')).show();
834 var encounter_block
= $
(parent
.Title
.document
.getElementById('current_encounter_block'));
835 $
(encounter_block
).hide();
837 // zero out the encounter frame, replace it with the encounter list frame
838 var f
= document
.forms
[0];
839 if ( f
.cb_top
.checked
&& f
.cb_bot
.checked
) {
840 var encounter_frame
= getEncounterTargetFrame('enc');
841 if ( encounter_frame
!= undefined
) {
842 loadFrame('ens0',encounter_frame
, '<?php echo $primary_docs['ens
'][2]; ?>');
846 $
(parent
.Title
.document
.getElementById('clear_active_group')).show();//To display Clear Active group button on selecting a patient
847 $
(parent
.Title
.document
.getElementById('clear_active')).hide();//To hide Clear Active Patient button on selecting a patient
850 function setPatientEncounter(EncounterIdArray
,EncounterDateArray
,CalendarCategoryArray
) {
851 //This function lists all encounters of the patient.
852 //This function writes the drop down in the top frame.
853 //It is called when a new patient is create/selected from the search menu.
854 var str
= '<Select class="text" id="EncounterHistory" onchange="{top.restoreSession();toencounter(this.options[this.selectedIndex].value)}">';
855 str+
='<option value=""><?php echo htmlspecialchars(xl('Encounter History
'), ENT_QUOTES) ?></option>';
856 <?php
if (acl_check_form('newpatient', '', array('write', 'addonly'))) { ?
>
857 str+
='<option value="New Encounter"><?php echo htmlspecialchars(xl('New Encounter
'), ENT_QUOTES) ?></option>';
859 str+
='<option value="Past Encounter List"><?php echo htmlspecialchars(xl('Past Encounter
List'), ENT_QUOTES) ?></option>';
860 for(CountEncounter
=0;CountEncounter
<EncounterDateArray
.length
;CountEncounter++
)
862 str+
='<option value="'+EncounterIdArray
[CountEncounter
]+
'~'+EncounterDateArray
[CountEncounter
]+
'">'+EncounterDateArray
[CountEncounter
]+
'-'+CalendarCategoryArray
[CountEncounter
]+
'</option>';
865 $
(parent
.Title
.document
.getElementById('past_encounter_block')).show();
866 top
.window
.parent
.Title
.document
.getElementById('past_encounter').innerHTML
=str
;
869 function loadCurrentPatientFromTitle() {
870 top
.restoreSession();
871 top
.frames
['RTop'].location
='../patient_file/summary/demographics.php';
874 function loadCurrentGroupFromTitle(gid
) {
875 top
.restoreSession();
876 top
.frames
['RTop'].location
='../therapy_groups/index.php?method=groupDetails&group_id=' + gid
;
879 function getEncounterTargetFrame( name
) {
880 var bias
= <?php
echo $primary_docs[ 'enc' ][ 1 ]?
>;
881 var f
= document
.forms
[0];
883 if (f
.cb_top
.checked
&& f
.cb_bot
.checked
) {
890 if ( f
.cb_top
.checked
) {
892 } else if ( f
.cb_bot
.checked
) {
899 function isEncounterLocked( encounterId
) {
900 <?php
if ($esignApi->lockEncounters()) { ?
>
901 // If encounter locking is enabled, make a syncronous call (async=false) to check the
902 // DB to see if the encounter is locked.
903 // Call restore session, just in case
904 top
.restoreSession();
907 url
: '<?php echo $GLOBALS['webroot
']?>/interface/esign/index.php?module=encounter&method=esign_is_encounter_locked',
908 data
: { encounterId
: encounterId
},
909 success
: function( data
) {
910 encounter_locked
= data
;
915 return encounter_locked
;
917 // If encounter locking isn't enabled, just tell the left_nav that the encounter
923 // Call this to announce that the encounter has changed. You must call this
924 // if you change the session encounter, so that the navigation frame will
925 // show the correct encounter and so that the other frame will be reloaded if
926 // it contains encounter-specific information from the previous encounter.
927 // frname is the name of the frame that the call came from, so we know to only
928 // reload encounter-specific content from the *other* frame.
929 function setEncounter(edate
, eid
, frname
) {
930 if (eid
== active_encounter
) return;
931 if (!eid
) edate
= '<?php xl('None
', 'e
'); ?>';
932 var str
= '<b>' + edate +
'</b>';
933 setDivContent('current_encounter', str
);
934 active_encounter
= eid
;
935 encounter_locked
=isEncounterLocked(active_encounter
);
936 reloadEncounter(frname
);
938 var encounter_block
= $
(parent
.Title
.document
.getElementById('current_encounter_block'));
939 var encounter
= $
(parent
.Title
.document
.getElementById('current_encounter'));
940 var estr
= '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate +
' (' + eid +
')</b></a>';
941 encounter
.html( estr
);
942 encounter_block
.show();
945 function loadCurrentEncounterFromTitle() {
946 top
.restoreSession();
947 top
.frames
[ parent
.left_nav
.getEncounterTargetFrame('enc') ].location
='../patient_file/encounter/encounter_top.php';
950 // You must call this if you delete the active patient (or if for any other
951 // reason you "close" the active patient without opening a new one), so that
952 // the appearance of the navigation frame will be correct and so that any
953 // stale content will be reloaded.
954 function clearPatient() {
955 if (active_pid
== 0) return;
956 var f
= document
.forms
[0];
958 active_encounter
= 0;
959 encounter_locked
= false;
960 setDivContent('current_patient', '<b><?php xl('None
', 'e
'); ?></b>');
961 $
(parent
.Title
.document
.getElementById('current_patient_block')).hide();
962 top
.window
.parent
.Title
.document
.getElementById('past_encounter').innerHTML
='';
963 $
(parent
.Title
.document
.getElementById('current_encounter_block')).hide();
968 // You must call this if you delete the active therapy group so that
969 // the appearance of the navigation frame will be correct and so that any
970 // stale content will be reloaded.
971 function clearTherapyGroup() {
972 if (active_gid
== 0) return;
973 var f
= document
.forms
[0];
975 active_encounter
= 0;
976 encounter_locked
= false;
977 setDivContent('current_patient', '<b><?php xl('None
', 'e
'); ?></b>');
978 $
(parent
.Title
.document
.getElementById('current_patient_block')).hide();
979 top
.window
.parent
.Title
.document
.getElementById('past_encounter').innerHTML
='';
980 $
(parent
.Title
.document
.getElementById('current_encounter_block')).hide();
984 // You must call this if you delete the active encounter (or if for any other
985 // reason you "close" the active encounter without opening a new one), so that
986 // the appearance of the navigation frame will be correct and so that any
987 // stale content will be reloaded.
988 function clearEncounter() {
989 if (active_encounter
== 0) return;
990 top
.window
.parent
.Title
.document
.getElementById('current_encounter').innerHTML
="<b><?php echo htmlspecialchars(xl('None'), ENT_QUOTES) ?></b>";
991 active_encounter
= 0;
992 encounter_locked
= false;
997 function removeOptionSelected(EncounterId
)
998 {//Removes an item from the Encounter drop down.
999 var elSel
= top
.window
.parent
.Title
.document
.getElementById('EncounterHistory');
1001 for (i
= elSel
.length
- 1; i
>=2; i
--) {
1002 EncounterHistoryValue
=elSel
.options
[i
].value
;
1003 EncounterHistoryValueArray
=EncounterHistoryValue
.split('~');
1004 if (EncounterHistoryValueArray
[0]==EncounterId
) {
1010 // You can call this to make sure the session pid is what we expect.
1011 function pidSanityCheck(pid
) {
1012 if (pid
!= active_pid
) {
1013 alert('Session patient ID is ' + pid +
', expecting ' + active_pid +
1014 '. This session is unstable and should be abandoned. Do not use ' +
1015 'OpenEMR in multiple browser windows!');
1021 // You can call this to make sure the session encounter is what we expect.
1022 function encounterSanityCheck(eid
) {
1023 if (eid
!= active_encounter
) {
1024 alert('Session encounter ID is ' + eid +
', expecting ' + active_encounter +
1025 '. This session is unstable and should be abandoned. Do not use ' +
1026 'OpenEMR in multiple browser windows!');
1033 function repPopup(aurl
) {
1034 top
.restoreSession();
1035 window
.open('<?php echo "$web_root/interface/reports/" ?>' + aurl
, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
1039 // This is invoked to pop up some window when a popup item is selected.
1040 function selpopup(selobj
) {
1041 var i
= selobj
.selectedIndex
;
1042 var opt
= selobj
.options
[i
];
1046 if (opt
.text
== 'Export' || opt
.text
== 'Import') {
1050 dlgopen(opt
.value
, '_blank', width
, height
);
1052 selobj
.selectedIndex
= 0;
1055 // Treeview activation stuff:
1056 $
(document
).ready(function(){
1057 if(1 == <?php
echo $GLOBALS['menu_styling_vertical'] ?
>){
1058 $
("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
1059 $
("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
1060 $
("#navigation-slide > li > ul > li > ul > li > a.collapsed_lv3 + ul").slideToggle("medium");
1061 $
("#navigation-slide > li > a.expanded").click(function() {
1062 $
("#navigation-slide > li > a.expanded").not(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1063 $
(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1065 $
("#navigation-slide > li > a.collapsed").click(function() {
1066 $
("#navigation-slide > li > a.expanded").not(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1067 $
(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1069 $
("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
1070 $
("#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");
1071 $
(this
).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1073 $
("#navigation-slide > li > ul > li > ul > li > a.expanded_lv3").click(function() {
1074 $
("#navigation-slide > li > ul > li > a.expanded").next("ul").find("li > a.expanded_lv3").not(this
).toggleClass("expanded_lv3").toggleClass("collapsed_lv3").parent().find('> ul').slideToggle("medium");
1075 $
(this
).toggleClass("expanded_lv3").toggleClass("collapsed_lv3").parent().find('> ul').slideToggle("medium");
1077 $
("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
1078 $
("#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");
1079 $
(this
).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1081 $
("#navigation-slide > li > ul > li > ul > li > a.collapsed_lv3").click(function() {
1082 $
("#navigation-slide > li > ul > li > a.expanded").next("ul").find("li > a.expanded_lv3").not(this
).toggleClass("expanded_lv3").toggleClass("collapsed_lv3").parent().find('> ul').slideToggle("medium");
1083 $
(this
).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1085 $
("#navigation-slide > li > a#cal0").prepend('<i class="fa fa-fw fa-calendar fa-2x"></i> ');
1086 $
("#navigation-slide > li > a#pfb0").prepend('<i class="fa fa-fw fa-list-alt fa-2x"></i> ');
1087 $
("#navigation-slide > li > a#rcb0").prepend('<i class="fa fa-fw fa-calendar-minus-o fa-2x"></i> ');
1088 $
("#navigation-slide > li > a#msg0").prepend('<i class="fa fa-fw fa-envelope-o fa-2x"></i> ');
1089 $
("#navigation-slide > li > a#app0").prepend('<i class="fa fa-fw fa-user fa-2x"></i> ');
1090 $
("#navigation-slide > li > a#aop0").prepend('<i class="fa fa-fw fa-tachometer fa-2x"></i> ');
1091 $
("#navigation-slide > li > a#ppo0").prepend('<i class="fa fa-fw fa-users fa-2x"></i> ');
1092 $
("#navigation-slide > li > a#repimg").prepend('<i class="fa fa-fw fa-area-chart fa-2x"></i> ');
1093 $
("#navigation-slide > li > a#feeimg").prepend('<i class="fa fa-fw fa-dollar fa-2x"></i> ');
1094 $
("#navigation-slide > li > a#adm0").prepend('<i class="fa fa-fw fa-list-ol fa-2x"></i> ');
1095 $
("#navigation-slide > li > a#invimg").prepend('<i class="fa fa-fw fa-list-ol fa-2x"></i> ');
1096 $
("#navigation-slide > li > a#admimg").prepend('<i class="fa fa-fw fa-cogs fa-2x"></i> ');
1097 $
("#navigation-slide > li > a#misimg").prepend('<i class="fa fa-fw fa-cog fa-2x"></i> ');
1098 $
("#navigation-slide > li > a#proimg").prepend('<i class="fa fa-fw fa-stethoscope fa-2x"></i> ');
1099 $
("#navigation-slide > li > a#modimg").prepend('<i class="fa fa-fw fa-puzzle-piece fa-2x"></i> ');
1100 $
("#navigation-slide > li").each(function(index
) {
1101 if($
(" > ul > li", this
).size() == 0){
1102 $
(" > a", this
).addClass("collapsed");
1105 } else { // $GLOBALS['menu_styling_vertical'] == 0
1107 //Remove the links (used by the sliding menu) that will break treeview
1108 $
('a.collapsed').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1109 $
('a.collapsed_lv2').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1110 $
('a.collapsed_lv3').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1111 $
('a.expanded').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1112 $
('a.expanded_lv2').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1113 $
('a.expanded_lv3').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1115 // Initiate treeview
1116 $
("#navigation").treeview({
1120 toggle
: function() {
1121 window
.console
&& console
.log("%o was toggled", this
);
1131 <body
class="body_nav main-left">
1133 <form method
='post' name
='find_patient' target
='RTop'
1134 action
='<?php echo $rootdir ?>/main/finder/patient_select.php'>
1137 <select name
='sel_frame' style
='background-color:transparent;font-size:9pt;width:100;'>
1138 <option value
='0'><?php
xl('Default', 'e'); ?
></option
>
1139 <option value
='1'><?php
xl('Top', 'e'); ?
></option
>
1140 <option value
='2'><?php
xl('Bottom', 'e'); ?
></option
>
1144 <table cellpadding
='0' cellspacing
='0' border
='0' width
='100%'>
1146 <td
class='smalltext' nowrap
>
1147 <input type
='checkbox' name
='cb_top' onclick
='toggleFrame(1)' <?php
echo $cb_top_chk ?
> />
1148 <b
><?php
xl('Top', 'e') ?
></b
>
1150 <td
class='smalltext' align
='right' nowrap
>
1151 <b
><?php
xl('Bot', 'e') ?
></b
>
1152 <input type
='checkbox' name
='cb_bot' onclick
='toggleFrame(2)' <?php
echo $cb_bot_chk ?
> />
1157 <?php
if ($GLOBALS['menu_styling_vertical'] == 1) { ?
>
1158 <ul id
="navigation-slide">
1159 <?php
} else { // ($GLOBALS['menu_styling_vertical'] == 0) ?>
1160 <ul id
="navigation">
1164 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1165 genTreeLink('RTop', 'cal', xl('Calendar'));
1168 if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1169 genTreeLink('RTop', 'pfb', xl('Flow Board'));
1171 if (!$GLOBALS['disable_rcb'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1172 genTreeLink('RBot', 'rcb', xl('Recall Board'));
1174 if (acl_check('patients', 'notes')) {
1175 genTreeLink('RBot', 'msg', xl('Messages'));
1178 if ($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address'] && acl_check('patientportal', 'portal')) {
1179 genTreeLink('RTop', 'app', xl('Portal Activity'));
1182 if ($GLOBALS['portal_onsite_two_enable'] && acl_check('patientportal', 'portal')) {
1183 genTreeLink('RTop', 'aop', xl('Portal Dashboard'));
1186 if ($GLOBALS['gbl_portal_cms_enable'] && acl_check('patientportal', 'portal')) {
1187 genPopLink(xl('CMS Portal'), '../cmsportal/list_requests.php', 'ppo0');
1191 <li
class="open"><a
class="collapsed" id
="patimg" ><i
class="fa fa-fw fa-user fa-2x"></i
> 
;<span
><?php
xl('Patient/Client', 'e') ?
></span
></a
>
1193 <?php
if (acl_check('patients', 'demo')) {
1194 genMiscLink('RTop', 'fin', '0', xl('Patients'), 'main/finder/dynamic_finder.php');
1196 <?php
if (acl_check('patients', 'demo', '', 'write') ||
acl_check('patients', 'demo', '', 'addonly')) {
1197 genTreeLink('RTop', 'new', ($GLOBALS['full_new_patient_form'] ?
xl('New/Search') : xl('New')));
1199 <?php
if (acl_check('patients', 'demo')) {
1200 genTreeLink('RTop', 'dem', xl('Summary'));
1203 <?php
if (acl_check('patients', 'appt') ||
acl_check_form('newpatient', '', array('write', 'addonly'))) { ?
>
1204 <li
class="open"><a
class="expanded_lv2"><span
><?php
xl('Visits', 'e') ?
></span
></a
>
1206 <?php
if (acl_check_form('newpatient', '', array('write', 'addonly'))) {
1207 genTreeLink('RBot', 'nen', xl('Create Visit'));
1209 <?php
if (acl_check('patients', 'appt')) {
1210 genTreeLink('RBot', 'enc', xl('Current'));
1212 <?php
if (acl_check('patients', 'appt')) {
1213 genTreeLink('RBot', 'ens', xl('Visit History'));
1219 <?php
if (acl_check('patients', 'med')) { ?
>
1220 <li
><a
class="collapsed_lv2"><span
><?php
xl('Records', 'e') ?
></span
></a
>
1222 <?php
genTreeLink('RTop', 'prq', xl('Patient Record Request')); ?
>
1227 <?php
if ($GLOBALS['gbl_nav_visit_forms'] && acl_check('patients', 'demo')) { ?
>
1228 <li
><a
class="collapsed_lv2"><span
><?php
xl('Visit Forms', 'e') ?
></span
></a
>
1231 // Generate the items for visit forms, both traditional and LBF.
1234 $regrows = getFormsByCategory(); // defined in registry.inc
1235 foreach ($regrows as $entry) {
1236 $option_id = $entry['directory'];
1237 $title = trim($entry['nickname']);
1238 if ($option_id == 'fee_sheet') {
1241 if ($option_id == 'newpatient') {
1244 // Check permission to create forms of this type.
1245 $tmp = explode('|', $entry['aco_spec']);
1246 if (!empty($tmp[1])) {
1247 if (!acl_check($tmp[0], $tmp[1], '', 'write') && !acl_check($tmp[0], $tmp[1], '', 'addonly')) {
1251 if (empty($title)) {
1252 $title = $entry['name'];
1254 if ($entry['category'] != $reglastcat) {
1256 echo " </ul></li>\n";
1258 echo " <li><a class='collapsed_lv3'><span>" . xlt($entry['category']) . "</span></a><ul>\n";
1259 $reglastcat = $entry['category'];
1265 xl_form_title($title),
1272 echo " </ul></li>\n";
1277 <li
class="collapsed" ><a
class="collapsed_lv2"><span
><?php
echo xlt('Import') ?
></span
></a
>
1279 <?php
genMiscLink('RTop', 'ccr', '0', xlt('Upload'), 'patient_file/ccr_import.php'); ?
>
1280 <?php
genMiscLink('RTop', 'apr', '0', xlt('Pending Approval'), 'patient_file/ccr_pending_approval.php'); ?
>
1283 <?php
} // end if gbl_nav_visit_forms ?>
1288 <?php
if ($GLOBALS['enable_group_therapy']) : ?
>
1289 <li
><a
class="collapsed" id
="groupimg" ><i
class="fa fa-fw fa-users"></i
> 
;<span
><?php
xl('Group', 'e') ?
></span
></a
>
1291 <?php
genMiscLink('RTop', 'gfn', '0', xl('Groups'), 'therapy_groups/index.php?method=listGroups'); ?
>
1292 <?php
genTreeLink('RTop', 'gng', xl('New')); ?
>
1293 <?php
genTreeLink('RTop', 'gdg', xl('Group Details')); ?
>
1294 <li
><a
class="collapsed_lv2"><span
><?php
xl('Visits', 'e') ?
></span
></a
>
1296 <?php
genTreeLink('RBot', 'gcv', xl('Create Visit')); ?
>
1297 <?php
genTreeLink('RBot', 'gce', xl('Current')); ?
>
1298 <?php
genTreeLink('RBot', 'gvh', xl('Visit History')); ?
>
1306 <?php
// TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1307 <?php
if ((!isset($GLOBALS['enable_fees_in_left_menu']) ||
$GLOBALS['enable_fees_in_left_menu'] == 1) &&
1308 (acl_check('encounters', 'coding') ||
acl_check('acct', 'eob') ||
acl_check('acct', 'bill', '', 'write'))) { ?
>
1309 <li
><a
class="collapsed" id
="feeimg" ><span
><?php
xl('Fees', 'e') ?
></span
></a
>
1311 <?php
if (acl_check('encounters', 'coding')) {
1312 genMiscLink('RBot', 'cod', '2', xl('Fee Sheet'), 'fee_sheet', false, true);
1314 <?php
if ($GLOBALS['use_charges_panel'] && acl_check('encounters', 'coding')) {
1315 genTreeLink('RBot', 'cod', xl('Charges'));
1317 <?php
if (acl_check('acct', 'bill', '', 'write')) {
1318 genMiscLink('RBot', 'pay', '1', xl('Payment'), 'patient_file/front_payment.php');
1320 <?php
if (acl_check('acct', 'bill', '', 'write')) {
1321 genMiscLink('RBot', 'bil', '1', xl('Checkout'), 'patient_file/pos_checkout.php?framed=1');
1323 <?php
if (!$GLOBALS['simplified_demographics'] && (acl_check('acct', 'bill', '', 'write') ||
acl_check('acct', 'eob', '', 'write'))) {
1324 genTreeLink('RTop', 'bil', xl('Billing'));
1326 <?php
if ($GLOBALS['enable_batch_payment'] && (acl_check('acct', 'bill', '', 'write') ||
acl_check('acct', 'eob', '', 'write'))) {
1327 genTreeLink('RTop', 'npa', xl('Batch Payments'), false, 2);
1329 <?php
if ($GLOBALS['enable_posting'] && acl_check('acct', 'eob', '', 'write')) {
1330 genMiscLink('RTop', 'eob', '0', xl('Posting'), 'billing/sl_eob_search.php');
1332 <?php
if ($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob')) {
1333 genTreeLink('RTop', 'edi', xl('EDI History'), false, 2);
1339 <?php
if (acl_check('menus', 'modle')) {?
>
1340 <li
><a
class="collapsed" id
="modimg" ><span
><?php
echo xlt('Modules') ?
></span
></a
>
1343 if (acl_check('admin', 'manage_modules')) {
1344 genMiscLink('RTop', 'adm', '0', xl('Manage Modules'), 'modules/zend_modules/public/Installer');
1348 <?php
//genTreeLink('RTop','ort',xl('Settings')); ?>
1350 $module_query = sqlStatement("select mod_id, 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");
1351 if (sqlNumRows($module_query)) {
1352 while ($modulerow = sqlFetchArray($module_query)) {
1353 $module_hooks = sqlStatement("SELECT msh.*,ms.obj_name,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
1354 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1355 WHERE m.mod_id = ? AND fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='modules' ORDER BY m.mod_id", array($modulerow['mod_id']));
1359 if ($modulerow['type'] == 0) {
1360 $modulePath = $GLOBALS['customModDir'];
1364 $modulePath = $GLOBALS['zendModDir'];
1367 if (sqlNumRows($module_hooks) == 0) {
1368 // module without hooks in module section
1369 $acl_section = strtolower($modulerow['mod_directory']);
1370 $disallowed[$acl_section] = zh_acl_check($_SESSION['authUserID'], $acl_section) ?
"" : "1";
1372 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$added;
1373 $mod_nick_name = $modulerow['mod_nick_name'] ?
$modulerow['mod_nick_name'] : $modulerow['mod_name'];
1374 genMiscLink2('RTop', $acl_section, '0', xlt($mod_nick_name), $relative_link);
1376 // module with hooks in module section
1379 while ($hookrow = sqlFetchArray($module_hooks)) {
1380 $disallowed[$hookrow['obj_name']] = !$disallowed['adm'] ||
zh_acl_check($_SESSION['authUserID'], $hookrow['obj_name']) ?
"" : "1";
1382 $relative_link ="modules/".$modulePath."/".$hookrow['mod_relative_link'].$hookrow['path'];
1383 $mod_nick_name = $hookrow['menu_name'] ?
$hookrow['menu_name'] : 'NoName';
1385 if ($jid==0 ||
($modid!=$hookrow['mod_id'])) {
1390 <li
><a
class="collapsed_lv2"><span
><?php
echo xlt($hookrow['mod_ui_name']); ?
></span
></a
>
1396 $modid = $hookrow['mod_id'];
1397 genMiscLink('RTop', $hookrow['obj_name'], '0', xlt($mod_nick_name), $relative_link);
1411 <?php
if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?
>
1412 <li
><a
class="collapsed" id
="invimg" ><span
><?php
xl('Inventory', 'e') ?
></span
></a
>
1414 <?php
genMiscLink('RTop', 'adm', '0', xl('Management'), 'drugs/drug_inventory.php'); ?
>
1415 <?php
genPopLink(xl('Destroyed'), 'destroyed_drugs_report.php'); ?
>
1420 <?php
if (acl_check('patients', 'lab')) { ?
>
1421 <li
><a
class="collapsed" id
="proimg" ><span
><?php
xl('Procedures', 'e') ?
></span
></a
>
1423 <?php
if (acl_check('admin', 'super')) {
1424 genTreeLink('RTop', 'orl', xl('Providers'));
1426 <?php
if (acl_check('admin', 'super')) {
1427 genTreeLink('RTop', 'ort', xl('Configuration'));
1429 <?php
if (acl_check('admin', 'super')) {
1430 genTreeLink('RTop', 'orc', xl('Load Compendium'));
1432 <?php
genTreeLink('RTop', 'orp', xl('Pending Review')); ?
>
1433 <?php
genTreeLink('RTop', 'orr', xl('Patient Results')); ?
>
1434 <?php
genTreeLink('RTop', 'lda', xl('Lab Overview')); ?
>
1435 <?php
genTreeLink('RTop', 'orb', xl('Batch Results')); ?
>
1436 <?php
genTreeLink('RTop', 'ore', xl('Electronic Reports')); ?
>
1437 <?php
genTreeLink('RTop', 'dld', xl('Lab Documents'));?
>
1443 if ($GLOBALS['erx_enable'] && acl_check('patients', 'rx')) {
1444 $newcrop_user_role = sqlQuery("SELECT newcrop_user_role FROM users WHERE username = '".$_SESSION['authUser']."'");
1445 if ($newcrop_user_role['newcrop_user_role']) {
1447 <li
><a
class="collapsed" id
="feeimg" ><span
><?php
xl('New Crop', 'e') ?
></span
></a
>
1449 <li
><a
class="collapsed_lv2"><span
><?php
xl('Status', 'e') ?
></span
></a
>
1451 <?php
genTreeLink('RTop', 'erx', xl('e-Rx')); ?
>
1452 <?php
genMiscLink('RTop', 'err', '0', xl('e-Rx Renewal'), 'eRx.php?page=status'); ?
>
1453 <?php
if ($newcrop_user_role['newcrop_user_role'] === 'erxadmin') {
1454 genMiscLink('RTop', 'ere', '0', xl('e-Rx EPCS'), 'eRx.php?page=epcs-admin');
1465 <?php
if (!$disallowed['adm']) { ?
>
1466 <li
><a
class="collapsed" id
="admimg" ><span
><?php
xl('Administration', 'e') ?
></span
></a
>
1468 <?php
if (acl_check('admin', 'super')) {
1469 genMiscLink('RTop', 'adm', '0', xl('Globals'), 'super/edit_globals.php');
1471 <?php
if (acl_check('admin', 'users')) {
1472 genMiscLink('RTop', 'adm', '0', xl('Facilities'), 'usergroup/facilities.php');
1474 <?php
if (acl_check('admin', 'users')) {
1475 genMiscLink('RTop', 'adm', '0', xl('Users'), 'usergroup/usergroup_admin.php');
1477 <?php
if (acl_check('admin', 'practice')) {
1478 genTreeLink('RTop', 'adb', xl('Addr Book'));
1481 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1482 if (acl_check('admin', 'practice')) {
1483 genMiscLink('RTop', 'adm', '0', xl('Practice'), '../controller.php?practice_settings&pharmacy&action=list');
1485 <?php
if (acl_check('admin', 'superbill')) {
1486 genTreeLink('RTop', 'sup', xl('Codes'));
1488 <?php
if (acl_check('admin', 'super')) {
1489 genMiscLink('RTop', 'adm', '0', xl('Layouts'), 'super/edit_layout.php');
1491 <?php
if (acl_check('admin', 'super')) {
1492 genMiscLink('RTop', 'adm', '0', xl('Lists'), 'super/edit_list.php');
1494 <?php
if (acl_check('admin', 'acl')) {
1495 genMiscLink('RTop', 'adm', '0', xl('ACL'), 'usergroup/adminacl.php');
1497 <?php
if (acl_check('admin', 'super')) {
1498 genMiscLink('RTop', 'adm', '0', xl('Files'), 'super/manage_site_files.php');
1500 <?php
if (acl_check('admin', 'super')) {
1501 genMiscLink('RTop', 'adm', '0', xl('Backup'), 'main/backup.php');
1503 <?php
if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1504 genMiscLink('RTop', 'adm', '0', xl('Rules'), 'super/rules/index.php?action=browse!list');
1506 <?php
if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1507 genMiscLink('RTop', 'adm', '0', xl('Alerts'), 'super/rules/index.php?action=alerts!listactmgr');
1509 <?php
if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1510 genMiscLink('RTop', 'adm', '0', xl('Patient Reminders'), 'patient_file/reminder/patient_reminders.php?mode=admin&patient_id=');
1512 <?php
if (($GLOBALS['include_de_identification']) && (acl_check('admin', 'super'))) {
1513 genMiscLink('RTop', 'adm', '0', xl('De Identification'), 'de_identification_forms/de_identification_screen1.php');
1515 <?php
if (($GLOBALS['include_de_identification']) && (acl_check('admin', 'super'))) {
1516 genMiscLink('RTop', 'adm', '0', xl('Re Identification'), 'de_identification_forms/re_identification_input_screen.php');
1518 <?php
if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) {
1519 genMiscLink('RTop', 'adm', '0', xl('Export'), 'main/ippf_export.php');
1521 <li
><a
class="collapsed_lv2"><span
><?php
xl('Other', 'e') ?
></span
></a
>
1523 <?php
if (acl_check('admin', 'language')) {
1524 genMiscLink('RTop', 'adm', '0', xl('Language'), 'language/language.php');
1526 <?php
if (acl_check('admin', 'forms')) {
1527 genMiscLink('RTop', 'adm', '0', xl('Forms'), 'forms_admin/forms_admin.php');
1529 <?php
if (acl_check('admin', 'calendar') && !$GLOBALS['disable_calendar']) {
1530 genMiscLink('RTop', 'adm', '0', xl('Calendar'), 'main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig');
1532 <?php
if (acl_check('admin', 'users')) {
1533 genMiscLink('RTop', 'adm', '0', xl('Logs'), 'logview/logview.php');
1536 if ($newcrop_user_role['newcrop_user_role'] ||
$GLOBALS['erx_enable']) {
1537 if (acl_check('admin', 'users')) {
1538 genMiscLink('RTop', 'adm', '0', xl('eRx Logs'), 'logview/erx_logview.php');
1542 <?php
if (acl_check('admin', 'users')) {
1543 genMiscLink('RTop', 'adm', '0', xl('Certificates'), 'usergroup/ssl_certificates_admin.php');
1545 <?php
if (acl_check('admin', 'super')) {
1546 genMiscLink('RTop', 'adm', '0', xl('Native Data Loads'), '../interface/super/load_codes.php');
1548 <?php
if (acl_check('admin', 'super')) {
1549 genMiscLink('RTop', 'adm', '0', xl('External Data Loads'), '../interface/code_systems/dataloads_ajax.php');
1551 <?php
if (acl_check('admin', 'super')) {
1552 genMiscLink('RTop', 'adm', '0', xl('Merge Patients'), 'patient_file/merge_patients.php');
1554 <?php
if (acl_check('admin', 'super')) {
1555 genMiscLink('RTop', 'adm', '0', xl('Import Holidays'), '../interface/main/holidays/import_holidays.php');
1557 <?php
if ($GLOBALS['enable_auditlog_encryption']) {
1558 genMiscLink('RTop', 'rep', '0', xl('Audit Log Tamper'), 'reports/audit_log_tamper_report.php');
1566 <li
><a
class="collapsed" id
="repimg" ><span
><?php
xl('Reports', 'e') ?
></span
></a
>
1569 $module_query = sqlStatement("SELECT msh.*,ms.obj_name,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
1570 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1571 WHERE fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='reports' ORDER BY mod_id");
1572 if (sqlNumRows($module_query)) {
1575 while ($modulerow = sqlFetchArray($module_query)) {
1578 if ($modulerow['type'] == 0) {
1579 $modulePath = $GLOBALS['customModDir'];
1583 $modulePath = $GLOBALS['zendModDir'];
1586 $disallowed[$modulerow['obj_name']] = !$disallowed['adm'] ||
zh_acl_check($_SESSION['authUserID'], $modulerow['obj_name']) ?
"" : "1";
1588 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$modulerow['path'];
1589 $mod_nick_name = $modulerow['menu_name'] ?
$modulerow['menu_name'] : 'NoName';
1591 if ($jid==0 ||
($modid!=$modulerow['mod_id'])) {
1596 <li
><a
class="collapsed_lv2"><span
><?php
echo xlt($modulerow['mod_ui_name']); ?
></span
></a
>
1602 $modid = $modulerow['mod_id'];
1603 genMiscLink('RTop', $modulerow['obj_name'], '0', xlt($mod_nick_name), $relative_link);
1609 <?php
if (acl_check('patients', 'demo') ||
acl_check('patients', 'med') ||
1610 (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions'])) { ?
>
1611 <li
><a
class="collapsed_lv2"><span
><?php
xl('Clients', 'e') ?
></span
></a
>
1613 <?php
if (acl_check('patients', 'demo')) {
1614 genMiscLink('RTop', 'rep', '0', xl('List'), 'reports/patient_list.php');
1616 <?php
if (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions']) {
1617 genMiscLink('RTop', 'rep', '0', xl('Rx'), 'reports/prescriptions_report.php');
1619 <?php
if (acl_check('patients', 'med')) {
1620 genMiscLink('RTop', 'rep', '0', xl('Patient List Creation'), 'reports/patient_list_creation.php');
1622 <?php
if (acl_check('patients', 'med')) {
1623 genMiscLink('RTop', 'rep', '0', xl('Clinical'), 'reports/clinical_reports.php');
1625 <?php
if (acl_check('patients', 'med')) {
1626 genMiscLink('RTop', 'rep', '0', xl('Referrals'), 'reports/referrals_report.php');
1628 <?php
if (acl_check('patients', 'med')) {
1629 genMiscLink('RTop', 'rep', '0', xl('Immunization Registry'), 'reports/immunization_report.php');
1635 <?php
if (acl_check('patients', 'med')) { ?
>
1636 <li
><a
class="collapsed_lv2"><span
><?php
xl('Clinic', 'e') ?
></span
></a
>
1638 <?php
if (($GLOBALS['enable_cdr'] ||
$GLOBALS['enable_cqm'] ||
$GLOBALS['enable_amc']) && acl_check('patients', 'med')) {
1639 genMiscLink('RTop', 'rep', '0', xl('Report Results'), 'reports/report_results.php');
1641 <?php
if ($GLOBALS['enable_cdr'] && acl_check('patients', 'med')) {
1642 genMiscLink('RTop', 'rep', '0', xl('Standard Measures'), 'reports/cqm.php?type=standard');
1644 <?php
if ($GLOBALS['enable_cqm'] && acl_check('patients', 'med')) {
1645 genMiscLink('RTop', 'rep', '0', xl('Quality Measures (CQM)'), 'reports/cqm.php?type=cqm');
1647 <?php
if ($GLOBALS['enable_amc'] && acl_check('patients', 'med')) {
1648 genMiscLink('RTop', 'rep', '0', xl('Automated Measures (AMC)'), 'reports/cqm.php?type=amc');
1650 <?php
if ($GLOBALS['enable_amc_tracking'] && acl_check('patients', 'med')) {
1651 genMiscLink('RTop', 'rep', '0', xl('AMC Tracking'), 'reports/amc_tracking.php');
1653 <?php
if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_alert_log'] && acl_check('patients', 'med')) {
1654 genMiscLink('RTop', 'rep', '0', xl('Alerts Log'), 'reports/cdr_log.php');
1660 <li
><a
class="collapsed_lv2"><span
><?php
xl('Visits', 'e') ?
></span
></a
>
1662 <?php
if (acl_check('acct', 'rep_a')) {
1663 genMiscLink('RTop', 'rep', '0', xl('Daily Report'), 'reports/daily_summary_report.php');
1665 <?php
if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1666 genMiscLink('RTop', 'rep', '0', xl('Appointments'), 'reports/appointments_report.php');
1668 <?php
if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1669 genMiscLink('RTop', 'rep', '0', xl('Patient Flow Board'), 'reports/patient_flow_board_report.php');
1671 <?php
if (acl_check('encounters', 'coding_a')) {
1672 genMiscLink('RTop', 'rep', '0', xl('Encounters'), 'reports/encounters_report.php');
1674 <?php
if (!$GLOBALS['disable_calendar'] && acl_check('acct', 'rep_a')) {
1675 genMiscLink('RTop', 'rep', '0', xl('Appt-Enc'), 'reports/appt_encounter_report.php');
1677 <?php
if (empty($GLOBALS['code_types']['IPPF']) && acl_check('encounters', 'coding_a')) {
1678 genMiscLink('RTop', 'rep', '0', xl('Superbill'), 'reports/custom_report_range.php');
1680 <?php
if (acl_check('patients', 'demo')) {
1681 genMiscLink('RTop', 'rep', '0', xl('Eligibility'), 'reports/edi_270.php');
1683 <?php
if (acl_check('patients', 'demo')) {
1684 genMiscLink('RTop', 'rep', '0', xl('Eligibility Response'), 'reports/edi_271.php');
1686 <?php
if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1687 genMiscLink('RTop', 'rep', '0', xl('Chart Activity'), 'reports/chart_location_activity.php');
1689 <?php
if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1690 genMiscLink('RTop', 'rep', '0', xl('Charts Out'), 'reports/charts_checked_out.php');
1692 <?php
genMiscLink('RTop', 'rep', '0', xl('Services'), 'reports/services_by_category.php'); ?
>
1693 <?php
if (acl_check('patients', 'med')) {
1694 genMiscLink('RTop', 'rep', '0', xl('Syndromic Surveillance'), 'reports/non_reported.php');
1699 <?php
if (acl_check('acct', 'rep_a')) { ?
>
1700 <li
><a
class="collapsed_lv2"><span
><?php
xl('Financial', 'e') ?
></span
></a
>
1702 <?php
genMiscLink('RTop', 'rep', '0', xl('Sales'), 'reports/sales_by_item.php'); ?
>
1703 <?php
genMiscLink('RTop', 'rep', '0', xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?
>
1704 <?php
genMiscLink('RTop', 'rep', '0', xl('Front Rec'), 'reports/front_receipts_report.php'); ?
>
1705 <?php
genMiscLink('RTop', 'rep', '0', xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?
>
1706 <?php
genMiscLink('RTop', 'rep', '0', xl('Collections'), 'reports/collections_report.php'); ?
>
1707 <?php
genMiscLink('RTop', 'rep', '0', xl('Pat Ledger'), 'reports/pat_ledger.php?form=0'); ?
>
1708 <?php
genMiscLink('RTop', 'rep', '0', xl('Financial Summary by Service Code'), 'reports/svc_code_financial_report.php'); ?
>
1713 <?php
if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?
>
1714 <li
><a
class="collapsed_lv2"><span
><?php
xl('Inventory', 'e') ?
></span
></a
>
1716 <?php
genMiscLink('RTop', 'rep', '0', xl('List'), 'reports/inventory_list.php'); ?
>
1717 <?php
genMiscLink('RTop', 'rep', '0', xl('Activity'), 'reports/inventory_activity.php'); ?
>
1718 <?php
genMiscLink('RTop', 'rep', '0', xl('Transactions'), 'reports/inventory_transactions.php'); ?
>
1723 <?php
if (acl_check('patients', 'lab')) { ?
>
1724 <li
><a
class="collapsed_lv2"><span
><?php
xl('Procedures', 'e') ?
></span
></a
>
1726 <?php
genPopLink(xl('Pending Res'), '../orders/pending_orders.php'); ?
>
1727 <?php
if (!empty($GLOBALS['code_types']['IPPF'])) {
1728 genPopLink(xl('Pending F/U'), '../orders/pending_followup.php');
1730 <?php
genPopLink(xl('Statistics'), '../orders/procedure_stats.php'); ?
>
1735 <?php
if (!$GLOBALS['simplified_demographics'] && (acl_check('acct', 'rep_a') ||
acl_check('patients', 'demo'))) { ?
>
1736 <li
><a
class="collapsed_lv2"><span
><?php
xl('Insurance', 'e') ?
></span
></a
>
1738 <?php
if (acl_check('acct', 'rep_a')) {
1739 genMiscLink('RTop', 'rep', '0', xl('Distribution'), 'reports/insurance_allocation_report.php');
1741 <?php
if (acl_check('acct', 'rep_a')) {
1742 genMiscLink('RTop', 'rep', '0', xl('Indigents'), 'billing/indigent_patients_report.php');
1744 <?php
if (acl_check('patients', 'demo')) {
1745 genMiscLink('RTop', 'rep', '0', xl('Unique SP'), 'reports/unique_seen_patients_report.php');
1751 <?php
if (!empty($GLOBALS['code_types']['IPPF']) && acl_check('acct', 'rep_a')) { ?
>
1752 <li
><a
class="collapsed_lv2"><span
><?php
xl('Statistics', 'e') ?
></span
></a
>
1754 <?php
genPopLink(xl('IPPF Stats'), 'ippf_statistics.php?t=i'); ?
>
1755 <?php
genPopLink(xl('GCAC Stats'), 'ippf_statistics.php?t=g'); ?
>
1756 <?php
genPopLink(xl('MA Stats'), 'ippf_statistics.php?t=m'); ?
>
1757 <?php
genPopLink(xl('CYP'), 'ippf_cyp_report.php'); ?
>
1758 <?php
genPopLink(xl('Daily Record'), 'ippf_daily.php'); ?
>
1761 <?php
} // end ippf-specific ?>
1763 <li
><a
class="collapsed_lv2"><span
><?php
xl('Blank Forms', 'e') ?
></span
></a
>
1766 echo " <li><a class='collapsed_lv3'><span>" . xlt('Core') . "</span></a><ul>\n";
1767 genPopLink(xl('Demographics'), '../patient_file/summary/demographics_print.php');
1768 genPopLink(xl('Superbill/Fee Sheet'), '../patient_file/printed_fee_sheet.php');
1769 // genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php');
1770 echo " </ul></li>\n";
1772 // Generate the blank form items for LBF visit forms.
1775 $regrows = getFormsByCategory('1', true); // defined in registry.inc
1776 foreach ($regrows as $entry) {
1777 $option_id = $entry['directory'];
1778 $title = trim($entry['nickname']);
1779 $tmp = explode('|', $entry['aco_spec']);
1780 if (!empty($tmp[1])) {
1781 if (!acl_check($tmp[0], $tmp[1])) {
1785 if (empty($title)) {
1786 $title = $entry['name'];
1788 if ($entry['category'] != $reglastcat) {
1790 echo " </ul></li>\n";
1792 echo " <li><a class='collapsed_lv3'><span>" . xlt($entry['category']) . "</span></a><ul>\n";
1793 $reglastcat = $entry['category'];
1795 genPopLink(xl_form_title($title), "../forms/LBF/printable.php?formname=" . urlencode($option_id));
1798 echo " </ul></li>\n";
1804 <?php
if (acl_check('admin', 'batchcom')) { ?
>
1805 <li
><a
class="collapsed_lv2"><span
><?php
echo xlt('Services') ?
></span
></a
>
1807 <?php
genMiscLink('RTop', 'rep', '0', xl('Background Services'), 'reports/background_services.php'); ?
>
1808 <?php
genMiscLink('RTop', 'rep', '0', xl('Direct Message Log'), 'reports/direct_message_log.php'); ?
>
1816 <li
><a
class="collapsed" id
="misimg" ><span
><?php
xl('Miscellaneous', 'e') ?
></span
></a
>
1818 <?php
genTreeLink('RTop', 'ped', xl('Patient Education')); ?
>
1819 <?php
if (acl_check('encounters', 'auth')) {
1820 genTreeLink('RBot', 'aun', xl('Authorizations'));
1822 <?php
if (acl_check('patients', 'docs')) {
1823 genTreeLink('RTop', 'fax', xl('Fax/Scan'));
1825 <?php
if (acl_check('admin', 'practice')) {
1826 genTreeLink('RTop', 'adb', xl('Addr Book'));
1828 <?php
if (acl_check('admin', 'practice')) {
1829 genTreeLink('RTop', 'ort', xl('Order Catalog'));
1831 <?php
if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1832 genTreeLink('RTop', 'cht', xl('Chart Tracker'));
1834 <?php
if (acl_check('encounters', 'notes')) {
1835 genTreeLink('RTop', 'ono', xl('Ofc Notes'));
1837 <?php
if (acl_check('admin', 'batchcom') ||
acl_check('admin', 'practice')) {
1838 genMiscLink('RTop', 'adm', '0', xl('BatchCom'), 'batchcom/batchcom.php');
1840 <?php
$myrow = sqlQuery("SELECT state FROM registry WHERE directory = 'track_anything'");
1841 if ($myrow['state']=='1') {
1842 genTreeLink('RTop', 'tan', xl('Configure Tracks'));
1844 <?php
if (!$GLOBALS['use_active_directory']) {
1845 genTreeLink('RTop', 'pwd', xl('Password'));
1847 <?php
genMiscLink('RTop', 'prf', '0', xl('Preferences'), 'super/edit_globals.php?mode=user'); ?
>
1848 <?php
if (acl_check('patients', 'docs', '', 'write') ||
acl_check('patients', 'docs', '', 'addonly')) {
1849 genMiscLink('RTop', 'adm', '0', xl('New Documents'), '../controller.php?document&list&patient_id=00');
1851 <?php
if (acl_check('admin', 'practice')) {
1852 genMiscLink('RTop', 'adm', '0', xl('Document Templates'), 'super/manage_document_templates.php');
1861 <div id
='current_patient' style
= 'display:none'>
1862 <b
><?php
xl('None', 'e'); ?
></b
>
1865 <div id
='current_encounter' style
= 'display:none'>
1866 <b
><?php
xl('None', 'e'); ?
></b
>
1875 <input type
='hidden' name
='findBy' value
='Last' />
1876 <input type
="hidden" name
="searchFields" id
="searchFields"/>
1877 <input type
="hidden" name
="search_service_code" value
='' />
1881 <script language
='JavaScript'>
1884 function save_setting (cb_frames
) {
1885 for (var i
= 0, len
= cb_frames
.length
; i
< len
; i++
) {
1887 var fref
= '<?php echo $uspfx ?>frame' + i +
'_chk';
1888 var ureq
= $
.post( "<?php echo $GLOBALS['webroot'] ?>/library/ajax/user_settings.php",
1889 { lab
: fref
, val
: cb_frames
[i
] })
1890 .done(function(data
) {
1891 // alert( "Data Loaded: " + data );
1893 .fail(function(xhr
, textStatus
, errorThrown
) {
1894 alert("Error:"+xhr
.responseText+
"\n"+textStatus+
"\n"+errorThrown
);
1896 .always(function() {
1897 // alert( "finished" );
1901 alert (err
.message
);