public function getIterator($dbSelect = null)
 {
     if ($dbSelect === null) {
         return $this->_getIteratorBy(1, 1);
     }
     return parent::getIterator($dbSelect);
 }
Пример #2
0
 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();
 }
Пример #3
0
 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();
 }
Пример #4
0
 public function persist()
 {
     if (!strlen($this->guid) > 0) {
         $this->guid = str_replace('-', '', NSDR::create_guid());
     }
     return parent::persist();
 }
Пример #5
0
 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;
 }
Пример #6
0
 public function __construct()
 {
     parent::__construct();
     $this->audit = new Audit();
     $this->audit->_cascadePersist = $this->_cascadePersist;
     $this->handler = new Handler();
     $this->handler->_cascadePersist = $this->_cascadePersist;
 }
Пример #7
0
 public function populate()
 {
     $ret = parent::populate();
     $this->patient->populate();
     $this->provider->populate();
     $this->pharmacy->populate();
     return $ret;
 }
Пример #8
0
 public function persist()
 {
     $claimFileId = (int) $this->claimFileId;
     if (!$claimFileId > 0) {
         $this->claimFileId = $this->nextSequenceId('claimSequences');
     }
     return parent::persist();
 }
Пример #9
0
 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);
 }
Пример #10
0
 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;
 }
Пример #12
0
 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;
 }
Пример #14
0
 public function __construct()
 {
     parent::__construct();
     $this->company = new Company();
     $this->company->_cascadePersist = $this->_cascadePersist;
     $this->address = new Address();
     $this->address->_cascadePersist = $this->_cascadePersist;
 }
Пример #15
0
 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);
 }
Пример #16
0
 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);
 }
Пример #18
0
 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;
 }
Пример #19
0
 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);
 }
Пример #20
0
 public function __construct($table = null, $ormClass = null)
 {
     parent::__construct();
     if ($table !== null) {
         $this->_table = $table;
     }
     if ($ormClass !== null) {
         $this->_ormClass = $ormClass;
     }
 }
Пример #21
0
 public function persist()
 {
     if ($this->_ormPersist) {
         return parent::persist();
     }
     if ($this->shouldAudit()) {
         $sql = $this->toSQL();
         AuditLog::appendSql($sql);
     }
 }
Пример #22
0
 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);
 }
Пример #23
0
 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();
 }
Пример #24
0
 public function populate()
 {
     $ret = parent::populate();
     if ($this->building->buildingId > 0) {
         $this->building->populate();
     } else {
         $this->_init();
     }
     return $ret;
 }
Пример #25
0
 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;
 }
Пример #26
0
 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);
 }
Пример #27
0
 /**
  * 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();
 }
Пример #28
0
 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);
 }
Пример #29
0
 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;
 }