本文整理汇总了PHP中PhoneNumber::listPhoneNumbers方法的典型用法代码示例。如果您正苦于以下问题:PHP PhoneNumber::listPhoneNumbers方法的具体用法?PHP PhoneNumber::listPhoneNumbers怎么用?PHP PhoneNumber::listPhoneNumbers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhoneNumber
的用法示例。
在下文中一共展示了PhoneNumber::listPhoneNumbers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populateXML
public function populateXML(SimpleXMLElement $xml = null, $checked = true)
{
if ($xml === null) {
$xml = new SimpleXMLElement('<data/>');
}
$personId = (int) $this->person_id;
$person = $this->person;
$picture = '';
if ($person->activePhoto > 0) {
$attachment = new Attachment();
$attachment->attachmentId = (int) $person->activePhoto;
$attachment->populate();
$picture = base64_encode($attachment->rawData);
}
$xmlPatient = $xml->addChild('patient');
$xmlPerson = $xmlPatient->addChild('person');
$this->_addChild($xmlPerson, 'picture', $picture, $checked);
$this->_addChild($xmlPerson, 'lastName', $person->lastName, $checked);
$this->_addChild($xmlPerson, 'firstName', $person->firstName, $checked);
$this->_addChild($xmlPerson, 'middleName', $person->middleName, $checked);
$identifier = '';
if ($person->identifierType == 'SSN') {
$identifier = $person->identifier;
}
$this->_addChild($xmlPerson, 'identifier', $identifier, $checked);
$this->_addChild($xmlPerson, 'gender', $person->gender, $checked);
$dateOfBirth = explode(' ', date('m d Y', strtotime($person->dateOfBirth)));
$this->_addChild($xmlPerson, 'dobMonth', $dateOfBirth[0], $checked);
$this->_addChild($xmlPerson, 'dobDay', $dateOfBirth[1], $checked);
$this->_addChild($xmlPerson, 'dobYear', $dateOfBirth[2], $checked);
$statistics = PatientStatisticsDefinition::getPatientStatistics($personId);
$race = '';
if (isset($statistics['Race'])) {
$race = $statistics['Race'];
} else {
if (isset($statistics['race'])) {
$race = $statistics['race'];
}
}
$this->_addChild($xmlPerson, 'race', $race, $checked);
$maritalStatus = $person->maritalStatus ? $person->maritalStatus : 'Other';
$this->_addChild($xmlPerson, 'maritalStatus', $maritalStatus, $checked);
$addresses = Address::listAddresses($personId);
foreach ($addresses as $address) {
switch ($address->type) {
case Address::TYPE_MAIN:
$type = 'mainAddress';
break;
case Address::TYPE_SEC:
$type = 'secondaryAddress';
break;
case Address::TYPE_HOME:
$type = 'homeAddress';
break;
case Address::TYPE_EMPLOYER:
$type = 'employerAddress';
break;
case Address::TYPE_BILLING:
$type = 'billingAddress';
break;
case Address::TYPE_OTHER:
default:
$type = 'otherAddress';
break;
}
$xmlAddress = $xmlPatient->addChild($type);
$this->_addChild($xmlAddress, 'line1', $address->line1, $checked);
$this->_addChild($xmlAddress, 'city', $address->city, $checked);
$this->_addChild($xmlAddress, 'state', $address->state, $checked);
$this->_addChild($xmlAddress, 'zip', $address->postalCode, $checked);
}
$phoneNumbers = PhoneNumber::listPhoneNumbers($personId);
foreach ($phoneNumbers as $phoneNumber) {
switch ($phoneNumber->type) {
case PhoneNumber::TYPE_HOME:
$type = 'homePhone';
break;
case PhoneNumber::TYPE_WORK:
$type = 'workPhone';
break;
case PhoneNumber::TYPE_BILLING:
$type = 'billingPhone';
break;
case PhoneNumber::TYPE_EMPLOYER:
$type = 'employerPhone';
break;
case PhoneNumber::TYPE_MOBILE:
$type = 'mobilePhone';
break;
case PhoneNumber::TYPE_EMERGENCY:
$type = 'emergencyPhone';
break;
case PhoneNumber::TYPE_FAX:
$type = 'faxPhone';
break;
case PhoneNumber::TYPE_HOME_EVE:
$type = 'homeEvePhone';
break;
case PhoneNumber::TYPE_HOME_DAY:
$type = 'homeDayPhone';
//.........这里部分代码省略.........
示例2: defaultPatientHeaderAction
public function defaultPatientHeaderAction()
{
$personId = (int) $this->_getParam('personId');
// e76f18cd-d388-4c53-b940-53cb81b80c5e
$referenceId = $this->_getParam('referenceId');
$data = $this->_getAttachmentData($referenceId);
$patient = new Patient();
$patient->personId = $personId;
$patient->populate();
$person = $patient->person;
$picture = '';
if ($person->activePhoto > 0) {
$attachment = new Attachment();
$attachment->attachmentId = (int) $person->activePhoto;
$attachment->populate();
$picture = base64_encode($attachment->rawData);
}
$xml = new SimpleXMLElement('<patientHeader/>');
$xmlPatient = $xml->addChild('patient');
$this->_addChild($xmlPatient, 'picture', $picture);
$this->_addChild($xmlPatient, 'lastName', $person->lastName);
$this->_addChild($xmlPatient, 'firstName', $person->firstName);
$this->_addChild($xmlPatient, 'dateOfBirth', $person->dateOfBirth);
$this->_addChild($xmlPatient, 'gender', $person->gender);
$statistics = PatientStatisticsDefinition::getPatientStatistics($personId);
$race = '';
if (isset($statistics['Race'])) {
$race = $statistics['Race'];
} else {
if (isset($statistics['race'])) {
$race = $statistics['race'];
}
}
$this->_addChild($xmlPatient, 'race', $race);
$this->_addChild($xmlPatient, 'maritalStatus', $person->displayMaritalStatus);
$addresses = Address::listAddresses($personId);
$phoneNumbers = PhoneNumber::listPhoneNumbers($personId);
$address = null;
if (isset($addresses[Address::TYPE_BILLING])) {
$address = $addresses[Address::TYPE_BILLING];
} else {
if (isset($addresses[Address::TYPE_HOME])) {
$address = $addresses[Address::TYPE_HOME];
} else {
if (isset($addresses[Address::TYPE_MAIN])) {
$address = $addresses[Address::TYPE_MAIN];
} else {
if (isset($addresses[Address::TYPE_SEC])) {
$address = $addresses[Address::TYPE_SEC];
} else {
if (isset($addresses[Address::TYPE_OTHER])) {
$address = $addresses[Address::TYPE_OTHER];
}
}
}
}
}
if ($address !== null) {
$phone = '';
if (isset($phoneNumbers[PhoneNumber::TYPE_BILLING])) {
$phone = $phoneNumbers[PhoneNumber::TYPE_BILLING]->number;
} else {
if (isset($phoneNumbers[PhoneNumber::TYPE_HOME])) {
$phone = $phoneNumbers[PhoneNumber::TYPE_HOME]->number;
} else {
if (isset($phoneNumbers[PhoneNumber::TYPE_WORK])) {
$phone = $phoneNumbers[PhoneNumber::TYPE_WORK]->number;
} else {
if (isset($phoneNumbers[PhoneNumber::TYPE_HOME_DAY])) {
$phone = $phoneNumbers[PhoneNumber::TYPE_HOME_DAY]->number;
} else {
if (isset($phoneNumbers[PhoneNumber::TYPE_HOME_EVE])) {
$phone = $phoneNumbers[PhoneNumber::TYPE_HOME_EVE]->number;
} else {
if (isset($phoneNumbers[PhoneNumber::TYPE_MOBILE])) {
$phone = $phoneNumbers[PhoneNumber::TYPE_MOBILE]->number;
} else {
if (isset($phoneNumbers[PhoneNumber::TYPE_BEEPER])) {
$phone = $phoneNumbers[PhoneNumber::TYPE_BEEPER]->number;
}
}
}
}
}
}
}
$this->_addChild($xmlPatient, 'billingLine1', $address->line1);
$this->_addChild($xmlPatient, 'billingCity', $address->city);
$this->_addChild($xmlPatient, 'billingState', $address->state);
$this->_addChild($xmlPatient, 'billingZip', $address->postalCode);
$this->_addChild($xmlPatient, 'phoneNumber', $phone);
}
if ($person->primaryPracticeId > 0) {
$practice = new Practice();
$practice->practiceId = (int) $person->primaryPracticeId;
$practice->populate();
$address = $practice->primaryAddress;
$xmlPractice = $xml->addChild('practice');
$this->_addChild($xmlPractice, 'name', $practice->name);
$this->_addChild($xmlPractice, 'primaryLine1', $address->line1);
//.........这里部分代码省略.........