Update
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Http\Controllers\SendMail;
|
||||
use App\Services\AstmMessageService;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
use App\Poli;
|
||||
use App\Periksa;
|
||||
@@ -18,7 +19,6 @@ use App\Ruangan;
|
||||
use App\Jawaban;
|
||||
use App\Subjawaban;
|
||||
use App\Setting;
|
||||
use Carbon\Carbon;
|
||||
use App\Logbook;
|
||||
use App\Filefoto;
|
||||
use App\Riwayat;
|
||||
@@ -33,6 +33,7 @@ use App\SiraB;
|
||||
use App\Organisms;
|
||||
use App\RekapAntibiotik;
|
||||
use App\PendaftaranOnListiner;
|
||||
use Carbon\Carbon;
|
||||
use Aranyasen\HL7\Message;
|
||||
use Aranyasen\HL7\Connection;
|
||||
use Aranyasen\HL7\Segment;
|
||||
@@ -50,18 +51,19 @@ use File;
|
||||
use Session;
|
||||
use QrCode;
|
||||
use Exception;
|
||||
use PDFCREATOR;
|
||||
|
||||
define( 'API_ACCESS_KEY', 'AAAA6YBXh1k:APA91bFL0q7QAXQGohXMpTwHco79f13C8PFk1Oo8kKhg1JerOulT9-37dxyP8X5ibABI0NuQ4ZsVxKQKCt7HuR7lUdJJuB-hTVnBmOUIBYfBlHb-Lcp6aGkj4erfF7J__A5hufXjF8Vt' );
|
||||
|
||||
class DokterController extends Controller
|
||||
{
|
||||
protected $lisServiceUrl;
|
||||
public function __construct()
|
||||
{
|
||||
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');
|
||||
if ($tabel == 'dengan kop' OR $tabel == 'PDF'){
|
||||
$kopsurat = url('/kopsurat.png');
|
||||
} else {
|
||||
$kopsurat = '';
|
||||
}
|
||||
@@ -172,25 +174,77 @@ class DokterController extends Controller
|
||||
$template = $cekjenis->isidata ?? '';
|
||||
$data['template'] = $template;
|
||||
if ($template == 'TCM MTB Rif (Xpert)' OR $template == 'TCM MTB Rif (Truenat)' OR $template == 'TCM MTB Rif INH (BDMAX)'){
|
||||
return view('cetak.ekspertisetbtcmmtb', $data)->render();
|
||||
$generatesurat = view('cetak.ekspertisetbtcmmtb', $data)->render();
|
||||
} else if ($template == 'TCM XDR (Xpert)'){
|
||||
return view('cetak.ekspertisetbtcmxdr', $data)->render();
|
||||
$generatesurat = view('cetak.ekspertisetbtcmxdr', $data)->render();
|
||||
} else if ($template == 'Biakan'){
|
||||
return view('cetak.ekspertisetbbiakan', $data)->render();
|
||||
$generatesurat = view('cetak.ekspertisetbbiakan', $data)->render();
|
||||
} else {
|
||||
return view('cetak.ekspertisetbmikroskopis', $data)->render();
|
||||
$generatesurat = view('cetak.ekspertisetbmikroskopis', $data)->render();
|
||||
}
|
||||
} else if ($dlp == 'CCI'){
|
||||
return view('cetak.ekspertisecci', $data)->render();
|
||||
$generatesurat = view('cetak.ekspertisecci', $data)->render();
|
||||
} else if ($dlp == 'Kultur'){
|
||||
return view('cetak.ekspertisekultur', $data)->render();
|
||||
$generatesurat = view('cetak.ekspertisekultur', $data)->render();
|
||||
} else if ($dlp == 'Pewarna Langsung'){
|
||||
return view('cetak.ekspertisepl', $data)->render();
|
||||
$generatesurat = view('cetak.ekspertisepl', $data)->render();
|
||||
} else if ($dlp == 'Viral Load'){
|
||||
return view('cetak.ekspertisevl', $data)->render();
|
||||
$generatesurat = view('cetak.ekspertisevl', $data)->render();
|
||||
} else {
|
||||
return view('cetak.ekspertisedefault', $data)->render();
|
||||
$generatesurat = view('cetak.ekspertisedefault', $data)->render();
|
||||
}
|
||||
if ($tabel == 'dengan kop'){
|
||||
return $generatesurat;
|
||||
} else if ($tabel == 'PDF'){
|
||||
try {
|
||||
$info = array(
|
||||
'Name' => 'Radiology Information System',
|
||||
'Location' => 'Rumah Sakit Dr Saiful Anwar Malang',
|
||||
'Reason' => 'Dokumen '.url('/').'/hasil/'.$periksa->nofoto.' ditandatangani secara elektronik pada '.$periksa->verifikasi,
|
||||
'ContactInfo' => $periksa->nmdokter,
|
||||
);
|
||||
$page_format = array(
|
||||
'MediaBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 330),
|
||||
'Dur' => 3,
|
||||
'PZ' => 1,
|
||||
);
|
||||
PDFCREATOR::SetProtection(array('modify', 'copy'), '', null, 0, null);
|
||||
PDFCREATOR::SetCreator($periksa->nmdokter);
|
||||
PDFCREATOR::SetAuthor($periksa->nmdokter);
|
||||
PDFCREATOR::SetTitle('Hasil Pemeriksaan '.$periksa->nofoto);
|
||||
PDFCREATOR::SetSubject($periksa->reques);
|
||||
PDFCREATOR::SetKeywords($periksa->reques);
|
||||
PDFCREATOR::setPrintHeader(false);
|
||||
PDFCREATOR::setPrintFooter(false);
|
||||
PDFCREATOR::SetMargins(5, 0, 5);
|
||||
PDFCREATOR::setFontSubsetting(true);
|
||||
PDFCREATOR::setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||
PDFCREATOR::AddPage('P', $page_format, false, false);
|
||||
$bMargin = PDFCREATOR::getBreakMargin();
|
||||
$auto_page_break = PDFCREATOR::getAutoPageBreak();
|
||||
PDFCREATOR::SetAutoPageBreak(false, 0);
|
||||
PDFCREATOR::setPageMark();
|
||||
PDFCREATOR::writeHTML($generatesurat, true, 0, true, 0);
|
||||
PDFCREATOR::setCellHeightRatio(2);
|
||||
PDFCREATOR::setFooterMargin(0);
|
||||
$pdfdoc = PDFCREATOR::Output('', 'S');
|
||||
PDFCREATOR::reset();
|
||||
$ttePath = public_path('hasilpdf');
|
||||
if (!File::exists($ttePath)) {
|
||||
File::makeDirectory($ttePath, 0755, true);
|
||||
}
|
||||
Storage::disk('langsungpublic')->put('/hasilpdf/'.$periksa->nofoto.'.pdf', $pdfdoc);
|
||||
$file = public_path('hasilpdf/'.$periksa->nofoto.'.pdf');
|
||||
return response(file_get_contents($file),200)->header('Content-Type','application/pdf');
|
||||
} catch (\Exception $e) {
|
||||
Log::error('Error Generate PDF '.$periksa->id.': '.$e->getMessage());
|
||||
return $generatesurat;
|
||||
}
|
||||
} else {
|
||||
return $generatesurat;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public function index() {
|
||||
if (Session::get('previlage') == ''){
|
||||
@@ -1845,7 +1899,6 @@ class DokterController extends Controller
|
||||
$surat = self::genSurat($periksa->id, 'dengan kop');
|
||||
$dataraw = KomponenJawaban::where('accnumber', $periksa->nofoto)->get();
|
||||
return response()->json(['htmlink' => url('/').'/hasil/'.$periksa->nofoto, 'html' => $surat, 'rawdata' => json_encode($dataraw)], 201);
|
||||
//return $surat;
|
||||
} else {
|
||||
return response()->json(['status' => 'Failed', 'message' => 'Nomor Lab : '.$nolab.' Tidak di Temukan Cek Kembali Variable Yang di Kirim Haruslah Variable nolab'], 500);
|
||||
}
|
||||
@@ -2973,6 +3026,53 @@ class DokterController extends Controller
|
||||
}
|
||||
$data[] = array(
|
||||
'nofoto' => $rows->nofoto,
|
||||
'nolab' => $rows->orderid,
|
||||
'norm' => $rows->norm,
|
||||
'jenispemeriksaan' => $rows->reques,
|
||||
'mulai' => $rows->daftar,
|
||||
'selesai' => $rows->verifikasi,
|
||||
'urlhasil' => $urlhasil,
|
||||
'status' => $status,
|
||||
'keterangan' => $keterangan,
|
||||
'rawdata' => self::genSurat($rows->id, 'dengan kop'),
|
||||
);
|
||||
}
|
||||
}
|
||||
return response()->json(['data' => $data], 201);
|
||||
}
|
||||
public function getNOLabnorm(Request $request) {
|
||||
$data = [];
|
||||
$nofoto = $request->input('nofoto');
|
||||
$noregister = $request->input('noregister');
|
||||
$homebase = url("/");
|
||||
$alldata = Periksa::where('noregister', $noregister)->get();
|
||||
if (!empty($alldata)){
|
||||
foreach($alldata as $rows){
|
||||
$urlhasil = url('/').'/hasil/'.$rows->nofoto;
|
||||
$status = $rows->status;
|
||||
$keterangan = '';
|
||||
if ($status == '' OR is_null($status)){
|
||||
$status = 'new';
|
||||
} else {
|
||||
$cekbatal = explode('batalkan dengan alasan ', $status);
|
||||
if (isset($cekbatal[1])){
|
||||
$keterangan = $cekbatal[1];
|
||||
$status = 'Batal';
|
||||
} else {
|
||||
if ($status == 'Arsip' OR $status == 'Selesai'){
|
||||
$status = 'Selesai';
|
||||
} elseif ($status == 'Decliend'){
|
||||
$status = 'Ulang';
|
||||
$keterangan = 'Di Periksa Ulang PPDS';
|
||||
} else {
|
||||
$status = 'Proses';
|
||||
}
|
||||
}
|
||||
}
|
||||
$data[] = array(
|
||||
'nofoto' => $rows->nofoto,
|
||||
'nolab' => $rows->orderid,
|
||||
'norm' => $rows->norm,
|
||||
'jenispemeriksaan' => $rows->reques,
|
||||
'mulai' => $rows->daftar,
|
||||
'selesai' => $rows->verifikasi,
|
||||
|
||||
@@ -12,6 +12,6 @@ class VerifyCsrfToken extends Middleware
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
'registerpasien', 'registerjson', 'ekstrakhasil', 'prosesbatal', 'cekaksess', 'ekstrakexpertise'
|
||||
'registerpasien', 'registerjson', 'ekstrakhasil', 'prosesbatal', 'cekaksess', 'ekstrakexpertise', 'getnolabnorm'
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user