Example #1
0
 /**
  * @param \stdClass $params
  * @internal param $pid
  * @return mixed
  */
 public function currPatientSet(stdClass $params)
 {
     include_once $_SESSION['root'] . '/dataProvider/PoolArea.php';
     $poolArea = new PoolArea();
     $_SESSION['patient']['pid'] = $params->pid;
     $_SESSION['patient']['name'] = $this->getPatientFullNameByPid($params->pid);
     $p = $this->isPatientChartOutByPid($params->pid);
     $area = $poolArea->getCurrentPatientPoolAreaByPid($params->pid);
     if ($p === false || is_array($p) && $p['uid'] == $_SESSION['user']['id']) {
         $this->patientChartOutByPid($params->pid, $area['area_id']);
         $_SESSION['patient']['readOnly'] = false;
     } else {
         $_SESSION['patient']['readOnly'] = true;
     }
     return array('patient' => array('pid' => $params->pid, 'name' => $_SESSION['patient']['name'], 'pic' => $this->getPatientPhotoSrcIdByPid($params->pid), 'sex' => $this->getPatientSexByPid($params->pid), 'dob' => $dob = $this->getPatientDOBByPid($params->pid), 'age' => $this->getPatientAgeByDOB($dob), 'area' => $p === false ? null : $poolArea->getAreaTitleById($p['pool_area_id']), 'priority' => empty($area) ? null : $area['priority']), 'readOnly' => $_SESSION['patient']['readOnly'], 'overrideReadOnly' => $this->acl->hasPermission('override_readonly'), 'user' => $p === false ? null : $this->user->getUserFullNameById($p['uid']), 'area' => $p === false ? null : $poolArea->getAreaTitleById($p['pool_area_id']));
 }
Example #2
0
 /**
  * @param $params
  *
  * @return array
  */
 public function getPatientSetDataByPid($params)
 {
     include_once ROOT . '/dataProvider/PoolArea.php';
     $this->setPatient($params->pid);
     $poolArea = new PoolArea();
     $area = $poolArea->getCurrentPatientPoolAreaByPid($this->patient['pid']);
     $chart = $this->patientChartOutByPid($this->patient['pid'], $area['area_id']);
     return ['patient' => ['pid' => $this->patient['pid'], 'pubpid' => $this->patient['pubpid'], 'name' => $this->getPatientFullName(), 'pic' => $this->patient['image'], 'sex' => $this->getPatientSex(), 'dob' => $this->getPatientDOB(), 'age' => $this->getPatientAge(), 'area' => $area['poolArea'], 'priority' => empty($area) ? null : $area['priority'], 'rating' => isset($this->patient['rating']) ? $this->patient['rating'] : 0, 'record' => $this->patient], 'chart' => ['readOnly' => $chart->read_only == '1', 'overrideReadOnly' => $this->acl->hasPermission('override_readonly'), 'outUser' => isset($chart->outChart->uid) ? $this->user->getUserFullNameById($chart->outChart->uid) : 0, 'outArea' => isset($chart->outChart->pool_area_id) ? $poolArea->getAreaTitleById($chart->outChart->pool_area_id) : 0]];
 }
Example #3
0
 public function get_PatientTokensData($pid, $allNeededInfo, $tokens)
 {
     // Code reference: Relationship codes as specified by HL7. v2: Added 'Household' concept
     // https://phinvads.cdc.gov/vads/ViewValueSet.action?id=6FD34BBC-617F-DD11-B38D-00188B398520#
     $patientContact = new PatientContacts();
     $contactSelf = $patientContact->getContactByType($pid, 'SEL');
     $contactGuardian = $patientContact->getContactByType($pid, 'GRD');
     $contactMother = $patientContact->getContactByType($pid, 'MTH');
     $contactEmergency = $patientContact->getContactByType($pid, 'EMC');
     $contactEmployer = $patientContact->getContactByType($pid, 'EMR');
     $patientData = $this->getAllPatientData($pid);
     $age = $this->patient->getPatientAgeByDOB($patientData['DOB']);
     $user = new User();
     $patienInformation = ['[PATIENT_NAME]' => $patientData['fname'], '[PATIENT_ID]' => $patientData['pid'], '[PATIENT_FULL_NAME]' => $this->patient->getPatientFullNameByPid($patientData['pid']), '[PATIENT_LAST_NAME]' => $patientData['lname'], '[PATIENT_SEX]' => $patientData['sex'], '[PATIENT_BIRTHDATE]' => $patientData['DOB'], '[PATIENT_MARITAL_STATUS]' => $patientData['marital_status'], '[PATIENT_SOCIAL_SECURITY]' => $patientData['SS'], '[PATIENT_EXTERNAL_ID]' => $patientData['pubpid'], '[PATIENT_DRIVERS_LICENSE]' => $patientData['drivers_license'], '[PATIENT_ADDRESS]' => isset($contactSelf['street_mailing_address']) ? $contactSelf['street_mailing_address'] : '', '[PATIENT_CITY]' => isset($contactSelf['city']) ? $contactSelf['city'] : '', '[PATIENT_STATE]' => isset($contactSelf['state']) ? $contactSelf['state'] : '', '[PATIENT_COUNTRY]' => isset($contactSelf['country']) ? $contactSelf['country'] : '', '[PATIENT_ZIPCODE]' => isset($contactSelf['zip']) ? $contactSelf['zip'] : '', '[PATIENT_HOME_PHONE]' => isset($contactSelf['phone_local_number']) ? $contactSelf['phone_use_code'] . '-' . $contactSelf['phone_area_code'] . '-' . $contactSelf['phone_local_number'] : '', '[PATIENT_MOBILE_PHONE]' => isset($contactSelf['phone_local_number']) ? $contactSelf['phone_use_code'] . '-' . $contactSelf['phone_area_code'] . '-' . $contactSelf['phone_local_number'] : '', '[PATIENT_WORK_PHONE]' => isset($contactSelf['phone_local_number']) ? $contactSelf['phone_use_code'] . '-' . $contactSelf['phone_area_code'] . '-' . $contactSelf['phone_local_number'] : '', '[PATIENT_EMAIL]' => '', '[PATIENT_MOTHERS_NAME]' => isset($contactMother['first_name']) ? Person::fullname($contactMother['first_name'], $contactMother['middle_name'], $contactMother['last_name']) : '', '[PATIENT_GUARDIANS_NAME]' => isset($contactGuardian['first_name']) ? Person::fullname($contactGuardian['first_name'], $contactGuardian['middle_name'], $contactGuardian['last_name']) : '', '[PATIENT_EMERGENCY_CONTACT]' => isset($contactEmergency['first_name']) ? Person::fullname($contactEmergency['first_name'], $contactEmergency['middle_name'], $contactEmergency['last_name']) : '', '[PATIENT_EMERGENCY_PHONE]' => isset($contactEmergency['phone_local_number']) ? $contactEmergency['phone_use_code'] . '-' . $contactEmergency['phone_area_code'] . '-' . $contactEmergency['phone_local_number'] : '', '[PATIENT_PROVIDER]' => is_numeric($patientData['provider']) ? $user->getUserFullNameById($patientData['provider']) : '', '[PATIENT_PHARMACY]' => $patientData['pharmacy'], '[PATIENT_AGE]' => $age['DMY']['years'], '[PATIENT_OCCUPATION]' => $patientData['occupation'], '[PATIENT_EMPLOYEER]' => isset($contactEmployer['first_name']) ? Person::fullname($contactEmployer['first_name'], $contactEmployer['middle_name'], $contactEmployer['last_name']) : '', '[PATIENT_RACE]' => $patientData['race'], '[PATIENT_ETHNICITY]' => $patientData['ethnicity'], '[PATIENT_LENGUAGE]' => $patientData['language'], '[PATIENT_PICTURE]' => '<img src="' . $patientData['image'] . '" style="width:100px;height:100px">', '[PATIENT_QRCODE]' => '<img src="' . $patientData['qrcode'] . '" style="width:100px;height:100px">', '[PATIENT_TABACCO]' => 'tabaco', '[PATIENT_ALCOHOL]' => 'alcohol'];
     unset($user);
     foreach ($tokens as $i => $tok) {
         if (isset($patienInformation[$tok]) && ($allNeededInfo[$i] == '' || $allNeededInfo[$i] == null)) {
             $allNeededInfo[$i] = $patienInformation[$tok];
         }
     }
     return $allNeededInfo;
 }
Example #4
0
 public function get_PatientTokensData($pid, $allNeededInfo, $tokens)
 {
     $patientData = $this->getAllPatientData($pid);
     $age = $this->patient->getPatientAgeByDOB($patientData['DOB']);
     $user = new User();
     $patienInformation = ['[PATIENT_NAME]' => $patientData['fname'], '[PATIENT_ID]' => $patientData['pid'], '[PATIENT_FULL_NAME]' => $this->patient->getPatientFullNameByPid($patientData['pid']), '[PATIENT_LAST_NAME]' => $patientData['lname'], '[PATIENT_SEX]' => $patientData['sex'], '[PATIENT_BIRTHDATE]' => $patientData['DOB'], '[PATIENT_MARITAL_STATUS]' => $patientData['marital_status'], '[PATIENT_SOCIAL_SECURITY]' => $patientData['SS'], '[PATIENT_EXTERNAL_ID]' => $patientData['pubpid'], '[PATIENT_DRIVERS_LICENSE]' => $patientData['drivers_license'], '[PATIENT_ADDRESS]' => $patientData['address'], '[PATIENT_CITY]' => $patientData['city'], '[PATIENT_STATE]' => $patientData['state'], '[PATIENT_COUNTRY]' => $patientData['country'], '[PATIENT_ZIPCODE]' => $patientData['zipcode'], '[PATIENT_HOME_PHONE]' => $patientData['home_phone'], '[PATIENT_MOBILE_PHONE]' => $patientData['mobile_phone'], '[PATIENT_WORK_PHONE]' => $patientData['work_phone'], '[PATIENT_EMAIL]' => $patientData['email'], '[PATIENT_MOTHERS_NAME]' => $patientData['mothers_name'], '[PATIENT_GUARDIANS_NAME]' => $patientData['guardians_name'], '[PATIENT_EMERGENCY_CONTACT]' => $patientData['emer_contact'], '[PATIENT_EMERGENCY_PHONE]' => $patientData['emer_phone'], '[PATIENT_PROVIDER]' => is_numeric($patientData['provider']) ? $user->getUserFullNameById($patientData['provider']) : '', '[PATIENT_PHARMACY]' => $patientData['pharmacy'], '[PATIENT_AGE]' => $age['DMY']['years'], '[PATIENT_OCCUPATION]' => $patientData['occupation'], '[PATIENT_EMPLOYEER]' => $patientData['employer_name'], '[PATIENT_RACE]' => $patientData['race'], '[PATIENT_ETHNICITY]' => $patientData['ethnicity'], '[PATIENT_LENGUAGE]' => $patientData['language'], '[PATIENT_PICTURE]' => '<img src="' . $patientData['image'] . '" style="width:100px;height:100px">', '[PATIENT_QRCODE]' => '<img src="' . $patientData['qrcode'] . '" style="width:100px;height:100px">', '[PATIENT_TABACCO]' => 'tabaco', '[PATIENT_ALCOHOL]' => 'alcohol'];
     unset($user);
     foreach ($tokens as $i => $tok) {
         if (isset($patienInformation[$tok]) && ($allNeededInfo[$i] == '' || $allNeededInfo[$i] == null)) {
             $allNeededInfo[$i] = $patienInformation[$tok];
         }
     }
     return $allNeededInfo;
 }