init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Http\Controllers\Mobile\ConectaSusAb\Sigtap;
use App\Http\Controllers\Controller;
use App\Services\Sigtap\CidService;
use Illuminate\Http\Response;
class CidController extends Controller
{
public function index()
{
return response()->json(CidService::index()->toArray(), Response::HTTP_OK);
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Http\Controllers\Mobile\ConectaSusAb\Sigtap;
use App\Http\Controllers\Controller;
use Illuminate\Http\Response;
use App\Models\Sigtap\Ocupacao;
class OcupacaoController extends Controller
{
public function index()
{
return response()->json(Ocupacao::all()->toArray(), Response::HTTP_OK);
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Http\Controllers\Mobile\ConectaSusAb\Sigtap;
use App\Http\Controllers\Controller;
use App\Models\Sigtap\Procedimento;
use App\Models\Sigtap\Competencia;
use Illuminate\Http\Response;
class ProcedimentoController extends Controller
{
public function index()
{
$listaCamposProcedimentos = [
'id',
'competencia_id',
'codigo',
'nome',
'complexidade',
'sexo',
'idade_minima',
'idade_maxima'
];
$ultimaCompetencia = Competencia::orderBy('valor', 'desc')->first(['id']);
$procedimentos = Procedimento::where('competencia_id', $ultimaCompetencia->id)
->select($listaCamposProcedimentos)
->get()
->toArray();
return response()->json($procedimentos, Response::HTTP_OK);
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers\Mobile\ConectaSusAb\Sigtap;
use App\Http\Controllers\Controller;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
class ProcedimentoOcupacaoController extends Controller
{
public function index($ocupacaoId)
{
$competencias = DB::table('sigtap.competencia')
->select('id')
->orderByDesc('valor')
->take(4)
->pluck('id')
->toArray();
$procedimentoOcupacao = DB::table('sigtap.procedimento_ocupacao')
->whereIn('competencia_id', $competencias)
->where('ocupacao_id', $ocupacaoId)
->get()
->pluck('procedimento_id');
return response()->json($procedimentoOcupacao, Response::HTTP_OK);
}
}