-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathin_patient.php~
executable file
·399 lines (393 loc) · 16 KB
/
in_patient.php~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<?php
include("connection/connection.php");
include("header/header.php");
include("header/patient_information.php");
include("in_patient_status.php");
//Get and or Set a Session for Out Patient Id
$in_patient_id = isset($_GET['in_patient_id'])?$_GET['in_patient_id']:$_POST['in_patient_id'];
//Select from in_patient table.
$query = mysql_query("SELECT * FROM in_patient where id ='$in_patient_id'");
$data = mysql_fetch_array($query);
if ($data['clinic_type'] == 'S'){ $data['clinic_type'] = 'SERVICE'; }else { $data['clinic_type'] = 'PRIVATE'; }
if ($data['expired'] == 'N'){ $data['expired'] = 'NO'; }else { $data['expired'] = 'YES'; }
//Registration Status and Hospital ID
$query = mysql_query("SELECT registration_status,hospital_id FROM in_patient where patients_info_id ='$patient_info_id'");
$r_status = mysql_fetch_array($query);
if ($r_status['registration_status'] == null){
$registration_status = "N"; }
else{ $registration_status = "R";}
//Submit the form.HIN
if (isset($_POST['save']))
if (empty($_POST['date_referred']) || ($_POST['consultant'] == "0") || empty($_POST['management_plan']) || empty($_POST['room']) || empty($_POST['bed']) || empty($_POST['referring_md']) || empty($_POST['specialty'])){
$msg="<p style='background-color:#faadad; width:750; text-align:center; border: #c39495 1px solid; padding:10px 10px 10px 20px; color:#860d0d; font-family:tahoma;'>
<img src='images/error.png' width='20' height='20' style='margin-top:2px;'>
<font size='5' color='red'><span style='padding-top:10px;'>Please fill-up all required fields.</span></font><br>
</p>";
}
elseif(empty($_POST["derm_diagnosis"]) && empty($_POST["suggested_diagnosis"])) {
$msg="<p style='background-color:#faadad; width:750; text-align:center; border: #c39495 1px solid; padding:10px 10px 10px 20px; color:#860d0d; font-family:tahoma;'>
<img src='images/error.png' width='20' height='20' style='margin-top:2px;'>
<font size='5' color='red'><span style='padding-top:10px;'>Please fill-up atleast one of the diagnosis field.</span></font><br>
</p>";
}
elseif(!empty($_POST["derm_diagnosis"]) && !empty($_POST["suggested_diagnosis"])) {
$msg="<p style='background-color:#faadad; width:750; text-align:center; border: #c39495 1px solid; padding:10px 10px 10px 20px; color:#860d0d; font-family:tahoma;'>
<img src='images/error.png' width='20' height='20' style='margin-top:2px;'>
<font size='5' color='red'><span style='padding-top:10px;'>You must fill-up one of the diagnosis field.</span></font><br>
</p>";
}
else
{
//DATE REFERRED
$date_of_consultation = explode("/",$_POST['date_referred']);
$d_o_c = $date_of_consultation[2].'-'.$date_of_consultation[0].'-'.$date_of_consultation[1];
//DATE DISCHARED
$date_dischared = explode("/",$_POST['date_dischared_from_derm_service']);
$date_of_dischared = $date_dischared[2].'-'.$date_dischared[0].'-'.$date_dischared[1];
//DATE OF DEATH
$date_death = explode("/",$_POST['date_of_death']);
$date_of_death = $date_death[2].'-'.$date_death[0].'-'.$date_death[1];
//VOID DUPLICATE ENTRIES OF DATE REFERRED PER PATIENTS
$duplicate=mysql_query("SELECT date_referred, patients_info_id FROM in_patient where date_referred='$d_o_c' and patients_info_id='".$_POST['patients_info_id']."'");
if($data = mysql_fetch_array($duplicate))
{
$msg="<p style='background-color:#faadad; width:750; text-align:center; border: #c39495 1px solid; padding:10px 10px 10px 20px; color:#860d0d; font-family:tahoma;'>
<img src='images/error.png' width='20' height='20' style='margin-top:2px;'>
<font size='5' color='red'><span style='padding-top:10px;'>Date Referred was already done. Select other date.</span></font><br>
</p>";
}
else
{
//Insert Query in Out Patient Table;
$query = "INSERT INTO in_patient
values('',
'".$_POST['patients_info_id']."',
'".$_SESSION['u_id']."',
'".$_POST['consultant']."',
'$registration_status',
'".$_POST['satellite_id']."',
'".addslashes(trim($_POST['hospital_id']))."',
'$d_o_c',
'".$_POST['hour'].':'.$_POST['min'].' '.$_POST['time']."',
'".$_POST['hour1'].':'.$_POST['min1'].' '.$_POST['time1']."',
'".$_POST['clinic']."',
'".addslashes(trim($_POST['room']))."',
'".addslashes(trim($_POST['bed']))."',
'".addslashes(trim($_POST['referring_md']))."',
'".addslashes(trim($_POST['specialty']))."',
'".addslashes(trim($_POST['reason_for_referral']))."',
'".$_POST['expired']."',
'".addslashes(trim($_POST['histopath_record_number']))."',
'".addslashes(trim($_POST['cause_of_death']))."',
'".addslashes(trim($_POST['notes']))."',
'$date_of_death',
'$date_of_dischared')";
mysql_query($query) or die ("Error Inserting New Records: ".mysql_error());
$in_patient_id=mysql_insert_id();
//Insert data in in patient details
$query1 = "insert into in_patient_details values
('',
'$in_patient_id',
'1',
'".addslashes(trim($_POST['derm_diagnosis']))."".addslashes(trim($_POST['suggested_diagnosis']))."',
'".addslashes(trim($_POST['other_information']))."',
'".addslashes(trim($_POST['diagnosis_code']))."',
'".$_POST['problem']."',
'".$_POST['result']."',
'".$_POST['outcome']."',
'".addslashes(trim($_POST['management_plan']))."',
'".addslashes(trim($_POST['procedure']))."',
'".addslashes(trim($_POST['comorbidities']))."',
'".addslashes(trim($_POST['histopath_diagnosis']))."')";
mysql_query($query1) or die ("Error Inserting New Records: ".mysql_error());
$msg="<p style='background-color:#EBEAF2;; width:996; text-align:top; border:gray 0px solid; padding:1px 1px 1px 2px; color:#EBEAF2; font-family:tahoma; margin:1;'>
<img src='images/check.png' width='30' height='30' style='margin-top:2px;'>
<font size='5' color='red'>Sucessfully created In patient information.</font></p>";
echo "<META HTTP-EQUIV='Refresh' CONTENT='1; URL=in_patient.php?patients_info_id=$_POST[patients_info_id]'>";
}
}
?>
<script>
//Datepicker Format
$(document).ready(function(){
$('#datepicker-example11').Zebra_DatePicker({
format: 'm/d/Y'
});
$('#datepicker-example12').Zebra_DatePicker({
format: 'm/d/Y'
});
$('#datepicker-example13').Zebra_DatePicker({
format: 'm/d/Y'
});
});
$(function() {
<?php include("source.php"); ?>
$("#diagnosis").autocomplete({
minLength: 2,
delay:500,
source: projects,
focus: function( event, ui ) {
$( "#diagnosis" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#diagnosis" ).val( ui.item.label);
$( "#diagnosis_code" ).val( ui.item.value);
return false;
},
change:function (event, ui) {
if (!ui.item) {
this.value = '';
document.getElementById("diagnosis_code").value = "";
}
},
})
});
</script>
<style>
textarea
{
font-size: 16px;
}
.ui-autocomplete { height: 200px; overflow-y: scroll; overflow-x: hidden;}
</style>
<div align="center">
<form autocomplete="off" action="in_patient.php" method="post">
<input type="hidden" value="<?php echo $patient_info_id; ?>" name="patients_info_id">
<table style="border:gray 1px solid;">
<?php echo "<tr><td colspan=2 align=center>$msg</td></tr>"; ?>
<tr>
<td colspan="2" class="header">IN PATIENT REGISTRATION</td>
</tr>
<td class="question" width="25%">Date Referred : </td>
<td><input type="text" name="date_referred" id="datepicker-example11" value="<?php echo $_POST['consultation_date']; ?>" class="a"> <font size="1px"><b>mm/dd/yyyy</b></font><?php echo $required; ?></td>
</tr>
<tr>
<td class="question">Satelitte Clinic : </td>
<td><?php {satellite_clinic_lists();} ?></td>
</tr>
<tr>
<td class="question">Time of Referral :</td>
<td><select name="hour" size="1" value="<?php echo $_POST['hour'] ?>" class="index_input">
<option value="hour">HOUR</option>
<?php
for ($i = 01; $i <= 12; $i++)
{
$value = strlen($i);
if($value==1)
{
$k = "0".$i;
}
else
{
$k=$i;
}
echo "<option value='$k'";
if ($_POST['hour'] == $i)
{
echo "selected='selected'";
}
echo ">$k</option>";
}
?>
</select> :
<select name="min" size="1" value="<?php echo $_POST['min'] ?>" class="index_input">
<option value="min">MIN</option>
<option value="00">00</option>
<?php
for ($i = 01; $i <= 59; $i++)
{
$value = strlen($i);
if($value==1)
{
$k = "0".$i;
}
else
{
$k=$i;
}
echo "<option value='$k'";
if ($_POST['min'] == $i)
{
echo "selected='selected'";
}
echo ">$k</option>";
}
?>
</select>
<select name="time" size="1" value="<?php echo $_POST['time'] ?>" class="index_input">
<option value="AM">AM</option>
<option value="PM">PM</option>
</select><?php echo $required; ?>
</td>
</tr>
<tr>
<td class="question">Time Referral Answered : </td>
<td><select name="hour1" size="1" value="<?php echo $_POST['hour1'] ?>" class="index_input">
<option value="hour1">HOUR</option>
<?php
for ($i = 01; $i <= 12; $i++)
{
$value = strlen($i);
if($value==1)
{
$k = "0".$i;
}
else
{
$k=$i;
}
echo "<option value='$k'";
if ($_POST['hour1'] == $i)
{
echo "selected='selected'";
}
echo ">$k</option>";
}
?>
</select> :
<select name="min1" size="1" value="<?php echo $_POST['min1'] ?>" class="index_input">
<option value="min1">MIN</option>
<option value="00">00</option>
<?php
for ($i = 01; $i <= 59; $i++)
{
$value = strlen($i);
if($value==1)
{
$k = "0".$i;
}
else
{
$k=$i;
}
echo "<option value='$k'";
if ($_POST['min1'] == $i)
{
echo "selected='selected'";
}
echo ">$k</option>";
}
?>
</select>
<select name="time1" size="1" value="<?php echo $_POST['time1'] ?>" class="index_input">
<option value="AM">AM</option>
<option value="PM">PM</option>
</select><?php echo $required; ?>
</td>
</tr>
<tr>
<td class="question">Hospital ID Number : </td>
<td><input type="text" name="hospital_id" class="a" size="25" value="<?php echo $r_status['hospital_id']; ?>"></td>
</tr>
<tr>
<td class="question">Out Patient Clinic : </td>
<td class="ans regis"><input type="radio" name="clinic" value="S" checked="checked"> Service <input type="radio" value="P" name="clinic"> Private </td>
</tr>
<tr>
<td class="question">Room No. : </td><td><input type="text" name="room" class="a required" size="5" value="<?php echo $_POST['room']; ?>"><span class="question"> Bed No. : </span><input type="text" name="bed" class="a required" size="5" value="<?php echo $_POST['bed']; ?>"> <?php echo $required; ?></td>
</tr>
<tr>
<td class="question">Dermatology Resident : </td>
<td class="ans"><?php echo $_SESSION['lname'].', '.$_SESSION['fname']; ?></td>
</tr>
<tr>
<td class="question">Consultant : </td>
<td><?php {consultant_lists();} echo $required; ?></td>
</tr>
<tr>
<td class="question">Referring MD : </td>
<td><input type="text" name="referring_md" class="a" size="25" value="<?php echo $_POST['referring_md']; ?>"><?php echo $required; ?></td>
</tr>
<tr>
<td class="question">Specialty / Dept. : </td>
<td><input type="text" name="specialty" class="a" size="25" value="<?php echo $_POST['specialty']; ?>"><?php echo $required; ?></td>
</tr>
<tr>
<td class="question">Reason for Referral : </td>
<td><textarea name="reason_for_referral" cols="43"><?php echo $_POST['reason_for_referral']; ?></textarea></td>
</tr>
<tr>
<td class="question">Derm Diagnosis : </td>
<td><input type="text" name="derm_diagnosis" id="diagnosis" size="50" class="a" value="<?php echo $_POST['derm_diagnosis'];?>"><?php echo $required; ?></td>
</tr>
<tr>
<td class="question">Suggested Diagnosis: </td>
<td><input type="text" name="suggested_diagnosis" size="50" class="a" value="<?php echo $_POST['suggested_diagnosis'];?>"></td>
</tr>
<tr>
<td class="question">Other Information : </td>
<td><input type="text" name="other_information" size="50" class="a" value="<?php echo $_POST['other_information'];?>"></td>
</tr>
<tr>
<td class="question">Diagnosis code: </td>
<td><input type="text" name="diagnosis_code" readonly="readonly" id="diagnosis_code" size="30" class="a" value="<?php echo $_POST['diagnosis_code'];?>"><?php echo $required; ?></td>
</tr>
<tr>
<td></td>
<td class="ans regis" colspan="2"><input type="radio" name="problem" value="N" checked="checked"> New Problem <img src="images/question_mark.jpg" width="20" height="20" title="First time to consult for the derm problem in your Derm Service"><input type="radio" name="problem" value="F">Follow-up to Previous Problem<img src="images/question_mark.jpg" width="20" height="20" title="Follow-up consultation for a derm problem previously seen by your Derm Service"></td>
</tr>
<tr>
<td></td>
<td class="ans regis"><input type="radio" name="result" value="F"> Final <img src="images/question_mark.jpg" width="20" height="20" title="patient's diagnosis is established clinically or through test">
<input type="radio" name="result" value="P" checked="checked">Provisional <img src="images/question_mark.jpg" width="20" height="20" title="patient not a confirmed case(ex. if CTCL is the present working impression but it is not a confirmed case"></td>
</tr>
<tr>
<td class="question">Comorbidities : </td>
<td><input type="text" name="comorbidities" size="30" value="<?php echo $_POST['comorbidities']; ?>" class="a"></td>
</tr>
<tr>
<td class="question">Management Plan : </td>
<td><textarea name="management_plan" cols="43"><?php echo $_POST['management_plan']; ?></textarea><?php echo $required; ?></td>
</tr>
<tr>
<td class="question">Procedure : </td>
<td><input name="procedure" type="text" class="a" size="30" value="<?php echo $_POST['procedure']; ?>"></td>
</tr>
<tr>
<td class="question">Histopath Diagnosis : </td>
<td><input type="text" name="histopath_diagnosis" class="a" size="30" value="<?php echo $_POST['histopath_diagnosis']; ?>"></td>
</tr>
<tr>
<td class="question">Patient Outcome : </td>
<td><select name="outcome" class="index_input">
<option value="1">Not Applicable</option>
<option value="2">Resolved</option>
<option value="3">Improved</option>
<option value="4">No Improvement</option>
<option value="5">Deteriorated</option>
</select>
</td>
</tr>
<tr>
<td class="question">Date Discharged from derm Service : </td>
<td><input type="text" name="date_dischared_from_derm_service" id="datepicker-example12" value="<?php echo $_POST['date_dischared_from_derm_service']; ?>" class="a"> <font size="1px"><b>mm/dd/yyyy</b></font><?php echo $required; ?></td>
</tr>
<tr>
<td class="question">Histopath Record Number : </td>
<td><input type="text" name="histopath_record_number" class="a" size="30" value="<?php echo $_POST['histopath_record_number']; ?>"></td>
</tr>
<tr>
<td class="question">Expired : </td>
<td class="regis ans"><input type="radio" name="expired" value="N" checked="checked">No <input type="radio" name="expired" value="Y"> Yes </td>
</tr>
<tr>
<td class="question">Cause of Death: </td>
<td><input type="text" name="cause_of_death" size="50" class="a" value="<?php echo $_POST['cause_of_death'];?>"></td>
</tr>
<tr>
<td class="question">Date of Death : </td>
<td><input type="text" name="date_of_death" id="datepicker-example13" value="<?php echo $_POST['date_of_death']; ?>" class="a"></td>
</tr>
<tr>
<td class="question">Notes : </td>
<td><textarea name="notes" cols="43"><?php echo $_POST['notes']; ?></textarea></td>
</tr>
<tr>
<td></td><td><input name="save" type="submit" class="submit" value="SAVE"></td>
</tr>
</table>
</form>
</div>
</html>
<script type="text/javascript" src="javascript/datepicker/zebra_datepicker.js"></script>