48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Farmacia;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\Farmacia\RelatorioAltoCustoProcessoPacienteService;
|
|
use Illuminate\Http\Response;
|
|
|
|
class RelatorioAltoCustoProcessoPacienteController extends Controller
|
|
{
|
|
protected $modulo = 'farmacia';
|
|
protected $funcionalidade = 'relatorio-alto-custo-processo-paciente';
|
|
|
|
public function index()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(RelatorioAltoCustoProcessoPacienteService::index(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function list()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(RelatorioAltoCustoProcessoPacienteService::list(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function autocompleteMaterial()
|
|
{
|
|
return datatables()->of(RelatorioAltoCustoProcessoPacienteService::autocompleteMaterial())->toJson();
|
|
}
|
|
|
|
public function autocompletePaciente()
|
|
{
|
|
return datatables()
|
|
->of(RelatorioAltoCustoProcessoPacienteService::autocompletePaciente())
|
|
->filterColumn('paciente.prontuario', function ($query, $keyword) {
|
|
|
|
$query->where('paciente.prontuario', (int) $keyword);
|
|
})
|
|
->filterColumn('cidadao.data_nascimento', function ($query, $keyword) {
|
|
|
|
$query->whereRaw("DATE_FORMAT(cidadao.data_nascimento, '%d/%m/%Y') like ?", ["%{$keyword}%"]);
|
|
})
|
|
->toJson();
|
|
}
|
|
}
|