- 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_pregnancy.php
blob0c006d5ce6022040ee6b1acd6dae22d0d3b424b6
1 <?php
2 if($rows) $pregnancy=$pregs->FetchRow();
3 ?>
5 <script language="JavaScript">
6 <!-- Script Begin
7 function chkform(d) {
8 if(d.delivery_date.value==""){
9 alert("<?php echo $LDPlsEnterDeliveryDate; ?>");
10 d.delivery_date.focus();
11 return false;
12 }else if(d.delivery_time.value==""){
13 alert("<?php echo $LDPlsEnterDeliveryTime; ?>");
14 d.delivery_time.focus();
15 return false;
16 }else if(isNaN(d.nr_of_fetuses.value)){
17 d.bp_diastolic_high.focus(); // patch for Konqueror
18 alert("<?php echo $LDEntryInvalidChar; ?>");
19 d.nr_of_fetuses.focus();
20 return false;
21 }else if(d.nr_of_fetuses.value<0){
22 d.bp_diastolic_high.focus(); // patch for Konqueror
23 alert("<?php echo $LDNotNegValue; ?>");
24 d.nr_of_fetuses.focus();
25 return false;
26 }else if(isNaN(d.bp_systolic_high.value)){
27 d.bp_diastolic_high.focus(); // patch for Konqueror
28 alert("<?php echo $LDEntryInvalidChar; ?>");
29 d.bp_systolic_high.focus();
30 return false;
31 }else if(d.bp_systolic_high.value<0){
32 d.bp_diastolic_high.focus(); // patch for Konqueror
33 alert("<?php echo $LDNotNegValue; ?>");
34 d.bp_systolic_high.focus();
35 return false;
36 }else if(isNaN(d.bp_diastolic_high.value)){
37 d.bp_systolic_high.focus(); // patch for Konqueror
38 alert("<?php echo $LDEntryInvalidChar; ?>");
39 d.bp_diastolic_high.focus();
40 return false;
41 }else if(d.bp_diastolic_high.value<0){
42 d.bp_systolic_high.focus(); // patch for Konqueror
43 alert("<?php echo $LDNotNegValue; ?>");
44 d.bp_diastolic_high.focus();
45 return false;
46 }else if(isNaN(d.blood_loss.value)){
47 d.bp_systolic_high.focus(); // patch for Konqueror
48 alert("<?php echo $LDEntryInvalidChar; ?>");
49 d.blood_loss.focus();
50 return false;
51 }else if(d.blood_loss.value<0){
52 d.bp_systolic_high.focus(); // patch for Konqueror
53 alert("<?php echo $LDNotNegValue; ?>");
54 d.blood_loss.focus();
55 return false;
56 }else if(d.docu_by.value==""){
57 alert("<?php echo $LDPlsEnterFullName; ?>");
58 d.docu_by.focus();
59 return false;
60 }else{
61 return true;
64 // Script End -->
65 </script>
68 <form method="post" name="report" onSubmit="return chkform(this)">
69 <?php
70 # Pregnancy nr
71 $TP_PREG_NR=$LD['this_pregnancy_nr'];
72 if($pregnancy['this_pregnancy_nr']) $TP_PNR=$pregnancy['this_pregnancy_nr'];
74 # Delivery date
75 if($pregnancy['delivery_date']) $TP_PREGDATE=formatDate2Local($pregnancy['delivery_date'],$date_format);
76 $TP_IMG_PDATE=createComIcon($root_path,'show-calendar.gif','0','',TRUE);
77 # Delivery time
78 if($pregnancy['delivery_time']) $TP_PTIME=$pregnancy['delivery_time'];
79 # GRavida
80 $TP_GRAVIDA=$LD['gravida'];
81 if($pregnancy['gravida']) $TP_GRAV=$pregnancy['gravida'];
82 # Para
83 $TP_PARA=$LD['para'];
84 if($pregnancy['para']) $TP_PARA_VAL=$pregnancy['para'];
85 # Gestational age
86 $TP_GEST_AGE=$LD['pregnancy_gestational_age'];
87 if($pregnancy['pregnancy_gestational_age']) $TP_GAGE=$pregnancy['pregnancy_gestational_age'];
88 # Nr of fetuses , default = 1
89 if(!$pregnancy['nr_of_fetuses']) $pregnancy['nr_of_fetuses']=1;
90 $TP_NR_FETUSES=$LD['nr_of_fetuses'];
91 if($pregnancy['nr_of_fetuses']) $TP_NFETUS=$pregnancy['nr_of_fetuses'];
92 # Child enc nr.
93 $TP_CHILD_ENR=$LD['child_encounter_nr'];
94 $TP_SEPARATE=$LD['sepspace'];
95 $TP_CH_ENR=$pregnancy['child_encounter_nr'];
96 # Delivery mode
97 if(!isset($pregnancy['delivery_mode'])) $pregnancy['delivery_mode']=1;
98 $TP_DELIV_MODE=$LD['delivery_mode'];
99 # Delivery mode radio buttosn
100 $TP_DMODE_RADIOS='';
101 $dm=&$obj->DeliveryModes();
102 if($obj->LastRecordCount()){
103 while($dmod=$dm->FetchRow()){
104 $TP_DMODE_RADIOS.='<input type="radio" name="delivery_mode" value="'.$dmod['nr'].'" ';
105 if($pregnancy['delivery_mode']==$dmod['nr']) $TP_DMODE_RADIOS.='checked' ;
106 $TP_DMODE_RADIOS.='>';
107 if(isset($$dmod['LD_var'])&&$$dmod['LD_var']) $TP_DMODE_RADIOS.=$$dmod['LD_var'];
108 else $TP_DMODE_RADIOS.=$dmod['name'];
109 $TP_DMODE_RADIOS.='&nbsp;';
112 # Is booked
114 if(!isset($pregnancy['is_booked'])) $pregnancy['is_booked']=1;
115 $TP_ISBOOKED=$LD['is_booked'];
116 $TP_ISBOOKED_YES='<input type="radio" name="is_booked" value="1" ';
117 if($pregnancy['is_booked']) $TP_ISBOOKED_YES.='checked';
118 $TP_ISBOOKED_YES.='>'.$LDYes;
119 $TP_ISBOOKED_NO='<input type="radio" name="is_booked" value="0" ';
120 if(!$pregnancy['is_booked']) $TP_ISBOOKED_NO.='checked';
121 $TP_ISBOOKED_NO.='>'.$LDNo;
123 $TP_VDRL=$LD['vdrl'];
124 $TP_VDRL_VAL=$pregnancy['vdrl'];
125 # Rh
126 $TP_RH=$LD['rh'];
127 if($pregnancy['rh']) $TP_RH_VAL=$pregnancy['rh'];
128 # BP systolic
129 $TP_BPSYS=$LD['bp_systolic_high'];
130 if($pregnancy['bp_systolic_high']) $TP_BPSYS_VAL=$pregnancy['bp_systolic_high'];
131 $TP_BPDIAST=$LD['bp_diastolic_high'];
132 if($pregnancy['bp_diastolic_high']) $TP_BPDIAST_VAL= $pregnancy['bp_diastolic_high'];
133 # Proteinuria
134 if(!isset($pregnancy['proteinuria'])) $pregnancy['proteinuria']=0; # Defaults to no proteinuria
135 $TP_PROTEINURIA=$LD['proteinuria'];
136 $TP_PROT_YES='<input type="radio" name="proteinuria" value="1" ';
137 if($pregnancy['proteinuria']) $TP_PROT_YES.='checked';
138 $TP_PROT_YES.='>'.$LDYes;
139 $TP_PROT_NO='<input type="radio" name="proteinuria" value="0" ';
140 if(!$pregnancy['proteinuria']) $TP_PROT_NO.='checked';
141 $TP_PROT_NO.='>'.$LDNo;
142 # Labour duration
143 $TP_LABOUR_DUR=$LD['labour_duration'];
144 if($pregnancy['labour_duration']) $TP_LABOUR_VAL=$pregnancy['labour_duration'];
145 # Induction method
146 $TP_INDUCT_METHOD=$LD['induction_method'];
147 # Induction radio buttons
148 if(!isset($pregnancy['induction_method'])||!$pregnancy['induction_method']) $pregnancy['induction_method']=1; # Defaults to 1 = not induced
149 $TP_INDUCT_RADIOS='';
150 # Fetch the induction methods
151 $ind=&$obj->InductionMethods();
152 if($obj->LastRecordCount()){
153 while($induc=$ind->FetchRow()){
154 $TP_INDUCT_RADIOS.=' <input type="radio" name="induction_method" value="'.$induc['nr'].'" ';
155 if($pregnancy['induction_method']==$induc['nr']) $TP_INDUCT_RADIOS.='checked' ;
156 $TP_INDUCT_RADIOS.='>';
157 if(isset($$induc['LD_var'])&&$$induc['LD_var']) $TP_INDUCT_RADIOS.=$$induc['LD_var'];
158 else $TP_INDUCT_RADIOS.=$induc['name'];
159 $TP_INDUCT_RADIOS.='&nbsp;';
163 # Induction indication
164 $TP_INDUCT_INDIC.=$LD['induction_indication'];
165 $TP_INDUCT_VAL=$pregnancy['induction_indication'];
166 # Anaesthesia type default= 1 (none)
167 if(!$pregnancy['anaesth_type_nr']) $pregnancy['anaesth_type_nr']=1;
168 $TP_ANAESTH=$LD['anaesth_type_nr'];
169 # Anaesthesia radio buttons
170 $TP_ANAESTH_RADIOS='';
171 $ana=&$obj->AnaesthesiaTypes();
173 if($obj->LastRecordCount()){
174 while($row=$ana->FetchRow()){
175 $TP_ANAESTH_RADIOS.='<input type="radio" name="anaesth_type_nr" value="'.$row['nr'].'" ';
176 if($pregnancy['anaesth_type_nr']==$row['nr']) $TP_ANAESTH_RADIOS.='checked';
177 $TP_ANAESTH_RADIOS.='>';
178 if(isset($$row['LD_var'])&&$$row['LD_var']) $TP_ANAESTH_RADIOS.=$$row['LD_var'];
179 else $TP_ANAESTH_RADIOS.=$row['name'];
180 $TP_ANAESTH_RADIOS.='&nbsp;';
184 # Complications
185 $TP_COMPLICATION=$LD['complications'];
186 $TP_COMPLIC=$pregnancy['complications'];
187 # Perineum default = 1 (intact)
188 if(!$pregnancy['perineum']) $pregnancy['perineum']=1;
189 $TP_PERINEUM=$LD['perineum'];
190 # Perineum radio buttons
191 $TP_PERINEUM_RADIOS='';
192 $buf=&$obj->Perineums();
193 if($obj->LastRecordCount()){
194 while($per=$buf->FetchRow()){
195 $TP_PERINEUM_RADIOS.=' <input type="radio" name="perineum" value="'.$per['nr'].'" ';
196 if($pregnancy['perineum']==$per['nr']) $TP_PERINEUM_RADIOS.='checked' ;
197 $TP_PERINEUM_RADIOS.='>';
198 if(isset($$per['LD_var'])&&$$per['LD_var']) $TP_PERINEUM_RADIOS.=$$per['LD_var'];
199 else $TP_PERINEUM_RADIOS.=$per['name'];
202 # Blood loss
203 $TP_BLOODLOSS.=$LD['blood_loss'];
204 if($pregnancy['blood_loss']>0) $TP_BLOSS=$pregnancy['blood_loss'];
205 # Blood loss unit of measure
206 # make ml (milliliter) the default
207 if(empty($pregnancy['blood_loss_unit'])) $pregnancy['blood_loss_unit']='ml';
208 $TP_BLOSS_OPTIONS='';
209 # Load the volume units
210 $unit=&$msr->VolumeUnits();
211 while(list($x,$v)=each($unit)){
212 $TP_BLOSS_OPTIONS.='<option value="'.$v['id'].'" ';
213 if($pregnancy['blood_loss_unit']==$v['id']) $TP_BLOSS_OPTIONS.='selected';
214 $TP_BLOSS_OPTIONS.='>'.$v['id'];
216 # Retained placenta
217 $TP_RETPLACENTA=$LD['is_retained_placenta'];
218 $TP_RETPLACENTA_YES='<input type="radio" name="is_retained_placenta" value="1" ';
219 if($pregnancy['is_retained_placenta']) $TP_RETPLACENTA_YES.='checked';
220 $TP_RETPLACENTA_YES.='>'.$LDYes;
221 $TP_RETPLACENTA_NO='<input type="radio" name="is_retained_placenta" value="0" ';
222 if(!$pregnancy['is_retained_placenta']) $TP_RETPLACENTA_NO.='checked';
223 $TP_RETPLACENTA_NO.='>'.$LDNo;
224 # Post labour condition
225 $TP_POST_LABOUR=$LD['post_labour_condition'];
226 $TP_PLABOUR=$pregnancy['post_labour_condition'];
227 # Outcome default = 1 (living)
228 if(!$pregnancy['outcome']) $pregnancy['outcome']=1;
229 $TP_OUTCOME=$LD['outcome'];
230 # Outcome radio buttons
231 $TP_OUT_RADIOS='';
232 $oc=&$obj->Outcomes();
233 if($obj->LastRecordCount()){
234 while($otc=$oc->FetchRow()){
235 $TP_OUT_RADIOS.='<input type="radio" name="outcome" value="'.$otc['nr'].'" ';
236 if($pregnancy['outcome']==$otc['nr']) $TP_OUT_RADIOS.='checked' ;
237 $TP_OUT_RADIOS.='>';
238 if(isset($$otc['LD_var'])&&$$otc['LD_var']) $TP_OUT_RADIOS.=$$otc['LD_var'];
239 else $TP_OUT_RADIOS.=$otc['name'];
240 $TP_OUT_RADIOS.='&nbsp;';
243 $TP_DOCBY=$LD['docu_by'];
244 $TP_DBY=$HTTP_SESSION_VARS['sess_user_name'];
245 # Load the template
246 $tp_preg=&$TP_obj->load('registration_admission/tp_input_show_pregnancy.htm');
247 eval("echo $tp_preg;");
250 <input type="hidden" name="sid" value="<?php echo $sid; ?>">
251 <input type="hidden" name="lang" value="<?php echo $lang; ?>">
252 <input type="hidden" name="encounter_nr" value="<?php echo $HTTP_SESSION_VARS['sess_en']; ?>">
253 <input type="hidden" name="pid" value="<?php echo $HTTP_SESSION_VARS['sess_pid']; ?>">
254 <input type="hidden" name="rec_nr" value="<?php echo $rec_nr; ?>">
255 <input type="hidden" name="allow_update" value="<?php if(isset($allow_update)) echo $allow_update; ?>">
256 <input type="hidden" name="target" value="<?php echo trim($target); ?>">
257 <input type="hidden" name="mode" value="newdata">
258 <input type="image" <?php echo createLDImgSrc($root_path,'savedisc.gif','0'); ?>>
260 </form>