本文整理汇总了PHP中PhoneNumber::populateWithSql方法的典型用法代码示例。如果您正苦于以下问题:PHP PhoneNumber::populateWithSql方法的具体用法?PHP PhoneNumber::populateWithSql怎么用?PHP PhoneNumber::populateWithSql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhoneNumber
的用法示例。
在下文中一共展示了PhoneNumber::populateWithSql方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: patient
public static function patient($personId)
{
$newPatient = true;
$db = Zend_Registry::get('dbAdapter');
$sqlSelect = $db->select()->from('audits', 'COUNT(*) AS ctr')->where("objectClass = 'Patient' AND objectId = ?", (int) $personId);
if (($row = $db->fetchRow($sqlSelect)) && $row['ctr'] > 1) {
$newPatient = false;
}
$data = self::_getPatientData($personId);
$subscribersEnum = 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) {
continue;
}
foreach ($rowset as $row) {
$subscribersEnum[$row->key] = $row->name;
}
}
$insuredRelationship = new InsuredRelationship();
$sqlSelect = $db->select()->from($insuredRelationship->_table)->where('person_id = ?', $personId)->where('active = 1')->order('program_order');
$insuredRelationshipIterator = $insuredRelationship->getIterator($sqlSelect);
$subscribers = array();
$insurances = array();
$guarantors = array();
foreach ($insuredRelationshipIterator as $item) {
$subscriberId = (int) $item->subscriberId;
$subscriberToPatientRelationship = $item->subscriberToPatientRelationship;
if (!$subscriberId > 0) {
$subscriberId = $personId;
$subscriberToPatientRelationship = 'SELF';
}
if (isset($subscribersEnum[$subscriberToPatientRelationship])) {
$subscriberToPatientRelationship = $subscribersEnum[$subscriberToPatientRelationship];
}
if (!isset($subscribers[$subscriberId])) {
$patient = new Patient();
$patient->personId = $subscriberId;
$patient->populate();
$subscribers[$subscriberId] = $patient;
}
$subscriber = self::_getPatientData($subscribers[$subscriberId], false);
$subscriber['relation'] = strtoupper(substr($subscriberToPatientRelationship, 0, 1));
$insuranceProgram = $item->insuranceProgram;
$companyId = (int) $insuranceProgram->companyId;
$phoneNumber = new PhoneNumber();
$sqlSelect = $db->select()->from(array('cn' => 'company_number'))->join(array('n' => 'number'), 'n.number_id = cn.number_id')->where('n.active = 1')->where('cn.company_id = ?', $companyId)->order('n.displayOrder')->limit(1);
$phoneNumber->populateWithSql($sqlSelect->__toString());
$insurance = array();
$insurance['companyId'] = $companyId;
$insurance['companyName'] = $insuranceProgram->company->name;
$address = $insuranceProgram->address;
$insurance['line1'] = $address->line1;
$insurance['line2'] = $address->line2;
$insurance['city'] = $address->city;
$insurance['state'] = $address->state;
$insurance['zip'] = $address->postalCode;
$insurance['phoneNumber'] = $phoneNumber->number;
$insurance['groupNumber'] = $item->groupName;
$insurance['groupName'] = '';
$insurance['policyNumber'] = $item->groupNumber;
//$insurance['ssn'] = $insuranceProgram->payerIdentifier;
$insurances[] = array('subscriber' => $subscriber, 'insurance' => $insurance);
$guarantors[] = $subscriber;
}
$adt = $newPatient ? 'A04' : 'A08';
$t = microtime();
$x = explode(' ', $t);
$date = date('YmdHis', $x[1]);
$messageId = $date . str_replace('.', '0', $x[0]);
$id = 0;
$hl7Guarantors = array();
foreach ($guarantors as $key => $guarantor) {
$ctr = $key + 1;
$hl7Guarantors[] = "GT1|{$ctr}|{$guarantor['recordNumber']}|{$guarantor['lastName']}^{$guarantor['firstName']}^{$guarantor['middleName']}^{$guarantor['suffix']}^^||{$guarantor['line1']}^{$guarantor['line2']}^{$guarantor['city']}^{$guarantor['state']}^{$guarantor['zip']}|{$guarantor['homePhone']}|{$guarantor['businessPhone']}|{$guarantor['dateOfBirth']}|{$guarantor['gender']}||S|{$guarantor['ssn']}|";
}
$hl7Insurances = array();
foreach ($insurances as $key => $value) {
$ctr = $key + 1;
$subscriber = $value['subscriber'];
$insurance = $value['insurance'];
$hl7Insurances[] = "IN1|{$ctr}|{$insurance['companyId']}^{$insurance['companyName']}|{$insurance['companyId']}|{$insurance['companyName']}|{$insurance['line1']}^{$insurance['line2']}^{$insurance['city']}^{$insurance['state']}^{$insurance['zip']}||{$insurance['phoneNumber']}|{$insurance['groupNumber']}|{$insurance['groupName']}|||||||{$subscriber['lastName']}^{$subscriber['firstName']}^{$subscriber['middleName']}^{$subscriber['suffix']}^^|{$subscriber['relation']}|{$subscriber['dateOfBirth']}|{$subscriber['line1']}^{$subscriber['line2']}^{$subscriber['city']}^{$subscriber['state']}^{$subscriber['zip']}|Y||{$ctr}||||||||||||||{$insurance['policyNumber']}|0||||||{$subscriber['gender']}||||||{$subscriber['ssn']}|";
if (!strlen($subscriber['ssn']) > 0) {
continue;
}
$hl7Insurances[] = "IN2|{$ctr}|{$subscriber['ssn']}";
}
$patient = $data['patient'];
$provider = $data['provider'];
$hl7Message = array();
$hl7Message[] = "MSH|^~\\&|MedMgr|989801|aroeshl7_prod|HEST|{$date}||ADT^{$adt}|{$messageId}|P|2.3|{$id}|";
$hl7Message[] = "EVN|{$adt}|{$date}|||38|";
$hl7Message[] = self::_PID($patient);
$hl7Message[] = self::_PV1($provider);
foreach ($hl7Guarantors as $hl7Guarantor) {
$hl7Message[] = $hl7Guarantor;
}
//.........这里部分代码省略.........