init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View 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);
}
}