61 lines
1.6 KiB
PHP
61 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Regulacao;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\Regulacao\ParametrizacaoService;
|
|
use Illuminate\Http\Response;
|
|
|
|
class ParametrizacaoController extends Controller
|
|
{
|
|
protected $modulo = 'regulacao';
|
|
protected $funcionalidade = 'parametrizacao';
|
|
|
|
public function autocompleteGrupoExame()
|
|
{
|
|
return datatables()
|
|
->of(ParametrizacaoService::autocompleteGrupoExame())
|
|
->toJson();
|
|
}
|
|
|
|
public function autocompleteExame()
|
|
{
|
|
return datatables()
|
|
->of(ParametrizacaoService::autocompleteExame())
|
|
->editColumn('grupo_id', fn ($i) => is_null($i->grupo_id) ? null : (int) $i->grupo_id)
|
|
->toJson();
|
|
}
|
|
|
|
public function autocompleteProcedimentoCirurgico()
|
|
{
|
|
return datatables()
|
|
->of(ParametrizacaoService::autocompleteProcedimentoCirurgico())
|
|
->editColumn('grupo_id', fn ($i) => is_null($i->grupo_id) ? null : (int) $i->grupo_id)
|
|
->toJson();
|
|
}
|
|
|
|
public function autocompleteEspecialidade()
|
|
{
|
|
return datatables()->of(ParametrizacaoService::autocompleteEspecialidade())->toJson();
|
|
}
|
|
|
|
public function list()
|
|
{
|
|
return response()->json(ParametrizacaoService::list(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(ParametrizacaoService::create(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(ParametrizacaoService::store(), Response::HTTP_CREATED);
|
|
}
|
|
}
|