本文整理汇总了PHP中Patient::getPatientByPublicId方法的典型用法代码示例。如果您正苦于以下问题:PHP Patient::getPatientByPublicId方法的具体用法?PHP Patient::getPatientByPublicId怎么用?PHP Patient::getPatientByPublicId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Patient
的用法示例。
在下文中一共展示了Patient::getPatientByPublicId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPatient
/**
* @param $patient
*
* @return mixed|object
*/
private function getPatient($patient)
{
require_once ROOT . '/dataProvider/Patient.php';
$Patient = new Patient();
if (isset($patient->RecordNumber)) {
$patient = $Patient->getPatientByPublicId($patient->RecordNumber);
} else {
$patient = $Patient->getPatientByPid($patient->Pid);
}
unset($Patient);
return $this->patient = $patient !== false ? (object) $patient : $patient;
}
示例2: AddPatient
public function AddPatient($params)
{
try {
$this->constructor($params);
if (!$this->isAuth()) {
throw new \Exception('Error: HTTP 403 Access Forbidden');
}
/**
* Patient class
*/
require_once ROOT . '/dataProvider/Patient.php';
$Patient = new Patient();
/**
* validations
*/
$validations = [];
if (!isset($params->Patient->FirstName)) {
$validations[] = 'First Name Missing';
}
if (!isset($params->Patient->LastName)) {
$validations[] = 'Last Name Missing';
}
if (!isset($params->Patient->DOB)) {
$validations[] = 'DOB Missing';
}
if (preg_match($this->vDate, $params->Patient->DOB) == 0) {
$validations[] = 'DOB format YYYY-MM-DD not valid';
}
if (!isset($params->Patient->Sex)) {
$validations[] = 'Sex Missing';
}
if (isset($params->Patient->DriveLicenceExpirationDate) && preg_match($this->vDate, $params->Patient->DriveLicenceExpirationDate) == 0) {
$validations[] = 'DriveLicenceExpirationDate format YYYY-MM-DD not valid';
}
if (isset($params->Patient->DeceaseDate) && preg_match($this->vDate, $params->Patient->DeceaseDate) == 0) {
$validations[] = 'DeceaseDate format YYYY-MM-DD not valid';
}
if (isset($params->Patient->DeathDate) && preg_match($this->vDate, $params->Patient->DeathDate) == 0) {
$validations[] = 'DeathDate format YYYY-MM-DD not valid';
}
if (isset($params->Patient->DeathDate) && preg_match($this->vDate, $params->Patient->DeathDate) == 0) {
$validations[] = 'DeathDate format YYYY-MM-DD not valid';
}
if (isset($params->Patient->Email) && !filter_var($params->Patient->Email, FILTER_VALIDATE_EMAIL)) {
$validations[] = 'Invalid Email format';
}
// TODO validate Sex, MaritalStatus, Race, Ethnicity, Religion, and Language HL7 values
if (isset($params->Patient->Pid) && $Patient->getPatientByPid($params->Patient->Pid) !== false) {
$validations[] = 'Duplicated Pid found in database';
}
if (isset($params->Patient->RecordNumber) && $Patient->getPatientByPublicId($params->Patient->RecordNumber) !== false) {
$validations[] = 'Duplicated RecordNumber found in database';
}
if (!empty($validations)) {
throw new \Exception('Validation Error: ' . implode(', ', $validations));
}
/**
* Lets continue
*/
$patient = new stdClass();
// basic info
$patient->pubpid = isset($params->Patient->RecordNumber) ? $params->Patient->RecordNumber : '';
$patient->title = isset($params->Patient->Title) ? $params->Patient->Title : '';
$patient->fname = $params->Patient->FirstName;
$patient->mname = isset($params->Patient->MiddleName) ? $params->Patient->MiddleName : '';
$patient->lname = $params->Patient->LastName;
$patient->DOB = $params->Patient->DOB;
$patient->sex = $params->Patient->Sex;
// extra info
$patient->SS = isset($params->Patient->SSN) ? $params->Patient->SSN : '';
$patient->marital_status = isset($params->Patient->MaritalStatus) ? $params->Patient->MaritalStatus : '';
$patient->race = isset($params->Patient->Race) ? $params->Patient->Race : '';
$patient->ethnicity = isset($params->Patient->Ethnicity) ? $params->Patient->Ethnicity : '';
$patient->religion = isset($params->Patient->Religion) ? $params->Patient->Religion : '';
$patient->language = isset($params->Patient->Language) ? $params->Patient->Language : '';
// driver lic
$patient->drivers_license = isset($params->Patient->DriverLicence) ? $params->Patient->DriverLicence : '';
$patient->drivers_license_state = isset($params->Patient->DriverLicenceState) ? $params->Patient->DriverLicenceState : '';
$patient->drivers_license_exp = isset($params->Patient->DriverLicenceExpirationDate) ? $params->Patient->DriverLicenceExpirationDate : '0000-00-00';
// physical address
$patient->address = isset($params->Patient->PhysicalAddressLineOne) ? $params->Patient->PhysicalAddressLineOne : '';
$patient->address_cont = isset($params->Patient->PhysicalAddressLineTwo) ? $params->Patient->PhysicalAddressLineTwo : '';
$patient->city = isset($params->Patient->PhysicalCity) ? $params->Patient->PhysicalCity : '';
$patient->state = isset($params->Patient->PhysicalState) ? $params->Patient->PhysicalState : '';
$patient->country = isset($params->Patient->PhysicalCountry) ? $params->Patient->PhysicalCountry : '';
$patient->zipcode = isset($params->Patient->PhysicalZipCode) ? $params->Patient->PhysicalZipCode : '';
// postal address
// $patient->mname = isset($params->Patient->PostalAddressLineOne) ? $params->Patient->PostalAddressLineOne : '';
// $patient->mname = isset($params->Patient->PostalAddressLineTwo) ? $params->Patient->PostalAddressLineTwo : '';
// $patient->mname = isset($params->Patient->PostalCity) ? $params->Patient->PostalCity : '';
// $patient->mname = isset($params->Patient->PostalState) ? $params->Patient->PostalState : '';
// $patient->mname = isset($params->Patient->PostalCountry) ? $params->Patient->PostalCountry : '';
// $patient->mname = isset($params->Patient->PostalZipCode) ? $params->Patient->PostalZipCode : '';
// phones and email info
$patient->home_phone = isset($params->Patient->HomePhoneNumber) ? $params->Patient->HomePhoneNumber : '';
$patient->mobile_phone = isset($params->Patient->MobilePhoneNumber) ? $params->Patient->MobilePhoneNumber : '';
$patient->work_phone = isset($params->Patient->WorkPhoneNumber) ? $params->Patient->WorkPhoneNumber : '';
$patient->work_phone_ext = isset($params->Patient->WorkPhoneExt) ? $params->Patient->WorkPhoneExt : '';
$patient->email = isset($params->Patient->Email) ? $params->Patient->Email : '';
// image
//.........这里部分代码省略.........
示例3: getPatient
/**
* @param $patient
*
* @return mixed|object
*/
private function getPatient($patient)
{
require_once ROOT . '/dataProvider/Patient.php';
$Patient = new Patient();
// if(isset($patient->Username)){
// $patient = $Patient->getPatientByUsername($patient->Username);
// } else
if (isset($patient->RecordNumber)) {
$patient = $Patient->getPatientByPublicId($patient->RecordNumber);
} else {
$patient = $Patient->getPatientByPid($patient->Pid);
}
unset($Patient);
return $this->patient = $patient !== false ? $this->convertPatient($patient, false) : $patient;
}