public function getPhoneNumbers($autoFix = true) { $phoneNumber = new PhoneNumber(); $phoneNumber->personId = $this->person_id; return $phoneNumber->getIteratorByPersonId(); }
public function _editAppointment(array $params, $action = 'new') { $appointmentId = isset($params['appointmentId']) ? (int) $params['appointmentId'] : 0; $appointment = new Appointment(); $appointment->appointmentId = $appointmentId; $date = isset($params['date']) ? $params['date'] : ''; if ($appointmentId > 0 && $appointment->populate()) { $filter = $this->getCurrentDisplayFilter(); $start = explode(' ', date('Y-m-d H:i', strtotime($appointment->start))); $date = $start[0]; $appointment->start = $start[1]; $appointment->end = date('H:i', strtotime($appointment->end)); $recordNumber = $appointment->patient->record_number; $patientName = $appointment->patient->displayName; $this->view->patient = "{$patientName} #{$recordNumber} PID:{$appointment->patient->person_id}"; } else { $start = isset($params['start']) ? $params['start'] : self::FILTER_TIME_START; $appointment->start = $start; $appointment->end = date('H:i', strtotime('+1 hour', strtotime($start))); $appointment->providerId = isset($params['providerId']) ? (int) $params['providerId'] : 0; $appointment->roomId = isset($params['roomId']) ? (int) $params['roomId'] : 0; } $this->view->date = $date; $form = new WebVista_Form(array('name' => $action . '-appointment')); $form->setAction(Zend_Registry::get('baseUrl') . 'calendar.raw/process-' . $action . '-appointment'); $form->loadORM($appointment, 'Appointment'); $form->setWindow('windowAppointmentId'); $this->view->form = $form; $this->view->reasons = PatientNote::listReasons(); $phones = array(); $phone = new PhoneNumber(); $phoneIterator = $phone->getIteratorByPersonId($appointment->patientId); foreach ($phoneIterator as $row) { $phones[] = $row->number; } $this->view->phones = $phones; $appointmentTemplate = new AppointmentTemplate(); $this->view->appointmentReasons = $appointmentTemplate->getAppointmentReasons(); $this->view->appointment = $appointment; $this->view->callbackId = $this->_getParam('callbackId', ''); $this->render('appointment'); }
public function ajaxListPhonesAction() { $patientId = (int) $this->_getParam('patientId'); $rows = array(); $tmp = array(); $phoneNumber = new PhoneNumber(); $phoneNumberIterator = $phoneNumber->getIteratorByPersonId($patientId); foreach ($phoneNumberIterator as $phone) { $rows[] = $this->_toJSON($phone, 'phoneNumberId', array('name', 'type', 'number', 'notes', 'active')); } $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json'); $json->suppressExit = true; $json->direct(array('rows' => $rows)); }