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


PHP Patient::populateWithArray方法代码示例

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


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

示例1: processNewPatientAction

 public function processNewPatientAction()
 {
     $params = $this->_getParam('patient');
     $patient = new Patient();
     $patient->populateWithArray($params);
     if (!strlen($patient->recordNumber) > 0) {
         $patient->recordNumber = WebVista_Model_ORM::nextSequenceId('record_sequence');
     }
     $patient->persist();
     $personId = (int) $patient->personId;
     // save addresses and phones
     $addresses = $this->_getParam('addresses');
     if (is_array($addresses)) {
         foreach ($addresses as $row) {
             $address = new Address();
             $address->populateWithArray($row);
             $address->personId = $personId;
             $address->persist();
         }
     }
     $phones = $this->_getParam('phones');
     if (is_array($phones)) {
         foreach ($phones as $row) {
             $phone = new PhoneNumber();
             $phone->populateWithArray($row);
             $phone->personId = $personId;
             $phone->persist();
         }
     }
     $ret = array();
     $ret['msg'] = 'Record Saved for Patient: ' . ucfirst($patient->firstName) . ' ' . ucfirst($patient->lastName);
     $ret['personId'] = $personId;
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($ret);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:36,代码来源:PatientNewController.php

示例2: processDetailsAction

 public function processDetailsAction()
 {
     $retval = false;
     $params = $this->_getParam('patient');
     $patientId = (int) $params['personId'];
     if ($patientId > 0) {
         if (!(int) $params['person']['personId'] > 0) {
             $params['person']['personId'] = $patientId;
         }
         if (isset($params['person']['active']) && $params['person']['active']) {
             $params['person']['active'] = 1;
         } else {
             $params['person']['active'] = 0;
         }
         $patient = new Patient();
         $patient->person_id = $patientId;
         $patient->populate();
         $patient->populateWithArray($params);
         $patient->person->person_id = $patientId;
         $patient->person->populate();
         $patient->person->populateWithArray($params['person']);
         $patient->persist();
         $retval = true;
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $data = __('Record updated successfully.');
     if ($retval == false) {
         $data = __('There was an error attempting to update patient details.');
     }
     $json->direct($data);
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:32,代码来源:PatientController.php

示例3: processDetailsAction

 public function processDetailsAction()
 {
     $params = $this->_getParam('patient');
     $patientId = (int) $params['personId'];
     $data = __('There was an error attempting to update patient details.');
     if ($patientId > 0) {
         if (!(int) $params['person']['personId'] > 0) {
             $params['person']['personId'] = $patientId;
         }
         if (isset($params['person']['active']) && $params['person']['active']) {
             $params['person']['active'] = 1;
         } else {
             $params['person']['active'] = 0;
         }
         $patient = new Patient();
         $patient->person_id = $patientId;
         $patient->populate();
         $patient->populateWithArray($params);
         if (strlen($patient->recordNumber) > 0 && $patient->hasMRNDuplicates()) {
             $data = __('ERROR: MRN number already exists');
         } else {
             $patient->person->person_id = $patientId;
             $patient->person->populate();
             $patient->person->populateWithArray($params['person']);
             $patient->persist();
             $data = __('Record updated successfully.');
         }
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($data);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:32,代码来源:PatientController.php


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