Files
rkm-conectasus-ci-sandbox/api/app/Models/Ambulatorio/Agendamento.php
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

77 lines
1.6 KiB
PHP

<?php
namespace App\Models\Ambulatorio;
use App\Models\Cadastro\SujeitoAtencao\Paciente;
use App\Models\Model;
use App\Models\Regulacao\Solicitacao as RegulacaoSolicitacao;
use App\Models\Sms\SmsEnvio;
class Agendamento extends Model
{
protected $table = 'ambulatorio_agendamento';
protected $casts = [
'horario' => 'datetime:H:i',
];
protected $fillable = [
'agendamento_anterior_id',
'jornada_id',
'tipo_id',
'horario',
'paciente_id',
'status_id',
'observacao',
'motivo_cancelamento',
'motivo_agendamento_excedente',
'sms_envio_id',
'regulacao_solicitacao_id',
'origem_agendamento',
];
protected $hidden = [
'created_at',
'created_lotacao_id',
'created_centro_custo_id',
'updated_at',
'updated_lotacao_id',
'updated_centro_custo_id',
];
public function jornada()
{
return $this->belongsTo(Jornada::class);
}
public function tipo()
{
return $this->belongsTo(AgendamentoTipo::class);
}
public function paciente()
{
return $this->belongsTo(Paciente::class);
}
public function status()
{
return $this->belongsTo(AgendamentoStatus::class);
}
public function smsEnvio()
{
return $this->belongsTo(SmsEnvio::class);
}
public function regulacaoSolicitacao()
{
return $this->belongsTo(RegulacaoSolicitacao::class);
}
public function atendimento()
{
return $this->hasOne(Atendimento::class);
}
}