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