This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Atendimento\Triagem;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Atendimento;
|
||||
use App\Models\ProntoAtendimento\Atendimento\AvaliacaoAntropometrica;
|
||||
use App\Models\ProntoAtendimento\Atendimento\ClassificacaoRisco;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Enfermagem\Historico;
|
||||
use App\Models\ProntoAtendimento\Atendimento\EscalaComaGlasgow;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Gestacao;
|
||||
use App\Models\ProntoAtendimento\Atendimento\MedicamentoUso;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Medico\DeclaracaoComparecimento;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Observacao;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Procedimento;
|
||||
use App\Models\ProntoAtendimento\Atendimento\SinalVital;
|
||||
use App\Models\ProntoAtendimento\Plantao\Plantao;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class AtendimentoTriagem extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'pronto_atendimento_atendimento_triagem';
|
||||
|
||||
protected $casts = [
|
||||
'is_faa_assinada' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'atendimento_id',
|
||||
'plantao_id',
|
||||
'historico_individual_familiar',
|
||||
'outras_avaliacoes_condicoes',
|
||||
'is_faa_assinada',
|
||||
];
|
||||
|
||||
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 atendimento()
|
||||
{
|
||||
return $this->belongsTo(Atendimento::class);
|
||||
}
|
||||
|
||||
public function plantao()
|
||||
{
|
||||
return $this->belongsTo(Plantao::class);
|
||||
}
|
||||
|
||||
public function avaliacaoAntropometrica()
|
||||
{
|
||||
return $this->hasOne(AvaliacaoAntropometrica::class);
|
||||
}
|
||||
|
||||
public function classificacaoRisco()
|
||||
{
|
||||
return $this->hasOne(ClassificacaoRisco::class);
|
||||
}
|
||||
|
||||
public function gestacao()
|
||||
{
|
||||
return $this->hasOne(Gestacao::class);
|
||||
}
|
||||
|
||||
public function medicamentosUso()
|
||||
{
|
||||
return $this->hasMany(MedicamentoUso::class);
|
||||
}
|
||||
|
||||
public function observacao()
|
||||
{
|
||||
return $this->hasOne(Observacao::class);
|
||||
}
|
||||
|
||||
public function procedimentos()
|
||||
{
|
||||
return $this->hasMany(Procedimento::class);
|
||||
}
|
||||
|
||||
public function sinaisVitais()
|
||||
{
|
||||
return $this->hasMany(SinalVital::class);
|
||||
}
|
||||
|
||||
public function historico()
|
||||
{
|
||||
return $this->hasOne(Historico::class);
|
||||
}
|
||||
|
||||
public function declaracoesComparecimento()
|
||||
{
|
||||
return $this->hasMany(DeclaracaoComparecimento::class);
|
||||
}
|
||||
|
||||
public function escalasComaGlasgow()
|
||||
{
|
||||
return $this->hasMany(EscalaComaGlasgow::class);
|
||||
}
|
||||
|
||||
public function encaminhamentos()
|
||||
{
|
||||
return $this->hasMany(Encaminhamento::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return $this->hasNoOne([
|
||||
'avaliacaoAntropometrica',
|
||||
'classificacaoRisco',
|
||||
'gestacao',
|
||||
'medicamentosUso',
|
||||
'observacao',
|
||||
'procedimentos',
|
||||
'sinaisVitais',
|
||||
'historico',
|
||||
'encaminhamentos',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Atendimento\Triagem;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DorToracicaSinalInstabilidade extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_dor_toracica_sinal_instabilidade';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Atendimento\Triagem;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Encaminhamento extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'pronto_atendimento_atendimento_triagem_encaminhamento';
|
||||
|
||||
protected $casts = [
|
||||
'urgente' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'infraestrutura_id',
|
||||
'urgente',
|
||||
'motivo',
|
||||
'observacoes'
|
||||
];
|
||||
|
||||
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 atendimentoTriagem()
|
||||
{
|
||||
return $this->belongsTo(AtendimentoTriagem::class);
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Atendimento\Triagem;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Atendimento;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Triagem\RelacionadoFormularioDorToracica;
|
||||
|
||||
|
||||
class FormularioDorToracica extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_triagem_formulario_dor_toracica';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'atendimento_id',
|
||||
'dor_toracica_id',
|
||||
'dispneia',
|
||||
'hora_sintoma',
|
||||
'hora_ecg_admissao',
|
||||
'data_sintoma',
|
||||
'data_ecg_admissao',
|
||||
'protocolo_finalizado',
|
||||
'protocolo_finalizado_em',
|
||||
'protocolo_tem_prosseguimento',
|
||||
'tem_contra_indicacao_trombolitico',
|
||||
'contra_indicacao_trombolitico_motivo',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'dispneia' => 'boolean',
|
||||
'protocolo_finalizado' => 'boolean',
|
||||
'protocolo_finalizado_em' => 'datetime:d/m/Y H:i:s',
|
||||
'protocolo_tem_prosseguimento' => 'boolean',
|
||||
'tem_contra_indicacao_trombolitico' => 'boolean',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function atendimento()
|
||||
{
|
||||
return $this->belongsTo(Atendimento::class);
|
||||
}
|
||||
|
||||
public function sinaisInstabilidade()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
DorToracicaSinalInstabilidade::class,
|
||||
'pronto_atendimento_triagem_formulario_dor_toracica_sinal_instabi',
|
||||
'formulario_dor_toracica_id',
|
||||
'sinal_instabilidade_id'
|
||||
)
|
||||
->using(FormularioDorToracicaSinalInstabilidade::class)
|
||||
->as('dorToracicaSinalInstabilidade')
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function atendimentosMedico()
|
||||
{
|
||||
return $this->hasMany(AtendimentoMedico::class);
|
||||
}
|
||||
|
||||
public function formularioRelacionado()
|
||||
{
|
||||
return $this->belongsTo(RelacionadoFormularioDorToracica::class);
|
||||
}
|
||||
|
||||
public function resultadosEletrocardiograma()
|
||||
{
|
||||
return $this->hasMany(FormularioDorToracicaResultadoEletrocardiograma::class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Atendimento\Triagem;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Medico\AtendimentoMedico;
|
||||
|
||||
class FormularioDorToracicaResultadoEletrocardiograma extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_triagem_formulario_dor_toracica_result_eletro';
|
||||
|
||||
protected $fillable = [
|
||||
'formulario_dor_toracica_id',
|
||||
'atendimento_medico_id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function formularioDorToracica()
|
||||
{
|
||||
return $this->belongsTo(FormularioDorToracica::class);
|
||||
}
|
||||
|
||||
public function atendimentoMedico()
|
||||
{
|
||||
return $this->belongsTo(AtendimentoMedico::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Atendimento\Triagem;
|
||||
|
||||
use App\Models\Pivot;
|
||||
|
||||
class FormularioDorToracicaSinalInstabilidade extends Pivot
|
||||
{
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Atendimento\Triagem;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrigemDorToracica extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_status_formulario_dor_toracica';
|
||||
|
||||
protected $fillable = [
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Atendimento\Triagem;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Atendimento;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Triagem\FormularioDorToracica;
|
||||
|
||||
|
||||
class RelacionadoFormularioDorToracica extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_triagem_formulario_dor_toracica_relacionado';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'formulario_id',
|
||||
'atendimento_id',
|
||||
'dor_toracica_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function atendimento()
|
||||
{
|
||||
return $this->belongsTo(Atendimento::class);
|
||||
}
|
||||
|
||||
public function formulario()
|
||||
{
|
||||
return $this->belongsTo(FormularioDorToracica::class);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user