This commit is contained in:
81
api/app/Models/Regulacao/ParametrizacaoPrestadorInterno.php
Normal file
81
api/app/Models/Regulacao/ParametrizacaoPrestadorInterno.php
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user