125 lines
3.8 KiB
PHP
125 lines
3.8 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\ExameLaboratorial;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\ExameLaboratorial\ParametrizacaoService;
|
|
use App\Models\ExameLaboratorial\Parametrizacao\CotaExamePeriodo;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Response;
|
|
|
|
class ParametrizacaoController extends Controller
|
|
{
|
|
protected $modulo = 'exame-laboratorial';
|
|
protected $funcionalidade = 'parametrizacao';
|
|
|
|
public function create()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(ParametrizacaoService::create(), Response::HTTP_OK);
|
|
}
|
|
|
|
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 list()
|
|
{
|
|
return response()->json(ParametrizacaoService::list(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function store(Request $request)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(ParametrizacaoService::store($request), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function saldo_exame(Request $request)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(ParametrizacaoService::saldo_exame($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getCotaExame(Request $request)
|
|
{
|
|
return response()->json(ParametrizacaoService::getCotaExame($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getCotaLaboratorio(Request $request)
|
|
{
|
|
return response()->json(ParametrizacaoService::getCotaLaboratorio($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getListagemCotaLaboratorio(Request $request)
|
|
{
|
|
return response()->json(ParametrizacaoService::getListagemCotaLaboratorio($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getCotaLaboratorioUnidade(Request $request)
|
|
{
|
|
return response()->json(ParametrizacaoService::getCotaLaboratorioUnidade($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getCotaLaboratorioTransferencia(Request $request)
|
|
{
|
|
return response()->json(ParametrizacaoService::getCotaLaboratorioTransferencia($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getCotaLaboratorioTranferenciaUnidade(Request $request)
|
|
{
|
|
return response()->json(ParametrizacaoService::getCotaLaboratorioUnidade($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getCotaLaboratorioExame(Request $request)
|
|
{
|
|
return response()->json(ParametrizacaoService::getCotaLaboratorioExame($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getCotaLaboratorioExameUnidade()
|
|
{
|
|
return response()->json(ParametrizacaoService::getCotaLaboratorioExameUnidade(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function lotacoes(Request $request)
|
|
{
|
|
|
|
return response()->json(ParametrizacaoService::lotacoes($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function saldo_unidade_solicitante(Request $request)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(ParametrizacaoService::saldo_unidade_solicitante($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getExamesUnidadeSolicitante()
|
|
{
|
|
return response()->json(ParametrizacaoService::getExamesUnidadeSolicitante(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getUnidadeFaturamento()
|
|
{
|
|
return response()->json(ParametrizacaoService::getUnidadeFaturamento(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getLaboratorioFaturamento()
|
|
{
|
|
return response()->json(ParametrizacaoService::getLaboratorioFaturamento(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
|
|
return response()->json(CotaExamePeriodo::destroy($id), Response::HTTP_NO_CONTENT);
|
|
}
|
|
|
|
}
|