preparing for 3.1.0 release
[openemr.git] / interface / globals.php
blob51a717180e684ab46f8d8bc541cacacf4e61885d
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 // Russian // xl('Russian')
106 // Slovak // xl('Slovak')
107 // Spanish // xl('Spanish')
108 // Swedish // xl('Swedish')
110 // Login Menu Language Translation Configuration
112 // 'language_menu_login' toggle
113 // -If set to true then will allow language selection on login
114 // -If set to false then will not show menu in login and will use default (see below)
115 $GLOBALS['language_menu_login'] = true;
117 // 'language_menu_all' toggle
118 // -If set to true then show all languages in login menu
119 // -If set to false then only show chosen (see below) languages in login menu
120 $GLOBALS['language_menu_showall'] = true;
122 // 'language_menu_show' array
123 // -ONLY pertinent if above 'language_menu_all' toggle is set to false
124 // -Displays these chosen languages in the login menu
125 $GLOBALS['language_menu_show'] = array('English (Standard)','Swedish');
127 // 'language_default'
128 // -Sets the default language
129 // -If login menu is on, then it will be the 'Default' choice in menu
130 // -If login menu is off, then it will choose this language
131 $GLOBALS['language_default'] = "English (Standard)";
133 // Language translation options
134 // -The globals below allow granular control to turn off translation of
135 // several specific parts of OpenEMR.
137 // 'translate_layout'
138 // -If true, then will translate the layout information.
139 // -If false, will not translate the layout information.
140 // If false, then most of the demographics and patient data
141 // entry forms will not be translated.
142 $GLOBALS['translate_layout'] = true;
144 // 'translate_lists'
145 // -If true, then will translate the lists information.
146 // -If false, will not translate the lists information.
147 // If false, then many lists of information in forms
148 // and templates will be untranslated.
149 $GLOBALS['translate_lists'] = true;
151 // 'translate_gacl_groups'
152 // -If true, then will translate the access control group names.
153 // -If false, will not translate the access control group names.
154 $GLOBALS['translate_gacl_groups'] = true;
156 // 'translate_note_titles'
157 // -If true, then will translate the patient Form (note) titles.
158 // -If false, will not translate the patient Form (note) titles.
159 $GLOBALS['translate_form_titles'] = true;
161 // 'translate_document_categories'
162 // -If true, then will translate the document categories.
163 // -If false, will not translate the document categories.
164 $GLOBALS['translate_document_categories'] = true;
166 // 'translate_appt_categories'
167 // -If true, then will translate the appt categories.
168 // -If false, will not translate the appt categories.
169 $GLOBALS['translate_appt_categories'] = true;
171 // Include the translation engine. This will also call sql.inc to
172 // open the openemr mysql connection.
173 include_once (dirname(__FILE__) . "/../library/translation.inc.php");
176 // Lists and Layouts Control Section
179 // 'state_custom_addlist_widget'
180 // - If true, then will display a customized addlist widget for
181 // state list entries (will ask for title and abbreviation)
182 $GLOBALS['state_custom_addlist_widget'] = true;
184 // Data type options. This will set data types in forms that are not
185 // covered by a layout.
186 // 1 = single-selection list
187 // 2 = text field
188 // 26 = single-selection list with ability to add to the list (addlist widget)
189 // (the list entries below are only pertinent for data types 1 or 26)
191 // 'state_data_type'
192 $GLOBALS['state_data_type'] = 26;
193 $GLOBALS['state_list'] = "state";
195 // 'country_data_type'
196 $GLOBALS['country_data_type'] = 26;
197 $GLOBALS['country_list'] = "country";
199 // Vitals form and growth chart units (US and-or metrics)
200 // 1 = Show both US and metric (main unit is US)
201 // 2 = Show both US and metric (main unit is metric)
202 // 3 = Show US only
203 // 4 = Show metric only
204 $GLOBALS['units_of_measurement'] = 1;
206 // Flag to not show the old deprecated metric form in
207 // the unregistered section of the admin->forms module.
208 // (since 3.1.0, metric units are now used along with US units
209 // in the main vitals form; controlled by above setting)
210 $GLOBALS['disable_deprecated_metrics_form'] = true;
212 include_once (dirname(__FILE__) . "/../library/date_functions.php");
213 include_once (dirname(__FILE__) . "/../library/classes/Filtreatment_class.php");
215 // Default category for find_patient screen
216 $GLOBALS['default_category'] = 5;
217 $GLOBALS['default_event_title'] = 'Office Visit';
219 // The session name appears in cookies stored in the browser. If you have
220 // multiple OpenEMR installations running on the same server, you should
221 // customize this name so they cannot interfere with each other.
223 // Also, if modify session_name, then need to place the identical name in
224 // the phpmyadmin file here: openemr/phpmyadmin/libraries/session.inc.php
225 // at line 71. This was required after embedded new phpmyadmin version on
226 // 05-12-2009 by Brady. Hopefully will figure out a more appropriate fix.
227 session_name("OpenEMR");
229 session_start();
231 // Set this to 1 or 2 to activate support for the new frame layout.
232 // 0 = Old-style layout
233 // 1 = Navigation menu consists of pairs of radio buttons
234 // 2 = Navigation menu is a tree view
236 $GLOBALS['concurrent_layout'] = 2;
238 // If >0 this will enforce a separate PHP session for each top-level
239 // browser window. You must log in separately for each. This is not
240 // thoroughly tested yet and some browsers might have trouble with it,
241 // so make it 0 if you must. Alternatively, you can set it to 2 to be
242 // notified when the session ID changes.
243 $GLOBALS['restore_sessions'] = 1; // 0=no, 1=yes, 2=yes+debug
245 // used in Add new event for multiple providers
246 $GLOBALS['select_multi_providers'] = false;
248 // NOT functional. Always keep this value FALSE.
249 // Plan to remove when this functionally has been completely
250 // removed from code.
251 $GLOBALS['dutchpc'] = FALSE;
253 // Theme definition:
254 if ($GLOBALS['concurrent_layout']) {
255 $top_bg_line = ' bgcolor="#dddddd" ';
256 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
257 $bottom_bg_line = $top_bg_line;
258 $title_bg_line = ' bgcolor="#bbbbbb" ';
259 $nav_bg_line = ' bgcolor="#94d6e7" ';
260 } else {
261 $top_bg_line = ' bgcolor="#94d6e7" ';
262 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
263 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
264 $title_bg_line = ' bgcolor="#aaffff" ';
265 $nav_bg_line = ' bgcolor="#94d6e7" ';
267 $login_filler_line = ' bgcolor="#f7f0d5" ';
268 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
269 $css_header = "$rootdir/themes/style_sky_blue.css";
270 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
271 $linepic = "$rootdir/pic/repeat_vline9.gif";
272 $table_bg = ' bgcolor="#cccccc" ';
273 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
274 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
275 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
276 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
278 // The height in pixels of the Logo bar at the top of the login page:
279 $GLOBALS['logoBarHeight'] = 110;
280 // The height in pixels of the Navigation bar:
281 $GLOBALS['navBarHeight'] = 22;
282 // The height in pixels of the Title bar:
283 $GLOBALS['titleBarHeight'] = 20;
285 // The assistant word, MORE printed next to titles that can be clicked:
286 // Note this label gets translated here via the xl function
287 // -if you don't want it translated, then strip the xl function away
288 $tmore = xl('(More)');
289 // The assistant word, BACK printed next to titles that return to previous screens:
290 // Note this label gets translated here via the xl function
291 // -if you don't want it translated, then strip the xl function away
292 $tback = xl('(Back)');
294 // This is the idle logout function:
295 // if a page has not been refreshed within this many seconds, the interface
296 // will return to the login page
297 if (!empty($special_timeout)) {
298 $timeout = intval($special_timeout);
300 else {
301 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
302 $timeout = 7200;
305 //Version tags
307 $v_major = '3';
308 $v_minor = '1';
309 $v_patch = '0';
310 $tag = ''; // minor revision number, should be empty for production releases
312 // This name appears on the login page and in the title bar of most windows.
313 // It's nice to customize this to be the name of your clinic.
314 $openemr_name = 'OpenEMR';
316 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
318 $rootdir = $GLOBALS['rootdir'];
319 $srcdir = $GLOBALS['srcdir'];
320 $login_screen = $GLOBALS['login_screen'];
321 $GLOBALS['css_header'] = $css_header;
322 $GLOBALS['backpic'] = $backpic;
323 $GLOBALS['rootdir'] = $rootdir;
325 // change these to reflect when the daily view should start to display times
326 // as well as it should end. ex schedule_start = 9 schedule_end = 17
327 // start end times in hours
328 $GLOBALS['schedule_start'] = 8;
329 $GLOBALS['schedule_end'] = 17;
331 // This is the time granularity of the calendar and the smallest interval
332 // in minutes for an appointment slot:
333 $GLOBALS['calendar_interval'] = 15;
335 // Include the authentication module code here, but the rule is
336 // if the file has the word "login" in the source code file name,
337 // don't include the authentication module - we do this to avoid
338 // include loops.
340 if (!$ignoreAuth) {
341 include_once("$srcdir/auth.inc");
344 // If you do not want your accounting system to have a customer added to it
345 // for each insurance company, then set this to true. SQL-Ledger currently
346 // (2005-03-21) does nothing useful with insurance companies as customers.
347 $GLOBALS['insurance_companies_are_not_customers'] = true;
349 // If OpenEMR is being used by an athletic team rather than in a traditional
350 // clinical setting, set this to true.
351 $GLOBALS['athletic_team'] = false;
353 // True if this is a weight loss clinic:
354 $GLOBALS['weight_loss_clinic'] = false;
356 // The telephone country code of this installation. 1 = USA.
357 // See http://www.wtng.info/ for a list.
358 $GLOBALS['phone_country_code'] = '1';
360 // This determines how appointments display on the calendar:
361 // 1 = lastname; 2 = last,first; 3 = last,first(title);
362 // 4 = last,first(title: description)
363 $GLOBALS['calendar_appt_style'] = 2;
365 // Make this true if you want providers to see all appointments by default
366 // and not just their own.
367 $GLOBALS['docs_see_entire_calendar'] = false;
369 // Set this to true if you want the drug database and support for in-house
370 // prescription dispensing.
371 $GLOBALS['inhouse_pharmacy'] = false;
373 // Make this nonzero if you want the ability to sell products other than
374 // prescription drugs. Also requires inhouse_pharmacy to be true.
375 // This allows selection of products from the Fee Sheet.
376 // Set this to 2 if you want a simplified interface (no templates, no
377 // prescription drugs), otherwise to 1.
378 $GLOBALS['sell_non_drug_products'] = 0;
380 // True to omit insurance and some other things from the demographics form:
381 $GLOBALS['simplified_demographics'] = false;
383 // True to omit form, route and interval which then become part of dosage:
384 $GLOBALS['simplified_prescriptions'] = false;
386 // True to omit method of payment from the copay panel:
387 $GLOBALS['simplified_copay'] = false;
389 // You may put text here as the default complaint in the New Patient form:
390 $GLOBALS['default_chief_complaint'] = '';
392 // This was added for sports teams needing to fill out injury forms, but might
393 // have other applications.
394 $GLOBALS['default_new_encounter_form'] = '';
396 // If you want a new encounter to be automatically created when appointment
397 // status is set to "@" (arrived), then make this true.
398 $GLOBALS['auto_create_new_encounters'] = true;
400 // If you don't want employer information, country, title in patient demographics.
401 $GLOBALS['omit_employers'] = false;
403 // This is for insurance billing and is specific to Medicare. Make it true
404 // to force the referring provider to be the same as the rendering provider,
405 // instead of coming from the patient demographics.
406 $GLOBALS['MedicareReferrerIsRenderer'] = false;
408 // You can set this to the category name of a document to link to from the
409 // patient summary page. Normally this is the category for insurance cards.
410 // This lets you click on the patient's name to see their ID card.
411 $GLOBALS['patient_id_category_name'] = '';
413 // Traditionally OpenEMR has allowed creation of user groups (not the same
414 // as access control groups). However this has never done anything very
415 // useful and creates confusion. Make this false if you really want it.
416 $GLOBALS['disable_non_default_groups'] = true;
418 // These are flags for some installation-specific customizations for which
419 // we have not yet figured out better parameters.
420 $GLOBALS['ippf_specific'] = false;
421 $GLOBALS['cene_specific'] = false;
423 // True to support discounts in the Checkout form by dollars instead of percentage.
424 $GLOBALS['discount_by_money'] = false;
426 // Set this to false if you want the doctors to be prompted to authorize
427 // patient notes created by others.
428 $GLOBALS['ignore_pnotes_authorization'] = true;
430 // This turns on the option of creating a new patient using the complete
431 // layout of the demographics form as well as a built-in search feature.
432 // Everyone should want this, but for now it's optional.
433 $GLOBALS['full_new_patient_form'] = true;
435 // Multi-facility Configuration
437 // Restrict non-authorized users to the "Schedule Facilities" (aka user_facilities table)
438 // set in User admin.
439 $GLOBALS['restrict_user_facility'] = false;
441 // Set a facility cookie, so browser keeps a default selected facility between logins.
442 $GLOBALS['set_facility_cookie'] = false;
444 // This can be used to enable the old Charges panel for entering billing
445 // codes and payments. It is not recommended, as it was obsoleted by the
446 // Fee Sheet which is more complete and comprehensive.
447 $GLOBALS['use_charges_panel'] = true;
449 // If you want Hylafax support then uncomment and customize the following
450 // statements, and also customize custom/faxcover.txt:
452 // $GLOBALS['hylafax_server'] = 'localhost';
453 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
454 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
456 // For scanner support, uncomment and customize the following. This is
457 // the directory in which scanned-in documents may be found, and may for
458 // example be a smbfs-mounted share from the PC supporting the scanner:
460 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
462 // Customize these if you are using SQL-Ledger with OpenEMR, or if you are
463 // going to run sl_convert.php to convert from SQL-Ledger.
465 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
466 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
467 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
468 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
469 $sl_dbname = 'sql-ledger'; // sql-ledger database name
470 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
471 $sl_dbpass = 'secret'; // sql-ledger database login password
473 // Don't change anything below this line. ////////////////////////////
475 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
477 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
478 $_SESSION['pid'] = $_GET['pid'];
480 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
481 $_SESSION['pid'] = $_POST['pid'];
483 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
484 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
485 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
487 // global interface function to format text length using ellipses
488 function strterm($string,$length) {
489 if (strlen($string) >= ($length-3)) {
490 return substr($string,0,$length-3) . "...";
491 } else {
492 return $string;
496 // turn off PHP compatibility warnings
497 ini_set("session.bug_compat_warn","off");
499 //settings for cronjob
500 // SEND SMS NOTIFICATION BEFORE HH HOUR
501 $SMS_NOTIFICATION_HOUR = 50;
502 // SEND EMAIL NOTIFICATION BEFORE HH HOUR
503 $EMAIL_NOTIFICATION_HOUR = 50;
504 $SMS_GATEWAY_USENAME = 'SMS_GATEWAY_USENAME';
505 $SMS_GATEWAY_PASSWORD = 'SMS_GATEWAY_PASSWORD';
506 $SMS_GATEWAY_APIKEY = 'SMS_GATEWAY_APIKEY';