Files
rkm-conectasus-ci-sandbox/api/app/Http/Controllers/ExameImagem/ReagendamentoCancelamentoExameController.php
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

94 lines
3.2 KiB
PHP

<?php
namespace App\Http\Controllers\ExameImagem;
use App\Http\Controllers\Controller;
use App\Services\ExameImagem\ReagendamentoCancelamentoExameService;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class ReagendamentoCancelamentoExameController extends Controller
{
protected $modulo = 'exame-imagem';
protected $funcionalidade = 'reagendamento-cancelamento-exame';
public function datatable(Request $request)
{
return datatables()->of(ReagendamentoCancelamentoExameService::datatable($request))
->filterColumn('cadastro_cidadao.data_nascimento', function ($query, $keyword) {
$query
->whereRaw("DATE_FORMAT(cadastro_cidadao.data_nascimento, '%d/%m/%Y') like ?", ["%{$keyword}%"])
->orWhereRaw(
"CONCAT(
SUBSTR(cadastro_cidadao.data_nascimento,9,2),
SUBSTR(cadastro_cidadao.data_nascimento,6,2),
SUBSTR(cadastro_cidadao.data_nascimento,1,4)
) like ?",
["%{$keyword}%"]
);
})
->filterColumn('cadastro_cidadao.cpf', function ($query, $keyword) {
$query
->whereRaw("cadastro_cidadao.cpf like ?", ["%{$keyword}%"])
->orWhereRaw(
"CONCAT(
SUBSTR(cadastro_cidadao.cpf,1,3),
'.',
SUBSTR(cadastro_cidadao.cpf,4,3),
'.',
SUBSTR(cadastro_cidadao.cpf,7,3),
'-',
SUBSTR(cadastro_cidadao.cpf,10,2)
) like ?",
["%{$keyword}%"]
);
})
->skipTotalRecords()
->toJson();
}
public function edit($usuarioId)
{
$this->auth(__FUNCTION__);
return response()->json(ReagendamentoCancelamentoExameService::edit($usuarioId), Response::HTTP_OK);
}
public function getJornadas(Request $request)
{
return response()->json(ReagendamentoCancelamentoExameService::getJornadas($request), Response::HTTP_OK);
}
public function getPrestadores(Request $request)
{
return response()->json(ReagendamentoCancelamentoExameService::getPrestadores($request), Response::HTTP_OK);
}
public function getGrupos(Request $request)
{
return response()->json(ReagendamentoCancelamentoExameService::getGrupos($request), Response::HTTP_OK);
}
public function getJornadasDestino(Request $request)
{
return response()->json(ReagendamentoCancelamentoExameService::getJornadasDestino($request), Response::HTTP_OK);
}
public function reschedule() {
$this->auth(__FUNCTION__);
return response()->json(ReagendamentoCancelamentoExameService::reschedule(), Response::HTTP_OK);
}
public function cancel()
{
$this->auth(__FUNCTION__);
return response()->json(ReagendamentoCancelamentoExameService::cancel(), Response::HTTP_OK);
}
}