bug fix by visolveemr - authorize link change to improvwe workflow
[openemr.git] / interface / globals.php
blob2504cbda9576bd4f8e7906b93931a7f505b05050
1 <?php
2 /* $Id$ */
3 // ------------------------------------------------------------------------ //
4 // OpenEMR Electronic Medical Records System //
5 // Copyright (c) 2005-2008 oemr.org //
6 // <http://www.oemr.org/> //
7 // ------------------------------------------------------------------------ //
8 // This program is free software; you can redistribute it and/or modify //
9 // it under the terms of the GNU General Public License as published by //
10 // the Free Software Foundation; either version 2 of the License, or //
11 // (at your option) any later version. //
12 // //
13 // You may not change or alter any portion of this comment or credits //
14 // of supporting developers from this source code or any supporting //
15 // source code which is considered copyrighted (c) material of the //
16 // original comment or credit authors. //
17 // //
18 // This program is distributed in the hope that it will be useful, //
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
21 // GNU General Public License for more details. //
22 // //
23 // You should have received a copy of the GNU General Public License //
24 // along with this program; if not, write to the Free Software //
25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
26 // ------------------------------------------------------------------------ //
28 // Some important php.ini overrides. Defaults for these values are often
29 // too small. You might choose to adjust them further.
31 ini_set('memory_limit', '64M');
32 ini_set('session.gc_maxlifetime', '14400');
34 // Emulates register_globals = On. Moved to here from the bottom of this file
35 // to address security issues. Need to change everything requiring this!
36 $ps = strpos($_SERVER['REQUEST_URI'],"myadmin");
37 if ($ps === false) {
38 extract($_GET);
39 extract($_POST);
42 require_once(dirname(__FILE__) . "/../includes/config.php");
43 // Global variable file in which colors and paths are set for the interface.
44 ///////////////////////////////////////////////////////////////////
45 // THESE VALUES MUST BE SET BEFORE OPENEMR WILL FUNCTION:
46 ///////////////////////////////////////////////////////////////////
47 // Set this to the full absolute directory path for openemr:
48 $webserver_root = "/var/www/openemr";
50 // Set this to the relative html path, ie. what you would type into the web
51 // browser after the server address to get to OpenEMR. For example, if you
52 // type "http://127.0.0.1/clinic/openemr/" to load OpenEMR, set $web_root
53 // to "/clinic/openemr" without the trailing slash.
54 $web_root = "/openemr";
56 ///////////////////////////////////////////////////////////////////
58 // Collecting the utf8 disable flag from the sqlconf.php file in order
59 // to set the correct html encoding. utf8 vs iso-8859-1. If flag is set
60 // then set to iso-8859-1.
61 require_once(dirname(__FILE__) . "/../library/sqlconf.php");
62 if (!$disable_utf8_flag) {
63 ini_set('default_charset', 'utf-8');
65 else {
66 ini_set('default_charset', 'iso-8859-1');
69 // This is the return mail address used when sending prescriptions by email:
70 $GLOBALS['practice_return_email_path'] = "prescription_mail@example.com";
72 // Root directory, relative to the webserver root:
73 $GLOBALS['rootdir'] = "$web_root/interface";
74 // Absolute path to the source code include and headers file directory (Full path):
75 $GLOBALS['srcdir'] = "$webserver_root/library";
76 // Absolute path to the location of documentroot directory for use with include statements:
77 $GLOBALS['fileroot'] = "$webserver_root";
78 // Absolute path to the location of interface directory for use with include statements:
79 $include_root = "$webserver_root/interface";
80 // Absolute path to the location of documentroot directory for use with include statements:
81 $GLOBALS['webroot'] = $web_root;
83 $GLOBALS['template_dir'] = $GLOBALS['fileroot'] . "/templates/";
84 $GLOBALS['incdir'] = $include_root;
85 // Location of the login screen file
86 $GLOBALS['login_screen'] = "$rootdir/login_screen.php";
89 // Language Translations Control Section
92 // Current supported languages: // Allow capture of term for translation:
93 // Armenian // xl('Armenian')
94 // Bahasa Indonesia // xl('Bahasa Indonesia')
95 // Chinese // xl('Chinese')
96 // Dutch // xl('Dutch')
97 // English (Indian) // xl('English (Indian)')
98 // English (Standard) // xl('English (Standard)')
99 // French // xl('French')
100 // German // xl('German')
101 // Greek // xl('Greek')
102 // Hebrew // xl('Hebrew')
103 // Norwegian // xl('Norwegian')
104 // Portuguese (Brazilian) // xl('Portuguese (Brazilian)')
105 // Portuguese (European) // xl('Portuguese (European)')
106 // Russian // xl('Russian')
107 // Slovak // xl('Slovak')
108 // Spanish // xl('Spanish')
109 // Swedish // xl('Swedish')
111 // Login Menu Language Translation Configuration
113 // 'language_menu_login' toggle
114 // -If set to true then will allow language selection on login
115 // -If set to false then will not show menu in login and will use default (see below)
116 $GLOBALS['language_menu_login'] = true;
118 // 'language_menu_all' toggle
119 // -If set to true then show all languages in login menu
120 // -If set to false then only show chosen (see below) languages in login menu
121 $GLOBALS['language_menu_showall'] = true;
123 // 'language_menu_show' array
124 // -ONLY pertinent if above 'language_menu_all' toggle is set to false
125 // -Displays these chosen languages in the login menu
126 $GLOBALS['language_menu_show'] = array('English (Standard)','Swedish');
128 // 'language_default'
129 // -Sets the default language
130 // -If login menu is on, then it will be the 'Default' choice in menu
131 // -If login menu is off, then it will choose this language
132 $GLOBALS['language_default'] = "English (Standard)";
134 // Language translation options
135 // -The globals below allow granular control to turn off translation of
136 // several specific parts of OpenEMR.
138 // 'translate_layout'
139 // -If true, then will translate the layout information.
140 // -If false, will not translate the layout information.
141 // If false, then most of the demographics and patient data
142 // entry forms will not be translated.
143 $GLOBALS['translate_layout'] = true;
145 // 'translate_lists'
146 // -If true, then will translate the lists information.
147 // -If false, will not translate the lists information.
148 // If false, then many lists of information in forms
149 // and templates will be untranslated.
150 $GLOBALS['translate_lists'] = true;
152 // 'translate_gacl_groups'
153 // -If true, then will translate the access control group names.
154 // -If false, will not translate the access control group names.
155 $GLOBALS['translate_gacl_groups'] = true;
157 // 'translate_note_titles'
158 // -If true, then will translate the patient Form (note) titles.
159 // -If false, will not translate the patient Form (note) titles.
160 $GLOBALS['translate_form_titles'] = true;
162 // 'translate_document_categories'
163 // -If true, then will translate the document categories.
164 // -If false, will not translate the document categories.
165 $GLOBALS['translate_document_categories'] = true;
167 // 'translate_appt_categories'
168 // -If true, then will translate the appt categories.
169 // -If false, will not translate the appt categories.
170 $GLOBALS['translate_appt_categories'] = true;
172 // Include the translation engine. This will also call sql.inc to
173 // open the openemr mysql connection.
174 include_once (dirname(__FILE__) . "/../library/translation.inc.php");
177 // Lists and Layouts Control Section
180 // 'state_custom_addlist_widget'
181 // - If true, then will display a customized addlist widget for
182 // state list entries (will ask for title and abbreviation)
183 $GLOBALS['state_custom_addlist_widget'] = true;
185 // Data type options. This will set data types in forms that are not
186 // covered by a layout.
187 // 1 = single-selection list
188 // 2 = text field
189 // 26 = single-selection list with ability to add to the list (addlist widget)
190 // (the list entries below are only pertinent for data types 1 or 26)
192 // 'state_data_type'
193 $GLOBALS['state_data_type'] = 26;
194 $GLOBALS['state_list'] = "state";
196 // 'country_data_type'
197 $GLOBALS['country_data_type'] = 26;
198 $GLOBALS['country_list'] = "country";
200 // Vitals form and growth chart units (US and-or metrics)
201 // 1 = Show both US and metric (main unit is US)
202 // 2 = Show both US and metric (main unit is metric)
203 // 3 = Show US only
204 // 4 = Show metric only
205 $GLOBALS['units_of_measurement'] = 1;
207 // Flag to not show the old deprecated metric form in
208 // the unregistered section of the admin->forms module.
209 // (since 3.1.0, metric units are now used along with US units
210 // in the main vitals form; controlled by above setting)
211 $GLOBALS['disable_deprecated_metrics_form'] = true;
213 // Flags to turn off/on specific OpenEMR modules
214 $GLOBALS['disable_calendar'] = false;
215 $GLOBALS['disable_chart_tracker'] = false;
216 $GLOBALS['disable_immunizations'] = false;
217 $GLOBALS['disable_prescriptions'] = false;
219 // Option to set the top default window. By default, it is set
220 // to the calendar screen. The starting directory is
221 // interface/main/ , hence:
222 // The calendar screen is 'main_info.php' .
223 // The patient search/add screen is '../new/new.php' .
224 $GLOBALS['default_top_pane'] = 'main_info.php';
226 include_once (dirname(__FILE__) . "/../library/date_functions.php");
227 include_once (dirname(__FILE__) . "/../library/classes/Filtreatment_class.php");
229 // Default category for find_patient screen
230 $GLOBALS['default_category'] = 5;
231 $GLOBALS['default_event_title'] = 'Office Visit';
233 // The session name appears in cookies stored in the browser. If you have
234 // multiple OpenEMR installations running on the same server, you should
235 // customize this name so they cannot interfere with each other.
237 // Also, if modify session_name, then need to place the identical name in
238 // the phpmyadmin file here: openemr/phpmyadmin/libraries/session.inc.php
239 // at line 71. This was required after embedded new phpmyadmin version on
240 // 05-12-2009 by Brady. Hopefully will figure out a more appropriate fix.
241 session_name("OpenEMR");
243 session_start();
245 // Set this to 1 or 2 to activate support for the new frame layout.
246 // 0 = Old-style layout
247 // 1 = Navigation menu consists of pairs of radio buttons
248 // 2 = Navigation menu is a tree view
250 $GLOBALS['concurrent_layout'] = 2;
252 // If >0 this will enforce a separate PHP session for each top-level
253 // browser window. You must log in separately for each. This is not
254 // thoroughly tested yet and some browsers might have trouble with it,
255 // so make it 0 if you must. Alternatively, you can set it to 2 to be
256 // notified when the session ID changes.
257 $GLOBALS['restore_sessions'] = 1; // 0=no, 1=yes, 2=yes+debug
259 // used in Add new event for multiple providers
260 $GLOBALS['select_multi_providers'] = false;
262 // NOT functional. Always keep this value FALSE.
263 // Plan to remove when this functionally has been completely
264 // removed from code.
265 $GLOBALS['dutchpc'] = FALSE;
267 // Theme definition:
268 if ($GLOBALS['concurrent_layout']) {
269 $top_bg_line = ' bgcolor="#dddddd" ';
270 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
271 $bottom_bg_line = $top_bg_line;
272 $title_bg_line = ' bgcolor="#bbbbbb" ';
273 $nav_bg_line = ' bgcolor="#94d6e7" ';
274 } else {
275 $top_bg_line = ' bgcolor="#94d6e7" ';
276 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
277 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
278 $title_bg_line = ' bgcolor="#aaffff" ';
279 $nav_bg_line = ' bgcolor="#94d6e7" ';
281 $login_filler_line = ' bgcolor="#f7f0d5" ';
282 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
283 $css_header = "$rootdir/themes/style_sky_blue.css";
284 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
285 $linepic = "$rootdir/pic/repeat_vline9.gif";
286 $table_bg = ' bgcolor="#cccccc" ';
287 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
288 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
289 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
290 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
292 // The height in pixels of the Logo bar at the top of the login page:
293 $GLOBALS['logoBarHeight'] = 110;
294 // The height in pixels of the Navigation bar:
295 $GLOBALS['navBarHeight'] = 22;
296 // The height in pixels of the Title bar:
297 $GLOBALS['titleBarHeight'] = 20;
299 // The assistant word, MORE printed next to titles that can be clicked:
300 // Note this label gets translated here via the xl function
301 // -if you don't want it translated, then strip the xl function away
302 $tmore = xl('(More)');
303 // The assistant word, BACK printed next to titles that return to previous screens:
304 // Note this label gets translated here via the xl function
305 // -if you don't want it translated, then strip the xl function away
306 $tback = xl('(Back)');
308 // This is the idle logout function:
309 // if a page has not been refreshed within this many seconds, the interface
310 // will return to the login page
311 if (!empty($special_timeout)) {
312 $timeout = intval($special_timeout);
314 else {
315 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
316 $timeout = 7200;
319 //Version tags
321 $v_major = '3';
322 $v_minor = '2';
323 $v_patch = '0';
324 $tag = '-dev'; // minor revision number, should be empty for production releases
326 // This name appears on the login page and in the title bar of most windows.
327 // It's nice to customize this to be the name of your clinic.
328 $openemr_name = 'OpenEMR';
330 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
332 $rootdir = $GLOBALS['rootdir'];
333 $srcdir = $GLOBALS['srcdir'];
334 $login_screen = $GLOBALS['login_screen'];
335 $GLOBALS['css_header'] = $css_header;
336 $GLOBALS['backpic'] = $backpic;
337 $GLOBALS['rootdir'] = $rootdir;
339 // change these to reflect when the daily view should start to display times
340 // as well as it should end. ex schedule_start = 9 schedule_end = 17
341 // start end times in hours
342 $GLOBALS['schedule_start'] = 8;
343 $GLOBALS['schedule_end'] = 17;
345 // This is the time granularity of the calendar and the smallest interval
346 // in minutes for an appointment slot:
347 $GLOBALS['calendar_interval'] = 15;
349 // Include the authentication module code here, but the rule is
350 // if the file has the word "login" in the source code file name,
351 // don't include the authentication module - we do this to avoid
352 // include loops.
354 if (!$ignoreAuth) {
355 include_once("$srcdir/auth.inc");
358 // If you do not want your accounting system to have a customer added to it
359 // for each insurance company, then set this to true. SQL-Ledger currently
360 // (2005-03-21) does nothing useful with insurance companies as customers.
361 $GLOBALS['insurance_companies_are_not_customers'] = true;
363 // If OpenEMR is being used by an athletic team rather than in a traditional
364 // clinical setting, set this to true.
365 $GLOBALS['athletic_team'] = false;
367 // True if this is a weight loss clinic:
368 $GLOBALS['weight_loss_clinic'] = false;
370 // The telephone country code of this installation. 1 = USA.
371 // See http://www.wtng.info/ for a list.
372 $GLOBALS['phone_country_code'] = '1';
374 // This determines how appointments display on the calendar:
375 // 1 = lastname; 2 = last,first; 3 = last,first(title);
376 // 4 = last,first(title: description)
377 $GLOBALS['calendar_appt_style'] = 2;
379 // Make this true if you want providers to see all appointments by default
380 // and not just their own.
381 $GLOBALS['docs_see_entire_calendar'] = false;
383 // Set this to true if you want the drug database and support for in-house
384 // prescription dispensing.
385 $GLOBALS['inhouse_pharmacy'] = false;
387 // Make this nonzero if you want the ability to sell products other than
388 // prescription drugs. Also requires inhouse_pharmacy to be true.
389 // This allows selection of products from the Fee Sheet.
390 // Set this to 2 if you want a simplified interface (no templates, no
391 // prescription drugs), otherwise to 1.
392 $GLOBALS['sell_non_drug_products'] = 0;
394 // True to omit insurance and some other things from the demographics form:
395 $GLOBALS['simplified_demographics'] = false;
397 // True to omit form, route and interval which then become part of dosage:
398 $GLOBALS['simplified_prescriptions'] = false;
400 // True to omit method of payment from the copay panel:
401 $GLOBALS['simplified_copay'] = false;
403 // You may put text here as the default complaint in the New Patient form:
404 $GLOBALS['default_chief_complaint'] = '';
406 // This was added for sports teams needing to fill out injury forms, but might
407 // have other applications.
408 $GLOBALS['default_new_encounter_form'] = '';
410 // If you want a new encounter to be automatically created when appointment
411 // status is set to "@" (arrived), then make this true.
412 $GLOBALS['auto_create_new_encounters'] = true;
414 // If you don't want employer information, country, title in patient demographics.
415 $GLOBALS['omit_employers'] = false;
417 // This is for insurance billing and is specific to Medicare. Make it true
418 // to force the referring provider to be the same as the rendering provider,
419 // instead of coming from the patient demographics.
420 $GLOBALS['MedicareReferrerIsRenderer'] = false;
422 // You can set this to the category name of a document to link to from the
423 // patient summary page. Normally this is the category for insurance cards.
424 // This lets you click on the patient's name to see their ID card.
425 $GLOBALS['patient_id_category_name'] = '';
427 // Traditionally OpenEMR has allowed creation of user groups (not the same
428 // as access control groups). However this has never done anything very
429 // useful and creates confusion. Make this false if you really want it.
430 $GLOBALS['disable_non_default_groups'] = true;
432 // These are flags for some installation-specific customizations for which
433 // we have not yet figured out better parameters.
434 $GLOBALS['ippf_specific'] = false;
435 $GLOBALS['cene_specific'] = false;
437 // True to support discounts in the Checkout form by dollars instead of percentage.
438 $GLOBALS['discount_by_money'] = false;
440 // Set this to false if you want the doctors to be prompted to authorize
441 // patient notes created by others.
442 $GLOBALS['ignore_pnotes_authorization'] = true;
444 // This turns on the option of creating a new patient using the complete
445 // layout of the demographics form as well as a built-in search feature.
446 // Everyone should want this, but for now it's optional.
447 $GLOBALS['full_new_patient_form'] = true;
449 // This can be used to enable the old Charges panel for entering billing
450 // codes and payments. It is not recommended, as it was obsoleted by the
451 // Fee Sheet which is more complete and comprehensive.
452 $GLOBALS['use_charges_panel'] = false;
454 // Multi-facility Configuration
456 // Restrict non-authorized users to the "Schedule Facilities" (aka user_facilities table)
457 // set in User admin.
458 $GLOBALS['restrict_user_facility'] = false;
460 // Set a facility cookie, so browser keeps a default selected facility between logins.
461 $GLOBALS['set_facility_cookie'] = false;
463 // If you want Hylafax support then uncomment and customize the following
464 // statements, and also customize custom/faxcover.txt:
466 // $GLOBALS['hylafax_server'] = 'localhost';
467 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
468 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
470 // For scanner support, uncomment and customize the following. This is
471 // the directory in which scanned-in documents may be found, and may for
472 // example be a smbfs-mounted share from the PC supporting the scanner:
474 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
476 // Customize these if you are using SQL-Ledger with OpenEMR, or if you are
477 // going to run sl_convert.php to convert from SQL-Ledger.
479 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
480 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
481 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
482 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
483 $sl_dbname = 'sql-ledger'; // sql-ledger database name
484 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
485 $sl_dbpass = 'secret'; // sql-ledger database login password
487 // Don't change anything below this line. ////////////////////////////
489 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
491 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
492 $_SESSION['pid'] = $_GET['pid'];
494 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
495 $_SESSION['pid'] = $_POST['pid'];
497 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
498 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
499 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
501 // global interface function to format text length using ellipses
502 function strterm($string,$length) {
503 if (strlen($string) >= ($length-3)) {
504 return substr($string,0,$length-3) . "...";
505 } else {
506 return $string;
510 // turn off PHP compatibility warnings
511 ini_set("session.bug_compat_warn","off");
513 //settings for cronjob
514 // SEND SMS NOTIFICATION BEFORE HH HOUR
515 $SMS_NOTIFICATION_HOUR = 50;
516 // SEND EMAIL NOTIFICATION BEFORE HH HOUR
517 $EMAIL_NOTIFICATION_HOUR = 50;
518 $SMS_GATEWAY_USENAME = 'SMS_GATEWAY_USENAME';
519 $SMS_GATEWAY_PASSWORD = 'SMS_GATEWAY_PASSWORD';
520 $SMS_GATEWAY_APIKEY = 'SMS_GATEWAY_APIKEY';