forked from basoro/Dokter-Ulun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbook-op.php
396 lines (388 loc) · 18.5 KB
/
book-op.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
<?php
include_once ('layout/header.php');
if(isset($_GET['no_rawat'])) {
$_sql = "SELECT a.no_rkm_medis, a.no_rawat, b.nm_pasien, b.umur, a.status_lanjut , a.kd_pj FROM reg_periksa a, pasien b WHERE a.no_rkm_medis = b.no_rkm_medis AND a.no_rawat = '$_GET[no_rawat]'";
$found_pasien = query($_sql);
if(num_rows($found_pasien) == 1) {
while($row = fetch_array($found_pasien)) {
$no_rkm_medis = $row['0'];
$get_no_rawat = $row['1'];
$no_rawat = $row['1'];
$nm_pasien = $row['2'];
$umur = $row['3'];
$status_lanjut = $row['4'];
$kd_pj = $row['5'];
}
} else {
redirect ("{$_SERVER['PHP_SELF']}");
}
}
?>
<section class="content">
<div class="container-fluid">
<?php $action = isset($_GET['action'])?$_GET['action']:null; ?>
<?php if(!$action){ ?>
<!-- Menu Utama -->
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="header">
<h2>
PASIEN BOOKING OPERASI
<small>Tanggal : <?php if(isset($_POST['tanggal']) && $_POST['tanggal'] !="") { echo $_POST['tanggal']; } else { echo $date; } ?></small>
</h2>
</div>
<div class="table-responsive">
<ul class="nav nav-tabs tab-nav-right" role="tablist">
<li role="presentation" class="active"><a href="#poli" data-toggle="tab">Jadwal Operasi</a></li>
<!-- <li role="presentation"><a href="#intern" data-toggle="tab">Jadwal Semua Operasi</a></li> -->
</ul>
<div class="body">
<!--tab utama -->
<div class="tab-content m-t-20">
<div role="tabpanel" class="tab-pane fade in active" id="poli">
<table id="datatable_ralan" class="table table-bordered table-striped table-hover display nowrap">
<thead>
<tr>
<th>Nama Pasien</th>
<th>No RM</th>
<th>Nama Operasi</th>
<th>Jam Mulai</th>
<th>Jam Selesai</th>
<th>Diagnosa</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
$data = "SELECT pasien.nm_pasien, pasien.no_rkm_medis, booking_operasi.no_rawat, paket_operasi.nm_perawatan, booking_operasi.jam_mulai, booking_operasi.jam_selesai, booking_operasi.status, GROUP_CONCAT(DISTINCT penyakit.nm_penyakit SEPARATOR '<br>') as nm_penyakit
FROM pasien, booking_operasi, paket_operasi, reg_periksa, diagnosa_pasien, penyakit
WHERE booking_operasi.no_rawat = reg_periksa.no_rawat
AND pasien.no_rkm_medis = reg_periksa.no_rkm_medis
AND booking_operasi.kode_paket = paket_operasi.kode_paket
AND diagnosa_pasien.no_rawat = booking_operasi.no_rawat
AND diagnosa_pasien.kd_penyakit = penyakit.kd_penyakit
AND booking_operasi.kd_dokter = '{$_SESSION['username']}' ";
if(isset($_POST['tanggal']) && $_POST['tanggal'] !="") {
$data .= " AND booking_operasi.tanggal = '{$_POST['tanggal']}'";
} else {
$data .= " AND booking_operasi.tanggal='$date'";
}
$data .= " ORDER BY reg_periksa.no_reg ASC";
$sql = query($data);
$no = 1;
while($row = fetch_array($sql)){?>
<tr>
<td><?php echo $row['nm_pasien'];?></td>
<td><?php echo $row['no_rkm_medis'];?></td>
<td><?php echo $row['nm_perawatan'];?></td>
<td><?php echo $row['jam_mulai'];?></td>
<td><?php echo $row['jam_selesai'];?></td>
<td><?php echo $row['nm_penyakit'];?></td>
<td><?php echo $row['status'];?></td>
</tr>
<?php
$no++;
}
?>
</tbody>
</table>
</div>
</div>
<!--tab utama -->
<div class="body">
<form method="POST" action="">
<div class="row clearfix">
<div class="col-xs-8 col-lg-10">
<div class="form-group">
<div class="form-line">
<input type="text" class="datepicker form-control" name="tanggal" placeholder="Pilih tanggal...">
</div>
</div>
</div>
<div class="col-xs-4 col-lg-2">
<input type="submit" class="btn btn-primary btn-lg m-l-15 waves-effect" value="Submit">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Menu Utama -->
<?php } ?>
<?php if($action == "view"){ ?>
<!-- Menu View -->
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="header">
<h2>Detail Pasien</h2>
</div>
<div class="body">
<dl class="dl-horizontal">
<dt>Nama Lengkap</dt>
<dd><?php echo $nm_pasien; ?></dd>
<dt>No. RM</dt>
<dd><?php echo $no_rkm_medis; ?></dd>
<dt>No. Rawat</dt>
<dd><?php echo $no_rawat; ?></dd>
<dt>Umur</dt>
<dd><?php echo $umur; ?></dd>
</dl>
</div>
<div class="body">
<!-- Nav Tabs -->
<div class="row">
<ul class="nav nav-tabs tab-nav-right" role="tablist">
<li role="presentation" class="active"><a href="#riwayat" data-toggle="tab">RIWAYAT</a></li>
<li role="presentation"><a href="#anamnese" data-toggle="tab">PEMERIKSAAN</a></li>
<li role="presentation"><a href="#diagnosa" data-toggle="tab">DIAGNOSA</a></li>
<li role="presentation"><a href="#resep" data-toggle="tab">RESEP</a></li>
<li role="presentation"><a href="#permintaanlab" data-toggle="tab">PERMINTAAN LAB</a></li>
<li role="presentation"><a href="#permintaanrad" data-toggle="tab">PERMINTAAN RAD</a></li>
<li role="presentation"><a href="#skdp" data-toggle="tab">SURAT KONTROL</a></li>
</ul>
</div>
<!-- End Nav Tabs -->
<!-- Tab Panes -->
<div class="tab-content m-t-20">
<!-- riwayat -->
<div role="tabpanel" class="tab-pane fade in active" id="riwayat">
<table id="riwayatmedis" class="table">
<thead>
<tr>
<th>Tanggal</th>
<th>Nomor Rawat</th>
<th>Klinik/Ruangan/Dokter</th>
<th>Keluhan</th>
<th>Pemeriksaan</th>
<th>Diagnosa</th>
<th>Obat</th>
<th>Laboratorium</th>
<th>Radiologi</th>
</tr>
</thead>
<tbody>
<?php
$q_kunj = query ("SELECT tgl_registrasi, no_rawat, status_lanjut FROM reg_periksa WHERE no_rkm_medis = '$no_rkm_medis' AND stts !='Batal' ORDER BY tgl_registrasi DESC");
while ($data_kunj = fetch_array($q_kunj)) {
$tanggal_kunj = $data_kunj[0];
$no_rawat_kunj = $data_kunj[1];
$status_lanjut_kunj = $data_kunj[2];
?>
<tr>
<td><?php echo $tanggal_kunj; ?></td>
<td><?php echo $no_rawat_kunj; ?></td>
<td>
<?php
if($status_lanjut_kunj == 'Ralan') {
$sql_poli = fetch_assoc(query("SELECT a.nm_poli, c.nm_dokter FROM poliklinik a, reg_periksa b, dokter c WHERE b.no_rawat = '$no_rawat_kunj' AND a.kd_poli = b.kd_poli AND b.kd_dokter = c.kd_dokter"));
echo $sql_poli['nm_poli'];
echo '<br>';
echo "(".$sql_poli['nm_dokter'].")";
} else {
echo 'Rawat Inap';
}
?>
</td>
<?php
if($status_lanjut_kunj == 'Ralan') {
$sql_riksaralan = fetch_assoc(query("SELECT keluhan, pemeriksaan FROM pemeriksaan_ralan WHERE no_rawat = '$no_rawat_kunj'"));
echo "<td>".$sql_riksaralan['keluhan']."</td>";
echo "<td>".$sql_riksaralan['pemeriksaan']."</td>";
} else {
$sql_riksaranap = fetch_assoc(query("SELECT keluhan, pemeriksaan FROM pemeriksaan_ranap WHERE no_rawat = '$no_rawat_kunj'"));
echo "<td>".$sql_riksaranap['keluhan']."</td>";
echo "<td>".$sql_riksaranap['pemeriksaan']."</td>";
}
?>
<td>
<ul style="list-style:none;">
<?php
$sql_dx = query("SELECT a.kd_penyakit, a.nm_penyakit FROM penyakit a, diagnosa_pasien b WHERE a.kd_penyakit = b.kd_penyakit AND b.no_rawat = '$no_rawat_kunj'");
$no=1;
while ($row_dx = fetch_array($sql_dx)) {
echo '<li>'.$no.'. '.$row_dx[1].' ('.$row_dx[0].')</li>';
$no++;
}
?>
</ul>
</td>
<td>
<ul style="list-style:none;">
<?php
$sql_obat = query("select detail_pemberian_obat.jml, databarang.nama_brng from detail_pemberian_obat inner join databarang on detail_pemberian_obat.kode_brng=databarang.kode_brng where detail_pemberian_obat.no_rawat= '$no_rawat_kunj'");
$no=1;
while ($row_obat = fetch_array($sql_obat)) {
echo '<li>'.$no.'. '.$row_obat[1].' ('.$row_obat[0].')</li>';
$no++;
}
?>
</ul>
</td>
<td>
<ul style="list-style:none;">
<?php
$sql_lab = query("select template_laboratorium.Pemeriksaan, detail_periksa_lab.nilai, template_laboratorium.satuan, detail_periksa_lab.nilai_rujukan, detail_periksa_lab.keterangan from detail_periksa_lab inner join template_laboratorium on detail_periksa_lab.id_template=template_laboratorium.id_template where detail_periksa_lab.no_rawat= '$no_rawat_kunj'");
$no=1;
while ($row_lab = fetch_array($sql_lab)) {
echo '<li>'.$no.'. '.$row_lab[0].' ('.$row_lab[3].') = '.$row_lab[1].' '.$row_lab[2].'</li>';
$no++;
}
?>
</ul>
</td>
<td>
<div id="aniimated-thumbnials" class="list-unstyled row clearfix">
<?php
$sql_rad = query("select * from gambar_radiologi where no_rawat= '$no_rawat_kunj'");
$no=1;
while ($row_rad = fetch_array($sql_rad)) {
echo '<div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">';
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=radiologi&no_rawat='.$no_rawat_kunj.'" class="title"><img class="img-responsive thumbnail" src="'.SIMRSURL.'/radiologi/'.$row_rad[3].'"></a>';
echo '</div>';
$no++;
}
?>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- riwayat -->
<!-- anamnese -->
<div class="tab-pane fade" role="tabpanel" id="anamnese">
<?php include_once ('./module/anamnese.php');?>
</div>
<!-- anamnese -->
<!-- diagnosa -->
<div role="tabpanel" class="tab-pane fade" id="diagnosa">
<?php include_once ('./module/diagnosa.php');?>
</div>
<!-- end diagnosa -->
<!-- eresep -->
<div role="tabpanel" class="tab-pane fade" id="resep">
<?php include_once ('./module/eresep.php');?>
</div>
<!-- end eresep -->
<!-- permintaan lab -->
<div role="tabpanel" class="tab-pane fade" id="permintaanlab">
<?php include_once ('./module/mintalab.php');?>
</div>
<!-- end permintaan lab -->
<!-- permintaan rad -->
<div role="tabpanel" class="tab-pane fade" id="permintaanrad">
<?php include_once ('./module/mintarad.php');?>
</div>
<!-- end permintaan rad -->
<!-- skdp -->
<div role="tabpanel" class="tab-pane fade" id="skdp">
<?php include_once ('./module/skdp.php');?>
</div>
<!-- end skdp -->
</div>
<!-- Tab Panes -->
</div>
</div>
</div>
</div>
<!-- Menu View -->
<?php } ?>
<!-- Menu Radiologi -->
<?php if($action == "radiologi"){ ?>
<div class="card">
<div class="header">
<h2>
BERKAS DIGITAL RADIOLOGI
</h2>
</div>
<div class="body">
<dl class="dl-horizontal">
<dt>Nama Lengkap</dt>
<dd><?php echo $nm_pasien; ?></dd>
<dt>No. RM</dt>
<dd><?php echo $no_rkm_medis; ?></dd>
<dt>No. Rawat</dt>
<dd><?php echo $no_rawat; ?></dd>
<dt>Umur</dt>
<dd><?php echo $umur; ?></dd>
</dl>
<div id="aniimated-thumbnials" class="list-unstyled row clearfix">
<?php
$sql_rad = query("select * from gambar_radiologi where no_rawat= '{$_GET['no_rawat']}'");
$no=1;
while ($row_rad = fetch_array($sql_rad)) {
echo '<div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">';
echo '<a href="'.SIMRSURL.'/radiologi/'.$row_rad[3].'" data-sub-html=""><img class="img-responsive thumbnail" src="'.SIMRSURL.'/radiologi/'.$row_rad[3].'"></a>';
echo '</div>';
$no++;
}
?>
</div>
</div>
</div>
<a class="btn btn-primary" href="<?php echo $_SERVER['PHP_SELF'].'?action=view&no_rawat='.$_GET['no_rawat']; ?>">BACK</a>
<br><br>
<?php } ?>
<!-- end Menu Radiologi -->
<!-- delete -->
<?php
if($action == "delete_diagnosa"){
$hapus = "DELETE FROM diagnosa_pasien WHERE no_rawat='{$_REQUEST['no_rawat']}' AND kd_penyakit = '{$_REQUEST['kode']}' AND prioritas = '{$_REQUEST['prioritas']}'";
$hasil = query($hapus);
if (($hasil)) {
redirect("{$_SERVER['PHP_SELF']}?action=view&no_rawat={$no_rawat}");
}
}
if($action == "delete_obat"){
$hapus = "DELETE FROM resep_dokter WHERE no_resep='{$_REQUEST['no_resep']}' AND kode_brng='{$_REQUEST['kode_obat']}'";
$hasil = query($hapus);
if (($hasil)) {
redirect("{$_SERVER['PHP_SELF']}?action=view&no_rawat={$no_rawat}");
}
}
if($action == "delete_lab"){
$hapus = "DELETE FROM permintaan_pemeriksaan_lab WHERE noorder='{$_REQUEST['noorder']}' AND kd_jenis_prw='{$_REQUEST['kd_jenis_prw']}'";
$hasil = query($hapus);
if (($hasil)) {
redirect("{$_SERVER['PHP_SELF']}?action=view&no_rawat={$no_rawat}");
}
}
if($action == "delete_rad"){
$hapus = "DELETE FROM permintaan_pemeriksaan_radiologi WHERE noorder='{$_REQUEST['noorder']}' AND kd_jenis_prw='{$_REQUEST['kd_jenis_prw']}'";
$hasil = query($hapus);
if (($hasil)) {
redirect("{$_SERVER['PHP_SELF']}?action=view&no_rawat={$no_rawat}");
}
}
if($action == "delete_an"){
$hapus = "DELETE FROM pemeriksaan_ralan WHERE no_rawat='{$_REQUEST['no_rawat']}' AND keluhan='{$_REQUEST['keluhan']}'";
$hasil = query($hapus);
if (($hasil)) {
redirect("{$_SERVER['PHP_SELF']}?action=view&no_rawat={$no_rawat}");
}
}
?>
<!-- end delete -->
</div>
</section>
<?php include_once ('layout/footer.php'); ?>
<script>
function Antri()
{
$.ajax({
url: './includes/ambil.php',
type: 'POST',
success: function(lol)
{
$('.antri').html(lol);
}
});
};
setInterval(function(){ Antri(); }, 1000);
</script>