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. //
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. //
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. //
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 // Emulates register_globals = On. Moved to here from the bottom of this file
29 // to address security issues. Need to change everything requiring this!
30 $ps = strpos($_SERVER['REQUEST_URI'],"myadmin");
36 require_once(dirname(__FILE__
) . "/../includes/config.php");
37 // Global variable file in which colors and paths are set for the interface.
38 ///////////////////////////////////////////////////////////////////
39 // THESE VALUES MUST BE SET BEFORE OPENEMR WILL FUNCTION:
40 ///////////////////////////////////////////////////////////////////
41 // Set this to the full absolute directory path for openemr:
42 $webserver_root = "/var/www/openemr";
44 // Set this to the relative html path, ie. what you would type into the web
45 // browser after the server address to get to OpenEMR. For example, if you
46 // type "http://127.0.0.1/clinic/openemr/" to load OpenEMR, set $web_root
47 // to "/clinic/openemr" without the trailing slash.
48 $web_root = "/openemr";
50 ///////////////////////////////////////////////////////////////////
52 // This is the return mail address used when sending prescriptions by email:
53 $GLOBALS['practice_return_email_path'] = "prescription_mail@example.com";
55 // Root directory, relative to the webserver root:
56 $GLOBALS['rootdir'] = "$web_root/interface";
57 // Absolute path to the source code include and headers file directory (Full path):
58 $GLOBALS['srcdir'] = "$webserver_root/library";
59 // Absolute path to the location of documentroot directory for use with include statements:
60 $GLOBALS['fileroot'] = "$webserver_root";
61 // Absolute path to the location of interface directory for use with include statements:
62 $include_root = "$webserver_root/interface";
63 // Absolute path to the location of documentroot directory for use with include statements:
64 $GLOBALS['webroot'] = $web_root;
66 $GLOBALS['template_dir'] = $GLOBALS['fileroot'] . "/templates/";
67 $GLOBALS['incdir'] = $include_root;
68 // Location of the login screen file
69 $GLOBALS['login_screen'] = "$rootdir/login_screen.php";
71 // Language Control Section (will add toggling)
72 // English:1, Swedish:2, Spanish:3, German:4, Dutch:5, Hebrew:6
73 define ('LANGUAGE',1);
74 include_once (dirname(__FILE__
) . "/../library/translation.inc.php");
76 include_once (dirname(__FILE__
) . "/../library/date_functions.php");
77 include_once (dirname(__FILE__
) . "/../library/classes/Filtreatment_class.php");
79 // Default category for find_patient screen
80 $GLOBALS['default_category'] = 5;
81 $GLOBALS['default_event_title'] = 'Office Visit';
83 // The session name appears in cookies stored in the browser. If you have
84 // multiple OpenEMR installations running on the same server, you should
85 // customize this name so they cannot interfere with each other.
86 session_name("OpenEMR");
90 // Set this to 1 or 2 to activate support for the new frame layout.
91 // 0 = Old-style layout
92 // 1 = Navigation menu consists of pairs of radio buttons
93 // 2 = Navigation menu is a tree view
95 $GLOBALS['concurrent_layout'] = 1;
97 // If >0 this will enforce a separate PHP session for each top-level
98 // browser window. You must log in separately for each. This is not
99 // thoroughly tested yet and some browsers might have trouble with it,
100 // so make it 0 if you must. Alternatively, you can set it to 2 to be
101 // notified when the session ID changes.
102 $GLOBALS['restore_sessions'] = 1; // 0=no, 1=yes, 2=yes+debug
104 // used in Add new event for multiple providers
105 $GLOBALS['select_multi_providers'] = false;
107 // used for Dutch Mental Health Facility
108 $GLOBALS['dutchpc'] = FALSE;
110 if ( $GLOBALS['dutchpc'] ) {
111 include_once (dirname(__FILE__
) . "/../library/DBC_include.php");
115 if ($GLOBALS['concurrent_layout']) {
116 $top_bg_line = ' bgcolor="#dddddd" ';
117 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
118 $bottom_bg_line = $top_bg_line;
119 $title_bg_line = ' bgcolor="#bbbbbb" ';
120 $nav_bg_line = ' bgcolor="#94d6e7" ';
122 $top_bg_line = ' bgcolor="#94d6e7" ';
123 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
124 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
125 $title_bg_line = ' bgcolor="#aaffff" ';
126 $nav_bg_line = ' bgcolor="#94d6e7" ';
128 $login_filler_line = ' bgcolor="#f7f0d5" ';
129 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
130 $css_header = "$rootdir/themes/style_sky_blue.css";
131 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
132 $linepic = "$rootdir/pic/repeat_vline9.gif";
133 $table_bg = ' bgcolor="#cccccc" ';
134 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
135 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
136 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
137 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
139 // The height in pixels of the Logo bar at the top of the login page:
140 $GLOBALS['logoBarHeight'] = 110;
141 // The height in pixels of the Navigation bar:
142 $GLOBALS['navBarHeight'] = 22;
143 // The height in pixels of the Title bar:
144 $GLOBALS['titleBarHeight'] = 20;
146 // The assistant word, MORE printed next to titles that can be clicked:
148 // The assistant word, BACK printed next to titles that return to previous screens:
151 // This is the idle logout function:
152 // if a page has not been refreshed within this many seconds, the interface
153 // will return to the login page
154 if (!empty($special_timeout)) {
155 $timeout = intval($special_timeout);
158 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
167 $tag = '-dev'; // release candidate, e.g. '-rc1'
169 // This name appears on the login page and in the title bar of most windows.
170 // It's nice to customize this to be the name of your clinic.
171 $openemr_name = 'OpenEMR';
173 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
175 $rootdir = $GLOBALS['rootdir'];
176 $srcdir = $GLOBALS['srcdir'];
177 $login_screen = $GLOBALS['login_screen'];
178 $GLOBALS['css_header'] = $css_header;
179 $GLOBALS['backpic'] = $backpic;
180 $GLOBALS['rootdir'] = $rootdir;
182 // change these to reflect when the daily view should start to display times
183 // as well as it should end. ex schedule_start = 9 schedule_end = 17
184 // start end times in hours
185 $GLOBALS['schedule_start'] = 8;
186 $GLOBALS['schedule_end'] = 17;
188 // This is the time granularity of the calendar and the smallest interval
189 // in minutes for an appointment slot:
190 $GLOBALS['calendar_interval'] = 15;
192 // Include the authentication module code here, but the rule is
193 // if the file has the word "login" in the source code file name,
194 // don't include the authentication module - we do this to avoid
198 include_once("$srcdir/auth.inc");
201 // If you do not want your accounting system to have a customer added to it
202 // for each insurance company, then set this to true. SQL-Ledger currently
203 // (2005-03-21) does nothing useful with insurance companies as customers.
204 $GLOBALS['insurance_companies_are_not_customers'] = true;
206 // If OpenEMR is being used by an athletic team rather than in a traditional
207 // clinical setting, set this to true.
208 $GLOBALS['athletic_team'] = false;
210 // True if this is a weight loss clinic:
211 $GLOBALS['weight_loss_clinic'] = false;
213 // The telephone country code of this installation. 1 = USA.
214 // See http://www.wtng.info/ for a list.
215 $GLOBALS['phone_country_code'] = '1';
217 // This determines how appointments display on the calendar:
218 // 1 = lastname; 2 = last,first; 3 = last,first(title);
219 // 4 = last,first(title: description)
220 $GLOBALS['calendar_appt_style'] = 2;
222 // Make this true if you want providers to see all appointments by default
223 // and not just their own.
224 $GLOBALS['docs_see_entire_calendar'] = false;
226 // Set this to true if you want the drug database and support for in-house
227 // prescription dispensing.
228 $GLOBALS['inhouse_pharmacy'] = false;
230 // Make this nonzero if you want the ability to sell products other than
231 // prescription drugs. Also requires inhouse_pharmacy to be true.
232 // This allows selection of products from the Fee Sheet.
233 // Set this to 2 if you want a simplified interface (no templates, no
234 // prescription drugs), otherwise to 1.
235 $GLOBALS['sell_non_drug_products'] = 0;
237 // True to omit insurance and some other things from the demographics form:
238 $GLOBALS['simplified_demographics'] = false;
240 // True to omit form, route and interval which then become part of dosage:
241 $GLOBALS['simplified_prescriptions'] = false;
243 // True to omit method of payment from the copay panel:
244 $GLOBALS['simplified_copay'] = false;
246 // You may put text here as the default complaint in the New Patient form:
247 $GLOBALS['default_chief_complaint'] = '';
249 // This was added for sports teams needing to fill out injury forms, but might
250 // have other applications.
251 $GLOBALS['default_new_encounter_form'] = '';
253 // If you want a new encounter to be automatically created when appointment
254 // status is set to "@" (arrived), then make this true.
255 $GLOBALS['auto_create_new_encounters'] = true;
257 // If you don't want employer information, country, title in patient demographics.
258 $GLOBALS['omit_employers'] = false;
260 // This is for insurance billing and is specific to Medicare. Make it true
261 // to force the referring provider to be the same as the rendering provider,
262 // instead of coming from the patient demographics.
263 $GLOBALS['MedicareReferrerIsRenderer'] = false;
265 // You can set this to the category name of a document to link to from the
266 // patient summary page. Normally this is the category for insurance cards.
267 // This lets you click on the patient's name to see their ID card.
268 $GLOBALS['patient_id_category_name'] = '';
270 // Traditionally OpenEMR has allowed creation of user groups (not the same
271 // as access control groups). However this has never done anything very
272 // useful and creates confusion. Make this false if you really want it.
273 $GLOBALS['disable_non_default_groups'] = true;
275 // True for IPPF installations, otherwise false.
276 $GLOBALS['ippf_specific'] = false;
278 // True to support discounts in the Checkout form by dollars instead of percentage.
279 $GLOBALS['discount_by_money'] = false;
281 // If "SET NAMES 'utf8'" is supported and desired.
282 $GLOBALS['use_set_names_utf8'] = false;
284 // If you want Hylafax support then uncomment and customize the following
285 // statements, and also customize custom/faxcover.txt:
287 // $GLOBALS['hylafax_server'] = 'localhost';
288 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
289 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
291 // For scanner support, uncomment and customize the following. This is
292 // the directory in which scanned-in documents may be found, and may for
293 // example be a smbfs-mounted share from the PC supporting the scanner:
295 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
297 // Customize these if you are using SQL-Ledger with OpenEMR.
298 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
299 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
300 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
301 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
302 $sl_dbname = 'sql-ledger'; // sql-ledger database name
303 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
304 $sl_dbpass = 'secret'; // sql-ledger database login password
306 // Don't change anything below this line. ////////////////////////////
308 $encounter = empty($_SESSION['encounter']) ?
0 : $_SESSION['encounter'];
310 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
311 $_SESSION['pid'] = $_GET['pid'];
313 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
314 $_SESSION['pid'] = $_POST['pid'];
316 $pid = empty($_SESSION['pid']) ?
0 : $_SESSION['pid'];
317 $userauthorized = empty($_SESSION['userauthorized']) ?
0 : $_SESSION['userauthorized'];
318 $groupname = empty($_SESSION['authProvider']) ?
0 : $_SESSION['authProvider'];
320 // global interface function to format text length using ellipses
321 function strterm($string,$length) {
322 if (strlen($string) >= ($length-3)) {
323 return substr($string,0,$length-3) . "...";
329 // turn off PHP compatibility warnings
330 ini_set("session.bug_compat_warn","off");
332 if ($GLOBALS['use_set_names_utf8']) mysql_query("SET NAMES 'utf8'");
334 //settings for cronjob
335 // SEND SMS NOTIFICATION BEFORE HH HOUR
336 $SMS_NOTIFICATION_HOUR = 50;
337 // SEND EMAIL NOTIFICATION BEFORE HH HOUR
338 $EMAIL_NOTIFICATION_HOUR = 50;
339 $SMS_GATEWAY_USENAME = 'SMS_GATEWAY_USENAME';
340 $SMS_GATEWAY_PASSWORD = 'SMS_GATEWAY_PASSWORD';
341 $SMS_GATEWAY_APIKEY = 'SMS_GATEWAY_APIKEY';