This commit is contained in:
Duidev Software House
2025-10-14 07:59:56 +07:00
parent 684705b383
commit 5d172ab337
12 changed files with 576 additions and 322 deletions
@@ -1065,21 +1065,21 @@ class DokterController extends Controller
$getnama = User::where('id', $analis)->first();
Periksa::where('nofoto', $nofoto)->update([
'analis' => $analis,
'nmanalis' => $getnama->nama
'nmanalis' => $getnama->nama ?? ''
]);
} else if ($request->input('komponen') == 'ppds3'){
$ppds3 = $request->input('isi');
$getnama = User::where('id', $ppds3)->first();
Periksa::where('nofoto', $nofoto)->update([
'ppds3' => $ppds3,
'nmppdssenior' => $getnama->nama
'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
'nmdokter' => $getnama->nama ?? ''
]);
}
} else {
@@ -1091,7 +1091,7 @@ class DokterController extends Controller
]);
} else if ($request->input('komponen') == 'ppds3'){
Periksa::where('nofoto', $nofoto)->update([
'ppds3' => 0,
'ppdssenior' => 0,
'nmppdssenior' => '',
'nmdrafter' => Session('nama'),
]);
@@ -1254,11 +1254,60 @@ class DokterController extends Controller
$ketemu = '';
$organism = '';
$nomor = 1;
$jsonantibiotik = array(
'Oxacillin-OX',
'Cefoxitin-FOX',
'Benzylpenicillin-P',
'Ampicillin-AM',
'Azithromycin-AZM',
'Erythromycin-ERY',
'Cefazolin-CZO',
'Cefepime-FEP',
'Cefixime-CFM',
'Cefotaxime-CTX',
'Cefuroxime-CXM',
'Ceftazidime-CAZ',
'Ceftriaxone-CRO',
'Ceftazidime/Avibactam-CZA',
'Piperacilin/Tazobactam-TZP',
'Ampicillin/Sulbactam-SAM',
'Amoxicillin/Clavulanate-AMC',
'Cefoperazon/Sulbactam-SCF',
'Aztreonam-ATM',
'Ceftaroline-CPT',
'Ciprofloxacin-CIP',
'Levofloxacin-LEV',
'Moxifloxacin-MFX',
'Clindamycin-CLI',
'Colistin-CS',
'Tetracyclin-TCY',
'Tigecycline-TGC',
'Gentamicin-GM',
'Amikacin-AN',
'Meropenem-MEM',
'Imipenem-IPM',
'Doripenem-DOR',
'Ertapenem-ETP',
'Minocycline-MNO',
'Doxycycline-DOX',
'Spectinomycin-SPT',
'Tigecycline-TGC',
'Trimethoprim/Sulfamethoxazole-SXT',
'Fosfomycin-FOS',
'Vancomycin-VAN',
'Linezolid-LNZ',
'Fluconazole',
'Voriconazole',
'Caspofungin',
'Micafungin',
'Amphotericin B',
'Flucytosine'
);
try {
$cekada = ResultSample::where('accession_number', 'LIKE', $nofoto.'%')->get();
if (!empty($cekada)){
foreach($cekada as $rows){
$jsondata = $rows->additional_result;
if ($rows->organism !== null){
$organism = $rows->organism;
$sudah = Organisms::where('name', $organism)->count();
@@ -1270,6 +1319,33 @@ class DokterController extends Controller
]);
}
}
if (!empty($rows->additional_result)) {
$firstDecode = json_decode($rows->additional_result, true);
if (is_string($firstDecode)) {
$data = json_decode($firstDecode, true);
} else {
$data = $firstDecode;
}
if (is_array($data)) {
foreach ($data as $item) {
$glassreportname = in_array($item['antibiotic_name'], $jsonantibiotik);
RekapAntibiotik::updateOrCreate(
[
'orderid' => $orderid,
'antibiotic' => $item['antibiotic_name'],
],
[
'resistance' => $item['resistance_note'] ?? null,
'value' => $item['value'] ?? null,
'interpretation' => $item['interpretation'] ?? null,
'glassreportname' => $glassreportname,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]
);
}
}
}
}
}
$gentabel = RekapAntibiotik::where('orderid', $orderid)->get();
@@ -1307,6 +1383,8 @@ class DokterController extends Controller
]
);
}
} else {
}
if ($isidata == '' OR is_null($isidata)){
} else {