199 lines
8.5 KiB
PHP
199 lines
8.5 KiB
PHP
<?php
|
|
echo $datetimepicker_css;
|
|
echo $easyui_css;
|
|
include 'core/main.php';
|
|
|
|
array_push($form_plugin['ui_plugins_js'], $datetimepicker_js);
|
|
array_push($form_plugin['ui_plugins_js'], $sweetalert_js);
|
|
|
|
$js_init .= '$(".datetime").datepicker({format :"yyyy-mm-dd hh:ii:ss", autoclose:true, todayBtn:true, minuteStep: 10 });';
|
|
|
|
$cek_pelimpahan = $db->query("SELECT a.tgl_pelimpahan,d.kddokter as kddokter_utama,d.namadokter as dpjp_utama,smf_utama,e.kddokter as kddokter_pengganti,e.namadokter as dpjp_pengganti,smf_pengganti from t_pelimpahan_dpjp a
|
|
join m_dokter d on a.dpjp_utama = d.kddokter
|
|
join m_dokter e on a.dpjp_pengganti = e.kddokter
|
|
where id_admission = $id_admission order by id_pelimpahan");
|
|
if ($cek_pelimpahan->numRows() > 0) {
|
|
$st_input_pelimpahan = false;
|
|
$data_pelimpahan_dpjp = $cek_pelimpahan->fetchAll();
|
|
$arr_pelimpahan = $data_pelimpahan_dpjp[$cek_pelimpahan->numRows() - 1];
|
|
// $nama_dpjp = $arr_pelimpahan['dpjp_utama'];
|
|
// $smf_dpjp = $arr_pelimpahan['smf_utama'];
|
|
$nama_dpjp = $arr_pelimpahan['dpjp_pengganti'];
|
|
$smf_dpjp = $arr_pelimpahan['smf_pengganti'];
|
|
$dpjp_pengganti = $arr_pelimpahan['kddokter_pengganti'];
|
|
$smf_pengganti = $arr_pelimpahan['smf_pengganti'];
|
|
$tgl_pelimpahan = $arr_pelimpahan['tgl_pelimpahan'];
|
|
} else {
|
|
$st_input_pelimpahan = false;
|
|
$data_pelimpahan_dpjp = [];
|
|
$nama_dpjp = $arr_dokter[$kddokter];
|
|
$smf_dpjp = $arr_smf[$kddokter];
|
|
$dpjp_pengganti = $kddokter;
|
|
$tgl_pelimpahan = date('Y-m-d');
|
|
$smf_pengganti = '';
|
|
}
|
|
?>
|
|
<h4>FORM PELIMPAHAN DOKTER DPJP</h4>
|
|
|
|
<form name="pelimpahan_dpjp" method="post" id="pelimpahan_dpjp">
|
|
|
|
<input type="hidden" name="idx_admission" id="idx_admission" value="<?php echo $id_admission; ?>" />
|
|
<input type="hidden" name="nomr" id="nomr" value="<?php echo $nomr; ?>" />
|
|
<input type="hidden" name="kdruang" value="<?php echo $noruang; ?>" />
|
|
<input type="hidden" name="dpjp_utama" value="<?php echo $kddokter; ?>" />
|
|
|
|
<div class="text-left">
|
|
<p>Yang bertanda tangan di bawah ini :
|
|
<div class="form-group row">
|
|
<label class="col-sm-2">Nama </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" readonly class="form-control" name="nama_dpjp" id="nama_dpjp"
|
|
value="<?php echo $nama_dpjp; ?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-sm-2">SMF </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" readonly class="form-control" name="smf_dpjp" id="smf_dpjp"
|
|
value="<?php echo $smf_dpjp; ?>" />
|
|
</div>
|
|
</div>
|
|
<p>Selaku Dokter DPJP dari Pasien : </p>
|
|
<div class="form-group row">
|
|
<label class="col-sm-2">Nama </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" readonly class="form-control" name="nama_pasien" id="nama_pasien"
|
|
value="<?php echo $nama; ?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-sm-2">Alamat </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" readonly class="form-control" name="alamat_pasien" id="alamat_pasien"
|
|
value="<?php echo $userdata['alamat']; ?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-sm-2">Ruang Rawat </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" readonly class="form-control" name="ruang" id="ruang"
|
|
value="<?php echo $userdata['nm_ruang']; ?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-sm-2">No Rekam Medik </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" readonly class="form-control" name="norm" id="norm"
|
|
value="<?php echo $userdata['nomr']; ?>" />
|
|
</div>
|
|
</div>
|
|
<p>Melimpahkan tanggung jawab perawatan pasien tersebut di atas kepada : </p>
|
|
<div class="form-group row">
|
|
<label class="col-sm-2">Nama </label>
|
|
<div class="col-sm-8">
|
|
<?php
|
|
if ($st_input_pelimpahan == false) {
|
|
echo form_dropdown('dpjp_baru', $arr_dokter, $kddokter, 'class="form-control" id="kddokter_baru"');
|
|
} else {
|
|
echo form_dropdown('dpjp_baru', $arr_dokter, $dpjp_pengganti, 'class="form-control" id="kddokter_baru" disabled');
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-sm-2">SMF </label>
|
|
<div class="col-sm-8">
|
|
<input type="text" readonly class="form-control" name="smf_dpjp_baru" id="smf_dpjp_baru"
|
|
value="<?php echo $smf_pengganti; ?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-sm-2">Tanggal Pelimpahan</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="form-control mask-date-default datepicker-default" name="tgl_pelimpahan"
|
|
id="tgl_pelimpahan"
|
|
value="<?php echo ($st_input_pelimpahan == false) ? date('Y-m-d') : $tgl_pelimpahan; ?>"
|
|
<?php echo ($st_input_pelimpahan == false) ? '' : 'disabled'; ?> />
|
|
</div>
|
|
</div>
|
|
<?php if ($st_input_pelimpahan == false) : ?>
|
|
<?php
|
|
/***Todo Pembatasan Access menurut unit pelayanan */
|
|
if (($_SESSION['ROLES'] == 15) or ($_SESSION['ROLES'] == 6)) {
|
|
echo '<div class="alert alert-error"><p>Anda tidak memiliki akses untuk mengisi form ini</p></div>';
|
|
} else {
|
|
echo ' <input type="button" name="Submit" id="simpan_pelimpahan" value="Simpan" class="btn btn-primary" />';
|
|
}
|
|
?>
|
|
|
|
<?php endif; ?>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="container-fluid mt-5">
|
|
<div class="row">
|
|
<div class="col-sm-12 col-md-12">
|
|
<table class="table table-condensed table-striped table-sm table-bordered" id="table_pelimpahan">
|
|
<thead>
|
|
<tr class="table-info">
|
|
<th rowspan="2">No.</th>
|
|
<th rowspan="2">Tanggal Pelimpahan</th>
|
|
<th colspan="2">DPJP Asal</th>
|
|
<th colspan="2">Dilimpahkan Ke DPJP</th>
|
|
</tr>
|
|
<tr class="table-info">
|
|
<th>Nama DPJP</th>
|
|
<th>SMF DPJP</th>
|
|
<th>Nama DPJP</th>
|
|
<th>SMF DPJP</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
if (!empty($data_pelimpahan_dpjp)) {
|
|
$no = 1;
|
|
foreach ($data_pelimpahan_dpjp as $row) {
|
|
echo '<tr><td>' . $no . '</td><td>' . $row['tgl_pelimpahan'] . '</td><td>' . $row['dpjp_utama'] . '</td><td>' . $row['smf_utama'] . '</td><td>' . $row['dpjp_pengganti'] . '</td><td>' . $row['smf_pengganti'] . '</td></tr>';
|
|
$no++;
|
|
}
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
echo '<script>';
|
|
$arr_str_smf = [];
|
|
foreach ($arr_smf as $kd => $smf) {
|
|
$arr_str_smf[] = $kd . ':\'' . $smf . '\'';
|
|
}
|
|
$str_dpjp = 'const arr_smf = {' . implode(',', $arr_str_smf) . '}';
|
|
echo $str_dpjp;
|
|
echo '</script>';
|
|
?>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$("#kddokter_baru").on("change", function(d) {
|
|
const kd = $(this).find(":selected").val();
|
|
$("#smf_dpjp_baru").val(arr_smf[kd]);
|
|
});
|
|
$('#simpan_pelimpahan').click(function() {
|
|
form_pelimpahan = $("#pelimpahan_dpjp").serialize();
|
|
|
|
$.post('<?php echo _BASE_; ?>ranap/save_pelimpahan.php', form_pelimpahan + "&simpan=1",
|
|
function(data) {
|
|
Toast.fire({
|
|
title: data.message,
|
|
type: data.type,
|
|
onClose: function() {
|
|
// window.location.reload();
|
|
if (data.table != false) {
|
|
$("#table_pelimpahan tbody").html(data.table);
|
|
}
|
|
}
|
|
});
|
|
}, "json");
|
|
});
|
|
});
|
|
</script>
|