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=array('departments.php');
14 define('LANG_FILE','konsil.php');
15 $local_user='ck_lab_user';
17 require_once($root_path.'include/inc_front_chain_lang.php');
18 require_once($root_path.'global_conf/inc_global_address.php');
19 require_once($root_path.'include/inc_diagnostics_report_fx.php');
21 $breakfile=$root_path.'modules/radiology/radiolog.php'.URL_APPEND
;
22 $returnfile='labor_test_request_admin_'.$subtarget.'.php'.URL_APPEND
.'&target='.$target.'&subtarget='.$subtarget.'&user_origin='.$user_origin;
23 $thisfile='labor_test_findings_'.$subtarget.'.php';
27 $edit=1; /* Assume to edit first */
29 $formtitle=$LDRadiology;
30 $dept_nr=19; // 19 = department nr. of radiology
31 $db_request_table=$subtarget;
35 require_once($root_path.'include/care_api_classes/class_encounter.php');
36 $enc_obj=new Encounter
;
38 /* Here begins the real work */
40 require_once($root_path.'include/inc_date_format_functions.php');
43 /* Check for the patient number = $pn. If available get the patients data, otherwise set edit to 0 */
47 if( $enc_obj->loadEncounterData($pn)) {
49 include_once($root_path.'include/care_api_classes/class_globalconfig.php');
50 $GLOBAL_CONFIG=array();
51 $glob_obj=new GlobalConfig($GLOBAL_CONFIG);
52 $glob_obj->getConfig('patient_%');
53 switch ($enc_obj->EncounterClass())
55 case '1': $full_en = ($pn +
$GLOBAL_CONFIG['patient_inpatient_nr_adder']);
57 case '2': $full_en = ($pn +
$GLOBAL_CONFIG['patient_outpatient_nr_adder']);
59 default: $full_en = ($pn +
$GLOBAL_CONFIG['patient_inpatient_nr_adder']);
62 $result=&$enc_obj->encounter
;
74 if(!isset($mode) && $batch_nr && $pn) $mode='edit';
80 $sql="INSERT INTO care_test_findings_".$db_request_table."
82 batch_nr, encounter_nr, dept_nr,
84 doctor_id, findings_date, findings_time,
92 '".$batch_nr."','".$pn."','".$dept_nr."',
93 '".addslashes(htmlspecialchars($findings))."','".addslashes(htmlspecialchars($diagnosis))."',
94 '".htmlspecialchars($doctor_id)."', '".formatDate2Std($findings_date,$date_format)."', '".date('H:i:s')."',
96 'Create: ".date('Y-m-d H:i:s')." = ".$HTTP_SESSION_VARS['sess_user_name']."\n',
97 '".$HTTP_SESSION_VARS['sess_user_name']."',
102 if($ergebnis=$enc_obj->Transact($sql))
104 signalNewDiagnosticsReportEvent($findings_date);
106 header("location:$thisfile?sid=$sid&lang=$lang&edit=$edit&saved=insert&mode=edit&pn=$pn&station=$station&user_origin=$user_origin&status=$status&target=$target&subtarget=$subtarget&noresize=$noresize&batch_nr=$batch_nr&entry_date=$entry_date");
111 echo "<p>$sql<p>$LDDbNoSave";
115 break; // end of case 'save'
119 $sql="UPDATE care_test_findings_".$db_request_table." SET
120 findings='".addslashes(htmlspecialchars($findings))."',
121 diagnosis='".addslashes(htmlspecialchars($diagnosis))."',
122 doctor_id='".htmlspecialchars($doctor_id)."',
123 findings_date='".formatDate2Std($findings_date,$date_format)."',
124 findings_time='".date('H:i:s')."',
125 history=".$enc_obj->ConcatHistory("Update: ".date('Y-m-d H:i:s')." = ".$HTTP_SESSION_VARS['sess_user_name']."\n").",
126 modify_id = '".$HTTP_SESSION_VARS['sess_user_name']."',
127 modify_time='".date('YmdHis')."'
128 WHERE batch_nr = '".$batch_nr."'";
130 if($ergebnis=$enc_obj->Transact($sql))
132 signalNewDiagnosticsReportEvent($findings_date);
134 header("location:$thisfile?sid=$sid&lang=$lang&edit=$edit&saved=insert&mode=edit&pn=$pn&station=$station&user_origin=$user_origin&status=$status&target=$target&subtarget=$subtarget&noresize=$noresize&batch_nr=$batch_nr&entry_date=$entry_date");
139 echo "<p>$sql<p>$LDDbNoSave";
143 break; // end of case 'save'
147 $sql="UPDATE care_test_findings_".$db_request_table." SET
149 history=".$enc_obj->ConcatHistory("Done: ".date('Y-m-d H:i:s')." = ".$HTTP_SESSION_VARS['sess_user_name']."\n").",
150 modify_id = '".$HTTP_SESSION_VARS['sess_user_name']."',
151 modify_time='".date('YmdHis')."'
152 WHERE batch_nr = '".$batch_nr."'";
154 if($ergebnis=$enc_obj->Transact($sql))
157 $sql="UPDATE care_test_request_".$db_request_table." SET
159 history=".$enc_obj->ConcatHistory("Done: ".date('Y-m-d H:i:s')." = ".$HTTP_SESSION_VARS['sess_user_name']."\n").",
160 modify_id = '".$HTTP_SESSION_VARS['sess_user_name']."',
161 modify_time='".date('YmdHis')."'
162 WHERE batch_nr = '".$batch_nr."'";
164 if($ergebnis=$enc_obj->Transact($sql))
166 // Load the visual signalling functions
167 include_once($root_path.'include/inc_visual_signalling_fx.php');
168 // Set the visual signal
169 setEventSignalColor($pn,SIGNAL_COLOR_DIAGNOSTICS_REPORT
);
170 header("location:$thisfile?sid=$sid&lang=$lang&edit=$edit&saved=insert&mode=edit&pn=$pn&station=$station&user_origin=$user_origin&status=$status&target=$target&subtarget=$subtarget&noresize=$noresize&batch_nr=$batch_nr&entry_date=$entry_date");
175 echo "<p>$sql<p>$LDDbNoSave";
181 echo "<p>$sql<p>$LDDbNoSave";
185 break; // end of case 'save'
188 /* If mode is edit, get the stored test findings
192 $sql="SELECT * FROM care_test_findings_".$db_request_table." WHERE batch_nr='$batch_nr'";
193 if($ergebnis=$db->Execute($sql))
195 if($editable_rows=$ergebnis->RecordCount())
197 $stored_findings=$ergebnis->FetchRow();
198 if($stored_findings['status']=='done') $edit=0; /* Inhibit editing of the findings */
211 break; ///* End of case 'edit': */
215 }// end of switch($mode)
217 if($edit) $returnfile.='&batch_nr='.$batch_nr.'&pn='.$pn.'&tracker='.$tracker;
219 # Start Smarty templating here
224 # Note: it is advisable to load this after the inc_front_chain_lang.php so
225 # that the smarty script can use the user configured template theme
227 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
228 $smarty = new smarty_care('nursing');
231 $smarty->assign('sToolbarTitle',$LDDiagnosticTest." (".$batch_nr.")");
234 $smarty->assign('pbBack',$returnfile);
236 # href for help button
237 $smarty->assign('pbHelp',"javascript:gethelp('pending_radio_findings.php')");
239 # href for close button
240 $smarty->assign('breakfile',$breakfile);
243 $smarty->assign('sWindowTitle',$LDDiagnosticTest." (".$batch_nr.")");
245 $smarty->assign('sOnLoadJs','onLoad="if (window.focus) window.focus();"');
247 # Collect extra javascript code
252 <!DOCTYPE HTML
PUBLIC "-//IETF//DTD HTML 3.0//EN" "html.dtd">
253 <?php
html_rtl($lang); ?
>
255 <?php
echo setCharSet(); ?
>
256 <TITLE
><?php
echo "$LDDiagnosticTest $station" ?
></TITLE
>
258 require($root_path.'include/inc_js_gethelp.php');
259 require($root_path.'include/inc_css_a_hilitebu.php');
262 <style type
="text/css">
263 div
.fva2_ml10
{font
-family
: verdana
,arial
; font
-size
: 12; margin
-left
: 10;}
264 div
.fa2_ml10
{font
-family
: arial
; font
-size
: 12; margin
-left
: 10;}
265 div
.fva2_ml3
{font
-family
: verdana
; font
-size
: 12; margin
-left
: 3; }
266 div
.fa2_ml3
{font
-family
: arial
; font
-size
: 12; margin
-left
: 3; }
267 .fva2_ml10
{font
-family
: verdana
,arial
; font
-size
: 12; margin
-left
: 10; color
:#000099;}
268 .fva2b_ml10
{font
-family
: verdana
,arial
; font
-size
: 12; margin
-left
: 10; color
:#000000;}
269 .fva0_ml10
{font
-family
: verdana
,arial
; font
-size
: 10; margin
-left
: 10; color
:#000099;}
270 .fvag_ml10
{font
-family
: verdana
,arial
; font
-size
: 10; margin
-left
: 10; color
:#969696;}
273 <script language
="javascript">
278 * Output the following function only when in edit mode
286 if(d
.findings
.value
=="" && d
.diagnosis
.value
=="") return false;
287 else if(d
.findings_date
.value
=="" || d
.findings_date
.value
==" ")
289 alert("<?php echo $LDPlsEnterDate ?>");
290 d
.findings_date
.focus();
293 else if(d
.doctor_id
.value
=="" || d
.doctor_id
.value
==" ")
295 alert("<?php echo $LDPlsEnterDoctorName ?>");
311 urlholder
="labor_test_findings_printpop.php?sid=<?php echo $sid ?>&lang=<?php echo $lang ?>&user_origin=<?php echo $user_origin ?>&subtarget=<?php echo $subtarget ?>&batch_nr=<?php echo $batch_nr ?>&pn=<?php echo $pn ?>&entry_date=<?php echo $entry_date ?>";
312 findings_printout
<?php
echo $sid ?
>=window
.open(urlholder
,"findings_printout<?php echo $sid ?>","width=800,height=600,menubar=no,resizable=yes,scrollbars=yes");
313 findings_printout
<?php
echo $sid ?
>.print();
316 <?php
require($root_path.'include/inc_checkdate_lang.php'); ?
>
321 $sTemp = ob_get_contents();
325 $smarty->append('JavaScript',$sTemp);
336 <form name
="form_test_request" method
="post" action
="<?php echo $thisfile ?>" onSubmit
="return chkForm(this)">
340 require_once($root_path.'include/inc_test_findings_form_'.$subtarget.'.php');
346 <input type="image" '.createLDImgSrc($root_path,'savedisc.gif','0').'>';
352 <a href
="javascript:printOut()"><img
<?php
echo createLDImgSrc($root_path,'printout.gif','0') ?
>></a
>
354 if (isset($stored_findings['status']) && $stored_findings['status']!='done' )
357 <a href="'. $thisfile.'?sid='.$sid.'&lang='.$lang.'&edit='.$edit.'&mode=done&target='.$target.'&subtarget='.$subtarget.'&batch_nr='.$batch_nr.'&pn='.$pn.'&user_origin='.$user_origin.'&entry_date='.$entry_date.'"><img '.createLDImgSrc($root_path,'done.gif','0').' alt="'.$LDDone.'"></a>';
364 require($root_path.'include/inc_test_request_hiddenvars.php');
367 <input type
="hidden" name
="entry_date" value
="<?php echo $entry_date ?>">
378 $sTemp = ob_get_contents();
381 # Assign to page template object
382 $smarty->assign('sMainFrameBlockData',$sTemp);
387 $smarty->display('common/mainframe.tpl');