137 lines
3.2 KiB
PHP
137 lines
3.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Ambulatorio;
|
|
|
|
use App\Models\Apac\MotivoSaidaPermanencia;
|
|
use App\Models\Apac\SolicitacaoAutorizacao;
|
|
use App\Models\Cadastro\EtapaClinica;
|
|
use App\Models\Cadastro\Oci;
|
|
use App\Models\Cadastro\SujeitoAtencao\Lotacao;
|
|
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
|
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
|
use App\Models\Model;
|
|
use App\Models\Sigtap\Cid;
|
|
use App\Models\Sigtap\Ocupacao;
|
|
use App\Models\Sigtap\Procedimento;
|
|
|
|
class AcompanhamentoOci extends Model
|
|
{
|
|
protected $table = 'ambulatorio_acompanhamento_oci';
|
|
|
|
protected $casts = [
|
|
'iniciado_em' => 'datetime',
|
|
'finalizado_em' => 'datetime',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'paciente_id',
|
|
'ocupacao_id',
|
|
'oci_id',
|
|
'etapa_clinica_atual_id',
|
|
'status_id',
|
|
'iniciado_em',
|
|
'iniciado_lotacao_id',
|
|
'finalizado_em',
|
|
'finalizado_lotacao_id',
|
|
'finalizado_motivo_encerramento_id',
|
|
'finalizado_observacao',
|
|
'motivo_saida_permanencia_id',
|
|
'procedimento_oci_data',
|
|
'procedimento_oci_procedimento_id',
|
|
'procedimento_oci_cid_id',
|
|
'procedimento_oci_quantidade',
|
|
'procedimento_oci_ocupacao_id',
|
|
'procedimento_oci_usuario_id',
|
|
'apac_solicitacao_autorizacao_id',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'created_lotacao_id',
|
|
'created_centro_custo_id',
|
|
'updated_at',
|
|
'updated_lotacao_id',
|
|
'updated_centro_custo_id',
|
|
];
|
|
|
|
public function paciente()
|
|
{
|
|
return $this->belongsTo(Paciente::class);
|
|
}
|
|
|
|
public function ocupacao()
|
|
{
|
|
return $this->belongsTo(Ocupacao::class);
|
|
}
|
|
|
|
public function oci()
|
|
{
|
|
return $this->belongsTo(Oci::class);
|
|
}
|
|
|
|
public function status()
|
|
{
|
|
return $this->belongsTo(AcompanhamentoOciStatus::class);
|
|
}
|
|
|
|
public function etapaClinicaAtual()
|
|
{
|
|
return $this->belongsTo(EtapaClinica::class);
|
|
}
|
|
|
|
public function iniciadoLotacao()
|
|
{
|
|
return $this->belongsTo(Lotacao::class);
|
|
}
|
|
|
|
public function finalizadoLotacao()
|
|
{
|
|
return $this->belongsTo(Lotacao::class);
|
|
}
|
|
|
|
public function motivoSaidaPermanencia()
|
|
{
|
|
return $this->belongsTo(MotivoSaidaPermanencia::class);
|
|
}
|
|
|
|
public function finalizadoMotivoEncerramento()
|
|
{
|
|
return $this->belongsTo(AcompanhamentoOciMotivoEncerramento::class);
|
|
}
|
|
|
|
public function procedimentoOciProcedimento()
|
|
{
|
|
return $this->belongsTo(Procedimento::class);
|
|
}
|
|
|
|
public function procedimentoOciCid()
|
|
{
|
|
return $this->belongsTo(Cid::class);
|
|
}
|
|
|
|
public function procedimentoOciOcupacao()
|
|
{
|
|
return $this->belongsTo(Ocupacao::class);
|
|
}
|
|
|
|
public function procedimentoOciUsuario()
|
|
{
|
|
return $this->belongsTo(Usuario::class);
|
|
}
|
|
|
|
public function apacSolicitacaoAutorizacao()
|
|
{
|
|
return $this->belongsTo(SolicitacaoAutorizacao::class);
|
|
}
|
|
|
|
public function etapasClinicasConcluidas()
|
|
{
|
|
return $this->hasMany(AcompanhamentoOciEtapaClinicaConcluida::class);
|
|
}
|
|
|
|
public function procedimentosRealizados()
|
|
{
|
|
return $this->hasMany(AcompanhamentoOciProcedimentoRealizado::class);
|
|
}
|
|
}
|