public function getIterator($dbSelect = null) { if ($dbSelect === null) { return $this->_getIteratorBy(1, 1); } return parent::getIterator($dbSelect); }
public function persist() { if (!$this->dateTime || $this->dateTime == '0000-00-00 00:00:00') { $this->dateTime = date('Y-m-d H:i:s'); } return parent::persist(); }
public function persist() { if ($this->_persistMode != WebVista_Model_ORM::DELETE && (int) $this->program_order === 0) { $this->program_order = self::maxProgramOrder($this) + 1; } return parent::persist(); }
public function persist() { if (!strlen($this->guid) > 0) { $this->guid = str_replace('-', '', NSDR::create_guid()); } return parent::persist(); }
public function persist() { $db = Zend_Registry::get('dbAdapter'); $reportBaseId = (int) $this->reportBaseId; if ($this->_persistMode == self::DELETE) { try { $db->delete($this->_table, 'reportBaseId = ' . $reportBaseId); $db->delete('reportQueries', 'reportBaseId = ' . $reportBaseId); $db->delete('reportViews', 'reportBaseId = ' . $reportBaseId); return true; } catch (Exception $e) { return false; } } $data = $this->toArray(); unset($data['reportFilters']); unset($data['reportQueries']); unset($data['reportViews']); if (strlen($data['guid']) <= 0) { $data['guid'] = uniqid('', true); } if ($reportBaseId > 0) { $ret = $db->update($this->_table, $data, 'reportBaseId = ' . $reportBaseId); } else { $this->reportBaseId = WebVista_Model_ORM::nextSequenceId(); $data['reportBaseId'] = $this->reportBaseId; $ret = $db->insert($this->_table, $data); } return $ret; }
public function __construct() { parent::__construct(); $this->audit = new Audit(); $this->audit->_cascadePersist = $this->_cascadePersist; $this->handler = new Handler(); $this->handler->_cascadePersist = $this->_cascadePersist; }
public function populate() { $ret = parent::populate(); $this->patient->populate(); $this->provider->populate(); $this->pharmacy->populate(); return $ret; }
public function persist() { $claimFileId = (int) $this->claimFileId; if (!$claimFileId > 0) { $this->claimFileId = $this->nextSequenceId('claimSequences'); } return parent::persist(); }
public function getIterator($dbSelect = null) { if ($dbSelect === null) { $db = Zend_Registry::get('dbAdapter'); $dbSelect = $db->select()->from($this->_table)->where('handlerType = ?', $this->handlerType)->order('name'); } return parent::getIterator($dbSelect); }
public function __construct() { parent::__construct(); $this->building = new Building(); $this->building->_cascadePersist = false; $this->provider = new Provider(); $this->provider->_cascadePersist = false; }
public function __construct() { parent::__construct(); $this->insuranceProgram = new InsuranceProgram(); $this->insuranceProgram->_cascadePersist = $this->_cascadePersist; $this->person = new Person(); $this->person->_cascadePersist = $this->_cascadePersist; }
public function __construct() { parent::__construct(); $this->patient = new Patient(); $this->patient->_cascadePersist = $this->_cascadePersist; $this->user = new User(); $this->user->_cascadePersist = $this->_cascadePersist; }
function __construct() { parent::__construct(); $this->medication = new Medication(); $this->medication->_cascadePersist = false; $this->refillResponse = new MedicationRefillResponse(); $this->refillResponse->_cascadePersist = false; }
public function __construct() { parent::__construct(); $this->company = new Company(); $this->company->_cascadePersist = $this->_cascadePersist; $this->address = new Address(); $this->address->_cascadePersist = $this->_cascadePersist; }
public function getIterator($sqlSelect = null) { if ($sqlSelect === null) { $db = Zend_Registry::get('dbAdapter'); $sqlSelect = $db->select()->from($this->_table)->order('dateTime DESC'); } return parent::getIterator($sqlSelect); }
public function populateByLabOrderId($labOrderId = null) { $db = Zend_Registry::get('dbAdapter'); if ($labOrderId === null) { $labOrderId = $this->lab_order_id; } $sqlSelect = $db->select()->from($this->_table)->where('lab_order_id = ?', (int) $labOrderId)->limit(1); return parent::populateWithSql($sqlSelect->__toString()); }
function __get($key) { if (isset($this->{$key})) { return $this->{$key}; } elseif (in_array($key, $this->clinicalNoteTemplate->ORMFields())) { return $this->clinicalNoteTemplate->__get($key); } return parent::__get($key); }
public function populate() { parent::populate(); $this->primaryAddress = $this->_loadAddress(4); //4 is primary address $this->secondaryAddress = $this->_loadAddress(5); //4 is primary address return true; }
public function __set($key, $value) { if (in_array($key, $this->ORMFields())) { return parent::__set($key, $value); } elseif (in_array($key, $this->number->ORMFields())) { return $this->number->__set($key, $value); } return parent::__set($key, $value); }
public function __construct($table = null, $ormClass = null) { parent::__construct(); if ($table !== null) { $this->_table = $table; } if ($ormClass !== null) { $this->_ormClass = $ormClass; } }
public function persist() { if ($this->_ormPersist) { return parent::persist(); } if ($this->shouldAudit()) { $sql = $this->toSQL(); AuditLog::appendSql($sql); } }
public function getIteratorByTeam($teamId = null) { if ($teamId === null) { $teamId = $this->teamId; } $db = Zend_Registry::get('dbAdapter'); $dbSelect = $db->select()->from($this->_table)->where("(status = 'new' AND (teamId = ? OR teamId = ''))", $teamId)->orWhere("status = 'new' AND userId = ?", (int) Zend_Auth::getInstance()->getIdentity()->personId)->order('dateTime DESC'); trigger_error($dbSelect->__toString(), E_USER_NOTICE); return parent::getIterator($dbSelect); }
public function persist() { if (!$this->dateTime || $this->dateTime == '0000-00-00 00:00:00') { $this->dateTime = date('Y-m-d H:i:s'); } if (!$this->patientProcedureId > 0) { $this->populateVisitDiagnoses(); } return parent::persist(); }
public function populate() { $ret = parent::populate(); if ($this->building->buildingId > 0) { $this->building->populate(); } else { $this->_init(); } return $ret; }
public function __construct() { parent::__construct(); $this->audit = new Audit(); $this->audit->_cascadePersist = false; $this->pharmacy = new Pharmacy(); $this->pharmacy->_cascadePersist = false; $this->medication = new Medication(); $this->medication->_cascadePersist = false; }
public function getIteratorByPersonId($personId = null) { if ($personId === null) { $personId = $this->personId; } $personId = (int) $personId; $db = Zend_Registry::get('dbAdapter'); $dbSelect = $db->select()->from($this->_table)->where('person_id = ' . $personId . ' OR patient_id = ' . $personId); return parent::getIterator($dbSelect); }
/** * Overrides WebVista_Model_ORM::persist() */ public function persist() { $order = (int) $this->order; if (!$order > 0 && $this->_persistMode != WebVista_Model_ORM::DELETE) { $db = Zend_Registry::get("dbAdapter"); $dbSelect = $db->select()->from($this->_table, "MAX(`order`) AS order"); $result = $db->fetchRow($dbSelect); $this->order = $result['order'] + 1; } parent::persist(); }
public function __get($key) { if (in_array($key, $this->ORMFields())) { return $this->{$key}; } elseif (in_array($key, $this->author->ORMFields())) { return $this->author->__get($key); } elseif (!is_null(parent::__get($key))) { return parent::__get($key); } elseif (!is_null($this->author->__get($key))) { return $this->author->__get($key); } return parent::__get($key); }
public function populate() { parent::populate(); $this->patient = new Patient(); $this->patient->setPersonId($this->patientId); $this->patient->populate(); $this->provider = new Provider(); $this->provider->setPersonId($this->providerId); $this->provider->populate(); $this->creator->userId = $this->creatorId; $this->creator->populate(); $this->lastChange->userId = $this->lastChangeId; $this->lastChange->populate(); }
public function persist() { $db = Zend_Registry::get('dbAdapter'); $clinicalNoteTemplateId = (int) $this->clinicalNoteTemplateId; $data = $this->toArray(); if ($clinicalNoteTemplateId > 0) { $ret = $db->update($this->_table, $data, 'clinicalNoteTemplateId = ' . $clinicalNoteTemplateId); } else { $this->clinicalNoteTemplateId = WebVista_Model_ORM::nextSequenceId(); $data['clinicalNoteTemplateId'] = $this->clinicalNoteTemplateId; $ret = $db->insert($this->_table, $data); } return $ret; }