103 lines
2.6 KiB
PHP
103 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace App\Models\ProntoAtendimento\PedidoExame;
|
|
|
|
use App\Models\Model;
|
|
use App\Models\ProntoAtendimento\Atendimento\Atendimento;
|
|
use App\Models\ProntoAtendimento\Atendimento\Enfermagem\AtendimentoEnfermagem;
|
|
use App\Models\ProntoAtendimento\Atendimento\ExameImagem\AtendimentoExameImagem;
|
|
use App\Models\ProntoAtendimento\Atendimento\Medico\AtendimentoMedico;
|
|
use App\Models\ProntoAtendimento\Atendimento\Observacao\PacienteObservacao;
|
|
use App\Models\ProntoAtendimento\Plantao\Plantao;
|
|
use Dyrynda\Database\Support\CascadeSoftDeletes;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class PedidoExame extends Model
|
|
{
|
|
use SoftDeletes, CascadeSoftDeletes;
|
|
|
|
protected $table = 'pronto_atendimento_pedido_exame';
|
|
|
|
protected $casts = [
|
|
'urgente' => 'boolean',
|
|
'data_solicitacao' => 'date',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'atendimento_id',
|
|
'atendimento_medico_id',
|
|
'atendimento_enfermagem_id',
|
|
'paciente_observacao_id',
|
|
'exame_imagem_id',
|
|
'plantao_id',
|
|
'data_solicitacao',
|
|
'unidade_encaminhamento_id',
|
|
'unidade_externa_encaminhamento_id',
|
|
'medico_solicitante_encaminhamento',
|
|
'urgente',
|
|
'justificativa',
|
|
'usuario_id',
|
|
'ocupacao_id',
|
|
'lotacao_id',
|
|
'laboratorio_usuario_id',
|
|
'laboratorio_ocupacao_id',
|
|
'laboratorio_lotacao_id',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'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',
|
|
];
|
|
|
|
protected $with = [
|
|
'exames'
|
|
];
|
|
|
|
public function atendimento()
|
|
{
|
|
return $this->belongsTo(Atendimento::class);
|
|
}
|
|
|
|
public function atendimentoMedico()
|
|
{
|
|
return $this->belongsTo(AtendimentoMedico::class);
|
|
}
|
|
|
|
public function atendimentoEnfermagem()
|
|
{
|
|
return $this->belongsTo(AtendimentoEnfermagem::class);
|
|
}
|
|
|
|
public function atendimentoExameImagem()
|
|
{
|
|
return $this->belongsTo(AtendimentoExameImagem::class, 'exame_imagem_id');
|
|
}
|
|
|
|
public function pacienteObservacao()
|
|
{
|
|
return $this->belongsTo(PacienteObservacao::class);
|
|
}
|
|
|
|
public function plantao()
|
|
{
|
|
return $this->belongsTo(Plantao::class);
|
|
}
|
|
|
|
public function exames()
|
|
{
|
|
return $this->hasMany(Item::class);
|
|
}
|
|
|
|
public function laudos()
|
|
{
|
|
return $this->hasMany(Laudo::class);
|
|
}
|
|
}
|