/** * @param $patient */ public static function addPat($patient) { $pat = patient::where("uid", $patient["uid"])->get(); if (sizeof($pat) == 0) { $pat = new patient(); $pat->name = $patient["name"]; $pat->uid = $patient["uid"]; $pat->gender = $patient["gender"]; $pat->yob = $patient["yob"]; $pat->gname = $patient["gname"]; $pat->house = $patient["house"]; $pat->street = $patient["street"]; $pat->lm = $patient["lm"]; $pat->dist = $patient["dist"]; $pat->state = $patient["state"]; $pat->pc = $patient["pc"]; $pat->age = $patient["age"]; $pat->hospital = session("hospid"); $pat->save(); $sql = "create table `MR" . $patient["uid"] . "` (\n `id` int unsigned not null auto_increment primary key,\n `docid` int not null,\n `hospid` int not null,\n `type` varchar(255) not null,\n `data` varchar(255) not null,\n `flag` int unsigned not null,\n `created_at` timestamp not null,\n `updated_at` timestamp not null)\n default character set utf8 collate utf8_unicode_ci"; DB::connection("centraldb")->statement($sql); } $pat = lpatients::find($patient["uid"]); if ($pat == null) { $pat = new lpatients(); $pat->id = $patient["uid"]; $pat->name = $patient["name"]; $pat->save(); } }
public function testfunc() { echo '<!DOCTYPE html> <meta charset="utf-8">'; $pp = patient::where('userId', 3)->first(); $app = appointment::where('appointmentId', 1)->first(); $doc = doctor::where('userId', 4)->first(); $schedule = schedule::where('scheduleId', 1)->first(); $dep = department::where('departmentId', 2)->first(); // $doc->getScheduleInRange(2015, 12); $results = $doc->getDiagStats(2015, 12); foreach ($results as $date) { echo $date['date'] . ' ' . $date['morning'] . ' ' . $date['afternoon'] . ' ' . $date['sum'] . '<br>'; } // return view('testSearch')->with('patient', $pp)->with('ap', $app)->with('doctor', $doc)->with('sc', $schedule)->with('idd', $schedule->scheduleId)->with('department', $dep); }
public static function editPatientProfile($request) { $userId = $request['userId']; $addressStr = ""; if ($request['addressNo'] != null) { $addressSet = array($request['addressNo'], $request['moo'], $request['street'], $request['subdistrict'], $request['district'], $request['province'], $request['zipcode']); $addressStr = join(",,", $addressSet); } User::where('userId', $userId)->update(array('email' => $request['email'], 'name' => $request['name'], 'surname' => $request['surname'])); patient::where('userId', $userId)->update(array('telHome' => $request['telHome'], 'telMobile' => $request['telMobile'], 'address' => $addressStr, 'bloodGroup' => $request['bloodGroup'])); }
public function patientProfileByPharmacist($patientId) { $patient = patient::where('userId', $patientId)->first(); return view('pharmacist.patientProfileByPharmacist')->with('patient', $patient); }
public function addPatient() { $input = $_POST; $input["age"] = date("Y") - $input["yob"]; general::addPat($input); $pat = patient::where("uid", $input["uid"])->first(); $pat->password = bcrypt(session("password")); $pat->save(); session()->flash("error", "Successfully registered, You can sign in now."); return redirect("patient/login"); }
public function manageAppointmentShow($patientId) { $patient = patient::where('userId', $patientId)->first(); $appointments = $patient->appointmentSorted(); return view('staff.manageAppointmentForPatient2')->with('patient', $patient)->with('appointments', $appointments); }