function Render(&$AInfo) { $vDB = GetDB(); $vBranchInfo = GetBranchInfo(); $this->AddPage(); $this->SetFont('arial_rus', '', 10); $vWidth = $this->GetAreaWidth() / 2 - 10; $vHeight = $this->FontSize; $vHeightLN = $this->FontSize * 1.5; $vX = $this->GetX(); $vY = $this->GetY(); $this->SetXY($vX, $vY); $this->Cell($vWidth, $vHeight, 'Министерство здравоохранения', '', 0, 'L'); $this->Ln($vHeightLN); $this->Cell($vWidth, $vHeight, 'и социального развития', '', 0, 'L'); $this->Ln($vHeightLN); $this->Cell($vWidth, $vHeight, 'Российской Федерации', '', 0, 'L'); $this->Ln($vHeightLN); $this->Cell($vWidth, $vHeight, iconv("utf8", "windows-1251", @$vBranchInfo['name']), '', 0, 'L'); $this->Cell($vWidth, $vHeight, '', '', 0, 'L'); $this->Ln($vHeightLN); $this->ExactCell($vHeight, 'Код ОГРН '); $this->BoxedText($vWidth, $vHeight, iconv("utf8", "windows-1251", $vBranchInfo['OGRN'])); $this->Ln($vHeightLN); $this->SetFont('arial_rus', '', 10); $vHeight = $this->FontSize; $vHeightLN = $this->FontSize * 1.5; $this->Cell($vWidth, $vHeight, 'НАПРАВЛЕНИЕ НА ЛФК', '', 0, 'C'); $this->Ln($vHeightLN); // $this->Notes('Карта стационарного (амб.) больного №', 0, $vWidth, 1, @$AInfo['case_id']); $this->Notes('Фамилия, имя, отчество', 0, $vWidth, 1, FormatShortNameEx($AInfo)); $vX = $this->GetX(); $vY = $this->GetY(); $this->Notes('Возраст ', 0, $vWidth / 2, 1, CalcAge(@$AInfo['born_date'])); $this->SetXY($vX + $vWidth / 2, $vY); $this->Notes('Пол', 0, $vWidth / 2, 1, iconv("utf8", "windows-1251", FormatSex($AInfo['is_male']))); $vBlock = array(); $vBlock[] = array('title' => 'Адрес', 'text' => iconv("utf8", "windows-1251", FormatAddress(@$AInfo['addr_reg_street'], @$AInfo['addr_reg_num'], @$AInfo['addr_reg_subnum'], @$AInfo['addr_reg_apartment']))); $vBlock[] = array('title' => 'Документ', 'text' => iconv("utf8", "windows-1251", FormatDocument(@$AInfo['doc_type_id'], @$AInfo['doc_series'], @$AInfo['doc_number']))); $vBlock[] = array('title' => 'Полис', 'text' => iconv("utf8", "windows-1251", FormatPolisEx(@$AInfo['insurance_company_id'], @$AInfo['polis_series'], @$AInfo['polis_number']))); $vBlock[] = array('title' => 'Диагноз', 'text' => iconv("utf8", "windows-1251", @$AInfo['diagnosis']), 'rows' => 3); $vBlock[] = array('title' => 'Дата', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong(date('Y-m-d', time())))); $vBlock[] = array('title' => 'Врач', 'text' => iconv("utf8", "windows-1251", FormatUserName(@$AInfo['doctor_id']))); $this->BlockNotes($vBlock, $vWidth); }
function FirstPage($AData) { $vBranchInfo = GetBranchInfo(); $this->AddPage(); $this->SetFont('arial_rus', '', 10); $vWidth = $this->GetAreaWidth(); $vHeight = $this->FontSize * 1.5; $vX = $this->GetX(); $vY = $this->GetY(); $this->SetXY($vX + 0, $vY); // $this->Cell($vWidth, $vHeight, 'СПб ГУЗ ГП №51 Травматологическое отделение', 'B', 0, 'L'); $this->Cell($vWidth, $vHeight, iconv("utf8", "windows-1251", @$vBranchInfo['name']), 'B', 0, 'L'); $this->Ln($vHeight); $this->SetFont('arial_rus', '', 14); $vHeight = $this->FontSize * 1.5; $this->Cell($vWidth, $vHeight, 'Направление на рентгенологическое исследование'); $this->Ln($vHeight); $this->SetFont('arial_rus', '', 10); $vHeight = $this->FontSize * 1.5; /* $vTitles = array('Дата', 'История болезни №', 'Фамилия Имя Отчество', 'Дата рождения', 'Объективный статус', 'Область исследования', 'Описание'); $vTitleWidth = 0; foreach( $vTitles as $vTitle ) { $vTitleWidth = max($vTitleWidth, $this->GetStringWidth($vTitle)+3); } $this->Notes($vTitles[0], $vTitleWidth, $vWidth, 1, Date2ReadableLong($AData['date'])); $this->Notes($vTitles[1], $vTitleWidth, $vWidth, 1, $AData['case_id']); $this->Notes($vTitles[2], $vTitleWidth, $vWidth, 1, $AData['case']['last_name'].' '.$AData['case']['first_name'].' '.$AData['case']['patr_name']); $this->Notes($vTitles[3], $vTitleWidth, $vWidth, 1, Date2ReadableLong($AData['case']['born_date'])); $this->Notes($vTitles[4], $vTitleWidth, $vWidth, 3, $AData['objective']); $this->Notes($vTitles[5], $vTitleWidth, $vWidth, 1, $AData['area']); */ $vCase =& $AData['case']; $vBlock = array(array('title' => 'Дата', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong($AData['date']))), array('title' => 'История болезни №', 'text' => $AData['case_id']), array('title' => 'Фамилия Имя Отчество', 'text' => iconv("utf8", "windows-1251", $vCase['last_name']) . ' ' . iconv("utf8", "windows-1251", $vCase['first_name']) . ' ' . iconv("utf8", "windows-1251", $vCase['patr_name'])), array('title' => 'Дата рождения', 'text' => iconv("utf8", "windows-1251", FormatBornDateAndAgeLong($AData['date'], @$vCase['born_date']))), array('title' => 'Пол', 'text' => @$vCase['is_male'] ? 'мужской' : 'женский'), array('title' => 'Адрес регистрации', 'text' => iconv("utf8", "windows-1251", FormatAddress(@$vCase['addr_reg_street'], @$vCase['addr_reg_num'], @$vCase['addr_reg_subnum'], @$vCase['addr_reg_apartment']))), array('title' => 'Адрес проживания', 'text' => iconv("utf8", "windows-1251", FormatAddress(@$vCase['addr_phys_street'], @$vCase['addr_phys_num'], @$vCase['addr_phys_subnum'], @$vCase['addr_phys_apartment']))), array('title' => 'Документ', 'text' => iconv("utf8", "windows-1251", FormatDocument(@$vCase['doc_type_id'], @$vCase['doc_series'], @$vCase['doc_number']))), array('title' => 'Телефон(ы)', 'text' => @$vCase['phone']), array('title' => 'Категория', 'text' => iconv("utf8", "windows-1251", FormatCategory(@$vCase['employment_category_id']))), array('title' => 'Место работы', 'text' => iconv("utf8", "windows-1251", @$vCase['employment_place'])), array('title' => 'Профессия', 'text' => iconv("utf8", "windows-1251", @$vCase['profession'])), array('title' => 'Полис', 'text' => iconv("utf8", "windows-1251", FormatPolis(@$vCase['insurance_company_id'], @$vCase['polis_series'], @$vCase['polis_number']))), array('title' => 'что произошло', 'text' => iconv("utf8", "windows-1251", @$vCase['accident'])), array('title' => 'дата и время', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong(@$vCase['accident_datetime']))), array('title' => 'Диагноз предварительный', 'text' => iconv("utf8", "windows-1251", $AData['diagnosis']), 'rows' => 2), array('title' => 'Область исследования', 'text' => iconv("utf8", "windows-1251", $AData['area']), 'rows' => 2), array('title' => 'Направил', 'text' => iconv("utf8", "windows-1251", FormatUserName($AData['user_id']))), array('title' => 'Описание', 'text' => iconv("utf8", "windows-1251", $AData['description']), 'rows' => 1)); $this->BlockNotes($vBlock, $vWidth); $this->Ln($vHeight * 5); $vBlock = array(array('title' => 'Диагноз заключительный', 'text' => '', 'rows' => 2)); $this->BlockNotes($vBlock, $vWidth); }
function OutCard($ACaseID, &$ASurgeries) { $vDB = GetDB(); $vCase = $vDB->GetById('emst_cases', $ACaseID); $this->SetFont('arial_rus', '', 10); $vHeight = $this->FontSize * 1.5; $vWidth = $this->GetAreaWidth(); // $vName = trim(@$vCase['last_name'].' '.@$vCase['first_name'].' '.@$vCase['patr_name']); $vName = FormatNameEx($vCase); $this->Cell(20, $vHeight, 'Ф.И.О.'); $this->Cell(70, $vHeight, $vName, 'B'); $this->ExactCell($vHeight, ' И.Б. № '); $this->Cell(15, $vHeight, $ACaseID, 'B'); // $this->Ln($vHeight); $this->ExactCell($vHeight, ' пол '); $this->Cell(5, $vHeight, FormatSex(@$vCase['is_male']), 'B'); $this->ExactCell($vHeight, ' дата рождения '); $this->Cell(30, $vHeight, Date2Readable(@$vCase['born_date']), 'B'); $this->Ln($vHeight); $this->Cell(20, $vHeight, 'Категория'); $this->Cell(20, $vHeight, '11-прочее', 'B'); $this->ExactCell($vHeight, ' работабщий '); $this->Cell(10, $vHeight, FormatBoolean(@$vCase['employment_category_id'] == 1), 'B'); $this->Ln($vHeight); $this->Cell(20, $vHeight, 'Документ'); $this->Cell(70, $vHeight, FormatDocument(@$vCase['doc_type_id'], @$vCase['doc_series'], @$vCase['doc_number']), 'B'); $this->Ln($vHeight); $this->Cell(20, $vHeight, 'Полис'); $this->Cell(70, $vHeight, FormatPolis(@$vCase['insurance_company_id'], @$vCase['polis_series'], @$vCase['polis_number']), 'B'); $this->Ln($vHeight); $this->Cell(20, $vHeight, 'Адр.рег.'); $this->Cell(70, $vHeight, FormatAddress(@$vCase['addr_reg_street'], @$vCase['addr_reg_num'], @$vCase['addr_reg_subnum'], @$vCase['addr_reg_apartment']), 'B'); $this->Ln($vHeight); $this->Cell(20, $vHeight, 'Адр.факт.'); $this->Cell(70, $vHeight, FormatAddress(@$vCase['addr_phys_street'], @$vCase['addr_phys_num'], @$vCase['addr_phys_subnum'], @$vCase['addr_phys_apartment']), 'B'); $this->Ln($vHeight); $vCount = count($ASurgeries); if ($vCount > 0) { $vLast = $ASurgeries[$vCount - 1]; } else { $vLast = array(); } $this->Cell(20, $vHeight, 'Цель'); $this->Cell(30, $vHeight, '1-Леч.-диагн.', 'B'); $this->Cell(20, $vHeight, 'Случай'); $this->Cell(30, $vHeight, '1-Первичный', 'B'); $this->Cell(30, $vHeight, 'Законченность'); $this->Cell(10, $vHeight, FormatBoolean(!empty($vLast['clinical_outcome_id'])), 'B'); $this->Ln($vHeight); $this->Cell(20, $vHeight, 'Исход'); $this->Cell(70, $vHeight, FormatClinicalOutcome(@$vLast['clinical_outcome_id'], @$vLast['clinical_outcome_notes']), 'B'); $this->Ln($vHeight); $this->Cell(20, $vHeight, 'Диагноз'); $vTmp = $vCase['diagnosis']; if (strlen($vTmp) > 80) { $vTmp = substr($vTmp, 0, 80 - 3) . '...'; } $this->Cell(140, $vHeight, $vTmp, 'B'); $this->Cell(10, $vHeight, 'МКБ'); $this->Cell(20, $vHeight, @$vCase['diagnosis_mkb'], 'B'); $this->Ln($vHeight); $this->Cell(20, $vHeight, 'Характер'); $this->Cell(20, $vHeight, '1-Острое', 'B'); $this->Cell(20, $vHeight, 'Травма'); $this->Cell(60, $vHeight, FormatTraumaType(@$vCase['trauma_type_id']), 'B'); $this->Ln($vHeight); $this->CheckSpace($vHeight * 4); $this->Cell(40, $vHeight, 'ПОСЕЩЕНИЯ'); $this->Ln($vHeight); $this->OutSurgery($vHeight, array('№', 'Дата', 'Врач', 'Специальность', 'Цель', 'Место'), 'C'); for ($i = 0; $i < $vCount; $i++) { $vSurgery =& $ASurgeries[$i]; $this->OutSurgery($vHeight, array(1 + $i, Date2Readable(ExtractWord($vSurgery['date'], ' ', 0)), FormatUserName($vSurgery['user_id']), 'травматолог', '1-Леч.диагн.', '1-Амбулаторно')); } $vIllDocs = array(); $vPrevIllDoc = null; for ($i = 0; $i < $vCount; $i++) { $vSurgery =& $ASurgeries[$i]; if (!empty($vSurgery['ill_doc'])) { if (empty($vPrevIllDoc) || $vPrevIllDoc['ill_doc'] != $vSurgery['ill_doc'] || $vPrevIllDoc['ill_beg_date'] != $vSurgery['ill_beg_date'] || $vPrevIllDoc['ill_end_date'] != $vSurgery['ill_end_date']) { $vIllDocs[] = $vSurgery; $vPrevIllDoc =& $vSurgery; } } } if (count($vIllDocs)) { $this->CheckSpace($vHeight * 4); $this->Cell(40, $vHeight, 'НЕТРУДОСПОСОБНОСТЬ'); $this->Ln($vHeight); $this->OutIllDoc($vHeight, array('№', 'Док.', 'Врач', 'Повод', 'Дата откр.', 'Дата закр.', 'Кому', 'Пол', 'Возр.'), 'C'); for ($i = 0; $i < count($vIllDocs); $i++) { $vSurgery = $vIllDocs[$i]; $this->OutIllDoc($vHeight, array(1 + $i, '1-Б/Л', FormatUserName($vSurgery['user_id']), '1-Заб.', Date2Readable($vSurgery['ill_beg_date']), Date2Readable($vSurgery['ill_end_date']), '1-Пац', FormatSex(@$vCase['is_male']), CalcAge(@$vCase['born_date'], $vSurgery['ill_beg_date']))); } $this->Cell(20, $vHeight, 'Б/Л. '); $this->Cell(40, $vHeight, $vIllDocs[count($vIllDocs) - 1]['ill_doc'], 'B'); } // $this->Ln($vHeight); // $this->Cell($vWidth, $vHeight, ); // $this->Ln($vHeight); // $this->Cell($vWidth, $vHeight, Date2Readable(@$vCase['born_date'])); $this->Ln($vHeight); $this->Ln($vHeight); }