public function deleteDoctorTime($doctor_time_id) { if (!HospitalEmployee::isDoctor()) { return response()->json(["success" => false, "messages" => ['notlogin or notvalid']]); } // if(!HospitalEmployee::isDoctor()) // return response()->json(["success" = false]; $doctorTime = DoctorTime::where('doctorTime_id', $doctor_time_id)->first(); if ($doctorTime) { $doctorTime->delete(); } return response()->json(["success" => true]); }
public function drugAllergic(Request $request, $patientId) { if (!HospitalEmployee::isDoctor()) { return response()->json(["success" => false, "error" => 'notlogin or notvalid']); } $drugAllergic = $request->input('drugAllergic'); $error = []; if (!$drugAllergic) { $error[] = 'drugAllergic_not_found'; } if (sizeof($error) != 0) { return response()->json(["success" => false, "message" => $error]); } $drAllergic = Patient::where('id', $patientId)->first(); $drAllergic->drugAllergic = $drugAllergic; $drAllergic->save(); return response()->json(["success" => true, "message" => 'saved drugAllergic record']); }
public function getLastAppointment($patient_id) { if (!Patient::isPatient() && !HospitalEmployee::isDoctor() && !HospitalEmployee::isStaff()) { return response()->json(["success" => false, "error" => 'notlogin or notvalid']); } return response()->json(["success" => true, "data" => Appointment::getLastAppointment($patient_id)]); }