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,81 @@
<?php
namespace App\Models\Regulacao;
use App\Models\Cadastro\Especialidade;
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
use App\Models\Model;
use App\Models\Parametrizacao\Exame\Exame;
use App\Models\Parametrizacao\ProcedimentoCirurgico;
class ParametrizacaoPrestadorInterno extends Model
{
protected $table = 'regulacao_parametrizacao_prestador_interno';
protected $casts = [
'controla_protocolo_fechamento' => 'boolean',
'ativo' => 'boolean',
];
protected $fillable = [
'infraestrutura_id',
'controla_protocolo_fechamento',
'ativo',
];
protected $hidden = [
'created_at',
'created_lotacao_id',
'created_centro_custo_id',
'updated_at',
'updated_lotacao_id',
'updated_centro_custo_id',
];
public function infraestrutura()
{
return $this->belongsTo(Infraestrutura::class);
}
public function exames()
{
return $this->belongsToMany(
Exame::class,
'regulacao_parametrizacao_prestador_interno_exame',
'prestador_interno_id',
'exame_id'
)
->using(ParametrizacaoPrestadorInternoExame::class)
->as('pivotPrestadorExame')
->withPivot(['observacoes', 'ativo'])
->withTimestamps();
}
public function procedimentosCirurgicos()
{
return $this->belongsToMany(
ProcedimentoCirurgico::class,
'regulacao_parametrizacao_prestador_interno_proced_cirurgico',
'prestador_interno_id',
'procedimento_cirurgico_id'
)
->using(ParametrizacaoPrestadorInternoProcedimentoCirurgico::class)
->as('pivotPrestadorProcedimentoCirurgico')
->withPivot(['observacoes', 'ativo'])
->withTimestamps();
}
public function especialidades()
{
return $this->belongsToMany(
Especialidade::class,
'regulacao_parametrizacao_prestador_interno_especialidade',
'prestador_interno_id',
'especialidade_id'
)
->using(ParametrizacaoPrestadorInternoEspecialidade::class)
->as('pivotPrestadorEspecialidade')
->withPivot(['observacoes', 'ativo'])
->withTimestamps();
}
}