public function proceduresAction()
 {
     $providerIterator = new ProviderIterator();
     $this->view->listProviders = $providerIterator->toArray('personId', 'displayName');
     $this->render();
 }
 public function listPatientVisitTypesAction()
 {
     $patientId = (int) $this->_getParam('patientId');
     $rows = array();
     if ($patientId > 0) {
         $patientVisitTypeIterator = new PatientVisitTypeIterator();
         $patientVisitTypeIterator->setFilters(array('patientId' => $patientId));
         $providerIterator = new ProviderIterator();
         $listProviders = $providerIterator->toArray('personId', 'displayName');
         foreach ($patientVisitTypeIterator as $visitType) {
             $provider = '';
             if (isset($listProviders[$visitType->providerId])) {
                 $provider = $listProviders[$visitType->providerId];
             }
             $tmp = array();
             $tmp['id'] = $visitType->providerId;
             $tmp['data'][] = $provider;
             $tmp['data'][] = $visitType->isPrimary ? __('Primary') : '';
             $rows[] = $tmp;
         }
     }
     $data = array();
     $data['rows'] = $rows;
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($data);
 }
 public function forwardAlertAction()
 {
     $alertId = (int) $this->_getParam('alertId');
     $alert = new GeneralAlert();
     $alert->generalAlertId = $alertId;
     $alert->populate();
     $this->_form = new WebVista_Form(array('name' => 'forwardAlert'));
     $this->_form->setAction(Zend_Registry::get('baseUrl') . 'general-alerts.raw/process-forward-alert');
     $this->_form->loadORM($alert, 'forwardAlert');
     $this->_form->setWindow('windowForwardAlertId');
     $this->view->form = $this->_form;
     $providerIterator = new ProviderIterator();
     $this->view->providers = $providerIterator->toArray('personId', 'displayName');
     $this->view->jsCallback = $this->_getParam('jsCallback');
     $this->render('forward-alert');
 }
 public function listPatientProceduresAction()
 {
     $patientId = (int) $this->_getParam('patientId');
     $rows = array();
     if ($patientId > 0) {
         $patientProcedureIterator = new PatientProcedureIterator();
         $patientProcedureIterator->setFilters(array('patientId' => $patientId));
         $providerIterator = new ProviderIterator();
         $listProviders = $providerIterator->toArray('personId', 'displayName');
         foreach ($patientProcedureIterator as $proc) {
             $quantity = $proc->quantity;
             if ($quantity > 2) {
                 $quantity .= ' times';
             } else {
                 $quantity .= ' time';
             }
             $provider = '';
             if (isset($listProviders[$proc->providerId])) {
                 $provider = $listProviders[$proc->providerId];
             }
             $tmp = array();
             $tmp['id'] = $proc->code;
             $tmp['data'][] = $quantity;
             $tmp['data'][] = $proc->procedure;
             $tmp['data'][] = $provider;
             $tmp['data'][] = $proc->providerId;
             $tmp['data'][] = $proc->comments;
             $rows[] = $tmp;
         }
     }
     $data = array();
     $data['rows'] = $rows;
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($data);
 }