Fixed patient phone number problem.
[openemr.git] / interface / globals.php
blob6aea24d3de97ae12a62cacb18247284ca5260c50
1 <?php
2 /* $Id$ */
3 // ------------------------------------------------------------------------ //
4 // OpenEMR Electronic Medical Records System //
5 // Copyright (c) 2005 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 // 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");
31 if ($ps === false) {
32 extract($_GET);
33 extract($_POST);
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 = "/mnt/htdocs/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");
78 // Default category for find_patient screen
79 $GLOBALS['default_category'] = 5;
80 $GLOBALS['default_event_title'] = 'Office Visit';
82 // The session name appears in cookies stored in the browser. If you have
83 // multiple OpenEMR installations running on the same server, you should
84 // customize this name so they cannot interfere with each other.
85 session_name("OpenEMR");
87 session_start();
89 // Set this to true to activate support for the new frame layout.
91 $GLOBALS['concurrent_layout'] = true;
93 // If >0 this will enforce a separate PHP session for each top-level
94 // browser window. You must log in separately for each. This is not
95 // thoroughly tested yet and some browsers might have trouble with it,
96 // so make it 0 if you must. Alternatively, you can set it to 2 to be
97 // notified when the session ID changes.
98 $GLOBALS['restore_sessions'] = 1; // 0=no, 1=yes, 2=yes+debug
100 // used in Add new event for multiple providers
101 $GLOBALS['select_multi_providers'] = false;
103 // Theme definition:
104 if ($GLOBALS['concurrent_layout']) {
105 $top_bg_line = ' bgcolor="#dddddd" ';
106 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
107 $bottom_bg_line = $top_bg_line;
108 $title_bg_line = ' bgcolor="#bbbbbb" ';
109 $nav_bg_line = ' bgcolor="#94d6e7" ';
110 } else {
111 $top_bg_line = ' bgcolor="#94d6e7" ';
112 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
113 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
114 $title_bg_line = ' bgcolor="#aaffff" ';
115 $nav_bg_line = ' bgcolor="#94d6e7" ';
117 $login_filler_line = ' bgcolor="#f7f0d5" ';
118 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
119 $css_header = "$rootdir/themes/style_sky_blue.css";
120 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
121 $linepic = "$rootdir/pic/repeat_vline9.gif";
122 $table_bg = ' bgcolor="#cccccc" ';
123 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
124 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
125 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
126 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
128 // The height in pixels of the Logo bar at the top of the login page:
129 $GLOBALS['logoBarHeight'] = 110;
130 // The height in pixels of the Navigation bar:
131 $GLOBALS['navBarHeight'] = 22;
132 // The height in pixels of the Title bar:
133 $GLOBALS['titleBarHeight'] = 20;
135 // The assistant word, MORE printed next to titles that can be clicked:
136 $tmore = "(More)";
137 // The assistant word, BACK printed next to titles that return to previous screens:
138 $tback = "(Back)";
140 // This is the idle logout function:
141 // if a page has not been refreshed within this many seconds, the interface
142 // will return to the login page
143 if (!empty($special_timeout)) {
144 $timeout = intval($special_timeout);
146 else {
147 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
148 $timeout = 7200;
151 //Version tags
153 $v_major = '2';
154 $v_minor = '8';
155 $v_patch = '4';
156 $tag = '-dev'; // release candidate, e.g. '-rc1'
158 // This name appears on the login page and in the title bar of most windows.
159 // It's nice to customize this to be the name of your clinic.
160 $openemr_name = 'OpenEMR';
162 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
164 $rootdir = $GLOBALS['rootdir'];
165 $srcdir = $GLOBALS['srcdir'];
166 $login_screen = $GLOBALS['login_screen'];
167 $GLOBALS['css_header'] = $css_header;
168 $GLOBALS['backpic'] = $backpic;
169 $GLOBALS['rootdir'] = $rootdir;
171 // change these to reflect when the daily view should start to display times
172 // as well as it should end. ex schedule_start = 9 schedule_end = 17
173 // start end times in hours
174 $GLOBALS['schedule_start'] = 8;
175 $GLOBALS['schedule_end'] = 17;
177 // This is the time granularity of the calendar and the smallest interval
178 // in minutes for an appointment slot:
179 $GLOBALS['calendar_interval'] = 15;
181 // Include the authentication module code here, but the rule is
182 // if the file has the word "login" in the source code file name,
183 // don't include the authentication module - we do this to avoid
184 // include loops.
186 if (!$ignoreAuth) {
187 include_once("$srcdir/auth.inc");
190 // If you do not want your accounting system to have a customer added to it
191 // for each insurance company, then set this to true. SQL-Ledger currently
192 // (2005-03-21) does nothing useful with insurance companies as customers.
193 $GLOBALS['insurance_companies_are_not_customers'] = true;
195 // If OpenEMR is being used by an athletic team rather than in a traditional
196 // clinical setting, set this to true.
197 $GLOBALS['athletic_team'] = false;
199 // True if this is a weight loss clinic:
200 $GLOBALS['weight_loss_clinic'] = false;
202 // The telephone country code of this installation. 1 = USA.
203 // See http://www.wtng.info/ for a list.
204 $GLOBALS['phone_country_code'] = '1';
206 // This determines how appointments display on the calendar:
207 // 1 = lastname; 2 = last,first; 3 = last,first(title);
208 // 4 = last,first(title: description)
209 $GLOBALS['calendar_appt_style'] = 2;
211 // Make this true if you want providers to see all appointments by default
212 // and not just their own.
213 $GLOBALS['docs_see_entire_calendar'] = false;
215 // Set this to true if you want the drug database and support for in-house
216 // prescription dispensing.
217 $GLOBALS['inhouse_pharmacy'] = false;
219 // True to omit insurance and some other things from the demographics form:
220 $GLOBALS['simplified_demographics'] = false;
222 // True to omit form, route and interval which then become part of dosage:
223 $GLOBALS['simplified_prescriptions'] = false;
225 // True to omit method of payment from the copay panel:
226 $GLOBALS['simplified_copay'] = false;
228 // You may put text here as the default complaint in the New Patient form:
229 $GLOBALS['default_chief_complaint'] = '';
231 // This was added for sports teams needing to fill out injury forms, but might
232 // have other applications.
233 $GLOBALS['default_new_encounter_form'] = '';
235 // If you want a new encounter to be automatically created when appointment
236 // status is set to "@" (arrived), then make this true.
237 $GLOBALS['auto_create_new_encounters'] = true;
239 // If you don't want employer information, country, title in patient demographics.
240 $GLOBALS['omit_employers'] = false;
242 // You can set this to the category name of a document to link to from the
243 // patient summary page. Normally this is the category for insurance cards.
244 // This lets you click on the patient's name to see their ID card.
245 $GLOBALS['patient_id_category_name'] = '';
247 // If you want Hylafax support then uncomment and customize the following
248 // statements, and also customize custom/faxcover.txt:
250 // $GLOBALS['hylafax_server'] = 'localhost';
251 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
252 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
254 // For scanner support, uncomment and customize the following. This is
255 // the directory in which scanned-in documents may be found, and may for
256 // example be a smbfs-mounted share from the PC supporting the scanner:
258 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
260 // Customize these if you are using SQL-Ledger with OpenEMR.
261 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
262 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
263 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
264 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
265 $sl_dbname = 'sql-ledger'; // sql-ledger database name
266 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
267 $sl_dbpass = 'secret'; // sql-ledger database login password
269 // Don't change anything below this line. ////////////////////////////
271 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
273 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
274 $_SESSION['pid'] = $_GET['pid'];
276 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
277 $_SESSION['pid'] = $_POST['pid'];
279 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
280 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
281 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
283 // global interface function to format text length using ellipses
284 function strterm($string,$length) {
285 if (strlen($string) >= ($length-3)) {
286 return substr($string,0,$length-3) . "...";
287 } else {
288 return $string;
292 // turn off PHP compatibility warnings
293 ini_set("session.bug_compat_warn","off");