drug lookup fix from Sam Rajan
[openemr.git] / interface / globals.php
blob3b39663b5946fbf4aa68c8a42b3aa47cadeed679
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 require_once(dirname(__FILE__) . "/../includes/config.php");
29 // Global variable file in which colors and paths are set for the interface.
30 ///////////////////////////////////////////////////////////////////
31 // THESE VALUES MUST BE SET BEFORE OPENEMR WILL FUNCTION:
32 ///////////////////////////////////////////////////////////////////
33 // Set this to the full absolute directory path for openemr:
34 $webserver_root = "/mnt/htdocs/openemr";
36 // Set this to the relative html path, ie. what you would type into the web
37 // browser after the server address to get to OpenEMR. For example, if you
38 // type "http://127.0.0.1/clinic/openemr/" to load OpenEMR, set $web_root
39 // to "/clinic/openemr" without the trailing slash.
40 $web_root = "/openemr";
42 ///////////////////////////////////////////////////////////////////
44 // This is the return mail address used when sending prescriptions by email:
45 $GLOBALS['practice_return_email_path'] = "prescription_mail@example.com";
47 // Root directory, relative to the webserver root:
48 $GLOBALS['rootdir'] = "$web_root/interface";
49 // Absolute path to the source code include and headers file directory (Full path):
50 $GLOBALS['srcdir'] = "$webserver_root/library";
51 // Absolute path to the location of documentroot directory for use with include statements:
52 $GLOBALS['fileroot'] = "$webserver_root";
53 // Absolute path to the location of interface directory for use with include statements:
54 $include_root = "$webserver_root/interface";
55 // Absolute path to the location of documentroot directory for use with include statements:
56 $GLOBALS['webroot'] = $web_root;
58 $GLOBALS['template_dir'] = $GLOBALS['fileroot'] . "/templates/";
59 $GLOBALS['incdir'] = $include_root;
60 // Location of the login screen file
61 $GLOBALS['login_screen'] = "$rootdir/login_screen.php";
63 // Language Control Section (will add toggling)
64 // English:1, Swedish:2, Spanish:3, German:4, Dutch:5, Hebrew:6
65 define ('LANGUAGE',1);
66 include_once (dirname(__FILE__) . "/../library/translation.inc.php");
68 include_once (dirname(__FILE__) . "/../library/date_functions.php");
70 // Default category for find_patient screen
71 $GLOBALS['default_category'] = 5;
72 $GLOBALS['default_event_title'] = 'Office Visit';
74 // The session name appears in cookies stored in the browser. If you have
75 // multiple OpenEMR installations running on the same server, you should
76 // customize this name so they cannot interfere with each other.
77 session_name("OpenEMR");
79 session_start();
81 // Set this to true to activate support for the new frame layout.
83 $GLOBALS['concurrent_layout'] = true;
85 // used in Add new event for multiple providers
86 $GLOBALS['select_multi_providers'] = false;
88 // Theme definition:
89 if ($GLOBALS['concurrent_layout']) {
90 $top_bg_line = ' bgcolor="#dddddd" ';
91 $GLOBALS['style']['BGCOLOR2'] = "#dddddd";
92 $bottom_bg_line = $top_bg_line;
93 $title_bg_line = ' bgcolor="#bbbbbb" ';
94 $nav_bg_line = ' bgcolor="#94d6e7" ';
95 } else {
96 $top_bg_line = ' bgcolor="#94d6e7" ';
97 $GLOBALS['style']['BGCOLOR2'] = "#94d6e7";
98 $bottom_bg_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
99 $title_bg_line = ' bgcolor="#aaffff" ';
100 $nav_bg_line = ' bgcolor="#94d6e7" ';
102 $login_filler_line = ' bgcolor="#f7f0d5" ';
103 $login_body_line = ' background="'.$rootdir.'/pic/aquabg.gif" ';
104 $css_header = "$rootdir/themes/style_sky_blue.css";
105 $logocode="<img src='$rootdir/pic/logo_sky.gif'>";
106 $linepic = "$rootdir/pic/repeat_vline9.gif";
107 $table_bg = ' bgcolor="#cccccc" ';
108 $GLOBALS['style']['BGCOLOR1'] = "#cccccc";
109 $GLOBALS['style']['TEXTCOLOR11'] = "#222222";
110 $GLOBALS['style']['HIGHLIGHTCOLOR'] = "#dddddd";
111 $GLOBALS['style']['BOTTOM_BG_LINE'] = $bottom_bg_line;
113 // The height in pixels of the Logo bar at the top of the login page:
114 $GLOBALS['logoBarHeight'] = 110;
115 // The height in pixels of the Navigation bar:
116 $GLOBALS['navBarHeight'] = 22;
117 // The height in pixels of the Title bar:
118 $GLOBALS['titleBarHeight'] = 20;
120 // The assistant word, MORE printed next to titles that can be clicked:
121 $tmore = "(More)";
122 // The assistant word, BACK printed next to titles that return to previous screens:
123 $tback = "(Back)";
125 // This is the idle logout function:
126 // if a page has not been refreshed within this many seconds, the interface
127 // will return to the login page
128 if (!empty($special_timeout)) {
129 $timeout = intval($special_timeout);
131 else {
132 // Max Idle Time in seconds before logout. Default 7200 (2 hours):
133 $timeout = 7200;
136 //Version tags
138 $v_major = '2';
139 $v_minor = '8';
140 $v_patch = '3';
141 $tag = '-dev'; // release candidate, e.g. '-rc1'
143 // This name appears on the login page and in the title bar of most windows.
144 // It's nice to customize this to be the name of your clinic.
145 $openemr_name = 'OpenEMR';
147 $openemr_version = "$v_major.$v_minor.$v_patch".$tag; // Version tag used by program
149 $rootdir = $GLOBALS['rootdir'];
150 $srcdir = $GLOBALS['srcdir'];
151 $login_screen = $GLOBALS['login_screen'];
152 $GLOBALS['css_header'] = $css_header;
153 $GLOBALS['backpic'] = $backpic;
154 $GLOBALS['rootdir'] = $rootdir;
156 // change these to reflect when the daily view should start to display times
157 // as well as it should end. ex schedule_start = 9 schedule_end = 17
158 // start end times in hours
159 $GLOBALS['schedule_start'] = 8;
160 $GLOBALS['schedule_end'] = 17;
162 // This is the time granularity of the calendar and the smallest interval
163 // in minutes for an appointment slot:
164 $GLOBALS['calendar_interval'] = 15;
166 // Include the authentication module code here, but the rule is
167 // if the file has the word "login" in the source code file name,
168 // don't include the authentication module - we do this to avoid
169 // include loops.
171 if (!$ignoreAuth) {
172 include_once("$srcdir/auth.inc");
175 // If you do not want your accounting system to have a customer added to it
176 // for each insurance company, then set this to true. SQL-Ledger currently
177 // (2005-03-21) does nothing useful with insurance companies as customers.
178 $GLOBALS['insurance_companies_are_not_customers'] = true;
180 // If OpenEMR is being used by an athletic team rather than in a traditional
181 // clinical setting, set this to true.
182 $GLOBALS['athletic_team'] = false;
184 // True if this is a weight loss clinic:
185 $GLOBALS['weight_loss_clinic'] = false;
187 // The telephone country code of this installation. 1 = USA.
188 // See http://www.wtng.info/ for a list.
189 $GLOBALS['phone_country_code'] = '1';
191 // This determines how appointments display on the calendar:
192 // 1 = lastname; 2 = last,first; 3 = last,first(title);
193 // 4 = last,first(title: description)
194 $GLOBALS['calendar_appt_style'] = 2;
196 // Make this true if you want providers to see all appointments by default
197 // and not just their own.
198 $GLOBALS['docs_see_entire_calendar'] = false;
200 // Set this to true if you want the drug database and support for in-house
201 // prescription dispensing.
202 $GLOBALS['inhouse_pharmacy'] = false;
204 // True to omit insurance and some other things from the demographics form:
205 $GLOBALS['simplified_demographics'] = false;
207 // True to omit form, route and interval which then become part of dosage:
208 $GLOBALS['simplified_prescriptions'] = false;
210 // True to omit method of payment from the copay panel:
211 $GLOBALS['simplified_copay'] = false;
213 // You may put text here as the default complaint in the New Patient form:
214 $GLOBALS['default_chief_complaint'] = '';
216 // This was added for sports teams needing to fill out injury forms, but might
217 // have other applications.
218 $GLOBALS['default_new_encounter_form'] = '';
220 // If you want a new encounter to be automatically created when appointment
221 // status is set to "@" (arrived), then make this true.
222 $GLOBALS['auto_create_new_encounters'] = true;
224 // If you don't want employer information, country, title in patient demographics.
225 $GLOBALS['omit_employers'] = false;
227 // You can set this to the category name of a document to link to from the
228 // patient summary page. Normally this is the category for insurance cards.
229 // This lets you click on the patient's name to see their ID card.
230 $GLOBALS['patient_id_category_name'] = '';
232 // If you want Hylafax support then uncomment and customize the following
233 // statements, and also customize custom/faxcover.txt:
235 // $GLOBALS['hylafax_server'] = 'localhost';
236 // $GLOBALS['hylafax_basedir'] = '/var/spool/fax';
237 // $GLOBALS['hylafax_enscript'] = 'enscript -M Letter -B -e^ --margins=36:36:36:36';
239 // For scanner support, uncomment and customize the following. This is
240 // the directory in which scanned-in documents may be found, and may for
241 // example be a smbfs-mounted share from the PC supporting the scanner:
243 // $GLOBALS['scanner_output_directory'] = '/mnt/scan_docs';
245 // Customize these if you are using SQL-Ledger with OpenEMR.
246 $sl_cash_acc = '1060'; // sql-ledger account number for checking account
247 $sl_ar_acc = '1200'; // sql-ledger account number for accounts receivable
248 $sl_income_acc = '4320'; // sql-ledger account number for medical services income
249 $sl_services_id = 'MS'; // sql-ledger parts table id for medical services
250 $sl_dbname = 'sql-ledger'; // sql-ledger database name
251 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
252 $sl_dbpass = 'secret'; // sql-ledger database login password
254 // Don't change anything below this line. ////////////////////////////
256 $encounter = empty($_SESSION['encounter']) ? 0 : $_SESSION['encounter'];
258 if (!empty($_GET['pid']) && empty($_SESSION['pid'])) {
259 $_SESSION['pid'] = $_GET['pid'];
261 elseif (!empty($_POST['pid']) && empty($_SESSION['pid'])) {
262 $_SESSION['pid'] = $_POST['pid'];
264 $pid = empty($_SESSION['pid']) ? 0 : $_SESSION['pid'];
265 $userauthorized = empty($_SESSION['userauthorized']) ? 0 : $_SESSION['userauthorized'];
266 $groupname = empty($_SESSION['authProvider']) ? 0 : $_SESSION['authProvider'];
268 // global interface function to format text length using ellipses
269 function strterm($string,$length) {
270 if (strlen($string) >= ($length-3)) {
271 return substr($string,0,$length-3) . "...";
272 } else {
273 return $string;
277 // required for normal operation because of recent changes in PHP:
278 $ps = strpos($_SERVER['REQUEST_URI'],"myadmin");
279 if ($ps === false) {
280 extract($_GET);
281 extract($_POST);
284 // turn off PHP compatibility warnings
285 ini_set("session.bug_compat_warn","off");