From 76956507392cbf295eab8d394742bedd981b6f36 Mon Sep 17 00:00:00 2001 From: R Date: Fri, 19 Jan 2024 10:58:58 +0700 Subject: [PATCH 1/6] Add Seeder UpdateTarifLMSSeeder --- database/seeders/UpdateTarifLMSSeeder.php | 213 ++++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 database/seeders/UpdateTarifLMSSeeder.php diff --git a/database/seeders/UpdateTarifLMSSeeder.php b/database/seeders/UpdateTarifLMSSeeder.php new file mode 100644 index 00000000..6c519d3e --- /dev/null +++ b/database/seeders/UpdateTarifLMSSeeder.php @@ -0,0 +1,213 @@ + "A", + // "sHealthCare" => "Rumah Sakit Awal Bros Sudirman Pekanbaru", + // ], + // [ + // "sKodeRS" => "B", + // "sHealthCare" => "Rumah Sakit Awal Bros Batam", + // ], + // [ + // "sKodeRS" => "BW", + // "sHealthCare" => "Primaya Hospital Bhakti Wara", + // ], + // [ + // "sKodeRS" => "C", + // "sHealthCare" => "Primaya Hospital Tangerang", + // ], + // [ + // "sKodeRS" => "D", + // "sHealthCare" => "Primaya Hospital Bekasi Barat", + // ], + // [ + // "sKodeRS" => "E", + // "sHealthCare" => "Primaya Evasari Hospital", + // ], + // [ + // "sKodeRS" => "F", + // "sHealthCare" => "Primaya Hospital Makassar", + // ], + // [ + // "sKodeRS" => "G", + // "sHealthCare" => "Rumah Sakit Awal Bros Ujung Batu", + // ], + // [ + // "sKodeRS" => "I", + // "sHealthCare" => "Rumah Sakit Awal Bros Panam", + // ], + // [ + // "sKodeRS" => "K", + // "sHealthCare" => "Rumah Sakit Awal Bros Ahmad Yani", + // ], + // [ + // "sKodeRS" => "M", + // "sHealthCare" => "Primaya Hospital Bekasi Timur", + // ], + // [ + // "sKodeRS" => "N", + // "sHealthCare" => "Primaya Hospital Betang Pambelum", + // ], + // [ + // "sKodeRS" => "O", + // "sHealthCare" => "Primaya Hospital Inco Sorowako", + // ], + // [ + // "sKodeRS" => "P", + // "sHealthCare" => "Primaya Hospital Bekasi Utara", + // ], + // [ + // "sKodeRS" => "PK", + // "sHealthCare" => "Primaya Hospital Pasar Kemis", + // ], + // [ + // "sKodeRS" => "Q", + // "sHealthCare" => "Primaya Hospital Karawang", + // ], + // [ + // "sKodeRS" => "SK", + // "sHealthCare" => "Primaya Hospital Sukabumi", + // ], + // ] + + $dataTarifs = [ + // [ + // 'adm_rajal' => null, + + // 'appt_umum' => null, + // 'walkin_umum' => null, + // 'telekonsul_umum' => null, + + // 'appt_spesialis' => 250000, + // 'walkin_spesialis' => 250000, + // 'telekonsul_spesialis' => 213000, + + // 'appt_subspesialis' => 345000, + // 'walkin_subspesialis' => 345000, + // 'telekonsul_subspesialis' => 293000, + + // 'applied_to' => ['A', 'KODERSLMS'] + // ], + [ + 'adm_rajal' => 100000, + + 'appt_umum' => 120000, + 'walkin_umum' => 120000, + 'telekonsul_umum' => 102000, + + 'appt_spesialis' => 250000, + 'walkin_spesialis' => 250000, + 'telekonsul_spesialis' => 213000, + + 'appt_subspesialis' => 345000, + 'walkin_subspesialis' => 345000, + 'telekonsul_subspesialis' => 293000, + + 'applied_to' => ['P'] + ] + ]; + + $spesialisUmum = Speciality::where('sSlug', 'general-practitioner')->first(); + + foreach ($dataTarifs as $tarif) { + // [MARK] : UMUM + // Update Tarif Dokter Umum + $updateUmum = []; + if ($tarif['walkin_umum'] != null) { + $updateUmum[] = ['nBiaya' => $tarif['walkin_umum']]; + } + if ($tarif['telekonsul_umum'] != null) { + $updateUmum[] = ['nBiayaTC' => $tarif['telekonsul_umum']]; + $updateUmum[] = ['nBiayaATC' => $tarif['telekonsul_umum']]; + } + // Updating + $dokUmum = JadwalDokter::query() + ->where('nIDSpesialis', $spesialisUmum->nID) + ->whereHas('healthcare', function($hc) use ($tarif) { + $hc->whereIn('sKodeRS', $tarif['applied_to']); + }) + ->update([ + 'nBiaya' => $tarif['walkin_umum'], + 'nBiayaTC' => $tarif['telekonsul_umum'], + 'nBiayaATC' => $tarif['telekonsul_umum'], + 'dUpdateOn' => now() + ]); + $this->command->info('Updating : Dokter Umum'); + + // [MARK] : SPESIALIS + // Update Tarif Dokter Spesialis + $updateSpesialis = []; + if ($tarif['walkin_spesialis'] != null) { + $updateUmum[] = ['nBiaya' => $tarif['walkin_spesialis']]; + } + if ($tarif['telekonsul_spesialis'] != null) { + $updateUmum[] = ['nBiayaTC' => $tarif['telekonsul_spesialis']]; + $updateUmum[] = ['nBiayaATC' => $tarif['telekonsul_spesialis']]; + } + + // Updating + $dokSpesialis = JadwalDokter::query() + ->whereNot(function ($q) use ($spesialisUmum) { + $q->where('nIDSpesialis', $spesialisUmum->nID); + }) + ->where('sIsSubSpesialis', 0) + ->whereHas('healthcare', function($hc) use ($tarif) { + $hc->whereIn('sKodeRS', $tarif['applied_to']); + }) + ->update([ + 'nBiaya' => $tarif['walkin_spesialis'], + 'nBiayaTC' => $tarif['telekonsul_spesialis'], + 'nBiayaATC' => $tarif['telekonsul_spesialis'], + 'dUpdateOn' => now() + ]); + $this->command->info('Updating : Dokter Spesialis'); + + + // [MARK] : SUBSPESIALIS + // Update Tarif Dokter Sub Spesialis + $updateSubSpesialis = []; + if ($tarif['walkin_subspesialis'] != null) { + $updateUmum[] = ['nBiaya' => $tarif['walkin_subspesialis']]; + } + if ($tarif['telekonsul_subspesialis'] != null) { + $updateUmum[] = ['nBiayaTC' => $tarif['telekonsul_subspesialis']]; + $updateUmum[] = ['nBiayaATC' => $tarif['telekonsul_subspesialis']]; + } + + // Updating + $dokSubSpesialis = JadwalDokter::query() + ->whereNot(function ($q) use ($spesialisUmum) { + $q->where('nIDSpesialis', $spesialisUmum->nID); + }) + ->where('sIsSubSpesialis', 1) + ->whereHas('healthcare', function($hc) use ($tarif) { + $hc->whereIn('sKodeRS', $tarif['applied_to']); + }) + ->update([ + 'nBiaya' => $tarif['walkin_subspesialis'], + 'nBiayaTC' => $tarif['telekonsul_subspesialis'], + 'nBiayaATC' => $tarif['telekonsul_subspesialis'], + 'dUpdateOn' => now() + ]); + $this->command->info('Updating : Dokter Sub Spesialis'); + } + } +} From 1d1392c2d0fd68345b0a1babb54df7bdda518325 Mon Sep 17 00:00:00 2001 From: R Date: Fri, 19 Jan 2024 11:19:54 +0700 Subject: [PATCH 2/6] Add Seeder UpdateTarifLMSSeeder --- database/seeders/UpdateTarifLMSSeeder.php | 103 ++++++++++------------ 1 file changed, 48 insertions(+), 55 deletions(-) diff --git a/database/seeders/UpdateTarifLMSSeeder.php b/database/seeders/UpdateTarifLMSSeeder.php index 6c519d3e..2b4d1835 100644 --- a/database/seeders/UpdateTarifLMSSeeder.php +++ b/database/seeders/UpdateTarifLMSSeeder.php @@ -132,82 +132,75 @@ class UpdateTarifLMSSeeder extends Seeder // Update Tarif Dokter Umum $updateUmum = []; if ($tarif['walkin_umum'] != null) { - $updateUmum[] = ['nBiaya' => $tarif['walkin_umum']]; + $updateUmum['nBiaya'] = $tarif['walkin_umum']; } if ($tarif['telekonsul_umum'] != null) { - $updateUmum[] = ['nBiayaTC' => $tarif['telekonsul_umum']]; - $updateUmum[] = ['nBiayaATC' => $tarif['telekonsul_umum']]; + $updateUmum['nBiayaTC'] = $tarif['telekonsul_umum']; + $updateUmum['nBiayaATC'] = $tarif['telekonsul_umum']; + } + 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']); + }) + ->update($updateUmum); + $this->command->info('Updating : Dokter Umum'); } - // Updating - $dokUmum = JadwalDokter::query() - ->where('nIDSpesialis', $spesialisUmum->nID) - ->whereHas('healthcare', function($hc) use ($tarif) { - $hc->whereIn('sKodeRS', $tarif['applied_to']); - }) - ->update([ - 'nBiaya' => $tarif['walkin_umum'], - 'nBiayaTC' => $tarif['telekonsul_umum'], - 'nBiayaATC' => $tarif['telekonsul_umum'], - 'dUpdateOn' => now() - ]); - $this->command->info('Updating : Dokter Umum'); // [MARK] : SPESIALIS // Update Tarif Dokter Spesialis $updateSpesialis = []; if ($tarif['walkin_spesialis'] != null) { - $updateUmum[] = ['nBiaya' => $tarif['walkin_spesialis']]; + $updateSpesialis['nBiaya'] = $tarif['walkin_spesialis']; } if ($tarif['telekonsul_spesialis'] != null) { - $updateUmum[] = ['nBiayaTC' => $tarif['telekonsul_spesialis']]; - $updateUmum[] = ['nBiayaATC' => $tarif['telekonsul_spesialis']]; + $updateSpesialis['nBiayaTC'] = $tarif['telekonsul_spesialis']; + $updateSpesialis['nBiayaATC'] = $tarif['telekonsul_spesialis']; + } + if (count($updateSpesialis)) { + $updateSpesialis['dUpdateOn'] = now(); + // Updating + $dokSpesialis = JadwalDokter::query() + ->whereNot(function ($q) use ($spesialisUmum) { + $q->where('nIDSpesialis', $spesialisUmum->nID); + }) + ->where('sIsSubSpesialis', 0) + ->whereHas('healthcare', function($hc) use ($tarif) { + $hc->whereIn('sKodeRS', $tarif['applied_to']); + }) + ->update($updateSpesialis); + $this->command->info('Updating : Dokter Spesialis'); } - - // Updating - $dokSpesialis = JadwalDokter::query() - ->whereNot(function ($q) use ($spesialisUmum) { - $q->where('nIDSpesialis', $spesialisUmum->nID); - }) - ->where('sIsSubSpesialis', 0) - ->whereHas('healthcare', function($hc) use ($tarif) { - $hc->whereIn('sKodeRS', $tarif['applied_to']); - }) - ->update([ - 'nBiaya' => $tarif['walkin_spesialis'], - 'nBiayaTC' => $tarif['telekonsul_spesialis'], - 'nBiayaATC' => $tarif['telekonsul_spesialis'], - 'dUpdateOn' => now() - ]); - $this->command->info('Updating : Dokter Spesialis'); // [MARK] : SUBSPESIALIS // Update Tarif Dokter Sub Spesialis $updateSubSpesialis = []; if ($tarif['walkin_subspesialis'] != null) { - $updateUmum[] = ['nBiaya' => $tarif['walkin_subspesialis']]; + $updateSubSpesialis['nBiaya'] = $tarif['walkin_subspesialis']; } if ($tarif['telekonsul_subspesialis'] != null) { - $updateUmum[] = ['nBiayaTC' => $tarif['telekonsul_subspesialis']]; - $updateUmum[] = ['nBiayaATC' => $tarif['telekonsul_subspesialis']]; + $updateSubSpesialis['nBiayaTC'] = $tarif['telekonsul_subspesialis']; + $updateSubSpesialis['nBiayaATC'] = $tarif['telekonsul_subspesialis']; } + if (count($updateSubSpesialis)) { + $updateSubSpesialis['dUpdateOn'] = now(); - // Updating - $dokSubSpesialis = JadwalDokter::query() - ->whereNot(function ($q) use ($spesialisUmum) { - $q->where('nIDSpesialis', $spesialisUmum->nID); - }) - ->where('sIsSubSpesialis', 1) - ->whereHas('healthcare', function($hc) use ($tarif) { - $hc->whereIn('sKodeRS', $tarif['applied_to']); - }) - ->update([ - 'nBiaya' => $tarif['walkin_subspesialis'], - 'nBiayaTC' => $tarif['telekonsul_subspesialis'], - 'nBiayaATC' => $tarif['telekonsul_subspesialis'], - 'dUpdateOn' => now() - ]); - $this->command->info('Updating : Dokter Sub Spesialis'); + // Updating + $dokSubSpesialis = JadwalDokter::query() + ->whereNot(function ($q) use ($spesialisUmum) { + $q->where('nIDSpesialis', $spesialisUmum->nID); + }) + ->where('sIsSubSpesialis', 1) + ->whereHas('healthcare', function($hc) use ($tarif) { + $hc->whereIn('sKodeRS', $tarif['applied_to']); + }) + ->update($updateSubSpesialis); + $this->command->info('Updating : Dokter Sub Spesialis'); + } } } } From fd1a8cffac4fb67180c76efa63a1efb908baaa80 Mon Sep 17 00:00:00 2001 From: R Date: Fri, 19 Jan 2024 14:03:11 +0700 Subject: [PATCH 3/6] Add Seeder UpdateTarifLMSSeeder --- database/seeders/UpdateTarifLMSSeeder.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/database/seeders/UpdateTarifLMSSeeder.php b/database/seeders/UpdateTarifLMSSeeder.php index 2b4d1835..684541b6 100644 --- a/database/seeders/UpdateTarifLMSSeeder.php +++ b/database/seeders/UpdateTarifLMSSeeder.php @@ -146,6 +146,7 @@ class UpdateTarifLMSSeeder extends Seeder ->whereHas('healthcare', function($hc) use ($tarif) { $hc->whereIn('sKodeRS', $tarif['applied_to']); }) + ->withTrashed() ->update($updateUmum); $this->command->info('Updating : Dokter Umum'); } @@ -171,6 +172,7 @@ class UpdateTarifLMSSeeder extends Seeder ->whereHas('healthcare', function($hc) use ($tarif) { $hc->whereIn('sKodeRS', $tarif['applied_to']); }) + ->withTrashed() ->update($updateSpesialis); $this->command->info('Updating : Dokter Spesialis'); } @@ -198,6 +200,7 @@ class UpdateTarifLMSSeeder extends Seeder ->whereHas('healthcare', function($hc) use ($tarif) { $hc->whereIn('sKodeRS', $tarif['applied_to']); }) + ->withTrashed() ->update($updateSubSpesialis); $this->command->info('Updating : Dokter Sub Spesialis'); } From b74ef82239dfce7bdbc25ebcde5061d8f33e9c32 Mon Sep 17 00:00:00 2001 From: R Date: Fri, 19 Jan 2024 14:06:18 +0700 Subject: [PATCH 4/6] Add Seeder UpdateTarifLMSSeeder --- database/seeders/UpdateTarifLMSSeeder.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/database/seeders/UpdateTarifLMSSeeder.php b/database/seeders/UpdateTarifLMSSeeder.php index 684541b6..9abb646b 100644 --- a/database/seeders/UpdateTarifLMSSeeder.php +++ b/database/seeders/UpdateTarifLMSSeeder.php @@ -144,7 +144,8 @@ class UpdateTarifLMSSeeder extends Seeder $dokUmum = JadwalDokter::query() ->where('nIDSpesialis', $spesialisUmum->nID) ->whereHas('healthcare', function($hc) use ($tarif) { - $hc->whereIn('sKodeRS', $tarif['applied_to']); + $hc->whereIn('sKodeRS', $tarif['applied_to']) + ->withTrashed(); }) ->withTrashed() ->update($updateUmum); @@ -170,7 +171,8 @@ class UpdateTarifLMSSeeder extends Seeder }) ->where('sIsSubSpesialis', 0) ->whereHas('healthcare', function($hc) use ($tarif) { - $hc->whereIn('sKodeRS', $tarif['applied_to']); + $hc->whereIn('sKodeRS', $tarif['applied_to']) + ->withTrashed(); }) ->withTrashed() ->update($updateSpesialis); @@ -198,7 +200,8 @@ class UpdateTarifLMSSeeder extends Seeder }) ->where('sIsSubSpesialis', 1) ->whereHas('healthcare', function($hc) use ($tarif) { - $hc->whereIn('sKodeRS', $tarif['applied_to']); + $hc->whereIn('sKodeRS', $tarif['applied_to']) + ->withTrashed(); }) ->withTrashed() ->update($updateSubSpesialis); From efe0d861696f3ef95d3dd2a322864f91b527f14d Mon Sep 17 00:00:00 2001 From: ivan-sim Date: Fri, 19 Jan 2024 14:08:43 +0700 Subject: [PATCH 5/6] Update --- .../src/sections/dashboard/TableListFinalLog.tsx | 6 +++--- .../src/sections/dashboard/TableListReqLog.tsx | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx b/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx index 061c81fe..87264886 100644 --- a/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx +++ b/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx @@ -38,7 +38,7 @@ export default function TableListFinalLog() { const [data, setData] = useState([]); // Download LOG - async function handleDownloadLog(request_log_id: any, service_code:any, no_polis:any, full_name:any) { + async function handleDownloadLog(request_log_id: any, service_code:any, no_polis:any, full_name:any, provider:any) { return axios .get(`download-final-log/${request_log_id}`, { responseType: 'blob', @@ -46,7 +46,7 @@ export default function TableListFinalLog() { .then((response) => { console.log(response); // GL Akhir-010124-OP-00001234 Ratih-LinkSehat - const namaFile = 'GL Akhir-'+getFormattedToday()+'-'+service_code+'-'+no_polis+'-'+full_name+'-LinkSehat.pdf'; + const namaFile = 'GL Akhir-'+provider+'-'+getFormattedToday()+'-'+service_code+'-'+no_polis+'-'+full_name+'-LinkSehat.pdf'; const url = URL.createObjectURL(response.data); const link = document.createElement('a'); link.href = url; @@ -369,7 +369,7 @@ export default function TableListFinalLog() { View {obj.status === 'approved' ? ( - handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name)}> + handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name, obj.provider)}> Download Final LOG diff --git a/frontend/hospital-portal/src/sections/dashboard/TableListReqLog.tsx b/frontend/hospital-portal/src/sections/dashboard/TableListReqLog.tsx index 4f1ddd11..f3d949cf 100644 --- a/frontend/hospital-portal/src/sections/dashboard/TableListReqLog.tsx +++ b/frontend/hospital-portal/src/sections/dashboard/TableListReqLog.tsx @@ -42,15 +42,14 @@ export default function TableList() { const [data, setData] = useState([]); // Download LOG - async function handleDownloadLog(request_log_id: any, service_code:any, no_polis:any, full_name:any) { + async function handleDownloadLog(request_log_id: any, service_code:any, no_polis:any, full_name:any, provider:any) { return axios .get(`download-log/${request_log_id}`, { responseType: 'blob', }) .then((response) => { - console.log(response); // GL Awal-010124-OP-00001234 Ratih-LinkSehat - const namaFile = 'GL Awal-'+getFormattedToday()+'-'+service_code+'-'+no_polis+'-'+full_name+'-LinkSehat.pdf'; + const namaFile = 'GL Awal-'+provider+'-'+getFormattedToday()+'-'+service_code+'-'+no_polis+'-'+full_name+'-LinkSehat.pdf'; const url = URL.createObjectURL(response.data); const link = document.createElement('a'); link.href = url; @@ -368,7 +367,7 @@ export default function TableList() { View {obj.status === 'approved' ? ( - handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name)}> + handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name, obj.provider)}> Download LOG From 543a1cb715520e9eb5aec11d638e7296e54b3004 Mon Sep 17 00:00:00 2001 From: R Date: Fri, 19 Jan 2024 14:10:49 +0700 Subject: [PATCH 6/6] Add Seeder UpdateTarifLMSSeeder --- database/seeders/UpdateTarifLMSSeeder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/seeders/UpdateTarifLMSSeeder.php b/database/seeders/UpdateTarifLMSSeeder.php index 9abb646b..ec4c011e 100644 --- a/database/seeders/UpdateTarifLMSSeeder.php +++ b/database/seeders/UpdateTarifLMSSeeder.php @@ -139,7 +139,7 @@ class UpdateTarifLMSSeeder extends Seeder $updateUmum['nBiayaATC'] = $tarif['telekonsul_umum']; } if (count($updateUmum)) { - $updateUmum['dUpdateOn'] = now(); + // $updateUmum['dUpdateOn'] = now(); // Updating $dokUmum = JadwalDokter::query() ->where('nIDSpesialis', $spesialisUmum->nID) @@ -163,7 +163,7 @@ class UpdateTarifLMSSeeder extends Seeder $updateSpesialis['nBiayaATC'] = $tarif['telekonsul_spesialis']; } if (count($updateSpesialis)) { - $updateSpesialis['dUpdateOn'] = now(); + // $updateSpesialis['dUpdateOn'] = now(); // Updating $dokSpesialis = JadwalDokter::query() ->whereNot(function ($q) use ($spesialisUmum) { @@ -191,7 +191,7 @@ class UpdateTarifLMSSeeder extends Seeder $updateSubSpesialis['nBiayaATC'] = $tarif['telekonsul_subspesialis']; } if (count($updateSubSpesialis)) { - $updateSubSpesialis['dUpdateOn'] = now(); + // $updateSubSpesialis['dUpdateOn'] = now(); // Updating $dokSubSpesialis = JadwalDokter::query()