first commit
This commit is contained in:
@@ -0,0 +1,326 @@
|
||||
<?php
|
||||
require_once './core/db.php';
|
||||
$dbRIS = new db($_ENV['RIS_DB_HOST'], $_ENV['RIS_DB_USER'], $_ENV['RIS_DB_PASS'], $_ENV['RIS_DB_NAME']);
|
||||
|
||||
$visitNumberCol = (_DBTYPE_ == 'mysqli') ? "a.VisitNumber" : "a.\"VisitNumber\"";
|
||||
$OrderNumberCol = (_DBTYPE_ == 'mysqli') ? "a.OrderNumber" : "a.\"OrderNumber\"";
|
||||
$nomrCol = (_DBTYPE_ == 'mysqli') ? "a.NoMR" : "a.\"NoMR\"";
|
||||
$lisRegNoCol = (_DBTYPE_ == 'mysqli') ? "a.LIS_REG_NO" : "a.\"LIS_REG_NO\"";
|
||||
$wardNameCol = (_DBTYPE_ == 'mysqli') ? "a.WardName" : "a.\"WardName\"";
|
||||
$doctorNameCol = (_DBTYPE_ == 'mysqli') ? "a.DoctorName" : "a.\"DoctorName\"";
|
||||
$retrievedCol = (_DBTYPE_ == 'mysqli') ? "a.RETRIEVED_DT" : "a.\"RETRIEVED_DT\"";
|
||||
$serviceUnitCol = (_DBTYPE_ == 'mysqli') ? "a.ServiceUnitID" : "a.\"ServiceUnitID\"";
|
||||
|
||||
$sql = "SELECT a.nolab,a.tglorder as tgl_order,a.tgl_lab, b.nama, b.alamat, g.nama as carabayar, a.nomr, e.nama as poly, a.idxdaftar, (select namadokter from m_dokter join t_orderlabmikro on m_dokter.kddokter = t_orderlabmikro.drpengirim where t_orderlabmikro.nolab = a.nolab limit 1) as namadokter,'Mikrobiologi Klinik' as nama_lab,'MK' as kode_lab
|
||||
FROM t_orderlabmikro_main a
|
||||
JOIN t_admission f ON a.IDXDAFTAR = f.id_admission and a.NOMR = f.NOMR
|
||||
JOIN m_pasien b ON a.NOMR = b.NOMR
|
||||
JOIN m_ruang e ON f.noruang = e.no
|
||||
JOIN m_carabayar g ON f.statusbayar = g.KODE
|
||||
WHERE (f.id_admission = $id_admission) or a.nomr = '$nomr'
|
||||
UNION
|
||||
SELECT a.noreglab as nolab,a.tglorder as tgl_order,a.tgljawab_lab as tgl_lab, b.nama, b.alamat, g.nama as carabayar, a.nomr, e.nama as poly, a.idxdaftar, (select namadokter from m_dokter join t_orderlabpa_main on m_dokter.kddokter = t_orderlabpa_main.drpengirim where t_orderlabpa_main.noreglab = a.noreglab limit 1) as namadokter,'Patologi Anatomi' as nama_lab,'PA' as kode_lab
|
||||
FROM t_orderlabpa_main a
|
||||
JOIN t_admission f ON a.IDXDAFTAR = f.id_admission and a.NOMR = f.NOMR
|
||||
JOIN m_pasien b ON a.NOMR = b.NOMR
|
||||
JOIN m_ruang e ON f.noruang = e.no
|
||||
JOIN m_carabayar g ON f.statusbayar = g.KODE
|
||||
WHERE f.id_admission = $id_admission
|
||||
UNION
|
||||
SELECT $OrderNumberCol as NOLAB,a.\"OrderDateTime\" as tgl_order, (select authorization_date from t_lis_result where lis_reg_no = $lisRegNoCol limit 1) as tgl_lab, b.nama, b.alamat, g.nama as carabayar, $nomrCol, $wardNameCol as poly, $visitNumberCol as idxdaftar, $doctorNameCol as namadokter,'Patologi Klinik' as nama_lab,'PK' as kode_lab
|
||||
FROM t_lis_registration a
|
||||
JOIN (select nobill,idxdaftar from t_billranap where idxdaftar= $id_admission order by idxbill desc limit 1) bill on $visitNumberCol = bill.nobill
|
||||
JOIN t_admission f ON bill.idxdaftar = f.id_admission and $nomrCol = f.NOMR
|
||||
JOIN m_pasien b ON $nomrCol = b.NOMR
|
||||
JOIN m_carabayar g ON f.statusbayar = g.KODE
|
||||
WHERE $serviceUnitCol = 1 AND f.id_admission = $id_admission
|
||||
UNION
|
||||
SELECT a.no_form as nolab,a.tgl_order,a.tgl_uji as tgl_lab, b.nama, b.alamat, g.nama as carabayar, a.nomr, e.nama as poly, a.idxdaftar, (select namadokter from m_dokter join t_orderlabdarah_main on m_dokter.kddokter = t_orderlabdarah_main.dokter_pengirim where t_orderlabdarah_main.no_form = a.no_form limit 1) as namadokter,'Darah' as nama_lab,'DRH' as kode_lab
|
||||
FROM t_orderlabdarah_main a
|
||||
JOIN t_admission f ON a.IDXDAFTAR = f.id_admission and a.NOMR = f.NOMR
|
||||
JOIN m_pasien b ON a.NOMR = b.NOMR
|
||||
JOIN m_ruang e ON f.noruang = e.no
|
||||
JOIN m_carabayar g ON f.statusbayar = g.KODE
|
||||
WHERE f.id_admission = $id_admission
|
||||
ORDER BY nolab desc
|
||||
";
|
||||
|
||||
$sql_rad = 'SELECT a.idxorderrad,a.hasilresume,a.nofilm, b.tglorder, b.nomr,p.nama as poly,t.nama_field as nama_tindakan,t.jenis_kelompok as jenisfilm,d.namadokter,
|
||||
case b.aps when 1 then (select nama from m_pasien_aps p where b.nomr = b.nomr limit 1)
|
||||
else (select nama from m_pasien p where p.nomr = b.nomr limit 1) end as nama,
|
||||
case b.aps when 1 then (select jeniskelamin from m_pasien_aps p where b.nomr = b.nomr limit 1)
|
||||
else (select jeniskelamin from m_pasien p where b.nomr = b.nomr limit 1) end as jeniskelamin
|
||||
FROM t_orderradiologi a
|
||||
JOIN t_orderradiologi_main b on a.IDXPKRAD = b.IDXPKRAD
|
||||
JOIN m_ruang p ON p.no = b.POLYPENGIRIM
|
||||
JOIN m_dokter d ON d.KDDOKTER = b.DRPENGIRIM
|
||||
JOIN m_form_lab t ON t.form_id = a.IDXFORM
|
||||
where b.IDXDAFTAR = ' . $id_admission . ' AND b.NOMR = \'' . $nomr . '\' and RAJAL = 0';
|
||||
|
||||
$tmp_rad = $dbRIS->query("SELECT a.nofoto,a.reques,a.mulai,a.akhir,a.status from periksa a
|
||||
where noregister = '$nomr' and a.verifikasi is not null");
|
||||
?>
|
||||
<div class="container-fluid">
|
||||
|
||||
<fieldset class="fieldset">
|
||||
<h5>HASIL PEMERIKSAAN PENUNJANG</h5>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h5>Laboratorium</h5>
|
||||
<table class="table table-bordered table-striped table-sm">
|
||||
<tr class="bg-success text-white">
|
||||
<th>No Lab</th>
|
||||
<th>Dari Lab</th>
|
||||
<th>Tanggal Order</th>
|
||||
<th>Tanggal Selesai</th>
|
||||
<th>Lihat Hasil</th>
|
||||
</tr>
|
||||
<?php
|
||||
$tmp_query = $db->query($sql);
|
||||
if ($tmp_query->numRows()) {
|
||||
foreach ($tmp_query->fetchAll() as $ds) {
|
||||
$view_lab = ($ds['kode_lab'] == 'MK') ? 'view_lab_mikro' : (($ds['kode_lab'] == 'PA') ? 'view_lab_pa' : (($ds['kode_lab'] == 'DRH') ? 'view_lab_darah' : 'view_lab_pk'));
|
||||
if ($ds['kode_lab'] == 'MK') {
|
||||
$get_detil = $db->query("SELECT nomr,no_lokal as no_lab,
|
||||
case when jenis_hasil is null then 'BELUM DIPERIKSA'
|
||||
when jenis_hasil != '' and simpan_analis = 1 and status_kirim_expertise is null and simpan_expertise is null and status_final is null then 'DIPERIKSA ANALIS'
|
||||
when jenis_hasil != '' and simpan_analis = 1 and status_kirim_expertise = 1 and simpan_expertise is null and status_final is null then 'KIRIM EXPERTISE'
|
||||
when jenis_hasil != '' and simpan_analis = 1 and status_kirim_expertise = 1 and simpan_expertise = 1 and status_final is null then 'DIPERIKSA EXPERTISE'
|
||||
when jenis_hasil != '' and simpan_analis = 1 and status_kirim_expertise = 1 and simpan_expertise = 1 and status_final = 1 then 'KIRIM HASIL LAB' end as status,jenis_hasil,idxordermikro
|
||||
from t_orderlabmikro where nolab='{$ds['nolab']}' and no_lokal is not null and status_final = 1");
|
||||
if ($get_detil->numRows() > 0) {
|
||||
$data_detil = $get_detil->fetchAll();
|
||||
}
|
||||
echo '<tr>';
|
||||
echo '<td>' . $ds['nolab'] . '</td>';
|
||||
echo '<td>' . $ds['nama_lab'] . '</td>';
|
||||
echo '<td>' . $ds['tgl_order'] . '</td>';
|
||||
echo '<td>' . $ds['tgl_lab'] . '</td>';
|
||||
echo '<td>';
|
||||
if ($get_detil->numRows() > 0) {
|
||||
echo '<table class="table">
|
||||
<thead class="thead-dark"><tr><th>No Lab</th><th>Hasil</th></tr></thead><tbody>';
|
||||
foreach ($data_detil as $detil) {
|
||||
$hasil = ($detil['status'] == 'KIRIM HASIL LAB') ? '<button data-nomr="' . $detil['nomr'] . '" data-idx="' . $detil['idxordermikro'] . '" data-nolab="' . $ds['nolab'] . '" data-jenis_hasil="' . $detil['jenis_hasil'] . '" class="view_lab_mikro btn btn-outline-danger btn-sm"><i class="fa fa-file-pdf"></i> Lihat ' . $detil['jenis_hasil'] . '</button>' : '';
|
||||
|
||||
echo '<tr><td>' . $detil['no_lab'] . '</td><td>' . $hasil . '</td></tr>';
|
||||
}
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
echo '</td></tr>';
|
||||
} else {
|
||||
echo '<tr>';
|
||||
echo '<td>' . $ds['nolab'] . '</td>';
|
||||
echo '<td>' . $ds['nama_lab'] . '</td>';
|
||||
echo '<td>' . $ds['tgl_order'] . '</td>';
|
||||
echo '<td>' . $ds['tgl_lab'] . '</td>';
|
||||
echo '<td><button data-nomr="' . $ds['nomr'] . '" data-idx="' . $ds['idxdaftar'] . '" data-nolab="' . $ds['nolab'] . '" class="' . $view_lab . ' btn btn-outline-secondary btn-sm">LIHAT</button></td></tr><tr id="detillab-' . $ds['nolab'] . '"><td colspan="4"></td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h5>Radiologi</h5>
|
||||
<table class="table table-bordered table-striped table-sm">
|
||||
<tr class="bg-success text-white">
|
||||
<th>No Foto</th>
|
||||
<th>Nama Foto</th>
|
||||
<th>Mulai</th>
|
||||
<th>Selesai</th>
|
||||
<th>Waktu Respon</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
<?php
|
||||
if ($tmp_rad->numRows()) {
|
||||
foreach ($tmp_rad->fetchAll() as $ds) {
|
||||
$dt_a = new DateTime($ds['mulai']);
|
||||
if ($ds['selesai'] != '') {
|
||||
$dt_b = new DateTime($ds['selesai']);
|
||||
|
||||
$dt_respon = $dt_b->diff($dt_a);
|
||||
$waktu_respon = $dt_respon->format("%H jam %I menit %s detik");
|
||||
} else {
|
||||
$waktu_respon = '';
|
||||
}
|
||||
$view_lab = 'view_rad';
|
||||
echo '<tr>';
|
||||
echo '<td>' . $ds['nofoto'] . '</td>';
|
||||
echo '<td>' . $ds['reques'] . '</td>';
|
||||
echo '<td>' . $ds['mulai'] . '</td>';
|
||||
echo '<td>' . $ds['selesai'] . '</td>';
|
||||
echo '<td>' . $waktu_respon . '</td>';
|
||||
echo '<td>' . $ds['status'] . '</td>';
|
||||
echo '<td><div class="btn-group">
|
||||
<button data-nofoto="' . $ds['nofoto'] . '" class="' . $view_lab . ' btn btn-outline-primary btn-sm">Jawaban</button>
|
||||
<button data-nofoto="' . $ds['nofoto'] . '" data-nomr="' . $nomr . '" class="' . $view_lab . '_foto btn btn-outline-success btn-sm">Lihat Foto</button>
|
||||
</div>
|
||||
</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
// $(document).on("click", ".view_lab_pk", function(e) {
|
||||
// e.preventDefault();
|
||||
// $(this).button("loading");
|
||||
// var nolab = $(this).data("nolab");
|
||||
// var nomr = $(this).data("nomr");
|
||||
// var idx = $(this).data("idx");
|
||||
// $.ajax({
|
||||
// url: <?php echo _BASE_ . 'include/master.php?get_viewer=1'; ?>,
|
||||
// type: "POST",
|
||||
// data: {
|
||||
// search: data_search
|
||||
// },
|
||||
// dataType: "JSON",
|
||||
// success: function(data) {
|
||||
// console.log(data);
|
||||
// },
|
||||
// error: function(jqXHR, textStatus, errorThrown) {
|
||||
// $(".view_lab_pk").button("reset");
|
||||
// },
|
||||
// }); //end ajax
|
||||
// });
|
||||
$(".view_lab_pk").click(function() {
|
||||
var nolab = $(this).data("nolab");
|
||||
var nomr = $(this).data("nomr");
|
||||
var idx = $(this).data("idx");
|
||||
var this_btn = $(this);
|
||||
this_btn.text("Loading...");
|
||||
|
||||
$.post("<?php echo _BASE_ . 'include/master.php?get_viewer=1'; ?>", {
|
||||
nomr
|
||||
}, function(data) {
|
||||
// console.log(data);
|
||||
wrapper = $("#detillab-" + nolab + " td");
|
||||
// wrapper.html("");
|
||||
//console.log(wrapper);
|
||||
html_elm = "<div class=\"list-group\">";
|
||||
if (data.type == "success") {
|
||||
this_btn.text("Loading Selesai").prop("disabled", true);
|
||||
$.each(data.data, function(k, v) {
|
||||
html_elm +=
|
||||
"<a href=\"javascript:void(0)\" class=\"list-group-item list-group-item-action view_pdf\" onclick=\"openviewer('" +
|
||||
v.url + "')\">" + v.nama + "</a>";
|
||||
});
|
||||
} else {
|
||||
this_btn.text("Lihat").prop("disabled", false);
|
||||
}
|
||||
html_elm += "</div>";
|
||||
wrapper.html(html_elm);
|
||||
}, "json");
|
||||
/*$.post('<?php echo _BASE_; ?>lab/detil_hasil_labpk.php',{preview:1,nolab:nolab,nomr:nomr,idx:idx,rajal:0},function(data)
|
||||
{
|
||||
$("#modal-preview .modal-body").html(data);
|
||||
$("#modal-preview").modal("show");
|
||||
})*/
|
||||
|
||||
});
|
||||
|
||||
function openviewer(url) {
|
||||
$("#print_body").html("");
|
||||
$("#print_body").html("<embed src=\"\" width=\"100%\" height=\"450\" id=\"embed_pdf\"></embed>");
|
||||
$("#embed_pdf").prop("src", url);
|
||||
$("#modal-preview").modal("show");
|
||||
$("#modal-preview .btn-success").css("display", 'none');
|
||||
}
|
||||
|
||||
// $(".view_lab_mikro").click(function(){
|
||||
// var nolab = $(this).data("nolab");
|
||||
// var nomr = $(this).data("nomr");
|
||||
// var idx = $(this).data("idx");
|
||||
// $.post('<?php echo _BASE_; ?>lab/detil_hasil_labmikro.php',{preview:1,nolab:nolab,nomr:nomr,idx:idx},function(data)
|
||||
// {
|
||||
// $("#modal-preview .modal-body").html(data);
|
||||
// $("#modal-preview").modal("show");
|
||||
// })
|
||||
|
||||
// });
|
||||
// $(".view_lab_pa").click(function(){
|
||||
// var nolab = $(this).data("nolab");
|
||||
// var nomr = $(this).data("nomr");
|
||||
// var idx = $(this).data("idx");
|
||||
// $.post('<?php echo _BASE_; ?>lab/detil_hasil_labpa.php',{preview:1,nolab:nolab,nomr:nomr,idx:idx},function(data)
|
||||
// {
|
||||
// $("#modal-preview .modal-body").html(data);
|
||||
// $("#modal-preview").modal("show");
|
||||
// })
|
||||
|
||||
// });
|
||||
|
||||
$(".view_lab_darah").click(function() {
|
||||
var nolab = $(this).data("nolab");
|
||||
var nomr = $(this).data("nomr");
|
||||
var idx = $(this).data("idx");
|
||||
$.post('<?php echo _BASE_; ?>lab/detil_hasil_labdarah.php', {
|
||||
preview: 1,
|
||||
nolab: nolab,
|
||||
nomr: nomr,
|
||||
idx: idx
|
||||
}, function(data) {
|
||||
$("#modal-preview .modal-body").html(data);
|
||||
$("#modal-preview").modal("show");
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
$(".view_rad").click(function() {
|
||||
var nofoto = $(this).data("nofoto");
|
||||
$.post('<?php echo _BASE_; ?>radiologi/detil_hasil_radiologi.php', {
|
||||
preview: 1,
|
||||
nofoto
|
||||
}, function(data) {
|
||||
$("#modal-preview .modal-body").html(data);
|
||||
$("#modal-preview").modal("show");
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
$(".view_rad_foto").click(function() {
|
||||
var nofoto = $(this).data("nofoto");
|
||||
var nomr = $(this).data("nomr");
|
||||
$.post('<?php echo _BASE_; ?>include/master.php', {
|
||||
ris_viewer: 1,
|
||||
nofoto,
|
||||
nomr
|
||||
}, function(data) {
|
||||
// $("#modal-preview .modal-body").html(data);
|
||||
// $("#modal-preview").modal("show");
|
||||
// $("#modal-preview .btn-success").css("display",'none');
|
||||
var windowFeatures =
|
||||
"height=900,width=1300,directories=0,titlebar=0,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,addressbar=0";
|
||||
a = window.open(data.url, 'viewer_radiologi', windowFeatures);
|
||||
}, "json");
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
array_push($form_plugin['ui_plugins_js'], $jspm_js);
|
||||
|
||||
$js_init .= $jspm_init;
|
||||
$js_init .= '$(".view_lab_mikro").click(function(){
|
||||
var nolab = $(this).data("nolab");
|
||||
var nomr = $(this).data("nomr");
|
||||
var idx = $(this).data("idx");
|
||||
jspm_print_with_toolbar("' . _BASE_ . 'lab/detil_hasil_labmikro.php?preview=1&no="+idx,"modal-preview","Hasil Laboratorium Mikrobiologi.pdf",0);
|
||||
});
|
||||
$(".view_lab_pa").click(function(){
|
||||
var nolab = $(this).data("nolab");
|
||||
var nomr = $(this).data("nomr");
|
||||
var idx = $(this).data("idx");
|
||||
jspm_print_with_toolbar("' . _BASE_ . 'lab/detil_hasil_labpa.php?preview=1&idx="+idx+"&nomr="+nomr+"&nolab="+nolab,"modal-preview","Hasil Laboratorium Patologi Anatomi.pdf",0);
|
||||
});';
|
||||
?>
|
||||
Reference in New Issue
Block a user