<?php

namespace Database\Seeders;

use App\Models\Speciality;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class SpecialitiesSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $specialities = array(
            array(
                'code' => '1',
                'name' => 'Akupunktur',
                'image' => 'image/specialities/akupunktur.png',
            ),
            array(
                'code' => '2',
                'name' => 'Anak',
                'image' => 'image/specialities/anak.png',
            ),
            array(
                'code' => '3',
                'name' => 'Andrologi',
                'image' => 'image/specialities/andrologi.png',
            ),
            array(
                'code' => '4',
                'name' => 'Anastesia',
                'image' => 'image/specialities/anestesi.png',
            ),
            array(
                'code' => '5',
                'name' => 'Bedah Anak',
                'image' => 'image/specialities/bedah_anak.png',
            ),
            array(
                'code' => '6',
                'name' => 'Bedah Digestif',
                'image' => 'image/specialities/bedah_digestif.png',
            ),
            array(
                'code' => '7',
                'name' => 'Bedah Mulut',
                'image' => 'image/specialities/bedah_mulut.png',
            ),
            array(
                'code' => '8',
                'name' => 'Bedah Onkologi',
                'image' => 'image/specialities/bedah_onkologi.png',
            ),
            array(
                'code' => '9',
                'name' => 'Bedah Orthopedi',
                'image' => 'image/specialities/bedah_orthopedi.png',
            ),
            array(
                'code' => '10',
                'name' => 'Bedah Plastik & Rekonstruksi',
                'image' => 'image/specialities/bedah_plastik_dan_rekonstruksi.png',
            ),
            array(
                'code' => '11',
                'name' => 'Bedah Saraf',
                'image' => 'image/specialities/bedah_saraf.png',
            ),
            array(
                'code' => '12',
                'name' => 'Bedah Thorak & Kardiovaskuler',
                'image' => 'image/specialities/bedah_thorak_dan_kardiovaskuler.png',
            ),
            array(
                'code' => '13',
                'name' => 'Bedah Umum',
                'image' => 'image/specialities/bedah_umum.png',
            ),
            array(
                'code' => '14',
                'name' => 'Bedah Vaskuler',
                'image' => 'image/specialities/bedah_vaskuler.png',
            ),
            array(
                'code' => '15',
                'name' => 'Dokter Gigi',
                'image' => 'image/specialities/dokter_gigi.png',
            ),
            array(
                'code' => '16',
                'name' => 'Fisik & Rehabilitasi',
                'image' => 'image/specialities/fisik_dan_rehabilitasi.png',
            ),
            array(
                'code' => '17',
                'name' => 'Gastroenterologi Hepatologi',
                'image' => 'image/specialities/gastroenterologi_hepatologi.png',
            ),
            array(
                'code' => '18',
                'name' => 'Ginjal Hipertensi',
                'image' => 'image/specialities/ginjal_hipertensi.png',
            ),
            array(
                'code' => '19',
                'name' => 'Gizi Klinik',
                'image' => 'image/specialities/gizi_klinik.png',
            ),
            array(
                'code' => '20',
                'name' => 'Hematologi Onkologi',
                'image' => 'image/specialities/hematologi_onkologi.png',
            ),
            array(
                'code' => '21',
                'name' => 'Jantung & Pembuluh Darah',
                'image' => 'image/specialities/jantung_dan_pembuluh_darah.png',
            ),
            array(
                'code' => '22',
                'name' => 'Kardio Vaskuler',
                'image' => 'image/specialities/kardio_vaskuler.png',
            ),
            array(
                'code' => '23',
                'name' => 'Kebidanan & Kandungan',
                'image' => 'image/specialities/kebidanan_dan_kandungan.png',
            ),
            array(
                'code' => '24',
                'name' => 'Kesehatan Jiwa',
                'image' => 'image/specialities/kesehatan_jiwa.png',
            ),
            array(
                'code' => '25',
                'name' => 'Kulit & Kelamin',
                'image' => 'image/specialities/kulit_dan_kelamin.png',
            ),
            array(
                'code' => '26',
                'name' => 'Laboratorium',
                'image' => 'image/specialities/laboratorium.png',
            ),
            array(
                'code' => '27',
                'name' => 'Mata',
                'image' => 'image/specialities/mata.png',
            ),
            array(
                'code' => '28',
                'name' => 'Okupasi',
                'image' => 'image/specialities/okupasi.png',
            ),
            array(
                'code' => '29',
                'name' => 'Paru',
                'image' => 'image/specialities/paru.png',
            ),
            array(
                'code' => '30',
                'name' => 'Patologi Klinik',
                'image' => 'image/specialities/patologi_klinik.png',
            ),
            array(
                'code' => '31',
                'name' => 'Penyakit Dalam',
                'image' => 'image/specialities/penyakit_dalam.png',
            ),
            array(
                'code' => '32',
                'name' => 'Psikologi',
                'image' => 'image/specialities/psikolog.png',
            ),
            array(
                'code' => '33',
                'name' => 'Radiologi',
                'image' => 'image/specialities/radiolog.png',
            ),
            array(
                'code' => '34',
                'name' => 'Rehabilitasi Medik',
                'image' => 'image/specialities/rehabilitasi_medik.png',
            ),
            array(
                'code' => '35',
                'name' => 'Rheumatologi',
                'image' => 'image/specialities/rheumatologi.png',
            ),
            array(
                'code' => '36',
                'name' => 'Saraf',
                'image' => 'image/specialities/saraf.png',
            ),
            array(
                'code' => '37',
                'name' => 'THT',
                'image' => 'image/specialities/tht.png',
            ),
            array(
                'code' => '38',
                'name' => 'Umum',
                'image' => 'image/specialities/umum.png',
            ),
            array(
                'code' => '39',
                'name' => 'Urologi',
                'image' => 'image/specialities/urologi.png',
            ),
            array(
                'code' => '40',
                'name' => 'Lain-Lain',
                'image' => 'image/specialities/lain_lain.png',
            ),
        );

        // Speciality::truncate();

        foreach ($specialities as $speciality) {
            $speciality['code'] = "SP" . str_pad($speciality['code'], 4, 0, STR_PAD_LEFT);
            unset($speciality['image']);
            Speciality::updateOrCreate(
                [
                    'code' => $speciality['code'],
                ],
                $speciality
            );
        }
    }
}
