- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / laboratory / labor_test_findings_printpop.php
blob8bf326d50960abb7ce554ab4685fbcd6829f896a
1 <?php
2 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
3 require('./roots.php');
4 require($root_path.'include/inc_environment_global.php');
5 /**
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
9 * elpidio@care2x.org,
11 * See the file "copy_notice.txt" for the licence notice
13 $lang_tables[] = 'departments.php';
14 define('LANG_FILE','konsil.php');
16 /* Globalize the variables */
19 /* We need to differentiate from where the user is coming:
20 * $user_origin != lab ; from patient charts folder
21 * $user_origin == lab ; from the laboratory
22 * and set the user cookie name and break or return filename
24 switch($user_origin){
26 case 'lab':
27 $local_user='ck_lab_user';
28 $breakfile=$root_path."modules/laboratory/labor.php".URL_APPEND;
29 break;
31 case 'patreg':
32 $local_user='aufnahme_user';
33 $breakfile='javascript:window.close()';
34 break;
36 default:
37 $local_user='ck_pflege_user';
38 $breakfile=$root_path."modules/nursing/nursing-station-patientdaten.php".URL_APPEND."&edit=$edit&station=$station&pn=$pn";
41 //$local_user='ck_lab_user';
43 require_once($root_path.'include/inc_front_chain_lang.php');
45 $thisfile="labor_test_findings_".$subtarget.".php";
47 switch ($subtarget)
49 case "patho":
50 $bgc1="#cde1ec";
51 $formtitle = $LDPathology;
52 break;
54 case 'radio':
55 $bgc1="#ffffff";
56 $formtitle = $LDRadiology;
57 break;
59 case "baclabor":
60 $bgc1='#fff3f3';
61 $formtitle = $LDBacteriologicalLaboratory;
62 break;
65 $edit=0; /* Set to no edit */
67 //$konsil="patho";
69 $db_request_table=$subtarget;
72 /* Here begins the real work */
74 require_once($root_path.'include/inc_date_format_functions.php');
77 /* Check for the patient number = $pn. If available get the patients data, otherwise set edit to 0 */
78 if(isset($pn)&&$pn)
80 include_once($root_path.'include/care_api_classes/class_encounter.php');
81 $enc_obj=new Encounter;
82 if( $enc_obj->loadEncounterData($pn)) {
84 include_once($root_path.'include/care_api_classes/class_globalconfig.php');
85 $GLOBAL_CONFIG=array();
86 $glob_obj=new GlobalConfig($GLOBAL_CONFIG);
87 $glob_obj->getConfig('patient_%');
88 switch ($enc_obj->EncounterClass())
90 case '1': $full_en = ($pn + $GLOBAL_CONFIG['patient_inpatient_nr_adder']);
91 break;
92 case '2': $full_en = ($pn + $GLOBAL_CONFIG['patient_outpatient_nr_adder']);
93 break;
94 default: $full_en = ($pn + $GLOBAL_CONFIG['patient_inpatient_nr_adder']);
97 $result=&$enc_obj->encounter;
103 if(!isset($mode) && $batch_nr && $pn) $mode="edit";
105 switch($mode)
107 /* If mode is edit, get the stored test findings
109 case 'edit':
111 if($subtarget=='baclabor')
114 $sql="SELECT * FROM care_test_request_".$db_request_table." WHERE batch_nr='".$batch_nr."'";
116 if($ergebnis=$db->Execute($sql))
118 if($editable_rows=$ergebnis->RecordCount())
121 $stored_request=$ergebnis->FetchRow();
123 parse_str($stored_request['material'],$stored_material);
124 parse_str($stored_request['test_type'],$stored_test_type);
126 $edit_form=1;
127 $read_form=1;
133 $sql="SELECT * FROM care_test_findings_".$db_request_table." WHERE batch_nr='".$batch_nr."'";
135 if($ergebnis=$db->Execute($sql))
137 if($editable_rows=$ergebnis->RecordCount())
140 $stored_findings=$ergebnis->FetchRow();
142 if($subtarget=='baclabor')
144 parse_str($stored_findings['type_general'],$parsed_type);
145 parse_str($stored_findings['resist_anaerob'],$parsed_resist_anaerob);
146 parse_str($stored_findings['resist_aerob'],$parsed_resist_aerob);
147 parse_str($stored_findings['findings'],$parsed_findings);
150 if($stored_findings['status']=="done") $edit_findings=0; /* Inhibit editing of the findings */
152 $mode='update';
153 $edit_form=1;
154 $read_form=1;
158 break; ///* End of case 'edit': */
160 default: $mode="";
162 }// end of switch($mode)
166 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN" "html.dtd">
167 <?php html_rtl($lang); ?>
168 <HEAD>
169 <?php echo setCharSet(); ?>
170 <TITLE><?php echo "$LDTestFindings #$batch_nr" ?></TITLE>
171 <?php
172 require($root_path.'include/inc_js_gethelp.php');
173 require($root_path.'include/inc_css_a_hilitebu.php');
176 <style type="text/css">
177 div.fva2_ml10 {font-family: verdana,arial; font-size: 12; margin-left: 10;}
178 div.fa2_ml10 {font-family: arial; font-size: 12; margin-left: 10;}
179 div.fva2_ml3 {font-family: verdana; font-size: 12; margin-left: 3; }
180 div.fa2_ml3 {font-family: arial; font-size: 12; margin-left: 3; }
181 .fva2_ml10 {font-family: verdana,arial; font-size: 12; margin-left: 10; color:#000099;}
182 .fva2b_ml10 {font-family: verdana,arial; font-size: 12; margin-left: 10; color:#000000;}
183 .fva0_ml10 {font-family: verdana,arial; font-size: 10; margin-left: 10; color:#000099;}
184 .fvag_ml10 {font-family: verdana,arial; font-size: 10; margin-left: 10; color:#969696;}
185 .lab {font-family:ms ui gothic; font-size: 9; color:#ee6666;}
186 .lmargin {margin-left: 5;}
187 </style>
190 </HEAD>
192 <BODY bgcolor=<?php echo $cfg['body_bgcolor']; ?> onLoad="if (window.focus) window.focus();window.print();" >
196 <?php
198 require_once($root_path.'include/inc_test_request_printout_fx.php');
201 if($show_print_button) echo '<a href="javascript:window.print()"><img '.createLDImgSrc($root_path,'printout.gif','0').'></a><p>';
204 * Load the form
206 // include('../include/inc_test_request_printout_baclabor.php');
207 if($subtarget=='baclabor')
209 echo '<img src="'.$root_path.'main/imgcreator/barcode_label_single_large.php?sid='.$sid.'&lang='.$lang.'&fen='.$full_en.'&en='.$pn.'&batch_nr='.$batch_nr.'&child_img=1&subtarget='.$subtarget.'" >';
211 else
213 include_once($root_path.'include/inc_test_findings_form_'.$subtarget.'.php');
217 </BODY>
218 </HTML>