This commit is contained in:
20
api/app/Models/ProntoAtendimento/Aih/CaraterInternacao.php
Normal file
20
api/app/Models/ProntoAtendimento/Aih/CaraterInternacao.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Aih;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class CaraterInternacao extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_aih_carater_internacao';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/ProntoAtendimento/Aih/CausaExterna.php
Normal file
20
api/app/Models/ProntoAtendimento/Aih/CausaExterna.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Aih;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class CausaExterna extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_aih_causa_externa';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/ProntoAtendimento/Aih/Clinica.php
Normal file
20
api/app/Models/ProntoAtendimento/Aih/Clinica.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Aih;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Clinica extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_aih_clinica';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
112
api/app/Models/ProntoAtendimento/Aih/Internacao.php
Normal file
112
api/app/Models/ProntoAtendimento/Aih/Internacao.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Aih;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Model;
|
||||
use App\Models\ProntoAtendimento\Atendimento\Faa;
|
||||
use App\Models\Sigtap\Cid;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Internacao extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'pronto_atendimento_aih_internacao';
|
||||
|
||||
protected $casts = [
|
||||
'finalizada' => 'boolean'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'paciente_id',
|
||||
'unidade_solicitante_id',
|
||||
'unidade_internacao_id',
|
||||
'cid_principal_id',
|
||||
'cid_secundario_id',
|
||||
'cid_causas_associadas_id',
|
||||
'faa_id',
|
||||
'principais_sinais_sintomas_clinicos',
|
||||
'condicoes_que_justificam_internacao',
|
||||
'principais_resultados_de_provas_diagnosticas',
|
||||
'finalizada',
|
||||
];
|
||||
|
||||
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 = [
|
||||
'procedimento',
|
||||
'causaExterna',
|
||||
'autorizacao',
|
||||
];
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function unidadeSolicitante()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function unidadeInternacao()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function cidPrincipal()
|
||||
{
|
||||
return $this->belongsTo(Cid::class);
|
||||
}
|
||||
|
||||
public function cidSecundario()
|
||||
{
|
||||
return $this->belongsTo(Cid::class);
|
||||
}
|
||||
|
||||
public function cidCausasAssociadas()
|
||||
{
|
||||
return $this->belongsTo(Cid::class);
|
||||
}
|
||||
|
||||
public function faa()
|
||||
{
|
||||
return $this->belongsTo(Faa::class);
|
||||
}
|
||||
|
||||
public function procedimento()
|
||||
{
|
||||
return $this->hasOne(InternacaoProcedimento::class);
|
||||
}
|
||||
|
||||
public function causaExterna()
|
||||
{
|
||||
return $this->hasOne(InternacaoCausaExterna::class);
|
||||
}
|
||||
|
||||
public function autorizacao()
|
||||
{
|
||||
return $this->hasOne(InternacaoAutorizacao::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return $this->hasNoOne([
|
||||
'procedimento',
|
||||
'causaExterna',
|
||||
'autorizacao'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Aih;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\Geral\DocumentoTipo;
|
||||
use App\Models\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class InternacaoAutorizacao extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'pronto_atendimento_aih_internacao_autorizacao';
|
||||
|
||||
protected $fillable = [
|
||||
'internacao_id',
|
||||
'profissional_autorizador_id',
|
||||
'documento_tipo_id',
|
||||
'documento_numero',
|
||||
'data_autorizacao',
|
||||
'codigo_orgao_emissor',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'internacao_id',
|
||||
'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 internacao()
|
||||
{
|
||||
return $this->belongsTo(Internacao::class);
|
||||
}
|
||||
|
||||
public function profissionalAutorizador()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function documentoTipo()
|
||||
{
|
||||
return $this->belongsTo(DocumentoTipo::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return $this->hasNoOne([]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Aih;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\ProntoAtendimento\Aih\CausaExterna;
|
||||
use App\Models\ProntoAtendimento\Aih\VinculoPrevidencia;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class InternacaoCausaExterna extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'pronto_atendimento_aih_internacao_causa_externa';
|
||||
|
||||
protected $fillable = [
|
||||
'internacao_id',
|
||||
'causa_externa_id',
|
||||
'cnpj_seguradora',
|
||||
'numero_bilhete',
|
||||
'serie',
|
||||
'cnpj_empresa',
|
||||
'cnae_empresa',
|
||||
'cbor',
|
||||
'vinculo_previdencia_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'internacao_id',
|
||||
'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 internacao()
|
||||
{
|
||||
return $this->belongsTo(Internacao::class);
|
||||
}
|
||||
|
||||
public function causaExterna()
|
||||
{
|
||||
return $this->belongsTo(CausaExterna::class);
|
||||
}
|
||||
|
||||
public function vinculoPrevidencia()
|
||||
{
|
||||
return $this->belongsTo(VinculoPrevidencia::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return $this->hasNoOne([]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Aih;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\Geral\DocumentoTipo;
|
||||
use App\Models\Model;
|
||||
use App\Models\ProntoAtendimento\Aih\CaraterInternacao;
|
||||
use App\Models\ProntoAtendimento\Aih\Clinica;
|
||||
use App\Models\Sigtap\Procedimento;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class InternacaoProcedimento extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'pronto_atendimento_aih_internacao_procedimento';
|
||||
|
||||
protected $fillable = [
|
||||
'internacao_id',
|
||||
'procedimento_solicitado_id',
|
||||
'data_solicitacao',
|
||||
'clinica_id',
|
||||
'carater_internacao_id',
|
||||
'profissional_solicitante_assistente_id',
|
||||
'documento_tipo_id',
|
||||
'documento_numero',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'internacao_id',
|
||||
'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 internacao()
|
||||
{
|
||||
return $this->belongsTo(Internacao::class);
|
||||
}
|
||||
|
||||
public function procedimentoSolicitado()
|
||||
{
|
||||
return $this->belongsTo(Procedimento::class);
|
||||
}
|
||||
|
||||
public function clinica()
|
||||
{
|
||||
return $this->belongsTo(Clinica::class);
|
||||
}
|
||||
|
||||
public function caraterInternacao()
|
||||
{
|
||||
return $this->belongsTo(CaraterInternacao::class);
|
||||
}
|
||||
|
||||
public function profissionalSolicitanteAssistente()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function documentoTipo()
|
||||
{
|
||||
return $this->belongsTo(DocumentoTipo::class);
|
||||
}
|
||||
|
||||
public function getIsAllowedToDeleteAttribute()
|
||||
{
|
||||
return $this->hasNoOne([]);
|
||||
}
|
||||
}
|
||||
20
api/app/Models/ProntoAtendimento/Aih/VinculoPrevidencia.php
Normal file
20
api/app/Models/ProntoAtendimento/Aih/VinculoPrevidencia.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\ProntoAtendimento\Aih;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class VinculoPrevidencia extends Model
|
||||
{
|
||||
protected $table = 'pronto_atendimento_aih_vinculo_previdencia';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nome'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user