This commit is contained in:
57
api/app/Http/Controllers/Raas/ExportacaoController.php
Normal file
57
api/app/Http/Controllers/Raas/ExportacaoController.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Raas;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Raas\ExportacaoService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ExportacaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'raas';
|
||||
protected $funcionalidade = 'exportacao';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::store(), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function update($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::update($id), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()->of(ExportacaoService::datatable())->skipTotalRecords()->make(true);
|
||||
}
|
||||
|
||||
public function download($id)
|
||||
{
|
||||
$response = ExportacaoService::download($id);
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'text/plain;charset=UTF-8',
|
||||
];
|
||||
|
||||
return response()->download($response['arquivo'], $response['nome'], $headers);
|
||||
}
|
||||
}
|
||||
80
api/app/Http/Controllers/Raas/ProcedimentoController.php
Normal file
80
api/app/Http/Controllers/Raas/ProcedimentoController.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Raas;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Raas\ProcedimentoService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ProcedimentoController extends Controller
|
||||
{
|
||||
protected $modulo = 'raas';
|
||||
protected $funcionalidade = 'procedimento';
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(ProcedimentoService::datatable())
|
||||
->filterColumn('atendimento.data_admissao', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("DATE_FORMAT(atendimento.data_admissao, '%d/%m/%Y') like ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(atendimento.data_admissao,9,2),
|
||||
SUBSTR(atendimento.data_admissao,6,2),
|
||||
SUBSTR(atendimento.data_admissao,1,4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->filterColumn('cid_principal', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("cid_principal.nome like ?", ["%{$keyword}%"])
|
||||
->orWhereRaw("REPLACE(cid_principal.codigo, '.', '') like ?", ['%' . str_replace('.', '', $keyword) . '%']);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoService::store(), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoService::update($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroyAutomaticos($unidadeId, $competenciaId)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoService::destroyAutomaticos($unidadeId, $competenciaId), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Raas;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Raas\RelatorioInconsistenciaService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioInconsistenciaController extends Controller
|
||||
{
|
||||
protected $modulo = 'raas';
|
||||
protected $funcionalidade = 'relatorio-inconsistencia';
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioInconsistenciaService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return response()->json(RelatorioInconsistenciaService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(RelatorioInconsistenciaService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function autocomplete()
|
||||
{
|
||||
return datatables()->of(RelatorioInconsistenciaService::autocomplete())->toJson();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user