diff --git a/Modules/Internal/Http/Controllers/Api/CityController.php b/Modules/Internal/Http/Controllers/Api/CityController.php new file mode 100644 index 00000000..b820bb51 --- /dev/null +++ b/Modules/Internal/Http/Controllers/Api/CityController.php @@ -0,0 +1,86 @@ +province_id)->orderBy('name', 'asc')->get(); + + if (!$city) { + return response(['message' => 'Tidak ada data'], 404); + } else { + return response(['message' => 'Data ditemukan', 'data' => $city]); + } + } + + /** + * Show the form for creating a new resource. + * @return Renderable + */ + public function create() + { + return view('internal::create'); + } + + /** + * Store a newly created resource in storage. + * @param Request $request + * @return Renderable + */ + public function store(Request $request) + { + // + } + + /** + * Show the specified resource. + * @param int $id + * @return Renderable + */ + public function show($id) + { + return view('internal::show'); + } + + /** + * Show the form for editing the specified resource. + * @param int $id + * @return Renderable + */ + public function edit($id) + { + return view('internal::edit'); + } + + /** + * Update the specified resource in storage. + * @param Request $request + * @param int $id + * @return Renderable + */ + public function update(Request $request, $id) + { + // + } + + /** + * Remove the specified resource from storage. + * @param int $id + * @return Renderable + */ + public function destroy($id) + { + // + } +} diff --git a/Modules/Internal/Http/Controllers/Api/DistrictController.php b/Modules/Internal/Http/Controllers/Api/DistrictController.php new file mode 100644 index 00000000..e0b71eaa --- /dev/null +++ b/Modules/Internal/Http/Controllers/Api/DistrictController.php @@ -0,0 +1,85 @@ +city_id)->orderBy('name', 'asc')->get(); + + if (!$district) { + return response(['message' => 'Tidak ada data'], 404); + } else { + return response(['message' => 'Data ditemukan', 'data' => $district]); + } + } + /** + * Show the form for creating a new resource. + * @return Renderable + */ + public function create() + { + return view('internal::create'); + } + + /** + * Store a newly created resource in storage. + * @param Request $request + * @return Renderable + */ + public function store(Request $request) + { + // + } + + /** + * Show the specified resource. + * @param int $id + * @return Renderable + */ + public function show($id) + { + return view('internal::show'); + } + + /** + * Show the form for editing the specified resource. + * @param int $id + * @return Renderable + */ + public function edit($id) + { + return view('internal::edit'); + } + + /** + * Update the specified resource in storage. + * @param Request $request + * @param int $id + * @return Renderable + */ + public function update(Request $request, $id) + { + // + } + + /** + * Remove the specified resource from storage. + * @param int $id + * @return Renderable + */ + public function destroy($id) + { + // + } +} diff --git a/Modules/Internal/Http/Controllers/Api/DoctorController.php b/Modules/Internal/Http/Controllers/Api/DoctorController.php index 9310b3c0..7ef26669 100644 --- a/Modules/Internal/Http/Controllers/Api/DoctorController.php +++ b/Modules/Internal/Http/Controllers/Api/DoctorController.php @@ -3,6 +3,7 @@ namespace Modules\Internal\Http\Controllers\Api; use App\Helpers\Helper; +use App\Models\Person; use App\Models\Practitioner; use App\Models\PractitionerRole; use Illuminate\Contracts\Support\Renderable; @@ -18,12 +19,6 @@ class DoctorController extends Controller */ public function index(Request $request) { - // $doctors = PractitionerRole::active()->with('practitioner.person', 'organization') - // ->when($request->search ?? null, function ($query, $search) { - // $query->whereHas('practitioner.person', function ($person) use ($search) { - // $person->where('name', 'LIKE', '%' . $search . '%'); - // }); - // })->paginate(); $doctors = Practitioner::with('person', 'practitionerRoles.organization', 'practitionerRoles.speciality') ->when($request->search ?? null, function ($query, $search) { @@ -31,6 +26,9 @@ class DoctorController extends Controller $person->where('name', 'LIKE', '%' . $search . '%'); }); }) + ->when($request->id ?? null, function ($query, $id) { + $query->where('id', $id); + }) ->when($request->organization_id ?? null, function ($query, $organization_id) { $query->whereHas('practitionerRoles', function ($practitionerRole) use ($organization_id) { $practitionerRole->where('organization_id', $organization_id); @@ -65,7 +63,58 @@ class DoctorController extends Controller */ public function store(Request $request) { - // + $data_person = [ + 'name' => $request->name, + 'gender' => $request->gender, + 'address' => $request->address, + 'phone' => $request->phone, + 'email' => $request->email, + 'birth_date' => date('Y-m-d', strtotime($request->birth_date)), + 'birth_place' => $request->birth_place, + ]; + + $person = Person::create($data_person); + $address = $person->addresses()->create([ + 'use' => 'both', + 'type' => 'physical', + 'text' => $request->address, + ]); + + $person->main_address_id = $address->id; + $person->save(); + + $practitioner = $person->practitioner()->create(); + + $practices = $request->practices; + if ($practices[0]['organization_id'] !== null) { + foreach ($practices as $key => $practice) { + if (isset($practice['specialities'])) { + //jika input spesialis + foreach ($practice['specialities'] as $key => $speciality) { + $speciality_id = $speciality['speciality_id']; + $organization_id = $practice['organization_id']; + $practitionerRole = $practitioner->practitionerRoles()->create([ + 'organization_id' => $organization_id, + 'speciality_id' => $speciality_id, + ]); + } + } else { + //jika tidak input spesialis + $speciality_id = null; + $organization_id = $practice['organization_id']; + + $practitionerRole = $practitioner->practitionerRoles()->create([ + 'organization_id' => $organization_id, + 'speciality_id' => $speciality_id, + ]); + } + } + } + + return response()->json([ + 'status' => 'success', + 'message' => 'Data berhasil disimpan', + ]); } /** @@ -75,7 +124,8 @@ class DoctorController extends Controller */ public function show($id) { - return view('internal::show'); + $practitioner = Practitioner::with('person', 'practitionerRoles.organization', 'practitionerRoles.speciality')->find($id); + return response()->json(DoctorResource::make($practitioner)); } /** @@ -85,7 +135,8 @@ class DoctorController extends Controller */ public function edit($id) { - return view('internal::edit'); + $practitioner = Practitioner::with('person', 'practitionerRoles.organization', 'practitionerRoles.speciality')->find($id); + return response()->json(DoctorResource::make($practitioner)); } /** @@ -96,7 +147,81 @@ class DoctorController extends Controller */ public function update(Request $request, $id) { - // + $practitioner = Practitioner::find($id); + $data_person = [ + 'name' => $request->name, + 'gender' => $request->gender, + 'address' => $request->address, + 'phone' => $request->phone, + 'email' => $request->email, + 'birth_date' => date('Y-m-d', strtotime($request->birth_date)), + 'birth_place' => $request->birth_place, + ]; + + $person = $practitioner->person; + $person->update($data_person); + $address = $practitioner->person->addresses()->updateOrCreate([ + 'use' => 'both', + 'type' => 'physical', + 'text' => $request->address, + ]); + $practitioner->person->main_address_id = $address->id; + $practitioner->person->save(); + + $practices = $request->practices; + $practitionerRole = $practitioner->practitionerRoles()->get() ?? null; + + foreach ($practices as $practice) { + $organization_id = $practice['organization_id']; + foreach ($practice['specialities'] as $speciality) { + $speciality_id = $speciality['speciality_id']; + $cek = $practitionerRole->where('organization_id', $organization_id) + ->where('speciality_id', $speciality_id)->first() ?? null; + if (!$cek || $practitionerRole->isEmpty()) { + // Create new practitioner role if not found + $practitioner->practitionerRoles()->create([ + 'organization_id' => $organization_id, + 'speciality_id' => $speciality_id, + ]); + } + } + } + + + if ($practitionerRole) { + // Remove practitioner roles that are no longer exists + $currentRoleIds = $practitionerRole->pluck('id')->toArray(); + $newRoleIds = []; + + foreach ($practices as $practice) { + $organization_id = $practice['organization_id']; + foreach ($practice['specialities'] as $speciality) { + $speciality_id = $speciality['speciality_id']; + $newPractitionerRole = $practitionerRole->where('organization_id', $organization_id) + ->where('speciality_id', $speciality_id) + ->first(); + + if ($newPractitionerRole) { + $newRoleIds[] = $newPractitionerRole->id; + } + } + } + + $deletedRoleIds = array_diff($currentRoleIds, $newRoleIds); + + if (count($deletedRoleIds) > 0) { + // Delete practitioner roles that are no longer exists + $data = $practitionerRole->whereIn('id', $deletedRoleIds); + $data->each(function ($item) { + $item->delete(); + }); + } + } + + return response()->json([ + 'status' => 'success', + 'message' => 'Data berhasil disimpan', + ]); } /** @@ -106,6 +231,14 @@ class DoctorController extends Controller */ public function destroy($id) { - // + $practitioner = Practitioner::find($id); + $person = $practitioner->person->delete(); + $address = $practitioner->person->addresses()->delete(); + $practitionerRole = $practitioner->practitionerRoles()->delete(); + $practitioner->delete(); + return response()->json([ + 'status' => 'success', + 'message' => 'Data berhasil dihapus', + ]); } } diff --git a/Modules/Internal/Http/Controllers/Api/OrganizationController.php b/Modules/Internal/Http/Controllers/Api/OrganizationController.php index a22c1010..67ff2ff4 100644 --- a/Modules/Internal/Http/Controllers/Api/OrganizationController.php +++ b/Modules/Internal/Http/Controllers/Api/OrganizationController.php @@ -47,7 +47,44 @@ class OrganizationController extends Controller */ public function store(Request $request) { - // + $organization = [ + 'code' => $request->code, + 'name' => $request->name, + 'type' => 'hospital', + 'status' => $request->active == 1 ? 'active' : 'inactive', + 'description' => $request->description, + ]; + + $create_organization = Organization::create($organization); + + if ($request->phone != null) { + $create_organization->metas()->create([ + 'system' => 'default', + 'type' => 'phone', + 'value' => $request->phone, + ]); + } + + $address = $create_organization->addresses()->create([ + 'use' => 'both', + 'type' => 'physical', + 'text' => $request->address, + 'province_id' => $request->province_id, + 'city_id' => $request->city_id, + 'district_id' => $request->district_id, + 'village_id' => $request->village_id, + 'postal_code' => $request->postal_code, + 'lat' => $request->lat, + 'lng' => $request->lng, + ]); + + $create_organization->main_address_id = $address->id; + $create_organization->save(); + + return response()->json([ + 'message' => 'Data berhasil disimpan', + 'data' => new OrganizationResource($create_organization) + ]); } /** @@ -57,7 +94,7 @@ class OrganizationController extends Controller */ public function show($id) { - return view('internal::show'); + return response()->json(OrganizationResource::make(Organization::find($id))); } /** @@ -67,7 +104,7 @@ class OrganizationController extends Controller */ public function edit($id) { - return view('internal::edit'); + return response()->json(OrganizationResource::make(Organization::find($id))); } /** @@ -78,7 +115,46 @@ class OrganizationController extends Controller */ public function update(Request $request, $id) { - // + $update_organization = Organization::find($id); + + $update_organization->update([ + 'code' => $request->code, + 'name' => $request->name, + 'type' => 'hospital', + 'status' => $request->active == 1 ? 'active' : 'inactive', + 'description' => $request->description, + ]); + + if ($request->phone != null) { + $update_organization->metas()->updateOrCreate([ + 'system' => 'default', + 'type' => 'phone', + ], [ + 'system' => 'default', + 'type' => 'phone', + 'value' => $request->phone, + ]); + } + + $update_organization->addresses()->updateOrCreate([ + 'id' => $update_organization->main_address_id + ], [ + 'use' => 'both', + 'type' => 'physical', + 'text' => $request->address, + 'province_id' => $request->province_id, + 'city_id' => $request->city_id, + 'district_id' => $request->district_id, + 'village_id' => $request->village_id, + 'postal_code' => $request->postal_code, + 'lat' => $request->lat, + 'lng' => $request->lng, + ]); + + return response()->json([ + 'message' => 'Data berhasil diubah', + 'data' => new OrganizationResource($update_organization) + ]); } /** @@ -88,6 +164,12 @@ class OrganizationController extends Controller */ public function destroy($id) { - // + $delete_organization = Organization::find($id); + $delete_organization->addresses()->delete(); + $delete_organization->delete(); + return response()->json([ + 'message' => 'Data berhasil dihapus', + 'data' => new OrganizationResource($delete_organization) + ]); } } diff --git a/Modules/Internal/Http/Controllers/Api/ProvinceController.php b/Modules/Internal/Http/Controllers/Api/ProvinceController.php new file mode 100644 index 00000000..148fbb1a --- /dev/null +++ b/Modules/Internal/Http/Controllers/Api/ProvinceController.php @@ -0,0 +1,86 @@ +get(); + + if (empty($province)) { + return response(['message' => 'Tidak ada data'], 404); + } else { + return response(['message' => 'Data ditemukan', 'data' => $province]); + } + } + + /** + * Show the form for creating a new resource. + * @return Renderable + */ + public function create() + { + return view('internal::create'); + } + + /** + * Store a newly created resource in storage. + * @param Request $request + * @return Renderable + */ + public function store(Request $request) + { + // + } + + /** + * Show the specified resource. + * @param int $id + * @return Renderable + */ + public function show($id) + { + return view('internal::show'); + } + + /** + * Show the form for editing the specified resource. + * @param int $id + * @return Renderable + */ + public function edit($id) + { + return view('internal::edit'); + } + + /** + * Update the specified resource in storage. + * @param Request $request + * @param int $id + * @return Renderable + */ + public function update(Request $request, $id) + { + // + } + + /** + * Remove the specified resource from storage. + * @param int $id + * @return Renderable + */ + public function destroy($id) + { + // + } +} diff --git a/Modules/Internal/Http/Controllers/Api/VillageController.php b/Modules/Internal/Http/Controllers/Api/VillageController.php new file mode 100644 index 00000000..6e80ccff --- /dev/null +++ b/Modules/Internal/Http/Controllers/Api/VillageController.php @@ -0,0 +1,86 @@ +district_id)->orderBy('name', 'asc')->get(); + + if (!$villages) { + return response(['message' => 'Tidak ada data'], 404); + } else { + return response(['message' => 'Data ditemukan', 'data' => $villages]); + } + } + + /** + * Show the form for creating a new resource. + * @return Renderable + */ + public function create() + { + return view('internal::create'); + } + + /** + * Store a newly created resource in storage. + * @param Request $request + * @return Renderable + */ + public function store(Request $request) + { + // + } + + /** + * Show the specified resource. + * @param int $id + * @return Renderable + */ + public function show($id) + { + return view('internal::show'); + } + + /** + * Show the form for editing the specified resource. + * @param int $id + * @return Renderable + */ + public function edit($id) + { + return view('internal::edit'); + } + + /** + * Update the specified resource in storage. + * @param Request $request + * @param int $id + * @return Renderable + */ + public function update(Request $request, $id) + { + // + } + + /** + * Remove the specified resource from storage. + * @param int $id + * @return Renderable + */ + public function destroy($id) + { + // + } +} diff --git a/Modules/Internal/Routes/api.php b/Modules/Internal/Routes/api.php index 143727c9..8b7dd01e 100755 --- a/Modules/Internal/Routes/api.php +++ b/Modules/Internal/Routes/api.php @@ -4,6 +4,7 @@ use App\Http\Controllers\Api\MemberController as ApiMemberController; use Modules\Internal\Http\Controllers\Api\AuthController; use Illuminate\Http\Request; use Modules\Internal\Http\Controllers\Api\BenefitController; +use Modules\Internal\Http\Controllers\Api\CityController; use Modules\Internal\Http\Controllers\Api\ClaimController; use Modules\Internal\Http\Controllers\Api\CorporateBenefitController; use Modules\Internal\Http\Controllers\Api\CorporateController; @@ -13,6 +14,7 @@ use Modules\Internal\Http\Controllers\Api\CorporatePlanController; use Modules\Internal\Http\Controllers\Api\CorporateServiceController; use Modules\Internal\Http\Controllers\Api\DiagnosisController; use Modules\Internal\Http\Controllers\Api\DiagnosisExclusionController; +use Modules\Internal\Http\Controllers\Api\DistrictController; use Modules\Internal\Http\Controllers\Api\DivisionController; use Modules\Internal\Http\Controllers\Api\DoctorController; use Modules\Internal\Http\Controllers\Api\DrugController; @@ -20,7 +22,9 @@ use Modules\Internal\Http\Controllers\Api\FormulariumController; use Modules\Internal\Http\Controllers\Api\MemberController; use Modules\Internal\Http\Controllers\Api\OrganizationController; use Modules\Internal\Http\Controllers\Api\PlanController; +use Modules\Internal\Http\Controllers\Api\ProvinceController; use Modules\Internal\Http\Controllers\Api\SpecialityController; +use Modules\Internal\Http\Controllers\Api\VillageController; /* |-------------------------------------------------------------------------- @@ -125,8 +129,8 @@ Route::prefix('internal')->group(function () { Route::get('generate-log/{member_id}', [CorporateMemberController::class, 'generateLog']); }); - // Route::resource('organizations', OrganizationController::class); - // Route::resource('doctors', DoctorController::class); - - // Route::get('something', [DiagnosisExclusionController::class, 'index']); + Route::get('province', [ProvinceController::class, 'index']); + Route::get('city', [CityController::class, 'index']); + Route::get('district', [DistrictController::class, 'index']); + Route::get('village', [VillageController::class, 'index']); }); diff --git a/Modules/Internal/Transformers/DoctorResource.php b/Modules/Internal/Transformers/DoctorResource.php index c5f31fca..5889b3a5 100644 --- a/Modules/Internal/Transformers/DoctorResource.php +++ b/Modules/Internal/Transformers/DoctorResource.php @@ -4,6 +4,8 @@ namespace Modules\Internal\Transformers; use Illuminate\Http\Resources\Json\JsonResource; +use function PHPSTORM_META\map; + class DoctorResource extends JsonResource { /** @@ -19,35 +21,51 @@ class DoctorResource extends JsonResource // 'his_dokter_id' => $this->practitionerRoles->meta, 'name' => $this->person->name, 'person_id' => $this->person->id, - 'phone' => $this->person->phone, - 'email' => $this->person->email, - 'gender' => $this->person->gender == "L" ? 'Laki-laki' : 'Perempuan', - 'address' => $this->person->currentAddress->text, + 'phone' => $this->person->phone ?? null, + 'email' => $this->person->email ?? null, + 'birth_date' => $this->person->birth_date ?? null, + 'birth_place' => $this->person->birth_place ?? null, + 'gender' => $this->person->gender == "L" || $this->person->gender == "male" ? 'male' : 'female', + 'address' => $this->person->currentAddress->text ?? null, 'organizations' => $this->practitionerRoles->unique('organization_id')->map(function ($practitionerRole) { return [ 'organization_id' => $practitionerRole->organization->id, 'organization_name' => $practitionerRole->organization->name, ]; - }), + })->values(), "specialties" => $this->practitionerRoles->unique('speciality_id')->map(function ($practitionerRole) { return [ 'specialty_id' => $practitionerRole->speciality->id, 'specialty_name' => $practitionerRole->speciality->name, ]; }), - "departemen" => $this->practitionerRoles->map(function ($practitionerRole) { - return [ - 'departemen_id' => $practitionerRole->meta->DepartemenID, - ]; - }), - 'education' => $this->meta->education, - 'experience' => $this->meta->work_experience, - 'award' => $this->meta->award, - 'keilmuan' => $this->meta->Keilmuan, - 'tipe_dokter' => $this->meta->tipeDokter, + // "departemen" => $this->practitionerRoles->map(function ($practitionerRole) { + // return [ + // 'departemen_id' => $practitionerRole->meta->DepartemenID ?? null, + // ]; + // }) ?? null, + 'education' => $this->meta->education ?? null, + 'experience' => $this->meta->work_experience ?? null, + 'award' => $this->meta->award ?? null, + 'keilmuan' => $this->meta->Keilmuan ?? null, + 'tipe_dokter' => $this->meta->tipeDokter ?? null, ]; + $grouped = $this->collection($this->practitionerRoles)->groupBy('organization_id'); + $grouped->transform(function ($items, $key) { + return [ + 'organization_id' => $key, + 'specialities' => $items->map(function ($item) { + return [ + 'speciality_id' => $item->speciality->id, + ]; + }), + ]; + }); + + $doctor['practices'] = $grouped->toArray(); + return $doctor; } } diff --git a/Modules/Internal/Transformers/OrganizationResource.php b/Modules/Internal/Transformers/OrganizationResource.php index d726d704..283fd9c9 100644 --- a/Modules/Internal/Transformers/OrganizationResource.php +++ b/Modules/Internal/Transformers/OrganizationResource.php @@ -14,17 +14,24 @@ class OrganizationResource extends JsonResource */ public function toArray($request) { + $organization = [ 'id' => $this->id, 'name' => $this->name, 'type' => $this->type, 'code' => $this->code, 'description' => $this->description, - 'kodeRs' => $this->meta->kodeRs ?? null, + 'kodeRs' => $this->meta->KodeRS ?? null, 'phone' => $this->meta->phone ?? null, 'lat' => $this->currentAddress->lat ?? null, 'lng' => $this->currentAddress->lng ?? null, - 'address' => $this->currentAddress ?? null, + 'address' => $this->currentAddress->text ?? null, + 'province_id' => $this->currentAddress->province_id ?? null, + 'city_id' => $this->currentAddress->city_id ?? null, + 'district_id' => $this->currentAddress->district_id ?? null, + 'village_id' => $this->currentAddress->village_id ?? null, + 'postal_code' => $this->currentAddress->postal_code ?? null, + 'active' => $this->status == 'active' ? 1 : 0, ]; return $organization; diff --git a/app/Models/Person.php b/app/Models/Person.php index a9c0814b..af6fb438 100755 --- a/app/Models/Person.php +++ b/app/Models/Person.php @@ -114,6 +114,11 @@ class Person extends Model return $this->hasOne(User::class, 'person_id'); } + public function practitioner() + { + return $this->hasOne(Practitioner::class, 'person_id'); + } + public function appointmentParticipantables() { return $this->morphMany(AppointmentParticipant::class, 'participantable'); diff --git a/frontend/dashboard/.env.development b/frontend/dashboard/.env.development new file mode 100755 index 00000000..c429fda8 --- /dev/null +++ b/frontend/dashboard/.env.development @@ -0,0 +1,7 @@ +GENERATE_SOURCEMAP=false + +PORT=8083 + +REACT_APP_HOST_API_URL="http://localhost:8000" + +VITE_API_URL="http://localhost:8000/api/internal" diff --git a/frontend/dashboard/src/pages/Master/Doctors/Create.tsx b/frontend/dashboard/src/pages/Master/Doctors/Create.tsx index b0f07577..0086d737 100644 --- a/frontend/dashboard/src/pages/Master/Doctors/Create.tsx +++ b/frontend/dashboard/src/pages/Master/Doctors/Create.tsx @@ -9,7 +9,6 @@ import Form from './Form'; import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs'; import axios from '../../../utils/axios'; import { Practitioner } from '../../../@types/doctor'; -import ButtonBack from '../../../components/ButtonBack'; export default function Create() { const { themeStretch } = useSettings(); @@ -31,7 +30,6 @@ export default function Create() { - ); } -// const pageTitle = 'Create Data Dokter'; -// return ( -// -// -// - -// -// -// -//
-// -// -// -// -// -// ); -// } diff --git a/frontend/dashboard/src/pages/Master/Doctors/Form.tsx b/frontend/dashboard/src/pages/Master/Doctors/Form.tsx index 39885db8..c2037e43 100644 --- a/frontend/dashboard/src/pages/Master/Doctors/Form.tsx +++ b/frontend/dashboard/src/pages/Master/Doctors/Form.tsx @@ -8,7 +8,7 @@ import Select, { SelectChangeEvent } from '@mui/material/Select'; import * as React from 'react'; // form -import { useForm } from 'react-hook-form'; +import { useForm, Controller } from 'react-hook-form'; import { yupResolver } from '@hookform/resolvers/yup'; // @mui import { styled } from '@mui/material/styles'; @@ -25,6 +25,7 @@ import { Typography, TextField, Chip, + Autocomplete, } from '@mui/material'; import CancelIcon from '@mui/icons-material/Cancel'; @@ -41,17 +42,20 @@ import { RHFMultiCheckbox, RHFCheckbox, RHFCustomMultiCheckbox, + RHFSelect, } from '../../../components/hook-form'; import axios from '../../../utils/axios'; import { fCurrency } from '../../../utils/formatNumber'; import { Practitioner } from '../../../@types/doctor'; +import AddIcon from '@mui/icons-material/Add'; import { Label, Rowing } from '@mui/icons-material'; +import { email } from '../../../_mock/email'; const LabelStyle = styled(Typography)(({ theme }) => ({ - ...theme.typography.subtitle2, - color: theme.palette.text.secondary, - marginBottom: theme.spacing(1), + ...theme.typography.h6, + marginBottom: theme.spacing(2), + marginTop: theme.spacing(2), })); const HeaderStyle = styled('header')(({ theme }) => ({ @@ -66,7 +70,6 @@ const Title = styled(Typography)(({ theme }) => ({ boxShadow: 'none', // paddingBottom: theme.spacing(3), fontWeight: 700, - color: '#005B7F', })); interface FormValuesProps extends Partial { @@ -106,6 +109,8 @@ export default function PractitionerForm({ isEdit, currentPractitioner }: Props) () => ({ id: currentPractitioner?.id, name: currentPractitioner?.name || '', + email: currentPractitioner?.email || '', + phone: currentPractitioner?.phone || '', address: currentPractitioner?.address || '', birth_date: currentPractitioner?.birth_date || '', gender: currentPractitioner?.gender || '', @@ -121,6 +126,8 @@ export default function PractitionerForm({ isEdit, currentPractitioner }: Props) [currentPractitioner] ); + console.log('currentPractitioner', currentPractitioner); + console.log('defaultValues', defaultValues); function StatusLabel({ value }: { value: boolean }) { @@ -168,91 +175,391 @@ export default function PractitionerForm({ isEdit, currentPractitioner }: Props) // eslint-disable-next-line react-hooks/exhaustive-deps }, [isEdit, currentPractitioner]); - const handleActivate = (event: React.ChangeEvent) => { - setValue('active', event.target.checked); + const onSubmit = async (data: FormValuesProps) => { + try { + const formData = new FormData(); + formData.append('name', data.name); + formData.append('gender', data.gender); + formData.append('address', data.address); + formData.append('birth_place', data.birth_place); + formData.append('birth_date', data.birth_date); + formData.append('email', data.email); + formData.append('phone', data.phone); + // formData.append('active', data.active ? '1' : '0'); + forms.forEach((form, index) => { + formData.append(`practices[${index}][organization_id]`, form.organizationId); + form.specialities.forEach((speciality, i) => { + formData.append(`practices[${index}][specialities][${i}][speciality_id]`, speciality); + }); + }); - console.log('event.target.checked', event.target.checked); + if (!isEdit) { + console.log('formData', formData); + const response = await axios.post('/doctors', formData); + } else { + formData.append('_method', 'PUT'); + const response = await axios.post('/doctors/' + currentPractitioner?.id ?? '', formData); + } + reset(); + enqueueSnackbar(!isEdit ? 'Doctors Created Successfully!' : 'Doctors Udpated Successfully!', { + variant: 'success', + }); + navigate('/master/doctors'); + } catch (error: any) { + if (error && error.response.status === 422) { + console.log('error', error.response.data.errors); + for (const [key, value] of Object.entries(error.response.data.errors)) { + setError(key, { message: value[0] }); + enqueueSnackbar(value[0] ?? 'Failed Processing Request', { variant: 'error' }); + } + } else { + enqueueSnackbar(error.message ?? 'Failed Processing Request', { variant: 'error' }); + } + } - const formData = new FormData(); - formData.append('active', event.target.checked ? '1' : '0'); - formData.append('_method', 'PUT'); - axios.post('/doctors/' + currentPractitioner?.id ?? '', formData); + const ascent = document?.querySelector('ascent'); + if (ascent != null) { + ascent.innerHTML = ''; + } + }; - enqueueSnackbar('active Updated Successfully!', { variant: 'success' }); + const [organizations, setOrganizations] = useState([]); + const [specialities, setSpecialities] = useState([]); + + useEffect(() => { + axios.get(`/search-organizations`).then((response) => { + setOrganizations( + response.data.map((item: any) => ({ ...item, name: item.name, value: item.id })) + ); + }); + + axios.get(`/search-specialities`).then((response) => { + setSpecialities( + response.data.map((item: any) => ({ ...item, name: item.name, value: item.id })) + ); + }); + }, []); + + // const specialities = [ + // { name: 'Dentistry', id: 1 }, + // { name: 'Dermatology', id: 2 }, + // { name: 'General Medicine', id: 3 }, + // { name: 'Pediatrics', id: 4 }, + // { name: 'Surgery', id: 5 }, + // ]; + + const practices = currentPractitioner?.practices || []; + // const practices = [ + // { + // organization_id: 187, + // specialities: [ + // { + // speciality_id: 7, + // }, + // { + // speciality_id: 6, + // }, + // ], + // }, + // { + // organization_id: 181, + // specialities: [ + // { + // speciality_id: 2, + // }, + // ], + // }, + // ]; + + const [forms, setForms] = useState([]); + + useEffect(() => { + if (practices.length > 0) { + const newForms = practices.map((practice: any) => { + return { + organizationId: practice.organization_id, + specialities: practice.specialities.map((s) => s.speciality_id), + }; + }); + setForms(newForms); + } else { + setForms([ + { + organizationId: '', + specialities: [], + }, + ]); + } + }, [practices && practices.length]); + // }, []); + + console.log('forms', forms); + + const findValueOrganization = (organizationId) => { + if (organizationId === '' || organizationId === null) { + return { name: '', value: '' }; + } else { + const organization = organizations.find((o) => o.id === organizationId); + return { name: organization?.name, value: organizationId }; + } + }; + + // console.log('findValueOrganization', findValueOrganization(187)); + + // const findValueSpeciality = (specialityIds: number[]) => { + // if (specialityIds.length === 0) { + // return []; + // } else { + // const data = specialities.filter((s) => specialityIds.includes(s.id)); + // return data.map((d) => ({ name: d.name, value: d.id })); + // } + // }; + + const findValueSpeciality = (values: any) => { + return specialities.filter((s) => values.includes(s.value)); + }; + + // const [forms, setForms] = useState([ + // { + // organizationId: '', + // specialities: [], + // }, + // ]); + + const addForm = () => { + setForms([ + ...forms, + { + organizationId: '', + specialities: [], + }, + ]); + }; + console.log('forms', forms); + + const gender = [ + { + value: 'male', + label: 'Laki-Laki', + }, + { + value: 'female', + label: 'Perempuan', + }, + ]; + + console.log('forms', forms); + // const handleSpecialitiesChange = (index: number, value: any) => { + // const newForms = [...forms]; + // newForms[index].specialities = value.map((v: any) => ({ speciality_id: v.id })); + // setForms(newForms); + // }; + // const handleSpecialitiesChange = (index: number, value: any) => { + // const updatedForms = [...forms]; + // updatedForms[index].specialities = value.map((v: any) => v.speciality_id); + // setForms(updatedForms); + // }; + + const handleOrganizationIdChange = (index, value) => { + const updatedForms = [...forms]; + updatedForms[index].organizationId = value.id; + setForms(updatedForms); + }; + + const handleSpecialitiesChange = (index: number, value: any) => { + setForms((forms) => { + forms[index].specialities = value.map((v: any) => v.value); + return [...forms]; + }); + }; + + // const availableOrganizations = organizations.filter( + // (org) => + // !forms.some((f) => f.organization && f.organization.id === org.id) || + // forms.findIndex((f) => f.organization && f.organization.id === org.id) === editIndex + // ); + const availableOrganizations = + practices.length > 0 + ? organizations.filter( + (org) => !practices.some((practice) => practice.organization_id === org.id) + ) + : organizations.filter((org) => !forms.some((f) => f.organizationId === org.id)); + + // const availableOrganizations = organizations.filter( + // (org) => !practices.some((p) => p.organization_id === org.id) + // ); + + const handleDeleteForm = (index) => { + const updatedForms = [...forms]; + updatedForms.splice(index, 1); + setForms(updatedForms); }; return ( - + {/* */} - + {/* Data Dokter - {/* Status Rumah Sakit */} - + - + */} Informasi Umum - - - - - Nama Dokter - {currentPractitioner?.name ? currentPractitioner?.name : '-'} - No Telp - {currentPractitioner?.phone ? currentPractitioner?.phone : '-'} - Tempat Lahir - - {currentPractitioner?.birth_place ? currentPractitioner?.birth_place : '-'} - - Alamat - {currentPractitioner?.address ? currentPractitioner?.address : '-'} + + + Nama Dokter + - - Jenis Kelamin - {currentPractitioner?.gender ? currentPractitioner?.gender : '-'} - Email - {currentPractitioner?.email ? currentPractitioner?.email : '-'} - Tanggal Lahir - - {currentPractitioner?.birth_date ? currentPractitioner?.birth_date : '-'} - + + + Jenis Kelamin + + + ))} + + + + Alamat + + + + + Tempat Lahir + + + + Tanggal Lahir + + + + Email + + + + No. Telp + - Tempat Praktik - {currentPractitioner?.organizations?.map((item, index) => ( - - - - {item.name} + + Tempat Praktik + + + + {forms.map((form, index) => ( +
+ + + + {index !== 0 && ( + + // + )} + + {/*

{form.organizationId}

*/} + + + option.name} + isOptionEqualToValue={(option, value) => option.value === value.value} + onChange={(event, value) => handleOrganizationIdChange(index, value)} + renderInput={(params) => ( + + )} + /> + {/* + option.name ?? findValueOrganization(form.organizationId).name ?? '' + } + onChange={(event, value) => handleOrganizationIdChange(index, value)} + renderInput={(params) => ( + + )} + /> */} + + + {form.specialities && ( + // option.name} + // isOptionEqualToValue={(option, value) => option.value === value.value} + // onChange={(event, value) => handleSpecialitiesChange(index, value)} + // renderInput={(params) => ( + // + // )} + // /> + + option.name} + onChange={(event, value) => handleSpecialitiesChange(index, value)} + renderInput={(params) => ( + + )} + /> + )} + - -
- ))} - - - Spesialisasi - {currentPractitioner?.specialities?.map((item, index) => ( - - - - {item.name} - - - + +
))}
+ + + + + {!isEdit ? 'Simpan' : 'Simpan Perubahan'} + + + +
diff --git a/frontend/dashboard/src/pages/Master/Doctors/List.tsx b/frontend/dashboard/src/pages/Master/Doctors/List.tsx index f311bc2a..03238342 100644 --- a/frontend/dashboard/src/pages/Master/Doctors/List.tsx +++ b/frontend/dashboard/src/pages/Master/Doctors/List.tsx @@ -57,6 +57,7 @@ import { Search } from '@mui/icons-material'; import { Icon } from '@iconify/react'; import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'; +import AddIcon from '@mui/icons-material/Add'; // ---------------------------------------------------------------------- @@ -205,9 +206,16 @@ export default function List() { spacing={2} sx={{ p: 2, justifyContent: 'space-between', alignItems: 'center' }} > - + + + + + + ); } @@ -297,15 +305,22 @@ export default function List() { */} - {/* + - + + - */} + {/* COLLAPSIBLE ROW */} @@ -336,7 +351,12 @@ export default function List() { Jenis Kelamin - : {row.gender ? row.gender : '-'} + :{' '} + {row.gender == 'male' + ? 'Laki-Laki' + : row.gender == 'female' + ? 'Perempuan' + : '-'} diff --git a/frontend/dashboard/src/pages/Master/Hospitals/Create.tsx b/frontend/dashboard/src/pages/Master/Hospitals/Create.tsx index 03cc498e..efcb13d6 100644 --- a/frontend/dashboard/src/pages/Master/Hospitals/Create.tsx +++ b/frontend/dashboard/src/pages/Master/Hospitals/Create.tsx @@ -9,7 +9,6 @@ import Form from './Form'; import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs'; import axios from '../../../utils/axios'; import { Organizations } from '../../../@types/organization'; -import ButtonBack from '../../../components/ButtonBack'; export default function Create() { const { themeStretch } = useSettings(); @@ -31,25 +30,20 @@ export default function Create() { - - + ); diff --git a/frontend/dashboard/src/pages/Master/Hospitals/Form.tsx b/frontend/dashboard/src/pages/Master/Hospitals/Form.tsx index 546d225a..1574953c 100644 --- a/frontend/dashboard/src/pages/Master/Hospitals/Form.tsx +++ b/frontend/dashboard/src/pages/Master/Hospitals/Form.tsx @@ -65,7 +65,6 @@ const LabelStyle = styled(Typography)(({ theme }) => ({ })); const HeaderStyle = styled('header')(({ theme }) => ({ - padding: theme.spacing(5), display: 'flex', alignItems: 'center', justifyContent: 'space-between', @@ -76,7 +75,6 @@ const Title = styled(Typography)(({ theme }) => ({ boxShadow: 'none', // paddingBottom: theme.spacing(3), fontWeight: 700, - color: '#005B7F', })); // const [timezone, setTimezone] = React.useState(''); @@ -110,10 +108,6 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop const NewCorporateSchema = Yup.object().shape({ name: Yup.string().required('Name is required'), code: Yup.string().required('Corporate Code is required'), - active: Yup.boolean().required('Corporate Status is required'), - lat: Yup.string().required('Latitude is required'), - lng: Yup.string().required('Longitude is required'), - timezone: Yup.string().required('Timezone is required'), // file: Yup.boolean().required('Corporate Status is required'), }); @@ -133,12 +127,6 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop village_id: currentOrganizations?.village_id || '', postal_code: currentOrganizations?.postal_code || '', description: currentOrganizations?.description || '', - technology: currentOrganizations?.technology || '', - support_services: currentOrganizations?.support_services || '', - merchant_code: currentOrganizations?.merchant_code || '', - merchant_key: currentOrganizations?.merchant_key || '', - image_url: currentOrganizations?.image_url || '', - region_groups: currentOrganizations?.region_groups || '', }), // eslint-disable-next-line react-hooks/exhaustive-deps [currentOrganizations] @@ -192,25 +180,15 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop // eslint-disable-next-line react-hooks/exhaustive-deps }, [isEdit, currentOrganizations]); - const currentImage = currentOrganizations?.image_url; - console.log('currentImage', currentImage); - - console.log('current_image', currentImage); - - const [file, setFile] = useState(null); - console.log('file', file); - const onSubmit = async (data: FormValuesProps) => { try { const formData = new FormData(); - console.log('data', data); formData.append('name', data.name); formData.append('code', data.code); formData.append('phone', data.phone); formData.append('lat', data.lat); formData.append('lng', data.lng); formData.append('address', data.address); - formData.append('timezone', data.timezone); formData.append('active', data.active ? '1' : '0'); if (data.province_id === currentOrganizations?.province_id) { formData.append('province_id', data.province_id); @@ -235,21 +213,12 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop } else { formData.append('village_id', data.village_id?.value ?? ''); } - if (data.region_groups === currentOrganizations?.region_groups) { - formData.append('region_groups', data.region_groups); - } else { - formData.append('region_groups', data.region_groups?.value ?? ''); - } formData.append('postal_code', data.postal_code); formData.append('description', data.description); - formData.append('technology', data.technology); - formData.append('support_services', data.support_services); - formData.append('merchant_code', data.merchant_code); - formData.append('merchant_key', data.merchant_key); - formData.append('image', file); if (!isEdit) { + console.log('formData', formData); const response = await axios.post('/organizations', formData); } else { formData.append('_method', 'PUT'); @@ -263,9 +232,10 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop !isEdit ? 'Organizations Created Successfully!' : 'Organizations Udpated Successfully!', { variant: 'success' } ); - navigate('/master/organizations'); + navigate('/master/hospitals'); } catch (error: any) { if (error && error.response.status === 422) { + console.log('error', error.response.data.errors); for (const [key, value] of Object.entries(error.response.data.errors)) { setError(key, { message: value[0] }); enqueueSnackbar(value[0] ?? 'Failed Processing Request', { variant: 'error' }); @@ -281,34 +251,10 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop } }; - const [valueTab, setValueTab] = React.useState('1'); - - const handleChangeTab = (event: React.SyntheticEvent, newValueTab: string) => { - setValueTab(newValueTab); - }; - - const handleDrop = useCallback( - (acceptedFiles) => { - setValue( - 'logo', - acceptedFiles.map((file: Blob | MediaSource) => - Object.assign(file, { - preview: URL.createObjectURL(file), - }) - ) - ); - }, - [setValue] - ); - - const handleRemove = (file: File | string) => { - setValue('logo', null); - }; - const [province, setProvince] = useState([]); const [city, setCity] = useState([]); const [district, setDistrict] = useState([]); - // const [village, setVillage] = useState([]); + const [village, setVillage] = useState([]); useEffect(() => { axios.get('/province').then((res) => { @@ -335,17 +281,15 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop } }; - // if (values.province_id) { - // if (values.city_id) { - // loadDistrict(); - // } else { - // loadCity(); - // } - // } else { - // axios.get('/province').then((res) => { - // setProvince(res.data.data.map((item: any) => ({ value: item.id, label: item.name }))); - // }); - // } + const loadVillage = async () => { + if (values.district_id == currentOrganizations?.district_id) { + const res = await axios.get('/village?district_id=' + values.district_id); + setVillage(res.data.data.map((item: any) => ({ value: item.id, label: item.name }))); + } else { + const res = await axios.get('/village?district_id=' + values.district_id?.value); + setVillage(res.data.data.map((item: any) => ({ value: item.id, label: item.name }))); + } + }; if (values.province_id) { loadCity(); @@ -354,12 +298,11 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop if (values.city_id) { loadDistrict(); } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [values.province_id, values.city_id, values.district_id]); - console.log('province', values.province_id); - console.log('city', values.city_id); - console.log('district', values.district_id); + if (values.district_id) { + loadVillage(); + } + }, [values.province_id, values.city_id, values.district_id, values.village_id]); const findValueProvince = province.find( (item: any) => item.value === currentOrganizations?.province_id @@ -368,53 +311,8 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop const findValueDistrict = district.find( (item: any) => item.value === currentOrganizations?.district_id ); - - console.log('findValueProvince', findValueProvince); - console.log('findValueCity', findValueCity); - console.log('findValueDistrict', findValueDistrict); - const timezone = [ - { - value: 'WIB', - label: 'WIB', - }, - { - value: 'WITA', - label: 'WITA', - }, - { - value: 'WIT', - label: 'WIT', - }, - ]; - const region_groups = [ - { - value: 'Jabodetabek', - label: 'Jabodetabek', - }, - { - value: 'Jawa', - label: 'Jawa', - }, - { - value: 'Kalimantan', - label: 'Kalimantan', - }, - { - value: 'Papua', - label: 'Papua', - }, - { - value: 'Sulawesi', - label: 'Sulawesi', - }, - { - value: 'Sumatera', - label: 'Sumatera', - }, - ]; - - const findVaalueGroupWilayah = region_groups.find( - (item: any) => item.value === currentOrganizations?.region_groups + const findValueVillage = village.find( + (item: any) => item.value === currentOrganizations?.village_id ); return ( @@ -431,326 +329,147 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop - - - - - - - - - - - - - - Nama Rumah Sakit - - - - Pilih Foto Rumah Sakit - - - - - - Nomor IGD - - - - Code Rumah Sakit - - - - Group Wilayah - ( - - option.label ?? findVaalueGroupWilayah?.label ?? '' - } - value={value} - onChange={(event: any, newValue: any) => { - console.log('newValue', newValue); - setValue('region_groups', newValue?.value); - onChange(newValue); - }} - renderInput={(params) => ( - - )} - /> - )} - /> - - - Alamat - - - - Provinsi - {/* - ( - - )} - /> */} + + + + Nama Rumah Sakit + + - ( - - option.label ?? findValueProvince?.label ?? '' - } - value={value} - onChange={(event: any, newValue: any) => { - console.log('newValue', newValue); - setValue('province_id', newValue?.value); - onChange(newValue); - }} - renderInput={(params) => ( - - )} - /> - )} - /> - - - Kabupaten / Kota - {/* ( - - )} - /> */} - ( - option.label ?? findValueCity?.label ?? ''} - value={value} - onChange={(event: any, newValue: any) => { - console.log('newValue', newValue); - setValue('city_id', newValue?.value); - onChange(newValue); - }} - renderInput={(params) => ( - - )} - /> - )} - /> - + + Code Rumah Sakit + + + + Nomor IGD + + + + Alamat + + + + Provinsi - - Kecamatan + ( + option.label ?? findValueProvince?.label ?? ''} + value={value} + onChange={(event: any, newValue: any) => { + console.log('newValue', newValue); + setValue('province_id', newValue?.value); + onChange(newValue); + }} + renderInput={(params) => ( + + )} + /> + )} + /> + + + Kabupaten / Kota - {/* ( - - )} - /> */} + ( + option.label ?? findValueCity?.label ?? ''} + value={value} + onChange={(event: any, newValue: any) => { + console.log('newValue', newValue); + setValue('city_id', newValue?.value); + onChange(newValue); + }} + renderInput={(params) => ( + + )} + /> + )} + /> + - ( - - option.label ?? findValueDistrict?.label ?? '' - } - value={value} - onChange={(event: any, newValue: any) => { - console.log('newValue', newValue); - setValue('district_id', newValue?.value); - onChange(newValue); - }} - renderInput={(params) => ( - - )} - /> - )} - /> - - - Kode Pos - - - - Latitude - - - - Longitude - - - - Timezone - {/* */} - - - ))} - - - - - - - - - - Deskripsi - - - - Teknologi - - - - Layanan Penunjang - - - - - - - - - - Merchant Code - - - - Merchant Key - - - - - - + + Kecamatan + + ( + option.label ?? findValueDistrict?.label ?? ''} + value={value} + onChange={(event: any, newValue: any) => { + console.log('newValue', newValue); + setValue('district_id', newValue?.value); + onChange(newValue); + }} + renderInput={(params) => ( + + )} + /> + )} + /> + + + Desa + + ( + option.label ?? findValueVillage?.label ?? ''} + value={value} + onChange={(event: any, newValue: any) => { + console.log('newValue', newValue); + setValue('village_id', newValue?.value); + onChange(newValue); + }} + renderInput={(params) => ( + + )} + /> + )} + /> + + + Kode Pos + + + + Latitude + + + + Longitude + + + + Deskripsi + + + - + + diff --git a/frontend/dashboard/src/pages/Master/Hospitals/List.tsx b/frontend/dashboard/src/pages/Master/Hospitals/List.tsx index eda78d2f..bd0b7462 100644 --- a/frontend/dashboard/src/pages/Master/Hospitals/List.tsx +++ b/frontend/dashboard/src/pages/Master/Hospitals/List.tsx @@ -147,9 +147,11 @@ export default function List() { > - {/* - - */} + + + ); } @@ -259,26 +261,26 @@ export default function List() { {row.name} {row.phone} - {row.address?.text} + {row.address} - {/* - - - - - - - - - */} + + + + {/* */} + {/* COLLAPSIBLE ROW */} diff --git a/frontend/dashboard/src/routes/index.tsx b/frontend/dashboard/src/routes/index.tsx index bd77a22d..b3af7b29 100755 --- a/frontend/dashboard/src/routes/index.tsx +++ b/frontend/dashboard/src/routes/index.tsx @@ -194,10 +194,26 @@ export default function Router() { path: 'master/doctors', element: , }, + { + path: 'master/doctors/create', + element: , + }, + { + path: 'master/doctors/:id/edit', + element: , + }, { path: 'master/hospitals', element: , }, + { + path: 'master/hospitals/create', + element: , + }, + { + path: 'master/hospitals/:id/edit', + element: , + }, { path: 'master/diagnosis', element: , @@ -320,7 +336,9 @@ const CorporateFormularium = Loadable(lazy(() => import('../pages/Corporates/For const MasterDiagnosis = Loadable(lazy(() => import('../pages/Master/Diagnosis/Index'))); const MasterDoctors = Loadable(lazy(() => import('../pages/Master/Doctors/Index'))); +const MasterDoctorsCreate = Loadable(lazy(() => import('../pages/Master/Doctors/Create'))); const MasterHospitals = Loadable(lazy(() => import('../pages/Master/Hospitals/Index'))); +const MasterHospitalsCreate = Loadable(lazy(() => import('../pages/Master/Hospitals/Create'))); const MasterDrug = Loadable(lazy(() => import('../pages/Master/Drug/Index'))); diff --git a/frontend/dashboard/src/utils/getColorPresets.ts b/frontend/dashboard/src/utils/getColorPresets.ts index 30c7fcbe..04678554 100755 --- a/frontend/dashboard/src/utils/getColorPresets.ts +++ b/frontend/dashboard/src/utils/getColorPresets.ts @@ -36,8 +36,8 @@ export const colorPresets = [ name: 'blue', lighter: '#D1E9FC', light: '#76B0F1', - main: '#2065D1', - dark: '#103996', + main: '#006a35', + dark: '#004422', darker: '#061B64', contrastText: '#fff', }, @@ -63,7 +63,7 @@ export const colorPresets = [ }, ]; -export const defaultPreset = colorPresets[0]; +export const defaultPreset = colorPresets[3]; export const purplePreset = colorPresets[1]; export const cyanPreset = colorPresets[2]; export const bluePreset = colorPresets[3];