Compare commits

...

10 Commits

33 changed files with 2667 additions and 51 deletions

View File

@ -2,12 +2,38 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\PatienRegistration;
use App\Models\Transaction;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;
class DashboardController extends Controller
{
public function index()
{
return view('dashboard');
// Count all patients registered for hospital service
$patient_register_today = PatienRegistration::whereDate('created_at', now())->count();
$patient_register_month = PatienRegistration::whereMonth('created_at', now()->month)->count();
// revenue today
$todayRevenue = Transaction::select(DB::raw('SUM(treatments.fee * transactions.amount) as total'))
->join('treatments', 'transactions.treatment_id', '=', 'treatments.id')
->whereDate('transactions.created_at', Carbon::today())
->value('total');
// Revenue for last month
$lastMonthRevenue = Transaction::select(DB::raw('SUM(treatments.fee * transactions.amount) as total'))
->join('treatments', 'transactions.treatment_id', '=', 'treatments.id')
->whereYear('transactions.created_at', now()->year)
->whereMonth('transactions.created_at', now()->month)
->value('total');
return view('dashboard', [
'title' => 'Dashboard',
'patient_register_today' => $patient_register_today,
'patiet_register_month' => $patient_register_month,
'todayRevenue' => $todayRevenue,
'lastMonthRevenue' => $lastMonthRevenue,
]);
}
}

View File

@ -2,9 +2,90 @@
namespace App\Http\Controllers;
use App\Http\Requests\ManageRegistration\StoreNewRegistration;
use App\Http\Requests\ManageRegistration\UpdateRegistration;
use App\Models\Insurance;
use App\Models\PatienRegistration;
use App\Models\Patient;
use App\Models\ServiceRoom;
use Illuminate\Http\Request;
class PatienRegistrationController extends Controller
{
//
public function index()
{
$registrations = PatienRegistration::with(['user', 'patient', 'insurance', 'service_room'])->get();
return view('registration.index', compact('registrations'));
}
public function create()
{
$patients = Patient::all();
$insurances = Insurance::all();
$serviceRooms = ServiceRoom::all();
return view('registration.add', compact('patients', 'insurances', 'serviceRooms'));
}
public function store(StoreNewRegistration $request)
{
$validatedData = $request->validated();
$data = [
'registration_date' => $validatedData['registration_date'],
'patient_id' => $validatedData['patient_id'],
'insurance_id' => $validatedData['insurance_id'],
'insurance_number' => $validatedData['insurance_number'],
'service_room_id' => $validatedData['service_room_id'],
'responsible_person_name' => $validatedData['responsible_person_name'],
'responsible_person_phone' => $validatedData['responsible_person_phone'],
'responsible_email' => $validatedData['responsible_email'],
'responsible_person_relationship' => $validatedData['responsible_person_relationship'],
'responsible_person_address' => $validatedData['responsible_person_address'],
'user_id' => auth()->id(),
];
PatienRegistration::create($data);
return redirect()->route('patient-registration.index')->with('success', 'Pendaftaran pasien berhasil.');
}
public function edit($id)
{
$registration = PatienRegistration::findOrFail($id);
$patients = Patient::all();
$insurances = Insurance::all();
$serviceRooms = ServiceRoom::all();
return view('registration.edit', compact('registration', 'patients', 'insurances', 'serviceRooms'));
}
public function update(UpdateRegistration $request, $id)
{
$registration = PatienRegistration::findOrFail($id);
$validatedData = $request->validated();
$data = [
'registration_date' => $validatedData['registration_date'],
'patient_id' => $validatedData['patient_id'],
'insurance_id' => $validatedData['insurance_id'],
'insurance_number' => $validatedData['insurance_number'],
'service_room_id' => $validatedData['service_room_id'],
'responsible_person_name' => $validatedData['responsible_person_name'],
'responsible_person_phone' => $validatedData['responsible_person_phone'],
'responsible_email' => $validatedData['responsible_email'],
'responsible_person_relationship' => $validatedData['responsible_person_relationship'],
'responsible_person_address' => $validatedData['responsible_person_address'],
'user_id' => auth()->id(),
];
$registration->update($data);
return redirect()->route('patient-registration.index')->with('success', 'Pendaftaran pasien berhasil diperbarui.');
}
public function destroy($id)
{
$registration = PatienRegistration::findOrFail($id);
$registration->delete();
return redirect()->route('patient-registration.index')->with('success', 'Pendaftaran pasien berhasil dihapus.');
}
}

View File

@ -2,9 +2,64 @@
namespace App\Http\Controllers;
use App\Http\Requests\ManagePatient\StoreNewPatient;
use App\Http\Requests\ManagePatient\UpdatePatient;
use App\Models\Patient;
use Illuminate\Http\Request;
class PatientController extends Controller
{
//
public function index()
{
$patients = Patient::all();
return view('patient.index', compact('patients'));
}
public function create()
{
return view('patient.add');
}
public function store(StoreNewPatient $request)
{
$patient = new Patient();
$patient->fill($request->validated());
// Generate a 16-character medical record number
$uniqueNumber = str_pad(rand(1, 99999999), 8, '0', STR_PAD_LEFT); // Ensure 8 digits
$timestamp = substr(time(), -5); // Take the last 8 digits of the timestamp
$patient->medical_record_number = 'MR' . $timestamp . $uniqueNumber; // Combine to make 16 characters
$patient->save();
return redirect()->route('patient-management.index')->with('success', 'Data pasien baru berhasil ditambahkan!');
}
public function show($id)
{
$patient = Patient::findOrFail($id);
return view('patient.show', compact('patient'));
}
public function edit($id)
{
$patient = Patient::findOrFail($id);
return view('patient.edit', compact('patient'));
}
public function update(UpdatePatient $request, $id)
{
$patient = Patient::findOrFail($id);
$patient->fill($request->validated());
$patient->save();
return redirect()->route('patient-management.index')->with('success', 'Data pasien berhasil diperbarui!');
}
public function destroy($id)
{
$patient = Patient::findOrFail($id);
$patient->delete();
return redirect()->route('patient-management.index')->with('success', 'Data pasien berhasil dihapus!');
}
}

View File

@ -2,9 +2,60 @@
namespace App\Http\Controllers;
use App\Models\ServiceRoom;
use Illuminate\Http\Request;
class ServiceRoomController extends Controller
{
//
/**
* Display a listing of the resource.
*/
public function index()
{
$service_rooms = ServiceRoom::all();
return view('service-room.index', compact('service_rooms'));
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$data = $request->validate([
'name' => 'required|string|max:255',
]);
ServiceRoom::create($data);
return redirect()->route('service-room.index')
->with('success', 'Ruang Pelayanan berhasil ditambahkan.');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
$data = $request->validate([
'name' => 'required|string|max:255',
]);
$service_rooms = ServiceRoom::findOrFail($id);
$service_rooms->update($data);
return redirect()->route('service-room.index')
->with('success', 'Ruang Pelayanan berhasil diperbarui.');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
$service_rooms = ServiceRoom::findOrFail($id);
$service_rooms->delete();
return redirect()->route('service-room.index')
->with('success', 'Ruang Pelayanan berhasil dihapus.');
}
}

View File

@ -2,9 +2,72 @@
namespace App\Http\Controllers;
use App\Models\PatienRegistration;
use App\Models\Transaction;
use App\Models\Treatment;
use Illuminate\Http\Request;
class TransactionController extends Controller
{
//
public function index($id)
{
// Fetch the registration data with related models
$registration = PatienRegistration::with(['patient', 'insurance', 'service_room'])->where('id', $id)->first();
$transactions = Transaction::with(['treatment'])
->where('patien_registration_id', $id)
->get();
$treatments = Treatment::all();
// Pass the data to the view
return view('registration.transaction.index', compact('registration', 'transactions', 'treatments'));
}
public function store(Request $request, $id)
{
// Validate the request data
$validatedData = $request->validate([
'treatment_id' => 'required|exists:treatments,id',
'amount' => 'required|numeric|min:0',
]);
// Create a new transaction
Transaction::create([
'patien_registration_id' => $id,
'treatment_id' => $validatedData['treatment_id'],
'amount' => $validatedData['amount'],
'user_id' => auth()->user()->id,
]);
// Redirect back with a success message
return redirect()->back()->with('success', 'Transaksi berhasil ditambahkan.');
}
public function update(Request $request, $transId)
{
// Validate the request data
$validatedData = $request->validate([
'treatment_id' => 'required|exists:treatments,id',
'amount' => 'required|numeric|min:0',
]);
// Find the transaction and update it
$transaction = Transaction::findOrFail($transId);
$transaction->update([
'treatment_id' => $validatedData['treatment_id'],
'amount' => $validatedData['amount'],
]);
// Redirect back with a success message
return redirect()->back()->with('success', 'Transaksi berhasil diperbarui.');
}
public function destroy($transId)
{
// Find the transaction and delete it
$transaction = Transaction::findOrFail($transId);
$transaction->delete();
// Redirect back with a success message
return redirect()->back()->with('success', 'Transaksi berhasil dihapus.');
}
}

View File

@ -2,9 +2,62 @@
namespace App\Http\Controllers;
use App\Models\Treatment;
use Illuminate\Http\Request;
class TreatmentController extends Controller
{
//
/**
* Display a listing of the resource.
*/
public function index()
{
$treatments = Treatment::all();
return view('treatment.index', compact('treatments'));
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$data = $request->validate([
'name' => 'required|string|max:255',
'fee' => 'required|numeric|min:0',
]);
Treatment::create($data);
return redirect()->route('treatment.index')
->with('success', 'Jenis Tindakan berhasil ditambahkan.');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
$data = $request->validate([
'name' => 'required|string|max:255',
'fee' => 'required|numeric|min:0',
]);
$insurance = Treatment::findOrFail($id);
$insurance->update($data);
return redirect()->route('treatment.index')
->with('success', 'Jenis Tindakan berhasil diperbarui.');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
$insurance = Treatment::findOrFail($id);
$insurance->delete();
return redirect()->route('treatment.index')
->with('success', 'Jenis Tindakan berhasil dihapus.');
}
}

View File

@ -33,6 +33,18 @@ class LoginRequest extends FormRequest
];
}
public function messages(): array
{
return [
'nip.required' => 'NIP harus diisi.',
'nip.string' => 'NIP harus berupa string.',
'nip.min' => 'NIP harus terdiri dari 12 karakter.',
'nip.max' => 'NIP tidak boleh lebih dari 12 karakter.',
'password.required' => 'Password harus diisi.',
'password.string' => 'Password harus berupa string.',
];
}
/**
* Attempt to authenticate the request's credentials.
*
@ -49,7 +61,7 @@ class LoginRequest extends FormRequest
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => 'Akun tidak cocok dengan data kami.',
'nip' => 'Akun tidak cocok dengan data kami.',
]);
}

View File

@ -0,0 +1,80 @@
<?php
namespace App\Http\Requests\ManagePatient;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreNewPatient extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'identity_number' => ['required', 'numeric', 'unique:patients,identity_number'],
'first_name' => ['required', 'string', 'max:255'],
'last_name' => ['required', 'string', 'max:255'],
'birth_date' => ['required', 'date'],
'gender' => ['required', Rule::in(['L', 'P'])],
'blood_type' => ['required', Rule::in(['A', 'B', 'AB', 'O'])],
'phone_number' => ['required', 'string', 'max:15'],
'email' => ['required', 'email', 'unique:patients,email'],
'address' => ['required', 'string'],
'allergies' => ['required', 'string'],
'current_medicines' => ['required', 'string'],
'medical_history' => ['required', 'string'],
];
}
/**
* Get custom error messages for validation rules.
*
* @return array<string, string>
*/
public function messages(): array
{
return [
'identity_number.required' => 'NIK wajib diisi.',
'identity_number.numeric' => 'NIK harus berupa angka.',
'identity_number.unique' => 'NIK sudah terdaftar.',
'first_name.required' => 'Nama depan wajib diisi.',
'first_name.string' => 'Nama depan harus berupa teks.',
'first_name.max' => 'Nama depan tidak boleh lebih dari 255 karakter.',
'last_name.required' => 'Nama belakang wajib diisi.',
'last_name.string' => 'Nama belakang harus berupa teks.',
'last_name.max' => 'Nama belakang tidak boleh lebih dari 255 karakter.',
'birth_date.required' => 'Tanggal lahir wajib diisi.',
'birth_date.date' => 'Tanggal lahir harus berupa tanggal yang valid.',
'gender.required' => 'Jenis kelamin wajib dipilih.',
'gender.in' => 'Jenis kelamin harus berupa Laki-Laki (L) atau Perempuan (P).',
'blood_type.required' => 'Golongan darah wajib dipilih.',
'blood_type.in' => 'Golongan darah harus berupa A, B, AB, atau O.',
'phone_number.required' => 'Nomor HP wajib diisi.',
'phone_number.string' => 'Nomor HP harus berupa teks.',
'phone_number.max' => 'Nomor HP tidak boleh lebih dari 15 karakter.',
'email.required' => 'Email wajib diisi.',
'email.email' => 'Email harus berupa alamat email yang valid.',
'email.unique' => 'Email sudah terdaftar.',
'address.required' => 'Alamat wajib diisi.',
'address.string' => 'Alamat harus berupa teks.',
'allergies.required' => 'Alergi wajib diisi.',
'allergies.string' => 'Alergi harus berupa teks.',
'current_medicines.required' => 'Konsumsi obat saat ini wajib diisi.',
'current_medicines.string' => 'Konsumsi obat saat ini harus berupa teks.',
'medical_history.required' => 'Histori medis wajib diisi.',
'medical_history.string' => 'Histori medis harus berupa teks.',
];
}
}

View File

@ -0,0 +1,88 @@
<?php
namespace App\Http\Requests\ManagePatient;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdatePatient extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'identity_number' => [
'required',
'numeric',
Rule::unique('patients', 'identity_number')->ignore($this->route('id')),
],
'first_name' => ['required', 'string', 'max:255'],
'last_name' => ['required', 'string', 'max:255'],
'birth_date' => ['required', 'date'],
'gender' => ['required', Rule::in(['L', 'P'])],
'blood_type' => ['required', Rule::in(['A', 'B', 'AB', 'O'])],
'phone_number' => ['required', 'string', 'max:15'],
'email' => [
'required',
'email',
Rule::unique('patients', 'email')->ignore($this->route('id')),
],
'address' => ['required', 'string'],
'allergies' => ['required', 'string'],
'current_medicines' => ['required', 'string'],
'medical_history' => ['required', 'string'],
];
}
/**
* Get custom error messages for validation rules.
*
* @return array<string, string>
*/
public function messages(): array
{
return [
'identity_number.required' => 'NIK wajib diisi.',
'identity_number.numeric' => 'NIK harus berupa angka.',
'identity_number.unique' => 'NIK sudah terdaftar.',
'first_name.required' => 'Nama depan wajib diisi.',
'first_name.string' => 'Nama depan harus berupa teks.',
'first_name.max' => 'Nama depan tidak boleh lebih dari 255 karakter.',
'last_name.required' => 'Nama belakang wajib diisi.',
'last_name.string' => 'Nama belakang harus berupa teks.',
'last_name.max' => 'Nama belakang tidak boleh lebih dari 255 karakter.',
'birth_date.required' => 'Tanggal lahir wajib diisi.',
'birth_date.date' => 'Tanggal lahir harus berupa tanggal yang valid.',
'gender.required' => 'Jenis kelamin wajib dipilih.',
'gender.in' => 'Jenis kelamin harus berupa Laki-Laki (L) atau Perempuan (P).',
'blood_type.required' => 'Golongan darah wajib dipilih.',
'blood_type.in' => 'Golongan darah harus berupa A, B, AB, atau O.',
'phone_number.required' => 'Nomor HP wajib diisi.',
'phone_number.string' => 'Nomor HP harus berupa teks.',
'phone_number.max' => 'Nomor HP tidak boleh lebih dari 15 karakter.',
'email.required' => 'Email wajib diisi.',
'email.email' => 'Email harus berupa alamat email yang valid.',
'email.unique' => 'Email sudah terdaftar.',
'address.required' => 'Alamat wajib diisi.',
'address.string' => 'Alamat harus berupa teks.',
'allergies.required' => 'Alergi wajib diisi.',
'allergies.string' => 'Alergi harus berupa teks.',
'current_medicines.required' => 'Konsumsi obat saat ini wajib diisi.',
'current_medicines.string' => 'Konsumsi obat saat ini harus berupa teks.',
'medical_history.required' => 'Histori medis wajib diisi.',
'medical_history.string' => 'Histori medis harus berupa teks.',
];
}
}

View File

@ -0,0 +1,75 @@
<?php
namespace App\Http\Requests\ManageRegistration;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreNewRegistration extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'registration_date' => ['required', 'date'],
'patient_id' => ['required', 'exists:patients,id'],
'insurance_id' => ['required', 'exists:insurances,id'],
'insurance_number' => ['required', 'numeric'],
'service_room_id' => ['required', 'exists:service_rooms,id'],
'responsible_person_name' => ['required', 'string', 'max:255'],
'responsible_person_phone' => ['required', 'string', 'max:15'],
'responsible_email' => ['required', 'email', 'max:255'],
'responsible_person_relationship' => ['required', 'string', 'max:100'],
'responsible_person_address' => ['required', 'string', 'max:500'],
];
}
/**
* Get custom error messages for validation rules.
*
* @return array<string, string>
*/
public function messages(): array
{
return [
'registration_date.required' => 'Tanggal registrasi wajib diisi.',
'registration_date.date' => 'Tanggal registrasi harus berupa tanggal yang valid.',
'patient_id.required' => 'Pasien wajib dipilih.',
'patient_id.exists' => 'Pasien yang dipilih tidak valid.',
'insurance_id.required' => 'Asuransi wajib dipilih.',
'insurance_id.exists' => 'Asuransi yang dipilih tidak valid.',
'insurance_number.required' => 'Nomor asuransi wajib diisi.',
'insurance_number.string' => 'Nomor asuransi harus berupa teks.',
'insurance_number.max' => 'Nomor asuransi tidak boleh lebih dari 20 karakter.',
'service_room_id.required' => 'Ruangan layanan wajib dipilih.',
'service_room_id.exists' => 'Ruangan layanan yang dipilih tidak valid.',
'responsible_person_name.required' => 'Nama penanggung jawab wajib diisi.',
'responsible_person_name.string' => 'Nama penanggung jawab harus berupa teks.',
'responsible_person_name.max' => 'Nama penanggung jawab tidak boleh lebih dari 255 karakter.',
'responsible_person_phone.required' => 'Nomor HP penanggung jawab wajib diisi.',
'responsible_person_phone.string' => 'Nomor HP penanggung jawab harus berupa teks.',
'responsible_person_phone.max' => 'Nomor HP penanggung jawab tidak boleh lebih dari 15 karakter.',
'responsible_email.required' => 'Email penanggung jawab wajib diisi.',
'responsible_email.email' => 'Email penanggung jawab harus berupa alamat email yang valid.',
'responsible_email.max' => 'Email penanggung jawab tidak boleh lebih dari 255 karakter.',
'responsible_person_relationship.required' => 'Hubungan dengan pasien wajib diisi.',
'responsible_person_relationship.string' => 'Hubungan dengan pasien harus berupa teks.',
'responsible_person_relationship.max' => 'Hubungan dengan pasien tidak boleh lebih dari 100 karakter.',
'responsible_person_address.required' => 'Alamat penanggung jawab wajib diisi.',
'responsible_person_address.string' => 'Alamat penanggung jawab harus berupa teks.',
'responsible_person_address.max' => 'Alamat penanggung jawab tidak boleh lebih dari 500 karakter.',
];
}
}

View File

@ -0,0 +1,75 @@
<?php
namespace App\Http\Requests\ManageRegistration;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class UpdateRegistration extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'registration_date' => ['required', 'date'],
'patient_id' => ['required', 'exists:patients,id'],
'insurance_id' => ['required', 'exists:insurances,id'],
'insurance_number' => ['required', 'numeric'],
'service_room_id' => ['required', 'exists:service_rooms,id'],
'responsible_person_name' => ['required', 'string', 'max:255'],
'responsible_person_phone' => ['required', 'string', 'max:15'],
'responsible_email' => ['required', 'email', 'max:255'],
'responsible_person_relationship' => ['required', 'string', 'max:100'],
'responsible_person_address' => ['required', 'string', 'max:500'],
];
}
/**
* Get custom error messages for validation rules.
*
* @return array<string, string>
*/
public function messages(): array
{
return [
'registration_date.required' => 'Tanggal registrasi wajib diisi.',
'registration_date.date' => 'Tanggal registrasi harus berupa tanggal yang valid.',
'patient_id.required' => 'Pasien wajib dipilih.',
'patient_id.exists' => 'Pasien yang dipilih tidak valid.',
'insurance_id.required' => 'Asuransi wajib dipilih.',
'insurance_id.exists' => 'Asuransi yang dipilih tidak valid.',
'insurance_number.required' => 'Nomor asuransi wajib diisi.',
'insurance_number.string' => 'Nomor asuransi harus berupa teks.',
'insurance_number.max' => 'Nomor asuransi tidak boleh lebih dari 20 karakter.',
'service_room_id.required' => 'Ruangan layanan wajib dipilih.',
'service_room_id.exists' => 'Ruangan layanan yang dipilih tidak valid.',
'responsible_person_name.required' => 'Nama penanggung jawab wajib diisi.',
'responsible_person_name.string' => 'Nama penanggung jawab harus berupa teks.',
'responsible_person_name.max' => 'Nama penanggung jawab tidak boleh lebih dari 255 karakter.',
'responsible_person_phone.required' => 'Nomor HP penanggung jawab wajib diisi.',
'responsible_person_phone.string' => 'Nomor HP penanggung jawab harus berupa teks.',
'responsible_person_phone.max' => 'Nomor HP penanggung jawab tidak boleh lebih dari 15 karakter.',
'responsible_email.required' => 'Email penanggung jawab wajib diisi.',
'responsible_email.email' => 'Email penanggung jawab harus berupa alamat email yang valid.',
'responsible_email.max' => 'Email penanggung jawab tidak boleh lebih dari 255 karakter.',
'responsible_person_relationship.required' => 'Hubungan dengan pasien wajib diisi.',
'responsible_person_relationship.string' => 'Hubungan dengan pasien harus berupa teks.',
'responsible_person_relationship.max' => 'Hubungan dengan pasien tidak boleh lebih dari 100 karakter.',
'responsible_person_address.required' => 'Alamat penanggung jawab wajib diisi.',
'responsible_person_address.string' => 'Alamat penanggung jawab harus berupa teks.',
'responsible_person_address.max' => 'Alamat penanggung jawab tidak boleh lebih dari 500 karakter.',
];
}
}

View File

@ -9,4 +9,27 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class PatienRegistration extends Model
{
use HasFactory, SoftDeletes;
protected $table = 'patien_registrations';
protected $guarded = ["id"];
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
public function patient()
{
return $this->belongsTo(Patient::class, 'patient_id');
}
public function insurance()
{
return $this->belongsTo(insurance::class, 'insurance_id');
}
public function service_room()
{
return $this->belongsTo(ServiceRoom::class, 'service_room_id');
}
}

View File

@ -9,4 +9,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class Patient extends Model
{
use HasFactory, SoftDeletes;
protected $table = "patients";
protected $guarded = ["id"];
}

View File

@ -9,4 +9,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class ServiceRoom extends Model
{
use HasFactory, SoftDeletes;
protected $table = "service_rooms";
protected $guarded = ["id"];
}

View File

@ -9,4 +9,12 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class Transaction extends Model
{
use HasFactory, SoftDeletes;
protected $table = "transactions";
protected $guarded = ["id"];
public function treatment()
{
return $this->belongsTo(Treatment::class, 'treatment_id');
}
}

View File

@ -9,4 +9,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class Treatment extends Model
{
use HasFactory, SoftDeletes;
protected $table = "treatments";
protected $guarded = ["id"];
}

View File

@ -27,9 +27,9 @@ return new class extends Migration
// Medical Information
$table->string('blood_type', 10); // (Golongan Darah)
$table->string('allergies');
$table->string('current_medicines');
$table->text('medical_history');
$table->string('allergies')->nullable(); // (Alergi)
$table->string('current_medicines')->nullable(); // (Obat yang Sedang Dikonsumsi)
$table->text('medical_history')->nullable(); // (Riwayat Penyakit)
$table->timestamps();
$table->softDeletes();
});

BIN
public/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

View File

@ -26,14 +26,13 @@
<!-- small box -->
<div class="small-box bg-info">
<div class="inner">
<h3>50</h3>
<h3>{{ $patient_register_today }}</h3>
<p>Surat Masuk</p>
<p>Pasian Hari Ini</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
@ -41,14 +40,13 @@
<!-- small box -->
<div class="small-box bg-success">
<div class="inner">
<h3>100</h3>
<h3>{{ $patiet_register_month }}</h3>
<p>Surat Keluar</p>
<p>Pasien Sebulan Terakhir</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
@ -56,14 +54,13 @@
<!-- small box -->
<div class="small-box bg-warning">
<div class="inner">
<h3>5</h3>
<h3>Rp. {{ number_format($todayRevenue) }}</h3>
<p>Jenis Surat</p>
<p>Pendapatan Harian</p>
</div>
<div class="icon">
<i class="ion ion-document-text"></i>
<i class="ion ion-cash"></i>
</div>
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
@ -71,14 +68,13 @@
<!-- small box -->
<div class="small-box bg-danger">
<div class="inner">
<h3>3</h3>
<h3>Rp. {{ number_format($lastMonthRevenue) }}</h3>
<p>Pengguna Sistem</p>
<p>Pendapatan Bulanan</p>
</div>
<div class="icon">
<i class="ion ion-person"></i>
</div>
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->

View File

@ -1,6 +1,5 @@
<!-- Main Footer -->
<footer class="main-footer">
<strong>Copyright &copy; 2024 <a href="https://adminlte.io">AdminLTE.io</a>, Boilerplate by <a
href="https://github.com/hafizcode02">Hafiz Caniago</a>. </strong>
<strong>Copyright &copy; 2025 <a href="https://github.com/hafizcode02">Hafiz Caniago</a>. </strong>
All rights reserved.
</footer>

View File

@ -2,9 +2,9 @@
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="index3.html" class="brand-link">
<img src="{{ asset('dist/img/AdminLTELogo.png') }}" alt="AdminLTE Logo"
class="brand-image img-circle elevation-3" style="opacity: .8">
<span class="brand-text font-weight-light">Laravel Boilerplate</span>
<img src="{{ asset('logo.png') }}" alt="AdminLTE Logo"
class="brand-image elevation-3" style="opacity: .8">
<span class="brand-text font-weight-bold">&nbsp;</span>
</a>
<!-- Sidebar -->
@ -32,13 +32,39 @@
'link' => '/dashboard',
'childs' => [],
],
(object) [
'icon' => 'fas fa-book',
'name' => 'Registrasi Pasien',
'link' => '/registrasi-pasien',
'childs' => [],
],
(object) [
'icon' => 'fas fa-list',
'name' => 'Jenis Asuransi',
'name' => 'Manajemen Asuransi',
'link' => '/asuransi',
'childs' => [],
'is_admin' => true, // Menambahkan field ini untuk mengontrol akses
],
(object) [
'icon' => 'fas fa-list',
'name' => 'Manajemen Tindakan',
'link' => '/tindakan',
'childs' => [],
'is_admin' => true, // Menambahkan field ini untuk mengontrol akses
],
(object) [
'icon' => 'fas fa-list',
'name' => 'Manajemen Ruangan',
'link' => '/ruang-pelayanan',
'childs' => [],
'is_admin' => true, // Menambahkan field ini untuk mengontrol akses
],
(object) [
'icon' => 'fas fa-user',
'name' => 'Manajemen Pasien',
'link' => '/pasien',
'childs' => [],
],
(object) [
'icon' => 'fas fa-user',
'name' => 'Manajemen Pegawai',
@ -46,23 +72,6 @@
'childs' => [],
'is_admin' => true, // Menambahkan field ini untuk mengontrol akses
],
(object) [
'title' => 'DROPDOWN EXAMPLE',
],
(object) [
'icon' => 'fas fa-book',
'name' => 'Dropdown Example',
'childs' => [
(object) [
'name' => 'Dropdown 1',
'link' => '#',
],
(object) [
'name' => 'Dropdown 2',
'link' => '#',
],
],
],
(object) [
'title' => 'AKUN PENGGUNA',
],
@ -83,8 +92,8 @@
@continue
@endif
@if (isset($menu->is_admin) && $menu->is_admin && !Auth::user()->role === 'admin')
@continue {{-- Menghentikan iterasi jika bukan superuser --}}
@if (isset($menu->is_admin) && $menu->is_admin && Auth::user()->role !== 'admin')
@continue {{-- Menghentikan iterasi jika bukan admin --}}
@endif
@php

View File

@ -24,7 +24,8 @@
<!-- /.login-logo -->
<div class="card card-outline card-primary">
<div class="card-header text-center">
<h1><b>RSABHK - REGISTRASI</h1>
<img src="{{ asset('logo.png') }}" alt="Logo" width="150px" height="100px" style="object-fit:contain">
<h3><b>RSABHK - REGISTRASI</h3>
</div>
<div class="card-body">
<p class="login-box-msg">Login untuk memulai</p>

View File

@ -0,0 +1,170 @@
@extends('layouts.app')
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Tambah Pasien</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Tambah Pasien</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('main-content')
<div class="row">
<div class="col-12">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Data Pasien</h3>
</div>
<form action="{{ route('patient-management.store') }}" method="POST">
@csrf
<div class="card-body" style="padding-bottom: 0.5rem">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>NIK <strong class="text-danger">*</strong></label>
<input name="identity_number" type="number" class="form-control"
placeholder="Masukan NIK" value="{{ old('identity_number') }}" required>
@error('identity_number')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Nama Depan <strong class="text-danger">*</strong></label>
<input name="first_name" type="text" class="form-control"
placeholder="Masukan Nama Depan" value="{{ old('first_name') }}" required>
@error('first_name')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Nama Belakang <strong class="text-danger">*</strong></label>
<input name="last_name" type="text" class="form-control"
placeholder="Masukan Nama Belakang" value="{{ old('last_name') }}" required>
@error('last_name')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Tanggal Lahir <strong class="text-danger">*</strong></label>
<input name="birth_date" type="date" class="form-control" placeholder="Tanggal Lahir"
value="{{ old('birth_date') }}" required>
@error('birth_date')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Jenis Kelamin <strong class="text-danger">*</strong></label>
<select name="gender" class="form-control">
<option value="">-- Pilih --</option>
<option value="L" {{ old('gender') == 'L' ? 'selected' : '' }}>Laki-Laki
</option>
<option value="P" {{ old('gender') == 'P' ? 'selected' : '' }}>Perempuan
</option>
</select>
@error('gender')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>No. HP <strong class="text-danger">*</strong></label>
<input name="phone_number" type="text" class="form-control" placeholder="No. HP"
value="{{ old('phone_number') }}" required>
@error('phone_number')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Contact Email <strong class="text-danger">*</strong></label>
<input name="email" type="email" class="form-control" placeholder="Masukan Email"
value="{{ old('email') }}" required>
@error('email')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Golongan Darah <strong class="text-danger">*</strong></label>
<select name="blood_type" class="form-control">
<option value="">-- Pilih --</option>
<option value="A" {{ old('blood_type') == 'A' ? 'selected' : '' }}>A </option>
<option value="B" {{ old('blood_type') == 'B' ? 'selected' : '' }}>B
</option>
<option value="AB" {{ old('blood_type') == 'AB' ? 'selected' : '' }}>AB
</option>
<option value="O" {{ old('blood_type') == 'O' ? 'selected' : '' }}>O
</option>
<option value="Lainnya" {{ old('blood_type') == 'Lainnya' ? 'selected' : '' }}>
Lainnya
</option>
</select>
@error('gender')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Alamat <strong class="text-danger">*</strong></label>
<textarea class="form-control" name="address" cols="20" rows="3" placeholder="Masukan Alamat" required>{{ old('address') }}</textarea>
@error('address')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Alergi: <strong class="text-danger">*</strong></label>
<textarea class="form-control" name="allergies" cols="20" rows="3" placeholder="Sebutkan alergi jika ada"
required>{{ old('allergies') }}</textarea>
@error('allergies')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Konsumsi Obat Saat Ini: <strong class="text-danger">*</strong></label>
<textarea class="form-control" name="current_medicines" cols="20" rows="3"
placeholder="Obat yang dikonsumsi saat ini, contoh : bodrex, almodipine" required>{{ old('current_medicines') }}</textarea>
@error('current_medicines')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Histori Medis: <strong class="text-danger">*</strong></label>
<textarea class="form-control" name="medical_history" cols="20" rows="3"
placeholder="Histori medis pasien" required>{{ old('medical_history') }}</textarea>
@error('medical_history')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
</div>
</div>
</div>
<span class="text-muted float-start ml-4">
<strong class="text-danger">*</strong> Wajib Diisi
</span>
<div class="card-footer mt-2">
<button type="button" class="btn btn-primary" onclick="history.back()">Kembali</button>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('scripts')
@if (session('success'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'success',
title: "{{ session('success') }}",
});
});
</script>
@endif
@endpush

View File

@ -0,0 +1,187 @@
@extends('layouts.app')
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Edit Pasien</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Edit Pasien</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('main-content')
<div class="row">
<div class="col-12">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Edit Data Pasien</h3>
</div>
<form action="{{ route('patient-management.update', $patient->id) }}" method="POST">
@csrf
@method('PUT')
<div class="card-body" style="padding-bottom: 0.5rem">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>No. Rekam Medis</label>
<input name="medical_record_number" type="text" class="form-control"
value="{{ old('medical_record_number', $patient->medical_record_number) }}"
readonly>
</div>
<div class="form-group">
<label>NIK <strong class="text-danger">*</strong></label>
<input name="identity_number" type="number" class="form-control"
placeholder="Masukan NIK"
value="{{ old('identity_number', $patient->identity_number) }}" required>
@error('identity_number')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Nama Depan <strong class="text-danger">*</strong></label>
<input name="first_name" type="text" class="form-control"
placeholder="Masukan Nama Depan"
value="{{ old('first_name', $patient->first_name) }}" required>
@error('first_name')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Nama Belakang <strong class="text-danger">*</strong></label>
<input name="last_name" type="text" class="form-control"
placeholder="Masukan Nama Belakang"
value="{{ old('last_name', $patient->last_name) }}" required>
@error('last_name')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Tanggal Lahir <strong class="text-danger">*</strong></label>
<input name="birth_date" type="date" class="form-control" placeholder="Tanggal Lahir"
value="{{ old('birth_date', $patient->birth_date) }}" required>
@error('birth_date')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Jenis Kelamin <strong class="text-danger">*</strong></label>
<select name="gender" class="form-control">
<option value="">-- Pilih --</option>
<option value="L"
{{ old('gender', $patient->gender) == 'L' ? 'selected' : '' }}>Laki-Laki
</option>
<option value="P"
{{ old('gender', $patient->gender) == 'P' ? 'selected' : '' }}>Perempuan
</option>
</select>
@error('gender')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>No. HP <strong class="text-danger">*</strong></label>
<input name="phone_number" type="text" class="form-control" placeholder="No. HP"
value="{{ old('phone_number', $patient->phone_number) }}" required>
@error('phone_number')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Contact Email <strong class="text-danger">*</strong></label>
<input name="email" type="email" class="form-control" placeholder="Masukan Email"
value="{{ old('email', $patient->email) }}" required>
@error('email')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Golongan Darah <strong class="text-danger">*</strong></label>
<select name="blood_type" class="form-control">
<option value="">-- Pilih --</option>
<option value="A"
{{ old('blood_type', $patient->blood_type) == 'A' ? 'selected' : '' }}>A
</option>
<option value="B"
{{ old('blood_type', $patient->blood_type) == 'B' ? 'selected' : '' }}>B
</option>
<option value="AB"
{{ old('blood_type', $patient->blood_type) == 'AB' ? 'selected' : '' }}>AB
</option>
<option value="O"
{{ old('blood_type', $patient->blood_type) == 'O' ? 'selected' : '' }}>O
</option>
<option value="Lainnya"
{{ old('blood_type', $patient->blood_type) == 'Lainnya' ? 'selected' : '' }}>
Lainnya</option>
</select>
@error('blood_type')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Alamat <strong class="text-danger">*</strong></label>
<textarea class="form-control" name="address" cols="20" rows="3" placeholder="Masukan Alamat" required>{{ old('address', $patient->address) }}</textarea>
@error('address')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Alergi: <strong class="text-danger">*</strong></label>
<textarea class="form-control" name="allergies" cols="20" rows="3"
placeholder="Sebutkan alergi jika ada" required>{{ old('allergies', $patient->allergies) }}</textarea>
@error('allergies')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Konsumsi Obat Saat Ini: <strong class="text-danger">*</strong></label>
<textarea class="form-control" name="current_medicines" cols="20" rows="3"
placeholder="Obat yang dikonsumsi saat ini, contoh : bodrex, almodipine" required>{{ old('current_medicines', $patient->current_medicines) }}</textarea>
@error('current_medicines')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Histori Medis: <strong class="text-danger">*</strong></label>
<textarea class="form-control" name="medical_history" cols="20" rows="3"
placeholder="Histori medis pasien" required>{{ old('medical_history', $patient->medical_history) }}</textarea>
@error('medical_history')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
</div>
</div>
</div>
<span class="text-muted float-start ml-4">
<strong class="text-danger">*</strong> Wajib Diisi
</span>
<div class="card-footer mt-2">
<button type="button" class="btn btn-primary" onclick="history.back()">Kembali</button>
<button type="submit" class="btn btn-success">Update</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('scripts')
@if (session('success'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'success',
title: "{{ session('success') }}",
});
});
</script>
@endif
@endpush

View File

@ -0,0 +1,158 @@
@extends('layouts.app')
@push('styles')
<!-- DataTables -->
<link rel="stylesheet" href="{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-buttons/css/buttons.bootstrap4.min.css') }}">
@endpush
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Manajemen Pasien</h1>
</div><!-- /.col -->
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Manajemen Pasien</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
@endsection
@section('main-content')
<div class="card">
<div class="card-header">
<a href="{{ route('patient-management.create') }}" class="btn btn-info">
<i class="fas fa-plus"></i>
&nbsp;&nbsp;Tambah Data Pasien
</a>
</div>
<div class="card-body">
<table id="tableData" class="table table-bordered table-hover">
<thead>
<tr>
<th>No</th>
<th>Rekam Medis</th>
<th>Nama Lengkap</th>
<th>Dibuat Pada</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@foreach ($patients as $index => $data)
<tr>
<td>{{ $index + 1 }}</td>
<td>{{ $data->medical_record_number }}</td>
<td>{{ $data->first_name }} {{ $data->last_name }}</td>
<td>{{ $data->created_at }}</td>
<td>
<a href="{{ route('patient-management.show', $data->id) }}" class="btn btn-sm btn-info">
<i class="fas fa-search"></i>&nbsp;&nbsp;Lihat
</a>
<a href="{{ route('patient-management.edit', $data->id) }}" class="btn btn-sm btn-warning">
<i class="fas fa-pencil-alt"></i>&nbsp;&nbsp;Edit
</a>
<button type="button" class="btn btn-sm btn-danger delete-btn"
data-url="{{ route('patient-management.destroy', $data->id) }}">
<i class="fas fa-trash"></i>&nbsp;&nbsp;Hapus
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- Delete Confirmation Modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Konfirmasi Hapus</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Apakah Anda yakin ingin menghapus data ini?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Batal</button>
<form id="deleteForm" action="" method="POST">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Hapus</button>
</form>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
@if (session('success'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'success',
title: "{{ session('success') }}",
});
});
</script>
@endif
@if (session('error'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'error',
title: "{{ session('error') }}",
});
});
</script>
@endif
<script src="{{ asset('plugins/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script>
<script>
$(function() {
$("#tableData").DataTable({
"paging": true,
"lengthChange": false,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": false,
"responsive": true,
});
});
document.addEventListener("DOMContentLoaded", function() {
const deleteButtons = document.querySelectorAll('.delete-btn');
const deleteModal = document.getElementById('deleteModal');
const deleteForm = document.getElementById('deleteForm');
deleteButtons.forEach(button => {
button.addEventListener('click', function() {
const url = this.getAttribute('data-url');
deleteForm.setAttribute('action', url);
$(deleteModal).modal('show'); // Use jQuery to show the modal
});
});
});
</script>
@endpush

View File

@ -0,0 +1,53 @@
@extends('layouts.app')
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Detail Pasien</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Detail Pasien</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('main-content')
<div class="row">
<div class="col-12">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Data Pasien</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<p><strong>No. Rekam Medis:</strong> {{ $patient->medical_record_number }}</p>
<p><strong>NIK:</strong> {{ $patient->identity_number }}</p>
<p><strong>Nama Depan:</strong> {{ $patient->first_name }}</p>
<p><strong>Nama Belakang:</strong> {{ $patient->last_name }}</p>
<p><strong>Tanggal Lahir:</strong> {{ $patient->birth_date }}</p>
<p><strong>Jenis Kelamin:</strong> {{ $patient->gender == 'L' ? 'Laki-Laki' : 'Perempuan' }}</p>
<p><strong>No. HP:</strong> {{ $patient->phone_number }}</p>
<p><strong>Email:</strong> {{ $patient->email }}</p>
</div>
<div class="col-md-6">
<p><strong>Golongan Darah:</strong> {{ $patient->blood_type }}</p>
<p><strong>Alamat:</strong> {{ $patient->address }}</p>
<p><strong>Alergi:</strong> {{ $patient->allergies }}</p>
<p><strong>Konsumsi Obat Saat Ini:</strong> {{ $patient->current_medicines }}</p>
<p><strong>Histori Medis:</strong> {{ $patient->medical_history }}</p>
</div>
</div>
</div>
<div class="card-footer">
<button type="button" class="btn btn-primary" onclick="history.back()">Kembali</button>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,167 @@
@extends('layouts.app')
@push('styles')
{{-- Select2 JS --}}
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<style>
.select2-container--default .select2-selection--single {
height: 38px !important;
}
</style>
@endpush
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Tambah Registrasi Pasien</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Tambah Registrasi Pasien</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('main-content')
<div class="row">
<div class="col-12">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Form Registrasi Pasien</h3>
</div>
<form action="{{ route('patient-registration.store') }}" method="POST">
@csrf
<div class="card-body">
<div class="row">
<!-- Left Column -->
<div class="col-md-6">
<div class="form-group">
<label>Tanggal Registrasi <strong class="text-danger">*</strong></label>
<input name="registration_date" type="date" class="form-control"
value="{{ old('registration_date') }}" required>
@error('registration_date')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Pasien <strong class="text-danger">*</strong></label>
<select name="patient_id" class="form-control select2" required>
<option value="">-- Pilih Pasien --</option>
@foreach ($patients as $patient)
<option value="{{ $patient->id }}"
{{ old('patient_id') == $patient->id ? 'selected' : '' }}>
{{ $patient->first_name }} {{ $patient->last_name }}
</option>
@endforeach
</select>
@error('patient_id')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Asuransi <strong class="text-danger">*</strong></label>
<select name="insurance_id" class="form-control" required>
<option value="">-- Pilih Asuransi --</option>
@foreach ($insurances as $insurance)
<option value="{{ $insurance->id }}"
{{ old('insurance_id') == $insurance->id ? 'selected' : '' }}>
{{ $insurance->name }}
</option>
@endforeach
</select>
@error('insurance_id')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>No. Asuransi <strong class="text-danger">*</strong></label>
<input name="insurance_number" type="number" class="form-control"
value="{{ old('insurance_number') }}" required>
@error('insurance_number')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Ruangan Layanan <strong class="text-danger">*</strong></label>
<select name="service_room_id" class="form-control" required>
<option value="">-- Pilih Ruangan --</option>
@foreach ($serviceRooms as $serviceRoom)
<option value="{{ $serviceRoom->id }}"
{{ old('service_room_id') == $serviceRoom->id ? 'selected' : '' }}>
{{ $serviceRoom->name }}
</option>
@endforeach
</select>
@error('service_room_id')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
</div>
<!-- Right Column -->
<div class="col-md-6">
<div class="form-group">
<label>Nama Penanggung Jawab <strong class="text-danger">*</strong></label>
<input name="responsible_person_name" type="text" class="form-control"
value="{{ old('responsible_person_name') }}" required>
@error('responsible_person_name')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>No. HP Penanggung Jawab <strong class="text-danger">*</strong></label>
<input name="responsible_person_phone" type="text" class="form-control"
value="{{ old('responsible_person_phone') }}" required>
@error('responsible_person_phone')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Email Penanggung Jawab <strong class="text-danger">*</strong></label>
<input name="responsible_email" type="email" class="form-control"
value="{{ old('responsible_email') }}" required>
@error('responsible_email')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Hubungan dengan Pasien <strong class="text-danger">*</strong></label>
<input name="responsible_person_relationship" type="text" class="form-control"
value="{{ old('responsible_person_relationship') }}" required>
@error('responsible_person_relationship')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Alamat Penanggung Jawab <strong class="text-danger">*</strong></label>
<textarea name="responsible_person_address" class="form-control" rows="3" required>{{ old('responsible_person_address') }}</textarea>
@error('responsible_person_address')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
</div>
</div>
</div>
<div class="card-footer">
<button type="button" class="btn btn-primary" onclick="history.back()">Kembali</button>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
$(document).ready(function() {
$('.select2').select2({
placeholder: "-- Pilih Pasien --",
allowClear: true,
width: '100%',
});
});
</script>
@endpush

View File

@ -0,0 +1,170 @@
@extends('layouts.app')
@push('styles')
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<style>
.select2-container--default .select2-selection--single {
height: 38px !important;
}
</style>
@endpush
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Edit Registrasi Pasien</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Edit Registrasi Pasien</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('main-content')
<div class="row">
<div class="col-12">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Form Edit Registrasi Pasien</h3>
</div>
<form action="{{ route('patient-registration.update', $registration->id) }}" method="POST">
@csrf
@method('PUT')
<div class="card-body">
<div class="row">
<!-- Left Column -->
<div class="col-md-6">
<div class="form-group">
<label>Tanggal Registrasi <strong class="text-danger">*</strong></label>
<input name="registration_date" type="date" class="form-control"
value="{{ old('registration_date', $registration->registration_date) }}" required>
@error('registration_date')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Pasien <strong class="text-danger">*</strong></label>
<select name="patient_id" class="form-control select2" required>
<option value="">-- Pilih Pasien --</option>
@foreach ($patients as $patient)
<option value="{{ $patient->id }}"
{{ old('patient_id', $registration->patient_id) == $patient->id ? 'selected' : '' }}>
{{ $patient->first_name }} {{ $patient->last_name }}
</option>
@endforeach
</select>
@error('patient_id')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Asuransi <strong class="text-danger">*</strong></label>
<select name="insurance_id" class="form-control" required>
<option value="">-- Pilih Asuransi --</option>
@foreach ($insurances as $insurance)
<option value="{{ $insurance->id }}"
{{ old('insurance_id', $registration->insurance_id) == $insurance->id ? 'selected' : '' }}>
{{ $insurance->name }}
</option>
@endforeach
</select>
@error('insurance_id')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>No. Asuransi <strong class="text-danger">*</strong></label>
<input name="insurance_number" type="number" class="form-control"
value="{{ old('insurance_number', $registration->insurance_number) }}" required>
@error('insurance_number')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Ruangan Layanan <strong class="text-danger">*</strong></label>
<select name="service_room_id" class="form-control" required>
<option value="">-- Pilih Ruangan --</option>
@foreach ($serviceRooms as $serviceRoom)
<option value="{{ $serviceRoom->id }}"
{{ old('service_room_id', $registration->service_room_id) == $serviceRoom->id ? 'selected' : '' }}>
{{ $serviceRoom->name }}
</option>
@endforeach
</select>
@error('service_room_id')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
</div>
<!-- Right Column -->
<div class="col-md-6">
<div class="form-group">
<label>Nama Penanggung Jawab <strong class="text-danger">*</strong></label>
<input name="responsible_person_name" type="text" class="form-control"
value="{{ old('responsible_person_name', $registration->responsible_person_name) }}"
required>
@error('responsible_person_name')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>No. HP Penanggung Jawab <strong class="text-danger">*</strong></label>
<input name="responsible_person_phone" type="text" class="form-control"
value="{{ old('responsible_person_phone', $registration->responsible_person_phone) }}"
required>
@error('responsible_person_phone')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Email Penanggung Jawab <strong class="text-danger">*</strong></label>
<input name="responsible_email" type="email" class="form-control"
value="{{ old('responsible_email', $registration->responsible_email) }}" required>
@error('responsible_email')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Hubungan dengan Pasien <strong class="text-danger">*</strong></label>
<input name="responsible_person_relationship" type="text" class="form-control"
value="{{ old('responsible_person_relationship', $registration->responsible_person_relationship) }}"
required>
@error('responsible_person_relationship')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
<div class="form-group">
<label>Alamat Penanggung Jawab <strong class="text-danger">*</strong></label>
<textarea name="responsible_person_address" class="form-control" rows="3" required>{{ old('responsible_person_address', $registration->responsible_person_address) }}</textarea>
@error('responsible_person_address')
<small style="color: red;">{{ $message }}</small>
@enderror
</div>
</div>
</div>
</div>
<div class="card-footer">
<button type="button" class="btn btn-primary" onclick="history.back()">Kembali</button>
<button type="submit" class="btn btn-success">Update</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
$(document).ready(function() {
$('.select2').select2({
placeholder: "-- Pilih Pasien --",
allowClear: true,
width: '100%',
});
});
</script>
@endpush

View File

@ -0,0 +1,161 @@
@extends('layouts.app')
@push('styles')
<!-- DataTables -->
<link rel="stylesheet" href="{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-buttons/css/buttons.bootstrap4.min.css') }}">
@endpush
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Registrasi Pasien</h1>
</div><!-- /.col -->
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Registrasi Pasien</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
@endsection
@section('main-content')
<div class="card">
<div class="card-header">
<a href="{{ route('patient-registration.create') }}" class="btn btn-info">
<i class="fas fa-plus"></i>
&nbsp;&nbsp;Tambah Registrasi Pasien
</a>
</div>
<div class="card-body">
<table id="tableData" class="table table-bordered table-hover">
<thead>
<tr>
<th>No</th>
<th>Rekam Medis</th>
<th>Nama Lengkap</th>
<th>Jaminan Kesehatan</th>
<th>Dibuat Oleh</th>
<th>Dibuat Pada</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@foreach ($registrations as $index => $data)
<tr>
<td>{{ $index + 1 }}</td>
<td>{{ $data->patient->medical_record_number }}</td>
<td>{{ $data->patient->first_name }} {{ $data->patient->last_name }}</td>
<td>{{ $data->insurance->name }}</td>
<td>{{ $data->user->name }}</td>
<td>{{ $data->created_at }}</td>
<td>
<a href="{{ route('transaction.index', $data->id) }}" class="btn btn-sm btn-info">
<i class="fas fa-money-bill"></i>&nbsp;&nbsp;Transaksi
</a>
<a href="{{ route('patient-registration.edit', $data->id) }}"
class="btn btn-sm btn-warning">
<i class="fas fa-pencil-alt"></i>&nbsp;&nbsp;Edit
</a>
<button type="button" class="btn btn-sm btn-danger delete-btn"
data-url="{{ route('patient-registration.destroy', $data->id) }}">
<i class="fas fa-trash"></i>&nbsp;&nbsp;Hapus
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- Delete Confirmation Modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Konfirmasi Hapus</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Apakah Anda yakin ingin menghapus data ini?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Batal</button>
<form id="deleteForm" action="" method="POST">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Hapus</button>
</form>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
@if (session('success'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'success',
title: "{{ session('success') }}",
});
});
</script>
@endif
@if (session('error'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'error',
title: "{{ session('error') }}",
});
});
</script>
@endif
<script src="{{ asset('plugins/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script>
<script>
$(function() {
$("#tableData").DataTable({
"paging": true,
"lengthChange": false,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": false,
"responsive": true,
});
});
document.addEventListener("DOMContentLoaded", function() {
const deleteButtons = document.querySelectorAll('.delete-btn');
const deleteModal = document.getElementById('deleteModal');
const deleteForm = document.getElementById('deleteForm');
deleteButtons.forEach(button => {
button.addEventListener('click', function() {
const url = this.getAttribute('data-url');
deleteForm.setAttribute('action', url);
$(deleteModal).modal('show'); // Use jQuery to show the modal
});
});
});
</script>
@endpush

View File

@ -0,0 +1,345 @@
@push('styles')
<!-- DataTables -->
<link rel="stylesheet" href="{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-buttons/css/buttons.bootstrap4.min.css') }}">
@endpush
@extends('layouts.app')
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Detail Transaksi Registrasi</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Detail Transaksi</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('main-content')
<div id="transaction_data">
<div class="row">
<div class="col-12">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">Data Registrasi Pasien</h3>
</div>
<div class="card-body">
<div class="row">
<!-- Left Column -->
<div class="col-md-4">
<div class="form-group">
<label>Tanggal Registrasi:</label>
<p>{{ $registration->registration_date }}</p>
</div>
<div class="form-group">
<label>Pasien:</label>
<p>{{ $registration->patient->first_name }} {{ $registration->patient->last_name }}</p>
</div>
<div class="form-group">
<label>Asuransi:</label>
<p>{{ $registration->insurance->name }}</p>
</div>
<div class="form-group">
<label>No. Asuransi:</label>
<p>{{ $registration->insurance_number }}</p>
</div>
</div>
<!-- Middle Column -->
<div class="col-md-4">
<div class="form-group">
<label>Ruangan Layanan:</label>
<p>{{ $registration->service_room->name }}</p>
</div>
<div class="form-group">
<label>Nama Penanggung Jawab:</label>
<p>{{ $registration->responsible_person_name }}</p>
</div>
<div class="form-group">
<label>No. HP Penanggung Jawab:</label>
<p>{{ $registration->responsible_person_phone }}</p>
</div>
<div class="form-group">
<label>Email Penanggung Jawab:</label>
<p>{{ $registration->responsible_email }}</p>
</div>
</div>
<!-- Right Column -->
<div class="col-md-4">
<div class="form-group">
<label>Hubungan dengan Pasien:</label>
<p>{{ $registration->responsible_person_relationship }}</p>
</div>
<div class="form-group">
<label>Alamat Penanggung Jawab:</label>
<p>{{ $registration->responsible_person_address }}</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<button class="btn btn-info" data-toggle="modal" data-target="#addTransactionModal">
<i class="fas fa-plus"></i>
&nbsp;&nbsp;Tambah Tindakan
</button>
</div>
<div class="card-body">
<table id="tableData" class="table table-bordered table-hover">
<thead>
<tr>
<th>No</th>
<th>Tindakan</th>
<th>Jumlah</th>
<th>Fee Tindakan</th>
<th>Total</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach ($transactions as $index => $data)
<tr>
<td>{{ $index + 1 }}</td>
<td>{{ $data->treatment->name }}</td>
<td>{{ $data->amount }}</td>
<td>{{ number_format($data->treatment->fee, 0, ',', '.') }}</td>
<td>{{ number_format($data->treatment->fee * $data->amount) }}</td>
<td>
<a href="#" class="btn btn-sm btn-warning edit-btn"
data-url="{{ route('transaction.update', $data->id) }}"
data-name="{{ $data->treatment_id }}" data-amount="{{ $data->amount }}"
data-toggle="modal" data-target="#editTransactionModal">
<i class="fas fa-pencil-alt"></i>&nbsp;&nbsp;Edit
</a>
<button type="button" class="btn btn-sm btn-danger delete-btn"
data-url="{{ route('transaction.destroy', $data->id) }}"
data-toggle="modal" data-target="#deleteTransactionModal">
<i class="fas fa-trash"></i>&nbsp;&nbsp;Hapus
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="d-flex justify-content-end mt-3">
<h5 class="font-weight-bold">
Total Tindakan:
{{ number_format(
$transactions->sum(function ($transaction) {
return $transaction->treatment->fee * $transaction->amount;
}),
0,
',',
'.',
) }}
</h5>
</div>
</div>
<!-- /.card-body -->
</div>
<!-- Modal Tambah Jenis Tindakan -->
<div class="modal fade" id="addTransactionModal" tabindex="-1" aria-labelledby="addTransactionModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<form id="addTransactionForm" method="POST"
action="{{ route('transaction.store', $registration->id) }}">
@csrf
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addTransactionModalLabel">Tambah Jenis Tindakan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="TransactionName" class="form-label">Nama Jenis Tindakan</label>
<select class="form-control" id="TransactionName" name="treatment_id" required>
<option value="">-- Pilih Jenis Tindakan --</option>
@foreach ($treatments as $treatment)
<option value="{{ $treatment->id }}">{{ $treatment->name }}</option>
@endforeach
</select>
</div>
<div class="mb-3">
<label for="TransactionAmount" class="form-label">Jumlah Tindakan</label>
<input type="number" class="form-control" id="TransactionAmount" name="amount"
required>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</div>
</form>
</div>
</div>
<!-- Modal Edit Jenis Tindakan -->
<div class="modal fade" id="editTransactionModal" tabindex="-1"
aria-labelledby="editTransactionModalLabel" aria-hidden="true">
<div class="modal-dialog">
<form id="editTransactionForm" method="POST">
@csrf
@method('PUT')
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editTransactionModalLabel">Edit Jenis Tindakan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="editTransactionName" class="form-label">Nama Jenis Tindakan</label>
<select class="form-control" id="editTransactionName" name="treatment_id"
required>
<option value="">-- Pilih Jenis Tindakan --</option>
@foreach ($treatments as $treatment)
<option value="{{ $treatment->id }}">{{ $treatment->name }}</option>
@endforeach
</select>
</div>
<div class="mb-3">
<label for="editTransactionAmount" class="form-label">Jumlah Tindakan</label>
<input type="number" class="form-control" id="editTransactionAmount"
name="amount" required>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Update</button>
</div>
</div>
</form>
</div>
</div>
<!-- Modal Konfirmasi Hapus -->
<div class="modal fade" id="deleteTransactionModal" tabindex="-1"
aria-labelledby="deleteTransactionModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteTransactionModalLabel">Hapus Jenis Tindakan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Apakah Anda yakin ingin menghapus jenis Tindakan ini?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<form id="deleteForm" action="" method="POST">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Hapus</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-12">
<button class="btn btn-primary">
<i class="fas fa-envelope"></i>&nbsp;&nbsp;Kirim Tagihan
</button>
<a href="{{ route('patient-registration.index') }}" class="btn btn-secondary">Kembali</a>
</div>
</div>
@endsection
@push('scripts')
@if (session('success'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'success',
title: "{{ session('success') }}",
});
});
</script>
@endif
@if (session('error'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'error',
title: "{{ session('error') }}",
});
});
</script>
@endif
<script src="{{ asset('plugins/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script>
<script>
$(function() {
$("#tableData").DataTable({
"paging": false,
"lengthChange": false,
"searching": false,
"ordering": true,
"info": false,
"autoWidth": false,
"responsive": true,
});
// Edit Document Type
const editButtons = document.querySelectorAll('.edit-btn');
const editModal = document.getElementById('editTransactionModal');
const editForm = document.getElementById('editTransactionForm');
editButtons.forEach(button => {
button.addEventListener('click', function() {
const url = this.getAttribute('data-url');
const name = this.getAttribute('data-name');
const amount = this.getAttribute('data-amount');
editForm.setAttribute('action', url);
document.getElementById('editTransactionName').value = name;
document.getElementById('editTransactionAmount').value = amount;
$(editModal).modal('show'); // Use jQuery to show the modal
});
});
// Delete Document Type
const deleteButtons = document.querySelectorAll('.delete-btn');
const deleteModal = document.getElementById('deleteTransactionModal');
const deleteForm = document.getElementById('deleteForm');
deleteButtons.forEach(button => {
button.addEventListener('click', function() {
const url = this.getAttribute('data-url');
deleteForm.setAttribute('action', url);
$(deleteModal).modal('show'); // Use jQuery to show the modal
});
});
});
</script>
@endpush

View File

@ -0,0 +1,225 @@
@extends('layouts.app')
@push('styles')
<!-- DataTables -->
<link rel="stylesheet" href="{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-buttons/css/buttons.bootstrap4.min.css') }}">
@endpush
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Manajemen Data Ruang Pelayanan</h1>
</div><!-- /.col -->
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Ruang Pelayanan</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
@endsection
@section('main-content')
<div class="card">
<div class="card-header">
<button class="btn btn-info" data-toggle="modal" data-target="#addServiceRoomModal">
<i class="fas fa-plus"></i>
&nbsp;&nbsp;Tambah Ruang Pelayanan
</button>
</div>
<div class="card-body">
<table id="tableData" class="table table-bordered table-hover">
<thead>
<tr>
<th>No</th>
<th> Ruang Pelayanan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@foreach ($service_rooms as $index => $data)
<tr>
<td>{{ $index + 1 }}</td>
<td>{{ $data->name }}</td>
<td>
<a href="#" class="btn btn-sm btn-warning edit-btn"
data-url="{{ route('service-room.update', $data->id) }}"
data-name="{{ $data->name }}" data-toggle="modal"
data-target="#editServiceRoomModal">
<i class="fas fa-pencil-alt"></i>&nbsp;&nbsp;Edit
</a>
<button type="button" class="btn btn-sm btn-danger delete-btn"
data-url="{{ route('service-room.destroy', $data->id) }}" data-toggle="modal"
data-target="#deleteServiceRoomModal">
<i class="fas fa-trash"></i>&nbsp;&nbsp;Hapus
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- Modal Tambah Jenis Ruang Pelayanan -->
<div class="modal fade" id="addServiceRoomModal" tabindex="-1" aria-labelledby="addServiceRoomModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<form id="addServiceRoomForm" method="POST" action="{{ route('service-room.store') }}">
@csrf
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addServiceRoomModalLabel">Tambah Jenis Ruang Pelayanan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="ServiceRoomName" class="form-label">Nama Jenis Ruang Pelayanan</label>
<input type="text" class="form-control" id="ServiceRoomName" name="name" required>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</div>
</form>
</div>
</div>
<!-- Modal Edit Jenis Ruang Pelayanan -->
<div class="modal fade" id="editServiceRoomModal" tabindex="-1" aria-labelledby="editServiceRoomModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<form id="editServiceRoomForm" method="POST">
@csrf
@method('PUT')
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editServiceRoomModalLabel">Edit Jenis Ruang Pelayanan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="editServiceRoomName" class="form-label">Nama Jenis Ruang Pelayanan</label>
<input type="text" class="form-control" id="editServiceRoomName" name="name" required>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Update</button>
</div>
</div>
</form>
</div>
</div>
<!-- Modal Konfirmasi Hapus -->
<div class="modal fade" id="deleteServiceRoomModal" tabindex="-1" aria-labelledby="deleteServiceRoomModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteServiceRoomModalLabel">Hapus Jenis Ruang Pelayanan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Apakah Anda yakin ingin menghapus jenis Ruang Pelayanan ini?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<form id="deleteForm" action="" method="POST">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Hapus</button>
</form>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
@if (session('success'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'success',
title: "{{ session('success') }}",
});
});
</script>
@endif
@if (session('error'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'error',
title: "{{ session('error') }}",
});
});
</script>
@endif
<script src="{{ asset('plugins/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script>
<script>
$(function() {
$("#tableData").DataTable({
"paging": true,
"lengthChange": false,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": false,
"responsive": true,
});
// Edit Document Type
const editButtons = document.querySelectorAll('.edit-btn');
const editModal = document.getElementById('editServiceRoomModal');
const editForm = document.getElementById('editServiceRoomForm');
editButtons.forEach(button => {
button.addEventListener('click', function() {
const url = this.getAttribute('data-url');
const name = this.getAttribute('data-name');
editForm.setAttribute('action', url);
document.getElementById('editServiceRoomName').value = name;
$(editModal).modal('show'); // Use jQuery to show the modal
});
});
// Delete Document Type
const deleteButtons = document.querySelectorAll('.delete-btn');
const deleteModal = document.getElementById('deleteServiceRoomModal');
const deleteForm = document.getElementById('deleteForm');
deleteButtons.forEach(button => {
button.addEventListener('click', function() {
const url = this.getAttribute('data-url');
deleteForm.setAttribute('action', url);
$(deleteModal).modal('show'); // Use jQuery to show the modal
});
});
});
</script>
@endpush

View File

@ -0,0 +1,235 @@
@extends('layouts.app')
@push('styles')
<!-- DataTables -->
<link rel="stylesheet" href="{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css') }}">
<link rel="stylesheet" href="{{ asset('plugins/datatables-buttons/css/buttons.bootstrap4.min.css') }}">
@endpush
@section('content-header')
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Manajemen Data Tindakan</h1>
</div><!-- /.col -->
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item active">Tindakan</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
@endsection
@section('main-content')
<div class="card">
<div class="card-header">
<button class="btn btn-info" data-toggle="modal" data-target="#add">
<i class="fas fa-plus"></i>
&nbsp;&nbsp;Tambah Tindakan
</button>
</div>
<div class="card-body">
<table id="tableData" class="table table-bordered table-hover">
<thead>
<tr>
<th>No</th>
<th>Nama Tindakan</th>
<th>Harga Tindakan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@foreach ($treatments as $index => $data)
<tr>
<td>{{ $index + 1 }}</td>
<td>{{ $data->name }}</td>
<td>Rp. {{ number_format($data->fee) }}</td>
<td>
<a href="#" class="btn btn-sm btn-warning edit-btn"
data-url="{{ route('treatment.update', $data->id) }}" data-name="{{ $data->name }}"
data-fee="{{ $data->fee }}" data-toggle="modal" data-target="#edit">
<i class="fas fa-pencil-alt"></i>&nbsp;&nbsp;Edit
</a>
<button type="button" class="btn btn-sm btn-danger delete-btn"
data-url="{{ route('treatment.destroy', $data->id) }}" data-toggle="modal"
data-target="#delete">
<i class="fas fa-trash"></i>&nbsp;&nbsp;Hapus
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- Modal Tambah Tindakan -->
<div class="modal fade" id="add" tabindex="-1" aria-labelledby="addTreatmentModalLabel" aria-hidden="true">
<div class="modal-dialog">
<form id="addtreatmentForm" method="POST" action="{{ route('treatment.store') }}">
@csrf
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addTreatmentModalLabel">Tambah Tindakan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="treatmentName" class="form-label">Nama Tindakan</label>
<input type="text" class="form-control" id="treatmentName" name="name" required>
</div>
<div class="mb-3">
<label for="treatmentPrice" class="form-label">Harga Tindakan</label>
<input type="number" class="form-control" id="treatmentPrice" name="fee" required>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</div>
</form>
</div>
</div>
<!-- Modal Edit Tindakan -->
<div class="modal fade" id="editTreatmentModal" tabindex="-1" aria-labelledby="editTreatmentModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<form id="edittreatmentForm" method="POST">
@csrf
@method('PUT')
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editTreatmentModalLabel">Edit Tindakan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="edittreatmentName" class="form-label">Nama Tindakan</label>
<input type="text" class="form-control" id="edittreatmentName" name="name" required>
</div>
<div class="mb-3">
<label for="edittreatmentPrice" class="form-label">Harga Tindakan</label>
<input type="number" class="form-control" id="edittreatmentPrice" name="fee" required>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Update</button>
</div>
</div>
</form>
</div>
</div>
<!-- Modal Konfirmasi Hapus -->
<div class="modal fade" id="deleteTreatmentModal" tabindex="-1" aria-labelledby="deleteTreatmentModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteTreatmentModalLabel">Hapus Tindakan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Apakah Anda yakin ingin menghapus Tindakan ini?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<form id="deleteForm" action="" method="POST">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">Hapus</button>
</form>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
@if (session('success'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'success',
title: "{{ session('success') }}",
});
});
</script>
@endif
@if (session('error'))
<script>
document.addEventListener('DOMContentLoaded', function() {
Toast.fire({
icon: 'error',
title: "{{ session('error') }}",
});
});
</script>
@endif
<script src="{{ asset('plugins/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script>
<script src="{{ asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script>
<script>
$(function() {
$("#tableData").DataTable({
"paging": true,
"lengthChange": false,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": false,
"responsive": true,
});
// Edit Document Type
const editButtons = document.querySelectorAll('.edit-btn');
const editModal = document.getElementById('editTreatmentModal');
const editForm = document.getElementById('edittreatmentForm');
editButtons.forEach(button => {
button.addEventListener('click', function() {
const url = this.getAttribute('data-url');
const name = this.getAttribute('data-name');
const fee = this.getAttribute('data-fee');
editForm.setAttribute('action', url);
document.getElementById('edittreatmentName').value = name;
document.getElementById('edittreatmentPrice').value = fee;
$(editModal).modal('show'); // Use jQuery to show the modal
});
});
// Delete Document Type
const deleteButtons = document.querySelectorAll('.delete-btn');
const deleteModal = document.getElementById('deleteTreatmentModal');
const deleteForm = document.getElementById('deleteForm');
deleteButtons.forEach(button => {
button.addEventListener('click', function() {
const url = this.getAttribute('data-url');
deleteForm.setAttribute('action', url);
$(deleteModal).modal('show'); // Use jQuery to show the modal
});
});
});
</script>
@endpush

View File

@ -4,8 +4,12 @@ use App\Http\Controllers\AuthController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\ManageUserController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\DocumentTypeController;
use App\Http\Controllers\InsuranceController;
use App\Http\Controllers\PatienRegistrationController;
use App\Http\Controllers\PatientController;
use App\Http\Controllers\ServiceRoomController;
use App\Http\Controllers\TransactionController;
use App\Http\Controllers\TreatmentController;
use Illuminate\Support\Facades\Route;
/*
@ -52,8 +56,45 @@ Route::middleware('auth')->group(function () {
Route::post('/asuransi', [InsuranceController::class, 'store'])->name('insurance.store');
Route::put('/asuransi/{id}', [InsuranceController::class, 'update'])->name('insurance.update');
Route::delete('/asuransi/{id}', [InsuranceController::class, 'destroy'])->name('insurance.destroy');
# Manage Jenis Tindakan
Route::get('/tindakan', [TreatmentController::class, 'index'])->name('treatment.index');
Route::post('/tindakan', [TreatmentController::class, 'store'])->name('treatment.store');
Route::put('/tindakan/{id}', [TreatmentController::class, 'update'])->name('treatment.update');
Route::delete('/tindakan/{id}', [TreatmentController::class, 'destroy'])->name('treatment.destroy');
# Manage Ruang Pelayanan
Route::get('/ruang-pelayanan', [ServiceRoomController::class, 'index'])->name('service-room.index');
Route::post('/ruang-pelayanan', [ServiceRoomController::class, 'store'])->name('service-room.store');
Route::put('/ruang-pelayanan/{id}', [ServiceRoomController::class, 'update'])->name('service-room.update');
Route::delete('/ruang-pelayanan/{id}', [ServiceRoomController::class, 'destroy'])->name('service-room.destroy');
});
# Manage Pasien
Route::get('/pasien', [PatientController::class, 'index'])->name('patient-management.index');
Route::get('/pasien/tambah', [PatientController::class, 'create'])->name('patient-management.create');
Route::post('/pasien', [PatientController::class, 'store'])->name('patient-management.store');
Route::get('/pasien/{id}/edit', [PatientController::class, 'edit'])->name('patient-management.edit');
Route::put('/pasien/{id}', [PatientController::class, 'update'])->name('patient-management.update');
Route::delete('/pasien/{id}', [PatientController::class, 'destroy'])->name('patient-management.destroy');
Route::get('/pasien/{id}', [PatientController::class, 'show'])->name('patient-management.show');
# Manage Registrasi Pasien
Route::get('/registrasi-pasien', [PatienRegistrationController::class, 'index'])->name('patient-registration.index');
Route::get('/registrasi-pasien/tambah', [PatienRegistrationController::class, 'create'])->name('patient-registration.create');
Route::get('/registrasi-pasien/{id}', [PatienRegistrationController::class, 'show'])->name('patient-registration.show');
Route::post('/registrasi-pasien', [PatienRegistrationController::class, 'store'])->name('patient-registration.store');
Route::get('/registrasi-pasien/{id}/edit', [PatienRegistrationController::class, 'edit'])->name('patient-registration.edit');
Route::put('/registrasi-pasien/{id}', [PatienRegistrationController::class, 'update'])->name('patient-registration.update');
Route::delete('/registrasi-pasien/{id}', [PatienRegistrationController::class, 'destroy'])->name('patient-registration.destroy');
# Manage Transaksi
Route::get('/registrasi-pasien/{id}/transaksi/', [TransactionController::class, 'index'])->name('transaction.index');
Route::post('/registrasi-pasien/{id}/transaksi', [TransactionController::class, 'store'])->name('transaction.store');
Route::put('/transaksi/{transId}', [TransactionController::class, 'update'])->name('transaction.update');
Route::delete('/transaksi/{transId}', [TransactionController::class, 'destroy'])->name('transaction.destroy');
// Profile Page
Route::get('/profil-akun', [ProfileController::class, 'edit'])->name('profile.edit');
Route::put('/profil-akun', [ProfileController::class, 'update'])->name('profile.update');