Compare commits
10
Commits
duidev
..
2ccdb4f969
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ccdb4f969 | ||
|
|
214b9c82f2 | ||
|
|
912c6c03e3 | ||
|
|
40b3d5d1b8 | ||
|
|
b6679233ea | ||
|
|
96f1d12450 | ||
|
|
27064a1f7e | ||
|
|
ffddee22df | ||
|
|
4bb265e4f1 | ||
|
|
1399f1a2f3 |
No files matched your search
@@ -0,0 +1,59 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=laravel
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_HOST=mailpit
|
||||
MAIL_PORT=1025
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS="[email protected]"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
PUSHER_APP_ID=
|
||||
PUSHER_APP_KEY=
|
||||
PUSHER_APP_SECRET=
|
||||
PUSHER_HOST=
|
||||
PUSHER_PORT=443
|
||||
PUSHER_SCHEME=https
|
||||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
VITE_PUSHER_HOST="${PUSHER_HOST}"
|
||||
VITE_PUSHER_PORT="${PUSHER_PORT}"
|
||||
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
|
||||
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
# Ignore environment files
|
||||
|
||||
mergekemain.sh
|
||||
# Ignore Laravel cache, logs, and storage
|
||||
/htdocs/storage/*
|
||||
/database
|
||||
!/htdocs/storage/.gitignore
|
||||
/htdocs/.env
|
||||
# Ignore bootstrap cache
|
||||
/htdocs/bootstrap/cache/*
|
||||
/htdocs/listenerlis/listener.log
|
||||
/htdocs/listenerlis/tcp_raw_data.bin
|
||||
.env
|
||||
!/htdocs/bootstrap/cache/.gitignore
|
||||
+1
-1
@@ -22,7 +22,7 @@ class ProcessAstmMessages extends Command
|
||||
public function handle()
|
||||
{
|
||||
// Ambil data dari DataListener
|
||||
$dataListener = DataListiner::where('processed', '0')->orderBy('created_at', 'DESC')->get();
|
||||
$dataListener = DataListiner::whereNull('processed')->get();
|
||||
if ($dataListener) {
|
||||
$jumlah = count($dataListener);
|
||||
$pesan = $this->astmMessageService->processAstmMessages($dataListener);
|
||||
+94
-336
@@ -6,6 +6,7 @@ use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use App\Http\Controllers\SendMail;
|
||||
use App\Services\AstmMessageService;
|
||||
|
||||
use App\Poli;
|
||||
use App\Periksa;
|
||||
use App\DataListiner;
|
||||
@@ -51,11 +52,6 @@ define( 'API_ACCESS_KEY', 'AAAA6YBXh1k:APA91bFL0q7QAXQGohXMpTwHco79f13C8PFk1Oo8k
|
||||
|
||||
class DokterController extends Controller
|
||||
{
|
||||
protected $lisServiceUrl;
|
||||
public function __construct()
|
||||
{
|
||||
$this->lisServiceUrl = env('LIS_SERVICE_URL', 'http://localhost:5000');
|
||||
}
|
||||
protected static function genSurat($id, $tabel){
|
||||
if ($tabel == 'dengan kop'){
|
||||
$kopsurat = url('/templateimage/kopsurat.png');
|
||||
@@ -135,7 +131,6 @@ class DokterController extends Controller
|
||||
$data['periksa'] = $periksa;
|
||||
$data['keterangan'] = $keterangan;
|
||||
$data['tandatangananalis'] = $tandatangananalis;
|
||||
$data['ttdanalis'] = $tandatangananalis;
|
||||
$data['tandatangan'] = $tandatangan;
|
||||
$data['ppds'] = $ppds;
|
||||
$data['kopsurat'] = $kopsurat;
|
||||
@@ -179,75 +174,63 @@ class DokterController extends Controller
|
||||
public function reportppds() {
|
||||
$previlage = Session('previlage');
|
||||
if ($previlage == 'developer' OR $previlage == 'supervisor') {
|
||||
$data = [
|
||||
'dokters' => User::where('previlage', 'supervisor')->get(),
|
||||
'allppds' => User::where('previlage', 'ppds')->get(),
|
||||
'allanalis' => User::where('previlage', 'analis')->get(),
|
||||
'lokasi' => 'Lab Mikrobiologi',
|
||||
'master' => 'mikro',
|
||||
'antrkrmsitu' => 0,
|
||||
];
|
||||
$allOrganisms = Organisms::orderBy('name', 'ASC')->get();
|
||||
$groupOrganisms = function ($kelompok) use ($allOrganisms) {
|
||||
$organisms = $allOrganisms->where('kelompok', $kelompok);
|
||||
if ($organisms->isEmpty()) {
|
||||
return [
|
||||
'organismes' => [[['id' => 0, 'name' => 'No Data']]],
|
||||
'categories' => ['No Data'],
|
||||
];
|
||||
$data = [];
|
||||
$dokters = User::where('previlage', 'supervisor')->get();
|
||||
$allppds = User::where('previlage', 'ppds')->get();
|
||||
$allanalis = User::where('previlage', 'analis')->get();
|
||||
$organismslis = Organisms::where('kelompok', 'biakankultur')->groupBy('category')->select('category')->get();
|
||||
$i = 0;
|
||||
foreach ($organismslis as $rorganisme) {
|
||||
$j = 0;
|
||||
$category = $rorganisme->category;
|
||||
$rooms = Organisms::where('kelompok', 'biakankultur')->where('category', $category)->orderBy('name', 'ASC')->get();
|
||||
foreach ($rooms as $room) {
|
||||
$data['organismes'][$i][$j]['id'] = $room->id;
|
||||
$data['organismes'][$i][$j]['name'] = $room->name;
|
||||
$j++;
|
||||
}
|
||||
$grouped = $organisms->groupBy('category');
|
||||
$organismes = [];
|
||||
$categories = [];
|
||||
$i = 0;
|
||||
foreach ($grouped as $category => $items) {
|
||||
$categories[] = $category;
|
||||
$j = 0;
|
||||
foreach ($items as $item) {
|
||||
$organismes[$i][$j] = ['id' => $item->id, 'name' => $item->name];
|
||||
$j++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
return [
|
||||
'organismes' => $organismes,
|
||||
'categories' => $categories,
|
||||
];
|
||||
};
|
||||
$biakankulturData = $groupOrganisms('biakankultur');
|
||||
$mikroorganismeData = $groupOrganisms('mikroorganisme');
|
||||
|
||||
// Gabungkan data
|
||||
$data = array_merge($data, [
|
||||
'organismes' => $biakankulturData['organismes'],
|
||||
'bacterycateggories' => $biakankulturData['categories'],
|
||||
'mikroorganismes' => $mikroorganismeData['organismes'],
|
||||
'mikroorganismestlist' => $mikroorganismeData['categories'],
|
||||
]);
|
||||
$kelompokMapping = [
|
||||
'jsonsputum' => 'Sputum',
|
||||
'jsonswabtenggorok' => 'Swab Tenggorok',
|
||||
'jsonurine' => 'Urine',
|
||||
'jsonswabperineum' => 'Swab perineum',
|
||||
'jsonselepitel' => 'Sel Epitel',
|
||||
'jsonselradang' => 'Sel Radang',
|
||||
'jsonmikroorganisme' => 'Q Mikroorganisme',
|
||||
'jsonjumlahlactobacillus' => 'Lactobacillus',
|
||||
'jsonjumlahgardnerella' => 'Gardnerella',
|
||||
'jsonjumlahmobiluncus' => 'Mobiluncus',
|
||||
'jsonpewarnaanziehlnielsen' => 'Pewarnaan Ziehl Nielsen',
|
||||
'jsonpewarnaanneisser' => 'Pewarnaan Neisser',
|
||||
'jsonpewarnaannegatif' => 'Pewarnaan Negatif',
|
||||
'jsonpewarnaanspora' => 'Pewarnaan Spora',
|
||||
'jsonmediabap' => 'Media BAP',
|
||||
'jsonmediacap' => 'Media CAP',
|
||||
'jsonmediamcconkey' => 'Media Mc Conkey',
|
||||
'jsonpemeriksaantl' => 'Pemeriksaan Tambahan Lainnya',
|
||||
'jsonbiakankultur' => 'Biakan Kultur',
|
||||
];
|
||||
foreach ($kelompokMapping as $key => $kelompok) {
|
||||
$data[$key] = $allOrganisms->where('kelompok', $kelompok)->values();
|
||||
$i++;
|
||||
}
|
||||
$x = 0;
|
||||
foreach ($organismslis as $rows) {
|
||||
$data['bacterycateggories'][$x] = $rows->category;
|
||||
$x++;
|
||||
}
|
||||
if ($x == 0){
|
||||
$data['organismes'][0][0]['id'] = 0;
|
||||
$data['organismes'][0][0]['name'] = 'No Data';
|
||||
$data['bacterycateggories'][0] = 'No Data';
|
||||
}
|
||||
$mikroorganismelist = Organisms::where('kelompok', 'mikroorganisme')->groupBy('category')->select('category')->get();
|
||||
$i = 0;
|
||||
foreach ($mikroorganismelist as $rorganisme) {
|
||||
$j = 0;
|
||||
$category = $rorganisme->category;
|
||||
$rooms = Organisms::where('kelompok', 'mikroorganisme')->where('category', $category)->orderBy('name', 'ASC')->get();
|
||||
foreach ($rooms as $room) {
|
||||
$data['mikroorganismes'][$i][$j]['id'] = $room->id;
|
||||
$data['mikroorganismes'][$i][$j]['name'] = $room->name;
|
||||
$j++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$x = 0;
|
||||
foreach ($mikroorganismelist as $rows) {
|
||||
$data['mikroorganismestlist'][$x] = $rows->category;
|
||||
$x++;
|
||||
}
|
||||
if ($x == 0){
|
||||
$data['mikroorganismes'][0][0]['id'] = 0;
|
||||
$data['mikroorganismes'][0][0]['name'] = 'No Data';
|
||||
$data['mikroorganismestlist'][0] = 'No Data';
|
||||
}
|
||||
$data['allppds'] = $allppds;
|
||||
$data['dokters'] = $dokters;
|
||||
$data['allanalis'] = $allanalis;
|
||||
$data['antrkrmsitu']= PeriksaSYNC::where('created_by', Session('username'))->where('status', '')->count();
|
||||
$data['lokasi'] = 'Lab Mikrobiologi';
|
||||
$data['master'] = 'mikro';
|
||||
$previlage = Session('previlage');
|
||||
return view('dokter.pemeriksaan', $data);
|
||||
} else {
|
||||
$data = [];
|
||||
@@ -495,7 +478,7 @@ class DokterController extends Controller
|
||||
'nmppdssenior' => $cekppds3->nama ?? null,
|
||||
'nmexcutor' => Session('nama'),
|
||||
'excutor' => Session('id'),
|
||||
'status' => 'Proses Analisis Sampel'
|
||||
'status' => 'Draft Saved'
|
||||
]);
|
||||
return response()->json(['icon' => 'success', 'status' => 'Success', 'message' => 'Expertise Saved']);
|
||||
}
|
||||
@@ -586,8 +569,8 @@ class DokterController extends Controller
|
||||
'modality' => $modality,
|
||||
'jumlah' => $jumlah,
|
||||
'foto' => $tanggal,
|
||||
'nmanalis' => Session('nama'),
|
||||
'analis' => Session('id'),
|
||||
'nmradiografer' => Session('nama'),
|
||||
'radiografer' => Session('id'),
|
||||
]);
|
||||
} else {
|
||||
Periksa::where('id', $idperiksa)->update([
|
||||
@@ -600,8 +583,8 @@ class DokterController extends Controller
|
||||
'dlp' => $dlp,
|
||||
'modality' => $modality,
|
||||
'jumlah' => $jumlah,
|
||||
'analis' => Session('id'),
|
||||
'nmanalis' => Session('nama'),
|
||||
'radiografer' => Session('id'),
|
||||
'nmradiografer' => Session('nama'),
|
||||
'foto' => $tanggal,
|
||||
'status' => 'Telah di kirim ke worklist/modalitas',
|
||||
'excutor' => null,
|
||||
@@ -873,128 +856,6 @@ class DokterController extends Controller
|
||||
$pesan = $e->getMessage();
|
||||
}
|
||||
return $pesan;
|
||||
} else if ($worklist == 'isandasar'){
|
||||
try {
|
||||
$dokter_id = 0;
|
||||
$analis = 0;
|
||||
$ppds3 = 0;
|
||||
$nmanalis = '';
|
||||
$nmdokter = '';
|
||||
$nmppdssenior = '';
|
||||
if ($request->input('komponen') == 'analis' OR $request->input('komponen') == 'ppds3' OR $request->input('komponen') == 'dokter'){
|
||||
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
|
||||
]);
|
||||
} 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
|
||||
]);
|
||||
} 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
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
if ($request->input('komponen') == 'analis'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'analis' => 0,
|
||||
'nmanalis' => '',
|
||||
'nmdrafter' => Session('nama'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'ppds3'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'ppds3' => 0,
|
||||
'nmppdssenior' => '',
|
||||
'nmdrafter' => Session('nama'),
|
||||
]);
|
||||
} else {
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'dokter_id' => 0,
|
||||
'nmdokter' => '',
|
||||
'nmdrafter' => Session('nama'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
} else if ($request->input('komponen') == 'klinis'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'klinis' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'bhp_media'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_media' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'bhp_potsputum'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_potsputum' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'bhp_poturine'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_poturine' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'bhp_oshe'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_oshe' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'bhp_obyekglass'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_obyekglass' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'bhp_botolbd'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_botolbd' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'bhp_parafilm'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_parafilm' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'bhp_tips'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_tips' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'bhp_cottonswab'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_cottonswab' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'id_esbl'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'id_esbl' => $request->input('isi'),
|
||||
]);
|
||||
} else if ($request->input('komponen') == 'id_mrsa'){
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'id_mrsa' => $request->input('isi'),
|
||||
]);
|
||||
} else {
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'bhp_antibiotiktambahan' => $request->input('isi'),
|
||||
]);
|
||||
}
|
||||
KomponenJawaban::updateOrCreate(
|
||||
[
|
||||
'accnumber' => $nofoto,
|
||||
'template' => $request->input('jenis'),
|
||||
'komponen' => $request->input('komponen'),
|
||||
],
|
||||
[
|
||||
'isidata' => $request->input('isi'),
|
||||
'created_by' => Session('nama')
|
||||
]
|
||||
);
|
||||
$pesan = $nofoto.' Saved '.$request->input('jenis');
|
||||
} catch (Exception $e) {
|
||||
$pesan = $e->getMessage();
|
||||
}
|
||||
return $pesan;
|
||||
} else if ($worklist == 'mappingalat'){
|
||||
try {
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
@@ -1080,7 +941,6 @@ class DokterController extends Controller
|
||||
]);
|
||||
}
|
||||
}
|
||||
$jsondata = json_decode($jsondata, true);
|
||||
if(is_array($jsondata) && count($jsondata) > 0){
|
||||
foreach ($jsondata as $item){
|
||||
RekapAntibiotik::updateOrCreate(
|
||||
@@ -1092,8 +952,6 @@ class DokterController extends Controller
|
||||
'resistance' => $item['resistance'],
|
||||
'value' => $item['value'],
|
||||
'interpretation' => $item['interpretation'],
|
||||
'created_at' => $getdataawal->daftar ?? date('Y-m-d H:i:s'),
|
||||
'updated_at' => $getdataawal->akhir ?? date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -1103,9 +961,9 @@ class DokterController extends Controller
|
||||
$gentabel = RekapAntibiotik::where('orderid', $orderid)->get();
|
||||
if (!empty($gentabel)){
|
||||
$nomor = 1;
|
||||
$isidata = $isidata.'<br /><table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td width="5%"><strong>No</strong></td><td width="65%"><strong>Antibiotik</strong></td><td width="15%"><strong>Value</strong></td><td width="15%"><strong>S/I/R</strong></td></tr>';
|
||||
$isidata = '<table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td width="5%"><strong>No</strong></td><td width="65%"><strong>Antibiotik</strong></td><td width="15%"><strong>Value</strong></td><td width="15%"><strong>S/I/R</strong></td></tr>';
|
||||
foreach($gentabel as $rtabel){
|
||||
$isidata = $isidata.'<tr><td>'.$nomor.'</td><td>'.$rtabel->resistance.'</td><td>'.$rtabel->value.'</td><td>'.$rtabel->interpretation.'</td></tr>';
|
||||
$isidata = $isidata.'<tr><td>'.$nomor.'</td><td>'.$rtabel->antibiotic.'</td<td>'.$rtabel->value.'</td><td>'.$rtabel->interpretation.'</td></tr>';
|
||||
$nomor++;
|
||||
}
|
||||
$isidata = $isidata.'</table>';
|
||||
@@ -1133,7 +991,7 @@ class DokterController extends Controller
|
||||
}
|
||||
return response()->json(['pesan' => $pesan, 'organism' => $organism]);
|
||||
return back();
|
||||
} else if ($worklist == 'getbbachtect' OR $worklist == 'getmgit' OR $worklist == 'getabbot'){
|
||||
} else if ($worklist == 'getbbachtect' OR $worklist == 'getmgit' OR $worklist == 'getgenexpert' OR $worklist == 'getabbot'){
|
||||
$isidata = $request->input('isi');
|
||||
try {
|
||||
$ketemu = '';
|
||||
@@ -1172,67 +1030,6 @@ class DokterController extends Controller
|
||||
$pesan = $isidata.'<br />'.$e->getMessage();
|
||||
}
|
||||
return $pesan;
|
||||
} else if ($worklist == 'getgenexpert'){
|
||||
$isidata = $request->input('isi');
|
||||
try {
|
||||
$ketemu = '';
|
||||
$cekada = ResultSample::where('accession_number', 'LIKE', $nofoto.'%')->get();
|
||||
if ($cekada->isNotEmpty()){
|
||||
foreach($cekada as $rows){
|
||||
$ketemu .= ($ketemu ? '<br />' : '') . $rows->test_status;
|
||||
}
|
||||
} else {
|
||||
$payload = [
|
||||
'command' => 'request_result',
|
||||
'data' => [
|
||||
'sample_id' => $nofoto
|
||||
],
|
||||
];
|
||||
$response = Http::timeout(30)->post($this->lisServiceUrl . '/command', $payload);
|
||||
if ($response->successful()) {
|
||||
Log::info('Permintaan hasil berhasil dikirim ke LIS service.', [
|
||||
'sample_id' => $nofoto,
|
||||
'response' => $response->json()
|
||||
]);
|
||||
} else {
|
||||
Log::error('Gagal terhubung ke LIS service saat meminta hasil.', [
|
||||
'sample_id' => $nofoto,
|
||||
'status' => $response->status(),
|
||||
'body' => $response->body()
|
||||
]);
|
||||
}
|
||||
}
|
||||
if ($ketemu != ''){
|
||||
if (is_null($isidata) || $isidata == ''){
|
||||
$isidata = $ketemu;
|
||||
} else {
|
||||
$isidata = $isidata.'<br />'.$ketemu;
|
||||
}
|
||||
}
|
||||
if (!is_null($isidata) && $isidata != ''){
|
||||
KomponenJawaban::updateOrCreate(
|
||||
[
|
||||
'accnumber' => $nofoto,
|
||||
'template' => $request->input('jenis'),
|
||||
'komponen' => $request->input('komponen'),
|
||||
],
|
||||
[
|
||||
'isidata' => $isidata,
|
||||
'created_by' => Session('nama')
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$pesan = $isidata;
|
||||
|
||||
} catch (Exception $e) {
|
||||
$pesan = (is_null($isidata) ? '' : $isidata . '<br />') . 'Error: ' . $e->getMessage();
|
||||
Log::error('Exception dalam fungsi requestResult.', [
|
||||
'sample_id' => $nofoto,
|
||||
'exception' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
return response($pesan, 200);
|
||||
} else if ($worklist == 'addviralload'){
|
||||
$tabelawal = $request->input('tabelawal');
|
||||
$idtabel = $request->input('idtabel');
|
||||
@@ -1269,22 +1066,15 @@ class DokterController extends Controller
|
||||
$tabel = $tabel.'</table>';
|
||||
}
|
||||
if ($orderid != 0){
|
||||
if ($getdata->subantibiotik !== null && $getdata->subantibiotik != ''){
|
||||
$antibiotik = $getdata->subantibiotik;
|
||||
} else {
|
||||
$antibiotik = $getdata->antibiotik;
|
||||
}
|
||||
RekapAntibiotik::updateOrCreate(
|
||||
[
|
||||
'orderid' => $orderid,
|
||||
'antibiotic' => $antibiotik,
|
||||
'antibiotic' => $getdata->antibiotik.' '.$getdata->subantibiotik,
|
||||
],
|
||||
[
|
||||
'resistance' => $getdata->diskcontent,
|
||||
'value' => $setval,
|
||||
'interpretation' => $setnilai,
|
||||
'created_at' => $getdataawal->daftar ?? date('Y-m-d H:i:s'),
|
||||
'updated_at' => $getdataawal->akhir ?? date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -1329,30 +1119,23 @@ class DokterController extends Controller
|
||||
$setval = $batasbawah;
|
||||
}
|
||||
if ($nomor == 1){
|
||||
$tabel = '<table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td width="5%"><strong>No</strong></td><td width="20%"><strong>Antibiotik</strong></td><td width="20%"><strong>Sub</strong></td><td width="10%"><strong>Disc Content</strong></td><td width="5%"><strong>S/I/R</strong></td></tr><tr><td>'.$nomor.'</td><td>'.$getdata->antibiotik.' '.$getdata->subantibiotik.'</td><td>'.$getdata->diskcontent.'</td><td>'.$setnilai.'</td></tr></table>';
|
||||
$tabel = '<table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td width="5%"><strong>No</strong></td><td width="20%"><strong>Antibiotik</strong></td><td width="20%"><strong>Sub</strong></td><td width="10%"><strong>Disc Content</strong></td><td width="5%"><strong>S/I/R</strong></td></tr><tr><td>'.$nomor.'</td><td>'.$getdata->antibiotik.'</td><td>'.$getdata->subantibiotik.'</td><td>'.$getdata->diskcontent.'</td><td>'.$setnilai.'</td></tr></table>';
|
||||
|
||||
} else {
|
||||
$baris = '<tr><td>'.$nomor.'</td><td>'.$getdata->antibiotik.' '.$getdata->subantibiotik.'</td><td>'.$getdata->diskcontent.'</td><td>'.$setnilai.'</td></tr>';
|
||||
$baris = '<tr><td>'.$nomor.'</td><td>'.$getdata->antibiotik.'</td><td>'.$getdata->subantibiotik.'</td><td>'.$getdata->diskcontent.'</td><td>'.$setnilai.'</td></tr>';
|
||||
$tabel = str_replace('</table>', $baris, $tabelawal);
|
||||
$tabel = $tabel.'</table>';
|
||||
}
|
||||
if ($orderid != 0){
|
||||
if ($getdata->subantibiotik !== null && $getdata->subantibiotik != ''){
|
||||
$antibiotik = $getdata->subantibiotik;
|
||||
} else {
|
||||
$antibiotik = $getdata->antibiotik;
|
||||
}
|
||||
RekapAntibiotik::updateOrCreate(
|
||||
[
|
||||
'orderid' => $orderid,
|
||||
'antibiotic' => $antibiotik,
|
||||
'antibiotic' => $getdata->antibiotik.' '.$getdata->subantibiotik,
|
||||
],
|
||||
[
|
||||
'resistance' => $getdata->diskcontent,
|
||||
'value' => $setval,
|
||||
'interpretation' => $setnilai,
|
||||
'created_at' => $getdataawal->daftar ?? date('Y-m-d H:i:s'),
|
||||
'updated_at' => $getdataawal->akhir ?? date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -1395,8 +1178,8 @@ class DokterController extends Controller
|
||||
'modality' => $modality,
|
||||
'jumlah' => $jumlah,
|
||||
'foto' => $tanggal,
|
||||
'excutor' => Session('id'),
|
||||
'nmexcutor' => Session('nama'),
|
||||
'nmradiografer' => Session('nama'),
|
||||
'radiografer' => Session('id'),
|
||||
]);
|
||||
} else {
|
||||
Periksa::where('id', $idperiksa)->update([
|
||||
@@ -1409,8 +1192,8 @@ class DokterController extends Controller
|
||||
'dlp' => $dlp,
|
||||
'modality' => $modality,
|
||||
'jumlah' => $jumlah,
|
||||
'excutor' => Session('id'),
|
||||
'nmexcutor' => Session('nama'),
|
||||
'radiografer' => Session('id'),
|
||||
'nmradiografer' => Session('nama'),
|
||||
'foto' => $tanggal,
|
||||
'status' => 'Telah di kirim ke worklist/modalitas',
|
||||
'excutor' => null,
|
||||
@@ -1525,7 +1308,7 @@ class DokterController extends Controller
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$tlsstatus = 'Proses Analisis Sampel';
|
||||
$tlsstatus = 'Draft Saved';
|
||||
Riwayat::create([
|
||||
'nofoto' => $nofoto,
|
||||
'jawaban' => $surat,
|
||||
@@ -1731,35 +1514,6 @@ class DokterController extends Controller
|
||||
'antibiotikall' => $antibiotikall,
|
||||
);
|
||||
}
|
||||
|
||||
$getsirab = SiraB::orderBy('family', 'ASC')->orderBy('spesies', 'ASC')->where('cek', '0')->get();
|
||||
foreach($getsirab as $row){
|
||||
$family = $row->family;
|
||||
$spesies= $row->spesies;
|
||||
$getallantibiotik = SiraB::where('family', $family)->get();
|
||||
foreach ($getallantibiotik as $row2){
|
||||
SiraB::updateOrCreate(
|
||||
[
|
||||
'family' => $row->family,
|
||||
'spesies' => $row->spesies,
|
||||
'antibiotik' => $row2->antibiotik,
|
||||
'subantibiotik' => $row2->subantibiotik,
|
||||
],
|
||||
[
|
||||
'diskcontent' => $row2->diskcontent,
|
||||
'batasatas' => $row2->batasatas,
|
||||
'midrange' => $row2->midrange,
|
||||
'batasbawah' => $row2->batasbawah,
|
||||
'sumber' => $row2->sumber,
|
||||
'kodedok' => $row2->kodedok,
|
||||
'atu' => $row2->atu,
|
||||
'kelompok' => $row2->kelompok,
|
||||
'glassreportname' => trim($row2->glassreportname),
|
||||
'cek' => '1',
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
echo json_encode($arrayfiles);
|
||||
} else if ($idpasien == 'Bakteri'){
|
||||
$getsirab = Organisms::where('kelompok', 'biakankultur')->orderBy('category', 'ASC')->orderBy('name', 'ASC')->get();
|
||||
@@ -1770,9 +1524,6 @@ class DokterController extends Controller
|
||||
} else if ($idpasien == 'listkodespesimen'){
|
||||
$getsirab = Organisms::where('kelompok', 'listkodespesimen')->orderBy('category', 'ASC')->orderBy('name', 'ASC')->get();
|
||||
echo json_encode($getsirab);
|
||||
} else if ($idpasien == 'allany'){
|
||||
$getsirab = Organisms::whereNotIn('kelompok', ['biakankultur', 'mikroorganisme', 'listkodespesimen'])->orderBy('category', 'ASC')->orderBy('name', 'ASC')->get();
|
||||
echo json_encode($getsirab);
|
||||
} else {
|
||||
$files = Periksa::where('pasien_id', $idpasien)->orderBy('created_at', 'DESC')->get();
|
||||
foreach ($files as $file) {
|
||||
@@ -1861,10 +1612,20 @@ class DokterController extends Controller
|
||||
$arrnofoto = explode('-', $nofoto);
|
||||
$nofoto = $arrnofoto[0];
|
||||
if ($statuse != 'Selesai'){
|
||||
Periksa::where('id', $id)->update([
|
||||
'status' => 'Pemeriksaan Sampel',
|
||||
'excutor' => $idpemeriksa,
|
||||
]);
|
||||
Periksa::where('noregister', $noregister)
|
||||
->where('daftar', $daftar)
|
||||
->where('status', 'Telah di kirim ke worklist/modalitas')
|
||||
->update([
|
||||
'status' => 'Diperiksa',
|
||||
'excutor' => $idpemeriksa,
|
||||
]);
|
||||
Periksa::where('noregister', $noregister)
|
||||
->where('daftar', $daftar)
|
||||
->where('status', null)
|
||||
->update([
|
||||
'status' => 'Diperiksa',
|
||||
'excutor' => $idpemeriksa,
|
||||
]);
|
||||
}
|
||||
}
|
||||
public function getFoto(Request $request) {
|
||||
@@ -2295,14 +2056,14 @@ class DokterController extends Controller
|
||||
$reques = $periksa->reques;
|
||||
$asuransi = $periksa->asuransi;
|
||||
$foto = $periksa->foto;
|
||||
$analis= $periksa->analis;
|
||||
$radiografer= $periksa->radiografer;
|
||||
$nofoto = $periksa->nofoto;
|
||||
$namapoli = $periksa->getRuangan->poli ?? 'Deleted Data Ruang';
|
||||
|
||||
if (is_null($analis)){
|
||||
if (is_null($radiografer)){
|
||||
Periksa::where('id', $idperiksa)->update([
|
||||
'analis' => Session('id'),
|
||||
'nmanalis' => Session('nama'),
|
||||
'radiografer' => Session('id'),
|
||||
'nmradiografer' => Session('nama'),
|
||||
'foto' => date("Y-m-d H:i:s")
|
||||
]);
|
||||
}
|
||||
@@ -2524,7 +2285,7 @@ class DokterController extends Controller
|
||||
'nmppdsjunior' => $periksa->nmppdsjunior,
|
||||
'nmppdsmiddle2' => $periksa->nmppdsmiddle2,
|
||||
'nmppdsjunior2' => $periksa->nmppdsjunior2,
|
||||
'nmanalis' => $periksa->nmanalis,
|
||||
'nmradiografer' => $periksa->nmradiografer,
|
||||
'nmexcutor' => $periksa->nmexcutor,
|
||||
'klinisi' => $periksa->klinisi,
|
||||
'klinis' => $periksa->klinis,
|
||||
@@ -2574,7 +2335,7 @@ class DokterController extends Controller
|
||||
'nmppdsjunior' => $periksa->nmppdsjunior,
|
||||
'nmppdsmiddle2' => $periksa->nmppdsmiddle2,
|
||||
'nmppdsjunior2' => $periksa->nmppdsjunior2,
|
||||
'nmanalis' => $periksa->nmanalis,
|
||||
'nmradiografer' => $periksa->nmradiografer,
|
||||
'nmexcutor' => $periksa->nmexcutor,
|
||||
'klinisi' => $periksa->klinisi,
|
||||
'klinis' => $periksa->klinis,
|
||||
@@ -2804,9 +2565,6 @@ class DokterController extends Controller
|
||||
foreach($idcetak as $rid){
|
||||
$periksa = Periksa::where('id', $rid)->first();
|
||||
if (isset($periksa->id)){
|
||||
Periksa::where('id', $periksa->id)->update([
|
||||
'status' => 'Penerimaan Sampel',
|
||||
]);
|
||||
if ($kanan == ''){
|
||||
$kolomttd = '<td><font color="grey">'.$nomor.'</font></td><td> </td>';
|
||||
$kanan = '1';
|
||||
@@ -2814,7 +2572,7 @@ class DokterController extends Controller
|
||||
$kolomttd = '<td> </td><td><font color="grey">'.$nomor.'</font></td>';
|
||||
$kanan = '';
|
||||
}
|
||||
$cetak = $cetak.'<tr><td align="center">'.$nomor.'</td><td>'.$periksa->nofoto.'</td><td>'.$periksa->noregister.'</td><td>'.$periksa->nmpasien.'</td><td>'.$periksa->jkpasien.'</td><td>'.$periksa->mulai.'</td><td>'.$periksa->asalpasien.'</td><td>'.$periksa->kd_spesimen.'</td><td>'.$periksa->nm_spesimen.'</td>'.$kolomttd.'</tr>';
|
||||
$cetak = $cetak.'<tr><td align="center">'.$nomor.'</td><td>'.$periksa->nofoto.'</td><td>'.$periksa->noregister.'</td><td>'.$periksa->nmpasien.'</td><td>'.$periksa->jkpasien.'</td><td>'.$periksa->mulai.'</td><td>'.$periksa->asalpasien.'</td><td>'.$periksa->kd_spesimen.'</td><td>'.$periksa->nm_spesimen.'</td>'.$kolomttd.'</tr>';
|
||||
$nomor++;
|
||||
}
|
||||
}
|
||||
+223
-435
File diff suppressed because one or more lines are too long
+32
-109
@@ -224,118 +224,41 @@ class ListController extends Controller
|
||||
$id = $request->input('val01');
|
||||
$alasan = $request->input('val02');
|
||||
$tabel = $request->input('val03');
|
||||
if ($id == 'buatulang'){
|
||||
$getdata= Periksa::where('id', $request->input('val02'))->first();
|
||||
if (isset($getdata->nofoto)){
|
||||
$ceksudah = Periksa::where('nofoto', 'LIKE', $getdata->nofoto.'_%')->count();
|
||||
$nomorbaru = $ceksudah++;
|
||||
$periksaid = Periksa::insertGetId([
|
||||
'mulai' => $getdata->mulai,
|
||||
'akhir' => $getdata->akhir,
|
||||
'noloket' => $getdata->noloket,
|
||||
'nofoto' => $getdata->nofoto.'_'.$nomorbaru,
|
||||
'noregister' => $getdata->noregister,
|
||||
'asalpasien' => $getdata->asalpasien,
|
||||
'nmrs' => $getdata->nmrs,
|
||||
'pasien_id' => $getdata->pasien_id,
|
||||
'nmpasien' => $getdata->nmpasien,
|
||||
'jkpasien' => $getdata->jkpasien,
|
||||
'ktp' => $getdata->ktp,
|
||||
'bpjs' => $getdata->bpjs,
|
||||
'tgllahirpasien'=> $getdata->tgllahirpasien,
|
||||
'tlppasien' => $getdata->tlppasien,
|
||||
'alamatpasien' => $getdata->alamatpasien,
|
||||
'reques' => $getdata->reques,
|
||||
'usia' => $getdata->usia,
|
||||
'berat' => $getdata->berat,
|
||||
'ruangan_id' => $getdata->ruangan_id,
|
||||
'ruangan' => $getdata->ruangan,
|
||||
'klinisi' => $getdata->klinisi,
|
||||
'klinis' => $getdata->klinis,
|
||||
'poli_id' => $getdata->poli_id,
|
||||
'kd_spesimen' => $getdata->kd_spesimen,
|
||||
'nm_spesimen' => $getdata->nm_spesimen,
|
||||
'keterangan' => '',
|
||||
'kesimpulan' => '',
|
||||
'asuransi' => $getdata->asuransi,
|
||||
'urgensi' => $getdata->urgensi,
|
||||
'daftar' => $getdata->daftar,
|
||||
'pendaftar' => Session('id'),
|
||||
'nmpendaftar' => Session('nama'),
|
||||
'orderid' => $getdata->orderid,
|
||||
]);
|
||||
try {
|
||||
if ($getdata->kd_spesimen != '' AND $getdata->nm_spesimen != ''){
|
||||
PendaftaranOnListiner::updateOrCreate(
|
||||
[
|
||||
'rnoreg' => $getdata->nofoto,
|
||||
],
|
||||
[
|
||||
'rtglast' => date('Y-m-d'),
|
||||
'norm' => $getdata->noregister,
|
||||
'nama' => $getdata->nmpasien,
|
||||
'alamat' => $getdata->alamatpasien,
|
||||
'telp' => $getdata->tlppasien,
|
||||
'hp' => $getdata->tlppasien,
|
||||
'tgllahir' => $getdata->tgllahirpasien,
|
||||
'umur' => $getdata->usia,
|
||||
'rjenis' => $getdata->jkpasien,
|
||||
'kodedok' => Session('id'),
|
||||
'namadok' => Session('nama'),
|
||||
'ruangan' => $getdata->ruangan,
|
||||
'tes' => '',
|
||||
'alat' => 'All',
|
||||
'kd_spesimen' => $getdata->kd_spesimen,
|
||||
'nm_spesimen' => $getdata->nm_spesimen,
|
||||
]
|
||||
);
|
||||
}
|
||||
return response()->json(['status' => 'Sukses', 'message' => 'Data Order Berhasil di Gandakan'], 201);
|
||||
} catch (Exception $e) {
|
||||
return response()->json(['status' => 'Sukses', 'message' => 'Data Order Berhasil di Gandakan'], 201);
|
||||
}
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Gagal', 'message' => 'Data Tidak Valid']);
|
||||
return back();
|
||||
}
|
||||
if ($alasan == ''){
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Gagal', 'message' => 'Mohon isi semua form']);
|
||||
return back();
|
||||
} else {
|
||||
if ($alasan == ''){
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Gagal', 'message' => 'Mohon isi semua form']);
|
||||
return back();
|
||||
} else {
|
||||
if ($tabel == 'aktif'){
|
||||
$alasan = 'Dibatalkan dengan alasan '.$alasan;
|
||||
$input = Periksa::where('id', $id)->update([
|
||||
'noloket' => null,
|
||||
'status' => $alasan
|
||||
]);
|
||||
$pesan = 'Order Expertise Canceled';
|
||||
} else if ($tabel == 'arsip'){
|
||||
$total = 0;
|
||||
$input = Periksa::whereIn('id', $id)->update([
|
||||
'status'=> 'Arsip'
|
||||
]);
|
||||
if ($input){
|
||||
$total++;
|
||||
}
|
||||
$pesan = 'Expertise Archieved '.$total;
|
||||
} else {
|
||||
$alasan = 'Dibatalkan dengan alasan '.$alasan;
|
||||
$input = Jadwalperiksa::where('id', $id)->update([
|
||||
'noloket' => null,
|
||||
'status' => $alasan
|
||||
]);
|
||||
$pesan = 'Schedulling Canceled';
|
||||
}
|
||||
if ($tabel == 'aktif'){
|
||||
$alasan = 'Dibatalkan dengan alasan '.$alasan;
|
||||
$input = Periksa::where('id', $id)->update([
|
||||
'noloket' => null,
|
||||
'status' => $alasan
|
||||
]);
|
||||
$pesan = 'Order Expertise Canceled';
|
||||
} else if ($tabel == 'arsip'){
|
||||
$total = 0;
|
||||
$input = Periksa::whereIn('id', $id)->update([
|
||||
'status'=> 'Arsip'
|
||||
]);
|
||||
if ($input){
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Sukses', 'message' => $pesan]);
|
||||
return back();
|
||||
}else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Gagal', 'message' => 'System Down, please try again in a few years...']);
|
||||
return back();
|
||||
}
|
||||
$total++;
|
||||
}
|
||||
$pesan = 'Expertise Archieved '.$total;
|
||||
} else {
|
||||
$alasan = 'Dibatalkan dengan alasan '.$alasan;
|
||||
$input = Jadwalperiksa::where('id', $id)->update([
|
||||
'noloket' => null,
|
||||
'status' => $alasan
|
||||
]);
|
||||
$pesan = 'Schedulling Canceled';
|
||||
}
|
||||
if ($input){
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Sukses', 'message' => $pesan]);
|
||||
return back();
|
||||
}else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Gagal', 'message' => 'System Down, please try again in a few years...']);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+42
-33
@@ -105,39 +105,48 @@ class PasienController extends Controller
|
||||
]);
|
||||
} else {
|
||||
try {
|
||||
$client = new Client();
|
||||
$res = $client->request('GET', env('GETPASIEN_API'), ['query' => ['limit' => 10, 'nomedis' => $norm]]);
|
||||
$response_data = json_decode($res->getBody()->getContents());
|
||||
if (isset($response_data->response[0])) {
|
||||
$hasil = $response_data->response[0];
|
||||
$nama = $hasil->Nama;
|
||||
$alamat = $hasil->Alamat;
|
||||
$telpon = $hasil->Telp;
|
||||
$kota = $hasil->Kota;
|
||||
$kelamin = $hasil->JenisKelamin;
|
||||
$tgllahir = $hasil->tanggal_lahir;
|
||||
return response()->json([
|
||||
'id' => 'new',
|
||||
'norm' => $norm,
|
||||
'telpon' => $telpon,
|
||||
'nama' => $nama,
|
||||
'tgl_lahir' => date('d-m-Y', strtotime($tgllahir)),
|
||||
'jk' => $kelamin,
|
||||
'alamat' => $alamat,
|
||||
'kota' => $kota,
|
||||
]);
|
||||
} else {
|
||||
return response()->json([
|
||||
'id' => '',
|
||||
'telpon' => '000000000',
|
||||
'norm' => $norm,
|
||||
'nama' => '',
|
||||
'tgl_lahir' => date("d-m-Y"),
|
||||
'jk' => 'L',
|
||||
'alamat' => 'Malang',
|
||||
'kota' => 'Malang',
|
||||
]);
|
||||
}
|
||||
$client = new Client();
|
||||
$res = $client->request('GET', 'http://10.10.123.51:8000/mr/'.$norm);
|
||||
$response_data = json_decode($res->getBody()->getContents());
|
||||
if (isset($response_data[0])) {
|
||||
$hasil = $response_data[0];
|
||||
$nama = $hasil->Nama;
|
||||
$alamat = $hasil->Alamat;
|
||||
$telpon = $hasil->Telp;
|
||||
$kota = $hasil->Kota;
|
||||
$kelamin = $hasil->JenisKelamin;
|
||||
$tgllahir = $hasil->tanggal_lahir;
|
||||
$nik = $hasil->nik;
|
||||
$bpjs = $hasil->bpjs;
|
||||
if ($kelamin == 'WANITA'){
|
||||
$kelamin = 'P';
|
||||
} else { $kelamin = 'L'; }
|
||||
return response()->json([
|
||||
'id' => 'new',
|
||||
'norm' => $norm,
|
||||
'telpon' => $telpon,
|
||||
'nama' => $nama,
|
||||
'tgl_lahir' => $tgllahir,
|
||||
'jk' => $kelamin,
|
||||
'alamat' => $alamat,
|
||||
'kota' => $kota,
|
||||
'nik' => $nik,
|
||||
'bpjs' => $bpjs,
|
||||
]);
|
||||
} else {
|
||||
return response()->json([
|
||||
'id' => '',
|
||||
'telpon' => '000000000',
|
||||
'norm' => $norm,
|
||||
'nama' => '',
|
||||
'tgl_lahir' => date("d-m-Y"),
|
||||
'jk' => 'L',
|
||||
'alamat' => 'Malang',
|
||||
'kota' => 'Malang',
|
||||
'nik' => '',
|
||||
'bpjs' => '',
|
||||
]);
|
||||
}
|
||||
}catch (Exception $e) {
|
||||
return response()->json([
|
||||
'id' => '',
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Poli;
|
||||
use App\Ruangan;
|
||||
use App\Organisms;
|
||||
|
||||
use Validator;
|
||||
use Session;
|
||||
|
||||
class PoliController extends Controller
|
||||
{
|
||||
public function index() {
|
||||
if (Session::get('previlage') == ''){
|
||||
return redirect('/login');
|
||||
} else {
|
||||
$data = [];
|
||||
$data['polis'] = Poli::all();
|
||||
$data['ruangans'] = Ruangan::all();
|
||||
return view('admin.poli', $data);
|
||||
}
|
||||
}
|
||||
public function storePoli(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'poli' => 'required',
|
||||
'poli' => 'required',
|
||||
'modaliti' => 'required'
|
||||
]);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$poli = $request->input('poli');
|
||||
$subpoli = $request->input('subpoli');
|
||||
$subsubpoli = $request->input('subsubpoli');
|
||||
$modaliti = $request->input('modaliti');
|
||||
Poli::create([
|
||||
'poli' => $request->input('poli'),
|
||||
'subpoli' => $request->input('subpoli'),
|
||||
'subsubpoli'=> $request->input('subsubpoli'),
|
||||
'modaliti' => $request->input('modaliti'),
|
||||
'modaliti2' => $request->input('modaliti2')
|
||||
]);
|
||||
$tulis = 'Data '.$poli.' '.$subpoli.' '.$subsubpoli.' Saved..!!';
|
||||
return response()->json(['status' => 'success', 'message' => $tulis]);
|
||||
}
|
||||
}
|
||||
public function getListPoli() {
|
||||
$results = Poli::orderBy('subpoli', 'ASC')->get();
|
||||
echo json_encode($results);
|
||||
}
|
||||
public function updatePoli(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'id' => 'required',
|
||||
'poli' => 'required',
|
||||
'subpoli' => 'required',
|
||||
'modaliti' => 'required'
|
||||
]);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$id = $request->input('id');
|
||||
$poli = $request->input('poli');
|
||||
$subpoli = $request->input('subpoli');
|
||||
$subsubpoli = $request->input('subsubpoli');
|
||||
Poli::where('id', $id)->update([
|
||||
'poli' => $poli,
|
||||
'subpoli' => $subpoli,
|
||||
'subsubpoli'=> $subsubpoli,
|
||||
'modaliti' => $request->input('modaliti'),
|
||||
'modaliti2' => $request->input('modaliti2')
|
||||
]);
|
||||
$tulis = 'Data '.$poli.' '.$subpoli.' '.$subsubpoli.' Updated..!!';
|
||||
return response()->json(['status' => 'success', 'message' => $tulis]);
|
||||
}
|
||||
}
|
||||
public function deletePoli(Request $request) {
|
||||
$id = $request->id;
|
||||
$poli = Poli::find($id);
|
||||
$poli->delete();
|
||||
return back();
|
||||
}
|
||||
public function storeRuangan(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'poli' => 'required',
|
||||
'ruangan' => 'required'
|
||||
]);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
Ruangan::create([
|
||||
'poli' => $request->input('poli'),
|
||||
'ruangan' => $request->input('ruangan')
|
||||
]);
|
||||
Session::flash('message', 'Data berhasil disimpan');
|
||||
Session::flash('alert-class', 'alert-success');
|
||||
return back();
|
||||
}
|
||||
}
|
||||
public function getListRuangan(Request $request) {
|
||||
$results = Ruangan::all();
|
||||
echo json_encode($results);
|
||||
}
|
||||
public function updateRuangan(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'id' => 'required',
|
||||
'poli' => 'required',
|
||||
'ruangan' => 'required'
|
||||
]);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$id = $request->input('id');
|
||||
Ruangan::where('id', $id)->update([
|
||||
'poli' => $request->input('poli'),
|
||||
'ruangan' => $request->input('ruangan')
|
||||
]);
|
||||
}
|
||||
}
|
||||
public function deleteRuangan(Request $request) {
|
||||
$id = $request->id;
|
||||
$ruangan = Ruangan::find($id);
|
||||
$ruangan->delete();
|
||||
return back();
|
||||
}
|
||||
}
|
||||
+1
-147
@@ -12,7 +12,6 @@ use App\Dokter;
|
||||
use App\Pasien;
|
||||
use App\Jadwalperiksa;
|
||||
use App\Riwayat;
|
||||
use App\RekapAntibiotik;
|
||||
use DateTime;
|
||||
use Carbon\Carbon;
|
||||
use Session;
|
||||
@@ -30,7 +29,7 @@ class ReportController extends Controller
|
||||
set_time_limit(0);
|
||||
$bulan = $request->input('bulan');
|
||||
$tahun = $request->input('tahun');
|
||||
if ($bulan == 'ALL' OR $bulan == 'Pick Month') {
|
||||
if ($bulan == 'ALL' || $bulan == 'Pick Month') {
|
||||
$orderbydate = Periksa::selectRaw('SUM(id) as jumlah, DATE(daftar) as day')->whereYear('daftar', $tahun)->groupBy(DB::raw('daftar'))->orderBy('daftar', 'ASC')->get();
|
||||
$bulan = '';
|
||||
} else {
|
||||
@@ -307,149 +306,4 @@ class ReportController extends Controller
|
||||
echo json_encode($arraylist);
|
||||
}
|
||||
}
|
||||
public function genRekapAntibiotik(Request $request) {
|
||||
$data = [];
|
||||
$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);
|
||||
}
|
||||
if ($bulan == '' OR $bulan == 'ALL' OR $bulan == 'Pick Month') {
|
||||
$orderbydate = Periksa::whereYear('daftar', $tahun)->orderBy('daftar', 'asc')->get();
|
||||
} else {
|
||||
$orderbydate = Periksa::whereMonth('daftar', $bulan)->whereYear('daftar', $tahun)->orderBy('daftar', 'asc')->get();
|
||||
}
|
||||
|
||||
$orderIds = $orderbydate->pluck('id');
|
||||
|
||||
$allAntibiotics = RekapAntibiotik::whereIn('orderid', $orderIds)->get();
|
||||
|
||||
$masterAntibioticList = $allAntibiotics->pluck('resistance')->unique()->sort()->values();
|
||||
|
||||
$jsonantibiotik = $allAntibiotics->groupBy('orderid')->map(function ($items) {
|
||||
return $items->pluck('interpretation', 'resistance');
|
||||
});
|
||||
|
||||
return view('admin.rekapantibiotik', compact('orderbydate', 'jsonantibiotik', 'bulan', 'tahun', 'masterAntibioticList'));
|
||||
}
|
||||
public function genGlassReport(Request $request) {
|
||||
$data = [];
|
||||
$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);
|
||||
}
|
||||
if ($bulan == '' OR $bulan == 'ALL' OR $bulan == 'Pick Month') {
|
||||
$orderbydate = Periksa::whereYear('daftar', $tahun)->get();
|
||||
$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', //tidak ada
|
||||
'Tetracyclin-TCY',
|
||||
'Tigecycline-TGC', //double
|
||||
'Gentamicin-GM',
|
||||
'Amikacin-AN',
|
||||
'Meropenem-MEM',
|
||||
'Imipenem-IPM',
|
||||
'Doripenem-DOR',
|
||||
'Ertapenem-ETP',
|
||||
'Minocycline-MNO',
|
||||
'Doxycycline-DOX',
|
||||
'Spectinomycin-SPT',
|
||||
'Tigecycline-TGC', //sama-ini
|
||||
'Trimethoprim/Sulfamethoxazole-SXT',
|
||||
'Fosfomycin-FOS',
|
||||
'Vancomycin-VAN',
|
||||
'Linezolid-LNZ',
|
||||
'Fluconazole', //tidak ada
|
||||
'Voriconazole', //tidak ada
|
||||
'Caspofungin', //tidak ada
|
||||
'Micafungin', //tidak ada
|
||||
'Amphotericin B', //tidak ada
|
||||
'Flucytosine' //tidak ada
|
||||
);
|
||||
} else {
|
||||
$orderbydate = Periksa::whereMonth('daftar', $bulan)->whereYear('daftar', $tahun)->get();
|
||||
$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'
|
||||
);
|
||||
}
|
||||
return view('admin.glassreport', compact('orderbydate', 'jsonantibiotik', 'bulan', 'tahun'));
|
||||
}
|
||||
}
|
||||
+1
-65
@@ -20,9 +20,7 @@ class TemplateController extends Controller
|
||||
if (Session::get('previlage') == ''){
|
||||
return redirect('/login');
|
||||
} else {
|
||||
$data = [];
|
||||
$getsirab = Organisms::whereNotIn('kelompok', ['biakankultur', 'mikroorganisme', 'listkodespesimen'])->select('kelompok')->groupBy('kelompok')->orderBy('kelompok', 'ASC')->get();
|
||||
$data['parameters'] = $getsirab;
|
||||
$data = [];
|
||||
return view('admin.template', $data);
|
||||
}
|
||||
}
|
||||
@@ -275,68 +273,6 @@ class TemplateController extends Controller
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => 'Unkown Error']);
|
||||
return back();
|
||||
}
|
||||
} else if ($tabel == 'Speciment'){
|
||||
if ($id == 'new'){
|
||||
$ceksudah = Organisms::where('name', $request->name)->where('category', $request->category)->where('kelompok', $request->kelompok)->count();
|
||||
if ($ceksudah == 0){
|
||||
$data = new Organisms;
|
||||
$inputData = $request->except(['id', 'tabel', '_token']);
|
||||
$data->fill($inputData);
|
||||
$data->save();
|
||||
} else {
|
||||
$pesan = $request->name.' ('.$request->category.') Sudah ada, Mohon ubah Data sebelum simpan kembali';
|
||||
}
|
||||
} else {
|
||||
$ceksudah = Organisms::where('id', '!=', $id)->where('name', $request->name)->where('category', $request->category)->where('kelompok', $request->kelompok)->count();
|
||||
if ($ceksudah == 0){
|
||||
$data = Organisms::find($id);
|
||||
$inputData = $request->except(['id', 'tabel', '_token']);
|
||||
$data->update($inputData);
|
||||
} else {
|
||||
$pesan = $request->name.' ('.$request->category.') Sudah ada, Mohon ubah Data sebelum simpan kembali';
|
||||
}
|
||||
}
|
||||
if ($data){
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Saved']);
|
||||
return back();
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => 'Unkown Error']);
|
||||
return back();
|
||||
}
|
||||
} else if ($tabel == 'Parameter'){
|
||||
$getdatalama = Organisms::where('kelompok', $request->kelompok)->first();
|
||||
$category = $getdatalama->category ?? $request->kelompok;
|
||||
|
||||
if ($id == 'new'){
|
||||
$ceksudah = Organisms::where('name', $request->name)->where('category', $category)->where('kelompok', $request->kelompok)->count();
|
||||
if ($ceksudah == 0){
|
||||
$data = Organisms::create([
|
||||
'name' => $request->name,
|
||||
'category' => $category,
|
||||
'kelompok' => $request->kelompok
|
||||
]);
|
||||
} else {
|
||||
$pesan = $request->name.' ('.$request->category.') Sudah ada, Mohon ubah Data sebelum simpan kembali';
|
||||
}
|
||||
} else {
|
||||
$ceksudah = Organisms::where('id', '!=', $id)->where('name', $request->name)->where('category', $category)->where('kelompok', $request->kelompok)->count();
|
||||
if ($ceksudah == 0){
|
||||
$data = Organisms::where('id', $id)->update([
|
||||
'name' => $request->name,
|
||||
'category' => $category,
|
||||
'kelompok' => $request->kelompok
|
||||
]);
|
||||
} else {
|
||||
$pesan = $request->name.' ('.$request->category.') Sudah ada, Mohon ubah Data sebelum simpan kembali';
|
||||
}
|
||||
}
|
||||
if ($data){
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Saved']);
|
||||
return back();
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => 'Unkown Error']);
|
||||
return back();
|
||||
}
|
||||
} else {
|
||||
if ($id == 'new'){
|
||||
$data = new SiraB;
|
||||
+1
-1
@@ -12,6 +12,6 @@ class VerifyCsrfToken extends Middleware
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
'registerpasien', 'registerjson', 'ekstrakhasil', 'prosesbatal', 'cekaksess'
|
||||
'registerpasien', 'registerjson', 'ekstrakhasil', 'prosesbatal'
|
||||
];
|
||||
}
|
||||
@@ -24,8 +24,6 @@ class RouteServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//resolve(\Illuminate\Routing\UrlGenerator::class)->forceScheme('https');
|
||||
//parent::boot();
|
||||
RateLimiter::for('api', function (Request $request) {
|
||||
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
|
||||
});
|
||||
@@ -231,80 +231,110 @@ class AstmMessageService
|
||||
return response()->json(['message' => 'Data berhasil diproses dan disimpan.']);
|
||||
|
||||
} else {
|
||||
if (!empty($mltrData)) {
|
||||
Log::info("Trying robust parser for MTRSL:", $mltrData);
|
||||
|
||||
$resultSample = new ResultSample();
|
||||
$antibioticResults = [];
|
||||
$currentAntibiotic = [];
|
||||
|
||||
foreach ($mltrData as $field) {
|
||||
if (strlen($field) < 2) continue; // Lewati field kosong
|
||||
|
||||
// 1. Identifikasi TAG dan VALUE dari setiap field
|
||||
$tag = substr($field, 0, 2);
|
||||
$value = substr($field, 2);
|
||||
|
||||
// 2. Gunakan SWITCH pada TAG, bukan pada INDEX
|
||||
switch ($tag) {
|
||||
// == Data Pasien & Sampel ==
|
||||
case 'pi': $resultSample->patient_id = $value; break;
|
||||
case 'pn':
|
||||
$patientNames = explode(',', $value ?? null);
|
||||
$resultSample->patient_name_last = trim($patientNames[0] ?? '');
|
||||
$resultSample->patient_name_first = trim($patientNames[1] ?? '');
|
||||
$resultSample->patient_name_middle = trim($patientNames[2] ?? '');
|
||||
break;
|
||||
case 'pl': $resultSample->address_street = $value; break;
|
||||
case 'ci': $resultSample->accession_number = substr($value, 6); break;
|
||||
case 'o2': $resultSample->organism = $value; break;
|
||||
|
||||
// Tanggal bisa memiliki tag s1, s3, dll. Sesuaikan jika perlu
|
||||
case 's3':
|
||||
try {
|
||||
// Contoh parsing tanggal dari format Vitek: 08/25/2025
|
||||
$resultSample->test_complete_datetime = Carbon::createFromFormat('m/d/Y', $value)->format('Y-m-d H:i:s');
|
||||
} catch (Exception $e) {
|
||||
$resultSample->test_complete_datetime = now();
|
||||
if (!empty($mltrData)){
|
||||
Log::info("Trying parser MTRSL :", $mltrData);
|
||||
$parsedData = [];
|
||||
$parsedData['antibiotics'] = [];
|
||||
$antibiotic = '';
|
||||
$resistance = '';
|
||||
$value = '';
|
||||
$interpretation = '';
|
||||
$mulaikirim = 0;
|
||||
$resultSample = new ResultSample();
|
||||
foreach ($mltrData as $index => $field) {
|
||||
if ($field == 'ra'){
|
||||
if ($antibiotic != ''){
|
||||
$parsedData['antibiotics'][] = [
|
||||
'antibiotic' => $antibiotic, // Antibiotik
|
||||
'resistance' => $resistance, // Hasil Resistansi
|
||||
'value' => $value, // Nilai
|
||||
'interpretation'=> $interpretation // Interpretasi
|
||||
];
|
||||
$antibiotic = '';
|
||||
$resistance = '';
|
||||
$value = '';
|
||||
$interpretation = '';
|
||||
} else {
|
||||
$mulaikirim = 1;
|
||||
}
|
||||
} else {
|
||||
if ($mulaikirim == 1){
|
||||
$antibiotic = substr($field, 2);
|
||||
$mulaikirim++;
|
||||
} else if ($mulaikirim == 2){
|
||||
$resistance = substr($field, 2);
|
||||
$mulaikirim++;
|
||||
} else if ($mulaikirim == 3){
|
||||
$value = substr($field, 2);
|
||||
$mulaikirim++;
|
||||
} else if ($mulaikirim == 4){
|
||||
$interpretation = substr($field, 2);
|
||||
$mulaikirim++;
|
||||
} else {
|
||||
$field = substr($field, 2);
|
||||
switch ($index) {
|
||||
case 0:
|
||||
$resultSample->sender_name = $alat;
|
||||
break;
|
||||
case 1:
|
||||
$resultSample->version_number = $field; // iiV2
|
||||
break;
|
||||
case 2:
|
||||
$resultSample->isolate_number = $field; // is000015F278BD
|
||||
break;
|
||||
case 4:
|
||||
$resultSample->patient_id = $field; // pi12009427
|
||||
break;
|
||||
case 5:
|
||||
$patientNames = explode(',', $field ?? null);
|
||||
if (count($patientNames) > 0) {
|
||||
$resultSample->patient_name_last = trim($patientNames[0]); // Last name
|
||||
}
|
||||
if (count($patientNames) > 1) {
|
||||
$resultSample->patient_name_first = trim($patientNames[1]); // First name
|
||||
}
|
||||
if (count($patientNames) > 2) {
|
||||
$resultSample->patient_name_middle = trim($patientNames[2]); // Middle name
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
$resultSample->address_street = $field; // plMANINJAU
|
||||
break;
|
||||
case 12:
|
||||
try {
|
||||
$resultSample->message_datetime = Carbon::parse($field)->format('Y-m-d') ?? null;
|
||||
}catch (Exception $e) {
|
||||
$resultSample->message_datetime = date('Y-m-d');
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
try {
|
||||
$resultSample->test_complete_datetime = Carbon::parse($field)->format('Y-m-d') ?? null;
|
||||
}catch (Exception $e) {
|
||||
$resultSample->test_complete_datetime = date('Y-m-d');
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
$resultSample->accession_number = substr($field, 6); // ci30112024.26859
|
||||
break;
|
||||
case 23:
|
||||
$resultSample->organism = $field; // o2Staphylococcus haemolyticus
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
// == Logika Cerdas untuk Blok Antibiotik ==
|
||||
case 'ra':
|
||||
// 'ra' adalah sinyal bahwa blok antibiotik SEBELUMNYA sudah selesai.
|
||||
// Jika $currentAntibiotic tidak kosong, simpan ke hasil utama.
|
||||
if (!empty($currentAntibiotic)) {
|
||||
$antibioticResults[] = $currentAntibiotic;
|
||||
}
|
||||
// Reset untuk menampung data antibiotik yang baru.
|
||||
$currentAntibiotic = [];
|
||||
break;
|
||||
case 'a1': $currentAntibiotic['antibiotic'] = $value; break; // Kode Antibiotik
|
||||
case 'a2': $currentAntibiotic['resistance'] = $value; break; // Nama Antibiotik
|
||||
case 'a3': $currentAntibiotic['value'] = $value; break; // Nilai MIC
|
||||
case 'a4': $currentAntibiotic['interpretation'] = $value; break; // Interpretasi
|
||||
case 'an':
|
||||
// Jika 'an' ada, ini adalah interpretasi final, timpa yang sebelumnya.
|
||||
$currentAntibiotic['interpretation'] = $value;
|
||||
break;
|
||||
|
||||
// == Metadata Lainnya (opsional) ==
|
||||
case 'ii': $resultSample->version_number = $value; break;
|
||||
case 'is': $resultSample->isolate_number = $value; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//$resultSample->specimen_type = $parsedData['specimen_type'] ?? null; // Could be inferred
|
||||
//$resultSample->test_id = $parsedData['test_id'] ?? null;
|
||||
|
||||
// Penting: Simpan blok antibiotik TERAKHIR setelah loop selesai
|
||||
if (!empty($currentAntibiotic)) {
|
||||
$antibioticResults[] = $currentAntibiotic;
|
||||
}
|
||||
|
||||
$resultSample->sender_name = $alat ?? 'VITEK'; // Pastikan var $alat ada
|
||||
$resultSample->additional_result = json_encode($antibioticResults);
|
||||
// Result Record
|
||||
|
||||
$resultSample->additional_result = json_encode($parsedData['antibiotics']);
|
||||
|
||||
// Menyimpan data yang sudah diparse
|
||||
$resultSample->save();
|
||||
Log::info("Data MTRSL successfully parsed and saved.", $resultSample->toArray());
|
||||
Log::info("Data MTRL Berhasil di Parse dan di simpan ", $resultSample->toArray());
|
||||
return response()->json(['message' => 'Data berhasil diproses dan disimpan.']);
|
||||
} else {
|
||||
$headerData = explode("|", $response);
|
||||
Loaded 100 of 15172 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in New Issue
Block a user