Merge branch 'origin/production' of https://dev.sismedika.online/febio/aso into origin/production
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\OLDLMS\Healthcare;
|
||||
use App\Models\OLDLMS\JadwalDokter;
|
||||
use App\Models\OLDLMS\Speciality;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
@@ -90,7 +91,7 @@ class UpdateTarifLMSSeeder extends Seeder
|
||||
|
||||
$dataTarifs = [
|
||||
// [
|
||||
// 'adm_rajal' => null,
|
||||
// 'adm_rajal' => 0,
|
||||
|
||||
// 'appt_umum' => null,
|
||||
// 'walkin_umum' => null,
|
||||
@@ -107,7 +108,7 @@ class UpdateTarifLMSSeeder extends Seeder
|
||||
// 'applied_to' => ['A', 'KODERSLMS']
|
||||
// ],
|
||||
[
|
||||
'adm_rajal' => 100000,
|
||||
'adm_rajal' => 55000,
|
||||
|
||||
'appt_umum' => 120000,
|
||||
'walkin_umum' => 120000,
|
||||
@@ -128,25 +129,24 @@ class UpdateTarifLMSSeeder extends Seeder
|
||||
$spesialisUmum = Speciality::where('sSlug', 'general-practitioner')->first();
|
||||
|
||||
foreach ($dataTarifs as $tarif) {
|
||||
$healthcareAppliedIds = Healthcare::whereIn('sKodeRS', $tarif['applied_to'])->pluck('nID');
|
||||
|
||||
// [MARK] : UMUM
|
||||
// Update Tarif Dokter Umum
|
||||
$updateUmum = [];
|
||||
if ($tarif['walkin_umum'] != null) {
|
||||
$updateUmum['nBiaya'] = $tarif['walkin_umum'];
|
||||
$updateUmum['nBiaya'] = $tarif['walkin_umum'] + $tarif['adm_rajal'];
|
||||
}
|
||||
if ($tarif['telekonsul_umum'] != null) {
|
||||
$updateUmum['nBiayaTC'] = $tarif['telekonsul_umum'];
|
||||
$updateUmum['nBiayaATC'] = $tarif['telekonsul_umum'];
|
||||
$updateUmum['nBiayaTC'] = $tarif['telekonsul_umum'] + $tarif['adm_rajal'];
|
||||
$updateUmum['nBiayaATC'] = $tarif['telekonsul_umum'] + $tarif['adm_rajal'];
|
||||
}
|
||||
if (count($updateUmum)) {
|
||||
// $updateUmum['dUpdateOn'] = now();
|
||||
// Updating
|
||||
$dokUmum = JadwalDokter::query()
|
||||
->where('nIDSpesialis', $spesialisUmum->nID)
|
||||
->whereHas('healthcare', function($hc) use ($tarif) {
|
||||
$hc->whereIn('sKodeRS', $tarif['applied_to'])
|
||||
->withTrashed();
|
||||
})
|
||||
->whereIn('nIDHealthCare', $healthcareAppliedIds)
|
||||
->withTrashed()
|
||||
->update($updateUmum);
|
||||
$this->command->info('Updating : Dokter Umum');
|
||||
@@ -156,11 +156,11 @@ class UpdateTarifLMSSeeder extends Seeder
|
||||
// Update Tarif Dokter Spesialis
|
||||
$updateSpesialis = [];
|
||||
if ($tarif['walkin_spesialis'] != null) {
|
||||
$updateSpesialis['nBiaya'] = $tarif['walkin_spesialis'];
|
||||
$updateSpesialis['nBiaya'] = $tarif['walkin_spesialis'] + $tarif['adm_rajal'];
|
||||
}
|
||||
if ($tarif['telekonsul_spesialis'] != null) {
|
||||
$updateSpesialis['nBiayaTC'] = $tarif['telekonsul_spesialis'];
|
||||
$updateSpesialis['nBiayaATC'] = $tarif['telekonsul_spesialis'];
|
||||
$updateSpesialis['nBiayaTC'] = $tarif['telekonsul_spesialis'] + $tarif['adm_rajal'];
|
||||
$updateSpesialis['nBiayaATC'] = $tarif['telekonsul_spesialis'] + $tarif['adm_rajal'];
|
||||
}
|
||||
if (count($updateSpesialis)) {
|
||||
// $updateSpesialis['dUpdateOn'] = now();
|
||||
@@ -170,10 +170,7 @@ class UpdateTarifLMSSeeder extends Seeder
|
||||
$q->where('nIDSpesialis', $spesialisUmum->nID);
|
||||
})
|
||||
->where('sIsSubSpesialis', 0)
|
||||
->whereHas('healthcare', function($hc) use ($tarif) {
|
||||
$hc->whereIn('sKodeRS', $tarif['applied_to'])
|
||||
->withTrashed();
|
||||
})
|
||||
->whereIn('nIDHealthCare', $healthcareAppliedIds)
|
||||
->withTrashed()
|
||||
->update($updateSpesialis);
|
||||
$this->command->info('Updating : Dokter Spesialis');
|
||||
@@ -184,11 +181,11 @@ class UpdateTarifLMSSeeder extends Seeder
|
||||
// Update Tarif Dokter Sub Spesialis
|
||||
$updateSubSpesialis = [];
|
||||
if ($tarif['walkin_subspesialis'] != null) {
|
||||
$updateSubSpesialis['nBiaya'] = $tarif['walkin_subspesialis'];
|
||||
$updateSubSpesialis['nBiaya'] = $tarif['walkin_subspesialis'] + $tarif['adm_rajal'];
|
||||
}
|
||||
if ($tarif['telekonsul_subspesialis'] != null) {
|
||||
$updateSubSpesialis['nBiayaTC'] = $tarif['telekonsul_subspesialis'];
|
||||
$updateSubSpesialis['nBiayaATC'] = $tarif['telekonsul_subspesialis'];
|
||||
$updateSubSpesialis['nBiayaTC'] = $tarif['telekonsul_subspesialis'] + $tarif['adm_rajal'];
|
||||
$updateSubSpesialis['nBiayaATC'] = $tarif['telekonsul_subspesialis'] + $tarif['adm_rajal'];
|
||||
}
|
||||
if (count($updateSubSpesialis)) {
|
||||
// $updateSubSpesialis['dUpdateOn'] = now();
|
||||
@@ -199,10 +196,7 @@ class UpdateTarifLMSSeeder extends Seeder
|
||||
$q->where('nIDSpesialis', $spesialisUmum->nID);
|
||||
})
|
||||
->where('sIsSubSpesialis', 1)
|
||||
->whereHas('healthcare', function($hc) use ($tarif) {
|
||||
$hc->whereIn('sKodeRS', $tarif['applied_to'])
|
||||
->withTrashed();
|
||||
})
|
||||
->whereIn('nIDHealthCare', $healthcareAppliedIds)
|
||||
->withTrashed()
|
||||
->update($updateSubSpesialis);
|
||||
$this->command->info('Updating : Dokter Sub Spesialis');
|
||||
|
||||
Reference in New Issue
Block a user