starting 3.1.0 development branch
[openemr.git] / interface / globals.php
blobbaa7d33891303a085696c3e6dff5c77dde3e1ed4
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 // Brazilian Portuguese // xl('Brazilian Portuguese')
96 // Chinese // xl('Chinese')
97 // Dutch // xl('Dutch')
98 // English (Indian) // xl('English (Indian)')
99 // English (Standard) // xl('English (Standard)')
100 // French // xl('French')
101 // German // xl('German')
102 // Greek // xl('Greek')
103 // Hebrew // xl('Hebrew')
104 // Norwegian // xl('Norwegian')
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");
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";
201 include_once (dirname(__FILE__) . "/../library/date_functions.php");
202 include_once (dirname(__FILE__) . "/../library/classes/Filtreatment_class.php");
204 // Default category for find_patient screen
205 $GLOBALS['default_category'] = 5;
206 $GLOBALS['default_event_title'] = 'Office Visit';
208 // The session name appears in cookies stored in the browser. If you have
209 // multiple OpenEMR installations running on the same server, you should
210 // customize this name so they cannot interfere with each other.
212 // Also, if modify session_name, then need to place the identical name in
213 // the phpmyadmin file here: openemr/phpmyadmin/libraries/session.inc.php
214 // at line 71. This was required after embedded new phpmyadmin version on
215 // 05-12-2009 by Brady. Hopefully will figure out a more appropriate fix.
216 session_name("OpenEMR");
218 session_start();
220 // Set this to 1 or 2 to activate support for the new frame layout.
221 // 0 = Old-style layout
222 // 1 = Navigation menu consists of pairs of radio buttons
223 // 2 = Navigation menu is a tree view
225 $GLOBALS['concurrent_layout'] = 2;
227 // If >0 this will enforce a separate PHP session for each top-level
228 // browser window. You must log in separately for each. This is not
229 // thoroughly tested yet and some browsers might have trouble with it,
230 // so make it 0 if you must. Alternatively, you can set it to 2 to be
231 // notified when the session ID changes.
232 $GLOBALS['restore_sessions'] = 1; // 0=no, 1=yes, 2=yes+debug
234 // used in Add new event for multiple providers
235 $GLOBALS['select_multi_providers'] = false;
237 // NOT functional. Always keep this value FALSE.
238 // Plan to remove when this functionally has been completely
239 // removed from code.
240 $GLOBALS['dutchpc'] = FALSE;
242 // Theme definition:
243 if ($GLOBALS['concurrent_layout']) {
244 $top_bg_line = ' bgcolor="#dddddd" ';
245 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
246 $bottom_bg_line = $top_bg_line;
247 $title_bg_line = ' bgcolor="#bbbbbb" ';
248 $nav_bg_line = ' bgcolor="#94d6e7" ';
249 } else {
250 $top_bg_line = ' bgcolor="#94d6e7" ';
251 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
252 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
253 $title_bg_line = ' bgcolor="#aaffff" ';
254 $nav_bg_line = ' bgcolor="#94d6e7" ';
256 $login_filler_line = ' bgcolor="#f7f0d5" ';
257 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
258 $css_header = "$rootdir/themes/style_sky_blue.css";
259 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
260 $linepic = "$rootdir/pic/repeat_vline9.gif";
261 $table_bg = ' bgcolor="#cccccc" ';
262 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
263 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
264 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
265 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
267 // The height in pixels of the Logo bar at the top of the login page:
268 $GLOBALS['logoBarHeight'] = 110;
269 // The height in pixels of the Navigation bar:
270 $GLOBALS['navBarHeight'] = 22;
271 // The height in pixels of the Title bar:
272 $GLOBALS['titleBarHeight'] = 20;
274 // The assistant word, MORE printed next to titles that can be clicked:
275 // Note this label gets translated here via the xl function
276 // -if you don't want it translated, then strip the xl function away
277 $tmore = xl('(More)');
278 // The assistant word, BACK printed next to titles that return to previous screens:
279 // Note this label gets translated here via the xl function
280 // -if you don't want it translated, then strip the xl function away
281 $tback = xl('(Back)');
283 // This is the idle logout function:
284 // if a page has not been refreshed within this many seconds, the interface
285 // will return to the login page
286 if (!empty($special_timeout)) {
287 $timeout = intval($special_timeout);
289 else {
290 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
291 $timeout = 7200;
294 //Version tags
296 $v_major = '3';
297 $v_minor = '1';
298 $v_patch = '0';
299 $tag = '-dev'; // minor revision number, should be empty for production releases
301 // This name appears on the login page and in the title bar of most windows.
302 // It's nice to customize this to be the name of your clinic.
303 $openemr_name = 'OpenEMR';
305 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
307 $rootdir = $GLOBALS['rootdir'];
308 $srcdir = $GLOBALS['srcdir'];
309 $login_screen = $GLOBALS['login_screen'];
310 $GLOBALS['css_header'] = $css_header;
311 $GLOBALS['backpic'] = $backpic;
312 $GLOBALS['rootdir'] = $rootdir;
314 // change these to reflect when the daily view should start to display times
315 // as well as it should end. ex schedule_start = 9 schedule_end = 17
316 // start end times in hours
317 $GLOBALS['schedule_start'] = 8;
318 $GLOBALS['schedule_end'] = 17;
320 // This is the time granularity of the calendar and the smallest interval
321 // in minutes for an appointment slot:
322 $GLOBALS['calendar_interval'] = 15;
324 // Include the authentication module code here, but the rule is
325 // if the file has the word "login" in the source code file name,
326 // don't include the authentication module - we do this to avoid
327 // include loops.
329 if (!$ignoreAuth) {
330 include_once("$srcdir/auth.inc");
333 // If you do not want your accounting system to have a customer added to it
334 // for each insurance company, then set this to true. SQL-Ledger currently
335 // (2005-03-21) does nothing useful with insurance companies as customers.
336 $GLOBALS['insurance_companies_are_not_customers'] = true;
338 // If OpenEMR is being used by an athletic team rather than in a traditional
339 // clinical setting, set this to true.
340 $GLOBALS['athletic_team'] = false;
342 // True if this is a weight loss clinic:
343 $GLOBALS['weight_loss_clinic'] = false;
345 // The telephone country code of this installation. 1 = USA.
346 // See http://www.wtng.info/ for a list.
347 $GLOBALS['phone_country_code'] = '1';
349 // This determines how appointments display on the calendar:
350 // 1 = lastname; 2 = last,first; 3 = last,first(title);
351 // 4 = last,first(title: description)
352 $GLOBALS['calendar_appt_style'] = 2;
354 // Make this true if you want providers to see all appointments by default
355 // and not just their own.
356 $GLOBALS['docs_see_entire_calendar'] = false;
358 // Set this to true if you want the drug database and support for in-house
359 // prescription dispensing.
360 $GLOBALS['inhouse_pharmacy'] = false;
362 // Make this nonzero if you want the ability to sell products other than
363 // prescription drugs. Also requires inhouse_pharmacy to be true.
364 // This allows selection of products from the Fee Sheet.
365 // Set this to 2 if you want a simplified interface (no templates, no
366 // prescription drugs), otherwise to 1.
367 $GLOBALS['sell_non_drug_products'] = 0;
369 // True to omit insurance and some other things from the demographics form:
370 $GLOBALS['simplified_demographics'] = false;
372 // True to omit form, route and interval which then become part of dosage:
373 $GLOBALS['simplified_prescriptions'] = false;
375 // True to omit method of payment from the copay panel:
376 $GLOBALS['simplified_copay'] = false;
378 // You may put text here as the default complaint in the New Patient form:
379 $GLOBALS['default_chief_complaint'] = '';
381 // This was added for sports teams needing to fill out injury forms, but might
382 // have other applications.
383 $GLOBALS['default_new_encounter_form'] = '';
385 // If you want a new encounter to be automatically created when appointment
386 // status is set to "@" (arrived), then make this true.
387 $GLOBALS['auto_create_new_encounters'] = true;
389 // If you don't want employer information, country, title in patient demographics.
390 $GLOBALS['omit_employers'] = false;
392 // This is for insurance billing and is specific to Medicare. Make it true
393 // to force the referring provider to be the same as the rendering provider,
394 // instead of coming from the patient demographics.
395 $GLOBALS['MedicareReferrerIsRenderer'] = false;
397 // You can set this to the category name of a document to link to from the
398 // patient summary page. Normally this is the category for insurance cards.
399 // This lets you click on the patient's name to see their ID card.
400 $GLOBALS['patient_id_category_name'] = '';
402 // Traditionally OpenEMR has allowed creation of user groups (not the same
403 // as access control groups). However this has never done anything very
404 // useful and creates confusion. Make this false if you really want it.
405 $GLOBALS['disable_non_default_groups'] = true;
407 // These are flags for some installation-specific customizations for which
408 // we have not yet figured out better parameters.
409 $GLOBALS['ippf_specific'] = false;
410 $GLOBALS['cene_specific'] = false;
412 // True to support discounts in the Checkout form by dollars instead of percentage.
413 $GLOBALS['discount_by_money'] = false;
415 // Set this to false if you want the doctors to be prompted to authorize
416 // patient notes created by others.
417 $GLOBALS['ignore_pnotes_authorization'] = true;
419 // This turns on the option of creating a new patient using the complete
420 // layout of the demographics form as well as a built-in search feature.
421 // Everyone should want this, but for now it's optional.
422 $GLOBALS['full_new_patient_form'] = true;
424 // Restrict non-authorized users to the "Schedule Facilities" (aka user_facilities table)
425 // set in User admin.
426 $GLOBALS['restrict_user_facility'] = false;
428 // If you want Hylafax support then uncomment and customize the following
429 // statements, and also customize custom/faxcover.txt:
431 // $GLOBALS['hylafax_server'] = 'localhost';
432 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
433 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
435 // For scanner support, uncomment and customize the following. This is
436 // the directory in which scanned-in documents may be found, and may for
437 // example be a smbfs-mounted share from the PC supporting the scanner:
439 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
441 // Customize these if you are using SQL-Ledger with OpenEMR, or if you are
442 // going to run sl_convert.php to convert from SQL-Ledger.
444 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
445 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
446 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
447 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
448 $sl_dbname = 'sql-ledger'; // sql-ledger database name
449 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
450 $sl_dbpass = 'secret'; // sql-ledger database login password
452 // Don't change anything below this line. ////////////////////////////
454 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
456 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
457 $_SESSION['pid'] = $_GET['pid'];
459 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
460 $_SESSION['pid'] = $_POST['pid'];
462 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
463 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
464 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
466 // global interface function to format text length using ellipses
467 function strterm($string,$length) {
468 if (strlen($string) >= ($length-3)) {
469 return substr($string,0,$length-3) . "...";
470 } else {
471 return $string;
475 // turn off PHP compatibility warnings
476 ini_set("session.bug_compat_warn","off");
478 //settings for cronjob
479 // SEND SMS NOTIFICATION BEFORE HH HOUR
480 $SMS_NOTIFICATION_HOUR = 50;
481 // SEND EMAIL NOTIFICATION BEFORE HH HOUR
482 $EMAIL_NOTIFICATION_HOUR = 50;
483 $SMS_GATEWAY_USENAME = 'SMS_GATEWAY_USENAME';
484 $SMS_GATEWAY_PASSWORD = 'SMS_GATEWAY_PASSWORD';
485 $SMS_GATEWAY_APIKEY = 'SMS_GATEWAY_APIKEY';