Changed version to 3.0 to match new OpenEMR release.
[openemr.git] / interface / globals.php
blob6953f485118a1b8eea5cbf8f9a06ef1a6ff0b8e5
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 // This is the return mail address used when sending prescriptions by email:
59 $GLOBALS['practice_return_email_path'] = "prescription_mail@example.com";
61 // Root directory, relative to the webserver root:
62 $GLOBALS['rootdir'] = "$web_root/interface";
63 // Absolute path to the source code include and headers file directory (Full path):
64 $GLOBALS['srcdir'] = "$webserver_root/library";
65 // Absolute path to the location of documentroot directory for use with include statements:
66 $GLOBALS['fileroot'] = "$webserver_root";
67 // Absolute path to the location of interface directory for use with include statements:
68 $include_root = "$webserver_root/interface";
69 // Absolute path to the location of documentroot directory for use with include statements:
70 $GLOBALS['webroot'] = $web_root;
72 $GLOBALS['template_dir'] = $GLOBALS['fileroot'] . "/templates/";
73 $GLOBALS['incdir'] = $include_root;
74 // Location of the login screen file
75 $GLOBALS['login_screen'] = "$rootdir/login_screen.php";
77 // Language Control Section (will add toggling)
78 // English:1, Swedish:2, Spanish:3, German:4, Dutch:5, Hebrew:6
79 define ('LANGUAGE',1);
80 include_once (dirname(__FILE__) . "/../library/translation.inc.php");
82 include_once (dirname(__FILE__) . "/../library/date_functions.php");
83 include_once (dirname(__FILE__) . "/../library/classes/Filtreatment_class.php");
85 // Default category for find_patient screen
86 $GLOBALS['default_category'] = 5;
87 $GLOBALS['default_event_title'] = 'Office Visit';
89 // The session name appears in cookies stored in the browser. If you have
90 // multiple OpenEMR installations running on the same server, you should
91 // customize this name so they cannot interfere with each other.
92 session_name("OpenEMR");
94 session_start();
96 // Set this to 1 or 2 to activate support for the new frame layout.
97 // 0 = Old-style layout
98 // 1 = Navigation menu consists of pairs of radio buttons
99 // 2 = Navigation menu is a tree view
101 $GLOBALS['concurrent_layout'] = 1;
103 // If >0 this will enforce a separate PHP session for each top-level
104 // browser window. You must log in separately for each. This is not
105 // thoroughly tested yet and some browsers might have trouble with it,
106 // so make it 0 if you must. Alternatively, you can set it to 2 to be
107 // notified when the session ID changes.
108 $GLOBALS['restore_sessions'] = 1; // 0=no, 1=yes, 2=yes+debug
110 // used in Add new event for multiple providers
111 $GLOBALS['select_multi_providers'] = false;
113 // used for Dutch Mental Health Facility
114 $GLOBALS['dutchpc'] = FALSE;
116 if ( $GLOBALS['dutchpc'] ) {
117 include_once (dirname(__FILE__) . "/../library/DBC_include.php");
120 // Theme definition:
121 if ($GLOBALS['concurrent_layout']) {
122 $top_bg_line = ' bgcolor="#dddddd" ';
123 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
124 $bottom_bg_line = $top_bg_line;
125 $title_bg_line = ' bgcolor="#bbbbbb" ';
126 $nav_bg_line = ' bgcolor="#94d6e7" ';
127 } else {
128 $top_bg_line = ' bgcolor="#94d6e7" ';
129 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
130 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
131 $title_bg_line = ' bgcolor="#aaffff" ';
132 $nav_bg_line = ' bgcolor="#94d6e7" ';
134 $login_filler_line = ' bgcolor="#f7f0d5" ';
135 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
136 $css_header = "$rootdir/themes/style_sky_blue.css";
137 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
138 $linepic = "$rootdir/pic/repeat_vline9.gif";
139 $table_bg = ' bgcolor="#cccccc" ';
140 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
141 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
142 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
143 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
145 // The height in pixels of the Logo bar at the top of the login page:
146 $GLOBALS['logoBarHeight'] = 110;
147 // The height in pixels of the Navigation bar:
148 $GLOBALS['navBarHeight'] = 22;
149 // The height in pixels of the Title bar:
150 $GLOBALS['titleBarHeight'] = 20;
152 // The assistant word, MORE printed next to titles that can be clicked:
153 $tmore = "(More)";
154 // The assistant word, BACK printed next to titles that return to previous screens:
155 $tback = "(Back)";
157 // This is the idle logout function:
158 // if a page has not been refreshed within this many seconds, the interface
159 // will return to the login page
160 if (!empty($special_timeout)) {
161 $timeout = intval($special_timeout);
163 else {
164 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
165 $timeout = 7200;
168 //Version tags
170 $v_major = '2';
171 $v_minor = '9';
172 $v_patch = '0';
173 $tag = '.3'; // minor revision number, should be empty for production releases
175 // This name appears on the login page and in the title bar of most windows.
176 // It's nice to customize this to be the name of your clinic.
177 $openemr_name = 'OpenEMR';
179 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
181 $rootdir = $GLOBALS['rootdir'];
182 $srcdir = $GLOBALS['srcdir'];
183 $login_screen = $GLOBALS['login_screen'];
184 $GLOBALS['css_header'] = $css_header;
185 $GLOBALS['backpic'] = $backpic;
186 $GLOBALS['rootdir'] = $rootdir;
188 // change these to reflect when the daily view should start to display times
189 // as well as it should end. ex schedule_start = 9 schedule_end = 17
190 // start end times in hours
191 $GLOBALS['schedule_start'] = 8;
192 $GLOBALS['schedule_end'] = 17;
194 // This is the time granularity of the calendar and the smallest interval
195 // in minutes for an appointment slot:
196 $GLOBALS['calendar_interval'] = 15;
198 // Include the authentication module code here, but the rule is
199 // if the file has the word "login" in the source code file name,
200 // don't include the authentication module - we do this to avoid
201 // include loops.
203 if (!$ignoreAuth) {
204 include_once("$srcdir/auth.inc");
207 // If you do not want your accounting system to have a customer added to it
208 // for each insurance company, then set this to true. SQL-Ledger currently
209 // (2005-03-21) does nothing useful with insurance companies as customers.
210 $GLOBALS['insurance_companies_are_not_customers'] = true;
212 // If OpenEMR is being used by an athletic team rather than in a traditional
213 // clinical setting, set this to true.
214 $GLOBALS['athletic_team'] = false;
216 // True if this is a weight loss clinic:
217 $GLOBALS['weight_loss_clinic'] = false;
219 // The telephone country code of this installation. 1 = USA.
220 // See http://www.wtng.info/ for a list.
221 $GLOBALS['phone_country_code'] = '1';
223 // This determines how appointments display on the calendar:
224 // 1 = lastname; 2 = last,first; 3 = last,first(title);
225 // 4 = last,first(title: description)
226 $GLOBALS['calendar_appt_style'] = 2;
228 // Make this true if you want providers to see all appointments by default
229 // and not just their own.
230 $GLOBALS['docs_see_entire_calendar'] = false;
232 // Set this to true if you want the drug database and support for in-house
233 // prescription dispensing.
234 $GLOBALS['inhouse_pharmacy'] = false;
236 // Make this nonzero if you want the ability to sell products other than
237 // prescription drugs. Also requires inhouse_pharmacy to be true.
238 // This allows selection of products from the Fee Sheet.
239 // Set this to 2 if you want a simplified interface (no templates, no
240 // prescription drugs), otherwise to 1.
241 $GLOBALS['sell_non_drug_products'] = 0;
243 // True to omit insurance and some other things from the demographics form:
244 $GLOBALS['simplified_demographics'] = false;
246 // True to omit form, route and interval which then become part of dosage:
247 $GLOBALS['simplified_prescriptions'] = false;
249 // True to omit method of payment from the copay panel:
250 $GLOBALS['simplified_copay'] = false;
252 // You may put text here as the default complaint in the New Patient form:
253 $GLOBALS['default_chief_complaint'] = '';
255 // This was added for sports teams needing to fill out injury forms, but might
256 // have other applications.
257 $GLOBALS['default_new_encounter_form'] = '';
259 // If you want a new encounter to be automatically created when appointment
260 // status is set to "@" (arrived), then make this true.
261 $GLOBALS['auto_create_new_encounters'] = true;
263 // If you don't want employer information, country, title in patient demographics.
264 $GLOBALS['omit_employers'] = false;
266 // This is for insurance billing and is specific to Medicare. Make it true
267 // to force the referring provider to be the same as the rendering provider,
268 // instead of coming from the patient demographics.
269 $GLOBALS['MedicareReferrerIsRenderer'] = false;
271 // You can set this to the category name of a document to link to from the
272 // patient summary page. Normally this is the category for insurance cards.
273 // This lets you click on the patient's name to see their ID card.
274 $GLOBALS['patient_id_category_name'] = '';
276 // Traditionally OpenEMR has allowed creation of user groups (not the same
277 // as access control groups). However this has never done anything very
278 // useful and creates confusion. Make this false if you really want it.
279 $GLOBALS['disable_non_default_groups'] = true;
281 // True for IPPF installations, otherwise false.
282 $GLOBALS['ippf_specific'] = false;
284 // True to support discounts in the Checkout form by dollars instead of percentage.
285 $GLOBALS['discount_by_money'] = false;
287 // If "SET NAMES 'utf8'" is supported and desired.
288 $GLOBALS['use_set_names_utf8'] = false;
290 // If you want Hylafax support then uncomment and customize the following
291 // statements, and also customize custom/faxcover.txt:
293 // $GLOBALS['hylafax_server'] = 'localhost';
294 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
295 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
297 // For scanner support, uncomment and customize the following. This is
298 // the directory in which scanned-in documents may be found, and may for
299 // example be a smbfs-mounted share from the PC supporting the scanner:
301 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
303 // Customize these if you are using SQL-Ledger with OpenEMR.
304 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
305 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
306 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
307 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
308 $sl_dbname = 'sql-ledger'; // sql-ledger database name
309 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
310 $sl_dbpass = 'secret'; // sql-ledger database login password
312 // Don't change anything below this line. ////////////////////////////
314 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
316 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
317 $_SESSION['pid'] = $_GET['pid'];
319 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
320 $_SESSION['pid'] = $_POST['pid'];
322 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
323 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
324 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
326 // global interface function to format text length using ellipses
327 function strterm($string,$length) {
328 if (strlen($string) >= ($length-3)) {
329 return substr($string,0,$length-3) . "...";
330 } else {
331 return $string;
335 // turn off PHP compatibility warnings
336 ini_set("session.bug_compat_warn","off");
338 if ($GLOBALS['use_set_names_utf8']) mysql_query("SET NAMES 'utf8'");
340 //settings for cronjob
341 // SEND SMS NOTIFICATION BEFORE HH HOUR
342 $SMS_NOTIFICATION_HOUR = 50;
343 // SEND EMAIL NOTIFICATION BEFORE HH HOUR
344 $EMAIL_NOTIFICATION_HOUR = 50;
345 $SMS_GATEWAY_USENAME = 'SMS_GATEWAY_USENAME';
346 $SMS_GATEWAY_PASSWORD = 'SMS_GATEWAY_PASSWORD';
347 $SMS_GATEWAY_APIKEY = 'SMS_GATEWAY_APIKEY';