update
This commit is contained in:
No files matched your search
@@ -1,11 +1,5 @@
|
||||
@php
|
||||
use App\RekapAntibiotik;
|
||||
use App\SiraB;
|
||||
$antibiotikData = RekapAntibiotik::whereIn('orderid', $orderbydate->pluck('id'))->get()->keyBy('orderid');
|
||||
$siraBData = SiraB::whereIn('antibiotik', $jsonantibiotik ?? [])->orWhereIn('subantibiotik', $jsonantibiotik ?? [])->get()->keyBy('antibiotik');
|
||||
@endphp
|
||||
|
||||
@extends('base.layout')
|
||||
|
||||
@section('content')
|
||||
<div class="wrapper">
|
||||
<div class="container-fluid">
|
||||
@@ -14,91 +8,53 @@
|
||||
<div class="card-box ribbon-box">
|
||||
<div class="ribbon ribbon-danger">Rekapitulasi Data Bulan {{$bulan}} Tahun {{$tahun}}</div>
|
||||
<p></p>
|
||||
<div class="table-responsive">
|
||||
<button type="button" class="btn btn-primary" id="btnexport"><i class="fa fa-print"></i> Export</button>
|
||||
<div class="mt-3 mb-3">
|
||||
<a href="{{ route('exportGlassReport', ['bulan' => $bulan, 'tahun' => $tahun]) }}" class="btn btn-success">
|
||||
<i class="fa fa-file-excel-o"></i> Download Full Excel (CSV)
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<table id="glassreport" class="table table-bordered display">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered" id="datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID Rumah Sakit</th>
|
||||
<th>Nama Pasien</th>
|
||||
<th>No Rekam Medis</th>
|
||||
<th>Jenis Kelamin</th>
|
||||
<th>Tanggal Lahir</th>
|
||||
<th>Usia</th>
|
||||
<th>Ruang Rawat</th>
|
||||
<th>Tanggal Pasien Masuk</th>
|
||||
<th>Tanggal Pengambilan Sample</th>
|
||||
<th>Specimen Origin (Comunity Origin / Hospital Origin)</th>
|
||||
<th>Jenis Spesimen</th>
|
||||
<th>Nama Spesies Bakteri</th>
|
||||
<th>ESBL</th>
|
||||
<th>MRSA</th>
|
||||
@if(!empty($jsonantibiotik))
|
||||
@foreach($jsonantibiotik as $antibiotic)
|
||||
<th>{{ $antibiotic }}</th>
|
||||
@endforeach
|
||||
@endif
|
||||
<th>No RM</th>
|
||||
<th>Bakteri</th>
|
||||
@foreach($jsonantibiotik as $antibiotic)
|
||||
<th title="{{ $antibiotic }}">{{ $antibiotic }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($orderbydate ?? [] as $data)
|
||||
@forelse($orderbydate as $data)
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>{{ $data->nmpasien }}</td>
|
||||
<td>{{ $data->noregister }}</td>
|
||||
<td>{{ $data->jkpasien }}</td>
|
||||
<td>{{ $data->tgllahirpasien }}</td>
|
||||
<td>{{ $data->usia }}</td>
|
||||
<td>{{ $data->asalpasien }}</td>
|
||||
<td>{{ $data->mulai }}</td>
|
||||
<td>{{ $data->daftar }}</td>
|
||||
<td> </td>
|
||||
<td>{{ $data->kd_spesimen }}</td>
|
||||
<td>{{ $data->nm_spesimen }}</td>
|
||||
<td>{{ $data->id_esbl }}</td>
|
||||
<td>{{ $data->id_mrsa }}</td>
|
||||
@if(!empty($jsonantibiotik))
|
||||
@foreach($jsonantibiotik as $antibiotic)
|
||||
@php
|
||||
$cekapakahada = $antibiotikData[$data->id] ?? null;
|
||||
$intepretasi = $cekapakahada->interpretation ?? '';
|
||||
@endphp
|
||||
<td>{{ $intepretasi }}</td>
|
||||
@endforeach
|
||||
@endif
|
||||
<td>{{ $data->nm_spesimen }}</td> @foreach($jsonantibiotik as $headerAntibiotik)
|
||||
@php
|
||||
// LOGIC UTAMA:
|
||||
// Cek di array lookup: [id_pasien][nama_antibiotik]
|
||||
// Jika ada, ambil nilainya. Jika tidak, kosong.
|
||||
$interpretasi = $antibiotikLookup[$data->id][$headerAntibiotik] ?? '';
|
||||
@endphp
|
||||
<td class="text-center" style="{{ $interpretasi == 'R' ? 'background-color:#ffcccc' : '' }}">
|
||||
{{ $interpretasi }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="14" class="text-center">Tidak ada data yang tersedia.</td>
|
||||
<td colspan="{{ count($jsonantibiotik) + 3 }}">Data tidak ditemukan</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="_token" id="token" value="{{ csrf_token() }}">
|
||||
@endsection
|
||||
@push('script')
|
||||
<!-- SIGNATURE PAD -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById('btnexport').addEventListener('click', function() {
|
||||
var table = document.getElementById('glassreport');
|
||||
if (table) {
|
||||
var wb = XLSX.utils.table_to_book(table, { sheet: "Report" });
|
||||
XLSX.writeFile(wb, "GlassReport_{{$bulan}}_Tahun{{$tahun}}.xlsx");
|
||||
} else {
|
||||
console.error('Tabel dengan ID "tblkeaktifankelas" tidak ditemukan.');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@endsection
|
||||
Reference in New Issue
Block a user