本文整理汇总了PHP中Patient::setPersonId方法的典型用法代码示例。如果您正苦于以下问题:PHP Patient::setPersonId方法的具体用法?PHP Patient::setPersonId怎么用?PHP Patient::setPersonId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Patient
的用法示例。
在下文中一共展示了Patient::setPersonId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateEventColumnData
protected function generateEventColumnData($columnIndex, $includeHeader = false)
{
$columnIndex = (int) $columnIndex;
$appointmentIterator = new AppointmentIterator();
if (!isset($this->getCurrentDisplayFilter($columnIndex)->columns[$columnIndex])) {
throw new Exception(__("Cannot generate column with that index, there is no filter defined for that column Index: ") . $columnIndex);
}
$this->_session->currentAppointments[$columnIndex] = array();
$filter = $this->getCurrentDisplayFilter();
$filterTimeStart = strtotime($filter->start);
$filterTimeEnd = strtotime($filter->end);
$paramFilters = $filter->columns[$columnIndex];
if (isset($paramFilters['dateFilter'])) {
$filter->date = date('Y-m-d', strtotime($paramFilters['dateFilter']));
}
$paramFilters['start'] = $filter->date . ' ' . self::FILTER_TIME_START;
$paramFilters['end'] = $filter->date . ' ' . self::FILTER_TIME_END;
$columnData = array();
// we need to get the length of time to create number of rows in the grid
$timeLen = ($filterTimeEnd - $filterTimeStart) / 60 / self::FILTER_MINUTES_INTERVAL;
for ($i = 0; $i <= $timeLen; $i++) {
$row = array();
// assign row id as rowNumber and columnIndex
$row['id'] = $i . $columnIndex;
$row['data'][0] = '';
$columnData[$i] = $row;
}
$filterToTimeStart = strtotime($paramFilters['start']);
$appointmentIterator->setFilter($paramFilters);
// hold the temporary data counter
$tmpDataCtr = array();
$colMultiplier = 1;
$zIndex = 0;
$refHeight = 22;
foreach ($appointmentIterator as $row) {
$startToTime = strtotime($row->start);
$endToTime = strtotime($row->end);
$tmpStart = date('H:i', $startToTime);
$tmpEnd = date('H:i', $endToTime);
$tmpLen = ($endToTime - $startToTime) / 60 / self::FILTER_MINUTES_INTERVAL;
$timeLen = ceil($tmpLen);
$tmpIdx = ($startToTime - $filterToTimeStart) / 60 / self::FILTER_MINUTES_INTERVAL;
$tmpIndex = ceil($tmpIdx);
if (!isset($columnData[$tmpIndex])) {
break;
}
$height = $refHeight * $timeLen;
$heightDiff = 0;
if ($tmpLen != $timeLen) {
$diff = $refHeight * ($timeLen - $tmpLen);
$heightDiff = $refHeight - $diff;
$height -= $heightDiff;
}
$marginLeft = 8;
$multiplier = 1;
$marginTop = -11.9;
if ($tmpIdx != $tmpIndex) {
$marginTop -= $refHeight * ($tmpIndex - $tmpIdx);
$height -= $refHeight;
$timeLen--;
$height += $heightDiff * 2;
}
// check for appointment intersection
foreach ($tmpDataCtr as $keyCtr => $dataCtr) {
if ($startToTime >= $dataCtr['ranges']['start'] && $startToTime < $dataCtr['ranges']['end']) {
if ($endToTime > $dataCtr['ranges']['end']) {
$tmpDataCtr[$keyCtr]['ranges']['end'] = $endToTime;
}
$tmpDataCtr[$keyCtr]['multiplier']++;
$multiplier = $tmpDataCtr[$keyCtr]['multiplier'];
break;
}
}
if ($multiplier === 1) {
$ranges = array('start' => $startToTime, 'end' => $endToTime);
$tmpDataCtr[] = array('ranges' => $ranges, 'multiplier' => $multiplier);
} else {
$marginLeft = ($multiplier - 1) * 250;
}
if ($multiplier > $colMultiplier) {
$colMultiplier = $multiplier;
}
$patient = new Patient();
$patient->setPersonId($row->patientId);
$patient->populate();
$person = $patient->person;
$this->_session->currentAppointments[$columnIndex][$row->appointmentId] = $row;
$zIndex++;
$columnData[$tmpIndex]['id'] = $row->appointmentId . 'i' . $columnData[$tmpIndex]['id'];
$appointmentId = $row->appointmentId;
$visitIcon = '';
$visit = new Visit();
$visit->appointmentId = $appointmentId;
$visit->populateByAppointmentId();
if ($visit->visitId > 0) {
$visitIcon = '<img src="' . $this->view->baseUrl . '/img/appointment_visit.png" alt="' . __('Visit') . '" title="' . __('Visit') . '" style="border:0px;height:18px;width:18px;margin-left:5px;" />';
}
$routingStatuses = array();
if (strlen($row->appointmentCode) > 0) {
$routingStatuses[] = __('Mark') . ': ' . $row->appointmentCode;
//.........这里部分代码省略.........
示例2: generateEventColumnData
protected function generateEventColumnData($columnIndex)
{
$columnIndex = (int) $columnIndex;
$columnData = array();
$scheduleEventIterator = new ScheduleEventIterator();
$appointmentIterator = new AppointmentIterator();
if (!isset($this->getCurrentDisplayFilter()->columns[$columnIndex])) {
throw new Exception(__("Cannot generate column with that index, there is no filter defined for that column Index: ") . $columnIndex);
}
$this->_session->currentAppointments[$columnIndex] = array();
$filter = $this->getCurrentDisplayFilter();
$filterTimeStart = strtotime($filter->start);
$filterTimeEnd = strtotime($filter->end);
$paramFilters = $filter->columns[$columnIndex];
if (isset($paramFilters['dateFilter'])) {
$filter->date = date('Y-m-d', strtotime($paramFilters['dateFilter']));
}
$paramFilters['start'] = $filter->date . ' ' . $filter->start;
$paramFilters['end'] = $filter->date . ' ' . $filter->end;
$paramFilters['start'] = $filter->date . ' ' . $filter->start;
$paramFilters['end'] = $filter->date . ' 23:59:59';
$scheduleEventIterator->setFilter($paramFilters);
// we need to get the length of time to create number of rows in the grid
$timeLen = ($filterTimeEnd - $filterTimeStart) / 60 / $filter->increment;
for ($i = 0; $i <= $timeLen; $i++) {
$row = array();
// assign row id as rowNumber and columnIndex
$row['id'] = $i . $columnIndex;
$row['data'][0] = '';
$columnData[$i] = $row;
}
$filterToTimeStart = strtotime($paramFilters['start']);
$appointmentIterator->setFilter($paramFilters);
// hold the temporary data counter
$tmpDataCtr = array();
$colMultiplier = 1;
$patient = new Patient();
$room = new Room();
$zIndex = 0;
foreach ($appointmentIterator as $row) {
$startToTime = strtotime($row->start);
$endToTime = strtotime($row->end);
$tmpStart = date('H:i', $startToTime);
$tmpEnd = date('H:i', $endToTime);
$timeLen = ($endToTime - $startToTime) / 60 / $filter->increment;
$tmpIndex = ($startToTime - $filterToTimeStart) / 60 / $filter->increment;
if (!isset($columnData[$tmpIndex])) {
break;
}
$index = $tmpIndex;
for ($j = 1; $j <= $timeLen; $j++) {
if (!isset($columnData[$index])) {
break;
}
$index++;
}
$j--;
$height = 20 * $j * 1.1;
$marginLeft = 8;
$multiplier = 1;
// generate ranges code inside if ($multiplier === 1) block
$incTime = $startToTime;
$ranges = array();
for ($ctr = 1; $ctr <= $timeLen; $ctr++) {
$ranges[] = date('H:i', $incTime);
$incTime = strtotime("+{$filter->increment} minutes", $incTime);
}
// check for appointment intersection
foreach ($tmpDataCtr as $keyCtr => $dataCtr) {
if (in_array($tmpStart, $dataCtr['ranges'])) {
// merge the ranges if we need to have a nested multiple bookings
// uncomment if this is not the case and move the generate ranges to its proper location for code optimization
$tmpDataCtr[$keyCtr]['ranges'] = array_merge($dataCtr['ranges'], $ranges);
$tmpDataCtr[$keyCtr]['multiplier']++;
$multiplier = $tmpDataCtr[$keyCtr]['multiplier'];
break;
}
}
if ($multiplier === 1) {
$tmpDataCtr[] = array('ranges' => $ranges, 'multiplier' => $multiplier);
} else {
$marginLeft = ($multiplier - 1) * 250;
}
if ($multiplier > $colMultiplier) {
$colMultiplier = $multiplier;
}
$patient->setPersonId($row->patientId);
$patient->populate();
$person = $patient->person;
$room->setRoomId($row->roomId);
$room->populate();
$this->_session->currentAppointments[$columnIndex][$row->appointmentId] = $row;
$mark = '';
if (strlen($row->appointmentCode) > 0) {
$mark = "({$row->appointmentCode})";
}
$zIndex++;
// where to use room?
$columnData[$tmpIndex]['id'] = $row->appointmentId . 'i' . $columnData[$tmpIndex]['id'];
$appointmentId = $row->appointmentId;
//.........这里部分代码省略.........