This commit is contained in:
37
api/app/Models/TransportePaciente/Acompanhante.php
Normal file
37
api/app/Models/TransportePaciente/Acompanhante.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Model;
|
||||
|
||||
class Acompanhante extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_acompanhante';
|
||||
|
||||
protected $fillable = [
|
||||
'relacao_id',
|
||||
'usuario_id',
|
||||
'nome',
|
||||
'telefone',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function relacao()
|
||||
{
|
||||
return $this->belongsTo(Relacao::class);
|
||||
}
|
||||
}
|
||||
129
api/app/Models/TransportePaciente/Agendar/Agendar.php
Normal file
129
api/app/Models/TransportePaciente/Agendar/Agendar.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Agendar;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Intranet\Municipio;
|
||||
use App\Models\Model;
|
||||
use App\Models\Sigtap\Procedimento;
|
||||
use App\Models\TransportePaciente\Acompanhante;
|
||||
use App\Models\TransportePaciente\Destino\Destino;
|
||||
use App\Models\TransportePaciente\Jornada\Jornada;
|
||||
use App\Models\TransportePaciente\Motivo\Motivo;
|
||||
use App\Models\TransportePaciente\Ponto\Ponto;
|
||||
use App\Models\TransportePaciente\PreAgendamentoTransporte;
|
||||
use App\Models\TransportePaciente\Status\Status;
|
||||
use App\Models\TransportePaciente\Veiculo\TipoPassageiro;
|
||||
use App\Models\TransportePaciente\Veiculo\Veiculo;
|
||||
|
||||
class Agendar extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_agendar_transporte';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'paciente_id',
|
||||
'motivo_id',
|
||||
'data',
|
||||
'horario',
|
||||
'municipio_id',
|
||||
'destino_id',
|
||||
'consulta_observacao',
|
||||
'acompanhante',
|
||||
'ponto_id',
|
||||
'data_saida',
|
||||
'horario_saida',
|
||||
'tipo_passageiro_id',
|
||||
'veiculo_id',
|
||||
'jornada_id',
|
||||
'supervisor_id',
|
||||
'status_id',
|
||||
'viagem_id',
|
||||
'observacao',
|
||||
'pre_agendamento_id',
|
||||
'acompanhante_1_id',
|
||||
'acompanhante_2_id',
|
||||
'procedimento_id',
|
||||
'lotacao_id',
|
||||
'ocupacao_id',
|
||||
'quantidade',
|
||||
'usuario_id',
|
||||
'veiculo_edited_by',
|
||||
'veiculo_edited_at',
|
||||
'funcionalidade_origem'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function motivo()
|
||||
{
|
||||
return $this->belongsTo(Motivo::class);
|
||||
}
|
||||
|
||||
public function municipio()
|
||||
{
|
||||
return $this->belongsTo(Municipio::class);
|
||||
}
|
||||
|
||||
public function destino()
|
||||
{
|
||||
return $this->belongsTo(Destino::class);
|
||||
}
|
||||
|
||||
public function ponto()
|
||||
{
|
||||
return $this->belongsTo(Ponto::class);
|
||||
}
|
||||
|
||||
public function tipoPassageio()
|
||||
{
|
||||
return $this->belongsTo(TipoPassageiro::class);
|
||||
}
|
||||
|
||||
public function veiculo()
|
||||
{
|
||||
return $this->belongsTo(Veiculo::class);
|
||||
}
|
||||
|
||||
public function jornada()
|
||||
{
|
||||
return $this->belongsTo(Jornada::class);
|
||||
}
|
||||
|
||||
public function preAgendamento()
|
||||
{
|
||||
return $this->belongsTo(PreAgendamentoTransporte::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
|
||||
public function acompanhanteUm()
|
||||
{
|
||||
return $this->belongsTo(Acompanhante::class, 'acompanhante_1_id');
|
||||
}
|
||||
|
||||
public function acompanhanteDois()
|
||||
{
|
||||
return $this->belongsTo(Acompanhante::class, 'acompanhante_2_id');
|
||||
}
|
||||
|
||||
public function procedimento()
|
||||
{
|
||||
return $this->belongsTo(Procedimento::class);
|
||||
}
|
||||
}
|
||||
33
api/app/Models/TransportePaciente/Agendar/Historico.php
Normal file
33
api/app/Models/TransportePaciente/Agendar/Historico.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Agendar;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Historico extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_agendar_transporte_historico';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'transporte_paciente_agendar_transporte_id',
|
||||
'data_saida',
|
||||
'horario_saida',
|
||||
'destino_id',
|
||||
'veiculo_id',
|
||||
'acompanhante',
|
||||
'motivo_id',
|
||||
'status_id',
|
||||
'lotacao_anterior_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_centro_custo_id',
|
||||
'updated_lotacao_id',
|
||||
'created_lotacao_id',
|
||||
'updated_at',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
}
|
||||
35
api/app/Models/TransportePaciente/Condutor/Condutor.php
Normal file
35
api/app/Models/TransportePaciente/Condutor/Condutor.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Condutor;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\Model;
|
||||
|
||||
class Condutor extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_condutor';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'usuario_id',
|
||||
'numero_cnh',
|
||||
'categoria_cnh_id',
|
||||
'bloqueado',
|
||||
'vencimento_habilitacao',
|
||||
'matricula'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
}
|
||||
57
api/app/Models/TransportePaciente/Destino/Destino.php
Normal file
57
api/app/Models/TransportePaciente/Destino/Destino.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Destino;
|
||||
|
||||
use App\Models\Cadastro\Localizacao\LogradouroTipo;
|
||||
use App\Models\Intranet\Municipio;
|
||||
use App\Models\Model;
|
||||
|
||||
class Destino extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_destino';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao_destino',
|
||||
'numero_telefone_fax',
|
||||
'data_inclusao',
|
||||
'destino_tipo_id',
|
||||
'numero_cnpj',
|
||||
'numero_cpf',
|
||||
'nome_logradouro',
|
||||
'numero_logradouro',
|
||||
'nome_complemento',
|
||||
'nome_bairro',
|
||||
'numero_cep',
|
||||
'numero_telefone_comercial',
|
||||
'observacao',
|
||||
'cnes',
|
||||
'bloqueado',
|
||||
'tipo_prestador',
|
||||
'distancia',
|
||||
'cadastro_logradouro_tipo_id',
|
||||
'documento_tipo_id',
|
||||
'usuario_id',
|
||||
'estado_id',
|
||||
'municipio_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function municipio()
|
||||
{
|
||||
return $this->belongsTo(Municipio::class);
|
||||
}
|
||||
|
||||
public function tipo()
|
||||
{
|
||||
return $this->belongsTo(LogradouroTipo::class, 'cadastro_logradouro_tipo_id');
|
||||
}
|
||||
}
|
||||
20
api/app/Models/TransportePaciente/Destino/DestinoTipo.php
Normal file
20
api/app/Models/TransportePaciente/Destino/DestinoTipo.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Destino;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class DestinoTipo extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_destino_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
108
api/app/Models/TransportePaciente/Faturamento/Faturamento.php
Normal file
108
api/app/Models/TransportePaciente/Faturamento/Faturamento.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Faturamento;
|
||||
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\Intranet\Municipio;
|
||||
use App\Models\Model;
|
||||
use App\Models\TransportePaciente\Agendar\Agendar;
|
||||
use App\Models\TransportePaciente\Destino\Destino;
|
||||
use App\Models\TransportePaciente\Jornada\Jornada;
|
||||
use App\Models\TransportePaciente\Motivo\Motivo;
|
||||
use App\Models\TransportePaciente\Ponto\Ponto;
|
||||
use App\Models\TransportePaciente\PreAgendamentoTransporte;
|
||||
use App\Models\TransportePaciente\Status\Status;
|
||||
use App\Models\TransportePaciente\Veiculo\TipoPassageiro;
|
||||
use App\Models\TransportePaciente\Veiculo\Veiculo;
|
||||
|
||||
class Faturamento extends Model
|
||||
{
|
||||
|
||||
protected $table = 'transporte_paciente_faturamento';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'agendamento_id',
|
||||
'bpa_procedimento_id',
|
||||
'procedimento_id',
|
||||
'lotacao_id',
|
||||
'ocupacao_id',
|
||||
'quantidade',
|
||||
'cid_principal_id',
|
||||
'cid_secundario_id',
|
||||
'paciente_id',
|
||||
'motivo_id',
|
||||
'destino_id',
|
||||
'distancia',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
|
||||
public function agendamento()
|
||||
{
|
||||
return $this->belongsTo(Agendar::class);
|
||||
}
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function motivo()
|
||||
{
|
||||
return $this->belongsTo(Motivo::class);
|
||||
}
|
||||
|
||||
public function municipio()
|
||||
{
|
||||
return $this->belongsTo(Municipio::class);
|
||||
}
|
||||
|
||||
public function destino()
|
||||
{
|
||||
return $this->belongsTo(Destino::class);
|
||||
}
|
||||
|
||||
public function ponto()
|
||||
{
|
||||
return $this->belongsTo(Ponto::class);
|
||||
}
|
||||
|
||||
public function tipoPassageio()
|
||||
{
|
||||
return $this->belongsTo(TipoPassageiro::class);
|
||||
}
|
||||
|
||||
public function veiculo()
|
||||
{
|
||||
return $this->belongsTo(Veiculo::class);
|
||||
}
|
||||
|
||||
public function jornada()
|
||||
{
|
||||
return $this->belongsTo(Jornada::class);
|
||||
}
|
||||
|
||||
public function preAgendamento()
|
||||
{
|
||||
return $this->belongsTo(PreAgendamentoTransporte::class);
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
|
||||
public function procedimento()
|
||||
{
|
||||
return $this->belongsTo(SigtapProcedimento::class);
|
||||
}
|
||||
}
|
||||
25
api/app/Models/TransportePaciente/Grupo/Grupo.php
Normal file
25
api/app/Models/TransportePaciente/Grupo/Grupo.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Grupo;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Grupo extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_grupo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
'bloqueado'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
27
api/app/Models/TransportePaciente/Jornada/Jornada.php
Normal file
27
api/app/Models/TransportePaciente/Jornada/Jornada.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Jornada;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Jornada extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_jornada';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'data_inicial',
|
||||
'data_final',
|
||||
'veiculo_id',
|
||||
'geral_dia_semana_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/TransportePaciente/Motivo/Modulo.php
Normal file
20
api/app/Models/TransportePaciente/Motivo/Modulo.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Motivo;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Modulo extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_motivo_modulo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
35
api/app/Models/TransportePaciente/Motivo/Motivo.php
Normal file
35
api/app/Models/TransportePaciente/Motivo/Motivo.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Motivo;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\Sigtap\Procedimento;
|
||||
|
||||
class Motivo extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_motivo_viagem_procedimento';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
'grupo_id',
|
||||
'modulo_id',
|
||||
'codigo_procedimento',
|
||||
'regulada',
|
||||
'bloqueado',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function procedimento()
|
||||
{
|
||||
return $this->belongsTo(Procedimento::class, 'codigo_procedimento');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Parametrizacao;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\Model;
|
||||
use App\Models\Sigtap\Ocupacao;
|
||||
|
||||
class Faturamento extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_parametrizacao_faturamento';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'unidade_id',
|
||||
'infraestrutura_id',
|
||||
'usuario_id',
|
||||
'ocupacao_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function ocupacao()
|
||||
{
|
||||
return $this->belongsTo(Ocupacao::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Parametrizacao;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Parametrizacao extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_parametrizacao';
|
||||
|
||||
protected $casts = [
|
||||
'horario_saida' => 'boolean',
|
||||
'faturamento' => 'boolean',
|
||||
'auxilio_alimentacao' => 'boolean',
|
||||
'agendar_transporte_jornada' => 'boolean',
|
||||
'veiculo' => 'boolean',
|
||||
'comprovante_acompanhante' => 'boolean',
|
||||
'dados_acompanhante' => 'boolean',
|
||||
'campo_livre' => 'boolean',
|
||||
'exibir_observacao_paciente' => 'boolean',
|
||||
'exibir_observacao_transporte' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'faltas',
|
||||
'periodo',
|
||||
'horario_saida',
|
||||
'faturamento',
|
||||
'auxilio_alimentacao',
|
||||
'agendar_transporte_jornada',
|
||||
'mensagem_protocolo',
|
||||
'veiculo',
|
||||
'comprovante_acompanhante',
|
||||
'dados_acompanhante',
|
||||
'campo_livre',
|
||||
'exibir_observacao_paciente',
|
||||
'exibir_observacao_transporte',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
39
api/app/Models/TransportePaciente/Ponto/Ponto.php
Normal file
39
api/app/Models/TransportePaciente/Ponto/Ponto.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Ponto;
|
||||
|
||||
use App\Models\Cadastro\Localizacao\Logradouro;
|
||||
use App\Models\Model;
|
||||
|
||||
class Ponto extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_ponto';
|
||||
|
||||
protected $casts = [
|
||||
'bloqueado' => 'boolean',
|
||||
'casa_paciente' => 'boolean',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
'logradouro_id',
|
||||
'numero',
|
||||
'bloqueado',
|
||||
'casa_paciente',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function logradouro()
|
||||
{
|
||||
return $this->belongsTo(Logradouro::class);
|
||||
}
|
||||
}
|
||||
109
api/app/Models/TransportePaciente/PreAgendamentoTransporte.php
Normal file
109
api/app/Models/TransportePaciente/PreAgendamentoTransporte.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Paciente;
|
||||
use App\Models\TransportePaciente\Motivo\Motivo;
|
||||
use App\Models\Geral\DiaSemana;
|
||||
use App\Models\Intranet\Municipio;
|
||||
use App\Models\TransportePaciente\Destino\Destino;
|
||||
use App\Models\TransportePaciente\Jornada\Jornada;
|
||||
use App\Models\TransportePaciente\Ponto\Ponto;
|
||||
use App\Models\TransportePaciente\Veiculo\TipoPassageiro;
|
||||
use App\Models\TransportePaciente\Veiculo\Veiculo;
|
||||
use App\Models\TransportePaciente\Agendar\Agendar;
|
||||
|
||||
class PreAgendamentoTransporte extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_pre_agendamento_transporte';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'paciente_id',
|
||||
'motivo_id',
|
||||
'horario',
|
||||
'data',
|
||||
'municipio_id',
|
||||
'destino_id',
|
||||
'acompanhante',
|
||||
'ponto_id',
|
||||
'observacao',
|
||||
'data_saida',
|
||||
'horario_saida',
|
||||
'veiculo_id',
|
||||
'jornada_id',
|
||||
'tipo_passageiro_id',
|
||||
'acompanhante_1_id',
|
||||
'acompanhante_2_id'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function paciente()
|
||||
{
|
||||
return $this->belongsTo(Paciente::class);
|
||||
}
|
||||
|
||||
public function motivo()
|
||||
{
|
||||
return $this->belongsTo(Motivo::class);
|
||||
}
|
||||
|
||||
public function diaSemana()
|
||||
{
|
||||
return $this->belongsTo(DiaSemana::class);
|
||||
}
|
||||
|
||||
public function municipio()
|
||||
{
|
||||
return $this->belongsTo(Municipio::class);
|
||||
}
|
||||
|
||||
public function destino()
|
||||
{
|
||||
return $this->belongsTo(Destino::class);
|
||||
}
|
||||
|
||||
public function ponto()
|
||||
{
|
||||
return $this->belongsTo(Ponto::class);
|
||||
}
|
||||
|
||||
public function veiculo()
|
||||
{
|
||||
return $this->belongsTo(Veiculo::class);
|
||||
}
|
||||
|
||||
public function jornada()
|
||||
{
|
||||
return $this->belongsTo(Jornada::class);
|
||||
}
|
||||
|
||||
public function tipoPassageiro()
|
||||
{
|
||||
return $this->belongsTo(TipoPassageiro::class);
|
||||
}
|
||||
|
||||
public function acompanhante1()
|
||||
{
|
||||
return $this->belongsTo(Acompanhante::class, 'acompanhante_1_id');
|
||||
}
|
||||
|
||||
public function acompanhante2()
|
||||
{
|
||||
return $this->belongsTo(Acompanhante::class, 'acompanhante_2_id');
|
||||
}
|
||||
|
||||
public function agendamento()
|
||||
{
|
||||
return $this->hasOne(Agendar::class, 'pre_agendamento_id');
|
||||
}
|
||||
}
|
||||
23
api/app/Models/TransportePaciente/Relacao.php
Normal file
23
api/app/Models/TransportePaciente/Relacao.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Relacao extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_acompanhante_relacao';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
19
api/app/Models/TransportePaciente/Status/Status.php
Normal file
19
api/app/Models/TransportePaciente/Status/Status.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Status;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Status extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_status';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
44
api/app/Models/TransportePaciente/Supervisor/Supervisor.php
Normal file
44
api/app/Models/TransportePaciente/Supervisor/Supervisor.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Supervisor;
|
||||
|
||||
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
||||
use App\Models\Cadastro\Estabelecimento\Unidade;
|
||||
use App\Models\Cadastro\SujeitoAtencao\Usuario;
|
||||
use App\Models\Model;
|
||||
|
||||
class Supervisor extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_supervisor';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'usuario_id',
|
||||
'unidade_id',
|
||||
'infraestrutura_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function usuario()
|
||||
{
|
||||
return $this->belongsTo(Usuario::class);
|
||||
}
|
||||
|
||||
public function unidade()
|
||||
{
|
||||
return $this->belongsTo(Unidade::class);
|
||||
}
|
||||
|
||||
public function infraestrutura()
|
||||
{
|
||||
return $this->belongsTo(Infraestrutura::class);
|
||||
}
|
||||
}
|
||||
20
api/app/Models/TransportePaciente/Veiculo/Combustivel.php
Normal file
20
api/app/Models/TransportePaciente/Veiculo/Combustivel.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Veiculo;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Combustivel extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_veiculo_combustivel';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/TransportePaciente/Veiculo/Cor.php
Normal file
20
api/app/Models/TransportePaciente/Veiculo/Cor.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Veiculo;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Cor extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_veiculo_cor';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/TransportePaciente/Veiculo/Marca.php
Normal file
20
api/app/Models/TransportePaciente/Veiculo/Marca.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Veiculo;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Marca extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_veiculo_marca';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/TransportePaciente/Veiculo/Tipo.php
Normal file
20
api/app/Models/TransportePaciente/Veiculo/Tipo.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Veiculo;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Tipo extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_veiculo_tipo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
20
api/app/Models/TransportePaciente/Veiculo/TipoPassageiro.php
Normal file
20
api/app/Models/TransportePaciente/Veiculo/TipoPassageiro.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Veiculo;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class TipoPassageiro extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_veiculo_tipo_passageiro';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'descricao',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
44
api/app/Models/TransportePaciente/Veiculo/Veiculo.php
Normal file
44
api/app/Models/TransportePaciente/Veiculo/Veiculo.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente\Veiculo;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class Veiculo extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_veiculo';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'numero_placa',
|
||||
'padrao_placa_mercosul',
|
||||
'descricao_modelo',
|
||||
'numero_capacidade',
|
||||
'ano_fabricacao',
|
||||
'numero_patrimonio',
|
||||
'prefixo',
|
||||
'kilometro_inicial',
|
||||
'numero_renavam',
|
||||
'numero_eixos',
|
||||
'numero_chassi',
|
||||
'data_aquisicao',
|
||||
'numero_cnpj_proprietario',
|
||||
'nome_proprietario',
|
||||
'bloqueado',
|
||||
'tipo_ambulancia',
|
||||
'marca_id',
|
||||
'tipo_id',
|
||||
'tipo_passageiro_id',
|
||||
'cor_id',
|
||||
'combustivel_id',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
79
api/app/Models/TransportePaciente/Viagem.php
Normal file
79
api/app/Models/TransportePaciente/Viagem.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\TransportePaciente\Condutor\Condutor;
|
||||
use App\Models\TransportePaciente\Veiculo\Veiculo;
|
||||
use App\Models\TransportePaciente\Jornada\Jornada;
|
||||
use App\Models\TransportePaciente\Destino\Destino;
|
||||
use App\Models\TransportePaciente\Agendar\Agendar;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Viagem extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'transporte_paciente_viagem';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'condutor_id',
|
||||
'veiculo_id',
|
||||
'data',
|
||||
'horario_saida_temp',
|
||||
'horario_saida_real',
|
||||
'horario_chegada_destino',
|
||||
'horario_saida_destino',
|
||||
'data_chegada',
|
||||
'horario_chegada',
|
||||
'km_saida',
|
||||
'km_chegada',
|
||||
'diaria',
|
||||
'refeicao',
|
||||
'pernoite',
|
||||
'pedagio',
|
||||
'combustivel',
|
||||
'outras_despesas',
|
||||
'descricao_outras_despesas',
|
||||
'total_despesa',
|
||||
'status_id',
|
||||
'jornada_id',
|
||||
'destino_id',
|
||||
'protocolo'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
|
||||
public function condutor()
|
||||
{
|
||||
return $this->belongsTo(Condutor::class);
|
||||
}
|
||||
|
||||
public function veiculo()
|
||||
{
|
||||
return $this->belongsTo(Veiculo::class);
|
||||
}
|
||||
|
||||
public function jornada()
|
||||
{
|
||||
return $this->belongsTo(Jornada::class);
|
||||
}
|
||||
|
||||
public function destino()
|
||||
{
|
||||
return $this->belongsTo(Destino::class);
|
||||
}
|
||||
|
||||
public function agendar()
|
||||
{
|
||||
return $this->belongsTo(Agendar::class);
|
||||
}
|
||||
}
|
||||
23
api/app/Models/TransportePaciente/ViagemStatus.php
Normal file
23
api/app/Models/TransportePaciente/ViagemStatus.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\TransportePaciente;
|
||||
|
||||
use App\Models\Model;
|
||||
|
||||
class ViagemStatus extends Model
|
||||
{
|
||||
protected $table = 'transporte_paciente_viagem_status';
|
||||
|
||||
protected $fillable = [
|
||||
'descricao'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'created_lotacao_id',
|
||||
'created_centro_custo_id',
|
||||
'updated_at',
|
||||
'updated_lotacao_id',
|
||||
'updated_centro_custo_id',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user