Esempio n. 1
0
 public function getPres()
 {
     $id = $_POST["uid"];
     $pat = patient::find($id);
     if ($pat == null) {
         redirect("phar");
     }
     $patRecs = DB::connection("centraldb")->select('select * from `MR' . $id . '` where `type` = "pres" and `flag` = "0" ');
     session(["patId" => $pat->uid]);
     return view("pharmacy.buy", compact("patRecs", "pat"));
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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']));
 }
Esempio n. 4
0
 public function patientProfileByPharmacist($patientId)
 {
     $patient = patient::where('userId', $patientId)->first();
     return view('pharmacist.patientProfileByPharmacist')->with('patient', $patient);
 }
Esempio n. 5
0
 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");
 }
Esempio n. 6
0
 public function show($hospitalNo)
 {
     $patient = patient::findOrFail($hospitalNo);
     return view('patient.profile', compact('patient'));
 }
 public function manageAppointmentShow($patientId)
 {
     $patient = patient::where('userId', $patientId)->first();
     $appointments = $patient->appointmentSorted();
     return view('staff.manageAppointmentForPatient2')->with('patient', $patient)->with('appointments', $appointments);
 }
Esempio n. 8
0
 public function searchPatient($url)
 {
     $query = e(Input::get('q', ''));
     if (!$query && $query == '') {
         return Response::json(array(), 400);
     }
     $patient = patient::searchPatient($query)->take(5)->get(array('patient.userId', 'name', 'surname'));
     $patient = $this->appendClass($patient, 'patient');
     $patient = $this->appendUrl($patient, $url);
     return Response::json(array('data' => $patient));
 }
Esempio n. 9
0
 /**
  * @param $uid
  * @return mixed
  */
 public static function getPatient($uid)
 {
     $pat = patient::find($uid);
     return $pat;
 }