diff --git a/database/seeders/PractitionerSeeder.php b/database/seeders/PractitionerSeeder.php index 44334af2..2504244b 100644 --- a/database/seeders/PractitionerSeeder.php +++ b/database/seeders/PractitionerSeeder.php @@ -21,15 +21,15 @@ class PractitionerSeeder extends Seeder public function run() { $organizations = Organization::query() - ->whereHas('metas', function ($meta) { - $meta->where('type', 'KodeRS'); - }) - ->with('metas') - ->get(); + ->whereHas('metas', function ($meta) { + $meta->where('type', 'KodeRS'); + }) + ->with('metas') + ->get(); $specialities = Speciality::pluck('id', 'name')->toArray(); - + foreach ($organizations as $organization) { - $response = Http::get('https://api.primaya.id/temp/practitioners?code='.$organization->meta->KodeRS); + $response = Http::get('https://app.primaya.id/temp/practitioners?code=' . $organization->meta->KodeRS); foreach ($response->json()['practitioners'] as $practitioner) { $practitioner = json_decode(json_encode($practitioner)); @@ -57,7 +57,7 @@ class PractitionerSeeder extends Seeder $newPractitioner = Practitioner::updateOrCreate([ 'person_id' => $newPerson->id - ],[ + ], [ 'person_id' => $newPerson->id ]); $newPractitioner->metas()->create([ @@ -95,7 +95,7 @@ class PractitionerSeeder extends Seeder 'type' => 'description', 'value' => $practitioner->doctor->description ?? null, ]); - + @@ -109,23 +109,23 @@ class PractitionerSeeder extends Seeder if (empty($newPractitionerRole->speciality_id)) { $newPractitionerRole->metas()->updateOrCreate([ 'type' => 'speciality_code', - ],[ + ], [ 'system' => 'default', 'type' => 'speciality_code', 'value' => $practitioner->speciality->code ?? null, ]); - + $newPractitionerRole->metas()->updateOrCreate([ 'type' => 'speciality', - ],[ + ], [ 'system' => 'default', 'type' => 'speciality', 'value' => $practitioner->speciality->name ?? null, ]); - + $newPractitionerRole->metas()->updateOrCreate([ 'type' => 'speciality_image', - ],[ + ], [ 'system' => 'default', 'type' => 'speciality_image', 'value' => $practitioner->speciality->name ?? null, @@ -135,7 +135,7 @@ class PractitionerSeeder extends Seeder $newPractitionerRole->metas()->updateOrCreate([ 'type' => 'primaya-his', 'type' => 'DokterID', - ],[ + ], [ 'system' => 'primaya-his', 'type' => 'DokterID', 'value' => $practitioner->meta->DokterID ?? null,