auth(__FUNCTION__); return response()->json(RelatorioCuidadoMulherPrevencaoCancerService::index(), Response::HTTP_OK); } public function create() { return response()->json(RelatorioCuidadoMulherPrevencaoCancerService::create(), Response::HTTP_OK); } public function list() { return response()->json(RelatorioCuidadoMulherPrevencaoCancerService::list(), Response::HTTP_OK); } public function autocompletePaciente() { return datatables() ->of(RelatorioCuidadoMulherPrevencaoCancerService::autocompletePaciente()) ->filterColumn('paciente.prontuario', function ($query, $keyword) { $query->whereRaw("LPAD(paciente.prontuario, 7, 0) like ?", ["%{$keyword}%"]); }) ->filterColumn('cidadao.cpf', function ($query, $keyword) { $query->whereRaw("cidadao.cpf like ?", ["%{$keyword}%"]) ->orWhereRaw( "CONCAT( SUBSTR(cidadao.cpf, 1, 3), '.', SUBSTR(cidadao.cpf, 4, 3), '.', SUBSTR(cidadao.cpf, 7, 3), '-', SUBSTR(cidadao.cpf, 10, 2) ) like ?", ["%{$keyword}%"] ); }) ->toJson(); } }