update
This commit is contained in:
No files matched your search
@@ -340,6 +340,108 @@ class ReportController extends Controller
|
|||||||
? 'MEMENUHI TARGET'
|
? 'MEMENUHI TARGET'
|
||||||
: 'TIDAK MEMENUHI TARGET';
|
: 'TIDAK MEMENUHI TARGET';
|
||||||
}
|
}
|
||||||
|
private function normalizeBtaSpValue($value) {
|
||||||
|
$value = trim(strip_tags((string) $value));
|
||||||
|
$normalized = strtolower(str_replace(' ', '', $value));
|
||||||
|
|
||||||
|
if ($normalized === '+++' || $normalized === '3+') {
|
||||||
|
return '+++';
|
||||||
|
}
|
||||||
|
if ($normalized === '++' || $normalized === '2+') {
|
||||||
|
return '++';
|
||||||
|
}
|
||||||
|
if ($normalized === '+' || $normalized === '1+') {
|
||||||
|
return '+';
|
||||||
|
}
|
||||||
|
if (in_array($normalized, ['1-9', '1s/d9', '1sd9'], true)) {
|
||||||
|
return '1-9';
|
||||||
|
}
|
||||||
|
if (in_array($normalized, ['neg', 'negatif', 'negative'], true)) {
|
||||||
|
return 'Neg';
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
private function buildMikroskopisBtaSpReport($bulan, $tahun) {
|
||||||
|
$nilaiList = ['+++', '++', '+', '1-9', 'Neg'];
|
||||||
|
$report = [];
|
||||||
|
|
||||||
|
foreach (['L' => 'Laki-laki', 'P' => 'Perempuan'] as $kodeKelamin => $labelKelamin) {
|
||||||
|
foreach ($nilaiList as $nilai) {
|
||||||
|
$report[$kodeKelamin][$nilai] = [
|
||||||
|
'kelamin' => $labelKelamin,
|
||||||
|
'nilai' => $nilai,
|
||||||
|
'pagi' => 0,
|
||||||
|
'sewaktu' => 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = DB::table('db_komponenjawaban')
|
||||||
|
->select('db_komponenjawaban.komponen', 'db_komponenjawaban.isidata', 'periksa.jkpasien')
|
||||||
|
->leftJoin('periksa', 'db_komponenjawaban.accnumber', 'periksa.nofoto')
|
||||||
|
->where(function ($q) {
|
||||||
|
$q->where('db_komponenjawaban.komponen', 'LIKE', '%hasilpemeriksaantbbiakan_pagi%')
|
||||||
|
->orWhere('db_komponenjawaban.komponen', 'LIKE', '%hasilpemeriksaantbbiakan_sewaktu%');
|
||||||
|
})
|
||||||
|
->whereNotNull('db_komponenjawaban.isidata')
|
||||||
|
->where('db_komponenjawaban.isidata', '!=', '')
|
||||||
|
->whereYear('periksa.daftar', $tahun);
|
||||||
|
|
||||||
|
if ($bulan != 'ALL' && $bulan != 'Pick Month') {
|
||||||
|
$query->whereMonth('periksa.daftar', $bulan);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($query->get() as $row) {
|
||||||
|
$kelamin = $row->jkpasien == 'L' ? 'L' : 'P';
|
||||||
|
$nilai = $this->normalizeBtaSpValue($row->isidata);
|
||||||
|
|
||||||
|
if ($nilai === null || !isset($report[$kelamin][$nilai])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stripos($row->komponen, 'hasilpemeriksaantbbiakan_pagi') !== false) {
|
||||||
|
$report[$kelamin][$nilai]['pagi']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stripos($row->komponen, 'hasilpemeriksaantbbiakan_sewaktu') !== false) {
|
||||||
|
$report[$kelamin][$nilai]['sewaktu']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_merge(array_values($report['L']), array_values($report['P']));
|
||||||
|
}
|
||||||
|
public function genMikroskopisBtaSpReport(Request $request) {
|
||||||
|
$bulan = $request->input('bulan');
|
||||||
|
$tahun = $request->input('tahun');
|
||||||
|
|
||||||
|
if ($tahun == '' OR is_null($tahun)){
|
||||||
|
$getarray = explode('?', $bulan);
|
||||||
|
$bulan = $getarray[0] ?? date('m');
|
||||||
|
$tahun = $getarray[1] ?? date('Y');
|
||||||
|
$bulan = str_replace('bulan=', '', $bulan);
|
||||||
|
$tahun = str_replace('tahun=', '', $tahun);
|
||||||
|
}
|
||||||
|
|
||||||
|
$nilaiList = ['+++', '++', '+', '1-9', 'Neg'];
|
||||||
|
$reportRows = collect($this->buildMikroskopisBtaSpReport($bulan, $tahun));
|
||||||
|
$rekapLaki = $reportRows
|
||||||
|
->where('kelamin', 'Laki-laki')
|
||||||
|
->keyBy('nilai')
|
||||||
|
->toArray();
|
||||||
|
$rekapPerempuan = $reportRows
|
||||||
|
->where('kelamin', 'Perempuan')
|
||||||
|
->keyBy('nilai')
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
return view('cetak.mikroskopisbtasp', compact(
|
||||||
|
'rekapLaki',
|
||||||
|
'rekapPerempuan',
|
||||||
|
'nilaiList',
|
||||||
|
'bulan',
|
||||||
|
'tahun'
|
||||||
|
));
|
||||||
|
}
|
||||||
public function report(Request $request) {
|
public function report(Request $request) {
|
||||||
$bulan = $request->input('bulan');
|
$bulan = $request->input('bulan');
|
||||||
$tahun = $request->input('tahun');
|
$tahun = $request->input('tahun');
|
||||||
@@ -355,6 +457,9 @@ class ReportController extends Controller
|
|||||||
$order = $request->input('order') ?? 'id desc';
|
$order = $request->input('order') ?? 'id desc';
|
||||||
$filterscount = $request->input('filterscount') ?? 0;
|
$filterscount = $request->input('filterscount') ?? 0;
|
||||||
$isMdrReport = $jenisreport == 'list_hasil_mdr';
|
$isMdrReport = $jenisreport == 'list_hasil_mdr';
|
||||||
|
if ($jenisreport == 'mikroskopis_bta_sp') {
|
||||||
|
return response()->json($this->buildMikroskopisBtaSpReport($bulan, $tahun));
|
||||||
|
}
|
||||||
if ($jenisreport == 'biorepository'){
|
if ($jenisreport == 'biorepository'){
|
||||||
if ($bulan == 'ALL'){
|
if ($bulan == 'ALL'){
|
||||||
$queryBiorepo = DB::table('db_komponenjawaban')
|
$queryBiorepo = DB::table('db_komponenjawaban')
|
||||||
|
|||||||
@@ -72,6 +72,9 @@
|
|||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<button type="button" class="btn btn-primary btn-block" id="btnrekapzn">Rekap Ziehl Nielsen</button>
|
<button type="button" class="btn btn-primary btn-block" id="btnrekapzn">Rekap Ziehl Nielsen</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<button type="button" class="btn btn-secondary btn-block" id="btnmikroskopisbtasp">Mikroskopis BTA SP</button>
|
||||||
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<a href="{{url('/biorepository')}}" class="btn btn-danger btn-block">Biorepository Bakteri</a>
|
<a href="{{url('/biorepository')}}" class="btn btn-danger btn-block">Biorepository Bakteri</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -654,6 +657,20 @@ $(document).ready(function () {
|
|||||||
var url = '{{url('/')}}/znreport?bulan='+bulan+'?tahun='+tahun;
|
var url = '{{url('/')}}/znreport?bulan='+bulan+'?tahun='+tahun;
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
$('#btnmikroskopisbtasp').click(function () {
|
||||||
|
var bulan = document.getElementById('bulan').value;
|
||||||
|
var tahun = document.getElementById('tahun').value;
|
||||||
|
if (bulan == '' || tahun == ''){
|
||||||
|
swal({
|
||||||
|
title : 'Mohon diLengkapi',
|
||||||
|
text : 'Data Dasar Bulan dan Tahun Wajib di Isi',
|
||||||
|
type : 'error',
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
var url = '{{url('/')}}/mikroskopisbtasp?bulan='+bulan+'&tahun='+tahun;
|
||||||
|
window.location.href = url;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$('#btnrekaptat').click(function () {
|
$('#btnrekaptat').click(function () {
|
||||||
var bulan = document.getElementById('bulan').value;
|
var bulan = document.getElementById('bulan').value;
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
@extends('base.layout')
|
||||||
|
@section('content')
|
||||||
|
<style>
|
||||||
|
table {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="wrapper">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="card-box ribbon-box">
|
||||||
|
<div class="ribbon ribbon-primary">Mikroskopis BTA SP Laki-Laki 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>
|
||||||
|
<table cellpadding="0" cellspacing="0" id="btasptable" class="table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Nilai</th>
|
||||||
|
<th>Pagi</th>
|
||||||
|
<th>Sewaktu</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($nilaiList as $nilai)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $nilai }}</td>
|
||||||
|
<td>{{ $rekapLaki[$nilai]['pagi'] ?? 0 }}</td>
|
||||||
|
<td>{{ $rekapLaki[$nilai]['sewaktu'] ?? 0 }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="card-box ribbon-box">
|
||||||
|
<div class="ribbon ribbon-danger">Mikroskopis BTA SP Perempuan Bulan {{$bulan}} Tahun {{$tahun}}</div>
|
||||||
|
<p></p>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<button type="button" class="btn btn-primary" id="btnexportperempuan"><i class="fa fa-print"></i> Export</button>
|
||||||
|
<table cellpadding="0" cellspacing="0" id="btasptableperempuan" class="table table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Nilai</th>
|
||||||
|
<th>Pagi</th>
|
||||||
|
<th>Sewaktu</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($nilaiList as $nilai)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $nilai }}</td>
|
||||||
|
<td>{{ $rekapPerempuan[$nilai]['pagi'] ?? 0 }}</td>
|
||||||
|
<td>{{ $rekapPerempuan[$nilai]['sewaktu'] ?? 0 }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
@push('script')
|
||||||
|
<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('btasptable');
|
||||||
|
if (table) {
|
||||||
|
var wb = XLSX.utils.table_to_book(table, { sheet: "Report" });
|
||||||
|
XLSX.writeFile(wb, "mikroskopisbtasplakilaki_{{$bulan}}_Tahun{{$tahun}}.xlsx");
|
||||||
|
} else {
|
||||||
|
console.error('Tabel dengan ID "btasptable" tidak ditemukan.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
document.getElementById('btnexportperempuan').addEventListener('click', function() {
|
||||||
|
var table = document.getElementById('btasptableperempuan');
|
||||||
|
if (table) {
|
||||||
|
var wb = XLSX.utils.table_to_book(table, { sheet: "Report" });
|
||||||
|
XLSX.writeFile(wb, "mikroskopisbtaspperempuan_{{$bulan}}_Tahun{{$tahun}}.xlsx");
|
||||||
|
} else {
|
||||||
|
console.error('Tabel dengan ID "btasptableperempuan" tidak ditemukan.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
@@ -146,6 +146,7 @@ Route::group(['middleware' => 'project.ipg'], function() {
|
|||||||
Route::get('rekapantibiotik', [ReportController::class, 'genRekapAntibiotik']);
|
Route::get('rekapantibiotik', [ReportController::class, 'genRekapAntibiotik']);
|
||||||
Route::get('glassreport', [ReportController::class, 'genGlassReport']);
|
Route::get('glassreport', [ReportController::class, 'genGlassReport']);
|
||||||
Route::get('znreport', [ReportController::class, 'genZNreport']);
|
Route::get('znreport', [ReportController::class, 'genZNreport']);
|
||||||
|
Route::get('mikroskopisbtasp', [ReportController::class, 'genMikroskopisBtaSpReport']);
|
||||||
Route::get('tatreport', [ReportController::class, 'genTATreport']);
|
Route::get('tatreport', [ReportController::class, 'genTATreport']);
|
||||||
Route::get('reportpenerimaansample', [ReportController::class, 'genRekapPenerimaanSample']);
|
Route::get('reportpenerimaansample', [ReportController::class, 'genRekapPenerimaanSample']);
|
||||||
Route::post('reportpenerimaansample/mark-printed', [ReportController::class, 'markRekapPenerimaanSamplePrinted'])->name('markRekapPenerimaanSamplePrinted');
|
Route::post('reportpenerimaansample/mark-printed', [ReportController::class, 'markRekapPenerimaanSamplePrinted'])->name('markRekapPenerimaanSamplePrinted');
|
||||||
|
|||||||
Reference in New Issue
Block a user