本文整理汇总了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);
}
示例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);
}
示例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);
}