当前位置: 首页>>代码示例>>PHP>>正文


PHP PhoneNumber::getIteratorByPatientId方法代码示例

本文整理汇总了PHP中PhoneNumber::getIteratorByPatientId方法的典型用法代码示例。如果您正苦于以下问题:PHP PhoneNumber::getIteratorByPatientId方法的具体用法?PHP PhoneNumber::getIteratorByPatientId怎么用?PHP PhoneNumber::getIteratorByPatientId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhoneNumber的用法示例。


在下文中一共展示了PhoneNumber::getIteratorByPatientId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addAppointmentAction

 public function addAppointmentAction()
 {
     $appointmentId = $this->_getParam('appointmentId');
     $appointment = new Appointment();
     if (strlen($appointmentId) > 0) {
         $filter = $this->getCurrentDisplayFilter();
         $appointment->appointmentId = (int) $appointmentId;
         $appointment->populate();
         $this->view->start = date('H:i', strtotime($appointment->start));
         $this->view->end = date('H:i', strtotime($appointment->end));
         foreach ($filter->columns as $index => $col) {
             if ($col['providerId'] > 0 && $col['roomId'] > 0 && $col['providerId'] == $appointment->providerId && $col['roomId'] == $appointment->roomId || $col['providerId'] > 0 && $col['providerId'] == $appointment->providerId || $col['roomId'] > 0 && $col['roomId'] == $appointment->roomId) {
                 $this->view->columnId = $index;
                 break;
             }
         }
         $recordNumber = $appointment->patient->record_number;
         $lastName = $appointment->patient->last_name;
         $firstName = $appointment->patient->first_name;
         $middleInitial = '';
         if (strlen($appointment->patient->middle_name) > 0) {
             $middleInitial = $appointment->patient->middle_name[0];
         }
         $this->view->patient = "{$lastName}, {$firstName} {$middleInitial} #{$recordNumber} PID:{$appointment->patient->person_id}";
     } else {
         $columnId = $this->_getParam('columnId');
         $rowId = $this->_getParam('rowId');
         $start = $this->_getParam('start');
         if (strlen($columnId) > 0) {
             $this->view->columnId = $columnId;
             $filter = $this->getCurrentDisplayFilter();
             if (!isset($filter->columns[$columnId])) {
                 throw new Exception(__("Cannot generate column with that index, there is no filter defined for that column Index: ") . $columnId);
             }
             $column = $filter->columns[$columnId];
             $appointment->providerId = isset($column['providerId']) ? $column['providerId'] : 0;
             $appointment->roomId = isset($column['roomId']) ? $column['roomId'] : 0;
         }
         if (strlen($start) > 0) {
             $this->view->start = $start;
             $this->view->end = date('H:i', strtotime('+1 hour', strtotime($start)));
         }
     }
     $form = new WebVista_Form(array('name' => 'add-appointment'));
     $form->setAction(Zend_Registry::get('baseUrl') . "calendar.raw/process-add-appointment");
     $form->loadORM($appointment, "Appointment");
     $form->setWindow('windowNewAppointment');
     $this->view->form = $form;
     $reasons = array();
     $enumeration = new Enumeration();
     $enumeration->populateByEnumerationName(PatientNote::ENUM_REASON_PARENT_NAME);
     $enumerationsClosure = new EnumerationsClosure();
     $enumerationIterator = $enumerationsClosure->getAllDescendants($enumeration->enumerationId, 1);
     $ctr = 0;
     foreach ($enumerationIterator as $enum) {
         // since data type of patient_note.reason is tinyint we simply use the counter as id
         $reasons[$ctr++] = $enum->name;
     }
     /*
     $patientNotes = array();
     $patientNote = new PatientNote();
     $patientNoteIterator = $patientNote->getIterator();
     $filters = array();
     $filters['patient_id'] = (int)$appointment->patientId;
     $filters['active'] = 1;
     $filters['posting'] = 0;
     $patientNoteIterator->setFilters($filters);
     foreach ($patientNoteIterator as $row) {
     	$patientNotes[$row->patientNoteId] = $reasons[$row->reason];
     }
     $this->view->patientNotes = $patientNotes;
     */
     $phones = array();
     $phone = new PhoneNumber();
     $phoneIterator = $phone->getIteratorByPatientId($appointment->patientId);
     foreach ($phoneIterator as $row) {
         $phones[] = $row->number;
     }
     $this->view->phones = $phones;
     $appointmentTemplate = new AppointmentTemplate();
     $appointmentReasons = $appointmentTemplate->getAppointmentReasons();
     $this->view->appointmentReasons = $appointmentReasons;
     $this->view->appointment = $appointment;
     $this->render('add-appointment');
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:85,代码来源:CalendarController.php


注:本文中的PhoneNumber::getIteratorByPatientId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。