public function run() { Poli::create(['nama_poli' => 'Poli Umum', 'deskripsi' => 'Poli ini menangani pasien dengan penyakit-penyakit umum oleh dokter non spesialis.']); Poli::create(['nama_poli' => 'Poli Gigi', 'deskripsi' => 'Poli ini menerima pasien yang akan ditangani oleh spesialis gigi.']); Pasien::create(['nama_pasien' => 'Spongebob Squarepants', 'nik' => '3456789012567890', 'jenis_kelamin' => 'L', 'tgl_lahir' => date("Y-m-d", rand(100000, 10000000)), 'alamat' => 'Nanas di Bikini Bottom', 'telepon' => '7391092019', 'gol_darah' => 'B', 'alergi' => 'ubur-ubur', 'riwayat_penyakit' => 'panu']); Pasien::create(['nama_pasien' => 'Shelock Holmes', 'nik' => '7890123456127805', 'jenis_kelamin' => 'L', 'tgl_lahir' => date("Y-m-d", rand(100000, 10000000)), 'alamat' => '221B Baker Street, London', 'telepon' => '6127162989', 'gol_darah' => 'AB', 'riwayat_penyakit' => 'flu']); }
public function update(Request $request, $id) { $poli = Poli::findOrFail($id); $this->validate($request, ['nama_poli' => 'required', 'deskripsi' => 'required']); $input = $request->all(); $poli->fill($input)->save(); Session::flash('edit_message', 'Poli ' . $id . ' berhasil dimutakhirkan!'); return redirect(action('PoliController@edit', $poli->id)); }
public function editDokter($id) { $poli = Poli::all(); $dokter = Dokter::findOrFail($id); return view('auth.edit-dokter')->with('dokter', $dokter)->with('poli', $poli); }
public function home() { $id_pasien = Input::get('id_pasien'); $id_bpjs = Input::get('id_bpjs'); if (isset($id_pasien) and empty($id_bpjs)) { $pasien = Pasien::where('id', '=', $id_pasien)->get(); $pasienid = DB::table('pasien')->where('id', $id_pasien)->value('id'); $pasienexists = Pasien::where('id', $id_pasien)->count(); if ($pasienexists == 1) { $info = "Pasien ditemukan"; $tambah = true; } else { $info = "Pasien tidak ditemukan"; $tambah = false; } if ($tambah) { $poli = Poli::all(); return view('dashboard.tambah-ke-poli')->with('pasienid', $pasienid)->with('poli', $poli); } else { return view('dashboard.home')->with('pasien', $pasien)->with('info', $info)->with('tambah', $tambah)->with('pasienid', $pasienid); } return view('dashboard.tambah-ke-poli')->with('pasien', $pasien)->with('info', $info)->with('tambah', $tambah); } else { if (isset($id_bpjs) and isset($id_pasien)) { $pasien = Pasien::where('id', '=', $id_pasien)->get(); $bpjs = BPJS::where('id', '=', $id_bpjs)->get(); $pasieninfo = DB::table('pasien')->where('id', $id_pasien)->value('nik'); $bpjsinfo = DB::table('bpjs')->where('id', $id_bpjs)->value('nik'); $bpjsstatus = DB::table('bpjs')->where('id', $id_bpjs)->value('status_premi'); $bpjsexists = BPJS::where('id', $id_bpjs)->count(); $pasienexists = Pasien::where('id', $id_pasien)->count(); $pasienid = DB::table('pasien')->where('id', $id_pasien)->value('id'); $bpjsid = BPJS::where('id', $id_bpjs)->value('id'); if ($pasienexists == 1) { if ($bpjsexists == 1) { if ($bpjsstatus == 0) { $info = "BPJS tidak aktif"; $tambah = false; } else { if ($pasieninfo == $bpjsinfo) { $info = "Data sama"; $tambah = true; } else { $info = "Data tidak sama"; $tambah = false; } } } else { $info = "BPJS tidak ditemukan"; $tambah = false; } } else { $info = "Pasien tidak ditemukan"; $tambah = false; } if ($tambah) { $poli = Poli::all(); return view('dashboard.tambah-ke-poli')->with('pasienid', $pasienid)->with('bpjsid', $bpjsid)->with('poli', $poli); } else { return view('dashboard.home')->with('pasien', $pasien)->with('bpjs', $bpjs)->with('info', $info)->with('tambah', $tambah)->with('pasienid', $pasienid)->with('bpjsid', $bpjsid); } } else { if (empty($id_bpjs) and empty($id_pasien)) { //if form is still empty if (Auth::user()->is('dokter')) { $email = Auth::user()->email; $id_dokter = Dokter::where('email', $email)->value('id'); $temp = RMTemp::where('id_dokter', $id_dokter)->where('status_cek', 0)->get(); } else { if (Auth::user()->is('admin')) { $email = Auth::user()->email; $id_admin = Admin::where('email', $email)->value('id'); $temp = RMTemp::where('id_admin', $id_admin)->where('status_cek', 1)->get(); } } if (isset($temp) and count($temp) > 0) { return view('dashboard.home')->with('temp', $temp); } else { return view('dashboard.home'); } } } } }