support for "encounter claims"
[openemr.git] / interface / globals.php
blobc1a333168f09f9d44163b2fcc7df9d63d1d3d924
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 // Is this windows or non-windows? Create a boolean definition.
29 if (!defined('IS_WINDOWS'))
30 define('IS_WINDOWS', (stripos(PHP_OS,'WIN') === 0));
32 // Some important php.ini overrides. Defaults for these values are often
33 // too small. You might choose to adjust them further.
35 ini_set('memory_limit', '64M');
36 ini_set('session.gc_maxlifetime', '14400');
38 // Emulates register_globals = On. Moved to here from the bottom of this file
39 // to address security issues. Need to change everything requiring this!
40 $ps = strpos($_SERVER['REQUEST_URI'],"myadmin");
41 if ($ps === false) {
42 extract($_GET);
43 extract($_POST);
46 require_once(dirname(__FILE__) . "/../includes/config.php");
47 // Global variable file in which colors and paths are set for the interface.
48 ///////////////////////////////////////////////////////////////////
49 // THESE VALUES MUST BE SET BEFORE OPENEMR WILL FUNCTION:
50 ///////////////////////////////////////////////////////////////////
51 // Set this to the full absolute directory path for openemr:
52 $webserver_root = "/var/www/openemr";
54 // Set this to the relative html path, ie. what you would type into the web
55 // browser after the server address to get to OpenEMR. For example, if you
56 // type "http://127.0.0.1/clinic/openemr/" to load OpenEMR, set $web_root
57 // to "/clinic/openemr" without the trailing slash.
58 $web_root = "/openemr";
60 ///////////////////////////////////////////////////////////////////
62 // Collecting the utf8 disable flag from the sqlconf.php file in order
63 // to set the correct html encoding. utf8 vs iso-8859-1. If flag is set
64 // then set to iso-8859-1.
65 require_once(dirname(__FILE__) . "/../library/sqlconf.php");
66 if (!$disable_utf8_flag) {
67 ini_set('default_charset', 'utf-8');
69 else {
70 ini_set('default_charset', 'iso-8859-1');
73 // This is the return mail address used when sending prescriptions by email:
74 $GLOBALS['practice_return_email_path'] = "prescription_mail@example.com";
76 // Root directory, relative to the webserver root:
77 $GLOBALS['rootdir'] = "$web_root/interface";
78 // Absolute path to the source code include and headers file directory (Full path):
79 $GLOBALS['srcdir'] = "$webserver_root/library";
80 // Absolute path to the location of documentroot directory for use with include statements:
81 $GLOBALS['fileroot'] = "$webserver_root";
82 // Absolute path to the location of interface directory for use with include statements:
83 $include_root = "$webserver_root/interface";
84 // Absolute path to the location of documentroot directory for use with include statements:
85 $GLOBALS['webroot'] = $web_root;
87 $GLOBALS['template_dir'] = $GLOBALS['fileroot'] . "/templates/";
88 $GLOBALS['incdir'] = $include_root;
89 // Location of the login screen file
90 $GLOBALS['login_screen'] = "$rootdir/login_screen.php";
93 // Operating system specific settings
94 // Currently used in the Adminstration->Backup page within OpenEMR
95 // -Note the temporary file directory parameter is only used when
96 // php version is < 5.2.1 (otherwise the temporary directory that
97 // is set within php is used)
99 // WINDOWS Specific Settings
100 $GLOBALS['mysql_bin_dir_win'] = "C:/xampp/mysql/bin";
101 $GLOBALS['perl_bin_dir_win'] = "C:/xampp/perl/bin";
102 $GLOBALS['temporary_files_dir_win'] = "C:/windows/temp";
104 // LINUX (non-Windows) Specific Settings
105 $GLOBALS['mysql_bin_dir_linux'] = "/usr/bin";
106 $GLOBALS['perl_bin_dir_linux'] = "/usr/bin";
107 $GLOBALS['temporary_files_dir_linux'] = "/tmp";
112 // Language Translations Control Section
115 // Current supported languages: // Allow capture of term for translation:
116 // Arabic // xl('Arabic')
117 // Armenian // xl('Armenian')
118 // Bahasa Indonesia // xl('Bahasa Indonesia')
119 // Chinese // xl('Chinese')
120 // Dutch // xl('Dutch')
121 // English (Indian) // xl('English (Indian)')
122 // English (Standard) // xl('English (Standard)')
123 // French // xl('French')
124 // German // xl('German')
125 // Greek // xl('Greek')
126 // Hebrew // xl('Hebrew')
127 // Norwegian // xl('Norwegian')
128 // Portuguese (Brazilian) // xl('Portuguese (Brazilian)')
129 // Portuguese (European) // xl('Portuguese (European)')
130 // Russian // xl('Russian')
131 // Slovak // xl('Slovak')
132 // Spanish // xl('Spanish')
133 // Swedish // xl('Swedish')
135 // Login Menu Language Translation Configuration
137 // 'language_menu_login' toggle
138 // -If set to true then will allow language selection on login
139 // -If set to false then will not show menu in login and will use default (see below)
140 $GLOBALS['language_menu_login'] = true;
142 // 'language_menu_all' toggle
143 // -If set to true then show all languages in login menu
144 // -If set to false then only show chosen (see below) languages in login menu
145 $GLOBALS['language_menu_showall'] = true;
147 // 'language_menu_show' array
148 // -ONLY pertinent if above 'language_menu_all' toggle is set to false
149 // -Displays these chosen languages in the login menu
150 $GLOBALS['language_menu_show'] = array('English (Standard)','Swedish');
152 // 'language_default'
153 // -Sets the default language
154 // -If login menu is on, then it will be the 'Default' choice in menu
155 // -If login menu is off, then it will choose this language
156 $GLOBALS['language_default'] = "English (Standard)";
158 // Language translation options
159 // -The globals below allow granular control to turn off translation of
160 // several specific parts of OpenEMR.
162 // 'translate_layout'
163 // -If true, then will translate the layout information.
164 // -If false, will not translate the layout information.
165 // If false, then most of the demographics and patient data
166 // entry forms will not be translated.
167 $GLOBALS['translate_layout'] = true;
169 // 'translate_lists'
170 // -If true, then will translate the lists information.
171 // -If false, will not translate the lists information.
172 // If false, then many lists of information in forms
173 // and templates will be untranslated.
174 $GLOBALS['translate_lists'] = true;
176 // 'translate_gacl_groups'
177 // -If true, then will translate the access control group names.
178 // -If false, will not translate the access control group names.
179 $GLOBALS['translate_gacl_groups'] = true;
181 // 'translate_note_titles'
182 // -If true, then will translate the patient Form (note) titles.
183 // -If false, will not translate the patient Form (note) titles.
184 $GLOBALS['translate_form_titles'] = true;
186 // 'translate_document_categories'
187 // -If true, then will translate the document categories.
188 // -If false, will not translate the document categories.
189 $GLOBALS['translate_document_categories'] = true;
191 // 'translate_appt_categories'
192 // -If true, then will translate the appt categories.
193 // -If false, will not translate the appt categories.
194 $GLOBALS['translate_appt_categories'] = true;
196 // Include the translation engine. This will also call sql.inc to
197 // open the openemr mysql connection.
198 include_once (dirname(__FILE__) . "/../library/translation.inc.php");
201 // Lists and Layouts Control Section
204 // 'state_custom_addlist_widget'
205 // - If true, then will display a customized addlist widget for
206 // state list entries (will ask for title and abbreviation)
207 $GLOBALS['state_custom_addlist_widget'] = true;
209 // Data type options. This will set data types in forms that are not
210 // covered by a layout.
211 // 1 = single-selection list
212 // 2 = text field
213 // 26 = single-selection list with ability to add to the list (addlist widget)
214 // (the list entries below are only pertinent for data types 1 or 26)
216 // 'state_data_type'
217 $GLOBALS['state_data_type'] = 26;
218 $GLOBALS['state_list'] = "state";
220 // 'country_data_type'
221 $GLOBALS['country_data_type'] = 26;
222 $GLOBALS['country_list'] = "country";
224 // Vitals form and growth chart units (US and-or metrics)
225 // 1 = Show both US and metric (main unit is US)
226 // 2 = Show both US and metric (main unit is metric)
227 // 3 = Show US only
228 // 4 = Show metric only
229 $GLOBALS['units_of_measurement'] = 1;
231 // Flag to not show the old deprecated metric form in
232 // the unregistered section of the admin->forms module.
233 // (since 3.1.0, metric units are now used along with US units
234 // in the main vitals form; controlled by above setting)
235 $GLOBALS['disable_deprecated_metrics_form'] = true;
237 // Flags to turn off/on specific OpenEMR modules
238 $GLOBALS['disable_calendar'] = false;
239 $GLOBALS['disable_chart_tracker'] = false;
240 $GLOBALS['disable_immunizations'] = false;
241 $GLOBALS['disable_prescriptions'] = false;
243 // Option to set the top default window. By default, it is set
244 // to the calendar screen. The starting directory is
245 // interface/main/ , hence:
246 // The calendar screen is 'main_info.php' .
247 // The patient search/add screen is '../new/new.php' .
248 $GLOBALS['default_top_pane'] = 'main_info.php';
250 // Option to set the 'Online Support' link. By default, it is
251 // set to the Sourceforge support forums. Note you can also remove
252 // the link entirely by simple commenting out below line.
253 $GLOBALS['online_support_link'] = 'http://sourceforge.net/projects/openemr/support';
255 include_once (dirname(__FILE__) . "/../library/date_functions.php");
256 include_once (dirname(__FILE__) . "/../library/classes/Filtreatment_class.php");
258 // Default category for find_patient screen
259 $GLOBALS['default_category'] = 5;
260 $GLOBALS['default_event_title'] = 'Office Visit';
262 // The session name appears in cookies stored in the browser. If you have
263 // multiple OpenEMR installations running on the same server, you should
264 // customize this name so they cannot interfere with each other.
266 // Also, if modify session_name, then need to place the identical name in
267 // the phpmyadmin file here: openemr/phpmyadmin/libraries/session.inc.php
268 // at line 71. This was required after embedded new phpmyadmin version on
269 // 05-12-2009 by Brady. Hopefully will figure out a more appropriate fix.
270 session_name("OpenEMR");
272 session_start();
274 // Set this to 1 or 2 to activate support for the new frame layout.
275 // 0 = Old-style layout
276 // 1 = Navigation menu consists of pairs of radio buttons
277 // 2 = Navigation menu is a tree view
279 $GLOBALS['concurrent_layout'] = 2;
281 // If >0 this will enforce a separate PHP session for each top-level
282 // browser window. You must log in separately for each. This is not
283 // thoroughly tested yet and some browsers might have trouble with it,
284 // so make it 0 if you must. Alternatively, you can set it to 2 to be
285 // notified when the session ID changes.
286 $GLOBALS['restore_sessions'] = 1; // 0=no, 1=yes, 2=yes+debug
288 // used in Add new event for multiple providers
289 $GLOBALS['select_multi_providers'] = false;
291 // NOT functional. Always keep this value FALSE.
292 // Plan to remove when this functionally has been completely
293 // removed from code.
294 $GLOBALS['dutchpc'] = FALSE;
296 // Theme definition:
297 if ($GLOBALS['concurrent_layout']) {
298 $top_bg_line = ' bgcolor="#dddddd" ';
299 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
300 $bottom_bg_line = $top_bg_line;
301 $title_bg_line = ' bgcolor="#bbbbbb" ';
302 $nav_bg_line = ' bgcolor="#94d6e7" ';
303 } else {
304 $top_bg_line = ' bgcolor="#94d6e7" ';
305 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
306 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
307 $title_bg_line = ' bgcolor="#aaffff" ';
308 $nav_bg_line = ' bgcolor="#94d6e7" ';
310 $login_filler_line = ' bgcolor="#f7f0d5" ';
311 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
312 $css_header = "$rootdir/themes/style_sky_blue.css";
313 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
314 $linepic = "$rootdir/pic/repeat_vline9.gif";
315 $table_bg = ' bgcolor="#cccccc" ';
316 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
317 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
318 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
319 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
321 // The height in pixels of the Logo bar at the top of the login page:
322 $GLOBALS['logoBarHeight'] = 110;
323 // The height in pixels of the Navigation bar:
324 $GLOBALS['navBarHeight'] = 22;
325 // The height in pixels of the Title bar:
326 $GLOBALS['titleBarHeight'] = 20;
328 // The assistant word, MORE printed next to titles that can be clicked:
329 // Note this label gets translated here via the xl function
330 // -if you don't want it translated, then strip the xl function away
331 $tmore = xl('(More)');
332 // The assistant word, BACK printed next to titles that return to previous screens:
333 // Note this label gets translated here via the xl function
334 // -if you don't want it translated, then strip the xl function away
335 $tback = xl('(Back)');
337 // This is the idle logout function:
338 // if a page has not been refreshed within this many seconds, the interface
339 // will return to the login page
340 if (!empty($special_timeout)) {
341 $timeout = intval($special_timeout);
343 else {
344 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
345 $timeout = 7200;
348 //Version tags
350 $v_major = '3';
351 $v_minor = '2';
352 $v_patch = '0';
353 $tag = '-dev'; // minor revision number, should be empty for production releases
355 // This name appears on the login page and in the title bar of most windows.
356 // It's nice to customize this to be the name of your clinic.
357 $openemr_name = 'OpenEMR';
359 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
361 $rootdir = $GLOBALS['rootdir'];
362 $srcdir = $GLOBALS['srcdir'];
363 $login_screen = $GLOBALS['login_screen'];
364 $GLOBALS['css_header'] = $css_header;
365 $GLOBALS['backpic'] = $backpic;
366 $GLOBALS['rootdir'] = $rootdir;
368 // change these to reflect when the daily view should start to display times
369 // as well as it should end. ex schedule_start = 9 schedule_end = 17
370 // start end times in hours
371 $GLOBALS['schedule_start'] = 8;
372 $GLOBALS['schedule_end'] = 17;
374 // This is the time granularity of the calendar and the smallest interval
375 // in minutes for an appointment slot:
376 $GLOBALS['calendar_interval'] = 15;
378 // Include the authentication module code here, but the rule is
379 // if the file has the word "login" in the source code file name,
380 // don't include the authentication module - we do this to avoid
381 // include loops.
383 if (!$ignoreAuth) {
384 include_once("$srcdir/auth.inc");
387 // If you do not want your accounting system to have a customer added to it
388 // for each insurance company, then set this to true. SQL-Ledger currently
389 // (2005-03-21) does nothing useful with insurance companies as customers.
390 $GLOBALS['insurance_companies_are_not_customers'] = true;
392 // If OpenEMR is being used by an athletic team rather than in a traditional
393 // clinical setting, set this to true.
394 $GLOBALS['athletic_team'] = false;
396 // True if this is a weight loss clinic:
397 $GLOBALS['weight_loss_clinic'] = false;
399 // The telephone country code of this installation. 1 = USA.
400 // See http://www.wtng.info/ for a list.
401 $GLOBALS['phone_country_code'] = '1';
403 // This determines how appointments display on the calendar:
404 // 1 = lastname; 2 = last,first; 3 = last,first(title);
405 // 4 = last,first(title: description)
406 $GLOBALS['calendar_appt_style'] = 2;
408 // Make this true if you want providers to see all appointments by default
409 // and not just their own.
410 $GLOBALS['docs_see_entire_calendar'] = false;
412 // Set this to true if you want the drug database and support for in-house
413 // prescription dispensing.
414 $GLOBALS['inhouse_pharmacy'] = false;
416 // Make this nonzero if you want the ability to sell products other than
417 // prescription drugs. Also requires inhouse_pharmacy to be true.
418 // This allows selection of products from the Fee Sheet.
419 // Set this to 2 if you want a simplified interface (no templates, no
420 // prescription drugs), otherwise to 1.
421 $GLOBALS['sell_non_drug_products'] = 0;
423 // True to omit insurance and some other things from the demographics form:
424 $GLOBALS['simplified_demographics'] = false;
426 // True to omit form, route and interval which then become part of dosage:
427 $GLOBALS['simplified_prescriptions'] = false;
429 // True to omit method of payment from the copay panel:
430 $GLOBALS['simplified_copay'] = false;
432 // You may put text here as the default complaint in the New Patient form:
433 $GLOBALS['default_chief_complaint'] = '';
435 // This was added for sports teams needing to fill out injury forms, but might
436 // have other applications.
437 $GLOBALS['default_new_encounter_form'] = '';
439 // If you want a new encounter to be automatically created when appointment
440 // status is set to "@" (arrived), then make this true.
441 $GLOBALS['auto_create_new_encounters'] = true;
443 // If you don't want employer information, country, title in patient demographics.
444 $GLOBALS['omit_employers'] = false;
446 // This is for insurance billing and is specific to Medicare. Make it true
447 // to force the referring provider to be the same as the rendering provider,
448 // instead of coming from the patient demographics.
449 $GLOBALS['MedicareReferrerIsRenderer'] = false;
451 // You can set this to the category name of a document to link to from the
452 // patient summary page. Normally this is the category for insurance cards.
453 // This lets you click on the patient's name to see their ID card.
454 $GLOBALS['patient_id_category_name'] = '';
456 // Traditionally OpenEMR has allowed creation of user groups (not the same
457 // as access control groups). However this has never done anything very
458 // useful and creates confusion. Make this false if you really want it.
459 $GLOBALS['disable_non_default_groups'] = true;
461 // These are flags for some installation-specific customizations for which
462 // we have not yet figured out better parameters.
463 $GLOBALS['ippf_specific'] = false;
464 $GLOBALS['cene_specific'] = false;
466 // True to support discounts in the Checkout form by dollars instead of percentage.
467 $GLOBALS['discount_by_money'] = false;
469 // Set this to false if you want the doctors to be prompted to authorize
470 // patient notes created by others.
471 $GLOBALS['ignore_pnotes_authorization'] = true;
473 // This turns on the option of creating a new patient using the complete
474 // layout of the demographics form as well as a built-in search feature.
475 // Everyone should want this, but for now it's optional.
476 $GLOBALS['full_new_patient_form'] = true;
478 // This can be used to enable the old Charges panel for entering billing
479 // codes and payments. It is not recommended, as it was obsoleted by the
480 // Fee Sheet which is more complete and comprehensive.
481 $GLOBALS['use_charges_panel'] = false;
483 // This was added for Wellcare EDI which can accept a special kind of claim
484 // containing diagnoses but not requiring procedures or charges. If you
485 // don't know what this is about then you don't want it!
486 $GLOBALS['support_encounter_claims'] = false;
488 // Multi-facility Configuration
490 // Restrict non-authorized users to the "Schedule Facilities" (aka user_facilities table)
491 // set in User admin.
492 $GLOBALS['restrict_user_facility'] = false;
494 // Set a facility cookie, so browser keeps a default selected facility between logins.
495 $GLOBALS['set_facility_cookie'] = false;
497 // If you want Hylafax support then uncomment and customize the following
498 // statements, and also customize custom/faxcover.txt:
500 // $GLOBALS['hylafax_server'] = 'localhost';
501 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
502 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
504 // For scanner support, uncomment and customize the following. This is
505 // the directory in which scanned-in documents may be found, and may for
506 // example be a smbfs-mounted share from the PC supporting the scanner:
508 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
510 // Customize these if you are using SQL-Ledger with OpenEMR, or if you are
511 // going to run sl_convert.php to convert from SQL-Ledger.
513 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
514 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
515 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
516 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
517 $sl_dbname = 'sql-ledger'; // sql-ledger database name
518 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
519 $sl_dbpass = 'secret'; // sql-ledger database login password
521 // Don't change anything below this line. ////////////////////////////
523 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
525 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
526 $_SESSION['pid'] = $_GET['pid'];
528 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
529 $_SESSION['pid'] = $_POST['pid'];
531 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
532 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
533 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
535 // global interface function to format text length using ellipses
536 function strterm($string,$length) {
537 if (strlen($string) >= ($length-3)) {
538 return substr($string,0,$length-3) . "...";
539 } else {
540 return $string;
544 // OS specific configuration (do not modify this)
545 $GLOBALS['mysql_bin_dir'] = IS_WINDOWS ? $GLOBALS['mysql_bin_dir_win'] : $GLOBALS['mysql_bin_dir_linux'];
546 $GLOBALS['perl_bin_dir'] = IS_WINDOWS ? $GLOBALS['perl_bin_dir_win'] : $GLOBALS['perl_bin_dir_linux'];
547 if (version_compare(phpversion(), "5.2.1", ">=")) {
548 $GLOBALS['temporary_files_dir'] = rtrim(sys_get_temp_dir(),'/'); // only works in PHP >= 5.2.1
550 else {
551 $GLOBALS['temporary_files_dir'] = IS_WINDOWS ? $GLOBALS['temporary_files_dir_win'] : $GLOBALS['temporary_files_dir_linux'];
554 // turn off PHP compatibility warnings
555 ini_set("session.bug_compat_warn","off");
557 //settings for cronjob
558 // SEND SMS NOTIFICATION BEFORE HH HOUR
559 $SMS_NOTIFICATION_HOUR = 50;
560 // SEND EMAIL NOTIFICATION BEFORE HH HOUR
561 $EMAIL_NOTIFICATION_HOUR = 50;
562 $SMS_GATEWAY_USENAME = 'SMS_GATEWAY_USENAME';
563 $SMS_GATEWAY_PASSWORD = 'SMS_GATEWAY_PASSWORD';
564 $SMS_GATEWAY_APIKEY = 'SMS_GATEWAY_APIKEY';