This commit is contained in:
88
api/app/Models/ProntoAtendimento/PedidoExame/Item.php
Normal file
88
api/app/Models/ProntoAtendimento/PedidoExame/Item.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\PedidoExame;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Lotacao;
|
||||
use App\Models\Model;
|
||||
use App\Models\Parametrizacao\Exame\Exame;
|
||||
use App\Models\Parametrizacao\Exame\ExameStatus;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Enfermagem\AtendimentoEnfermagem;
|
||||
use App\Models\ProntoAtendimento\Atendimento\ExameImagem\AtendimentoExameImagem;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Observacao\PacienteObservacao;
|
||||
use Dyrynda\Database\Support\CascadeSoftDeletes;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Item extends Model
|
||||
{
|
||||
use SoftDeletes, CascadeSoftDeletes;
|
||||
|
||||
protected $table = 'pronto_atendimento_pedido_exame_item';
|
||||
|
||||
protected $fillable = [
|
||||
'atendimento_enfermagem_id',
|
||||
'exame_imagem_id',
|
||||
'paciente_observacao_id',
|
||||
'exame_id',
|
||||
'valor_exame',
|
||||
'status_id',
|
||||
'horario_realizacao',
|
||||
'lotacao_executante_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 = [
|
||||
'exame',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function pedidoExame()
|
||||
{
|
||||
return $this->belongsTo(PedidoExame::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 exame()
|
||||
{
|
||||
return $this->belongsTo(Exame::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(ExameStatus::class, 'status_id');
|
||||
}
|
||||
|
||||
public function lotacaoExecutante()
|
||||
{
|
||||
return $this->belongsTo(Lotacao::class);
|
||||
}
|
||||
|
||||
public function observacoes()
|
||||
{
|
||||
return $this->hasMany(Observacao::class);
|
||||
}
|
||||
}
|
||||
54
api/app/Models/ProntoAtendimento/PedidoExame/Laudo.php
Normal file
54
api/app/Models/ProntoAtendimento/PedidoExame/Laudo.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\PedidoExame;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Enfermagem\AtendimentoEnfermagem;
|
||||
use App\Models\ProntoAtendimento\Atendimento\ExameImagem\AtendimentoExameImagem;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Observacao\PacienteObservacao;
|
||||
|
||||
class Laudo extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_pedido_exame_laudo';
|
||||
|
||||
protected $fillable = [
|
||||
'pedido_exame_id',
|
||||
'atendimento_enfermagem_id',
|
||||
'exame_imagem_id',
|
||||
'paciente_observacao_id',
|
||||
'nome',
|
||||
'hash'
|
||||
];
|
||||
|
||||
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',
|
||||
];
|
||||
|
||||
public function pedidoExame()
|
||||
{
|
||||
return $this->belongsTo(PedidoExame::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);
|
||||
}
|
||||
}
|
||||
38
api/app/Models/ProntoAtendimento/PedidoExame/Observacao.php
Normal file
38
api/app/Models/ProntoAtendimento/PedidoExame/Observacao.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\PedidoExame;
|
||||
|
||||
use App\Models\Parametrizacao\Exame\Exame;
|
||||
use App\Models\Model;
|
||||
use Dyrynda\Database\Support\CascadeSoftDeletes;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\Parametrizacao\Exame\ExameStatus;
|
||||
|
||||
class Observacao extends Model
|
||||
{
|
||||
use SoftDeletes, CascadeSoftDeletes;
|
||||
|
||||
protected $table = 'pronto_atendimento_pedido_exame_item_observacao';
|
||||
|
||||
protected $fillable = [
|
||||
'observacao',
|
||||
'item_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',
|
||||
];
|
||||
|
||||
public function pedidoExameItem()
|
||||
{
|
||||
return $this->belongsTo(Item::class);
|
||||
}
|
||||
}
|
||||
102
api/app/Models/ProntoAtendimento/PedidoExame/PedidoExame.php
Normal file
102
api/app/Models/ProntoAtendimento/PedidoExame/PedidoExame.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user