110 lines
2.4 KiB
PHP
110 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models\TransportePaciente;
|
|
|
|
use App\Models\Model;
|
|
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
|
use App\Models\TransportePaciente\Motivo\Motivo;
|
|
use App\Models\Geral\DiaSemana;
|
|
use App\Models\Intranet\Municipio;
|
|
use App\Models\TransportePaciente\Destino\Destino;
|
|
use App\Models\TransportePaciente\Jornada\Jornada;
|
|
use App\Models\TransportePaciente\Ponto\Ponto;
|
|
use App\Models\TransportePaciente\Veiculo\TipoPassageiro;
|
|
use App\Models\TransportePaciente\Veiculo\Veiculo;
|
|
use App\Models\TransportePaciente\Agendar\Agendar;
|
|
|
|
class PreAgendamentoTransporte extends Model
|
|
{
|
|
protected $table = 'transporte_paciente_pre_agendamento_transporte';
|
|
|
|
protected $fillable = [
|
|
'id',
|
|
'paciente_id',
|
|
'motivo_id',
|
|
'horario',
|
|
'data',
|
|
'municipio_id',
|
|
'destino_id',
|
|
'acompanhante',
|
|
'ponto_id',
|
|
'observacao',
|
|
'data_saida',
|
|
'horario_saida',
|
|
'veiculo_id',
|
|
'jornada_id',
|
|
'tipo_passageiro_id',
|
|
'acompanhante_1_id',
|
|
'acompanhante_2_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 motivo()
|
|
{
|
|
return $this->belongsTo(Motivo::class);
|
|
}
|
|
|
|
public function diaSemana()
|
|
{
|
|
return $this->belongsTo(DiaSemana::class);
|
|
}
|
|
|
|
public function municipio()
|
|
{
|
|
return $this->belongsTo(Municipio::class);
|
|
}
|
|
|
|
public function destino()
|
|
{
|
|
return $this->belongsTo(Destino::class);
|
|
}
|
|
|
|
public function ponto()
|
|
{
|
|
return $this->belongsTo(Ponto::class);
|
|
}
|
|
|
|
public function veiculo()
|
|
{
|
|
return $this->belongsTo(Veiculo::class);
|
|
}
|
|
|
|
public function jornada()
|
|
{
|
|
return $this->belongsTo(Jornada::class);
|
|
}
|
|
|
|
public function tipoPassageiro()
|
|
{
|
|
return $this->belongsTo(TipoPassageiro::class);
|
|
}
|
|
|
|
public function acompanhante1()
|
|
{
|
|
return $this->belongsTo(Acompanhante::class, 'acompanhante_1_id');
|
|
}
|
|
|
|
public function acompanhante2()
|
|
{
|
|
return $this->belongsTo(Acompanhante::class, 'acompanhante_2_id');
|
|
}
|
|
|
|
public function agendamento()
|
|
{
|
|
return $this->hasOne(Agendar::class, 'pre_agendamento_id');
|
|
}
|
|
}
|