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,82 @@
<?php
namespace App\Models\Regulacao;
use App\Models\Cadastro\Especialidade;
use App\Models\Model;
use App\Models\Parametrizacao\Exame\Exame;
use App\Models\Parametrizacao\ProcedimentoCirurgico;
use App\Models\TransportePaciente\Destino\Destino;
use Illuminate\Database\Eloquent\SoftDeletes;
class ParametrizacaoPrestadorExterno extends Model
{
protected $table = 'regulacao_parametrizacao_prestador_externo';
use SoftDeletes;
protected $casts = [
'ativo' => 'boolean',
'deleted_at' => 'datetime'
];
protected $fillable = [
'destino_id',
'ativo',
];
protected $hidden = [
'created_at',
'created_lotacao_id',
'created_centro_custo_id',
'updated_at',
'updated_lotacao_id',
'updated_centro_custo_id',
];
public function destino()
{
return $this->belongsTo(Destino::class);
}
public function exames()
{
return $this->belongsToMany(
Exame::class,
'regulacao_parametrizacao_prestador_externo_exame',
'prestador_externo_id',
'exame_id'
)
->using(ParametrizacaoPrestadorExternoExame::class)
->as('pivotPrestadorExame')
->withPivot(['observacoes', 'ativo'])
->withTimestamps();
}
public function procedimentosCirurgicos()
{
return $this->belongsToMany(
ProcedimentoCirurgico::class,
'regulacao_parametrizacao_prestador_externo_proced_cirurgico',
'prestador_externo_id',
'procedimento_cirurgico_id'
)
->using(ParametrizacaoPrestadorExternoProcedimentoCirurgico::class)
->as('pivotPrestadorProcedimentoCirurgico')
->withPivot(['observacoes', 'ativo'])
->withTimestamps();
}
public function especialidades()
{
return $this->belongsToMany(
Especialidade::class,
'regulacao_parametrizacao_prestador_externo_especialidade',
'prestador_externo_id',
'especialidade_id'
)
->using(ParametrizacaoPrestadorExternoEspecialidade::class)
->as('pivotPrestadorEspecialidade')
->withPivot(['observacoes', 'ativo'])
->withTimestamps();
}
}