protected function _createAudit($providerId, $personId, $visitId, $type) { $providerId = (int) $providerId; $personId = (int) $personId; $visitId = (int) $visitId; $audit = array(); $audit['objectClass'] = 'GenericAccessAudit'; $audit['objectId'] = $personId . ';' . $visitId; $audit['type'] = (int) $type; $audit['userId'] = $providerId; $audit['patientId'] = $personId; $values = array(); $provider = new Provider(); $provider->personId = $audit['userId']; $provider->populate(); $values['provider'] = $provider->toArray(); $patient = new Patient(); $patient->personId = $personId; $patient->populate(); $values['patient'] = $patient->toArray(); $values['personId'] = $patient->personId; $visit = new Visit(); $visit->visitId = $visitId; $visit->populate(); $values['visit'] = $visit->toArray(); $values['visitId'] = $visit->visitId; $audit['auditValues'] = $values; Audit::persistManualAuditArray($audit); }
public function detailAction() { $personId = (int) $this->_getParam('personId'); if (!$personId > 0) { $this->_helper->autoCompleteDojo($personId); } $db = Zend_Registry::get('dbAdapter'); $patient = new Patient(); $patient->personId = (int) $personId; $patient->populate(); $patient->person->populate(); $outputArray = $patient->toArray(); $outputArray['displayGender'] = $patient->displayGender; $outputArray['age'] = $patient->age; $acj = Zend_Controller_Action_HelperBroker::getStaticHelper('json'); $acj->suppressExit = true; $acj->direct($outputArray); }
/** * Query by Example. * * Match by attributes of passed example instance and return matched rows as an array of Patient instances * * @param PDO $db a PDO Database instance * @param Patient $example an example instance defining the conditions. All non-null properties will be considered a constraint, null values will be ignored. * @param boolean $and true if conditions should be and'ed, false if they should be or'ed * @param array $sort array of DSC instances * @return Patient[] */ public static function findByExample(PDO $db, Patient $example, $and = true, $sort = null) { $exampleValues = $example->toArray(); $filter = array(); foreach ($exampleValues as $fieldId => $value) { if (null !== $value) { $filter[$fieldId] = $value; } } return self::findByFilter($db, $filter, $and, $sort); }
public function transmitEprescriptionAction() { $medicationId = (int) $this->_getParam('medicationId'); $medication = new Medication(); $medication->medicationId = $medicationId; $medication->populate(); //echo $medication->toString(); //echo $medicationId; $data = $medication->toArray(); $practice = new Practice(); $practice->practiceId = MainController::getActivePractice(); $practice->populate(); $data['practiceName'] = $practice->name; $pharmacy = new Pharmacy(); $pharmacy->pharmacyId = $medication->pharmacyId; $pharmacy->populate(); $data['pharmacy'] = $pharmacy->toArray(); $prescriber = new Provider(); $prescriber->personId = $medication->prescriberPersonId; $prescriber->populate(); $prescriber->person->populate(); $data['prescriber'] = $prescriber->toArray(); $data['prescriber']['agentFirstName'] = ''; $data['prescriber']['agentLastName'] = ''; $data['prescriber']['agentSuffix'] = ''; $addressIterator = new AddressIterator(); $addressIterator->setFilters(array('class' => 'person', 'personId' => $prescriber->personId)); $data['prescriber']['address'] = $addressIterator->first()->toArray(); $phoneIterator = new PhoneNumberIterator(); $phoneIterator->setFilters(array('class' => 'person', 'personId' => $prescriber->personId)); $data['prescriber']['phone'] = $phoneIterator->first()->toArray(); $patient = new Patient(); $patient->personId = $medication->personId; $patient->populate(); $data['patient'] = $patient->toArray(); $phoneIterator->setFilters(array('class' => 'person', 'personId' => $patient->personId)); $data['patient']['phone'] = $phoneIterator->first()->toArray(); //var_dump($data);exit; $data = $this->makePostArray($data); //var_dump($this->makePostArray($data));exit; //var_dump($data);exit; $transmitEPrescribeURL = Zend_Registry::get('config')->healthcloud->URL; $transmitEPrescribeURL .= "SSRX/NewRx?apiKey=" . Zend_Registry::get('config')->healthcloud->apiKey; $cookieFile = tempnam(sys_get_temp_dir(), "ssddcookies_"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $transmitEPrescribeURL); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); $output = curl_exec($ch); echo $output; exit; }
public function getDetailsAction() { $personId = (int) $this->_getParam('personId'); $data = false; if ($personId > 0) { $patient = new Patient(); $patient->personId = $personId; $patient->populate(); $data = $patient->toArray(); $data['phoneNumber'] = $patient->person->phoneNumber->toArray(); $data['address'] = $patient->person->address->toArray(); $phones = array(); foreach ($patient->person->getPhoneNumbers() as $phone) { $phones[] = $phone->number; } $data['phones'] = implode(',', $phones); $data['age'] = $patient->person->age; } $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json'); $json->suppressExit = true; $json->direct($data); }