当前位置: 首页>>代码示例>>PHP>>正文


PHP Provider::persist方法代码示例

本文整理汇总了PHP中Provider::persist方法的典型用法代码示例。如果您正苦于以下问题:PHP Provider::persist方法的具体用法?PHP Provider::persist怎么用?PHP Provider::persist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Provider的用法示例。


在下文中一共展示了Provider::persist方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: importUsersAction

 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;
 }
开发者ID:psoas,项目名称:ch3-dev-preview,代码行数:41,代码来源:IndexController.php

示例2: generateTestSsDemoDataAction

 public function generateTestSsDemoDataAction()
 {
     $basePath = Zend_Registry::get('basePath');
     $xmlFile = $basePath . 'xml/ss-demo-data.xml';
     $xml = new SimpleXMLElement(file_get_contents($xmlFile));
     foreach ($xml as $key => $value) {
         switch ($key) {
             case 'prescriber':
                 $person = new Person();
                 $person->active = 1;
                 $person->lastName = (string) $value->PrescriberLastName;
                 $person->firstName = (string) $value->PrescriberFirstName;
                 $person->middleName = (string) $value->PrescriberMiddleName;
                 $person->suffix = (string) $value->PrescriberNameSuffix;
                 //$person->initials = (string)$value->PrescriberNamePrefix;
                 $provider = new Provider();
                 $provider->person = $person;
                 $provider->sureScriptsSPI = (string) $value->SPI;
                 $provider->deaNumber = (string) $value->DEANumber;
                 $provider->stateLicenseNumber = (string) $value->StateLicenseNumber;
                 $provider->persist();
                 //ProviderSpecialty, ClinicName
                 $phone = new PhoneNumber();
                 $phone->personId = $provider->personId;
                 $phone->name = 'Primary';
                 $phone->type = 4;
                 $phone->number = str_replace('-', '', (string) $value->PrescriberPhone);
                 $phone->persist();
                 $address = new Address();
                 $address->personId = $provider->personId;
                 $address->name = 'Main';
                 $address->type = 4;
                 $address->active = 1;
                 $address->line1 = (string) $value->ClinicAddressLine1;
                 $address->line2 = (string) $value->ClinicAddressLine2;
                 $address->city = (string) $value->ClinicCity;
                 $address->state = (string) $value->ClinicState;
                 $address->postalCode = (string) $value->ClinicZip;
                 $address->persist();
                 break;
             case 'pharmacy':
                 $pharmacy = new Pharmacy();
                 $pharmacy->NCPDPID = (string) $value->NCPDPID;
                 /*$pharmacy-> = (string)$value->ReferenceQualifier;
                 		$pharmacy-> = (string)$value->PharmacistLastName;
                 		$pharmacy-> = (string)$value->PharmacistFirstName;
                 		$pharmacy-> = (string)$value->PharmacistMiddleName;
                 		$pharmacy-> = (string)$value->PharmacistNamePrefix;
                 		$pharmacy-> = (string)$value->PharmacistNameSuffix;*/
                 $pharmacy->StoreName = (string) $value->PharmacyName;
                 $pharmacy->AddressLine1 = (string) $value->PharmacyAddressLine1;
                 $pharmacy->City = (string) $value->PharmacyCity;
                 $pharmacy->State = (string) $value->PharmacyState;
                 $pharmacy->Zip = (string) $value->PharmacyZip;
                 $pharmacy->PhonePrimary = (string) $value->PharmacyPhone;
                 $pharmacy->persist();
                 break;
             case 'patient':
                 $person = new Person();
                 $person->active = 1;
                 $person->lastName = (string) $value->PatientLastName;
                 $person->firstName = (string) $value->PatientFirstName;
                 $person->middleName = (string) $value->PatientMiddleName;
                 //$person->initials = (string)$value->PatientNamePrefix;
                 $person->identifier = (string) $value->PatientSS;
                 $address = new Address();
                 $address->name = 'Main';
                 $address->type = 4;
                 $address->active = 1;
                 $address->line1 = (string) $value->PatientAddressLine1;
                 $address->line2 = (string) $value->PatientAddressLine2;
                 $address->city = (string) $value->PatientCity;
                 $address->state = (string) $value->PatientState;
                 $address->postalCode = (string) $value->PatientZip;
                 $patient = new Patient();
                 $patient->person = $person;
                 $patient->homeAddress = $address;
                 $patient->persist();
                 $phone = new PhoneNumber();
                 $phone->personId = $patient->personId;
                 $phone->name = 'Primary';
                 $phone->type = 4;
                 $phone->number = str_replace('-', '', (string) $value->PatientPhone);
                 $phone->persist();
                 break;
             case 'medication':
                 break;
         }
     }
     echo 'Done';
     die;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:92,代码来源:TestDataController.php

示例3: addProcessAction


//.........这里部分代码省略.........
     $data['phones'] = $phoneNumber->phoneNumbers;
     /*$phoneNumbers = $phoneNumber->phoneNumbers;
     		$fax = '';
     		if (isset($phoneNumbers['FAX'])) {
     			$fax = $phoneNumbers['FAX'];
     			unset($phoneNumbers['FAX']);
     		}
     		$phone = $fax;
     		if (count($phoneNumbers) > 0) {
     			$phone = array_pop($phoneNumbers);
     		}
     		$data['phoneNumber'] = $phone;
     		$data['faxNumber'] = $fax;*/
     $data['specialtyCode'] = $provider->specialty;
     $specialtyQualifier = '';
     if (strlen($provider->specialty) > 0) {
         $specialtyQualifier = 'AM';
     }
     $data['specialtyQualifier'] = $specialtyQualifier;
     $data['serviceLevel'] = $provider->serviceLevel;
     $now = strtotime('now');
     $days30 = strtotime('+30 days', $now);
     $activeStartTime = gmdate("Y-m-d\\TH:i:s.0", $now) . 'Z';
     $activeEndTime = gmdate("Y-m-d\\TH:i:s.0", $days30) . 'Z';
     $data['activeStartTime'] = $provider->dateActiveStartZ;
     $data['activeEndTime'] = $provider->dateActiveEndZ;
     $dateActiveEnd = strtotime(date('Y-m-d', strtotime($provider->dateActiveEndZ)));
     if ($dateActiveEnd <= strtotime(date('Y-m-d'))) {
         // to disable a prescriber ActiveEndTime must be set to current date and ServiceLevel must be set to zero.
         $data['activeEndTime'] = date('Y-m-d');
         $data['serviceLevel'] = 0;
         $provider->serviceLevel = 0;
     }
     $provider->persist();
     $identifierType = $provider->identifierType;
     if (strlen($identifierType) > 0) {
         $data[$identifierType] = $provider->identifier;
     }
     /*
     		foreach ($data as $k=>$v) {
     			if (!strlen(trim($v)) > 0) {
     				$tmp = ' ';
     				if ($k == 'addressState') {
     					$tmp = 'AZ';
     				}
     				if ($k == 'addressZipCode') {
     					$tmp = '12345';
     				}
     				$data[$k] = $tmp;
     			}
     		}*/
     $messaging = new Messaging();
     //$messaging->messagingId = '';
     $type = 'add';
     $messaging->messageType = 'AddPrescriber';
     if (strlen($provider->sureScriptsSPI) > 0) {
         $messaging->messageType = 'UpdatePrescriber';
         $data['SPI'] = $provider->sureScriptsSPI;
         $type = 'update';
     }
     $messaging->populate();
     //$messaging->objectId = '';
     //$messaging->objectClass = '';
     $messaging->status = 'Sending';
     $messaging->note = 'Sending prescriber data';
     $messaging->dateStatus = date('Y-m-d H:i:s');
开发者ID:dragonlet,项目名称:clearhealth,代码行数:67,代码来源:AdminEprescribeController.php

示例4: _syncLocation

 protected function _syncLocation(EPrescriber $ePrescriber)
 {
     $ret = true;
     $dateActiveStart = strtotime($ePrescriber->dateActiveStart);
     $dateActiveEnd = strtotime($ePrescriber->dateActiveEnd);
     $serviceLevel = (int) $ePrescriber->serviceLevel;
     $personId = (int) $ePrescriber->providerId;
     $provider = new Provider();
     $provider->personId = $personId;
     $provider->populate();
     $provider->serviceLevel = $serviceLevel;
     if ($dateActiveStart > 0 && $dateActiveEnd > 0) {
         $provider->dateActiveStart = date('Y-m-d H:i:s', $dateActiveStart);
         $provider->dateActiveEnd = date('Y-m-d H:i:s', $dateActiveEnd);
     }
     $person = new Person();
     $person->personId = $personId;
     $person->populate();
     $practice = new Practice();
     $practice->practiceId = $person->primaryPracticeId;
     $practice->populate();
     $data = array();
     $data['deaNumber'] = $provider->deaNumber;
     $data['stateLicenseNumber'] = $provider->stateLicenseNumber;
     //$data['portalId'] = Zend_Registry::get('config')->sureScripts->portalId;
     //$data['accountId'] = Zend_Registry::get('config')->sureScripts->accountId;
     $data['clinicName'] = '' . $practice->name;
     $data['lastName'] = $person->lastName;
     $data['firstName'] = $person->firstName;
     $address = $ePrescriber->building;
     $data['addressLine1'] = $address->line1;
     $data['addressLine2'] = $address->line2;
     $data['addressCity'] = $address->city;
     $data['addressState'] = $address->state;
     $data['addressZipCode'] = $address->zipCode;
     $data['email'] = $person->email;
     $data['phones'] = array(array('number' => PhoneNumber::autoFixNumber($address->phoneNumber), 'type' => 'TE'), array('number' => PhoneNumber::autoFixNumber($address->fax), 'type' => 'FX'));
     $data['specialtyCode'] = $provider->specialty;
     $specialtyQualifier = '';
     if (strlen($provider->specialty) > 0) {
         $specialtyQualifier = 'AM';
     }
     $data['specialtyQualifier'] = $specialtyQualifier;
     $data['serviceLevel'] = $provider->serviceLevel;
     $now = strtotime('now');
     $days30 = strtotime('+30 days', $now);
     $activeStartTime = gmdate("Y-m-d\\TH:i:s.0", $now) . 'Z';
     $activeEndTime = gmdate("Y-m-d\\TH:i:s.0", $days30) . 'Z';
     $data['activeStartTime'] = $provider->dateActiveStartZ;
     $data['activeEndTime'] = $provider->dateActiveEndZ;
     $dateActiveEnd = strtotime(date('Y-m-d', strtotime($provider->dateActiveEndZ)));
     if ($dateActiveEnd <= strtotime(date('Y-m-d'))) {
         // to disable a prescriber ActiveEndTime must be set to current date and ServiceLevel must be set to zero.
         $data['activeEndTime'] = date('Y-m-d');
         $data['serviceLevel'] = 0;
         $provider->serviceLevel = 0;
     }
     $provider->persist();
     $identifierType = $provider->identifierType;
     if (strlen($identifierType) > 0) {
         $data[$identifierType] = $provider->identifier;
     }
     $messaging = new Messaging();
     //$messaging->messagingId = '';
     $type = 'add';
     $messaging->messageType = 'AddPrescriber';
     if (strlen($ePrescriber->SSID) > 0) {
         $messaging->messageType = 'UpdatePrescriber';
         $data['SPI'] = $ePrescriber->SSID;
         $type = 'update';
     } else {
         if (strlen($provider->sureScriptsSPI) > 0) {
             $messaging->messageType = 'AddPrescriberLocation';
             $data['SPI'] = substr($provider->sureScriptsSPI, 0, -3);
             $type = 'addLocation';
         }
     }
     // backupPortalId must be supplied if type is updateLocation
     $messaging->populate();
     //$messaging->objectId = '';
     //$messaging->objectClass = '';
     $messaging->status = 'Sending';
     $messaging->note = 'Sending prescriber data';
     $messaging->dateStatus = date('Y-m-d H:i:s');
     //$messaging->auditId = '';
     $messaging->persist();
     $query = http_build_query(array('type' => $type, 'data' => $data));
     $ch = curl_init();
     $ePrescribeURL = Zend_Registry::get('config')->healthcloud->URL;
     $ePrescribeURL .= 'ss-manager.raw/edit-prescriber?apiKey=' . Zend_Registry::get('config')->healthcloud->apiKey;
     curl_setopt($ch, CURLOPT_URL, $ePrescribeURL);
     curl_setopt($ch, CURLOPT_POST, true);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     $output = curl_exec($ch);
     trigger_error('OUTPUT: ' . $output, E_USER_NOTICE);
     $error = "";
//.........这里部分代码省略.........
开发者ID:dragonlet,项目名称:clearhealth,代码行数:101,代码来源:AdminUsersController.php

示例5: generateTestDataAction

 public function generateTestDataAction()
 {
     // Patient Test Data
     $person = new Person();
     $person->lastName = 'Test';
     $person->firstName = 'One';
     $person->persist();
     $patient = new Patient();
     $patient->personId = $person->personId;
     $patient->person = $person;
     $patient->persist();
     // Provider Test Data
     $person = new Person();
     $person->lastName = 'Provider';
     $person->firstName = 'ClearHealth';
     $person->persist();
     $provider = new Provider();
     $provider->personId = $person->personId;
     $provider->person = $person;
     $provider->persist();
     // set provider as user
     $user = new User();
     $user->username = 'provider';
     $user->password = 'provider';
     $user->person = $person;
     $user->persist();
     echo 'Done.';
     die;
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:29,代码来源:MainController.php


注:本文中的Provider::persist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。