HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/demo-telemedicina.teky.com.co/database/seeds/DatabaseSeeder.php
<?php

use Illuminate\Database\Seeder;
use Telemedicina\Rol;
use Telemedicina\User;
use Telemedicina\Module;
use Telemedicina\MedicalCenter;
use Telemedicina\Specialty;
use Telemedicina\SpecialtyCenter;
use Telemedicina\AttentionType;
use Telemedicina\DocumentState;
use Telemedicina\Structure;
use Telemedicina\Insurance;
use Telemedicina\IdentificationType;
use Telemedicina\Parameter;
use Telemedicina\Term;
use Carbon\Carbon;

class DatabaseSeeder extends Seeder
{
    protected $ES = 'es';
    /**
    * Run the database seeds.
    *
    * @return void
    */
    public function run()
    {
        $this->createSpecialities();
        $this->call(CountryTableSeeder::class);
        $this->call(DepartmentTableSeeder::class);
        $this->call(CityTableSeeder::class);
        $this->call(Cie10TableSeeder::class);
        $this->call(TreatmentTableSeeder::class);
        $this->call(AgendaTypeTableSeeder::class);
        $this->call(SexTableSeeder::class);
        $this->call(BannersTableSeeder::class);
        $this->call(FieldValuesTableSeeder::class);
        $this->call(FieldInputsTableSeeder::class);
        $this->call(MainDatasourcesTableSeeder::class);
        $this->call(ManualDatasourcesTableSeeder::class);
        $this->call(FieldDatasourcesTableSeeder::class);
        $this->call(FieldsTableSeeder::class);
        $this->call(FormsTableSeeder::class);
        $this->call(FormFieldsTableSeeder::class);
        $this->call(PaymentGatewayTableSeeder::class);
        
        $this->createCenters();
        $this->createRols();
        $this->createModules();
        $this->createStates();
        $this->createIdentificationTypes();
        $this->createUser();
        $this->createStandarStructure();
        //$this->call(UsersTableSeeder::class);
        $this->createAttentions();
        $this->relationCenterEspes();
        $this->createInsurances();
        $this->createParameters();
        $this->createTerm();
    }

    public function createTerm(){
        $o = new Term;
        $o->description = 'Telemedicina APP actuará como Responsable del Tratamiento de datos personales de los cuales soy titular y que, conjunta o separadamente podrá recolectar, usar y tratar mis datos personales conforme la Política de Tratamiento de Datos Personales.';
        $o->url = "https://images.aliansap.com.co/telemedicina/dev/terms/1.pdf";
        $o->active = true;
        $o->save();
    }

    public function createParameters(){
        $o = new Parameter;

        $o->code_country = 170;
        $o->phone_pqrs_whatsapp = '3164308801';
        $o->email_pqrs = 'andres.garcia@aliansap.com.co';
        $o->minimum_required_android = '1.0.0';
        $o->minimum_required_ios = '1.0.0';
        $o->android_play_store = '';
        $o->ios_app_store = '';
        $o->status_contract = true;
        $o->created_at = Carbon::now()->toDateTimeString();
        $o->updated_at = Carbon::now()->toDateTimeString();
        $o->app_name = config('app.name');
        $o->onesignal_app_id = config("onesignal.app_id");
        $o->onesignal_sender_id = config("onesignal.sender_id");

        $o->save();
    }

    public function createInsurances(){
        $o = new Insurance;
        if(config('app.locale') == $this->ES){
            $o->name = 'Entidad aseguradora';
        }else{
            $o->name = 'Insurance entity';
        }
        $o->rate = 2000;
        $o->active = true;
        $o->save();
    }

    public function createIdentificationTypes(){

        if(config('app.locale') == $this->ES){
            $obj = new IdentificationType;
            $obj->name = 'Cedula de ciudadania';
            $obj->code = 'CC';
            $obj->active = true;
            $obj->save();

            $obj = new IdentificationType;
            $obj->name = 'Cedula extranjería';
            $obj->code = 'CE';
            $obj->active = true;
            $obj->save();

            $obj = new IdentificationType;
            $obj->name = 'Pasaporte';
            $obj->code = 'TA';
            $obj->active = true;
            $obj->save();

            $obj = new IdentificationType;
            $obj->name = 'Registro Civil';
            $obj->code = 'RC';
            $obj->active = true;
            $obj->save();

            $obj = new IdentificationType;
            $obj->name = 'Tarjeta de identidad';
            $obj->code = 'TI';
            $obj->active = true;
            $obj->save();
        } else {
            $obj = new IdentificationType;
            $obj->name = 'ID';
            $obj->code = 'ID';
            $obj->active = true;
            $obj->save();

            $obj = new IdentificationType;
            $obj->name = 'Social Security Number';
            $obj->code = 'SSN';
            $obj->active = true;
            $obj->save();

            $obj = new IdentificationType;
            $obj->name = 'Passport';
            $obj->code = 'PA';
            $obj->active = true;
            $obj->save();
        }
    }

    public function createStandarStructure(){
        $obj = new Structure;
        $obj->specialty = 1;
        $obj->table = 'ginecoobstetricias';
        $obj->active = true;
        $obj->save();

        $obj = new Structure;
        $obj->specialty = 99;
        $obj->table = 'clinic_documents';
        $obj->active = true;
        $obj->save();
    }

    public function createCenters(){
        if(config('app.locale') == $this->ES){
            $obj = new MedicalCenter;
            $obj->name = 'Cali';
            $obj->contact = 'Diego';
            $obj->phone = '3137894521';
            $obj->address = 'Cra 1';
            $obj->city_id = 150;
            $obj->save();

            $obj = new MedicalCenter;
            $obj->name = 'Santander de Quilichao';
            $obj->contact = 'Diego';
            $obj->phone = '3137894521';
            $obj->address = 'Cra 2';
            $obj->city_id = 889;
            $obj->save();
        }else{
            $obj = new MedicalCenter;
            $obj->name = 'Florida Center';
            $obj->contact = 'Diego';
            $obj->phone = '3137894521';
            $obj->address = '1500 SW 1st Ave, Ocala FL 34471';
            $obj->city_id = 341;
            $obj->save();

            $obj = new MedicalCenter;
            $obj->name = 'Santander de Quilichao';
            $obj->contact = 'Diego';
            $obj->phone = '3137894521';
            $obj->address = '301 Memorial Medical Pkwy';
            $obj->city_id = 341;
            $obj->save();
        }
    }

    public function createSpecialities(){
        $obj = new Specialty;
        $obj->name = 'Ginecoobstetricia';
        $obj->save();

        $obj = new Specialty;
        $obj->name = 'COVID-19';
        $obj->save();
    }

    public function createAttentions(){
        if(config('app.locale') == $this->ES){
            $obj = new AttentionType;
            $obj->name = 'Urgencias';
            $obj->save();

            $obj = new AttentionType;
            $obj->name = 'Junta Médica';
            $obj->save();

            $obj = new AttentionType;
            $obj->name = 'Consulta externa';
            $obj->save();
        }else{
            $obj = new AttentionType;
            $obj->name = 'Urgency';
            $obj->save();

            $obj = new AttentionType;
            $obj->name = 'Medical Board';
            $obj->save();

            $obj = new AttentionType;
            $obj->name = 'External consultation';
            $obj->save();
        }
    }

    public function relationCenterEspes(){
        // Cali | Ginecoobstetricia | Urgencias
        $obj = new SpecialtyCenter;
        $obj->cents_id = 1;
        $obj->espes_id = 1;
        $obj->tipo_atencions_id = 1;
        $obj->save();

        // Cali | Ginecoobstetricia | Consulta externa
        $obj = new SpecialtyCenter;
        $obj->cents_id = 1;
        $obj->espes_id = 1;
        $obj->tipo_atencions_id = 3;
        $obj->save();

        // Cali | COVID19 | Urgencias
        $obj = new SpecialtyCenter;
        $obj->cents_id = 1;
        $obj->espes_id = 2;
        $obj->tipo_atencions_id = 1;
        $obj->save();

        // Cali | COVID19 | Junta medica
        $obj = new SpecialtyCenter;
        $obj->cents_id = 1;
        $obj->espes_id = 2;
        $obj->tipo_atencions_id = 2;
        $obj->save();

        // Cali | COVID19 | Consulta externa
        $obj = new SpecialtyCenter;
        $obj->cents_id = 1;
        $obj->espes_id = 2;
        $obj->tipo_atencions_id = 3;
        $obj->save();
    }

    public function createRols(){
        if(config('app.locale') == $this->ES){
            $obj = new Rol;
            $obj->name = 'Administrador';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'SyncServices';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'Medico Interno';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'Enfermera Interno';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'Personal Interno';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'Médico Externo';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'Enfermera Externo';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'Personal Externo';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'App Externo';
            $obj->save();
        }
        else {
            $obj = new Rol;
            $obj->name = 'Admin';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'SyncServices';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'Internal Medic';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'Internal Nurse';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'Internal People';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'External Medic';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'External Nurse';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'External People';
            $obj->save();

            $obj = new Rol;
            $obj->name = 'External App';
            $obj->save();
        }
    }

    public function createUser(){
        $obj = new User;
        $obj->name = 'AlianSAP';
        $obj->last_name = 'Consulting';
        $obj->phone = '3206388367';
        $obj->document = '1111-';
        $obj->identification_type_id = 1;
        $obj->sex = 1;
        $obj->rol_id = 1;
        $obj->center_id = 1;
        $obj->city_id = 150;
        $obj->initial = false;
        $obj->email = 'superadmin@aliansap.com.co';
        $obj->password = \Hash::make('aliansap2018*');

        $obj->save();

        $obj = new User;
        $obj->name = 'Admin';
        $obj->last_name = 'Interno';
        $obj->phone = '';
        $obj->document = '2222-';
        $obj->identification_type_id = 1;
        $obj->rol_id = 1;
        $obj->sex = 1;
        $obj->center_id = 1;
        $obj->city_id = 150;
        $obj->email = 'admincentro@mail.com';
        $obj->password = \Hash::make('123456');

        $obj->save();

        $obj = new User;
        $obj->name = 'Sync';
        $obj->last_name = 'User';
        $obj->phone = '3207472218';
        $obj->document = '999999999-';
        $obj->identification_type_id = 1;
        $obj->sex = 1;
        $obj->rol_id = 2;
        $obj->center_id = 2;
        $obj->city_id = 150;
        $obj->email = 'sync@services.com';
        $obj->password = \Hash::make('sync2018*');

        $obj->save();

        $obj = new User;
        $obj->name = 'Tester';
        $obj->last_name = 'Tester';
        $obj->phone = 'testerphone';
        $obj->document = 'Tester--';
        $obj->identification_type_id = 1;
        $obj->sex = 1;
        $obj->rol_id = 1;
        $obj->center_id = 1;
        $obj->city_id = 150;
        $obj->initial = false;
        $obj->email = 'tester@aliansap.com.co';
        $obj->password = \Hash::make('123456');

        $obj->save();

        $obj = new User;
        $obj->name = 'test1.admin';
        $obj->last_name = 'tester1';
        $obj->phone = '565231';
        $obj->document = '78456-';
        $obj->identification_type_id = 1;
        $obj->sex = 2;
        $obj->rol_id = 1;
        $obj->center_id = 1;
        $obj->city_id = 150;
        $obj->initial = false;
        $obj->email = 'tester1.admin@aliansap.com.co';
        $obj->password = \Hash::make('987654');

        $obj->save();

        $obj = new User;
        $obj->name = 'test2.admin';
        $obj->last_name = 'tester2';
        $obj->phone = '4563454';
        $obj->document = '123456-';
        $obj->identification_type_id = 1;
        $obj->sex = 2;
        $obj->rol_id = 1;
        $obj->center_id = 1;
        $obj->city_id = 150;
        $obj->initial = false;
        $obj->email = 'tester2.admin@aliansap.com.co';
        $obj->password = \Hash::make('987654');

        $obj->save();
    }

    public function createModules(){
        if(config('app.locale') == $this->ES){
            $obj = new Module;
            $obj->name = 'Usuarios';
            $obj->icon = 'fa-user';
            $obj->rol_id = 1;
            $obj->url = 'users';
            $obj->position = 1;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Autorizar servicios';
            $obj->icon = 'fa-handshake-o';
            $obj->rol_id = 1;
            $obj->url = 'centers_specialties';
            $obj->position = 2;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Hospitales';
            $obj->icon = 'fa-hospital-o';
            $obj->rol_id = 1;
            $obj->url = 'centers';
            $obj->position = 3;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Especialidades';
            $obj->icon = 'fa-star';
            $obj->rol_id = 1;
            $obj->url = 'specialties';
            $obj->position = 4;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Tipos de atención';
            $obj->icon = 'fa-file-text';
            $obj->rol_id = 1;
            $obj->url = 'types_care';
            $obj->position = 5;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Aseguradoras';
            $obj->icon = 'fa-legal';
            $obj->rol_id = 1;
            $obj->url = 'insurances';
            $obj->position = 6;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Respuestas cancelación';
            $obj->icon = 'fa-file-text';
            $obj->rol_id = 1;
            $obj->url = 'template_responses';
            $obj->position = 7;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Logs';
            $obj->icon = 'fa-file-text';
            $obj->rol_id = 1;
            $obj->url = 'logs';
            $obj->position = 8;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Solicitudes App';
            $obj->icon = 'fa-mobile';
            $obj->rol_id = 1;
            $obj->url = 'external_app';
            $obj->position = 9;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Tablero de solicitudes';
            $obj->icon = 'fa-info-circle';
            $obj->rol_id = 1;
            $obj->url = 'control_table';
            $obj->position = 10;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Notificaciones';
            $obj->icon = 'fa-bell';
            $obj->rol_id = 1;
            $obj->url = 'notifications';
            $obj->position = 11;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Banners';
            $obj->icon = 'fa-image';
            $obj->rol_id = 1;
            $obj->url = 'banners';
            $obj->position = 12;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Parametros';
            $obj->icon = 'fa-gears';
            $obj->rol_id = 1;
            $obj->url = 'parameters';
            $obj->position = 13;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Terminos';
            $obj->icon = 'fa-file-text';
            $obj->rol_id = 1;
            $obj->url = 'terms';
            $obj->position = 14;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Tratamientos';
            $obj->icon = 'fa-heartbeat';
            $obj->rol_id = 1;
            $obj->url = 'treatments';
            $obj->position = 15;
            $obj->save();
        } else {
            $obj = new Module;
            $obj->name = 'Users';
            $obj->icon = 'fa-user';
            $obj->rol_id = 1;
            $obj->url = 'users';
            $obj->position = 1;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Service authorization';
            $obj->icon = 'fa-handshake-o';
            $obj->rol_id = 1;
            $obj->url = 'centers_specialties';
            $obj->position = 2;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Medical Centers';
            $obj->icon = 'fa-hospital-o';
            $obj->rol_id = 1;
            $obj->url = 'centers';
            $obj->position = 3;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Specialties';
            $obj->icon = 'fa-star';
            $obj->rol_id = 1;
            $obj->url = 'specialties';
            $obj->position = 4;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Attention types';
            $obj->icon = 'fa-file-text';
            $obj->rol_id = 1;
            $obj->url = 'types_care';
            $obj->position = 5;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Insurances';
            $obj->icon = 'fa-legal';
            $obj->rol_id = 1;
            $obj->url = 'insurances';
            $obj->position = 6;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Cancel responses';
            $obj->icon = 'fa-file-text';
            $obj->rol_id = 1;
            $obj->url = 'template_responses';
            $obj->position = 7;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Logs';
            $obj->icon = 'fa-file-text';
            $obj->rol_id = 1;
            $obj->url = 'logs';
            $obj->position = 8;
            $obj->save();

            $obj = new Module;
            $obj->name = 'App requests';
            $obj->icon = 'fa-mobile';
            $obj->rol_id = 1;
            $obj->url = 'external_app';
            $obj->position = 9;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Request control table';
            $obj->icon = 'fa-info-circle';
            $obj->rol_id = 1;
            $obj->url = 'control_table';
            $obj->position = 10;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Notifications';
            $obj->icon = 'fa-bell';
            $obj->rol_id = 1;
            $obj->url = 'notifications';
            $obj->position = 11;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Banners';
            $obj->icon = 'fa-image';
            $obj->rol_id = 1;
            $obj->url = 'banners';
            $obj->position = 12;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Parameters';
            $obj->icon = 'fa-gears';
            $obj->rol_id = 1;
            $obj->url = 'parameters';
            $obj->position = 13;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Terms';
            $obj->icon = 'fa-file-text';
            $obj->rol_id = 1;
            $obj->url = 'terms';
            $obj->position = 14;
            $obj->save();

            $obj = new Module;
            $obj->name = 'Treatments';
            $obj->icon = 'fa-heartbeat';
            $obj->rol_id = 1;
            $obj->url = 'treatments';
            $obj->position = 15;
            $obj->save();
        }
    }

    public function createStates(){
        if(config('app.locale') == $this->ES){
            $obj = new DocumentState;
            $obj->name = 'Pendiente';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'Solicitado';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'En tratamiento';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'Fin de tratamiento';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'Concluido';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'Cancelado';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'App Urgente';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'App atención';
            $obj->save();
        }else{
            $obj = new DocumentState;
            $obj->name = 'Pending';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'Requested';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'In treatment';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'End of treatment';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'Concluded';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'Canceled';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'App urgency';
            $obj->save();

            $obj = new DocumentState;
            $obj->name = 'App attention';
            $obj->save();
        }
    }
}