132 lines
3.0 KiB
PHP
132 lines
3.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models\ExameImagem\Agendamento;
|
|
|
|
|
|
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
|
use App\Models\Cadastro\Estabelecimento\Unidade;
|
|
use App\Models\Cadastro\Grupo\Grupo;
|
|
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
|
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
|
use App\Models\ExameImagem\Agendamento\AgendamentoExame;
|
|
use App\Models\ExameImagem\Jornada\Jornada;
|
|
use App\Models\Model;
|
|
use App\Models\Parametrizacao\Exame\Exame;
|
|
use App\Models\Regulacao\Solicitacao as RegulacaoSolicitacao;
|
|
use App\Models\Sms\SmsEnvio;
|
|
|
|
class Agendamento extends Model
|
|
{
|
|
protected $table = 'exame_imagem_agendamento';
|
|
|
|
protected $fillable = [
|
|
'id',
|
|
'paciente_id',
|
|
'unidade_id',
|
|
'infraestrutura_id',
|
|
'unidade_solicitante_id',
|
|
'infraestrutura_solicitante_id',
|
|
'exame_id',
|
|
'medico_id',
|
|
'hora_exame',
|
|
'jornada_id',
|
|
'profissional_id',
|
|
'gestante',
|
|
'urgente',
|
|
'observacao',
|
|
'agendamento_numero',
|
|
'supervisor_id',
|
|
'nome_responsavel',
|
|
'retroativo',
|
|
'agendador_id',
|
|
'regulacao_solicitacao_id',
|
|
'sms_envio_id',
|
|
'app_conectasus_cidadao',
|
|
];
|
|
|
|
protected $casts = [
|
|
'data' => 'datetime:d/m/Y',
|
|
'data_menstruacao' => 'datetime:d/m/Y',
|
|
'gestante' => 'boolean',
|
|
'urgente' => 'boolean',
|
|
'retroativo' => 'boolean',
|
|
'app_conectasus_cidadao' => 'boolean',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_lotacao_id',
|
|
'created_centro_custo_id',
|
|
'updated_at',
|
|
'updated_lotacao_id',
|
|
'updated_centro_custo_id',
|
|
'deleted_at',
|
|
'deleted_lotacao_id',
|
|
'deleted_centro_custo_id',
|
|
];
|
|
|
|
public function unidade()
|
|
{
|
|
return $this->belongsTo(Unidade::class);
|
|
}
|
|
|
|
public function unidadeSolicitante()
|
|
{
|
|
return $this->belongsTo(Unidade::class);
|
|
}
|
|
|
|
public function exame()
|
|
{
|
|
return $this->belongsTo(Exame::class);
|
|
}
|
|
|
|
public function infraestruturaSolicitante()
|
|
{
|
|
return $this->belongsTo(Infraestrutura::class);
|
|
}
|
|
|
|
public function infraestrutura()
|
|
{
|
|
return $this->belongsTo(Infraestrutura::class);
|
|
}
|
|
|
|
public function usuario()
|
|
{
|
|
return $this->belongsTo(Usuario::class);
|
|
}
|
|
|
|
public function medico()
|
|
{
|
|
return $this->belongsTo(Usuario::class);
|
|
}
|
|
|
|
public function agendamentoExame()
|
|
{
|
|
return $this->hasMany(AgendamentoExame::class);
|
|
}
|
|
|
|
public function jornada()
|
|
{
|
|
return $this->belongsTo(Jornada::class);
|
|
}
|
|
|
|
public function paciente()
|
|
{
|
|
return $this->belongsTo(Paciente::class);
|
|
}
|
|
|
|
public function grupo()
|
|
{
|
|
return $this->belongsTo(Grupo::class, 'exame_id');
|
|
}
|
|
|
|
public function regulacaoSolicitacao()
|
|
{
|
|
return $this->belongsTo(RegulacaoSolicitacao::class);
|
|
}
|
|
|
|
public function smsEnvio()
|
|
{
|
|
return $this->belongsTo(SmsEnvio::class);
|
|
}
|
|
}
|