diff --git a/htdocs/app/Http/Controllers/DokterController.php b/htdocs/app/Http/Controllers/DokterController.php index 613a9901..873468ba 100644 --- a/htdocs/app/Http/Controllers/DokterController.php +++ b/htdocs/app/Http/Controllers/DokterController.php @@ -1062,25 +1062,31 @@ class DokterController extends Controller if ($request->input('isi') != 0){ if ($request->input('komponen') == 'analis'){ $analis = $request->input('isi'); - $getnama = User::where('id', $analis)->first(); - Periksa::where('nofoto', $nofoto)->update([ - 'analis' => $analis, - 'nmanalis' => $getnama->nama ?? '' - ]); + if ($analis){ + $getnama = User::where('id', $analis)->first(); + Periksa::where('nofoto', $nofoto)->update([ + 'analis' => $analis, + 'nmanalis' => $getnama->nama ?? '' + ]); + } } else if ($request->input('komponen') == 'ppds3'){ $ppds3 = $request->input('isi'); - $getnama = User::where('id', $ppds3)->first(); - Periksa::where('nofoto', $nofoto)->update([ - 'ppdssenior' => $ppds3, - 'nmppdssenior' => $getnama->nama ?? '' - ]); + if ($ppds3){ + $getnama = User::where('id', $ppds3)->first(); + Periksa::where('nofoto', $nofoto)->update([ + 'ppdssenior' => $ppds3, + 'nmppdssenior' => $getnama->nama ?? '' + ]); + } } else { $dokter_id = $request->input('isi'); - $getnama = User::where('id', $dokter_id)->first(); - Periksa::where('nofoto', $nofoto)->update([ - 'dokter_id' => $dokter_id, - 'nmdokter' => $getnama->nama ?? '' - ]); + if ($dokter_id){ + $getnama = User::where('id', $dokter_id)->first(); + Periksa::where('nofoto', $nofoto)->update([ + 'dokter_id' => $dokter_id, + 'nmdokter' => $getnama->nama ?? '' + ]); + } } } else { if ($request->input('komponen') == 'analis'){ @@ -1406,6 +1412,62 @@ class DokterController extends Controller } return response()->json(['pesan' => $pesan, 'organism' => $organism]); return back(); + } else if ($worklist == 'generatetabelantibiotik'){ + $arraysurat = []; + $i = 0; + $data = new RekapAntibiotik(); + $limit = ($request->input('limit') == null ? '20' : $request->input('limit')); + $order = ($request->input('order') == null ? 'id asc' : $request->input('order')); + $data = $data->where('orderid', $nofoto); + $data = $data->orderByRaw($order)->paginate($limit); + $totaldata = $data->total(); + if ($data) { + foreach($data as $rows){ + $arraysurat[$i] = $rows; + $i++; + } + $response = [ + 'message' => 'List Data Antibiotik', + 'total' => $totaldata, + 'data' => $arraysurat + ]; + return response()->json($response, 200); + } + $response = [ + 'message' => 'No Data' + ]; + return response()->json($response, 500); + } else if ($worklist == 'printunprinttblantibiotik'){ + try { + if ($request->input('isi') == 'unprintrow'){ + RekapAntibiotik::where('id', $nofoto)->update([ + 'printrow' => false + ]); + } + if ($request->input('isi') == 'printrow'){ + RekapAntibiotik::where('id', $nofoto)->update([ + 'printrow' => true + ]); + } + if ($request->input('isi') == 'unprintmic'){ + RekapAntibiotik::where('id', $nofoto)->update([ + 'printcol'=> false + ]); + } + if ($request->input('isi') == 'printmic'){ + RekapAntibiotik::where('id', $nofoto)->update([ + 'printcol'=> true + ]); + } + + $pesan = 'Success'; + } catch (Exception $e) { + $pesan = $e->getMessage(); + Log::error('Gagal Arsipkan Data.', [ + 'message' => $e->getMessage(), + ]); + } + return $pesan; } else if ($worklist == 'getbbachtect' OR $worklist == 'getmgit' OR $worklist == 'getabbot'){ $isidata = $request->input('isi'); try { @@ -1585,17 +1647,8 @@ class DokterController extends Controller $tabelawal = $request->input('tabelawal'); $idtabel = $request->input('idtabel'); $setnilai = $request->input('setnilai'); - $cekada = explode('', $tabelawal); - $jumlahbaris= count($cekbaris); - $nomor = $jumlahbaris - 1; - } else { - $nomor = 1; - } $getdataawal = Periksa::where('nofoto', $nofoto)->first(); $orderid = $getdataawal->id ?? 0; - $tabel = ''; $getdata = SiraB::where('id', $idtabel)->first(); if (isset($getdata->id)){ $batasatas = $getdata->batasatas; @@ -1608,14 +1661,7 @@ class DokterController extends Controller } else { $setval = $batasbawah; } - if ($nomor == 1){ - $tabel = '
NoAntibiotikSubDisc ContentS/I/R
'.$nomor.''.$getdata->antibiotik.''.$getdata->subantibiotik.''.$getdata->diskcontent.''.$setnilai.'
'; - - } else { - $baris = ''.$nomor.''.$getdata->antibiotik.''.$getdata->subantibiotik.''.$getdata->diskcontent.''.$setnilai.''; - $tabel = str_replace('', $baris, $tabelawal); - $tabel = $tabel.''; - } + if ($orderid != 0){ if ($getdata->subantibiotik !== null && $getdata->subantibiotik != ''){ $antibiotik = $getdata->subantibiotik; @@ -1631,16 +1677,15 @@ class DokterController extends Controller 'resistance' => $getdata->diskcontent, 'value' => $setval, 'interpretation' => $setnilai, + 'printrow' => true, + 'printcol' => false, 'created_at' => $getdataawal->daftar ?? date('Y-m-d H:i:s'), 'updated_at' => $getdataawal->akhir ?? date('Y-m-d H:i:s'), ] ); } } - Periksa::where('nofoto', $nofoto)->update([ - 'keterangan' => $tabel - ]); - return $tabel; + return 'Success'; } else { $periksa = Periksa::where('id', $idperiksa)->first(); if (isset($periksa->id)){ diff --git a/htdocs/app/Http/Controllers/FrontpageController.php b/htdocs/app/Http/Controllers/FrontpageController.php index 9c33efb9..e9066fe0 100644 --- a/htdocs/app/Http/Controllers/FrontpageController.php +++ b/htdocs/app/Http/Controllers/FrontpageController.php @@ -265,7 +265,12 @@ class FrontpageController extends Controller } // Kembalikan view dengan data - return view('dokter.ppds', $data); + if (Session::get('previlage') == 'developer'){ + return view('dokter.ppdsdeveloper', $data); + } else { + return view('dokter.ppds', $data); + } + } public function pengambilan() { if (Session::get('previlage') == ''){ diff --git a/htdocs/app/Services/AstmMessageService.php b/htdocs/app/Services/AstmMessageService.php index 946afa3f..7151fa60 100644 --- a/htdocs/app/Services/AstmMessageService.php +++ b/htdocs/app/Services/AstmMessageService.php @@ -12,6 +12,7 @@ use App\DataListiner; use App\Periksa; use App\RekapAntibiotik; use App\PendaftaranOnListiner; +use App\Organisms; // Proses untuk Growth and Detection Result function processGrowthDetectionResult($rawData){ @@ -289,10 +290,11 @@ class AstmMessageService } else { if (!empty($mltrData)){ - $mulaikirim = 0; - $tanggalmasuk = ''; - $tanggalkeluar = ''; - $parsedData = [ + $mulaikirim = 0; + $tanggalmasuk = ''; + $tanggalkeluar = ''; + $organism = ''; + $parsedData = [ 'patient_info' => [], 'antibiotics' => [] ]; @@ -377,7 +379,8 @@ class AstmMessageService $resultSample->specimen_type = substr($field, 2); } if ($kodeduadigit == 'o2'){ - $resultSample->organism = substr($field, 2); + $organism = substr($field, 2); + $resultSample->organism = $organism; } if ($kodeduadigit == 's1'){ $tanggalmasuk = substr($field, 2); @@ -411,6 +414,41 @@ class AstmMessageService $resultSample->save(); if ($accession_number){ $accession_number = substr($accession_number, 0, 9); + if ($organism !== ''){ + $sudah = Organisms::where('name', $organism)->count(); + if ($sudah == 0){ + Organisms::create([ + 'kelompok' => 'biakankultur', + 'name' => $organism, + 'category' => 'Vitek', + ]); + } + } + $cekdataperiksa = Periksa::where('nofoto', $accession_number)->first(); + if (isset($cekdataperiksa->id)){ + if (is_array($parsedData['antibiotics'])) { + foreach ($parsedData['antibiotics'] as $item) { + $glassreportname = in_array($item['antibiotic_name'], $jsonantibiotik); + RekapAntibiotik::updateOrCreate( + [ + 'orderid' => $cekdataperiksa->id, + 'antibiotic' => $item['antibiotic_name'], + ], + [ + 'resistance' => $item['resistance_note'] ?? null, + 'value' => $item['value'] ?? null, + 'interpretation' => $item['interpretation'] ?? null, + 'glassreportname' => $glassreportname, + 'printrow' => true, + 'printcol' => false, + 'created_at' => date('Y-m-d H:i:s'), + 'updated_at' => date('Y-m-d H:i:s'), + ] + ); + } + } + } + Periksa::where('nofoto', $accession_number)->update([ 'status' => 'Data Vitek di Terima', ]); diff --git a/htdocs/resources/views/cetak/ekspertisecci.blade.php b/htdocs/resources/views/cetak/ekspertisecci.blade.php index ae0f2db4..7ed6b4c8 100644 --- a/htdocs/resources/views/cetak/ekspertisecci.blade.php +++ b/htdocs/resources/views/cetak/ekspertisecci.blade.php @@ -131,7 +131,76 @@ + @php + $cekketerangan = explode('/table', $keterangan); + @endphp + + @if (!isset($cekketerangan[1]) && isset($antibiotiks) && $antibiotiks->isNotEmpty()) + @php + // Filter antibiotik yang printrow == true + $filtered = $antibiotiks->filter(function($row) { + return $row->printrow; + })->values(); // reset index + + $total = $filtered->count(); + $half = ceil($total / 2); + $left = $filtered->slice(0, $half)->values(); + $right = $filtered->slice($half)->values(); + @endphp + + + + + + + + + + + + + + + + @for ($i = 0; $i < $half; $i++) + + {{-- Kolom kiri --}} + @if (isset($left[$i])) + + + @if (isset($left[$i]->printcol)) + + @else + + @endif + + @else + + @endif + + {{-- Spacer kolom tengah --}} + + {{-- Kolom kanan --}} + @if (isset($right[$i])) + + + @if (isset($right[$i]->printcol)) + + @else + + @endif + + @else + + @endif + + @endfor + +
NoAntibiotikValueInterpretation NoAntibiotikValueInterpretation
{{ $i + 1 }}{{ $left[$i]->antibiotic }}{{ $left[$i]->value }} {{ $left[$i]->interpretation }}  {{ $i + 1 + $half }}{{ $right[$i]->antibiotic }}{{ $right[$i]->value }} {{ $right[$i]->interpretation }} 
+ @endif + @if ($keterangan != '') + Komentar:
{!! $keterangan !!} @endif diff --git a/htdocs/resources/views/cetak/ekspertisedefault.blade.php b/htdocs/resources/views/cetak/ekspertisedefault.blade.php index f7f0425c..b5ffaecc 100644 --- a/htdocs/resources/views/cetak/ekspertisedefault.blade.php +++ b/htdocs/resources/views/cetak/ekspertisedefault.blade.php @@ -83,7 +83,79 @@     -   + + + @php + $cekketerangan = explode('/table', $keterangan); + @endphp + + @if (!isset($cekketerangan[1]) && isset($antibiotiks) && $antibiotiks->isNotEmpty()) + @php + // Filter antibiotik yang printrow == true + $filtered = $antibiotiks->filter(function($row) { + return $row->printrow; + })->values(); // reset index + + $total = $filtered->count(); + $half = ceil($total / 2); + $left = $filtered->slice(0, $half)->values(); + $right = $filtered->slice($half)->values(); + @endphp + + + + + + + + + + + + + + + + + @for ($i = 0; $i < $half; $i++) + + {{-- Kolom kiri --}} + @if (isset($left[$i])) + + + @if (isset($left[$i]->printcol)) + + @else + + @endif + + @else + + @endif + + {{-- Spacer kolom tengah --}} + + {{-- Kolom kanan --}} + @if (isset($right[$i])) + + + @if (isset($right[$i]->printcol)) + + @else + + @endif + + @else + + @endif + + @endfor + +
NoAntibiotikValueInterpretation NoAntibiotikValueInterpretation
{{ $i + 1 }}{{ $left[$i]->antibiotic }}{{ $left[$i]->value }} {{ $left[$i]->interpretation }}  {{ $i + 1 + $half }}{{ $right[$i]->antibiotic }}{{ $right[$i]->value }} {{ $right[$i]->interpretation }} 
+ @endif + + +   diff --git a/htdocs/resources/views/cetak/ekspertisekultur.blade.php b/htdocs/resources/views/cetak/ekspertisekultur.blade.php index 3589e1ad..2350b990 100644 --- a/htdocs/resources/views/cetak/ekspertisekultur.blade.php +++ b/htdocs/resources/views/cetak/ekspertisekultur.blade.php @@ -9,12 +9,14 @@ @php $data = []; + $keterangan = $periksa->keterangan; $data['keterangan'] = $periksa->keterangan; if (!empty($komponens)) { foreach ($komponens as $rows) { $key = trim($rows->komponen); if (!empty($key)) { if ($key == 'keterangan') { + } else { $data[$key] = $rows->isidata; } @@ -357,6 +359,75 @@ @endif + @php + $cekketerangan = explode('/table', $keterangan); + @endphp + + @if (!isset($cekketerangan[1]) && isset($antibiotiks) && $antibiotiks->isNotEmpty()) + @php + // Filter antibiotik yang printrow == true + $filtered = $antibiotiks->filter(function($row) { + return $row->printrow; + })->values(); // reset index + + $total = $filtered->count(); + $half = ceil($total / 2); + $left = $filtered->slice(0, $half)->values(); + $right = $filtered->slice($half)->values(); + @endphp + + + + + + + + + + + + + + + + + @for ($i = 0; $i < $half; $i++) + + {{-- Kolom kiri --}} + @if (isset($left[$i])) + + + @if (isset($left[$i]->printcol)) + + @else + + @endif + + @else + + @endif + + {{-- Spacer kolom tengah --}} + + {{-- Kolom kanan --}} + @if (isset($right[$i])) + + + @if (isset($right[$i]->printcol)) + + @else + + @endif + + @else + + @endif + + @endfor + +
NoAntibiotikValueInterpretation NoAntibiotikValueInterpretation
{{ $i + 1 }}{{ $left[$i]->antibiotic }}{{ $left[$i]->value }} {{ $left[$i]->interpretation }}  {{ $i + 1 + $half }}{{ $right[$i]->antibiotic }}{{ $right[$i]->value }} {{ $right[$i]->interpretation }} 
+ @endif + @if (isset($data['keterangan'])) @php if (isset($data['id_kbamc'])){ diff --git a/htdocs/resources/views/cetak/ekspertisepl.blade.php b/htdocs/resources/views/cetak/ekspertisepl.blade.php index a2124c1c..8f96408a 100644 --- a/htdocs/resources/views/cetak/ekspertisepl.blade.php +++ b/htdocs/resources/views/cetak/ekspertisepl.blade.php @@ -211,6 +211,75 @@ @endif + @php + $cekketerangan = explode('/table', $keterangan); + @endphp + + @if (!isset($cekketerangan[1]) && isset($antibiotiks) && $antibiotiks->isNotEmpty()) + @php + // Filter antibiotik yang printrow == true + $filtered = $antibiotiks->filter(function($row) { + return $row->printrow; + })->values(); // reset index + + $total = $filtered->count(); + $half = ceil($total / 2); + $left = $filtered->slice(0, $half)->values(); + $right = $filtered->slice($half)->values(); + @endphp + + + + + + + + + + + + + + + + + @for ($i = 0; $i < $half; $i++) + + {{-- Kolom kiri --}} + @if (isset($left[$i])) + + @if (isset($left[$i]->printcol)) + + @else + + @endif + + + @else + + @endif + + {{-- Spacer kolom tengah --}} + + {{-- Kolom kanan --}} + @if (isset($right[$i])) + + + @if (isset($right[$i]->printcol)) + + @else + + @endif + + @else + + @endif + + @endfor + +
NoAntibiotikValueInterpretation NoAntibiotikValueInterpretation
{{ $i + 1 }}{{ $left[$i]->value }} {{ $left[$i]->value }}{{ $left[$i]->interpretation }}  {{ $i + 1 + $half }}{{ $right[$i]->antibiotic }}{{ $right[$i]->value }} {{ $right[$i]->interpretation }} 
+ @endif + @if ($keterangan != '') Komentar:
{!! $keterangan !!} @endif diff --git a/htdocs/resources/views/cetak/ekspertisevl.blade.php b/htdocs/resources/views/cetak/ekspertisevl.blade.php index e0f93f6d..e0ff1752 100644 --- a/htdocs/resources/views/cetak/ekspertisevl.blade.php +++ b/htdocs/resources/views/cetak/ekspertisevl.blade.php @@ -9,7 +9,7 @@ @php $data = []; $data['keterangan'] = $periksa->keterangan; - + $keterangan = $periksa->keterangan; if (!empty($komponens)) { foreach ($komponens as $rows) { $key = trim($rows->komponen); @@ -169,6 +169,75 @@ + @php + $cekketerangan = explode('/table', $keterangan); +@endphp + +@if (!isset($cekketerangan[1]) && isset($antibiotiks) && $antibiotiks->isNotEmpty()) + @php + // Filter antibiotik yang printrow == true + $filtered = $antibiotiks->filter(function($row) { + return $row->printrow; + })->values(); // reset index + + $total = $filtered->count(); + $half = ceil($total / 2); + $left = $filtered->slice(0, $half)->values(); + $right = $filtered->slice($half)->values(); + @endphp + + + + + + + + + + + + + + + + + @for ($i = 0; $i < $half; $i++) + + {{-- Kolom kiri --}} + @if (isset($left[$i])) + + + @if (isset($left[$i]->printcol)) + + @else + + @endif + + @else + + @endif + + {{-- Spacer kolom tengah --}} + + {{-- Kolom kanan --}} + @if (isset($right[$i])) + + + @if (isset($right[$i]->printcol)) + + @else + + @endif + + @else + + @endif + + @endfor + +
NoAntibiotikValueInterpretation NoAntibiotikValueInterpretation
{{ $i + 1 }}{{ $left[$i]->antibiotic }}{{ $left[$i]->value }} {{ $left[$i]->interpretation }}  {{ $i + 1 + $half }}{{ $right[$i]->antibiotic }}{{ $right[$i]->value }} {{ $right[$i]->interpretation }} 
+@endif + Komentar:
@if (isset($data['viralload'])) {!! $data['viralload'] !!} diff --git a/htdocs/resources/views/dokter/pemeriksaan.blade.php b/htdocs/resources/views/dokter/pemeriksaan.blade.php index 58b72e69..493c40a9 100644 --- a/htdocs/resources/views/dokter/pemeriksaan.blade.php +++ b/htdocs/resources/views/dokter/pemeriksaan.blade.php @@ -1872,9 +1872,11 @@
+ @@ -1891,18 +1893,39 @@ SIR Ab
+
+ + + + + + + + + + + + + +
Print AntibiotikValueInterpretationPrint Value.?
+
+
-
- - - - +
+
+ + +
+
+ + +
@@ -2149,6 +2172,34 @@ @push('script') +@endpush