Example #1
0
 /**
  * add new consultation to specific patient
  */
 public function processAction()
 {
     $data = $this->params()->fromPost();
     $form = new ConsultationForm();
     $form->setData($data);
     if ($form->isValid()) {
     }
 }
 public function indexAction()
 {
     $data = $this->params()->fromPost();
     $form = new ConsultationForm();
     $form->setData($data);
     if ($form->isValid()) {
         //TODO check if the patient is not exist on the today queue
         $consultationService = $this->getServiceLocator()->get(\Patient\Service\ConsultationService::class);
         $consultationService->add($data);
         $queueService = $this->getServiceLocator()->get(\Patient\Service\QueueService::class);
         $queueService->update($data['currentId'], ['isWaiting' => 0]);
         $this->redirect()->toRoute('patient/default', ['controller' => 'index']);
     }
     return false;
 }