コード例 #1
0
ファイル: Patient.php プロジェクト: nhom5UET/tichhophethong
 /**
  * @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']));
 }
コード例 #2
0
ファイル: PatientZone.php プロジェクト: igez/gaiaehr
 public function getPatientsZonesByFloorPlanId($FloorPlanId)
 {
     $Patient = new Patient();
     $Pool = new PoolArea();
     $zones = $this->pz->sql("SELECT pz.id AS patientZoneId,\n\t\t\t\t\t\t\t\t  pz.pid,\n\t\t\t\t\t\t\t\t  pz.uid,\n\t\t\t\t\t\t\t\t  pz.zone_id AS zoneId,\n\t\t\t\t\t\t\t\t  time_in AS zoneTimerIn,\n\t\t\t\t\t\t\t\t  fpz.floor_plan_id AS floorPlanId\n\t\t\t\t\t\t\t FROM patient_zone AS pz\n\t\t\t\t\t\tLEFT JOIN floor_plans_zones AS fpz ON pz.zone_id = fpz.id\n\t\t\t\t\t\t\tWHERE fpz.floor_plan_id = {$FloorPlanId} AND pz.time_out IS NULL")->all();
     foreach ($zones as $i => $zone) {
         $zone['patient'] = $Patient->getPatientDemographicDataByPid($zone['pid']);
         $zone['name'] = $Patient->getPatientFullName();
         $zone['warning'] = $Patient->getPatientArrivalLogWarningByPid($zone['pid']);
         $pool = $Pool->getCurrentPatientPoolAreaByPid($zone['pid']);
         $zone['poolArea'] = $pool['poolArea'];
         $zone['priority'] = $pool['priority'];
         $zone['eid'] = $pool['eid'];
         $zones[$i] = $zone;
     }
     unset($Patient, $Pool);
     return $zones;
 }
コード例 #3
0
ファイル: Patient.php プロジェクト: igez/gaiaehr
 /**
  * @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]];
 }