Example #1
0
 function getProviderDisplayName()
 {
     $provider = new Provider();
     $provider->person_id = $this->treating_person_id;
     $provider->populate();
     return $provider->person->getDisplayName();
 }
 public function __construct(array $data)
 {
     $this->measureNumber = isset($data['measureNumber']) ? (int) $data['measureNumber'] : 0;
     $this->denominator = isset($data['denominator']) ? (int) $data['denominator'] : 0;
     $this->numerator = isset($data['numerator']) ? (int) $data['numerator'] : 0;
     $this->exclusions = isset($data['exclusions']) ? (int) $data['exclusions'] : 0;
     $this->percentage = isset($data['percentage']) ? sprintf('%.2f', $data['percentage']) : 0;
     if (isset($data['visitDateStart'])) {
         $this->visitDateStart = date('m-d-Y', strtotime($data['visitDateStart']));
     } else {
         $this->visitDateStart = date('01-01-Y');
     }
     if (isset($data['visitDateEnd'])) {
         $this->visitDateEnd = date('m-d-Y', strtotime($data['visitDateEnd']));
     } else {
         $this->visitDateEnd = date('12-31-Y');
     }
     $provider = isset($data['provider']) ? $data['provider'] : '';
     if (!$data['provider'] instanceof Provider) {
         $providerId = (int) $provider;
         $provider = new Provider();
         $provider->personId = $providerId;
         $provider->populate();
     }
     $this->provider = $provider;
     if (isset($data['fileNumber'])) {
         $this->fileNumber = (int) $data['fileNumber'];
     }
     if (isset($data['numberOfFiles'])) {
         $this->numberOfFiles = (int) $data['numberOfFiles'];
     }
 }
Example #3
0
 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);
 }
Example #4
0
 public function registerAction()
 {
     $request = $this->getRequest();
     $registerForm = new RegisterProvider();
     if ($request->isPost()) {
         $postData = $request->getPost();
         $registerForm->setInputFilter(new RegisterProviderValidator($this->getServiceLocator()));
         $registerForm->setData($postData);
         if ($registerForm->isValid()) {
             $providerData = $registerForm->getData();
             $providerData = $this->prepareDataProvider($providerData);
             $providerEntity = new Provider();
             $providerEntity->exchangeArray($providerData);
             $providerData = $providerEntity->getArrayCopy();
             $providerDao = $this->getServiceDao('Model\\Dao\\ProviderDao');
             $saved = $providerDao->saveProvider($providerData);
             if ($saved) {
                 $this->sendMailRegisterConfirm($providerData);
                 $this->flashMessenger()->addMessage($providerData['email']);
                 print_r($providerData);
                 die;
             } else {
                 throw new \Exception("Not Save Row");
             }
         } else {
             $messages = $registerForm->getMessages();
             //print_r($messages);die;
             $registerForm->populateValues($postData);
         }
     }
     $view['providerForm'] = $registerForm;
     return new ViewModel($view);
 }
Example #5
0
 public function __construct($tthis, $context, $data)
 {
     $this->tthis = $tthis;
     $this->context = $context;
     $this->data = $data;
     $year = 0;
     if (isset($tthis->_attributes['year'])) {
         $year = (int) $tthis->_attributes['year'];
     }
     if (!$year > 0) {
         $year = date('Y') - 1;
     }
     // default year to previous
     $this->dateStart = date('Y-m-d', strtotime($year . '-01-01'));
     $this->dateEnd = date('Y-m-d', strtotime($year . '-12-31'));
     $this->providerId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
     $providerId = (int) $this->context;
     if ($providerId > 0) {
         $this->providerId = $providerId;
     }
     $info = array();
     $info['dateStart'] = $this->dateStart;
     $info['dateEnd'] = $this->dateEnd;
     $provider = new Provider();
     $provider->personId = $this->providerId;
     $provider->populate();
     $info['provider'] = $provider;
     self::$info = $info;
 }
Example #6
0
 /**
  * @covers mychaelstyle\storage\Factory::getProvider
  * @covers mychaelstyle\ProviderFactory::getProvider
  * @covers mychaelstyle\storage\Factory::getPackage
  * @covers mychaelstyle\storage\Factory::getPath
  */
 public function testGetProviderException()
 {
     // invalid
     $def = $this->dsnMap['Local'];
     $this->setExpectedException('mychaelstyle\\Exception');
     $provider = $this->object->getProvider('', $def['options']);
 }
Example #7
0
 public function testArr()
 {
     $data = ["a" => "b"];
     $provider = new Provider($data);
     $this->assertEquals($data, $provider->getDataAsArray());
     $this->assertEquals($data, $provider->exportFromArray($data));
 }
 /**
  * [add description]
  *
  * @param Provider $provider [description]
  *
  * @return [type] [description]
  */
 public function add(Provider $provider)
 {
     $provider->setApplication($this->app);
     $providerName = get_class($provider);
     if (!isset($this->providers[$providerName])) {
         $this->providers[$providerName] = $provider;
     }
 }
 /**
  * @expectedException AdamWathan\EloquentOAuth\Exceptions\ApplicationRejectedException
  */
 public function test_get_user_details_throws_exception_if_user_rejects_application()
 {
     $redirectUri = 'http://myapp.dev/provider/login';
     $config = array('id' => '1', 'secret' => 'foobar', 'redirect' => $redirectUri);
     $httpClient = M::mock('GuzzleHttp\\Client')->shouldIgnoreMissing();
     $input = M::mock('Illuminate\\Http\\Request')->shouldIgnoreMissing();
     $provider = new Provider($config, $httpClient, $input);
     $httpClient->shouldReceive('post->getBody')->andReturn('abc123');
     $httpClient->shouldReceive('get->getBody')->andReturn('{"user_id":"1","nick_name":"john.doe","first_name":"John","last_name":"Doe","email":"*****@*****.**","photo":"http:\\/\\/example.com\\/photos\\/john_doe.jpg"}');
     $input->shouldReceive('has')->andReturn(false);
     $details = $provider->getUserDetails();
 }
 public function proceduresAction()
 {
     $visitId = (int) $this->_getParam('visitId');
     $visit = new Visit();
     $visit->visitId = $visitId;
     if ($visitId > 0) {
         $visit->populate();
     }
     $provider = new Provider();
     $providerIterator = $provider->getIter();
     $this->view->listProviders = $providerIterator->toArray('personId', 'displayName');
     $this->view->providerId = (int) $visit->providerId;
     $this->render();
 }
Example #11
0
 public function create($name)
 {
     if (array_key_exists($name, $this->mockClasses)) {
         return $this->mockClasses[$name];
     }
     return parent::create(func_get_args());
 }
Example #12
0
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new Provider();
     }
     return self::$instance;
 }
 public function editAction()
 {
     $personId = (int) $this->_getParam('personId');
     if (isset($this->_session->messages)) {
         $this->view->messages = $this->_session->messages;
     }
     $this->_form = new WebVista_Form(array('name' => 'provider-detail'));
     $this->_form->setAction(Zend_Registry::get('baseUrl') . "admin-providers.raw/edit-process");
     $this->_provider = new Provider();
     $this->_provider->person_id = $personId;
     if (!$this->_provider->populate()) {
         if ($personId > 0) {
             //handle case where person exists but no provider record
             $this->view->noProvider = true;
         }
         //do nothing if personId is 0, no person selected yet
     }
     $this->_form->loadORM($this->_provider, 'provider');
     //var_dump($this->_form);
     $this->view->form = $this->_form;
     $this->view->person = $this->_provider;
     $stations = Enumeration::getEnumArray(Routing::ENUM_PARENT_NAME);
     $stations = array_merge(array('' => ''), $stations);
     $this->view->stations = $stations;
     $specialties = array('' => '');
     $listSpecialties = Provider::getListSpecialties();
     // temporarily use AM = American Medical Association
     foreach ($listSpecialties['AM'] as $specialty) {
         $specialties[$specialty['code']] = $specialty['description'];
     }
     $this->view->specialties = $specialties;
     $this->view->colors = Room::getColorList();
     $this->render('edit');
 }
Example #14
0
 /**
  * transformOnce method
  *
  * @param mixed $input
  * @param array $embeds
  * @return array
  */
 protected function transformOnce($input, array $embeds = [])
 {
     if ($this->transformer === null) {
         $this->transformer = $this->provider->willTransform($input)->get();
     }
     return $this->transformer->transform($input, $embeds);
 }
Example #15
0
 /**
  * Get products data
  *
  * @return array
  */
 public function getProductsData()
 {
     $productsData = [];
     $provider = new Provider();
     foreach ($this->_brands as $brandId => $brand) {
         $categoryUrl = $provider->getCategoryUrl(self::STORE_URL, $brandId, self::ALL_CATEGORY_PRODUCTS);
         if ($categoryUrl) {
             $productUrls[$categoryUrl] = $provider->getProductUrls($this->_addStoreUrl($categoryUrl));
             foreach ($productUrls[$categoryUrl] as $index => $productUrl) {
                 $productData = $provider->getProductData($this->_addStoreUrl($productUrl));
                 $productsData[$productUrl] = $this->_addBrandToProductData($productData, $brand);
             }
         }
     }
     return $productsData;
 }
 function __Construct($dictionary)
 {
     parent::__Construct(get_class(), "desktop.html", $dictionary);
     //get input params
     $paymentConfigCode = Params::Get('state');
     $authCode = Params::Get('code');
     //load provider (verify code)
     $provider = Provider::FromPaymentConfigCode($paymentConfigCode);
     if (is_null($provider)) {
         //TODO: deal with this
     } else {
         //check stripe id isn't already set
         if (!is_null($provider->getStripeAccountId())) {
             //TODO: deal with this
         } else {
             $stripeAccount = StripeConnector::ConstructAccount($authCode);
             if (is_null($stripeAccount)) {
                 //TODO: deal with this
             } else {
                 //add to provider - clear code
                 $provider->setStripeAccountId($stripeAccount->getId());
                 $provider->setPaymentConfigCode(null);
                 $provider->save();
                 //notify success
                 $this->connected = true;
             }
         }
     }
 }
Example #17
0
 public function getProviderName($provider_id)
 {
     $provider = Provider::model()->findByPk($provider_id);
     if ($provider) {
         return $provider->provider_name;
     }
     return 'Medlatec';
 }
Example #18
0
 /**
  * {@inheritdoc}
  */
 public function getValue($value)
 {
     $value = parent::getValue($value);
     if (is_array($value)) {
         return serialize($value);
     }
     return $value;
 }
 public function indexAjax()
 {
     return BootstrapUI::tableRemoteResponse()->search(array('name'))->column('name')->column('total', function ($value, $row) {
         return "<div class=\"text-right\">{$value}</div>";
     })->column('action', function ($value, $row) {
         return \Bootstrap::anchor(\Bootstrap::icon('search'), \Koldy\Url::href('reports', 'search', array('provider_id' => $row['id'])))->title('Find reports sent from this provider')->asButton()->size('xs')->color('red');
     })->resultSet(Provider::resultSet())->handle();
 }
Example #20
0
 public function actionGetAllResult()
 {
     $columns = array(0 => 'id', 1 => 'patient_name', 2 => 'service', 3 => 'time', 4 => 'status', 5 => 'created_at', 6 => 'action');
     $request = Yii::app()->request;
     $start = $_REQUEST['start'];
     $length = $_REQUEST['length'];
     $column = $_REQUEST['order'][0]['column'];
     $order = $_REQUEST['order'][0]['dir'];
     $where = null;
     $criteria = new CDbCriteria();
     $criteria->order = "{$columns[$column]} {$order}";
     if (!empty($_REQUEST['search']['value'])) {
         $criteria->addSearchCondition("patient_name", $_REQUEST['search']['value'], 'true', 'OR');
         $criteria->addSearchCondition("service", $_REQUEST['search']['value'], 'true', 'OR');
         $criteria->addSearchCondition("time", $_REQUEST['search']['value'], 'true', 'OR');
         $criteria->addSearchCondition("status", $_REQUEST['search']['value'], 'true', 'OR');
         $where = true;
     }
     if (!empty(Yii::app()->session['provider_id'])) {
         $criteria->condition = "status >= 1 AND provider_id = " . Yii::app()->session['provider_id'];
     }
     $count = ResultMedlatec::model()->count($criteria);
     $criteria->limit = $length;
     $criteria->offset = $start;
     //  $criteria->condition = "provider_id = " . Yii::app()->session['provider_id'];
     $data = ResultMedlatec::model()->findAll($criteria);
     $returnArr = array();
     $service_name = null;
     $patient_name = null;
     foreach ($data as $item) {
         $order = OrderMedlatec::model()->findByPk($item->order_id);
         if ($order) {
             $service = ServiceMedlatec::model()->findByPk($order->service_id);
             if ($service) {
                 $service_name = $service->service_name;
             }
             $patient_name = $order->name;
         }
         $itemArr = array();
         $itemArr['id'] = $item->id;
         $itemArr['patient_name'] = $patient_name;
         $itemArr['service'] = $service_name;
         $itemArr['time'] = Date('d-m-Y', $item->time);
         $itemArr['status'] = Util::getStatusLabel($item->status);
         $itemArr['created_at'] = Date('d-m-Y', $item->created_at);
         if (empty(Yii::app()->session['provider_id'])) {
             $itemArr['provider_name'] = Provider::model()->getProviderName($item->provider_id);
         }
         $edit_url = Yii::app()->createUrl('result/edit', array('result_id' => $item->id));
         $order_url = Yii::app()->createUrl('result/order', array('oid' => $item->order_id));
         $action = '<a data-toggle="modal" href="' . $edit_url . '" data-target="#edit-order-modal" onclick="loadInfoResult(' . $item->id . ')"><span class="label label-primary">Sửa</span></a>';
         $action .= ' <a data-toggle="modal" href="' . $order_url . '" data-target="#edit-order-modal" onclick="loadInfo(' . $item->order_id . ')"><span class="label label-info">Xem order</span></a>';
         $itemArr['action'] = $action;
         $returnArr[] = $itemArr;
     }
     //$all  = ResultMedlatec::model()->findAll();
     echo json_encode(array('data' => $returnArr, "recordsTotal" => $count, "recordsFiltered" => count($data)));
 }
Example #21
0
 /**
  * Load the dictionary that match the prefered languages.
  *
  * @return array The associative array of dictionary
  * @throws CantLoadDictionaryException Thrown when there is no match between languages files and selected languages.
  */
 public function load()
 {
     $this->dictProvider->setLangsPath($this->path);
     $dict = $this->dictProvider->load($this->getAvailableLangs());
     if ($dict === null) {
         throw new CantLoadDictionaryException(CantLoadDictionaryException::NO_MATCHING_FILES);
     }
     return $dict;
 }
Example #22
0
	public function setUp() {
		parent::setUp();

		$fileName = 'testimage.jpg';
		$this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName);
		$this->width = 1680;
		$this->height = 1050;
		$this->provider = new \OC\Preview\JPEG();
	}
Example #23
0
	public function setUp() {
		parent::setUp();

		$fileName = 'testimage.eps';
		$this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName);
		$this->width = 2400;
		$this->height = 1707;
		$this->provider = new \OC\Preview\Postscript;
	}
 /**
  * @inheritdoc
  */
 public function convertFromSqlBoolean($value)
 {
     if (in_array(strtolower($value), $this->falseBooleanValues, true)) {
         return false;
     } elseif (in_array(strtolower($value), $this->trueBooleanValues, true)) {
         return true;
     }
     return parent::convertFromSqlBoolean($value);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     Sms::create(['provider_id' => '1', 'name' => 'auth_key']);
     Sms::create(['provider_id' => '1', 'name' => 'sender_id']);
     Sms::create(['provider_id' => '1', 'name' => 'route']);
     Provider::create(array('name' => 'Msg91.com'));
     // $this->call("OthersTableSeeder");
 }
Example #26
0
	public function setUp() {
		parent::setUp();

		$fileName = 'lorem-big.txt';
		$this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName);
		// Arbitrary width and length which won't be used to calculate the ratio
		$this->width = 500;
		$this->height = 200;
		$this->provider = new \OC\Preview\TXT;
	}
Example #27
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     if (!check_admin_auth()) {
         return Redirect::action('SessionsController@create');
     }
     $role = check_admin_auth();
     $companies = Company::get(['id', 'fancy_name']);
     $providers = Provider::get(['id', 'fancy_name']);
     return View::make('registrations.create', compact('role', 'providers', 'companies'));
 }
 /**
  *  Constructor, setting up name, file and parameters
  */
 function BYJG()
 {
     Provider::Provider();
     //call base class constructor
     $this->_name = 'ByJG';
     $this->_file = basename(__FILE__);
     $this->_params['username'] = "******";
     //default params
     $this->_params['password'] = "******";
     //default params
 }
Example #29
0
 public function importUsersAction()
 {
     exit;
     $f = fopen('/tmp/newusers.csv', 'r');
     $counter = 0;
     while (($data = fgetcsv($f)) !== FALSE) {
         if ($counter == 0) {
             $counter++;
             continue;
         }
         echo $data[4] . "<br />";
         $user = new User();
         $user->username = $data[0];
         $user->password = $data[1];
         //$user->passphrase = $data[2];
         $user->person->firstName = $data[3];
         $user->person->lastName = $data[4];
         $user->person->middleName = $data[5];
         $user->person->defaultIdentifier = $data[6];
         $user->person->defaultIdentifierType = $data[7];
         $user->persist();
         //$user->person->persist();
         if ($data[8] == "PROVIDER") {
             $provider = new Provider();
             $provider->personId = $user->person->personId;
             $provider->type = "MD";
             $provider->providerIdentifier = $data[6];
             $provider->providerIdentifierType = $data[7];
             $provider->persist();
         } elseif ($data[8] == "STAFF") {
             //
         } elseif ($data[8] == "ADMIN") {
             //
         }
         //echo $user->toString();
         echo $data[11] . "\n";
         $counter++;
     }
     fclose($f);
     exit;
 }
 public function newAction()
 {
     $colIndex = $this->_getParam('colIndex');
     $sessionFilters = $this->_calendarSession->filter;
     if (!isset($sessionFilters->columns[$colIndex])) {
         $msg = __('Cannot generate column with that index, there is no filter defined for that column Index: ') . $colIndex;
         throw new Exception($msg);
     }
     $column = $sessionFilters->columns[$colIndex];
     $providerId = (int) $column['providerId'];
     $this->view->providerId = $providerId;
     $headerText = '';
     if ($providerId > 0) {
         $provider = new Provider();
         $provider->setPersonId($providerId);
         $provider->populate();
         $headerText = $provider->displayName;
     }
     $roomId = 0;
     if (isset($column['roomId'])) {
         $roomId = $column['roomId'];
     }
     $this->view->roomId = $roomId;
     if ($roomId > 0) {
         $room = new Room();
         $room->id = $roomId;
         $room->populate();
         $headerText .= ' -> ' . $room->name;
     }
     if (isset($column['dateFilter'])) {
         $headerText .= " ({$column['dateFilter']})";
     }
     $this->view->headerText = $headerText;
     $templates = array('' => '');
     $templates['tpl1'] = 'Provider 1 Template';
     $templates['tpl2'] = 'Provider 2 Template';
     $templates['tpl3'] = 'Provider 3 Template';
     $this->view->templates = $templates;
     // $this->_calendarSession->filter; calendar filter
     $this->render('new');
 }