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


PHP PhoneNumber::autoFixNumber方法代码示例

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


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

示例1: _checkCurrentLocation

 protected function _checkCurrentLocation(Medication $medication)
 {
     $identity = Zend_Auth::getInstance()->getIdentity();
     $personId = (int) $identity->personId;
     $building = Building::getBuildingDefaultLocation($personId);
     $ret = false;
     if ($building->buildingId > 0) {
         $eprescriber = new EPrescriber();
         $eprescriber->populateWithBuildingProvider((int) $building->buildingId, $personId);
         $location = 'for location: ' . $building->practice->name . '->' . $building->name;
         $err = $medication->summary . ' could not be signed because: ';
         if (!strlen($eprescriber->SSID) > 0) {
             $ret = $err . 'Medication will be ePrescribed and you do not have an SPI ' . $location;
         } else {
             $tmp = array();
             $line1Len = strlen($building->line1);
             if (!$line1Len > 0 || $line1Len > 35) {
                 $tmp[] = 'Address line1 field must be supplied and not more than 35 characters';
             }
             $line2Len = strlen($building->line2);
             if ($line2Len > 0 && $line2Len > 35) {
                 $tmp[] = 'Address line2 must not be more than 35 characters';
             }
             $cityLen = strlen($building->city);
             if (!$cityLen > 0 || $cityLen > 35) {
                 $tmp[] = 'Address city field must be supplied and not more than 35 characters';
             }
             if (strlen($building->state) != 2) {
                 $tmp[] = 'Address state field must be supplied and not more than 2 characters';
             }
             $zipCodeLen = strlen($building->zipCode);
             if ($zipCodeLen != 5 && $zipCodeLen != 9) {
                 $tmp[] = 'Address zipcode must be supplied and must be 5 or 9 digit long';
             }
             $phoneNumber = PhoneNumber::autoFixNumber($building->phoneNumber);
             $fax = PhoneNumber::autoFixNumber($building->fax);
             if (strlen($phoneNumber) < 11) {
                 $tmp[] = 'Phone number \'' . $phoneNumber . '\' is invalid';
             }
             $faxLen = strlen($fax);
             if ($faxLen > 0 && $faxLen < 11) {
                 $tmp[] = 'Fax number \'' . $fax . '\' is invalid';
             }
             if (count($tmp) > 0) {
                 $ret = $err . "\n" . implode("\n", $tmp) . ' ' . $location;
             }
         }
     } else {
         $ret = $medication->summary . ' could not be signed because: Medication will be ePrescribed and you do not have a default location.';
     }
     return $ret;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:52,代码来源:ESignController.php

示例2: getPhoneNumbers

 public function getPhoneNumbers()
 {
     $ret = array();
     $phoneNumber = PhoneNumber::autoFixNumber($this->phone_number);
     // TE
     $ret[] = array('number' => $phoneNumber, 'type' => 'TE');
     $fax = PhoneNumber::autoFixNumber($this->fax);
     // FX
     if (strlen($fax) > 0) {
         $ret[] = array('number' => $fax, 'type' => 'FX');
     }
     return $ret;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:13,代码来源:Building.php

示例3: _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

示例4: generateORC

 public static function generateORC($provider)
 {
     // test#5 does not have this segment
     if (!$provider instanceof Provider) {
         $providerId = (int) $provider;
         $provider = new Provider();
         $provider->personId = (int) $providerId;
         $provider->populate();
     }
     $building = Building::getBuildingDefaultLocation($provider->personId);
     //$practice = self::$providerBuilding->practice;
     $practice = $building->practice;
     $practiceAddr = $practice->primaryAddress;
     if (!$practiceAddr->addressId > 0) {
         $practiceAddr = $practice->secondaryAddress;
     }
     $practicePhone = $practice->mainPhone;
     if (!$practicePhone->numberId > 0) {
         $practicePhone = $practice->secondaryPhone;
     }
     $phone = PhoneNumber::autoFixNumber($practicePhone->number);
     if (substr($phone, 0, 1) == 1) {
         $phone = substr($phone, 1);
     }
     $areaCode = substr($phone, 0, 3);
     $localNumber = substr($phone, 3);
     $addr = new Address();
     foreach ($addr->getIteratorByPersonId($provider->personId) as $providerAddr) {
         break;
     }
     if (!isset($providerAddr)) {
         $providerAddr = new Address();
     }
     $orc = 'ORC|RE|||||||||||';
     if ($provider->personId > 0) {
         $providerId = strlen($provider->identifier) > 0 ? $provider->identifier : $provider->personId;
         $orc .= $providerId . '^' . $provider->person->lastName . '^' . $provider->person->firstName . '^^^^^^' . $building->name . '&2.16.840.1.113883.19.4.6&ISO';
     }
     $orc .= '|||||||||' . $practice->name . '^L^^^^' . $building->name . '&2.16.840.1.113883.19.4.6&ISO^XX^^^' . $practice->identifier . '|' . $practiceAddr->line1 . '^^' . $practiceAddr->city . '^' . $practiceAddr->state . '^' . $practiceAddr->zipCode . '^^B|^^^^^' . $areaCode . '^' . $localNumber;
     if ($providerAddr->addressId > 0) {
         $orc .= '|' . $providerAddr->line1 . '^^' . $providerAddr->city . '^' . $providerAddr->state . '^' . $providerAddr->zipCode . '^^B';
     }
     return $orc;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:44,代码来源:LabResultsMessage.php

示例5: _generate4010A1


//.........这里部分代码省略.........
     $provider = $providers[$providerId];
     $billAs = (int) $provider->billAs;
     if ($billAs > 0) {
         $providerId = $billAs;
         if (!isset($providers[$providerId])) {
             $provider = new Provider();
             $provider->personId = $providerId;
             $provider->populate();
             $providers[$providerId] = $provider;
         }
         $provider = $providers[$providerId];
     }
     $subscribers = array();
     $enumeration = new Enumeration();
     $enumeration->populateByUniqueName(InsuranceProgram::INSURANCE_ENUM_NAME);
     $enumerationClosure = new EnumerationClosure();
     foreach ($enumerationClosure->getAllDescendants($enumeration->enumerationId, 1, true) as $enum) {
         $rowset = $enumerationClosure->getAllDescendants($enum->enumerationId, 1, true);
         if ($enum->key == InsuranceProgram::INSURANCE_SUBSCRIBER_ENUM_KEY) {
             foreach ($rowset as $row) {
                 $subscribers[$row->key] = $row->name;
             }
             break;
         }
     }
     $insuredRelationship = new InsuredRelationship();
     $db = Zend_Registry::get('dbAdapter');
     $sqlSelect = $db->select()->from($insuredRelationship->_table)->where('insurance_program_id = ?', (int) $insuranceProgram->insuranceProgramId)->where('person_id = ?', (int) $patientId)->where('active = 1')->order('program_order')->limit(1);
     if ($row = $db->fetchRow($sqlSelect)) {
         $insuredRelationship->populateWithArray($row);
     }
     $subs = $insuredRelationship->subscriber;
     $subscriberAddr = $subs->address;
     $relationship = null;
     $relationshipCode = $insuredRelationship->subscriberToPatientRelationship;
     if (isset($subscribers[$relationshipCode])) {
         $relationship = $subscribers[$relationshipCode];
     }
     if ($relationship === null) {
         $relationship = 'Self';
         $relationshipCode = 18;
         $subs = new Person();
         $subs->personId = $insuredRelationship->personId;
         $subs->populate();
     }
     $subscriber = array('id' => (int) $subs->personId, 'relationship_code' => $relationshipCode, 'group_number' => $insuredRelationship->groupNumber, 'group_name' => $insuredRelationship->groupName, 'relationship' => $relationship, 'last_name' => $subs->lastName, 'first_name' => $subs->firstName, 'middle_name' => $subs->middleName, 'address' => array('line1' => $subscriberAddr->line1, 'line2' => $subscriberAddr->line2, 'city' => $subscriberAddr->city, 'state' => $subscriberAddr->state, 'zip' => $subscriberAddr->zipCode), 'date_of_birth' => date('Ymd', strtotime($subs->dateOfBirth)), 'gender' => $subs->gender, 'contract_type_code' => '', 'contract_amount' => '', 'contract_percent' => '', 'contract_code' => '', 'contract_discount_percent' => '', 'contract_version' => '');
     $practiceAddr = $practice->primaryAddress;
     $room = new Room();
     $room->roomId = (int) $visit->roomId;
     $room->populate();
     $facility = $room->building;
     $phoneNumber = PhoneNumber::autoFixNumber($practice->mainPhone->number);
     $phoneLen = strlen($phoneNumber);
     if ($phoneLen < 10) {
         $phoneNumber = str_pad($phoneNumber, 10, '0', STR_PAD_LEFT);
     } else {
         if ($phoneLen > 10) {
             $phoneNumber = substr($phoneNumber, -10);
         }
     }
     $identifierType = '';
     $identifier = $practice->identifier;
     if (strlen($identifier) > 0) {
         $identifierType = 'XX';
     }
     //24';
     $data = array('hlCount' => ++$ctr);
     $data['practice'] = array('name' => $practice->name, 'identifier_type' => $identifierType, 'identifier' => $identifier, 'address' => array('line1' => $practiceAddr->line1, 'line2' => $practiceAddr->line2, 'city' => $practiceAddr->city, 'state' => $practiceAddr->state, 'zip' => $practiceAddr->zipCode), 'phoneNumber' => $phoneNumber);
     $data['treating_facility'] = array('identifier' => $facility->identifier);
     $dateOfTreatment = date('Ymd', strtotime($visit->dateOfTreatment));
     $payer2Id = $insuranceProgram->insuranceProgramId;
     if (strlen($payer2Id) < 2) {
         $payer2Id = str_pad($payer2Id, 2, '0', STR_PAD_LEFT);
     }
     $identifierType = '';
     $identifier = $provider->person->identifier;
     if (strlen($identifier) > 0) {
         $identifierType = 'XX';
     }
     //34';
     $claimData = array('claim' => $claim, 'patient' => array('date_of_initial_treatment' => $dateOfTreatment, 'date_of_onset' => $dateOfTreatment, 'comment_type' => '', 'comment' => ''), 'treating_facility' => array('facility_code' => $facility->facilityCodeId, 'name' => $facility->name, 'address' => array('line1' => $facility->line1, 'line2' => $facility->line2, 'city' => $facility->city, 'state' => $facility->state, 'zip' => $facility->zipCode)), 'provider' => array('signature_on_file' => 'Y', 'accepts_assignment' => 'A', 'last_name' => $provider->person->lastName, 'first_name' => $provider->person->firstName, 'identifier_type' => $identifierType, 'identifier' => $identifier, 'identifier_2' => ''), 'billing_facility' => array('clia_number' => ''), 'subscriber' => $subscriber, 'clearing_house' => array('credit_max_amount' => '', 'repricing_method' => '', 'allowed_amount' => '', 'savings_amount' => '', 'identifier' => '', 'rate' => '', 'apg_code' => '', 'apg_amount' => '', 'reject_code' => '', 'compliance_code' => '', 'exception_code' => ''), 'referring_provider' => array('last_name' => '', 'first_name' => '', 'referral_type' => '', 'identifier_type' => '', 'identifier' => '', 'taxonomy_code' => ''), 'supervising_provider' => array('last_name' => '', 'first_name' => '', 'identifier_type' => '', 'identifier' => ''), 'payer2' => array('id' => $payer2Id, 'name' => $insuranceProgram->name));
     $clm = array();
     $iterator = new ClaimLineIterator();
     $iterator->setFilters(array('claimId' => $claimId));
     foreach ($iterator as $row) {
         $baseFee = (double) $row->baseFee;
         $adjustedFee = (double) $row->adjustedFee;
         $paid = (double) $row->paid;
         $billed = $row->totalMiscCharge;
         if ($baseFee > 0) {
             $billed += $baseFee - $adjustedFee;
         }
         $balance = abs($billed) - $paid;
         $clm[] = array('claim' => $claimData['claim'], 'patient' => $claimData['patient'], 'claim_line' => array('amount' => $balance, 'diagnosis1' => preg_replace('/[\\.]/', '', $row->diagnosisCode1), 'diagnosis2' => preg_replace('/[\\.]/', '', $row->diagnosisCode2), 'diagnosis3' => preg_replace('/[\\.]/', '', $row->diagnosisCode3), 'diagnosis4' => preg_replace('/[\\.]/', '', $row->diagnosisCode4), 'diagnosis5' => preg_replace('/[\\.]/', '', $row->diagnosisCode5), 'diagnosis6' => preg_replace('/[\\.]/', '', $row->diagnosisCode6), 'diagnosis7' => preg_replace('/[\\.]/', '', $row->diagnosisCode7), 'diagnosis8' => preg_replace('/[\\.]/', '', $row->diagnosisCode8), 'procedure' => $row->procedureCode, 'modifier1' => $row->modifier1, 'modifier2' => $row->modifier2, 'modifier3' => $row->modifier3, 'modifier4' => $row->modifier4, 'units' => str_replace('.00', '', $row->units), 'date_of_treatment' => $dateOfTreatment, 'clia_number' => ''), 'treating_facility' => $claimData['treating_facility'], 'provider' => $claimData['provider'], 'billing_facility' => $claimData['billing_facility'], 'subscriber' => $subscriber, 'clearing_house' => $claimData['clearing_house'], 'referring_provider' => $claimData['referring_provider'], 'supervising_provider' => $claimData['supervising_provider'], 'payer2' => $claimData['payer2']);
     }
     $hl2 = array();
     $hl2[] = array('hlCount' => $ctr, 'hlCount2' => ++$ctr, 'payer' => array('responsibility' => 'P'), 'subscriber' => $subscriber, 'patient' => array('weight' => '', 'last_name' => $patient->lastName, 'first_name' => $patient->firstName), 'responsible_party' => array('last_name' => '', 'first_name' => '', 'address' => array('line1' => '', 'line2' => '', 'city' => '', 'state' => '', 'zip' => '')), 'CLM' => $clm);
     $data['HL2'] = $hl2;
     return $data;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:101,代码来源:Claim.php


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