Update htdocs/app/Services/AstmMessageService.php
This commit is contained in:
No files matched your search
@@ -24,7 +24,7 @@ class ProcessAstmMessages extends Command
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
// Ambil data dari DataListener
|
// Ambil data dari DataListener
|
||||||
$dataListener = DataListiner::whereNull('processed')->get();
|
$dataListener = DataListiner::where('processed', '0')->get();
|
||||||
$dataLocal = DB::table('lis_phoenix')->whereNull('processed')->get();
|
$dataLocal = DB::table('lis_phoenix')->whereNull('processed')->get();
|
||||||
if ($dataListener) {
|
if ($dataListener) {
|
||||||
$jumlah = count($dataListener);
|
$jumlah = count($dataListener);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
use Illuminate\Routing\Controller as BaseController;
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
@@ -10,6 +11,7 @@ use App\Pasien;
|
|||||||
use App\Riwayat;
|
use App\Riwayat;
|
||||||
use App\Rekaplogbook;
|
use App\Rekaplogbook;
|
||||||
use App\PeriksaTest;
|
use App\PeriksaTest;
|
||||||
|
|
||||||
use Fawno\PhpSerial\SerialDio;
|
use Fawno\PhpSerial\SerialDio;
|
||||||
use Fawno\PhpSerial\SerialConfig;
|
use Fawno\PhpSerial\SerialConfig;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
@@ -25,6 +27,7 @@ use Aranyasen\HL7\Segments\PID;
|
|||||||
use Aranyasen\HL7\Segments\OBX;
|
use Aranyasen\HL7\Segments\OBX;
|
||||||
use Aranyasen\HL7\Segments\NTE;
|
use Aranyasen\HL7\Segments\NTE;
|
||||||
use Aranyasen\HL7\Segments\EVN;
|
use Aranyasen\HL7\Segments\EVN;
|
||||||
|
use Session;
|
||||||
|
|
||||||
class Controller extends BaseController
|
class Controller extends BaseController
|
||||||
{
|
{
|
||||||
@@ -175,10 +178,7 @@ class Controller extends BaseController
|
|||||||
protected function getDefaultData($jenis, $master, $mulai, $akhir, $valcari) {
|
protected function getDefaultData($jenis, $master, $mulai, $akhir, $valcari) {
|
||||||
$query = Periksa::whereNotNull('nofoto');
|
$query = Periksa::whereNotNull('nofoto');
|
||||||
if ($jenis == 'ThisDay') {
|
if ($jenis == 'ThisDay') {
|
||||||
$url = url()->current();
|
if (Session('previlage') == 'admin'){
|
||||||
$baseurl = url('/');
|
|
||||||
$ceklaman = str_replace($baseurl.'/', '', $url);
|
|
||||||
if ($ceklaman == 'pendaftaran'){
|
|
||||||
return $query->whereDate('daftar', Carbon::today());
|
return $query->whereDate('daftar', Carbon::today());
|
||||||
} else {
|
} else {
|
||||||
return $query->where(function($q) {
|
return $query->where(function($q) {
|
||||||
@@ -187,7 +187,6 @@ class Controller extends BaseController
|
|||||||
->orWhere('status', 'not like', 'Dibatalkan%');
|
->orWhere('status', 'not like', 'Dibatalkan%');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ($jenis == 'mundur2') {
|
} else if ($jenis == 'mundur2') {
|
||||||
return $query->whereDate('daftar', '>=', Carbon::today()->subDays(2));
|
return $query->whereDate('daftar', '>=', Carbon::today()->subDays(2));
|
||||||
} else if ($jenis == 'mundur3') {
|
} else if ($jenis == 'mundur3') {
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ use Illuminate\Support\Facades\DB;
|
|||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
use App\Http\Controllers\SendMail;
|
use App\Http\Controllers\SendMail;
|
||||||
use App\Services\AstmMessageService;
|
use App\Services\AstmMessageService;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
use App\Poli;
|
use App\Poli;
|
||||||
use App\Periksa;
|
use App\Periksa;
|
||||||
use App\DataListiner;
|
use App\DataListiner;
|
||||||
@@ -1137,21 +1140,28 @@ class DokterController extends Controller
|
|||||||
try {
|
try {
|
||||||
$ketemu = '';
|
$ketemu = '';
|
||||||
$nomor = 1;
|
$nomor = 1;
|
||||||
$cekada = ResultSample::where('accession_number', 'LIKE', $nofoto.'%')->get();
|
$cekdatalangsung = DataListiner::where('no_id', $nofoto)->whereIn('alat', ['BD Mikro 1', 'BD Mikro 2'])->first();
|
||||||
if (!empty($cekada)){
|
$ketemu = $cekdatalangsung->organisme ?? '';
|
||||||
foreach($cekada as $rows){
|
if ($ketemu == ''){
|
||||||
$ketemu = $rows->test_status;
|
$cekada = ResultSample::where('accession_number', 'LIKE', $nofoto.'%')->get();
|
||||||
|
if (!empty($cekada)){
|
||||||
|
foreach($cekada as $rows){
|
||||||
|
$ketemu = $rows->test_status;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$cekdata = DB::table('lis_phoenix')->where('no_id', $nofoto)->first();
|
||||||
|
$ketemu = $cekdata->organisme ?? '';
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$cekdata = DB::table('lis_phoenix')->where('no_id', $nofoto)->first();
|
|
||||||
$ketemu = $cekdata->organisme ?? '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ketemu != ''){
|
if ($ketemu != ''){
|
||||||
if ($isidata == '' OR is_null($isidata)){
|
if ($isidata == '' OR is_null($isidata)){
|
||||||
$isidata = $ketemu;
|
$isidata = $ketemu;
|
||||||
} else {
|
} else {
|
||||||
$isidata = $isidata.'<br />'.$ketemu;
|
$isidata = $isidata.'<br />'.$ketemu;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($isidata == '' OR is_null($isidata)){
|
if ($isidata == '' OR is_null($isidata)){
|
||||||
|
|
||||||
@@ -1709,38 +1719,6 @@ class DokterController extends Controller
|
|||||||
$idpasien = $request->input('val01');
|
$idpasien = $request->input('val01');
|
||||||
$arrayfiles = [];
|
$arrayfiles = [];
|
||||||
if ($idpasien == 'sirab'){
|
if ($idpasien == 'sirab'){
|
||||||
/*
|
|
||||||
$jumlah = 0;
|
|
||||||
$getklonin = SiraB::orderBy('family', 'ASC')->orderBy('spesies', 'ASC')->whereNull('cek')->get();
|
|
||||||
foreach($getklonin as $row){
|
|
||||||
$family = $row->family;
|
|
||||||
$spesies = $row->spesies;
|
|
||||||
$getallantibiotik = SiraB::where('family', $family)->get();
|
|
||||||
foreach($getallantibiotik as $rowa){
|
|
||||||
SiraB::updateOrCreate(
|
|
||||||
[
|
|
||||||
'family' => $family,
|
|
||||||
'spesies' => $spesies,
|
|
||||||
'antibiotik' => $rowa->antibiotik,
|
|
||||||
'subantibiotik' => $rowa->subantibiotik,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'diskcontent' => $row->diskcontent,
|
|
||||||
'batasatas' => $row->batasatas,
|
|
||||||
'midrange' => $row->midrange,
|
|
||||||
'batasbawah' => $row->batasbawah,
|
|
||||||
'sumber' => $row->sumber,
|
|
||||||
'kodedok' => $row->kodedok,
|
|
||||||
'atu' => $row->atu,
|
|
||||||
'kelompok' => $row->kelompok,
|
|
||||||
'cek' => '1',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
$jumlah++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo $jumlah;
|
|
||||||
*/
|
|
||||||
$getsirab = SiraB::orderBy('family', 'ASC')
|
$getsirab = SiraB::orderBy('family', 'ASC')
|
||||||
->orderBy('spesies', 'ASC')
|
->orderBy('spesies', 'ASC')
|
||||||
->get()
|
->get()
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\DB;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use App\DataListiner;
|
use App\DataListiner;
|
||||||
|
use App\Periksa;
|
||||||
|
|
||||||
// Proses untuk Growth and Detection Result
|
// Proses untuk Growth and Detection Result
|
||||||
function processGrowthDetectionResult($rawData){
|
function processGrowthDetectionResult($rawData){
|
||||||
@@ -227,6 +228,9 @@ class AstmMessageService
|
|||||||
|
|
||||||
// Simpan ke database
|
// Simpan ke database
|
||||||
if ($noregister){
|
if ($noregister){
|
||||||
|
Periksa::where('nofoto', $accession_number)->update([
|
||||||
|
'status' => 'Data Vitek di Terima',
|
||||||
|
]);
|
||||||
Log::info("Data berhasil disimpan:", $resultSample->toArray());
|
Log::info("Data berhasil disimpan:", $resultSample->toArray());
|
||||||
$resultSample->save();
|
$resultSample->save();
|
||||||
}
|
}
|
||||||
@@ -530,6 +534,9 @@ class AstmMessageService
|
|||||||
DataListiner::where('urut', $data->urut)->update([
|
DataListiner::where('urut', $data->urut)->update([
|
||||||
'processed' => 1
|
'processed' => 1
|
||||||
]);
|
]);
|
||||||
|
Periksa::where('nofoto', $data->no_id)->update([
|
||||||
|
'status' => 'Data BD di Terima',
|
||||||
|
]);
|
||||||
Log::info("Data ASTM BD ", $resultSample->toArray());
|
Log::info("Data ASTM BD ", $resultSample->toArray());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -575,6 +582,9 @@ class AstmMessageService
|
|||||||
DB::table('lis_phoenix')->where('id', $data->id)->update([
|
DB::table('lis_phoenix')->where('id', $data->id)->update([
|
||||||
'processed' => 1
|
'processed' => 1
|
||||||
]);
|
]);
|
||||||
|
Periksa::where('nofoto', $data->no_id)->update([
|
||||||
|
'status' => 'Data BD di Terima',
|
||||||
|
]);
|
||||||
Log::info("Data ASTM BD ", $resultSample->toArray());
|
Log::info("Data ASTM BD ", $resultSample->toArray());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user