67 lines
1.9 KiB
PHP
67 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Ambulatorio;
|
|
|
|
use App\Exceptions\Ambulatorio\NaoPodeCriarFichaAtencaoBasicaException;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\Ambulatorio\AtendimentoEnfermagemService;
|
|
use Illuminate\Http\Response;
|
|
|
|
class AtendimentoEnfermagemController extends Controller
|
|
{
|
|
protected $modulo = 'ambulatorio';
|
|
protected $funcionalidade = 'atendimento-enfermagem';
|
|
|
|
public function list()
|
|
{
|
|
return response()->json(AtendimentoEnfermagemService::list(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(AtendimentoEnfermagemService::create(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
try {
|
|
|
|
return response()->json(AtendimentoEnfermagemService::store(), Response::HTTP_CREATED);
|
|
}
|
|
catch (NaoPodeCriarFichaAtencaoBasicaException $e) {
|
|
|
|
return response()->json(['message' => $e->getMessage()], Response::HTTP_BAD_REQUEST);
|
|
}
|
|
}
|
|
|
|
public function validarProcedimentosCbo()
|
|
{
|
|
return response()->json(AtendimentoEnfermagemService::validarProcedimentosCbo(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function uploadImagem()
|
|
{
|
|
return response()->json(AtendimentoEnfermagemService::uploadImagem(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
|
|
return response()->json(AtendimentoEnfermagemService::destroy($id), Response::HTTP_NO_CONTENT);
|
|
}
|
|
|
|
public function storeFeridaProcedimento()
|
|
{
|
|
return response()->json(AtendimentoEnfermagemService::storeFeridaProcedimento(), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function destroyFeridaProcedimento($id)
|
|
{
|
|
return response()->json(AtendimentoEnfermagemService::destroyFeridaProcedimento($id), Response::HTTP_NO_CONTENT);
|
|
}
|
|
}
|