This commit is contained in:
Duidev Software House
2025-10-17 12:18:18 +07:00
parent 53564306e0
commit 90ab13dafd
11 changed files with 5095 additions and 207 deletions
@@ -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('</table', $tabelawal);
if (isset($cekada[1])){
$cekbaris = explode('</tr>', $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 = '<table border="1" cellpadding="0" cellspacing="0" width="80%"><tr><td style="text-align:center;" width="5%"><strong>No</strong></td><td style="text-align:center;" width="20%"><strong>Antibiotik</strong></td><td style="text-align:center;" width="20%"><strong>Sub</strong></td><td style="text-align:center;" width="10%"><strong>Disc Content</strong></td><td style="text-align:center;" width="5%"><strong>S/I/R</strong></td></tr><tr><td style="text-align:center;">'.$nomor.'</td><td>'.$getdata->antibiotik.'</td><td>'.$getdata->subantibiotik.'</td><td style="text-align:center;">'.$getdata->diskcontent.'</td><td style="text-align:center;">'.$setnilai.'</td></tr></table>';
} else {
$baris = '<tr><td style="text-align:center;">'.$nomor.'</td><td>'.$getdata->antibiotik.'</td><td>'.$getdata->subantibiotik.'</td><td style="text-align:center;">'.$getdata->diskcontent.'</td><td style="text-align:center;">'.$setnilai.'</td></tr>';
$tabel = str_replace('</table>', $baris, $tabelawal);
$tabel = $tabel.'</table>';
}
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)){
@@ -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') == ''){
+43 -5
View File
@@ -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',
]);