117 lines
3.3 KiB
PHP
117 lines
3.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\ExameLaboratorial;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\ExameLaboratorial\AgendamentoExameService;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Response;
|
|
|
|
class AgendamentoExameController extends Controller
|
|
{
|
|
protected $modulo = 'exame-laboratorial';
|
|
protected $funcionalidade = 'agendamento-exame';
|
|
|
|
public function show($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(AgendamentoExameService::show($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getAgendamento($id)
|
|
{
|
|
return response()->json(AgendamentoExameService::getAgendamento($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getDetalhamento($id)
|
|
{
|
|
return response()->json(AgendamentoExameService::getDetalhamento($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function printEtiqueta($id)
|
|
{
|
|
return response()->json(AgendamentoExameService::printEtiqueta($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function printProtocolo($id)
|
|
{
|
|
return response()->json(AgendamentoExameService::printProtocolo($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getHistoricoMedicamento($id)
|
|
{
|
|
return response()->json(AgendamentoExameService::getHistoricoMedicamento($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getHistoricoExame($idAgendamento)
|
|
{
|
|
return response()->json(AgendamentoExameService::getHistoricoExame($idAgendamento), Response::HTTP_OK);
|
|
}
|
|
|
|
public function store(Request $request)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(AgendamentoExameService::store($request), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function getJornadas(Request $request)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(AgendamentoExameService::getJornadas($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getKits(Request $request)
|
|
{
|
|
|
|
return response()->json(AgendamentoExameService::getKits($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getExameAmbulatorioAtendimento()
|
|
{
|
|
|
|
return response()->json(AgendamentoExameService::getExameAmbulatorioAtendimento(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getSupervisor(Request $request)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(AgendamentoExameService::getSupervisor($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function getCotas(Request $request)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(AgendamentoExameService::getCotas($request), Response::HTTP_OK);
|
|
}
|
|
|
|
public function saveExameBloqueado(Request $request)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(AgendamentoExameService::saveExameBloqueado($request), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function descartarExameAmbulatorioAtendimento()
|
|
{
|
|
|
|
return response()->json(AgendamentoExameService::descartarExameAmbulatorioAtendimento(), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function cancel(Request $request, $id)
|
|
{
|
|
$request->validate([
|
|
'justificativa' => ['required', 'string', 'min:3', 'max:1000'],
|
|
]);
|
|
|
|
return response()->json(
|
|
AgendamentoExameService::cancel($id, $request->justificativa),
|
|
Response::HTTP_OK
|
|
);
|
|
}
|
|
}
|