public function indexAction(Request $request) { $this->check(); $id = $request->get('id'); $patient = new Patient(); $patient->load($id); if ($patient->getId()) { return $this->render("PatientDiseaseBundle:Default:patientdiseaselist.html.twig", array('user' => $this->getUserDataHeader($request->getSession()), 'patient' => $patient->getData(), 'new_action' => $this->check('patient_disease_new', false))); } return $this->generate404($request->getSession(), 'Patient\'s Diseases'); }
public function deleteAction(Request $request) { $this->check(); $id = $request->get('id'); $disease = new Patient(); $disease->load($id); if ($disease->getId()) { $disease->delete(); $disease->save(); } return $this->redirectToRoute('patients_list'); }
public function fullLoad() { if ($this->getUserId()) { $user = new User(); $user->load($this->getUserId()); $this->setUserName($user->getName() . ' ' . $user->getSecondName()); } if ($this->getPatientId()) { $patient = new Patient(); $patient->load($this->getPatientId()); $this->setPatientName($patient->getName() . ' ' . $patient->getSecondName()); } if ($this->getDiseaseId()) { $disease = new Disease(); $disease->load($this->getDiseaseId()); $this->setTitle($disease->getTitle()); } }
public function fullLoad() { if ($this->getUserId()) { $user = new User(); $user->load($this->getUserId()); $this->setUserName($user->getName() . ' ' . $user->getSecondName()); } if ($this->getPatientId()) { $patient = new Patient(); $patient->load($this->getPatientId()); $this->setPatientName($patient->getName() . ' ' . $patient->getSecondName()); } if ($this->getServiceId()) { $service = new Service(); $service->load($this->getServiceId()); $this->setTitle($service->getTitle()); $this->setPrice($service->getPrice()); } }
public function newAction(Request $request) { $this->check(); $id = $request->get('id'); $diseases = new DiseaseCollection(); $users = new UserCollection(); $patient = new Patient(); $patient->load($id); $data = array(); $data['diseases'] = $diseases->getAllItemsData(); $data['users'] = $users->getAllItemsData(); if ($patient->getId()) { $data['patients'] = $patient->getData(); } else { $patient = new PatientCollection(); $data['patients'] = $patient->getAllItemsData(); } return $this->render('PatientDiseaseBundle:Default:patientdiseaseedit.html.twig', array('data' => $data, 'user' => $this->getUserDataHeader($request->getSession()), 'template_type' => 'New')); }