public function editBuildingAction()
 {
     $id = (int) $this->_getParam('id');
     $enumerationId = (int) $this->_getParam('enumerationId');
     $enumerationsClosure = new EnumerationsClosure();
     $parentId = $enumerationsClosure->getParentById($enumerationId);
     $enumeration = new Enumeration();
     $enumeration->enumerationId = $parentId;
     $enumeration->populate();
     $orm = new Building();
     if ($id > 0) {
         $orm->buildingId = $id;
         $orm->populate();
     }
     $orm->practiceId = $enumeration->ormId;
     $form = new WebVista_Form(array('name' => 'edit-building'));
     $form->setAction(Zend_Registry::get('baseUrl') . 'facilities.raw/process-edit-building');
     $form->loadORM($orm, 'Building');
     $form->setWindow('windowEditBuildingId');
     $this->view->form = $form;
     $this->view->enumerationId = $enumerationId;
     $this->view->statesList = Address::getStatesList();
     $enumeration = new Enumeration();
     $enumeration->guid = '22fb4e1e-a37a-4e7a-9dae-8e220ba939e8';
     $enumeration->populateByGuid();
     $enumerationClosure = new EnumerationClosure();
     $descendants = $enumerationClosure->getAllDescendants($enumeration->enumerationId, 1, true);
     $facilityCodes = array('' => '');
     foreach ($descendants as $descendant) {
         $facilityCodes[$descendant->key] = $descendant->key . ' : ' . $descendant->name;
     }
     $this->view->facilityCodes = $facilityCodes;
     $this->render('edit-building');
 }
 public function listAction()
 {
     $rows = array();
     $guid = '8e6a2456-1710-46be-a018-2afb0ec2829f';
     $enumeration = new Enumeration();
     $enumeration->populateByGuid($guid);
     $closure = new EnumerationClosure();
     $enumerationIterator = $closure->getAllDescendants($enumeration->enumerationId, 1, true);
     foreach ($enumerationIterator as $enum) {
         $row = array();
         $row['id'] = $enum->enumerationId;
         $row['data'] = array();
         $row['data'][] = $enum->name;
         $rows[] = $row;
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array('rows' => $rows), true);
 }
 public function listAction()
 {
     $rows = array();
     $guid = 'fac51e51-95fd-485e-a8f3-62e1228057ad';
     $enumeration = new Enumeration();
     $enumeration->populateByGuid($guid);
     $closure = new EnumerationClosure();
     $enumerationIterator = $closure->getAllDescendants($enumeration->enumerationId, 1, true);
     foreach ($enumerationIterator as $enum) {
         $row = array();
         $row['id'] = $enum->enumerationId;
         $row['data'] = array();
         $row['data'][] = $enum->name;
         $rows[] = $row;
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array('rows' => $rows), true);
 }
 public function addPaymentAction()
 {
     $columnId = -1;
     $appointmentId = (int) $this->_getParam('appointmentId');
     $visitId = (int) $this->_getParam('visitId');
     $appointment = new Appointment();
     $appointment->appointmentId = $appointmentId;
     $appointment->populate();
     $payment = new Payment();
     $payment->visitId = $visitId;
     $payment->personId = (int) $appointment->patientId;
     $payment->appointmentId = $appointmentId;
     if (!$visitId > 0) {
         $columnId = (int) $this->_getParam('columnId');
     }
     $form = new WebVista_Form(array('name' => 'paymentId'));
     $form->setAction(Zend_Registry::get('baseUrl') . 'appointment.raw/process-add-payment');
     $form->loadORM($payment, 'Payment');
     $form->setWindow('winPaymentId');
     $this->view->form = $form;
     $this->view->visitId = $visitId;
     $guid = 'd1d9039a-a21b-4dfb-b6fa-ec5f41331682';
     $enumeration = new Enumeration();
     $enumeration->populateByGuid($guid);
     $closure = new EnumerationClosure();
     $this->view->paymentTypes = $closure->getAllDescendants($enumeration->enumerationId, 1, true)->toArray('key', 'name');
     $this->view->columnId = $columnId;
     $this->render('add-payment');
 }
 public function visitTypeJsonAction()
 {
     $rows = array();
     $guid = '9eb793f8-1d5d-4ed5-959d-1e238361e00a';
     $enumeration = new Enumeration();
     $enumeration->populateByGuid($guid);
     $closure = new EnumerationClosure();
     $enumerationIterator = $closure->getAllDescendants($enumeration->enumerationId, 1, true);
     foreach ($enumerationIterator as $enum) {
         $row = array();
         $row['id'] = $enum->enumerationId;
         $row['data'] = array();
         $row['data'][] = $enum->name;
         $rows[] = $row;
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array('rows' => $rows), true);
 }
 public function listModifiersAction()
 {
     $guid = $this->_getParam('guid');
     $code = $this->_getParam('code');
     $fs = new FeeSchedule();
     $fs->guid = $guid;
     $fs->procedureCode = $code;
     $fs->populateByGuidCode();
     // ab377de7-8ea7-4912-a27b-2f9749499204 = coding preferences, 9eb793f8-1d5d-4ed5-959d-1e238361e00a = visit type section
     $enumeration = new Enumeration();
     $enumeration->guid = '2b15d494-dce4-4d27-89b5-ddd6f6fc1439';
     $enumeration->populateByGuid();
     $closure = new EnumerationClosure();
     $descendants = $closure->getAllDescendants($enumeration->enumerationId, 1, true);
     $rows = array();
     foreach ($descendants as $enum) {
         $mod = '';
         $fee = '';
         switch ($enum->key) {
             case $fs->modifier1:
                 $fee = $fs->modifier1fee;
                 break;
             case $fs->modifier2:
                 $fee = $fs->modifier2fee;
                 break;
             case $fs->modifier3:
                 $fee = $fs->modifier3fee;
                 break;
             case $fs->modifier4:
                 $fee = $fs->modifier4fee;
                 break;
         }
         if ($fee != '') {
             $mod = '1';
         } else {
             $fee = '0.00';
         }
         $row = array();
         $row['id'] = $enum->key;
         $row['data'] = array();
         $row['data'][] = $mod;
         $row['data'][] = $enum->key . ': ' . $enum->name;
         $row['data'][] = $fee;
         $rows[] = $row;
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array('rows' => $rows));
 }
 public function paymentAction()
 {
     $personId = (int) $this->_getParam('personId');
     $payment = new Payment();
     $payment->personId = $personId;
     $form = new WebVista_Form(array('name' => 'paymentId'));
     $form->setAction(Zend_Registry::get('baseUrl') . 'accounts.raw/process-payment');
     $form->loadORM($payment, 'Payment');
     $form->setWindow('windowUnallocPayment');
     $this->view->form = $form;
     $guid = 'd1d9039a-a21b-4dfb-b6fa-ec5f41331682';
     $enumeration = new Enumeration();
     $enumeration->populateByGuid($guid);
     $closure = new EnumerationClosure();
     $this->view->paymentTypes = $closure->getAllDescendants($enumeration->enumerationId, 1, true)->toArray('key', 'name');
     $this->render();
 }