2 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
);
3 require('./roots.php');
4 require($root_path.'include/inc_environment_global.php');
6 * CARE2X Integrated Hospital Information System Deployment 2.2 - 2006-07-10
7 * GNU General Public License
8 * Copyright 2002,2003,2004,2005,2006 Elpidio Latorilla
11 * See the file "copy_notice.txt" for the licence notice
13 $lang_tables[] = 'departments.php';
14 $lang_tables[] = 'konsil.php';
15 define('LANG_FILE','lab.php');
16 /* We need to differentiate from where the user is coming:
17 * $user_origin != lab ; from patient charts folder
18 * $user_origin == lab ; from the laboratory
19 * and set the user cookie name and break or return filename
21 if($user_origin=='lab')
23 $local_user='ck_lab_user';
24 if($target=='radio') $breakfile=$root_path.'modules/radiology/radiolog.php'.URL_APPEND
;
25 else $breakfile=$root_path.'modules/laboratory/labor.php'.URL_APPEND
;
29 $local_user='ck_pflege_user';
30 $breakfile=$root_path.'modules/nursing/nursing-station-patientdaten.php'.URL_APPEND
.'&pn='.$pn.'&station='.$station.'&edit='.$edit.'&user_origin='.$user_origin;
33 require_once($root_path.'include/inc_front_chain_lang.php');
39 # Note: it is advisable to load this after the inc_front_chain_lang.php so
40 # that the smarty script can use the user configured template theme
41 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
42 $smarty = new smarty_care('nursing');
44 $thisfile=basename(__FILE__
);
46 $db_request_table=$target;
50 /* Check for the patietn number = $pn. If available get the patients data, */
52 include_once($root_path.'include/care_api_classes/class_encounter.php');
53 $enc_obj=new Encounter
;
55 if($enc_obj->loadEncounterData($pn)){
57 include_once($root_path.'include/care_api_classes/class_globalconfig.php');
58 $GLOBAL_CONFIG=array();
59 $glob_obj=new GlobalConfig($GLOBAL_CONFIG);
60 $glob_obj->getConfig('patient_%');
61 switch ($enc_obj->EncounterClass())
63 case '1': $full_en = ($pn +
$GLOBAL_CONFIG['patient_inpatient_nr_adder']);
65 case '2': $full_en = ($pn +
$GLOBAL_CONFIG['patient_outpatient_nr_adder']);
67 default: $full_en = ($pn +
$GLOBAL_CONFIG['patient_inpatient_nr_adder']);
69 $HTTP_SESSION_VARS['sess_en']=$pn;
70 $HTTP_SESSION_VARS['sess_full_en']=$full_en;
74 /* Here begins the real work */
75 require_once($root_path.'include/inc_date_format_functions.php');
78 if(!isset($mode)) $mode='';
80 if($enc_obj->is_loaded
)
83 $sql="SELECT * FROM care_test_request_".$db_request_table." WHERE batch_nr='".$batch_nr."'";
84 if($ergebnis=$db->Execute($sql))
86 if($editable_rows=$ergebnis->RecordCount())
89 $stored_request=$ergebnis->FetchRow();
90 if($target=='baclabor')
92 parse_str($stored_request['material'],$stored_material);
93 parse_str($stored_request['test_type'],$stored_test_type);
95 elseif($target=='chemlabor')
97 if($stored_request['parameters']!='') parse_str($stored_request['parameters'],$stored_param);
105 echo "<p>$sql<p>$LDDbNoRead";
109 # Detect the type of form
110 # $bgc1 = The main background color of the form
114 $formtitle = $LDRadiology;
118 include_once($root_path.'include/care_api_classes/class_department.php');
119 $dept_obj=new Department
;
120 if($dept_obj->preloadDept($stored_request['testing_dept'])){
121 $buffer=$dept_obj->LDvar();
122 if(isset($
$buffer)&&!empty($
$buffer)) $formtitle=$
$buffer;
123 else $formtitle=$dept_obj->FormalName();
128 $formtitle = $LDChemicallaboratory;
130 if(file_exists($root_path.'language/'.$lang.'/lang_'.$lang.'_konsil_chemlabor.php')){
131 include_once($root_path.'language/'.$lang.'/lang_'.$lang.'_konsil_chemlabor.php');
133 include_once($root_path.'language/en/lang_en_konsil_chemlabor.php');
137 $formtitle = $LDBacteriologicalLaboratory;
141 $formtitle = $LDBloodBank;
145 $formtitle = $LDPathology;
148 default: $bgc1='#ffffff';
152 # Start the smarty templating
155 * HEAD META definition
157 $smarty->assign('setCharSet',setCharSet());
163 if(!isset($edit) ||
empty($edit)) $smarty->assign('edit',FALSE);
165 # Set it to be purely printout
166 $smarty->assign('printmode',TRUE);
168 # Added for the html tag direction
169 $smarty->assign('HTMLtag',html_ret_rtl($lang));
172 $smarty->assign('top_txtcolor',$cfg['top_txtcolor']);
173 $smarty->assign('top_bgcolor',$cfg['top_bgcolor']);
174 $smarty->assign('body_bgcolor',$cfg['body_bgcolor']);
175 $smarty->assign('body_txtcolor',$cfg['body_txtcolor']);
176 $smarty->assign('bgc1',$bgc1);
178 $smarty->assign('gifHilfeR',createLDImgSrc($root_path,'hilfe-r.gif','0') );
179 $smarty->assign('LDCloseAlt',$LDCloseAlt );
180 $smarty->assign('gifClose2',createLDImgSrc($root_path,'close2.gif','0') );
182 # Added for the common header top block
184 $smarty->assign('sToolbarTitle',"$LDTestRequest :: $formtitle");
186 $smarty->assign('pbBack','javascript:window.history.back()');
187 $smarty->assign('gifBack2',createLDImgSrc($root_path,'back2.gif','0') );
189 # Added for the common header top block
190 $smarty->assign('pbHelp','javascript:gethelp(\'request_aftersave.php\')');
192 $smarty->assign('breakfile',$breakfile);
195 $smarty->assign('dhtml','style="filter:alpha(opacity=70)" onMouseover="hilite(this,1)" onMouseOut="hilite(this,0)"');
197 $smarty->assign('dhtml','');
202 $smarty->assign('title',$LDTestRequest);
203 $smarty->assign('Name',$station);
207 if($target=='baclabor'){
209 $smarty->assign('css_lab','.lab {font-family: arial; font-size: 9; color:#ee6666;}');
213 $smarty->assign('css_lab','.lab {font-family: arial; font-size: 9; color:purple;}');
218 * collect JavaScript for Smarty
225 <script language
="javascript">
229 urlholder
="labor_test_request_printpop.php?sid=<?php echo $sid ?>&lang=<?php echo $lang ?>&user_origin=<?php echo $user_origin ?>&subtarget=<?php echo $target ?>&batch_nr=<?php echo $batch_nr ?>&pn=<?php echo $pn ?>";
230 testprintout
<?php
echo $sid ?
>=window
.open(urlholder
,"testprintout<?php echo $sid ?>","width=800,height=600,menubar=no,resizable=yes,scrollbars=yes");
231 //testprintout<?php echo $sid ?>.print();
236 require($root_path.'include/inc_js_gethelp.php');
237 require($root_path.'include/inc_css_a_hilitebu.php');
239 $sTemp = ob_get_contents();
241 $smarty->assign('JavaScript',$sTemp);
243 $smarty->assign('gifMascot','<img '.createMascot($root_path,'mascot1_r.gif','0','absmiddle').'>');
245 if($status=="draft") $smarty->assign('sAfterSavePrompt',$LDFormSaved[$saved]);
246 else $smarty->assign('sAfterSavePrompt',$LDRequestSent[$saved]);
248 $smarty->assign('LDWhatToDo',$LDWhatToDo);
249 $smarty->assign('pbPrintOut','javascript:printOut()');
250 $smarty->assign('gifGrnArrow','<img '.createComIcon($root_path,'bul_arrowgrnsm.gif','0','absmiddle',TRUE).'>');
251 $smarty->assign('LDPrintForm',$LDPrintForm);
252 $smarty->assign('pbEditForm',$root_path."modules/nursing/nursing-station-patientdaten-doconsil-".$target.".php".URL_APPEND
."&pn=$pn&edit=$edit&station=$station&target=$target&dept_nr=$dept_nr&user_origin=$user_origin&noresize=$noresize&mode=edit&batch_nr=$batch_nr");
253 $smarty->assign('LDEditForm',$LDEditForm);
254 $smarty->assign('pbNewSamePatient',$root_path."modules/nursing/nursing-station-patientdaten-doconsil-".$target.".php".URL_APPEND
."&pn=$pn&edit=$edit&station=$station&target=$target&dept_nr=$dept_nr&user_origin=$user_origin&noresize=$noresize&mode=");
255 $smarty->assign('LDNewFormSamePatient',$LDNewFormSamePatient);
257 if($user_origin=='lab'){
258 $smarty->assign('user_origin_lab',TRUE);
259 $smarty->assign('pbNewForm',$root_path."modules/nursing/nursing-station-patientdaten-doconsil-".$target.".php".URL_APPEND
."&edit=0&station=$station&target=$target&dept_nr=$dept_nr&user_origin=$user_origin&noresize=$noresize");
260 $smarty->assign('LDNewFormOtherPatient',$LDNewFormOtherPatient);
263 $smarty->assign('breakfile',$breakfile);
264 $smarty->assign('LDEndTestRequest',$LDEndTestRequest);
266 require_once($root_path.'include/inc_test_request_printout_fx.php');
268 /* Load the form for printing out
269 * This is a hybrid compromise as long as not all forms are converted to smarty
270 * templates. In this case, when the form is pathology, the smarty assignments are done
271 * otherwise the output is buffered
274 if($target=='patho'){
276 $smarty->assign('patho',TRUE);
277 include($root_path.'include/inc_test_request_printout_patho.php');
281 # Collect output buffer
283 if($target=='baclabor'){
284 include($root_path.'include/inc_test_findings_form_baclabor.php');
286 include($root_path.'include/inc_test_request_printout_'.$target.'.php');
288 $sTemp = ob_get_contents();
290 $smarty->assign('printout_form',$sTemp);
295 * managed in smarty_care.class.php
298 $smarty->assign('sCopyright',$smarty->Copyright());
299 $smarty->assign('sPageTime',$smarty->Pagetime());
305 $smarty->display('laboratory/request_aftersave.tpl');
306 // $smarty->display('debug.tpl');