This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\ExameLaboratorial;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\ExameLaboratorial\ImportarLaudoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ImportarLaudoController extends Controller
|
||||
{
|
||||
protected $modulo = 'exame-laboratorial';
|
||||
protected $funcionalidade = 'importar-laudo';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ImportarLaudoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ImportarLaudoService::list($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function load(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ImportarLaudoService::load($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ImportarLaudoService::show($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ImportarLaudoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function getExames($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ImportarLaudoService::getExames($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function download($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
$response = ImportarLaudoService::download($id);
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
];
|
||||
|
||||
return response()->download($response['arquivo'], $response['nome'], $headers);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ImportarLaudoService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user