patch from Joe Holzer to show encounter dates
[openemr.git] / interface / globals.php
blob98704a5c735a94d794a0061bfd10c4e85712b5ad
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";
88 // Language Control Section
90 // Current supported languages:
91 // Armenian
92 // Bahasa Indonesia
93 // Brazilian Portuguese
94 // Chinese
95 // Dutch
96 // English
97 // French
98 // German
99 // Greek
100 // Hebrew
101 // Norwegian
102 // Russian
103 // Slovak
104 // Spanish
105 // Swedish
107 // 'language_menu_login' toggle
108 // -If set to true then will allow language selection on login
109 // -If set to false then will not show menu in login and will use default (see below)
110 $GLOBALS['language_menu_login'] = true;
112 // 'language_menu_all' toggle
113 // -If set to true then show all languages in login menu
114 // -If set to false then only show chosen (see below) languages in login menu
115 $GLOBALS['language_menu_showall'] = true;
117 // 'language_menu_show' array
118 // -ONLY pertinent if above 'language_menu_all' toggle is set to false
119 // -Displays these chosen languages in the login menu
120 $GLOBALS['language_menu_show'] = array('English','Swedish');
122 // 'language_default'
123 // -Sets the default language
124 // -If login menu is on, then it will be the 'Default' choice in menu
125 // -If login menu is off, then it will choose this language
126 $GLOBALS['language_default'] = "English";
128 // 'translate_layout'
129 // -If true, then will translate the layout information.
130 // -If false, will not translate the layout information.
131 // If false, then most of the demographics and patient data
132 // entry forms will not be translated.
133 $GLOBALS['translate_layout'] = true;
135 // 'translate_lists'
136 // -If true, then will translate the lists information.
137 // -If false, will not translate the lists information.
138 // If false, then many lists of information in forms
139 // and templates will be untranslated.
140 $GLOBALS['translate_lists'] = true;
142 // 'translate_gacl_groups'
143 // -If true, then will translate the access control group names.
144 // -If false, will not translate the access control group names.
145 $GLOBALS['translate_gacl_groups'] = true;
147 include_once (dirname(__FILE__) . "/../library/translation.inc.php");
149 include_once (dirname(__FILE__) . "/../library/date_functions.php");
150 include_once (dirname(__FILE__) . "/../library/classes/Filtreatment_class.php");
152 // Default category for find_patient screen
153 $GLOBALS['default_category'] = 5;
154 $GLOBALS['default_event_title'] = 'Office Visit';
156 // The session name appears in cookies stored in the browser. If you have
157 // multiple OpenEMR installations running on the same server, you should
158 // customize this name so they cannot interfere with each other.
160 // Also, if modify session_name, then need to place the identical name in
161 // the phpmyadmin file here: openemr/phpmyadmin/libraries/session.inc.php
162 // at line 71. This was required after embedded new phpmyadmin version on
163 // 05-12-2009 by Brady. Hopefully will figure out a more appropriate fix.
164 session_name("OpenEMR");
166 session_start();
168 // Set this to 1 or 2 to activate support for the new frame layout.
169 // 0 = Old-style layout
170 // 1 = Navigation menu consists of pairs of radio buttons
171 // 2 = Navigation menu is a tree view
173 $GLOBALS['concurrent_layout'] = 2;
175 // If >0 this will enforce a separate PHP session for each top-level
176 // browser window. You must log in separately for each. This is not
177 // thoroughly tested yet and some browsers might have trouble with it,
178 // so make it 0 if you must. Alternatively, you can set it to 2 to be
179 // notified when the session ID changes.
180 $GLOBALS['restore_sessions'] = 1; // 0=no, 1=yes, 2=yes+debug
182 // used in Add new event for multiple providers
183 $GLOBALS['select_multi_providers'] = false;
185 // used for Dutch Mental Health Facility
186 $GLOBALS['dutchpc'] = FALSE;
188 if ( $GLOBALS['dutchpc'] ) {
189 include_once (dirname(__FILE__) . "/../library/DBC_include.php");
192 // Theme definition:
193 if ($GLOBALS['concurrent_layout']) {
194 $top_bg_line = ' bgcolor="#dddddd" ';
195 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
196 $bottom_bg_line = $top_bg_line;
197 $title_bg_line = ' bgcolor="#bbbbbb" ';
198 $nav_bg_line = ' bgcolor="#94d6e7" ';
199 } else {
200 $top_bg_line = ' bgcolor="#94d6e7" ';
201 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
202 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
203 $title_bg_line = ' bgcolor="#aaffff" ';
204 $nav_bg_line = ' bgcolor="#94d6e7" ';
206 $login_filler_line = ' bgcolor="#f7f0d5" ';
207 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
208 $css_header = "$rootdir/themes/style_sky_blue.css";
209 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
210 $linepic = "$rootdir/pic/repeat_vline9.gif";
211 $table_bg = ' bgcolor="#cccccc" ';
212 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
213 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
214 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
215 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
217 // The height in pixels of the Logo bar at the top of the login page:
218 $GLOBALS['logoBarHeight'] = 110;
219 // The height in pixels of the Navigation bar:
220 $GLOBALS['navBarHeight'] = 22;
221 // The height in pixels of the Title bar:
222 $GLOBALS['titleBarHeight'] = 20;
224 // The assistant word, MORE printed next to titles that can be clicked:
225 // Note this label gets translated here via the xl function
226 // -if you don't want it translated, then strip the xl function away
227 $tmore = xl('(More)');
228 // The assistant word, BACK printed next to titles that return to previous screens:
229 // Note this label gets translated here via the xl function
230 // -if you don't want it translated, then strip the xl function away
231 $tback = xl('(Back)');
233 // This is the idle logout function:
234 // if a page has not been refreshed within this many seconds, the interface
235 // will return to the login page
236 if (!empty($special_timeout)) {
237 $timeout = intval($special_timeout);
239 else {
240 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
241 $timeout = 7200;
244 //Version tags
246 $v_major = '3';
247 $v_minor = '0';
248 $v_patch = '1';
249 $tag = '.3'; // minor revision number, should be empty for production releases
251 // This name appears on the login page and in the title bar of most windows.
252 // It's nice to customize this to be the name of your clinic.
253 $openemr_name = 'OpenEMR';
255 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
257 $rootdir = $GLOBALS['rootdir'];
258 $srcdir = $GLOBALS['srcdir'];
259 $login_screen = $GLOBALS['login_screen'];
260 $GLOBALS['css_header'] = $css_header;
261 $GLOBALS['backpic'] = $backpic;
262 $GLOBALS['rootdir'] = $rootdir;
264 // change these to reflect when the daily view should start to display times
265 // as well as it should end. ex schedule_start = 9 schedule_end = 17
266 // start end times in hours
267 $GLOBALS['schedule_start'] = 8;
268 $GLOBALS['schedule_end'] = 17;
270 // This is the time granularity of the calendar and the smallest interval
271 // in minutes for an appointment slot:
272 $GLOBALS['calendar_interval'] = 15;
274 // Include the authentication module code here, but the rule is
275 // if the file has the word "login" in the source code file name,
276 // don't include the authentication module - we do this to avoid
277 // include loops.
279 if (!$ignoreAuth) {
280 include_once("$srcdir/auth.inc");
283 // If you do not want your accounting system to have a customer added to it
284 // for each insurance company, then set this to true. SQL-Ledger currently
285 // (2005-03-21) does nothing useful with insurance companies as customers.
286 $GLOBALS['insurance_companies_are_not_customers'] = true;
288 // If OpenEMR is being used by an athletic team rather than in a traditional
289 // clinical setting, set this to true.
290 $GLOBALS['athletic_team'] = false;
292 // True if this is a weight loss clinic:
293 $GLOBALS['weight_loss_clinic'] = false;
295 // The telephone country code of this installation. 1 = USA.
296 // See http://www.wtng.info/ for a list.
297 $GLOBALS['phone_country_code'] = '1';
299 // This determines how appointments display on the calendar:
300 // 1 = lastname; 2 = last,first; 3 = last,first(title);
301 // 4 = last,first(title: description)
302 $GLOBALS['calendar_appt_style'] = 2;
304 // Make this true if you want providers to see all appointments by default
305 // and not just their own.
306 $GLOBALS['docs_see_entire_calendar'] = false;
308 // Set this to true if you want the drug database and support for in-house
309 // prescription dispensing.
310 $GLOBALS['inhouse_pharmacy'] = false;
312 // Make this nonzero if you want the ability to sell products other than
313 // prescription drugs. Also requires inhouse_pharmacy to be true.
314 // This allows selection of products from the Fee Sheet.
315 // Set this to 2 if you want a simplified interface (no templates, no
316 // prescription drugs), otherwise to 1.
317 $GLOBALS['sell_non_drug_products'] = 0;
319 // True to omit insurance and some other things from the demographics form:
320 $GLOBALS['simplified_demographics'] = false;
322 // True to omit form, route and interval which then become part of dosage:
323 $GLOBALS['simplified_prescriptions'] = false;
325 // True to omit method of payment from the copay panel:
326 $GLOBALS['simplified_copay'] = false;
328 // You may put text here as the default complaint in the New Patient form:
329 $GLOBALS['default_chief_complaint'] = '';
331 // This was added for sports teams needing to fill out injury forms, but might
332 // have other applications.
333 $GLOBALS['default_new_encounter_form'] = '';
335 // If you want a new encounter to be automatically created when appointment
336 // status is set to "@" (arrived), then make this true.
337 $GLOBALS['auto_create_new_encounters'] = true;
339 // If you don't want employer information, country, title in patient demographics.
340 $GLOBALS['omit_employers'] = false;
342 // This is for insurance billing and is specific to Medicare. Make it true
343 // to force the referring provider to be the same as the rendering provider,
344 // instead of coming from the patient demographics.
345 $GLOBALS['MedicareReferrerIsRenderer'] = false;
347 // You can set this to the category name of a document to link to from the
348 // patient summary page. Normally this is the category for insurance cards.
349 // This lets you click on the patient's name to see their ID card.
350 $GLOBALS['patient_id_category_name'] = '';
352 // Traditionally OpenEMR has allowed creation of user groups (not the same
353 // as access control groups). However this has never done anything very
354 // useful and creates confusion. Make this false if you really want it.
355 $GLOBALS['disable_non_default_groups'] = true;
357 // These are flags for some installation-specific customizations for which
358 // we have not yet figured out better parameters.
359 $GLOBALS['ippf_specific'] = false;
360 $GLOBALS['cene_specific'] = false;
362 // True to support discounts in the Checkout form by dollars instead of percentage.
363 $GLOBALS['discount_by_money'] = false;
365 // Set this to false if you want the doctors to be prompted to authorize
366 // patient notes created by others.
367 $GLOBALS['ignore_pnotes_authorization'] = true;
369 // This turns on the option of creating a new patient using the complete
370 // layout of the demographics form as well as a built-in search feature.
371 // Everyone should want this, but for now it's optional.
372 $GLOBALS['full_new_patient_form'] = true;
374 // If you want Hylafax support then uncomment and customize the following
375 // statements, and also customize custom/faxcover.txt:
377 // $GLOBALS['hylafax_server'] = 'localhost';
378 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
379 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
381 // For scanner support, uncomment and customize the following. This is
382 // the directory in which scanned-in documents may be found, and may for
383 // example be a smbfs-mounted share from the PC supporting the scanner:
385 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
387 // Customize these if you are using SQL-Ledger with OpenEMR, or if you are
388 // going to run sl_convert.php to convert from SQL-Ledger.
390 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
391 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
392 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
393 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
394 $sl_dbname = 'sql-ledger'; // sql-ledger database name
395 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
396 $sl_dbpass = 'secret'; // sql-ledger database login password
398 // Don't change anything below this line. ////////////////////////////
400 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
402 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
403 $_SESSION['pid'] = $_GET['pid'];
405 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
406 $_SESSION['pid'] = $_POST['pid'];
408 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
409 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
410 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
412 // global interface function to format text length using ellipses
413 function strterm($string,$length) {
414 if (strlen($string) >= ($length-3)) {
415 return substr($string,0,$length-3) . "...";
416 } else {
417 return $string;
421 // turn off PHP compatibility warnings
422 ini_set("session.bug_compat_warn","off");
424 //settings for cronjob
425 // SEND SMS NOTIFICATION BEFORE HH HOUR
426 $SMS_NOTIFICATION_HOUR = 50;
427 // SEND EMAIL NOTIFICATION BEFORE HH HOUR
428 $EMAIL_NOTIFICATION_HOUR = 50;
429 $SMS_GATEWAY_USENAME = 'SMS_GATEWAY_USENAME';
430 $SMS_GATEWAY_PASSWORD = 'SMS_GATEWAY_PASSWORD';
431 $SMS_GATEWAY_APIKEY = 'SMS_GATEWAY_APIKEY';