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


PHP Address::getIteratorByPersonId方法代码示例

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


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

示例1: getAddresses

 public function getAddresses()
 {
     $address = new Address();
     $address->personId = $this->person_id;
     return $address->getIteratorByPersonId();
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:6,代码来源:Person.php

示例2: handlerSSSourceData


//.........这里部分代码省略.........
     $ePrescriber->populateWithBuildingProvider();
     $prescriberData['SPI'] = $ePrescriber->SSID;
     $prescriberData['addressLine1'] = $building->line1;
     $prescriberData['addressLine2'] = $building->line2;
     $prescriberData['city'] = $building->city;
     $prescriberData['state'] = $building->state;
     $prescriberData['zip'] = $building->zipCode;
     $prescriberData['phones'] = $building->phoneNumbers;
     $data['Prescriber'] = $prescriberData;
     WebVista::log('prescriber data: ' . print_r($prescriberData, true));
     // PATIENT DATA
     $patient = new Patient();
     $patient->personId = $medication->personId;
     $patient->populate();
     $patientData = array();
     $patientData['lastName'] = $patient->person->lastName;
     $patientData['firstName'] = $patient->person->firstName;
     $patientData['middleName'] = $patient->person->middleName;
     $patientData['suffix'] = $patient->person->suffix;
     $patientData['prefix'] = '';
     $patientData['email'] = $patient->person->email;
     $patientData['fileId'] = $patient->recordNumber;
     $patientData['medicareNumber'] = '';
     // TODO: to be implemented
     $identifierType = $patient->identifierType;
     if (strlen($identifierType) > 0) {
         $patientData[$identifierType] = $patient->identifier;
     }
     $patientData['gender'] = $patient->person->getDisplayGender();
     $dateOfBirth = date('Ymd', strtotime($patient->person->dateOfBirth));
     if ($patient->person->dateOfBirth == '0000-00-00') {
         $dateOfBirth = '';
     }
     $patientData['dateOfBirth'] = $dateOfBirth;
     $address = new Address();
     $address->personId = $patient->personId;
     $addressIterator = $address->getIteratorByPersonId();
     foreach ($addressIterator as $address) {
         break;
         // retrieves the top address
     }
     $patientData['addressLine1'] = $address->line1;
     $patientData['addressLine2'] = $address->line2;
     $patientData['city'] = $address->city;
     $patientData['state'] = $address->state;
     $patientData['zip'] = $address->zipCode;
     $phoneNumber = new PhoneNumber();
     $phoneNumber->personId = $patient->personId;
     $patientData['phones'] = $phoneNumber->phoneNumbers;
     $data['Patient'] = $patientData;
     WebVista::log('patient data: ' . print_r($patientData, true));
     // CHECK for attending/supervisor
     $attendingId = (int) TeamMember::getAttending($patient->teamId);
     $building = Building::getBuildingDefaultLocation($attendingId);
     $ePrescriber = new EPrescriber();
     $ePrescriber->providerId = $attendingId;
     $ePrescriber->buildingId = (int) $building->buildingId;
     $ePrescriber->populateWithBuildingProvider();
     if ($attendingId > 0 && strlen($ePrescriber->SSID) > 0) {
         // SUPERVISOR
         $provider = new Provider();
         $provider->personId = $attendingId;
         $provider->populate();
         $supervisorData = array();
         $supervisorData['DEANumber'] = $provider->deaNumber;
         $supervisorData['SPI'] = $ePrescriber->SSID;
         // it has conflicts with DEANumber
         //$supervisorData['stateLicenseNumber'] = $provider->stateLicenseNumber;
         $supervisorData['fileId'] = $provider->personId;
         $supervisorData['clinicName'] = '';
         $identifierType = $provider->identifierType;
         if (strlen($identifierType) > 0) {
             //	$prescriberData[$identifierType] = $provider->identifier;
         }
         $phoneNumber = new PhoneNumber();
         $phoneNumber->personId = $provider->personId;
         $supervisorData['phones'] = $phoneNumber->phoneNumbers;
         $supervisorData['lastName'] = $provider->person->lastName;
         $supervisorData['firstName'] = $provider->person->firstName;
         $supervisorData['middleName'] = $provider->person->middleName;
         $supervisorData['suffix'] = $provider->person->suffix;
         $supervisorData['prefix'] = '';
         $supervisorData['email'] = $provider->person->email;
         $supervisorData['specialtyCode'] = $provider->specialty;
         $specialtyQualifier = '';
         if (strlen($provider->specialty) > 0) {
             $specialtyQualifier = 'AM';
         }
         $supervisorData['specialtyQualifier'] = $specialtyQualifier;
         $supervisorData['addressLine1'] = $building->line1;
         $supervisorData['addressLine2'] = $building->line2;
         $supervisorData['city'] = $building->city;
         $supervisorData['state'] = $building->state;
         $supervisorData['zip'] = $building->zipCode;
         $supervisorData['phones'] = $building->phoneNumbers;
         $data['Supervisor'] = $supervisorData;
         WebVista::log('supervisor data: ' . print_r($supervisorData, true));
     }
     return $data;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:101,代码来源:DataIntegration.php

示例3: generatePID

 public static function generatePID($patientId)
 {
     $patient = new Patient();
     $patient->personId = (int) $patientId;
     $patient->populate();
     $phoneHome = '';
     $phoneBusiness = '';
     $phoneNumber = new PhoneNumber();
     $phoneNumber->personId = $patient->personId;
     $phones = $phoneNumber->getPhoneNumbers(false);
     foreach ($phones as $phone) {
         if ($phoneHome == '' && $phone['type'] == 'HP') {
             $phoneHome = $phone['number'];
         }
         if ($phoneBusiness == '' && $phone['type'] == 'TE') {
             $phoneBusiness = $phone['number'];
         }
     }
     /* most efficient way to create PID?
     		$patientName = $patient->person->lastName.'^'.$patient->person->firstName.'^'.strtoupper(substr($patient->person->middleName,0,1));
     		$addr = $patient->homeAddress;
     		$address = $addr->line1.'^'.$addr->line2.'^'.$addr->city.'^'.$addr->state.'^'.$addr->zipCode;
     		// reference: http://www.med.mun.ca/tedhoekman/medinfo/hl7/ch300056.htm
     		$data = array();
     		$data[] = 'PID';
     		$data[] = ''; // 1: Set ID
     		$data[] = ''; // 2: Patient ID (External)
     		$data[] = $patient->recordNumber; // 3: Patient ID (Internal)
     		$data[] = ''; // 4: Alternate Patient ID
     		$data[] = $patientName; // 5: Patient Name
     		$data[] = ''; // 6: Mother's Maiden Name
     		$data[] = date('Ymd',strtotime($patient->person->dateOfBirth)); // 7: Data/Time of Birth
     		$data[] = $patient->person->gender; // 8: Sex
     		$data[] = ''; // 9: Patient Alias
     		$data[] = ''; // 10: Race
     		$data[] = $address; // 11: Patient Address
     		$data[] = ''; // 12: Country Code
     		$data[] = $phoneHome; // 13: Phone Number (Home)
     		$data[] = $phoneBusiness; // 14: Phone Number (Business)
     		$data[] = ''; // 15: Primary Language
     		$data[] = $patient->person->maritalStatus; // 16: Marital Status
     		$data[] = ''; // 17: Religion
     		$data[] = ''; // 18: Patient Account Number
     		$data[] = $patient->person->identifier; // 19: Patient SSS Number
     		*/
     $data = array();
     $data['mrn'] = $patient->recordNumber;
     $data['lastName'] = $patient->person->lastName;
     $data['firstName'] = $patient->person->firstName;
     $data['middleInitial'] = strtoupper(substr($patient->person->middleName, 0, 1));
     $data['dateOfBirth'] = date('Ymd', strtotime($patient->person->dateOfBirth));
     $data['gender'] = $patient->person->gender;
     $address = $patient->homeAddress;
     // 2.x
     // fall back for 3.x
     if (!$address->addressId > 0) {
         $address = new Address();
         $address->personId = $patient->personId;
         $addressIterator = $address->getIteratorByPersonId();
         foreach ($addressIterator as $address) {
             break;
             // retrieves the top address
         }
     }
     $data['addressLine1'] = $address->line1;
     $data['addressLine2'] = $address->line2;
     $data['addressCity'] = $address->city;
     $data['addressState'] = $address->state;
     $data['addressZip'] = $address->zipCode;
     $data['phoneHome'] = $phoneHome;
     $data['phoneBusiness'] = $phoneBusiness;
     $data['ssn'] = $patient->person->identifier;
     $statistics = PatientStatisticsDefinition::getPatientStatistics((int) $patient->personId);
     $data['race'] = '';
     if (isset($statistics['Race'])) {
         $data['race'] = $statistics['Race'];
     }
     if (isset($statistics['race'])) {
         $data['race'] = $statistics['race'];
     }
     return 'PID|1||' . $data['mrn'] . '||' . $data['lastName'] . '^' . $data['firstName'] . '^' . $data['middleInitial'] . '||' . $data['dateOfBirth'] . '|' . $data['gender'] . '||' . $data['race'] . '|' . $data['addressLine1'] . '^' . $data['addressLine2'] . '^' . $data['addressCity'] . '^' . $data['addressState'] . '^' . $data['addressZip'] . '||' . $data['phoneHome'] . '|' . $data['phoneBusiness'] . '|||||' . $data['ssn'];
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:82,代码来源:HL7Generator.php

示例4: populateHeader

 public function populateHeader(SimpleXMLElement $xml)
 {
     $patientName = array();
     $patientName['given'] = $this->patient->person->firstName;
     $patientName['family'] = $this->patient->person->lastName;
     $patientName['suffix'] = $this->patient->person->suffix;
     $providerName = array();
     $providerName['prefix'] = $this->user->person->prefix;
     $providerName['given'] = $this->user->person->firstName;
     $providerName['family'] = $this->user->person->lastName;
     $building = $this->building;
     $buildingName = $building->displayName;
     $realmCode = $xml->addChild('realmCode');
     $realmCode->addAttribute('code', 'US');
     $typeId = $xml->addChild('typeId');
     $typeId->addAttribute('root', '2.16.840.1.113883.1.3');
     $typeId->addAttribute('extension', 'POCD_HD000040');
     $templateId = $xml->addChild('templateId');
     $templateId->addAttribute('root', '2.16.840.1.113883.3.27.1776');
     $templateId->addAttribute('assigningAuthorityName', 'CDA/R2');
     $templateId = $xml->addChild('templateId');
     $templateId->addAttribute('root', '2.16.840.1.113883.10.20.3');
     $templateId->addAttribute('assigningAuthorityName', 'HL7/CDT Header');
     $templateId = $xml->addChild('templateId');
     $templateId->addAttribute('root', '1.3.6.1.4.1.19376.1.5.3.1.1.1');
     $templateId->addAttribute('assigningAuthorityName', 'IHE/PCC');
     $templateId = $xml->addChild('templateId');
     $templateId->addAttribute('root', '2.16.840.1.113883.3.88.11.32.1');
     $templateId->addAttribute('assigningAuthorityName', 'HITSP/C32');
     $id = $xml->addChild('id');
     $id->addAttribute('root', '2.16.840.1.113883.3.72');
     $id->addAttribute('extension', 'HITSP_C32v2.5');
     $id->addAttribute('assigningAuthorityName', 'ClearHealth');
     $code = $xml->addChild('code');
     $code->addAttribute('code', '34133-9');
     $displayName = 'Summarization of episode note';
     $code->addAttribute('displayName', $displayName);
     $code->addAttribute('codeSystem', '2.16.840.1.113883.6.1');
     $code->addAttribute('codeSystemName', 'LOINC');
     $xml->addChild('title', html_convert_entities($this->_title));
     $effectiveTime = $xml->addChild('effectiveTime');
     $dateEffective = self::formatDate();
     $effectiveTime->addAttribute('value', $dateEffective);
     $confidentialityCode = $xml->addChild('confidentialityCode');
     $confidentialityCode->addAttribute('code', 'N');
     //$confidentialityCode->addAttribute('codeSystem','2.16.840.1.113883.5.25');
     $languageCode = $xml->addChild('languageCode');
     $languageCode->addAttribute('code', 'en-US');
     // RECORD TARGET
     $recordTarget = $xml->addChild('recordTarget');
     $patientRole = $recordTarget->addChild('patientRole');
     $id = $patientRole->addChild('id');
     //$id->addAttribute('root','CLINICID');
     $id->addAttribute('root', 'MRN');
     //$id->addAttribute('extension','PatientID');
     $id->addAttribute('extension', html_convert_entities($this->patient->recordNumber));
     // Address
     $address = new Address();
     $address->personId = $this->_patientId;
     $addressIterator = $address->getIteratorByPersonId();
     foreach ($addressIterator as $address) {
         break;
         // retrieves the top address
     }
     $addr = $patientRole->addChild('addr');
     if ($address->addressId > 0) {
         $addr->addAttribute('use', 'HP');
         $addr->addChild('streetAddressLine', html_convert_entities(strlen($address->line2) > 0 ? $address->line1 . ' ' . $address->line2 : $address->line1));
         $addr->addChild('city', html_convert_entities($address->city));
         $addr->addChild('state', html_convert_entities($address->state));
         $addr->addChild('postalCode', html_convert_entities($address->zipCode));
     }
     // Telecom
     $phone = null;
     $phoneNumber = new PhoneNumber();
     $phoneNumber->personId = $this->_patientId;
     foreach ($phoneNumber->getPhoneNumbers(false) as $phone) {
         break;
         // retrieves the top phone
     }
     $telecom = $patientRole->addChild('telecom');
     if ($phone && strlen($phone['number']) > 0) {
         $telecom->addAttribute('use', 'HP');
         $telecom->addAttribute('value', 'tel:' . html_convert_entities($phone['number']));
     }
     // Patient
     $patient = $patientRole->addChild('patient');
     $name = $patient->addChild('name');
     $name->addChild('given', html_convert_entities($patientName['given']));
     $name->addChild('family', html_convert_entities($patientName['family']));
     $name->addChild('suffix', html_convert_entities($patientName['suffix']));
     $genderCode = $patient->addChild('administrativeGenderCode');
     $genderCode->addAttribute('code', html_convert_entities($this->patient->person->gender));
     $genderCode->addAttribute('displayName', html_convert_entities($this->patient->person->displayGender));
     $genderCode->addAttribute('codeSystem', '2.16.840.1.113883.5.1');
     $genderCode->addAttribute('codeSystemName', 'HL7 AdministrativeGender');
     $birthTime = $patient->addChild('birthTime');
     $birthTime->addAttribute('value', date('Ymd', strtotime($this->patient->person->dateOfBirth)));
     /*$maritalStatusCode = $patient->addChild('maritalStatusCode');
     		$maritalStatusCode->addAttribute('code','');
//.........这里部分代码省略.........
开发者ID:dragonlet,项目名称:clearhealth,代码行数:101,代码来源:CCD.php

示例5: 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

示例6: export2PublicHealth

 protected function export2PublicHealth($ids)
 {
     $data = array();
     $data[] = 'FHS|^~\\&';
     $data[] = 'BHS|^~\\&';
     $ctr = count($ids);
     for ($i = 0; $i < $ctr; $i++) {
         $id = (int) $ids[$i];
         if (!isset($this->_session->patientList[$id])) {
             continue;
         }
         $problemList = isset($this->_session->patientList[$id]['problemList']) ? $this->_session->patientList[$id]['problemList'] : array();
         $patient = new Patient();
         $patient->personId = $id;
         $patient->populate();
         $person = $patient->person;
         $dateTime = date('YmdHi');
         $messageDateTime = date('YmdHiO');
         $data[] = 'MSH|^~\\&|CLEARHEALTH||||' . $dateTime . '||ADT^A04|' . $messageDateTime . '|P|2.3.1';
         $dateOfOnset = isset($problemList[0]['dateOfOnset']) ? $problemList[0]['dateOfOnset'] : date('YmdHis');
         $data[] = 'EVN||' . date('YmdHi', strtotime($dateOfOnset));
         // Address
         $address = new Address();
         $address->personId = $id;
         $addressIterator = $address->getIteratorByPersonId();
         foreach ($addressIterator as $address) {
             break;
             // retrieves the top address
         }
         // Telecom
         $phone = null;
         $phoneNumber = new PhoneNumber();
         $phoneNumber->personId = $id;
         foreach ($phoneNumber->getPhoneNumbers(false) as $phone) {
             break;
             // retrieves the top phone
         }
         $telecom = '';
         if ($phone && strlen($phone['number']) > 0) {
             $telecom = $phone['number'];
         }
         $data[] = 'PID|1||' . $patient->recordNumber . '||' . strtoupper($person->lastName) . '^' . strtoupper($person->firstName) . '^' . strtoupper($person->middleName) . '||' . date('Ymd', strtotime($person->dateOfBirth)) . '|' . $person->gender . '||U|' . $address->line1 . '^' . $address->line2 . '^' . $address->city . '^' . $address->state . '^' . $address->zipCode . '^US||' . $telecom;
         $visit = new Visit();
         $visit->patientId = $id;
         $visit->populateLatestVisit();
         $data[] = 'PV1|1|O||R||||||||||||||||||||||||||||||||||||||||' . date('YmdHis', strtotime($visit->dateOfTreatment));
         foreach ($problemList as $key => $problem) {
             $data[] = 'DG1|' . ($key + 1) . '||' . $problem['code'] . '^' . $problem['code'] . ' ' . $problem['codeTextShort'] . '^I9C|||F|||||||||1';
         }
     }
     $data[] = 'BTS|' . $ctr;
     $data[] = 'FTS|1';
     $filename = 'ph_' . uniqid('') . '.er7';
     return array('filename' => $filename, 'data' => $data);
 }
开发者ID:lucianobenetti,项目名称:clearhealth,代码行数:55,代码来源:PatientListController.php

示例7: ssCheck

 public function ssCheck()
 {
     $ret = array();
     // required SS: Name (last and first), Gender, Date of Birth
     $person = $this->person;
     $lastNameLen = strlen($person->lastName);
     if (!$lastNameLen > 0 || $lastNameLen > 35) {
         $ret[] = 'Last Name field must be supplied and not more than 35 characters';
     }
     $firstNameLen = strlen($person->firstName);
     if (!$firstNameLen > 0 || $firstNameLen > 35) {
         $ret[] = 'First Name field must be supplied and not more than 35 characters';
     }
     $gender = $person->gender;
     // Gender options = M, F, U
     $genderList = array('M' => 'Male', 'F' => 'Female', 'U' => 'Unknown', 1 => 'Male', 2 => 'Female', 3 => 'Unknown');
     if (!isset($genderList[$gender])) {
         $ret[] = 'Gender is invalid';
     }
     // Patient DOB must not be future
     $date = date('Y-m-d');
     $dateOfBirth = date('Ymd', strtotime($person->dateOfBirth));
     if ($person->dateOfBirth == '0000-00-00' || strtotime($dateOfBirth) > strtotime($date)) {
         $ret[] = 'Date of birth is invalid';
     }
     // Have appropriate validation on patient address/phone as required by SS docs
     $address = new Address();
     $address->personId = $this->personId;
     $addressIterator = $address->getIteratorByPersonId();
     foreach ($addressIterator as $address) {
         break;
         // retrieves the top address
     }
     //$address->populateWithType('MAIN');
     $line1Len = strlen($address->line1);
     if (!$line1Len > 0 || $line1Len > 35) {
         $ret[] = 'Address line1 field must be supplied and not more than 35 characters';
     }
     $line2Len = strlen($address->line2);
     if ($line2Len > 0 && $line2Len > 35) {
         $ret[] = 'Address line2 must not be more than 35 characters';
     }
     $cityLen = strlen($address->city);
     if (!$cityLen > 0 || $cityLen > 35) {
         $ret[] = 'Address city field must be supplied and not more than 35 characters';
     }
     if (strlen($address->state) != 2) {
         $ret[] = 'Address state field must be supplied and not more than 2 characters';
     }
     $zipCodeLen = strlen($address->zipCode);
     if ($zipCodeLen != 5 && $zipCodeLen != 9) {
         $ret[] = 'Address zipcode must be supplied and must be 5 or 9 digit long';
     }
     $phoneNumber = new PhoneNumber();
     $phoneNumber->personId = $person->personId;
     $phones = $phoneNumber->phoneNumbers;
     $hasTE = false;
     foreach ($phones as $phone) {
         if ($phone['type'] == 'TE') {
             $hasTE = true;
             break;
         }
         if (strlen($phone['number']) < 11) {
             $ret[] = 'Phone number \'' . $phone['number'] . '\' is invalid';
         }
     }
     if (!$hasTE) {
         $ret[] = 'Phone must have at least one Emergency, Employer or Billing';
     }
     return $ret;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:71,代码来源:Patient.php

示例8: generatePID

 public static function generatePID($patientId, $raw = false)
 {
     $patientId = (int) $patientId;
     $patient = new Patient();
     $patient->personId = $patientId;
     $patient->populate();
     // Patient Statistics
     $statistics = PatientStatisticsDefinition::getPatientStatistics($patientId);
     $pid = array('PID');
     $pid[1] = '';
     // empty
     $pid[2] = '';
     // empty
     $pid3 = array();
     // PID‐3: Patient Identifier List
     $pid3[1] = $patient->recordNumber;
     // PID‐3.1: ID Number
     $pid3[2] = '';
     // empty
     $pid3[3] = '';
     // empty
     $pid34 = array();
     // PID-3.4: Assigning Authority
     $pid34[] = 'MPI';
     // PID-3.4.1: Namespace ID
     $pid34[] = '2.16.840.1.113883.19.3.2.1';
     // PID-3.4.2: Universal ID
     $pid34[] = 'ISO';
     // PID-3.4.3: Universal ID Type
     $pid3[4] = implode('&', $pid34);
     $pid3[5] = 'MR';
     // PID-3.5: ID Number Type
     $pid[3] = implode('^', $pid3);
     $pid[4] = '';
     // empty
     $pid5 = array();
     $pid51 = array();
     // PID-5.1: Family Name
     $pid51[] = $patient->lastName;
     // PID-5.1.1: Surname
     $pid5[] = implode('^', $pid51);
     $pid5[] = $patient->firstName;
     // PID-5.2: Given Name
     $pid[5] = implode('^', $pid5);
     $pid[6] = '';
     // empty
     $pid7 = array();
     $pid7[] = date('Ymd', strtotime($patient->dateOfBirth));
     // PID-7.1: Date of Birth
     $pid[7] = implode('^', $pid7);
     $pid[8] = $patient->gender;
     // PID-8: Administrative Sex
     $pid[9] = '';
     // empty
     $race = '';
     $raceCode = 'HL70005';
     if (isset($statistics['Race'])) {
         $race = $statistics['Race'];
     }
     if (isset($statistics['race'])) {
         $race = $statistics['race'];
     }
     $raceId = '';
     foreach (explode(' ', $race) as $val) {
         $raceId .= strtoupper(substr($val, 0, 1));
     }
     $pid10 = array();
     // PID-10: Race
     $pid10[] = $raceId;
     // PID-10.1: Identifier
     $pid10[] = $race;
     // PID-10.2: Text
     $pid10[] = $raceCode;
     // PID-10.3: Name of Coding System
     $pid[10] = implode('^', $pid10);
     $addr = new Address();
     foreach ($addr->getIteratorByPersonId($patientId) as $address) {
         break;
     }
     $street = $address->line1;
     if (strlen($address->line2) > 0) {
         $street .= ' ' . $address->line2;
     }
     $pid11 = array();
     // PID-11: Patient Address
     $pid111 = array();
     // PID-11.1: Street Address
     $pid111[] = $street;
     // PID-11.1.1: Street or Mailing Address
     $pid11[] = implode('^', $pid111);
     // PID-11.1: Street Address
     $pid11[] = '';
     // empty
     $pid11[] = $address->city;
     // PID-11.3: City
     $pid11[] = $address->state;
     // PID-11.4: State
     $pid11[] = $address->zipCode;
     // PID-11.5: Zip Code
     $pid11[] = 'USA';
//.........这里部分代码省略.........
开发者ID:dragonlet,项目名称:clearhealth,代码行数:101,代码来源:HL7.php

示例9: ajaxListAddressesAction

 public function ajaxListAddressesAction()
 {
     $patientId = (int) $this->_getParam('patientId');
     $rows = array();
     $address = new Address();
     $addressIterator = $address->getIteratorByPersonId($patientId);
     foreach ($addressIterator as $addr) {
         $rows[] = $this->_toJSON($addr, 'addressId', array('name', 'type', 'line1', 'line2', 'city', 'state', 'postal_code', 'notes', 'active'));
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array('rows' => $rows));
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:13,代码来源:PatientController.php


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