95 lines
2.2 KiB
PHP
95 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Raas;
|
|
|
|
use App\Models\Ambulatorio\AtendimentoProcedimento as AmbulatorioAtendimentoProcedimento;
|
|
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
|
use App\Models\Model;
|
|
use App\Models\Sigtap\Classificacao;
|
|
use App\Models\Sigtap\Competencia;
|
|
use App\Models\Sigtap\Ocupacao;
|
|
use App\Models\Sigtap\Procedimento;
|
|
use App\Models\Sigtap\Servico;
|
|
|
|
class AtendimentoProcedimento extends Model
|
|
{
|
|
protected $table = 'raas_atendimento_procedimento';
|
|
|
|
protected $casts = [
|
|
'data_execucao' => 'datetime:d/m/Y',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'atendimento_id',
|
|
'usuario_id',
|
|
'ocupacao_id',
|
|
'procedimento_id',
|
|
'quantidade',
|
|
'data_execucao',
|
|
'servico_id',
|
|
'classificacao_id',
|
|
'local_realizacao_exame_id',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'created_lotacao_id',
|
|
'created_centro_custo_id',
|
|
'updated_at',
|
|
'updated_lotacao_id',
|
|
'updated_centro_custo_id',
|
|
];
|
|
|
|
public function atendimento()
|
|
{
|
|
return $this->belongsTo(Atendimento::class);
|
|
}
|
|
|
|
public function competencia()
|
|
{
|
|
return $this->belongsTo(Competencia::class);
|
|
}
|
|
|
|
public function procedimento()
|
|
{
|
|
return $this->belongsTo(Procedimento::class);
|
|
}
|
|
|
|
public function ocupacao()
|
|
{
|
|
return $this->belongsTo(Ocupacao::class);
|
|
}
|
|
|
|
public function usuario()
|
|
{
|
|
return $this->belongsTo(Usuario::class);
|
|
}
|
|
|
|
public function servico()
|
|
{
|
|
return $this->belongsTo(Servico::class);
|
|
}
|
|
|
|
public function classificacao()
|
|
{
|
|
return $this->belongsTo(Classificacao::class);
|
|
}
|
|
|
|
public function localRealizacaoExame()
|
|
{
|
|
return $this->belongsTo(LocalRealizacaoExame::class);
|
|
}
|
|
|
|
public function inconsistencias()
|
|
{
|
|
return $this->belongsToMany(Inconsistencia::class, 'raas_atendimento_procedimento_inconsistencia')
|
|
->using(AtendimentoProcedimentoInconsistencia::class)
|
|
->withTimestamps();
|
|
}
|
|
|
|
public function ambulatorioProcedimentos()
|
|
{
|
|
return $this->hasMany(AmbulatorioAtendimentoProcedimento::class, 'raas_atendimento_procedimento_id');
|
|
}
|
|
}
|