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/main/onotes/office_comments.php: removed Back link target.
34 // * interface/main/onotes/office_comments_full.php: changed Back link.
35 // * interface/billing/billing_report.php: removed Back link; added logic
36 // to properly go to demographics or to an encounter when requested.
37 // * interface/new/new.php: removed Back link and revised form target.
38 // * interface/new/new_patient_save.php: modified to load the demographics
39 // page to the current frame instead of loading a new frameset.
40 // * interface/patient_file/history/history.php: target change.
41 // * interface/patient_file/history/history_full.php: target changes.
42 // * interface/patient_file/history/history_save.php: target change.
43 // * interface/patient_file/history/encounters.php: link/target changes.
44 // * interface/patient_file/encounter/encounter_top.php: another new frameset
45 // cloned from patient_encounter.php.
46 // * interface/patient_file/encounter/forms.php: link target removal.
47 // * interface/forms/newpatient/new.php, view.php, save.php: link/target
49 // * interface/patient_file/summary/immunizations.php: removed back link.
50 // * interface/patient_file/summary/pnotes.php: changed link targets.
51 // * interface/patient_file/summary/pnotes_full.php: changed back link and
52 // added set_pid logic.
53 // * interface/patient_file/transaction/transactions.php: various changes.
54 // * interface/patient_file/transaction/add_transaction.php: new return js.
55 // * interface/patient_file/encounter/superbill_codes.php: target and link
57 // * interface/patient_file/encounter/superbill_custom_full.php: target and
59 // * interface/patient_file/encounter/diagnosis.php: target changes.
60 // * interface/patient_file/encounter/diagnosis_full.php: target and link
62 // * interface/main/authorizations/authorizations.php: link and target changes.
63 // * library/api.inc: url change.
64 // * interface/patient_file/summary/rx_frameset.php: new frameset.
65 // * interface/patient_file/summary/rx_left.php: new for prescriptions.
66 // * all encounter forms: remove all instances of "target=Main" and change
67 // all instances of "patient_encounter.php" to "encounter_top.php".
69 // Our find_patient form, when submitted, invokes patient_select.php in the
70 // upper frame. When the patient is selected, demographics.php is invoked
71 // with the set_pid parameter, which establishes the new session pid and also
72 // calls the setPatient() function (below). In this case demographics.php
73 // will also load the summary frameset into the bottom frame, invoking our
74 // loadFrame() function.
76 // Similarly, we have the concept of selecting an encounter from the
77 // Encounters list, and then having that "stick" until some other encounter
78 // or a new encounter is chosen. We also have a navigation item for creating
79 // a new encounter. interface/patient_file/encounter/encounter_top.php
80 // supports set_encounter to establish an encounter.
82 // TBD: Include active_pid and/or active_encounter in relevant submitted
83 // form data, and add logic to the save routines to make sure they match
84 // the corresponding session values.
86 require_once("../globals.php");
87 require_once($GLOBALS['fileroot']."/library/acl.inc");
88 require_once($GLOBALS['fileroot']."/custom/code_types.inc.php");
89 require_once($GLOBALS['fileroot']."/library/patient.inc");
90 require_once($GLOBALS['fileroot']."/library/lists.inc");
91 require_once($GLOBALS['fileroot']."/library/registry.inc");
92 require_once $GLOBALS['srcdir'].'/ESign/Api.php';
93 require_once $GLOBALS['srcdir'].'/user.inc';
95 // Fetch user preferences saved from prior session
96 $uspfx = substr(__FILE__
, strlen($GLOBALS['fileroot']."/")) . '.';
97 $cb_top_chk = prevSetting($uspfx, 'cb_top', 'frame0_chk', 'checked');
98 $cb_bot_chk = prevSetting($uspfx, 'cb_bot', 'frame1_chk', 'checked');
99 $usrval = json_encode(array ( $cb_top_chk, $cb_bot_chk ));
101 // This array defines the list of primary documents that may be
102 // chosen. Each element value is an array of 3 values:
104 // * Name to appear in the navigation table
105 // * Usage: 0 = global, 1 = patient-specific, 2 = encounter-specific, 3 = therapy group-specific, 4 = therapy group encounter - specific
106 // * The URL relative to the interface directory
109 $primary_docs = array(
110 'cal' => array(xl('Calendar') , 0, 'main/main_info.php'),
111 'pfb' => array(xl('Patient Flow Board') , 0, '../interface/patient_tracker/patient_tracker.php?skip_timeout_reset=1'),
112 'rcb' => array(xl('Recall Board') , 0, '../interface/main/messages/messages.php?go=Recalls'),
113 'app' => array(xl('Portal Activity') , 0, '../myportal/index.php'),
114 'aop' => array(xl('Portal Dashboard') , 0, '../portal/patient/provider'),
115 'msg' => array(xl('Messages') , 0, 'main/messages/messages.php?form_active=1'),
116 'pwd' => array(xl('Password') , 0, 'usergroup/user_info.php'),
117 'mfa' => array(xl('MFA Management'), 0, 'usergroup/mfa_registrations.php'),
118 'prf' => array(xl('Preferences') , 0, 'super/edit_globals.php?mode=user'),
119 'rep' => array(xl('Reports') , 0, 'reports/index.php'),
120 'ono' => array(xl('Ofc Notes') , 0, 'main/onotes/office_comments.php'),
121 'fax' => array(xl('Fax/Scan') , 0, 'fax/faxq.php'),
122 'adb' => array(xl('Addr Bk') , 0, 'usergroup/addrbook_list.php'),
123 'orl' => array(xl('Proc Prov') , 0, 'orders/procedure_provider_list.php'),
124 'ort' => array(xl('Proc Cat') , 0, 'orders/types.php'),
125 'orc' => array(xl('Proc Load') , 0, 'orders/load_compendium.php'),
126 'orb' => array(xl('Proc Bat') , 0, 'orders/orders_results.php?batch=1'),
127 'ore' => array(xl('E-Reports') , 0, 'orders/list_reports.php'),
128 'ppo' => array(xl('CMS Portal'), 0, 'cmsportal/list_requests.php'),
129 'cht' => array(xl('Chart Trk') , 0, '../custom/chart_tracker.php'),
130 'imp' => array(xl('Import') , 0, '../custom/import.php'),
131 'bil' => array(xl('Billing') , 0, 'billing/billing_report.php'),
132 'sup' => array(xl('Superbill') , 0, 'patient_file/encounter/superbill_custom_full.php'),
133 'aun' => array(xl('Authorizations'), 0, 'main/authorizations/authorizations.php'),
134 'new' => array(xl('New Pt') , 0, 'new/new.php'),
135 'ped' => array(xl('Patient Education'), 0, 'reports/patient_edu_web_lookup.php'),
136 'lab' => array(xl('Check Lab Results') , 0, 'orders/lab_exchange.php'),
137 'dem' => array(xl('Patient') , 1, "patient_file/summary/demographics.php"),
138 'his' => array(xl('History') , 1, 'patient_file/history/history.php'),
139 'ens' => array(xl('Visit History'), 1, 'patient_file/history/encounters.php'),
140 'nen' => array(xl('Create Visit'), 1, 'forms/newpatient/new.php?autoloaded=1&calenc='),
141 'pre' => array(xl('Rx') , 1, 'patient_file/summary/rx_frameset.php'),
142 'iss' => array(xl('Issues') , 1, 'patient_file/summary/stats_full.php?active=all'),
143 'imm' => array(xl('Immunize') , 1, 'patient_file/summary/immunizations.php'),
144 'doc' => array(xl('Documents') , 1, '../controller.php?document&list&patient_id={PID}'),
145 'orp' => array(xl('Proc Pending Rev'), 1, 'orders/orders_results.php?review=1'),
146 'orr' => array(xl('Proc Res') , 1, 'orders/orders_results.php'),
147 'lda' => array(xl('Lab overview') , 1, 'patient_file/summary/labdata.php'),
148 'tan' => array(xl('Configure Tracks') , 0, 'forms/track_anything/create.php'),
149 'prp' => array(xl('Pt Report') , 1, 'patient_file/report/patient_report.php'),
150 'prq' => array(xl('Pt Rec Request') , 1, 'patient_file/transaction/record_request.php'),
151 'pno' => array(xl('Pt Notes') , 1, 'patient_file/summary/pnotes.php'),
152 'tra' => array(xl('Transact') , 1, 'patient_file/transaction/transactions.php'),
153 'sum' => array(xl('Summary') , 1, 'patient_file/summary/summary_bottom.php'),
154 'enc' => array(xl('Encounter') , 2, 'patient_file/encounter/encounter_top.php'),
155 'erx' => array(xl('e-Rx') , 1, 'eRx.php'),
156 'err' => array(xl('e-Rx Renewal') , 1, 'eRx.php?page=status'),
157 'ere' => array(xl('e-Rx EPCS') , 1, 'eRx.php?page=epcs-admin'),
158 'pay' => array(xl('Payment') , 1, '../patient_file/front_payment.php'),
159 'edi' => array(xl('EDI History') , 0, 'billing/edih_view.php'),
160 'eob' => array(xl('Posting') , 0, 'billing/sl_eob_search.php'),
161 'dld' => array(xl('Display Documents'), 0, 'main/display_documents.php')
163 $disallowed = array();
166 $primary_docs['npa']=array(xl('Batch Payments') , 0, 'billing/new_payment.php');
167 if ($GLOBALS['use_charges_panel'] ||
$GLOBALS['menu_styling_vertical'] == 0) {
168 $primary_docs['cod'] = array(xl('Charges'), 2, 'patient_file/encounter/encounter_bottom.php');
171 if ($GLOBALS['enable_group_therapy']) {
172 $disallowed['gng'] = !acl_check("groups", "gadd");
173 $disallowed['gdg'] = !acl_check("groups", "gadd");
174 $disallowed['gcv'] = !acl_check("groups", "gcalendar");
175 $disallowed['gce'] = !acl_check("groups", "glog");
176 $disallowed['gvh'] = !acl_check("groups", "glog");
178 $primary_docs['gng'] = array(xl('New') , 0, 'therapy_groups/index.php?method=addGroup');
179 $primary_docs['gdg'] = array(xl('Group Details') , 3, '/therapy_groups/index.php?method=groupDetails&group_id=from_session');
180 $primary_docs['gcv'] = array(xl('Create Visit'), 3, 'forms/newGroupEncounter/new.php?autoloaded=1&calenc=');
181 $primary_docs['gce'] = array(xl('Current') , 4, 'patient_file/encounter/encounter_top.php');
182 $primary_docs['gvh'] = array(xl('Visit History'), 3, 'patient_file/history/encounters.php');
186 $esignApi = new Api();
187 // This section decides which navigation items will not appear.
190 $disallowed['edi'] = !($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob'));
191 $disallowed['adm'] = !(acl_check('admin', 'calendar') ||
192 acl_check('admin', 'database') ||
acl_check('admin', 'forms') ||
193 acl_check('admin', 'practice') ||
acl_check('admin', 'users') ||
194 acl_check('admin', 'acl') ||
acl_check('admin', 'super') ||
195 acl_check('admin', 'superbill') ||
acl_check('admin', 'drugs'));
197 $disallowed['bil'] = !(acl_check('acct', 'eob') ||
acl_check('acct', 'bill'));
199 $disallowed['new'] = !(acl_check('patients', 'demo', '', array('write','addonly')));
201 $disallowed['fax'] = !(($GLOBALS['enable_hylafax'] ||
$GLOBALS['enable_scanner']) && acl_check('patients', 'docs'));
203 $disallowed['iss'] = !((acl_check('encounters', 'notes', '', 'write') ||
204 acl_check('encounters', 'notes_a', '', 'write') ) &&
205 acl_check('patients', 'med', '', 'write') );
207 $disallowed['imp'] = $disallowed['new'] ||
!is_readable("$webserver_root/custom/import.php");
209 $disallowed['cht'] = !is_readable("$webserver_root/custom/chart_tracker.php");
211 $disallowed['pre'] = !(acl_check('patients', 'med'));
212 $disallowed['eob'] = !(acl_check('acct', 'eob'));
214 // Helper functions for treeview generation.
215 function genTreeLink($frame, $name, $title, $mono = false)
217 global $primary_docs, $disallowed;
218 if (empty($disallowed[$name])) {
219 $id = $name . $primary_docs[$name][1];
220 echo "<li><a href='' id='$id' onclick=\"";
222 if ($frame == 'RTop') {
223 echo "forceSpec(true,false);";
225 echo "forceSpec(false,true);";
229 echo "return loadFrame2('$id','$frame','" .
230 $primary_docs[$name][2] . "')\">" . $title . ($name == 'msg' ?
' <span id="reminderCountSpan" class="bold"></span>' : '')."</a></li>";
234 function genMiscLink($frame, $name, $level, $title, $url, $mono = false, $encform = false)
237 if (empty($disallowed[$name])) {
238 $id = $name . $level;
239 echo "<li><a href='' id='$id' onclick=\"";
241 if ($frame == 'RTop') {
242 echo "forceSpec(true,false);";
244 echo "forceSpec(false,true);";
248 // In this case $url is an encounter form name, not a URL.
249 echo "loadNewForm('" . addslashes(trim($url)) . "', '" . addslashes(trim($title)) . "');";
251 echo "loadFrame2('$id','$frame','" . $url . "');";
253 echo "return false;\">" . text($title) . "</a></li>";
257 function genMiscLink2($frame, $name, $level, $title, $url, $mono = false, $mouseovertext = "")
260 if (empty($disallowed[$name])) {
261 $id = $name . $level;
262 echo "<li><a href='' id='$id' title='$mouseovertext' onclick=\"";
264 if ($frame == 'RTop') {
265 echo "forceSpec(true,false);";
267 echo "forceSpec(false,true);";
271 echo "return loadFrame3('$id','$frame','" .
272 $url . "')\">" . $title . "</a></li>";
275 function genPopLink($title, $url, $linkid = '')
277 echo "<li><a href='' ";
279 echo "id='$linkid' ";
282 echo "onclick=\"return repPopup('$url')\"" .
283 ">" . $title . "</a></li>";
285 function genDualLink($topname, $botname, $title)
287 global $primary_docs, $disallowed;
288 if (empty($disallowed[$topname]) && empty($disallowed[$botname])) {
289 $topid = $topname . $primary_docs[$topname][1];
290 $botid = $botname . $primary_docs[$botname][1];
291 echo "<li><a href='' id='$topid' " .
292 "onclick=\"return loadFrameDual('$topid','$botid','" .
293 $primary_docs[$topname][2] . "','" .
294 $primary_docs[$botname][2] . "')\">" . $title . "</a></li>";
298 function genPopupsList($style = '')
300 global $disallowed, $webserver_root;
302 <select name
='popups' onchange
='selpopup(this)' style
='background-color:transparent;font-size:9pt;<?php echo $style; ?>'>
303 <option value
=''><?php
xl('Popups', 'e'); ?
></option
>
304 <?php
if (!$disallowed['iss']) { ?
>
305 <option value
='../patient_file/problem_encounter.php'><?php
xl('Issues', 'e'); ?
></option
>
307 <?php
if (!$GLOBALS['ippf_specific'] && acl_check('patients', 'demo')) { ?
>
308 <option value
='../../custom/export_xml.php'><?php
xl('Export', 'e'); ?
></option
>
309 <?php
if (acl_check('patients', 'demo', '', 'write')) { ?
>
310 <option value
='../../custom/import_xml.php'><?php
xl('Import', 'e'); ?
></option
>
314 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) { ?
>
315 <option value
='../reports/appointments_report.php?patient=<?php if (isset($pid)) {
317 } ?>'><?php
xl('Appts', 'e'); ?
></option
>
319 <?php
if (acl_check('patients', 'med')) { ?
>
320 <option value
='../patient_file/printed_fee_sheet.php?fill=1'><?php
xl('Superbill', 'e'); ?
></option
>
322 <?php
if (acl_check('acct', 'bill', '', 'write')) { ?
>
323 <option value
='../patient_file/front_payment.php'><?php
xl('Payment', 'e'); ?
></option
>
325 <?php
if ($GLOBALS['inhouse_pharmacy'] && acl_check('acct', 'bill', '', 'write')) { ?
>
326 <option value
='../patient_file/pos_checkout.php'><?php
xl('Checkout', 'e'); ?
></option
>
328 <?php
if (is_dir($GLOBALS['OE_SITE_DIR'] . "/letter_templates") && acl_check('patients', 'med')) { ?
>
329 <option value
='../patient_file/letter.php'><?php
xl('Letter', 'e'); ?
></option
>
331 <?php
if ($GLOBALS['chart_label_type'] != '0' && acl_check('patients', 'demo')) { ?
>
332 <option value
='../patient_file/label.php'><?php
xl('Chart Label', 'e'); ?
></option
>
334 <?php
if ($GLOBALS['barcode_label_type'] != '0' && acl_check('patients', 'demo')) { ?
>
335 <option value
='../patient_file/barcode_label.php'><?php
xl('Barcode Label', 'e'); ?
></option
>
337 <?php
if ($GLOBALS['addr_label_type'] && acl_check('patients', 'demo')) { ?
>
338 <option value
='../patient_file/addr_label.php'><?php
xl('Address Label', 'e'); ?
></option
>
344 function genFindBlock()
347 <table cellpadding
='0' cellspacing
='0' border
='0'>
349 <td
class='smalltext'><?php
xl('Find', 'e') ?
>: 
;</td
>
350 <td
class='smalltext' colspan
='2'>
351 <input type
="entry" size
="7" name
="patient" class='inputtext' style
='width:65px;' />
355 <td
class='smalltext'><?php
xl('by', 'e') ?
>:</td
>
356 <td
class='smalltext'>
357 <a href
="javascript:findPatient('Last');" class="navitem"><?php
xl('Name', 'e'); ?
></a
>
359 <td
class='smalltext' align
='right'>
360 <a href
="javascript:findPatient('ID');" class="navitem"><?php
xl('ID', 'e'); ?
></a
>
364 <td
class='smalltext'> 
;</td
>
365 <td
class='smalltext'>
366 <a href
="javascript:findPatient('SSN');" class="navitem"><?php
xl('SSN', 'e'); ?
></a
>
368 <td
class='smalltext' align
='right'>
369 <a href
="javascript:findPatient('DOB');" class="navitem"><?php
xl('DOB', 'e'); ?
></a
>
373 <td
class='smalltext'> 
;</td
>
374 <td
class='smalltext'>
375 <a href
="javascript:findPatient('Any');" class="navitem"><?php
xl('Any', 'e'); ?
></a
>
377 <td
class='smalltext' align
='right'>
378 <a href
="javascript:initFilter();" class="navitem"><?php
xl('Filter', 'e'); ?
></a
>
383 } // End function genFindBlock()
388 <title
>Navigation
</title
>
389 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative']; ?>/bootstrap/dist/css/bootstrap.min.css">
390 <?php
if ($_SESSION['language_direction'] == 'rtl') { ?
>
391 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative'] ?>/bootstrap-rtl/dist/css/bootstrap-rtl.min.css">
393 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
394 <link rel
="stylesheet" href
="<?php echo $GLOBALS['assets_static_relative'];?>/font-awesome/css/font-awesome.css" type
="text/css">
395 <style type
="text/css">
402 padding
: 5px
3px
5px
3px
;
405 font
-family
:sans
-serif
;
409 a
.navitem
, a
.navitem
:visited
{
411 font
-family
:sans
-serif
;
422 border
-color
: #000000;
423 background
-color
:transparent
;
427 background
-color
:transparent
;
429 #navigation-slide ul {
430 background
-color
:transparent
;
440 vertical
-align
:middle
;
443 <link rel
="stylesheet" href
="../../library/js/jquery.treeview-1.4.1/jquery.treeview.css" />
444 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-1-9-1/jquery.min.js"></script
>
445 <script src
="<?php echo $GLOBALS['assets_static_relative']; ?>/bootstrap/dist/js/bootstrap.min.js" type
="text/javascript"></script
>
446 <script type
="text/javascript" src
="../../library/js/jquery.treeview-1.4.1/jquery.treeview.js" ></script
>
448 <script type
="text/javascript" src
="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
450 <script language
='JavaScript'>
452 var usrval
= jQuery
.parseJSON('<?php echo $usrval ?>');
454 // tajemo work by CB 2012/01/31 12:32:57 PM dated reminders counter
455 function getReminderCount(){
456 top
.restoreSession();
457 // Send the skip_timeout_reset parameter to not count this as a manual entry in the
458 // timing out mechanism in OpenEMR.
459 $
.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/dated_reminders_counter.php",
460 { skip_timeout_reset
: "1" },
462 $
("#reminderCountSpan").html(data
);
463 // run updater every 60 seconds
464 var repeater
= setTimeout("getReminderCount()", 60000);
466 //piggy-back on this repeater to run other background-services
467 //this is a silent task manager that returns no output
468 $
.post("<?php echo $GLOBALS['webroot']; ?>/library/ajax/execute_background_services.php",
469 { skip_timeout_reset
: "1", ajax
: "1" });
472 $
(document
).ready(function (){
473 getReminderCount();//
474 parent
.loadedFrameCount +
= 1;
475 for (var i
= 0, len
= usrval
.length
; i
< len
; i++
) {
476 if (usrval
[i
] != "checked") toggleFrame(i+
1);
479 // end of tajemo work dated reminders counter
481 // Master values for current pid and encounter.
483 var active_encounter
= 0;
484 var encounter_locked
= false;
488 // Current selections in the top and bottom frames.
492 // Expand and/or collapse frames in response to checkbox clicks.
493 // fnum indicates which checkbox was clicked (1=left, 2=right).
494 function toggleFrame(fnum
) {
495 var f
= document
.forms
[0];
496 var fset
= top
.document
.getElementById('fsright');
497 if (!f
.cb_top
.checked
&& !f
.cb_bot
.checked
) {
498 if (fnum
== 1) f
.cb_bot
.checked
= true;
499 else f
.cb_top
.checked
= true;
501 var rows
= f
.cb_top
.checked ?
'*' : '0';
502 rows +
= f
.cb_bot
.checked ?
',*' : ',0';
504 save_setting ([(f
.cb_top
.checked ?
'checked' : ' '), (f
.cb_bot
.checked ?
'checked' : ' ')]);
507 // Load the specified url into the specified frame (RTop or RBot).
508 // The URL provided must be relative to interface.
509 function loadFrame(fname
, frame
, url
) {
510 top
.restoreSession();
511 var i
= url
.indexOf('{PID}');
512 if (i
>= 0) url
= url
.substring(0,i
) + active_pid + url
.substring(i+
5);
513 top
.frames
[frame
].location
= '<?php echo "$web_root/interface/" ?>' + url
;
514 if (frame
== 'RTop') topName
= fname
; else botName
= fname
;
517 // Load the specified url into a frame to be determined, with the specified
518 // frame as the default; the url must be relative to interface.
519 function loadFrame2(fname
, frame
, url
) {
520 var usage
= fname
.substring(3);
521 if (active_pid
== 0 && active_gid
== 0 && (usage
> '0' && usage
< '5')){
522 <?php
if ($GLOBALS['enable_group_therapy']) { ?
>
523 alert('<?php xl('You must first select
or add a patient
or therapy group
.', 'e
') ?>');
525 alert('<?php xl('You must first select
or add a patient
.', 'e
') ?>');
529 if (active_encounter
== 0 && (usage
> '1' && usage
< '3')) {
530 alert('<?php xl('You must first select
or create an encounter
.', 'e
') ?>');
533 if (encounter_locked
&& usage
> '1' && (usage
> '1' && usage
< '3')) {
534 alert('<?php echo xls('This encounter is locked
. No
new forms can be added
.') ?>');
537 var f
= document
.forms
[0];
538 top
.restoreSession();
539 var i
= url
.indexOf('{PID}');
540 if (i
>= 0) url
= url
.substring(0,i
) + active_pid + url
.substring(i+
5);
543 var fi
= f
.sel_frame
.selectedIndex
;
544 if (fi
== 1) frame
= 'RTop'; else if (fi
== 2) frame
= 'RBot';
546 if (!f
.cb_bot
.checked
) frame
= 'RTop'; else if (!f
.cb_top
.checked
) frame
= 'RBot';
547 top
.frames
[frame
].location
= '<?php echo "$web_root/interface/" ?>' + url
;
548 if (frame
== 'RTop') topName
= fname
; else botName
= fname
;
552 function loadFrame3(fname
, frame
, url
) {
553 var f
= document
.forms
[0];
554 top
.restoreSession();
555 var i
= url
.indexOf('{PID}');
556 if (i
>= 0) url
= url
.substring(0,i
) + active_pid + url
.substring(i+
5);
559 var fi
= f
.sel_frame
.selectedIndex
;
560 if (fi
== 1) frame
= 'RTop'; else if (fi
== 2) frame
= 'RBot';
562 if (!f
.cb_bot
.checked
) frame
= 'RTop'; else if (!f
.cb_top
.checked
) frame
= 'RBot';
563 top
.frames
[frame
].location
= '<?php echo "$web_root/interface/" ?>' + url
;
564 if (frame
== 'RTop') topName
= fname
; else botName
= fname
;
568 // Special handling to load a new encounter form into an existing encounter.
569 function loadNewForm(formname
, formdesc
) {
570 var url
= '<?php echo "$rootdir/patient_file/encounter/load_form.php?formname=" ?>' + formname
;
571 if (parent
.RBot
.twAddFrameTab
) {
572 parent
.RBot
.twAddFrameTab('enctabs', formdesc
, url
);
574 else if (parent
.RTop
.twAddFrameTab
) {
575 parent
.RTop
.twAddFrameTab('enctabs', formdesc
, url
);
578 loadFrame2('enc2','RBot','patient_file/encounter/encounter_top.php' +
579 '?formname=' + formname +
'&formdesc=' + formdesc
);
583 // Make sure the the top and bottom frames are open or closed, as specified.
584 function forceSpec(istop
, isbot
) {
585 var f
= document
.forms
[0];
586 if (f
.cb_top
.checked
!= istop
) {
587 f
.cb_top
.checked
= istop
;
590 if (f
.cb_bot
.checked
!= isbot
) {
591 f
.cb_bot
.checked
= isbot
;
596 // Make sure both frames are open.
597 function forceDual() {
598 forceSpec(true, true);
601 // Load the specified url into a frame to be determined, with the specified
602 // frame as the default; the url must be relative to interface.
603 function loadFrameDual(tname
, bname
, topurl
, boturl
) {
604 var topusage
= tname
.substring(3);
605 var botusage
= bname
.substring(3);
606 if (active_pid
== 0 && (topusage
> '0' || botusage
> '0')) {
607 alert('<?php xl('You must first select
or add a patient
.', 'e
') ?>');
610 if (active_encounter
== 0 && (topusage
> '1' || botusage
> '1')) {
611 alert('<?php xl('You must first select
or create an encounter
.', 'e
') ?>');
614 if (encounter_locked
&& (topusage
> '1' || botusage
> '1')) {
615 alert('<?php echo xls('This encounter is locked
. No
new forms can be added
.') ?>');
618 var f
= document
.forms
[0];
620 top
.restoreSession();
621 var i
= topurl
.indexOf('{PID}');
622 if (i
>= 0) topurl
= topurl
.substring(0,i
) + active_pid + topurl
.substring(i+
5);
623 i
= boturl
.indexOf('{PID}');
624 if (i
>= 0) boturl
= boturl
.substring(0,i
) + active_pid + boturl
.substring(i+
5);
625 top
.frames
.RTop
.location
= '<?php echo "$web_root/interface/" ?>' + topurl
;
626 top
.frames
.RBot
.location
= '<?php echo "$web_root/interface/" ?>' + boturl
;
632 // Set disabled/enabled state of radio buttons and associated labels
633 // depending on whether there is an active patient or encounter.
634 function syncRadios() {
635 var f
= document
.forms
[0];
636 encounter_locked
= isEncounterLocked(active_encounter
);
637 var nlinks
= document
.links
.length
;
638 for (var i
= 0; i
< nlinks
; ++i
) {
639 var lnk
= document
.links
[i
];
640 if (lnk
.id
.length
!= 4) continue;
641 var usage
= lnk
.id
.substring(3);
642 if (usage
== '1' || usage
== '2') {
644 if (active_pid
== 0) da
= true;
645 if (active_encounter
== 0 && usage
> '1') da
= true;
646 if (encounter_locked
&& usage
> '1') da
= true;
648 if ($GLOBALS['menu_styling_vertical'] == 0) {
649 $color = "'#0000ff'";
650 } else { // ($GLOBALS['menu_styling_vertical'] == 1)
651 $color = "'#000000'";
654 lnk
.style
.color
= da ?
'#888888' : <?php
echo $color; ?
>;
656 //for therapy groups menu
657 <?php
if ($GLOBALS['enable_group_therapy']) { ?
>
658 if (usage
== '3' || usage
== '4') {
660 if (active_gid
== 0) da
= true;
661 if (active_encounter
== 0 && usage
> '3') da
= true;
662 if (encounter_locked
&& usage
> '3') da
= true;
664 if ($GLOBALS['menu_styling_vertical'] == 0) {
665 $color = "'#0000ff'";
666 } else { // ($GLOBALS['menu_styling_vertical'] == 1)
667 $color = "'#000000'";
670 lnk
.style
.color
= da ?
'#888888' : <?php
echo $color; ?
>;
675 f
.popups
.disabled
= (active_pid
== 0);
679 top
.frames
['RTop'].location
='<?php echo $GLOBALS['default_top_pane
']?>';
680 top
.frames
['RBot'].location
='messages/messages.php?form_active=1';
683 //Function to clear active patient and encounter in the server side
684 function clearactive() {
685 top
.restoreSession();
686 //Ajax call to clear active patient in session
687 var method
= (active_pid
> 0) ?
'unset_pid' : 'unset_gid';
690 url
: "<?php echo $GLOBALS['webroot'] ?>/library/ajax/unset_session_ajax.php",
691 data
: { func
: method
},
692 success
:function( msg
) {
695 top
.frames
['RTop'].location
='<?php echo $GLOBALS['default_top_pane
']?>';
696 top
.frames
['RBot'].location
='messages/messages.php?form_active=1';
700 $
(parent
.Title
.document
.getElementById('clear_active')).hide();
701 $
(parent
.Title
.document
.getElementById('clear_active_group')).hide();
703 // Reference to the search.php window.
706 // Open the search.php window.
707 function initFilter() {
708 my_window
= window
.open("../../custom/search.php", "mywindow","status=1");
711 // This is called by the search.php (Filter) window.
712 function processFilter(fieldString
, serviceCode
) {
713 var f
= document
.forms
[0];
714 document
.getElementById('searchFields').value
= fieldString
;
715 f
.search_service_code
.value
= serviceCode
;
716 findPatient("Filter");
717 f
.search_service_code
.value
= '';
721 // Process the click to find a patient by name, id, ssn or dob.
722 function findPatient(findby
) {
723 var f
= document
.forms
[0];
724 if (! f
.cb_top
.checked
) {
725 f
.cb_top
.checked
= true;
728 f
.findBy
.value
= findby
;
729 top
.restoreSession();
730 document
.find_patient
.submit();
733 // Helper function to set the contents of a div.
734 function setSomeContent(id
, content
, doc
) {
735 if (doc
.getElementById
) {
736 var x
= doc
.getElementById(id
);
738 x
.innerHTML
= content
;
742 x
.innerHTML
= content
;
745 function setDivContent(id
, content
) {
746 setSomeContent(id
, content
, document
);
748 function setTitleContent(id
, content
) {
749 setSomeContent(id
, content
, parent
.Title
.document
);
752 // This is called automatically when a new patient is set, to make sure
753 // there are no patient-specific documents showing stale data. If a frame
754 // was just loaded with data for the correct patient, its name is passed so
755 // that it will not be zapped. At this point the new server-side pid is not
756 // assumed to be set, so this function will only load global data.
757 function reloadPatient(frname
) {
758 var f
= document
.forms
[0];
759 if (topName
.length
> 3 && topName
.substring(3) > '0' && frname
!= 'RTop') {
760 loadFrame('cal0','RTop', '<?php echo $primary_docs['cal
'][2]; ?>');
762 if (botName
.length
> 3 && botName
.substring(3) > '0' && frname
!= 'RBot') {
763 loadFrame('ens0','RBot', '<?php echo $primary_docs['ens
'][2]; ?>');
767 // Reload encounter-specific frames, excluding a specified frame. At this
768 // point the new server-side encounter ID may not be set and loading the same
769 // document for the new encounter will not work, so load patient info instead.
770 function reloadEncounter(frname
) {
771 var f
= document
.forms
[0];
772 if (topName
.length
> 3 && topName
.substring(3) > '1' && frname
!= 'RTop') {
773 loadFrame('dem1','RTop', '<?php echo $primary_docs['dem
'][2]; ?>');
775 if (botName
.length
> 3 && botName
.substring(3) > '1' && frname
!= 'RBot') {
776 loadFrame('ens1','RBot', '<?php echo $primary_docs['ens
'][2]; ?>');
781 // Call this to announce that the patient has changed. You must call this
782 // if you change the session PID, so that the navigation frame will show the
783 // correct patient and so that the other frame will be reloaded if it contains
784 // patient-specific information from the previous patient. frname is the name
785 // of the frame that the call came from, so we know to only reload content
786 // from the *other* frame if it is patient-specific.
787 function setPatient(pname
, pid
, pubpid
, frname
, str_dob
) {
789 var str
= '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentPatientFromTitle()" title="PID = ' + pid +
'"><b>' + pname +
' (' + pubpid +
')<br /></b></a>';
790 setDivContent('current_patient', str
);
791 setTitleContent('current_patient', str + str_dob
);
792 if (pid
== active_pid
) return;
793 setDivContent('current_encounter', '<b><?php xl('None
', 'e
'); ?></b>');
795 active_encounter
= 0;
796 encounter_locked
= false;
797 if (frname
) reloadPatient(frname
);
799 $
(parent
.Title
.document
.getElementById('current_patient_block')).show();
800 var encounter_block
= $
(parent
.Title
.document
.getElementById('current_encounter_block'));
801 $
(encounter_block
).hide();
803 // zero out the encounter frame, replace it with the encounter list frame
804 var f
= document
.forms
[0];
805 if ( f
.cb_top
.checked
&& f
.cb_bot
.checked
) {
806 var encounter_frame
= getEncounterTargetFrame('enc');
807 if ( encounter_frame
!= undefined
) {
808 loadFrame('ens0',encounter_frame
, '<?php echo $primary_docs['ens
'][2]; ?>');
812 $
(parent
.Title
.document
.getElementById('clear_active')).show();//To display Clear Active Patient button on selecting a patient
813 $
(parent
.Title
.document
.getElementById('clear_active_group')).hide();//To hide Clear Active group button on selecting a patient
817 // Call this to announce that the therapy group has changed. You must call this
818 // if you change the session 'therapy_group', so that the navigation frame will show the
820 function setTherapyGroup(group_id
, group_name
) {
823 $
(parent
.Title
.document
.querySelector('#current_patient_block span.text')).hide();
824 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>' );
825 if (group_id
== active_gid
) return;
826 setDivContent('current_encounter', '<b><?php xl('None
', 'e
'); ?></b>');
827 active_gid
= group_id
;
828 active_encounter
= 0;
829 encounter_locked
= false;
831 $
(parent
.Title
.document
.getElementById('current_patient_block')).show();
832 var encounter_block
= $
(parent
.Title
.document
.getElementById('current_encounter_block'));
833 $
(encounter_block
).hide();
835 // zero out the encounter frame, replace it with the encounter list frame
836 var f
= document
.forms
[0];
837 if ( f
.cb_top
.checked
&& f
.cb_bot
.checked
) {
838 var encounter_frame
= getEncounterTargetFrame('enc');
839 if ( encounter_frame
!= undefined
) {
840 loadFrame('ens0',encounter_frame
, '<?php echo $primary_docs['ens
'][2]; ?>');
844 $
(parent
.Title
.document
.getElementById('clear_active_group')).show();//To display Clear Active group button on selecting a patient
845 $
(parent
.Title
.document
.getElementById('clear_active')).hide();//To hide Clear Active Patient button on selecting a patient
848 function setPatientEncounter(EncounterIdArray
,EncounterDateArray
,CalendarCategoryArray
) {
849 //This function lists all encounters of the patient.
850 //This function writes the drop down in the top frame.
851 //It is called when a new patient is create/selected from the search menu.
852 var str
= '<Select class="text" id="EncounterHistory" onchange="{top.restoreSession();toencounter(this.options[this.selectedIndex].value)}">';
853 str+
='<option value=""><?php echo htmlspecialchars(xl('Encounter History
'), ENT_QUOTES) ?></option>';
854 <?php
if (acl_check_form('newpatient', '', array('write', 'addonly'))) { ?
>
855 str+
='<option value="New Encounter"><?php echo htmlspecialchars(xl('New Encounter
'), ENT_QUOTES) ?></option>';
857 str+
='<option value="Past Encounter List"><?php echo htmlspecialchars(xl('Past Encounter
List'), ENT_QUOTES) ?></option>';
858 for(CountEncounter
=0;CountEncounter
<EncounterDateArray
.length
;CountEncounter++
)
860 str+
='<option value="'+EncounterIdArray
[CountEncounter
]+
'~'+EncounterDateArray
[CountEncounter
]+
'">'+EncounterDateArray
[CountEncounter
]+
'-'+CalendarCategoryArray
[CountEncounter
]+
'</option>';
863 $
(parent
.Title
.document
.getElementById('past_encounter_block')).show();
864 top
.window
.parent
.Title
.document
.getElementById('past_encounter').innerHTML
=str
;
867 function loadCurrentPatientFromTitle() {
868 top
.restoreSession();
869 top
.frames
['RTop'].location
='../patient_file/summary/demographics.php';
872 function loadCurrentGroupFromTitle(gid
) {
873 top
.restoreSession();
874 top
.frames
['RTop'].location
='../therapy_groups/index.php?method=groupDetails&group_id=' + gid
;
877 function getEncounterTargetFrame( name
) {
878 var bias
= <?php
echo $primary_docs[ 'enc' ][ 1 ]?
>;
879 var f
= document
.forms
[0];
881 if (f
.cb_top
.checked
&& f
.cb_bot
.checked
) {
888 if ( f
.cb_top
.checked
) {
890 } else if ( f
.cb_bot
.checked
) {
897 function isEncounterLocked( encounterId
) {
898 <?php
if ($esignApi->lockEncounters()) { ?
>
899 // If encounter locking is enabled, make a syncronous call (async=false) to check the
900 // DB to see if the encounter is locked.
901 // Call restore session, just in case
902 top
.restoreSession();
905 url
: '<?php echo $GLOBALS['webroot
']?>/interface/esign/index.php?module=encounter&method=esign_is_encounter_locked',
906 data
: { encounterId
: encounterId
},
907 success
: function( data
) {
908 encounter_locked
= data
;
913 return encounter_locked
;
915 // If encounter locking isn't enabled, just tell the left_nav that the encounter
921 // Call this to announce that the encounter has changed. You must call this
922 // if you change the session encounter, so that the navigation frame will
923 // show the correct encounter and so that the other frame will be reloaded if
924 // it contains encounter-specific information from the previous encounter.
925 // frname is the name of the frame that the call came from, so we know to only
926 // reload encounter-specific content from the *other* frame.
927 function setEncounter(edate
, eid
, frname
) {
928 if (eid
== active_encounter
) return;
929 if (!eid
) edate
= '<?php xl('None
', 'e
'); ?>';
930 var str
= '<b>' + edate +
'</b>';
931 setDivContent('current_encounter', str
);
932 active_encounter
= eid
;
933 encounter_locked
=isEncounterLocked(active_encounter
);
934 reloadEncounter(frname
);
936 var encounter_block
= $
(parent
.Title
.document
.getElementById('current_encounter_block'));
937 var encounter
= $
(parent
.Title
.document
.getElementById('current_encounter'));
938 var estr
= '<a href=\'javascript:;\' onclick="parent.left_nav.loadCurrentEncounterFromTitle()"><b>' + edate +
' (' + eid +
')</b></a>';
939 encounter
.html( estr
);
940 encounter_block
.show();
943 function loadCurrentEncounterFromTitle() {
944 top
.restoreSession();
945 top
.frames
[ parent
.left_nav
.getEncounterTargetFrame('enc') ].location
='../patient_file/encounter/encounter_top.php';
948 // You must call this if you delete the active patient (or if for any other
949 // reason you "close" the active patient without opening a new one), so that
950 // the appearance of the navigation frame will be correct and so that any
951 // stale content will be reloaded.
952 function clearPatient() {
953 if (active_pid
== 0) return;
954 var f
= document
.forms
[0];
956 active_encounter
= 0;
957 encounter_locked
= false;
958 setDivContent('current_patient', '<b><?php xl('None
', 'e
'); ?></b>');
959 $
(parent
.Title
.document
.getElementById('current_patient_block')).hide();
960 top
.window
.parent
.Title
.document
.getElementById('past_encounter').innerHTML
='';
961 $
(parent
.Title
.document
.getElementById('current_encounter_block')).hide();
966 // You must call this if you delete the active therapy group so that
967 // the appearance of the navigation frame will be correct and so that any
968 // stale content will be reloaded.
969 function clearTherapyGroup() {
970 if (active_gid
== 0) return;
971 var f
= document
.forms
[0];
973 active_encounter
= 0;
974 encounter_locked
= false;
975 setDivContent('current_patient', '<b><?php xl('None
', 'e
'); ?></b>');
976 $
(parent
.Title
.document
.getElementById('current_patient_block')).hide();
977 top
.window
.parent
.Title
.document
.getElementById('past_encounter').innerHTML
='';
978 $
(parent
.Title
.document
.getElementById('current_encounter_block')).hide();
982 // You must call this if you delete the active encounter (or if for any other
983 // reason you "close" the active encounter without opening a new one), so that
984 // the appearance of the navigation frame will be correct and so that any
985 // stale content will be reloaded.
986 function clearEncounter() {
987 if (active_encounter
== 0) return;
988 top
.window
.parent
.Title
.document
.getElementById('current_encounter').innerHTML
="<b><?php echo htmlspecialchars(xl('None'), ENT_QUOTES) ?></b>";
989 active_encounter
= 0;
990 encounter_locked
= false;
995 function removeOptionSelected(EncounterId
)
996 {//Removes an item from the Encounter drop down.
997 var elSel
= top
.window
.parent
.Title
.document
.getElementById('EncounterHistory');
999 for (i
= elSel
.length
- 1; i
>=2; i
--) {
1000 EncounterHistoryValue
=elSel
.options
[i
].value
;
1001 EncounterHistoryValueArray
=EncounterHistoryValue
.split('~');
1002 if (EncounterHistoryValueArray
[0]==EncounterId
) {
1008 // You can call this to make sure the session pid is what we expect.
1009 function pidSanityCheck(pid
) {
1010 if (pid
!= active_pid
) {
1011 alert('Session patient ID is ' + pid +
', expecting ' + active_pid +
1012 '. This session is unstable and should be abandoned. Do not use ' +
1013 'OpenEMR in multiple browser windows!');
1019 // You can call this to make sure the session encounter is what we expect.
1020 function encounterSanityCheck(eid
) {
1021 if (eid
!= active_encounter
) {
1022 alert('Session encounter ID is ' + eid +
', expecting ' + active_encounter +
1023 '. This session is unstable and should be abandoned. Do not use ' +
1024 'OpenEMR in multiple browser windows!');
1031 function repPopup(aurl
) {
1032 top
.restoreSession();
1033 window
.open('<?php echo "$web_root/interface/reports/" ?>' + aurl
, '_blank', 'width=750,height=550,resizable=1,scrollbars=1');
1037 // This is invoked to pop up some window when a popup item is selected.
1038 function selpopup(selobj
) {
1039 var i
= selobj
.selectedIndex
;
1040 var opt
= selobj
.options
[i
];
1044 if (opt
.text
== 'Export' || opt
.text
== 'Import') {
1048 dlgopen(opt
.value
, '_blank', width
, height
);
1050 selobj
.selectedIndex
= 0;
1053 // Treeview activation stuff:
1054 $
(document
).ready(function(){
1055 if(1 == <?php
echo $GLOBALS['menu_styling_vertical'] ?
>){
1056 $
("#navigation-slide > li > a.collapsed + ul").slideToggle("medium");
1057 $
("#navigation-slide > li > ul > li > a.collapsed_lv2 + ul").slideToggle("medium");
1058 $
("#navigation-slide > li > ul > li > ul > li > a.collapsed_lv3 + ul").slideToggle("medium");
1059 $
("#navigation-slide > li > a.expanded").click(function() {
1060 $
("#navigation-slide > li > a.expanded").not(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1061 $
(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1063 $
("#navigation-slide > li > a.collapsed").click(function() {
1064 $
("#navigation-slide > li > a.expanded").not(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1065 $
(this
).toggleClass("expanded").toggleClass("collapsed").parent().find('> ul').slideToggle("medium");
1067 $
("#navigation-slide > li > ul > li > a.expanded_lv2").click(function() {
1068 $
("#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");
1069 $
(this
).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1071 $
("#navigation-slide > li > ul > li > ul > li > a.expanded_lv3").click(function() {
1072 $
("#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");
1073 $
(this
).toggleClass("expanded_lv3").toggleClass("collapsed_lv3").parent().find('> ul').slideToggle("medium");
1075 $
("#navigation-slide > li > ul > li > a.collapsed_lv2").click(function() {
1076 $
("#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");
1077 $
(this
).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1079 $
("#navigation-slide > li > ul > li > ul > li > a.collapsed_lv3").click(function() {
1080 $
("#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");
1081 $
(this
).toggleClass("expanded_lv2").toggleClass("collapsed_lv2").parent().find('> ul').slideToggle("medium");
1083 $
("#navigation-slide > li > a#cal0").prepend('<i class="fa fa-fw fa-calendar fa-2x"></i> ');
1084 $
("#navigation-slide > li > a#pfb0").prepend('<i class="fa fa-fw fa-list-alt fa-2x"></i> ');
1085 $
("#navigation-slide > li > a#rcb0").prepend('<i class="fa fa-fw fa-calendar-minus-o fa-2x"></i> ');
1086 $
("#navigation-slide > li > a#msg0").prepend('<i class="fa fa-fw fa-envelope-o fa-2x"></i> ');
1087 $
("#navigation-slide > li > a#app0").prepend('<i class="fa fa-fw fa-user fa-2x"></i> ');
1088 $
("#navigation-slide > li > a#aop0").prepend('<i class="fa fa-fw fa-tachometer fa-2x"></i> ');
1089 $
("#navigation-slide > li > a#ppo0").prepend('<i class="fa fa-fw fa-users fa-2x"></i> ');
1090 $
("#navigation-slide > li > a#repimg").prepend('<i class="fa fa-fw fa-area-chart fa-2x"></i> ');
1091 $
("#navigation-slide > li > a#feeimg").prepend('<i class="fa fa-fw fa-dollar fa-2x"></i> ');
1092 $
("#navigation-slide > li > a#adm0").prepend('<i class="fa fa-fw fa-list-ol fa-2x"></i> ');
1093 $
("#navigation-slide > li > a#invimg").prepend('<i class="fa fa-fw fa-list-ol fa-2x"></i> ');
1094 $
("#navigation-slide > li > a#admimg").prepend('<i class="fa fa-fw fa-cogs fa-2x"></i> ');
1095 $
("#navigation-slide > li > a#misimg").prepend('<i class="fa fa-fw fa-cog fa-2x"></i> ');
1096 $
("#navigation-slide > li > a#proimg").prepend('<i class="fa fa-fw fa-stethoscope fa-2x"></i> ');
1097 $
("#navigation-slide > li > a#modimg").prepend('<i class="fa fa-fw fa-puzzle-piece fa-2x"></i> ');
1098 $
("#navigation-slide > li").each(function(index
) {
1099 if($
(" > ul > li", this
).size() == 0){
1100 $
(" > a", this
).addClass("collapsed");
1103 } else { // $GLOBALS['menu_styling_vertical'] == 0
1105 //Remove the links (used by the sliding menu) that will break treeview
1106 $
('a.collapsed').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1107 $
('a.collapsed_lv2').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1108 $
('a.collapsed_lv3').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1109 $
('a.expanded').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1110 $
('a.expanded_lv2').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1111 $
('a.expanded_lv3').each(function() { $
(this
).replaceWith('<span>'+$
(this
).text()+
'</span>'); });
1113 // Initiate treeview
1114 $
("#navigation").treeview({
1118 toggle
: function() {
1119 window
.console
&& console
.log("%o was toggled", this
);
1129 <body
class="body_nav main-left">
1131 <form method
='post' name
='find_patient' target
='RTop'
1132 action
='<?php echo $rootdir ?>/main/finder/patient_select.php'>
1133 <input type
="hidden" name
="csrf_token_form" value
="<?php echo attr(collectCsrfToken()); ?>" />
1136 <select name
='sel_frame' style
='background-color:transparent;font-size:9pt;width:100;'>
1137 <option value
='0'><?php
xl('Default', 'e'); ?
></option
>
1138 <option value
='1'><?php
xl('Top', 'e'); ?
></option
>
1139 <option value
='2'><?php
xl('Bottom', 'e'); ?
></option
>
1143 <table cellpadding
='0' cellspacing
='0' border
='0' width
='100%'>
1145 <td
class='smalltext' nowrap
>
1146 <input type
='checkbox' name
='cb_top' onclick
='toggleFrame(1)' <?php
echo $cb_top_chk ?
> />
1147 <b
><?php
xl('Top', 'e') ?
></b
>
1149 <td
class='smalltext' align
='right' nowrap
>
1150 <b
><?php
xl('Bot', 'e') ?
></b
>
1151 <input type
='checkbox' name
='cb_bot' onclick
='toggleFrame(2)' <?php
echo $cb_bot_chk ?
> />
1156 <?php
if ($GLOBALS['menu_styling_vertical'] == 1) { ?
>
1157 <ul id
="navigation-slide">
1158 <?php
} else { // ($GLOBALS['menu_styling_vertical'] == 0) ?>
1159 <ul id
="navigation">
1163 if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1164 genTreeLink('RTop', 'cal', xl('Calendar'));
1167 if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1168 genTreeLink('RTop', 'pfb', xl('Flow Board'));
1170 if (!$GLOBALS['disable_rcb'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1171 genTreeLink('RBot', 'rcb', xl('Recall Board'));
1173 if (acl_check('patients', 'notes')) {
1174 genTreeLink('RBot', 'msg', xl('Messages'));
1177 if ($GLOBALS['portal_offsite_enable'] && $GLOBALS['portal_offsite_address'] && acl_check('patientportal', 'portal')) {
1178 genTreeLink('RTop', 'app', xl('Portal Activity'));
1181 if ($GLOBALS['portal_onsite_two_enable'] && acl_check('patientportal', 'portal')) {
1182 genTreeLink('RTop', 'aop', xl('Portal Dashboard'));
1185 if ($GLOBALS['gbl_portal_cms_enable'] && acl_check('patientportal', 'portal')) {
1186 genPopLink(xl('CMS Portal'), '../cmsportal/list_requests.php', 'ppo0');
1190 <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
>
1192 <?php
if (acl_check('patients', 'demo')) {
1193 genMiscLink('RTop', 'fin', '0', xl('Patients'), 'main/finder/dynamic_finder.php');
1195 <?php
if (acl_check('patients', 'demo', '', 'write') ||
acl_check('patients', 'demo', '', 'addonly')) {
1196 genTreeLink('RTop', 'new', ($GLOBALS['full_new_patient_form'] ?
xl('New/Search') : xl('New')));
1198 <?php
if (acl_check('patients', 'demo')) {
1199 genTreeLink('RTop', 'dem', xl('Summary'));
1202 <?php
if (acl_check('patients', 'appt') ||
acl_check_form('newpatient', '', array('write', 'addonly'))) { ?
>
1203 <li
class="open"><a
class="expanded_lv2"><span
><?php
xl('Visits', 'e') ?
></span
></a
>
1205 <?php
if (acl_check_form('newpatient', '', array('write', 'addonly'))) {
1206 genTreeLink('RBot', 'nen', xl('Create Visit'));
1208 <?php
if (acl_check('patients', 'appt')) {
1209 genTreeLink('RBot', 'enc', xl('Current'));
1211 <?php
if (acl_check('patients', 'appt')) {
1212 genTreeLink('RBot', 'ens', xl('Visit History'));
1218 <?php
if (acl_check('patients', 'med')) { ?
>
1219 <li
><a
class="collapsed_lv2"><span
><?php
xl('Records', 'e') ?
></span
></a
>
1221 <?php
genTreeLink('RTop', 'prq', xl('Patient Record Request')); ?
>
1226 <?php
if ($GLOBALS['gbl_nav_visit_forms'] && acl_check('patients', 'demo')) { ?
>
1227 <li
><a
class="collapsed_lv2"><span
><?php
xl('Visit Forms', 'e') ?
></span
></a
>
1230 // Generate the items for visit forms, both traditional and LBF.
1233 $regrows = getFormsByCategory(); // defined in registry.inc
1234 foreach ($regrows as $entry) {
1235 $option_id = $entry['directory'];
1236 $title = trim($entry['nickname']);
1237 if ($option_id == 'fee_sheet') {
1240 if ($option_id == 'newpatient') {
1243 // Check permission to create forms of this type.
1244 $tmp = explode('|', $entry['aco_spec']);
1245 if (!empty($tmp[1])) {
1246 if (!acl_check($tmp[0], $tmp[1], '', 'write') && !acl_check($tmp[0], $tmp[1], '', 'addonly')) {
1250 if (empty($title)) {
1251 $title = $entry['name'];
1253 if ($entry['category'] != $reglastcat) {
1255 echo " </ul></li>\n";
1257 echo " <li><a class='collapsed_lv3'><span>" . xlt($entry['category']) . "</span></a><ul>\n";
1258 $reglastcat = $entry['category'];
1264 xl_form_title($title),
1271 echo " </ul></li>\n";
1276 <li
class="collapsed" ><a
class="collapsed_lv2"><span
><?php
echo xlt('Import') ?
></span
></a
>
1278 <?php
genMiscLink('RTop', 'ccr', '0', xlt('Upload'), 'patient_file/ccr_import.php'); ?
>
1279 <?php
genMiscLink('RTop', 'apr', '0', xlt('Pending Approval'), 'patient_file/ccr_pending_approval.php'); ?
>
1282 <?php
} // end if gbl_nav_visit_forms ?>
1287 <?php
if ($GLOBALS['enable_group_therapy']) : ?
>
1288 <li
><a
class="collapsed" id
="groupimg" ><i
class="fa fa-fw fa-users"></i
> 
;<span
><?php
xl('Group', 'e') ?
></span
></a
>
1290 <?php
genMiscLink('RTop', 'gfn', '0', xl('Groups'), 'therapy_groups/index.php?method=listGroups'); ?
>
1291 <?php
genTreeLink('RTop', 'gng', xl('New')); ?
>
1292 <?php
genTreeLink('RTop', 'gdg', xl('Group Details')); ?
>
1293 <li
><a
class="collapsed_lv2"><span
><?php
xl('Visits', 'e') ?
></span
></a
>
1295 <?php
genTreeLink('RBot', 'gcv', xl('Create Visit')); ?
>
1296 <?php
genTreeLink('RBot', 'gce', xl('Current')); ?
>
1297 <?php
genTreeLink('RBot', 'gvh', xl('Visit History')); ?
>
1305 <?php
// TajEmo Work by CB 2012/06/21 10:41:15 AM hides fees if disabled in globals ?>
1306 <?php
if ((!isset($GLOBALS['enable_fees_in_left_menu']) ||
$GLOBALS['enable_fees_in_left_menu'] == 1) &&
1307 (acl_check('encounters', 'coding') ||
acl_check('acct', 'eob') ||
acl_check('acct', 'bill', '', 'write'))) { ?
>
1308 <li
><a
class="collapsed" id
="feeimg" ><span
><?php
xl('Fees', 'e') ?
></span
></a
>
1310 <?php
if (acl_check('encounters', 'coding')) {
1311 genMiscLink('RBot', 'cod', '2', xl('Fee Sheet'), 'fee_sheet', false, true);
1313 <?php
if ($GLOBALS['use_charges_panel'] && acl_check('encounters', 'coding')) {
1314 genTreeLink('RBot', 'cod', xl('Charges'));
1316 <?php
if (acl_check('acct', 'bill', '', 'write')) {
1317 genMiscLink('RBot', 'pay', '1', xl('Payment'), 'patient_file/front_payment.php');
1319 <?php
if (acl_check('acct', 'bill', '', 'write')) {
1320 genMiscLink('RBot', 'bil', '1', xl('Checkout'), 'patient_file/pos_checkout.php?framed=1');
1322 <?php
if (!$GLOBALS['simplified_demographics'] && (acl_check('acct', 'bill', '', 'write') ||
acl_check('acct', 'eob', '', 'write'))) {
1323 genTreeLink('RTop', 'bil', xl('Billing'));
1325 <?php
if ($GLOBALS['enable_batch_payment'] && (acl_check('acct', 'bill', '', 'write') ||
acl_check('acct', 'eob', '', 'write'))) {
1326 genTreeLink('RTop', 'npa', xl('Batch Payments'), false, 2);
1328 <?php
if ($GLOBALS['enable_posting'] && acl_check('acct', 'eob', '', 'write')) {
1329 genMiscLink('RTop', 'eob', '0', xl('Posting'), 'billing/sl_eob_search.php');
1331 <?php
if ($GLOBALS['enable_edihistory_in_left_menu'] && acl_check('acct', 'eob')) {
1332 genTreeLink('RTop', 'edi', xl('EDI History'), false, 2);
1338 <?php
if (acl_check('menus', 'modle')) {?
>
1339 <li
><a
class="collapsed" id
="modimg" ><span
><?php
echo xlt('Modules') ?
></span
></a
>
1342 if (acl_check('admin', 'manage_modules')) {
1343 genMiscLink('RTop', 'adm', '0', xl('Manage Modules'), 'modules/zend_modules/public/Installer');
1347 <?php
//genTreeLink('RTop','ort',xl('Settings')); ?>
1349 $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");
1350 if (sqlNumRows($module_query)) {
1351 while ($modulerow = sqlFetchArray($module_query)) {
1352 $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
1353 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1354 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']));
1358 if ($modulerow['type'] == 0) {
1359 $modulePath = $GLOBALS['customModDir'];
1363 $modulePath = $GLOBALS['zendModDir'];
1366 if (sqlNumRows($module_hooks) == 0) {
1367 // module without hooks in module section
1368 $acl_section = strtolower($modulerow['mod_directory']);
1369 $disallowed[$acl_section] = zh_acl_check($_SESSION['authUserID'], $acl_section) ?
"" : "1";
1371 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$added;
1372 $mod_nick_name = $modulerow['mod_nick_name'] ?
$modulerow['mod_nick_name'] : $modulerow['mod_name'];
1373 genMiscLink2('RTop', $acl_section, '0', xlt($mod_nick_name), $relative_link);
1375 // module with hooks in module section
1378 while ($hookrow = sqlFetchArray($module_hooks)) {
1379 $disallowed[$hookrow['obj_name']] = !$disallowed['adm'] ||
zh_acl_check($_SESSION['authUserID'], $hookrow['obj_name']) ?
"" : "1";
1381 $relative_link ="modules/".$modulePath."/".$hookrow['mod_relative_link'].$hookrow['path'];
1382 $mod_nick_name = $hookrow['menu_name'] ?
$hookrow['menu_name'] : 'NoName';
1384 if ($jid==0 ||
($modid!=$hookrow['mod_id'])) {
1389 <li
><a
class="collapsed_lv2"><span
><?php
echo xlt($hookrow['mod_ui_name']); ?
></span
></a
>
1395 $modid = $hookrow['mod_id'];
1396 genMiscLink('RTop', $hookrow['obj_name'], '0', xlt($mod_nick_name), $relative_link);
1410 <?php
if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?
>
1411 <li
><a
class="collapsed" id
="invimg" ><span
><?php
xl('Inventory', 'e') ?
></span
></a
>
1413 <?php
genMiscLink('RTop', 'adm', '0', xl('Management'), 'drugs/drug_inventory.php'); ?
>
1414 <?php
genPopLink(xl('Destroyed'), 'destroyed_drugs_report.php'); ?
>
1419 <?php
if (acl_check('patients', 'lab')) { ?
>
1420 <li
><a
class="collapsed" id
="proimg" ><span
><?php
xl('Procedures', 'e') ?
></span
></a
>
1422 <?php
if (acl_check('admin', 'super')) {
1423 genTreeLink('RTop', 'orl', xl('Providers'));
1425 <?php
if (acl_check('admin', 'super')) {
1426 genTreeLink('RTop', 'ort', xl('Configuration'));
1428 <?php
if (acl_check('admin', 'super')) {
1429 genTreeLink('RTop', 'orc', xl('Load Compendium'));
1431 <?php
genTreeLink('RTop', 'orp', xl('Pending Review')); ?
>
1432 <?php
genTreeLink('RTop', 'orr', xl('Patient Results')); ?
>
1433 <?php
genTreeLink('RTop', 'lda', xl('Lab Overview')); ?
>
1434 <?php
genTreeLink('RTop', 'orb', xl('Batch Results')); ?
>
1435 <?php
genTreeLink('RTop', 'ore', xl('Electronic Reports')); ?
>
1436 <?php
genTreeLink('RTop', 'dld', xl('Lab Documents'));?
>
1442 if ($GLOBALS['erx_enable'] && acl_check('patients', 'rx')) {
1443 $newcrop_user_role = sqlQuery("SELECT newcrop_user_role FROM users WHERE username = '".$_SESSION['authUser']."'");
1444 if ($newcrop_user_role['newcrop_user_role']) {
1446 <li
><a
class="collapsed" id
="feeimg" ><span
><?php
xl('New Crop', 'e') ?
></span
></a
>
1448 <li
><a
class="collapsed_lv2"><span
><?php
xl('Status', 'e') ?
></span
></a
>
1450 <?php
genTreeLink('RTop', 'erx', xl('e-Rx')); ?
>
1451 <?php
genMiscLink('RTop', 'err', '0', xl('e-Rx Renewal'), 'eRx.php?page=status'); ?
>
1452 <?php
if ($newcrop_user_role['newcrop_user_role'] === 'erxadmin') {
1453 genMiscLink('RTop', 'ere', '0', xl('e-Rx EPCS'), 'eRx.php?page=epcs-admin');
1464 <?php
if (!$disallowed['adm']) { ?
>
1465 <li
><a
class="collapsed" id
="admimg" ><span
><?php
xl('Administration', 'e') ?
></span
></a
>
1467 <?php
if (acl_check('admin', 'super')) {
1468 genMiscLink('RTop', 'adm', '0', xl('Globals'), 'super/edit_globals.php');
1470 <?php
if (acl_check('admin', 'users')) {
1471 genMiscLink('RTop', 'adm', '0', xl('Facilities'), 'usergroup/facilities.php');
1473 <?php
if (acl_check('admin', 'users')) {
1474 genMiscLink('RTop', 'adm', '0', xl('Users'), 'usergroup/usergroup_admin.php');
1476 <?php
if (acl_check('admin', 'practice')) {
1477 genTreeLink('RTop', 'adb', xl('Addr Book'));
1480 // Changed the target URL from practice settings -> Practice Settings - Pharmacy... Dec 09,09 .. Visolve ... This replaces empty frame with Pharmacy window
1481 if (acl_check('admin', 'practice')) {
1482 genMiscLink('RTop', 'adm', '0', xl('Practice'), '../controller.php?practice_settings&pharmacy&action=list');
1484 <?php
if (acl_check('admin', 'superbill')) {
1485 genTreeLink('RTop', 'sup', xl('Codes'));
1487 <?php
if (acl_check('admin', 'super')) {
1488 genMiscLink('RTop', 'adm', '0', xl('Layouts'), 'super/edit_layout.php');
1490 <?php
if (acl_check('admin', 'super')) {
1491 genMiscLink('RTop', 'adm', '0', xl('Lists'), 'super/edit_list.php');
1493 <?php
if (acl_check('admin', 'acl')) {
1494 genMiscLink('RTop', 'adm', '0', xl('ACL'), 'usergroup/adminacl.php');
1496 <?php
if (acl_check('admin', 'super')) {
1497 genMiscLink('RTop', 'adm', '0', xl('Files'), 'super/manage_site_files.php');
1499 <?php
if (acl_check('admin', 'super')) {
1500 genMiscLink('RTop', 'adm', '0', xl('Backup'), 'main/backup.php');
1502 <?php
if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1503 genMiscLink('RTop', 'adm', '0', xl('Rules'), 'super/rules/index.php?action=browse!list');
1505 <?php
if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1506 genMiscLink('RTop', 'adm', '0', xl('Alerts'), 'super/rules/index.php?action=alerts!listactmgr');
1508 <?php
if (acl_check('admin', 'super') && $GLOBALS['enable_cdr']) {
1509 genMiscLink('RTop', 'adm', '0', xl('Patient Reminders'), 'patient_file/reminder/patient_reminders.php?mode=admin&patient_id=');
1511 <?php
if (($GLOBALS['include_de_identification']) && (acl_check('admin', 'super'))) {
1512 genMiscLink('RTop', 'adm', '0', xl('De Identification'), 'de_identification_forms/de_identification_screen1.php');
1514 <?php
if (($GLOBALS['include_de_identification']) && (acl_check('admin', 'super'))) {
1515 genMiscLink('RTop', 'adm', '0', xl('Re Identification'), 'de_identification_forms/re_identification_input_screen.php');
1517 <?php
if (acl_check('admin', 'super') && !empty($GLOBALS['code_types']['IPPF'])) {
1518 genMiscLink('RTop', 'adm', '0', xl('Export'), 'main/ippf_export.php');
1520 <li
><a
class="collapsed_lv2"><span
><?php
xl('Other', 'e') ?
></span
></a
>
1522 <?php
if (acl_check('admin', 'language')) {
1523 genMiscLink('RTop', 'adm', '0', xl('Language'), 'language/language.php');
1525 <?php
if (acl_check('admin', 'forms')) {
1526 genMiscLink('RTop', 'adm', '0', xl('Forms'), 'forms_admin/forms_admin.php');
1528 <?php
if (acl_check('admin', 'calendar') && !$GLOBALS['disable_calendar']) {
1529 genMiscLink('RTop', 'adm', '0', xl('Calendar'), 'main/calendar/index.php?module=PostCalendar&type=admin&func=modifyconfig');
1531 <?php
if (acl_check('admin', 'users')) {
1532 genMiscLink('RTop', 'adm', '0', xl('Logs'), 'logview/logview.php');
1535 if ($newcrop_user_role['newcrop_user_role'] ||
$GLOBALS['erx_enable']) {
1536 if (acl_check('admin', 'users')) {
1537 genMiscLink('RTop', 'adm', '0', xl('eRx Logs'), 'logview/erx_logview.php');
1541 <?php
if (acl_check('admin', 'users')) {
1542 genMiscLink('RTop', 'adm', '0', xl('Certificates'), 'usergroup/ssl_certificates_admin.php');
1544 <?php
if (acl_check('admin', 'super')) {
1545 genMiscLink('RTop', 'adm', '0', xl('Native Data Loads'), '../interface/super/load_codes.php');
1547 <?php
if (acl_check('admin', 'super')) {
1548 genMiscLink('RTop', 'adm', '0', xl('External Data Loads'), '../interface/code_systems/dataloads_ajax.php');
1550 <?php
if (acl_check('admin', 'super')) {
1551 genMiscLink('RTop', 'adm', '0', xl('Merge Patients'), 'patient_file/merge_patients.php');
1553 <?php
if (acl_check('admin', 'super')) {
1554 genMiscLink('RTop', 'adm', '0', xl('Import Holidays'), '../interface/main/holidays/import_holidays.php');
1556 <?php
if ($GLOBALS['enable_auditlog_encryption']) {
1557 genMiscLink('RTop', 'rep', '0', xl('Audit Log Tamper'), 'reports/audit_log_tamper_report.php');
1565 <li
><a
class="collapsed" id
="repimg" ><span
><?php
xl('Reports', 'e') ?
></span
></a
>
1568 $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
1569 obj_name=enabled_hooks AND ms.mod_id=msh.mod_id LEFT OUTER JOIN modules AS m ON m.mod_id=ms.mod_id
1570 WHERE fld_type=3 AND mod_active=1 AND sql_run=1 AND attached_to='reports' ORDER BY mod_id");
1571 if (sqlNumRows($module_query)) {
1574 while ($modulerow = sqlFetchArray($module_query)) {
1577 if ($modulerow['type'] == 0) {
1578 $modulePath = $GLOBALS['customModDir'];
1582 $modulePath = $GLOBALS['zendModDir'];
1585 $disallowed[$modulerow['obj_name']] = !$disallowed['adm'] ||
zh_acl_check($_SESSION['authUserID'], $modulerow['obj_name']) ?
"" : "1";
1587 $relative_link ="modules/".$modulePath."/".$modulerow['mod_relative_link'].$modulerow['path'];
1588 $mod_nick_name = $modulerow['menu_name'] ?
$modulerow['menu_name'] : 'NoName';
1590 if ($jid==0 ||
($modid!=$modulerow['mod_id'])) {
1595 <li
><a
class="collapsed_lv2"><span
><?php
echo xlt($modulerow['mod_ui_name']); ?
></span
></a
>
1601 $modid = $modulerow['mod_id'];
1602 genMiscLink('RTop', $modulerow['obj_name'], '0', xlt($mod_nick_name), $relative_link);
1608 <?php
if (acl_check('patients', 'demo') ||
acl_check('patients', 'med') ||
1609 (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions'])) { ?
>
1610 <li
><a
class="collapsed_lv2"><span
><?php
xl('Clients', 'e') ?
></span
></a
>
1612 <?php
if (acl_check('patients', 'demo')) {
1613 genMiscLink('RTop', 'rep', '0', xl('List'), 'reports/patient_list.php');
1615 <?php
if (acl_check('patients', 'rx') && !$GLOBALS['disable_prescriptions']) {
1616 genMiscLink('RTop', 'rep', '0', xl('Rx'), 'reports/prescriptions_report.php');
1618 <?php
if (acl_check('patients', 'med')) {
1619 genMiscLink('RTop', 'rep', '0', xl('Patient List Creation'), 'reports/patient_list_creation.php');
1621 <?php
if (acl_check('patients', 'med')) {
1622 genMiscLink('RTop', 'rep', '0', xl('Clinical'), 'reports/clinical_reports.php');
1624 <?php
if (acl_check('patients', 'med')) {
1625 genMiscLink('RTop', 'rep', '0', xl('Referrals'), 'reports/referrals_report.php');
1627 <?php
if (acl_check('patients', 'med')) {
1628 genMiscLink('RTop', 'rep', '0', xl('Immunization Registry'), 'reports/immunization_report.php');
1634 <?php
if (acl_check('patients', 'med')) { ?
>
1635 <li
><a
class="collapsed_lv2"><span
><?php
xl('Clinic', 'e') ?
></span
></a
>
1637 <?php
if (($GLOBALS['enable_cdr'] ||
$GLOBALS['enable_cqm'] ||
$GLOBALS['enable_amc']) && acl_check('patients', 'med')) {
1638 genMiscLink('RTop', 'rep', '0', xl('Report Results'), 'reports/report_results.php');
1640 <?php
if ($GLOBALS['enable_cdr'] && acl_check('patients', 'med')) {
1641 genMiscLink('RTop', 'rep', '0', xl('Standard Measures'), 'reports/cqm.php?type=standard');
1643 <?php
if ($GLOBALS['enable_cqm'] && acl_check('patients', 'med')) {
1644 genMiscLink('RTop', 'rep', '0', xl('Quality Measures (CQM)'), 'reports/cqm.php?type=cqm');
1646 <?php
if ($GLOBALS['enable_amc'] && acl_check('patients', 'med')) {
1647 genMiscLink('RTop', 'rep', '0', xl('Automated Measures (AMC)'), 'reports/cqm.php?type=amc');
1649 <?php
if ($GLOBALS['enable_amc_tracking'] && acl_check('patients', 'med')) {
1650 genMiscLink('RTop', 'rep', '0', xl('AMC Tracking'), 'reports/amc_tracking.php');
1652 <?php
if ($GLOBALS['enable_cdr'] && $GLOBALS['enable_alert_log'] && acl_check('patients', 'med')) {
1653 genMiscLink('RTop', 'rep', '0', xl('Alerts Log'), 'reports/cdr_log.php');
1659 <li
><a
class="collapsed_lv2"><span
><?php
xl('Visits', 'e') ?
></span
></a
>
1661 <?php
if (acl_check('acct', 'rep_a')) {
1662 genMiscLink('RTop', 'rep', '0', xl('Daily Report'), 'reports/daily_summary_report.php');
1664 <?php
if (!$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1665 genMiscLink('RTop', 'rep', '0', xl('Appointments'), 'reports/appointments_report.php');
1667 <?php
if (!$GLOBALS['disable_pat_trkr'] && !$GLOBALS['disable_calendar'] && acl_check('patients', 'appt')) {
1668 genMiscLink('RTop', 'rep', '0', xl('Patient Flow Board'), 'reports/patient_flow_board_report.php');
1670 <?php
if (acl_check('encounters', 'coding_a')) {
1671 genMiscLink('RTop', 'rep', '0', xl('Encounters'), 'reports/encounters_report.php');
1673 <?php
if (!$GLOBALS['disable_calendar'] && acl_check('acct', 'rep_a')) {
1674 genMiscLink('RTop', 'rep', '0', xl('Appt-Enc'), 'reports/appt_encounter_report.php');
1676 <?php
if (empty($GLOBALS['code_types']['IPPF']) && acl_check('encounters', 'coding_a')) {
1677 genMiscLink('RTop', 'rep', '0', xl('Superbill'), 'reports/custom_report_range.php');
1679 <?php
if (acl_check('patients', 'demo')) {
1680 genMiscLink('RTop', 'rep', '0', xl('Eligibility'), 'reports/edi_270.php');
1682 <?php
if (acl_check('patients', 'demo')) {
1683 genMiscLink('RTop', 'rep', '0', xl('Eligibility Response'), 'reports/edi_271.php');
1685 <?php
if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1686 genMiscLink('RTop', 'rep', '0', xl('Chart Activity'), 'reports/chart_location_activity.php');
1688 <?php
if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1689 genMiscLink('RTop', 'rep', '0', xl('Charts Out'), 'reports/charts_checked_out.php');
1691 <?php
genMiscLink('RTop', 'rep', '0', xl('Services'), 'reports/services_by_category.php'); ?
>
1692 <?php
if (acl_check('patients', 'med')) {
1693 genMiscLink('RTop', 'rep', '0', xl('Syndromic Surveillance'), 'reports/non_reported.php');
1698 <?php
if (acl_check('acct', 'rep_a')) { ?
>
1699 <li
><a
class="collapsed_lv2"><span
><?php
xl('Financial', 'e') ?
></span
></a
>
1701 <?php
genMiscLink('RTop', 'rep', '0', xl('Sales'), 'reports/sales_by_item.php'); ?
>
1702 <?php
genMiscLink('RTop', 'rep', '0', xl('Cash Rec'), 'billing/sl_receipts_report.php'); ?
>
1703 <?php
genMiscLink('RTop', 'rep', '0', xl('Front Rec'), 'reports/front_receipts_report.php'); ?
>
1704 <?php
genMiscLink('RTop', 'rep', '0', xl('Pmt Method'), 'reports/receipts_by_method_report.php'); ?
>
1705 <?php
genMiscLink('RTop', 'rep', '0', xl('Collections'), 'reports/collections_report.php'); ?
>
1706 <?php
genMiscLink('RTop', 'rep', '0', xl('Pat Ledger'), 'reports/pat_ledger.php?form=0'); ?
>
1707 <?php
genMiscLink('RTop', 'rep', '0', xl('Financial Summary by Service Code'), 'reports/svc_code_financial_report.php'); ?
>
1712 <?php
if ($GLOBALS['inhouse_pharmacy'] && acl_check('admin', 'drugs')) { ?
>
1713 <li
><a
class="collapsed_lv2"><span
><?php
xl('Inventory', 'e') ?
></span
></a
>
1715 <?php
genMiscLink('RTop', 'rep', '0', xl('List'), 'reports/inventory_list.php'); ?
>
1716 <?php
genMiscLink('RTop', 'rep', '0', xl('Activity'), 'reports/inventory_activity.php'); ?
>
1717 <?php
genMiscLink('RTop', 'rep', '0', xl('Transactions'), 'reports/inventory_transactions.php'); ?
>
1722 <?php
if (acl_check('patients', 'lab')) { ?
>
1723 <li
><a
class="collapsed_lv2"><span
><?php
xl('Procedures', 'e') ?
></span
></a
>
1725 <?php
genPopLink(xl('Pending Res'), '../orders/pending_orders.php'); ?
>
1726 <?php
if (!empty($GLOBALS['code_types']['IPPF'])) {
1727 genPopLink(xl('Pending F/U'), '../orders/pending_followup.php');
1729 <?php
genPopLink(xl('Statistics'), '../orders/procedure_stats.php'); ?
>
1734 <?php
if (!$GLOBALS['simplified_demographics'] && (acl_check('acct', 'rep_a') ||
acl_check('patients', 'demo'))) { ?
>
1735 <li
><a
class="collapsed_lv2"><span
><?php
xl('Insurance', 'e') ?
></span
></a
>
1737 <?php
if (acl_check('acct', 'rep_a')) {
1738 genMiscLink('RTop', 'rep', '0', xl('Distribution'), 'reports/insurance_allocation_report.php');
1740 <?php
if (acl_check('acct', 'rep_a')) {
1741 genMiscLink('RTop', 'rep', '0', xl('Indigents'), 'billing/indigent_patients_report.php');
1743 <?php
if (acl_check('patients', 'demo')) {
1744 genMiscLink('RTop', 'rep', '0', xl('Unique SP'), 'reports/unique_seen_patients_report.php');
1750 <?php
if (!empty($GLOBALS['code_types']['IPPF']) && acl_check('acct', 'rep_a')) { ?
>
1751 <li
><a
class="collapsed_lv2"><span
><?php
xl('Statistics', 'e') ?
></span
></a
>
1753 <?php
genPopLink(xl('IPPF Stats'), 'ippf_statistics.php?t=i'); ?
>
1754 <?php
genPopLink(xl('GCAC Stats'), 'ippf_statistics.php?t=g'); ?
>
1755 <?php
genPopLink(xl('MA Stats'), 'ippf_statistics.php?t=m'); ?
>
1756 <?php
genPopLink(xl('CYP'), 'ippf_cyp_report.php'); ?
>
1757 <?php
genPopLink(xl('Daily Record'), 'ippf_daily.php'); ?
>
1760 <?php
} // end ippf-specific ?>
1762 <li
><a
class="collapsed_lv2"><span
><?php
xl('Blank Forms', 'e') ?
></span
></a
>
1765 echo " <li><a class='collapsed_lv3'><span>" . xlt('Core') . "</span></a><ul>\n";
1766 genPopLink(xl('Demographics'), '../patient_file/summary/demographics_print.php');
1767 genPopLink(xl('Superbill/Fee Sheet'), '../patient_file/printed_fee_sheet.php');
1768 // genPopLink(xl('Referral'),'../patient_file/transaction/print_referral.php');
1769 echo " </ul></li>\n";
1771 // Generate the blank form items for LBF visit forms.
1774 $regrows = getFormsByCategory('1', true); // defined in registry.inc
1775 foreach ($regrows as $entry) {
1776 $option_id = $entry['directory'];
1777 $title = trim($entry['nickname']);
1778 $tmp = explode('|', $entry['aco_spec']);
1779 if (!empty($tmp[1])) {
1780 if (!acl_check($tmp[0], $tmp[1])) {
1784 if (empty($title)) {
1785 $title = $entry['name'];
1787 if ($entry['category'] != $reglastcat) {
1789 echo " </ul></li>\n";
1791 echo " <li><a class='collapsed_lv3'><span>" . xlt($entry['category']) . "</span></a><ul>\n";
1792 $reglastcat = $entry['category'];
1794 genPopLink(xl_form_title($title), "../forms/LBF/printable.php?formname=" . urlencode($option_id));
1797 echo " </ul></li>\n";
1803 <?php
if (acl_check('admin', 'batchcom')) { ?
>
1804 <li
><a
class="collapsed_lv2"><span
><?php
echo xlt('Services') ?
></span
></a
>
1806 <?php
genMiscLink('RTop', 'rep', '0', xl('Background Services'), 'reports/background_services.php'); ?
>
1807 <?php
genMiscLink('RTop', 'rep', '0', xl('Direct Message Log'), 'reports/direct_message_log.php'); ?
>
1815 <li
><a
class="collapsed" id
="misimg" ><span
><?php
xl('Miscellaneous', 'e') ?
></span
></a
>
1817 <?php
genTreeLink('RTop', 'ped', xl('Patient Education')); ?
>
1818 <?php
if (acl_check('encounters', 'auth')) {
1819 genTreeLink('RBot', 'aun', xl('Authorizations'));
1821 <?php
if (acl_check('patients', 'docs')) {
1822 genTreeLink('RTop', 'fax', xl('Fax/Scan'));
1824 <?php
if (acl_check('admin', 'practice')) {
1825 genTreeLink('RTop', 'adb', xl('Addr Book'));
1827 <?php
if (acl_check('admin', 'practice')) {
1828 genTreeLink('RTop', 'ort', xl('Order Catalog'));
1830 <?php
if (!$GLOBALS['disable_chart_tracker'] && acl_check('patients', 'appt')) {
1831 genTreeLink('RTop', 'cht', xl('Chart Tracker'));
1833 <?php
if (acl_check('encounters', 'notes')) {
1834 genTreeLink('RTop', 'ono', xl('Ofc Notes'));
1836 <?php
if (acl_check('admin', 'batchcom') ||
acl_check('admin', 'practice')) {
1837 genMiscLink('RTop', 'adm', '0', xl('BatchCom'), 'batchcom/batchcom.php');
1839 <?php
$myrow = sqlQuery("SELECT state FROM registry WHERE directory = 'track_anything'");
1840 if ($myrow['state']=='1') {
1841 genTreeLink('RTop', 'tan', xl('Configure Tracks'));
1843 <?php
if (!$GLOBALS['use_active_directory']) {
1844 genTreeLink('RTop', 'pwd', xl('Password'));
1846 <?php
genTreeLink('RTop', 'mfa', xl('MFA Manaagement')); ?
>
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",
1892 csrf_token_form
: "<?php echo attr(collectCsrfToken()); ?>"
1895 .done(function(data
) {
1896 // alert( "Data Loaded: " + data );
1898 .fail(function(xhr
, textStatus
, errorThrown
) {
1899 alert("Error:"+xhr
.responseText+
"\n"+textStatus+
"\n"+errorThrown
);
1901 .always(function() {
1902 // alert( "finished" );
1906 alert (err
.message
);