- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / registration_admission / gui_bridge / default / gui_input_show_birthdetail.php
blobfef199ae24d793cb2b12f29af0a8eb946e589fe3
1 <script language="JavaScript">
2 <!-- Script Begin
3 function popClassification() {
4 urlholder="./neonatal_classifications.php<?php echo URL_REDIRECT_APPEND; ?>";
5 CLASSWIN<?php echo $sid ?>=window.open(urlholder,"CLASSWIN<?php echo $sid ?>","menubar=no,width=300,height=450,resizable=yes,scrollbars=yes");
8 function clearClassification() {
9 document.report.classification.value="";
10 document.report.classification.focus();
13 function chkform(d){
14 if(d.parent_encounter_nr.value==""){
15 if(!confirm("<?php echo $LDParentEncNrMissing; ?>")){
16 d.parent_encounter_nr.focus();
17 return false;
21 if(isNaN(d.parent_encounter_nr.value)){
22 d.length.focus(); // patch for Konqueror
23 alert("<?php echo $LDEntryInvalidChar; ?>");
24 d.parent_encounter_nr.focus();
25 return false;
26 }else if(d.parent_encounter_nr.value<0){
27 d.length.focus(); // patch for Konqueror
28 alert("<?php echo $LDNotNegValue; ?>");
29 d.parent_encounter_nr.focus();
30 return false;
31 }else if(d.delivery_place.value==""){
32 alert("<?php echo $LDPlsEnterDeliveryPlace; ?>");
33 d.delivery_place.focus();
34 return false;
35 }else if(d.delivery_mode.value==""){
36 alert("<?php echo $LDPlsSelectDeliveryMode; ?>");
37 return false;
38 }else if(isNaN(d.weight.value)){
39 d.length.focus(); // patch for Konqueror
40 alert("<?php echo $LDEntryInvalidChar; ?>");
41 d.weight.focus();
42 return false;
43 }else if(d.weight.value<0){
44 d.length.focus(); // patch for Konqueror
45 alert("<?php echo $LDNotNegValue; ?>");
46 d.weight.focus();
47 return false;
48 }else if(isNaN(d.length.value)){
49 d.weight.focus(); // patch for Konqueror
50 alert("<?php echo $LDEntryInvalidChar; ?>");
51 d.length.focus();
52 return false;
53 }else if(d.length.value<0){
54 d.weight.focus(); // patch for Konqueror
55 alert("<?php echo $LDNotNegValue; ?>");
56 d.length.focus();
57 return false;
58 }else if(isNaN(d.head_circumference.value)){
59 d.weight.focus(); // patch for Konqueror
60 alert("<?php echo $LDEntryInvalidChar; ?>");
61 d.head_circumference.focus();
62 return false;
63 }else if(d.head_circumference.value<0){
64 d.weight.focus(); // patch for Konqueror
65 alert("<?php echo $LDNotNegValue; ?>");
66 d.head_circumference.focus();
67 return false;
68 }else if(d.docu_by.value==""){
69 alert("<?php echo $LDPlsEnterFullName; ?>");
70 d.docu_by.focus();
71 return false;
72 }else{
73 return true;
76 // Script End -->
77 </script>
81 <form method="post" name="report" onSubmit="return chkform(this)">
82 <?php
83 # Parent's (mother's) encounter nr.
84 $TP_PARENT_ENR= $LD['parent_encounter_nr'];
86 if($birth['parent_encounter_nr']) $TP_PENR= $birth['parent_encounter_nr'];
88 # Delivery nr.
89 $TP_DELIV_NR=$LD['delivery_nr'];
91 if($birth['delivery_nr']) $TP_DNR= $birth['delivery_nr'];
93 # Delivery place
94 $TP_DELIV_PLACE=$LD['delivery_place'];
95 $TP_DPLACE=$birth['delivery_place'];
97 # Delivery mode
98 $TP_DELIV_MODE=$LD['delivery_mode'];
100 if(!$birth['delivery_mode']) $birth['delivery_mode']=1; # 1= Normal delivery
101 # Delivery mode radio buttons
102 $TP_DMODE_RADIOS='';
103 $dm=&$obj->DeliveryModes();
104 if($obj->LastRecordCount()){
105 while($dmod=$dm->FetchRow()){
106 $TP_DMODE_RADIOS.='<input type="radio" name="delivery_mode" value="'.$dmod['nr'].'" ';
107 if($birth['delivery_mode']==$dmod['nr']) $TP_DMODE_RADIOS.='checked' ;
108 $TP_DMODE_RADIOS.='>';
109 if(isset($$dmod['LD_var'])&&$$dmod['LD_var']) $TP_DMODE_RADIOS.=$$dmod['LD_var'];
110 else $TP_DMODE_RADIOS.=$dmod['name'];
114 # Ceasarean reason
115 $TP_CES_REASON=$LD['c_s_reason'];
116 $TP_CREASON=$birth['c_s_reason'];
118 # Born before arrival
119 $TP_BB_ARRIVAL=$LD['born_before_arrival'];
120 $TP_BB_AR_YES='<input type="radio" name="born_before_arrival" value="1" ';
121 if($birth['born_before_arrival']) $TP_BB_AR_YES.='checked';
122 $TP_BB_AR_YES.='>'.$LDYes;
123 $TP_BB_AR_NO='<input type="radio" name="born_before_arrival" value="0" ';
124 if(!$birth['born_before_arrival']) $TP_BB_AR_NO.='checked';
125 $TP_BB_AR_NO.='>'.$LDNo;
127 # Face presentation
128 $TP_FACE_PRES=$LD['face_presentation'];
130 if(!isset($birth['face_presentation'])) $birth['face_presentation']=1;
131 $TP_FACE_PRES_YES='<input type="radio" name="face_presentation" value="1" ';
132 if($birth['face_presentation']) $TP_FACE_PRES_YES.='checked';
133 $TP_FACE_PRES_YES.='>'.$LDYes;
135 $TP_FACE_PRES_NO='<input type="radio" name="face_presentation" value="0" ';
136 if(!$birth['face_presentation']) $TP_FACE_PRES_NO.='checked';
137 $TP_FACE_PRES_NO.='>'.$LDNo;
139 # Posterio -occipital position
140 $TP_POS_OCCI=$LD['posterio_occipital_position'];
141 $TP_POS_OCCI_YES='<input type="radio" name="posterio_occipital_position" value="1" ';
142 if($birth['posterio_occipital_position']) $TP_POS_OCCI_YES.='checked';
143 $TP_POS_OCCI_YES.='>'.$LDYes;
144 $TP_POS_OCCI_NO='<input type="radio" name="posterio_occipital_position" value="0" ';
145 if(!$birth['posterio_occipital_position']) $TP_POS_OCCI_NO.='checked';
146 $TP_POS_OCCI_NO.='>'.$LDNo;
148 # Delivery rank
149 $TP_DELIV_RANK=$LD['delivery_rank'];
150 if($birth['delivery_rank']) $TP_DRANK=$birth['delivery_rank'];
152 # Apgar item names
153 $TP_APGAR1=$LD['apgar_1_min'];
154 if(!isset($birth['apgar_1_min'])) $birth['apgar_1_min']=-1;
155 $TP_APGAR5=$LD['apgar_5_min'];
156 if(!isset($birth['apgar_5_min'])) $birth['apgar_5_min']=-1;
157 $TP_APGAR10=$LD['apgar_10_min'];
158 if(!isset($birth['apgar_10_min'])) $birth['apgar_10_min']=-1;
160 # Apgar 1 min - radio buttons
161 $TP_APGAR1_RADIOS='<input type="radio" name="apgar_1_min" value="0" ';
162 if($birth['apgar_1_min']==0) $TP_APGAR1_RADIOS.='checked';
163 $TP_APGAR1_RADIOS.='>0
164 <input type="radio" name="apgar_1_min" value="1" ';
165 if($birth['apgar_1_min']==1) $TP_APGAR1_RADIOS.='checked';
166 $TP_APGAR1_RADIOS.='>1
167 <input type="radio" name="apgar_1_min" value="2" ';
168 if($birth['apgar_1_min']==2) $TP_APGAR1_RADIOS.='checked';
169 $TP_APGAR1_RADIOS.='>2
170 <input type="radio" name="apgar_1_min" value="3" ';
171 if($birth['apgar_1_min']==3) $TP_APGAR1_RADIOS.='checked';
172 $TP_APGAR1_RADIOS.='>3
173 <input type="radio" name="apgar_1_min" value="4" ';
174 if($birth['apgar_1_min']==4) $TP_APGAR1_RADIOS.='checked';
175 $TP_APGAR1_RADIOS.='>4
176 <input type="radio" name="apgar_1_min" value="5" ';
177 if($birth['apgar_1_min']==5) $TP_APGAR1_RADIOS.='checked';
178 $TP_APGAR1_RADIOS.='>5
179 <input type="radio" name="apgar_1_min" value="6" ';
180 if($birth['apgar_1_min']==6) $TP_APGAR1_RADIOS.='checked';
181 $TP_APGAR1_RADIOS.='>6
182 <input type="radio" name="apgar_1_min" value="7" ';
183 if($birth['apgar_1_min']==7) $TP_APGAR1_RADIOS.='checked';
184 $TP_APGAR1_RADIOS.='>7
185 <input type="radio" name="apgar_1_min" value="8" ';
186 if($birth['apgar_1_min']==8) $TP_APGAR1_RADIOS.='checked';
187 $TP_APGAR1_RADIOS.='>8
188 <input type="radio" name="apgar_1_min" value="9" ';
189 if($birth['apgar_1_min']==9) $TP_APGAR1_RADIOS.='checked';
190 $TP_APGAR1_RADIOS.='>9
191 <input type="radio" name="apgar_1_min" value="10" ';
192 if($birth['apgar_1_min']==10) $TP_APGAR1_RADIOS.='checked';
193 $TP_APGAR1_RADIOS.='>10';
195 # Apgar 5 min radio buttons
196 $TP_APGAR5_RADIOS='<input type="radio" name="apgar_5_min" value="0" ';
197 if($birth['apgar_5_min']==0) $TP_APGAR5_RADIOS.='checked';
198 $TP_APGAR5_RADIOS.='>0
199 <input type="radio" name="apgar_5_min" value="1" ';
200 if($birth['apgar_5_min']==1) $TP_APGAR5_RADIOS.='checked';
201 $TP_APGAR5_RADIOS.='>1
202 <input type="radio" name="apgar_5_min" value="2" ';
203 if($birth['apgar_5_min']==2) $TP_APGAR5_RADIOS.='checked';
204 $TP_APGAR5_RADIOS.='>2
205 <input type="radio" name="apgar_5_min" value="3" ';
206 if($birth['apgar_5_min']==3) $TP_APGAR5_RADIOS.='checked';
207 $TP_APGAR5_RADIOS.='>3
208 <input type="radio" name="apgar_5_min" value="4" ';
209 if($birth['apgar_5_min']==4) $TP_APGAR5_RADIOS.='checked';
210 $TP_APGAR5_RADIOS.='>4
211 <input type="radio" name="apgar_5_min" value="5" ';
212 if($birth['apgar_5_min']==5) $TP_APGAR5_RADIOS.='checked';
213 $TP_APGAR5_RADIOS.='>5
214 <input type="radio" name="apgar_5_min" value="6" ';
215 if($birth['apgar_5_min']==6) $TP_APGAR5_RADIOS.='checked';
216 $TP_APGAR5_RADIOS.='>6
217 <input type="radio" name="apgar_5_min" value="7" ';
218 if($birth['apgar_5_min']==7) $TP_APGAR5_RADIOS.='checked';
219 $TP_APGAR5_RADIOS.='>7
220 <input type="radio" name="apgar_5_min" value="8" ';
221 if($birth['apgar_5_min']==8) $TP_APGAR5_RADIOS.='checked';
222 $TP_APGAR5_RADIOS.='>8
223 <input type="radio" name="apgar_5_min" value="9" ';
224 if($birth['apgar_5_min']==9) $TP_APGAR5_RADIOS.='checked';
225 $TP_APGAR5_RADIOS.='>9
226 <input type="radio" name="apgar_5_min" value="10" ';
227 if($birth['apgar_5_min']==10) $TP_APGAR5_RADIOS.='checked';
228 $TP_APGAR5_RADIOS.='>10';
230 # Apgar 10 mins radio buttons
231 $TP_APGAR10_RADIOS='<input type="radio" name="apgar_10_min" value="0" ';
232 if($birth['apgar_10_min']==0) $TP_APGAR10_RADIOS.='checked';
233 $TP_APGAR10_RADIOS.='>0
234 <input type="radio" name="apgar_10_min" value="1" ';
235 if($birth['apgar_10_min']==1) $TP_APGAR10_RADIOS.='checked';
236 $TP_APGAR10_RADIOS.='>1
237 <input type="radio" name="apgar_10_min" value="2" ';
238 if($birth['apgar_10_min']==2) $TP_APGAR10_RADIOS.='checked';
239 $TP_APGAR10_RADIOS.='>2
240 <input type="radio" name="apgar_10_min" value="3" ';
241 if($birth['apgar_10_min']==3) $TP_APGAR10_RADIOS.='checked';
242 $TP_APGAR10_RADIOS.='>3
243 <input type="radio" name="apgar_10_min" value="4" ';
244 if($birth['apgar_10_min']==4) $TP_APGAR10_RADIOS.='checked';
245 $TP_APGAR10_RADIOS.='>4
246 <input type="radio" name="apgar_10_min" value="5" ';
247 if($birth['apgar_10_min']==5) $TP_APGAR10_RADIOS.='checked';
248 $TP_APGAR10_RADIOS.='>5
249 <input type="radio" name="apgar_10_min" value="6" ';
250 if($birth['apgar_10_min']==6) $TP_APGAR10_RADIOS.='checked';
251 $TP_APGAR10_RADIOS.='>6
252 <input type="radio" name="apgar_10_min" value="7" ';
253 if($birth['apgar_10_min']==7) $TP_APGAR10_RADIOS.='checked';
254 $TP_APGAR10_RADIOS.='>7
255 <input type="radio" name="apgar_10_min" value="8" ';
256 if($birth['apgar_10_min']==8) $TP_APGAR10_RADIOS.='checked';
257 $TP_APGAR10_RADIOS.='>8
258 <input type="radio" name="apgar_10_min" value="9" ';
259 if($birth['apgar_10_min']==9) $TP_APGAR10_RADIOS.='checked';
260 $TP_APGAR10_RADIOS.='>9
261 <input type="radio" name="apgar_10_min" value="10" ';
262 if($birth['apgar_10_min']==10) $TP_APGAR10_RADIOS.='checked';
263 $TP_APGAR10_RADIOS.='>10';
265 # Time to spontan respiration
266 $TP_SPONTANRESP=$LD['time_to_spont_resp'];
267 if($birth['time_to_spont_resp']) $TP_SP_RESP=$birth['time_to_spont_resp'];
269 $TP_CONDITION=$LD['condition'];
270 $TP_COND=$birth['condition'];
271 $TP_WEIGHT=$LD['weight'];
272 if($birth['weight']>0) $TP_WT=$birth['weight'];
273 $TP_LENGTH=$LD['length'];
274 if($birth['length']>0) $TP_LEN=$birth['length'];
275 $TP_HEAD_CIRC=$LD['head_circumference'];
276 if($birth['head_circumference']>0) $TP_HCIRC=$birth['head_circumference'];
277 $TP_GEST_AGE=$LD['scored_gestational_age'];
278 if($birth['scored_gestational_age']>0) $TP_GAGE=$birth['scored_gestational_age'];
279 $TP_FEEDING=$LD['feeding'];
281 # Feeding, set default to "breast" = type #1
282 if(!isset($birth['feeding'])||!$birth['feeding']) $birth['feeding']=1;
283 # Feeding radio buttons
284 $TP_FEED_RADIOS='';
285 $fd=&$obj->FeedingTypes();
286 if($obj->LastRecordCount()){
287 while($feed=$fd->FetchRow()){
288 $TP_FEED_RADIOS.='<input type="radio" name="feeding" value="'.$feed['nr'].'" ';
289 if($birth['feeding']==$feed['nr']) $TP_FEED_RADIOS.='checked' ;
290 $TP_FEED_RADIOS.='>';
291 if(isset($$feed['LD_var'])&&$$feed['LD_var']) $TP_FEED_RADIOS.=$$feed['LD_var'];
292 else $TP_FEED_RADIOS.=$feed['name'];
296 # congenital abnormality
297 $TP_CONG_ABNORM=$LD['congenital_abnormality'];
298 if($birth['congenital_abnormality']) $TP_CABNORM=$birth['congenital_abnormality'];
299 else $TP_CABNORM='';
300 # Classification
301 $TP_CLASSIFICATION=$LD['classification'];
302 $TP_CLASSIF='';
303 if(!empty($birth['classification'])) $TP_CLASSIF=$birth['classification'];
304 # Image buttons for javascript activation
305 $TP_IMG_ADD=createLDImgSrc($root_path,'add_sm.gif','0');
306 $TP_IMG_CLEAR=createLDImgSrc($root_path,'clearall_sm.gif','0');
308 # Outcome
309 if(!$birth['outcome']) $birth['outcome']=1; # 1 = living
310 $TP_OUTCOME=$LD['outcome'];
311 # Outcome radio buttons
312 $TP_OUT_RADIOS='';
313 $oc=&$obj->Outcomes();
314 if($obj->LastRecordCount()){
315 while($otc=$oc->FetchRow()){
316 $TP_OUT_RADIOS.='<input type="radio" name="outcome" value="'.$otc['nr'].'" ';
317 if($birth['outcome']==$otc['nr']) $TP_OUT_RADIOS.='checked' ;
318 $TP_OUT_RADIOS.='>';
319 if(isset($$otc['LD_var'])&&$$otc['LD_var']) $TP_OUT_RADIOS.=$$otc['LD_var'];
320 else $TP_OUT_RADIOS.=$otc['name'];
323 # Disease categories
324 $TP_DIS_CAT=$LD['disease_category'];
325 # Disease category radio buttons
326 $TP_DISCAT_RADIOS='';
327 $dc=&$obj->DiseaseCategories();
328 if($obj->LastRecordCount()){
329 while($dcat=$dc->FetchRow()){
330 $TP_DISCAT_RADIOS.='<input type="radio" name="disease_category" value="'.$dcat['nr'].'" ';
331 if($birth['disease_category']==$dcat['nr']) $TP_DISCAT_RADIOS.='checked' ;
332 $TP_DISCAT_RADIOS.='>';
333 if(isset($$dcat['LD_var'])&&$$dcat['LD_var']) $TP_DISCAT_RADIOS.=$$dcat['LD_var'];
334 else $TP_DISCAT_RADIOS.=$dcat['name'];
337 # Documented by
338 $TP_DOCBY=$LD['docu_by'];
339 $TP_DBY=$HTTP_SESSION_VARS['sess_user_name'];
341 # Load the template
342 $tp_birth=$TP_obj->load('registration_admission/tp_input_show_birthdetail.htm');
343 eval("echo $tp_birth;");
347 <input type="hidden" name="sid" value="<?php echo $sid; ?>">
348 <input type="hidden" name="lang" value="<?php echo $lang; ?>">
349 <input type="hidden" name="encounter_nr" value="<?php echo $HTTP_SESSION_VARS['sess_en']; ?>">
350 <input type="hidden" name="pid" value="<?php echo $HTTP_SESSION_VARS['sess_pid']; ?>">
351 <input type="hidden" name="allow_update" value="<?php if(isset($allow_update)) echo $allow_update; ?>">
352 <input type="hidden" name="target" value="<?php echo $target; ?>">
353 <input type="hidden" name="delivery_date" value="<?php echo $date_birth; ?>">
354 <input type="hidden" name="mode" value="newdata">
355 <input type="image" <?php echo createLDImgSrc($root_path,'savedisc.gif','0'); ?>>
357 </form>