Example #1
0
 function Render(&$AConclusion)
 {
     $vDB = GetDB();
     $vHeavitiesList = $vDB->GetRBList('rb_trauma_heavity', 'id', 'name', true);
     $this->SetMargins(20, 20, 20);
     $this->SetAutoPageBreak(true, 30);
     $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, $vY);
     $this->Cell($vWidth, $vHeight, iconv("utf8", "windows-1251", @$vBranchInfo['name']), 'B', 0, 'L');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'Медицинская документация', '', 0, 'R');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'Учетная форма № 315/у', '', 0, 'R');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'УТВЕРЖДЕНА', '', 0, 'R');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'Приказом Минздравсоцразвития России', '', 0, 'R');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'От 15 апреля 2005 г. №275', '', 0, 'R');
     $this->Ln($vHeight);
     $this->Ln($vHeight);
     $this->SetFont('arial_rus', '', 14);
     $vHeight = $this->FontSize * 1.5;
     $this->Cell($vWidth, $vHeight, 'МЕДИЦИНСКОЕ ЗАКЛЮЧЕНИЕ', '', 0, 'C');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'о характере полученных повреждений здоровья в результате несчастного', '', 0, 'C');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'случая на производстве и степени их тяжести', '', 0, 'C');
     $this->Ln($vHeight);
     $this->Ln($vHeight);
     $this->SetFont('arial_rus', '', 10);
     $vHeight = $this->FontSize * 1.5;
     $vBlock = array();
     $vBlock[] = array('title' => 'Выдано', 'text' => iconv("utf8", "windows-1251", @$AConclusion['employment_place']));
     $vBlock[] = array('title' => 'О том, что пострадавший', 'text' => iconv("utf8", "windows-1251", FormatNameEx($AConclusion)));
     $vBlock[] = array('title' => 'дата рождения', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong(@$AConclusion['born_date'])));
     $vBlock[] = array('title' => 'должность (профессия)', 'text' => iconv("utf8", "windows-1251", @$AConclusion['profession']));
     $vBlock[] = array('title' => 'поступил в', 'text' => iconv("utf8", "windows-1251", @$vBranchInfo['name']));
     $vBlock[] = array('title' => 'дата и время обращения', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong(@$AConclusion['create_time'])));
     $vBlock[] = array('title' => 'Диагноз', 'text' => iconv("utf8", "windows-1251", @$AConclusion['diagnosis']));
     $vBlock[] = array('title' => 'Код диагноза по МКБ', 'text' => iconv("utf8", "windows-1251", @$AConclusion['diagnosis_mkb']));
     $this->BlockNotes($vBlock, $vWidth);
     $this->Cell($vWidth, $vHeight, 'Согласно схеме определения степени тяжести повреждения здоровья при несчастных случаях', '', 0, 'L');
     $this->Ln($vHeight);
     $vBlock = array();
     $vBlock[] = array('title' => 'на производстве указанное повреждение относится к категории', 'text' => iconv("utf8", "windows-1251", @$vHeavitiesList[$AConclusion['heavity']]));
     $this->BlockNotes($vBlock, $vWidth);
     $this->Ln($vHeight);
     $vBlock = array();
     $vBlock[] = array('title' => 'Врач', 'text' => iconv("utf8", "windows-1251", FormatUserName(@$AConclusion['doctor_id'])));
     $vBlock[] = array('title' => 'Дата', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong($vDB->ConvertToDate(time()))));
     $this->BlockNotes($vBlock, $vWidth);
     $this->Ln($vHeight);
 }
Example #2
0
 function Header()
 {
     $vBranchInfo = GetBranchInfo();
     $this->SetFont('arial_rus', '', 9);
     $vHeight = $this->FontSize * 1.5;
     $vWidth = $this->GetAreaWidth();
     $vX = $this->GetX();
     $this->Cell($vWidth, $vHeight, iconv('utf-8', 'cp1251', @$vBranchInfo['name']), '', 0, 'L');
     $this->SetX($vX);
     $this->Cell($vWidth, $vHeight, iconv('utf-8', 'cp1251', 'стр. ') . $this->PageNo(), '', 0, 'R');
     $this->Ln($vHeight);
     if ($this->PageNo() > 1) {
         $this->OutColNumbers();
     }
 }
Example #3
0
 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);
 }
Example #4
0
 function DrawLine($ACEC)
 {
     $vBranchInfo = GetBranchInfo();
     $vHeight = $this->FontSize * 1.5;
     $vRowData = array();
     $vCECDate = ExtractWord($ACEC['date'], ' ', 0);
     $vCaseID = $ACEC['case_id'];
     $vNumCECesBefore = GetNumCECes($vCaseID, $vCECDate, $ACEC['id']);
     $vCECNumber = $ACEC['cec_number'];
     if ($vCECNumber == 0) {
         $vCECNumber = '';
     }
     $vRowData[] = $vCECNumber . "\n(" . ($vNumCECesBefore + 1) . ')';
     //   'Дата',
     $vRowData[] = Date2Readable($vCECDate);
     //   'Врач',
     $vRowData[] = FormatUserName($ACEC['user_id']);
     //   'Ф.И.О. больного' & 'Дата рождения'
     //            $vRowData[] = FormatName($ACEC['last_name'], $ACEC['first_name'],$ACEC['patr_name'])
     $vRowData[] = FormatNameEx($ACEC) . "\n" . FormatBornDateAndAge($vCECDate, $ACEC['born_date']) . "\nи.б. " . $vCaseID;
     //            $vRowData[] = FormatSex($ACase['is_male']);
     //   'Адрес',
     $vRowData[] = FormatAddress($ACEC['addr_reg_street'], $ACEC['addr_reg_num'], $ACEC['addr_reg_subnum'], $ACEC['addr_reg_apartment']);
     //            $vRowData[] = $ACase['phone'];
     //   'Место работы' & 'Профессия'
     $vTmpList = array();
     $vTmp = FormatWorkableAge($vCECDate, $ACEC['born_date'], $ACEC['is_male']);
     if (!empty($vTmp)) {
         $vTmpList[] = $vTmp;
     }
     $vTmp = FormatCategory($ACEC['employment_category_id']);
     if (!empty($vTmp)) {
         $vTmpList[] = $vTmp;
     }
     $vTmp = $ACEC['employment_place'];
     if (!empty($vTmp)) {
         $vTmpList[] = $vTmp;
     }
     $vTmp = $ACEC['profession'];
     if (!empty($vTmp)) {
         $vTmpList[] = $vTmp;
     }
     $vRowData[] = implode(",\n", $vTmpList);
     //   'Диагноз',
     $vRowData[] = $ACEC['diagnosis'];
     //   '№ листка нетрудоспособности',
     $vTmp = $ACEC['ill_doc'];
     if (!empty($vTmp)) {
         $vTmp .= "\n" . Date2Readable($ACEC['disability_from_date']);
         $vTmp .= "\n" . Date2Readable($vCECDate);
         $vTmp .= "\n(" . (DateDiff($vCECDate, $ACEC['disability_from_date']) + 1) . ')';
     }
     $vRowData[] = $vTmp;
     //   'Заключение комиссии'
     $vRowData[] = "лечение продлено\nс " . Date2Readable(DateAddDay($vCECDate)) . "\nпо " . Date2Readable($ACEC['cec_cureup_date']) . "\n(" . DateDiff($ACEC['cec_cureup_date'], $vCECDate) . ')';
     //   'Подписи членов комиссии'
     $vTmp = $ACEC['cec_members'];
     if (empty($vTmp)) {
         $vTmp = $vBranchInfo['cec_members'];
     }
     $vRowData[] = $vTmp;
     foreach ($vRowData as &$v) {
         $v = iconv('utf-8', 'cp1251', $v);
     }
     $this->OutTableRow($vHeight, $vRowData);
 }
Example #5
0
 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);
 }
Example #6
0
 function FirstPage($ASurgery)
 {
     $this->AddPage();
     $this->SetFont('arial_rus', '', 10);
     $vWidth = $this->GetAreaWidth();
     $vHeight = $this->FontSize;
     //            $this->Image('images/ill.jpeg', 0, 0, 140, 207);
     if ($ASurgery['ill_doc_is_continue']) {
         $this->MarkContinue();
     } else {
         $this->MarkPrimary();
     }
     $vCase =& $ASurgery['case'];
     if (DateIsEmpty($ASurgery['ill_beg_date']) && !DateIsEmpty($vCase['disability_from_date'])) {
         $ASurgery['ill_beg_date'] = $vCase['disability_from_date'];
     } else {
         if (!DateIsEmpty($ASurgery['ill_beg_date']) && DateIsEmpty($vCase['disability_from_date'])) {
             $vCase['disability_from_date'] = $ASurgery['ill_beg_date'];
         }
     }
     //            print_r($ASurgery);
     //            $vName = trim($vCase['last_name'].' '.$vCase['first_name'].' '.$vCase['patr_name']);
     $vName = iconv('utf-8', 'cp1251', FormatNameEx($vCase));
     $this->Text(18, 19, $vName);
     $vDocName = iconv('utf-8', 'cp1251', FormatUserName($ASurgery['user_id']));
     $this->Text(95, 19, $vDocName);
     $vAddress = iconv('utf-8', 'cp1251', @FormatAddress($vCase['addr_reg_street'], $vCase['addr_reg_num'], $vCase['addr_reg_subnum'], $vCase['addr_reg_apartment']));
     $this->Text(18, 24, $vAddress);
     $this->Text(120, 24, $vCase['id']);
     $this->Text(18, 29, $vCase['employment_place']);
     $vDate = explode(' ', iconv('utf-8', 'cp1251', Date2ReadableLong($ASurgery['ill_beg_date'])));
     if (!empty($vDate[2])) {
         $vDate[2] = substr($vDate[2], -2);
     }
     $this->Text(27, 34, @($vDate[0] . ' ' . $vDate[1]));
     $this->Text(75, 34, @$vDate[2]);
     // -----------------------------------------------------------------
     $vIllFromDate = iconv('utf-8', 'cp1251', Date2ReadableLong($vCase['disability_from_date']));
     if (!empty($vIllFromDate)) {
         $this->Text(80, 48, 'C ' . $vIllFromDate);
     }
     //          $this->Text(15, 59, 'СПб ГУЗ ГП №51, Космонавтов 35');
     $vBranchInfo = GetBranchInfo();
     $this->Text(15, 59, @$vBranchInfo['ill_doc_name']);
     $this->Text(24, 63.5, $vDate[0] . ' ' . $vDate[1]);
     $this->Text(70, 63.5, $vDate[2]);
     $this->Text(15, 69, $vName);
     $this->Text(110, 69, CalcAge($vCase['born_date'], $ASurgery['ill_beg_date']));
     if ($vCase['is_male']) {
         $this->Ellipse(124, 68, 3, 2);
     } else {
         $this->Ellipse(131, 68, 3, 2);
     }
     $this->Text(15, 73.5, $vCase['employment_place']);
 }
Example #7
0
 function Render(&$AStudinfo)
 {
     $vDB = GetDB();
     $vName = FormatNameEx($AStudinfo);
     $this->SetMargins(0, 0, 0);
     $this->SetAutoPageBreak(true, 0);
     $vBranchInfo = GetBranchInfo();
     $this->AddPage();
     //        $this->Image('images/studinfo.jpeg', 10, 2, 284, 201);
     # =============================================================
     # первая страница
     $this->SetFont('times', '', 10.5);
     $vHeight = $this->FontSize;
     $this->SetXY(80, 9);
     $this->ExactCell($vHeight, 'Код формы по ОКУД __________');
     $this->SetXY(80, 13);
     $this->ExactCell($vHeight, 'Код учреждения по ОКПО ______');
     $this->Line(12, 19, 135, 19);
     $this->Line(12, 24, 85, 24);
     $this->Line(12, 32, 135, 32);
     $this->Line(85, 19, 85, 32);
     $this->SetXY(12, 19);
     $this->Cell(85 - 12, 24 - 19, 'Министерство здравоохранения СССР', '', 0, 'C');
     $this->SetXY(12, 24);
     $this->SetFont('times', '', 9.5);
     $this->Cell(85 - 12, 2, 'наименование учреждения', '', 0, 'C');
     $this->SetFont('courier', '', 10.5);
     $this->SetXY(12, 25);
     $this->MultiCell(85 - 12, 3.5, iconv("utf8", "windows-1251", @$vBranchInfo['name']), 0, 'L');
     $this->SetFont('times', '', 10.5);
     $this->SetXY(85, 19);
     $this->MultiCell(135 - 85, (32 - 19) / 4, "Медицинская документация\nФорма № 095/у\nУтв. Минздравом СССР\n04.10.80 № 1030", 0, 'C');
     $this->SetFont('times', 'B', 15.5);
     $this->SetXY(21, 35);
     $this->ExactCell($this->FontSize, 'Контрольный талон к справке № _________');
     $this->SetFont('times', '', 11.5);
     $this->SetXY(11, 44);
     $this->ExactCell($this->FontSize, 'Дата выдачи  ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, 135, $vY);
     $this->SetFont('courier', '', 12);
     $this->SetXY(55, 44);
     //        $this->ExactCell($this->FontSize, Date2ReadableLong($vDB->ConvertToDate(time())));
     //        $this->ExactCell($this->FontSize, Date2ReadableLong($vDB->ConvertToDate(@$AStudinfo['date'])));
     $this->ExactCell($this->FontSize, iconv("utf8", "windows-1251", Date2ReadableLong(@$AStudinfo['date'])));
     $this->SetFont('times', '', 11.5);
     $this->SetXY(11, 51);
     $this->ExactCell($this->FontSize, 'Фамилия, имя, отчество ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, 135, $vY);
     $this->Line(12, $vY + 7, 135, $vY + 7);
     $this->SetFont('courier', '', 12);
     $this->SetXY(55, 49);
     $this->MultiCell(135 - 50, 7, iconv("utf8", "windows-1251", $vName), 0, 'L');
     $this->SetFont('times', '', 11.5);
     $this->SetXY(11, 64);
     $this->ExactCell($this->FontSize, 'Название учебного заведения, детского дошкольного учреждения');
     $vY = $this->GetY() + $this->FontSize + 7;
     $this->Line(12, $vY, 135, $vY);
     $vY += 7;
     $this->Line(12, $vY, 135, $vY);
     $vY += 7;
     $this->Line(12, $vY, 135, $vY);
     $this->SetFont('courier', '', 12);
     $this->SetXY(11, 69);
     $this->MultiCell(135 - 11, 7, iconv("utf8", "windows-1251", @$AStudinfo['studinfo_target']), 0, 'L');
     $this->SetFont('times', '', 11.5);
     $this->SetXY(11, 91);
     $this->ExactCell($this->FontSize, 'Диагноз заболевания ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, 135, $vY);
     $vY += 7;
     $this->Line(12, $vY, 135, $vY);
     $vY += 7;
     $this->Line(12, $vY, 135, $vY);
     $vY += 7;
     $this->Line(12, $vY, 135, $vY);
     $vY += 7;
     $this->Line(12, $vY, 135, $vY);
     list($vDiagnosis, $vFontSize, $vStep) = $this->SelectFontSize(iconv("utf8", "windows-1251", @$AStudinfo['diagnosis']), array(87, 125), 12, 7, 5);
     //            $this->SetFont('courier','',$vFontSize);
     //            $vTexts = $this->SplitText(@$AStudinfo['diagnosis'], array(87, 125));
     $vX1 = 50;
     $vY1 = 91;
     for ($i = 0; $i < count($vDiagnosis); $i++) {
         $this->SetXY($vX1, $vY1);
         $this->ExactCell($this->FontSize, iconv("utf8", "windows-1251", $vDiagnosis[$i]));
         $vX1 = 11;
         $vY1 += $vStep;
     }
     $this->SetFont('times', '', 11.5);
     $this->SetXY(11, 126);
     $this->ExactCell($this->FontSize, 'Освобожден с ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, 82, $vY);
     $this->SetFont('times', '', 11.5);
     $this->SetXY(82, 126);
     $this->ExactCell($this->FontSize, 'по ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, 135, $vY);
     $this->SetFont('times', '', 11.5);
     $this->SetXY(11, 134);
     $this->ExactCell($this->FontSize, 'Освобождение');
     $this->SetXY(11, 139);
     $this->SetFont('times', '', 11.5);
     $this->ExactCell($this->FontSize, '     продлено с ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, 82, $vY);
     $this->SetFont('times', '', 11.5);
     $this->SetXY(82, 139);
     $this->ExactCell($this->FontSize, 'по ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, 135, $vY);
     $this->SetFont('times', '', 11.5);
     $this->SetXY(11, 149);
     $this->ExactCell($this->FontSize, 'Фамилия врача, выдавшего справку ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, 135, $vY);
     $vY += 7;
     $this->Line(12, $vY, 135, $vY);
     $this->SetFont('courier', '', 12);
     $this->SetXY($this->GetX(), 149);
     $this->ExactCell($this->FontSize, iconv("utf8", "windows-1251", iconv("utf8", "windows-1251", FormatUserName(@$AStudinfo['doctor_id']))));
     $this->SetFont('times', '', 11.5);
     $this->SetXY(11, 162);
     $this->ExactCell($this->FontSize, 'ПРИМЕЧАНИЕ:');
     $this->SetXY(45, 162);
     $this->ExactCell($this->FontSize, 'Контрольные талоны служат для учета выданных');
     $this->SetXY(45, 169);
     $this->ExactCell($this->FontSize, 'справок');
     $this->SetFont('times', '', 1);
     $this->SetXY(11, 200);
     $this->ExactCell($this->FontSize, 'A кроме того они очень годны для задалбывания программиста. Для самолётиков они явно маловаты, а самое им место - в сортире!');
     # =============================================================
     # вторая страница:
     $vX = 145;
     $this->SetFont('times', '', 10.5);
     $vHeight = $this->FontSize;
     $this->SetXY($vX + 80, 9);
     $this->ExactCell($vHeight, 'Код формы по ОКУД __________');
     $this->SetXY($vX + 80, 13);
     $this->ExactCell($vHeight, 'Код учреждения по ОКПО ______');
     $this->Line($vX + 12, 19, $vX + 135, 19);
     $this->Line($vX + 12, 24, $vX + 85, 24);
     $this->Line($vX + 12, 32, $vX + 135, 32);
     $this->Line($vX + 85, 19, $vX + 85, 32);
     $this->SetXY($vX + 12, 19);
     $this->Cell(85 - 12, 24 - 19, 'Министерство здравоохранения СССР', '', 0, 'C');
     $this->SetXY($vX + 12, 24);
     $this->SetFont('times', '', 9.5);
     $this->Cell(85 - 12, 2, 'наименование учреждения', '', 0, 'C');
     $this->SetFont('courier', '', 10.5);
     $this->SetXY($vX + 12, 25);
     $this->MultiCell(85 - 12, 3.5, iconv("utf8", "windows-1251", @$vBranchInfo['name']), 0, 'L');
     $this->SetFont('times', '', 10.5);
     $this->SetXY($vX + 85, 19);
     $this->MultiCell(135 - 85, (32 - 19) / 4, "Медицинская документация\nФорма № 095/у\nУтв. Минздравом СССР\n04.10.80 № 1030", 0, 'C');
     $this->SetFont('times', 'B', 16);
     $this->SetXY($vX + 43, 35);
     $this->ExactCell($this->FontSize, 'С П Р А В К А   № _________');
     $this->SetFont('times', 'B', 12.5);
     $this->SetXY($vX + 6, 42);
     $this->MultiCell(142 - 6, $this->FontSize + 0.5, "о временной нетрудоспособности студента, учащегося техникума,\nпрофессионально-технического училища, о болезни, карантине\nи прочих причинах отсутствия ребенка, посещающего школу,\nдетское дошкольное учреждение (нужное подчеркнуть)", 0, 'C');
     $vY = 42 + $this->FontSize;
     $vY1 = $vY + $this->FontSize + 0.5;
     $vY2 = $vY1 + $this->FontSize + 0.5;
     $vY3 = $vY2 + $this->FontSize + 0.5;
     switch (@$AStudinfo['studinfo_type']) {
         case 1:
             // студент ВУЗ
             $this->Line($vX + 8, $vY, $vX + 74, $vY);
             // о временной нетрудоспособности
             $this->Line($vX + 75, $vY, $vX + 93, $vY);
             // студента
             break;
         case 2:
             // студент техникума
             $this->Line($vX + 8, $vY, $vX + 74, $vY);
             // о временной нетрудоспособности
             $this->Line($vX + 95, $vY, $vX + 140, $vY);
             // учащегося техникума
             break;
         case 3:
             // ПТУ
             $this->Line($vX + 8, $vY, $vX + 74, $vY);
             // о временной нетрудоспособности
             $this->Line($vX + 95, $vY, $vX + 120, $vY);
             // учащегося
             $this->Line($vX + 10, $vY1, $vX + 93, $vY1);
             // профессионально-технического училища
             break;
         case 4:
             // школьник
             $this->Line($vX + 95, $vY1, $vX + 114, $vY1);
             // о болезни
             $this->Line($vX + 75, $vY2, $vX + 91, $vY2);
             // ребенка
             $this->Line($vX + 93, $vY2, $vX + 136, $vY2);
             // посещающего школу
             break;
         case 5:
             // дошкольник
             $this->Line($vX + 95, $vY1, $vX + 114, $vY1);
             // о болезни
             $this->Line($vX + 75, $vY2, $vX + 91, $vY2);
             // ребенка
             $this->Line($vX + 93, $vY2, $vX + 121, $vY2);
             // посещающего
             $this->Line($vX + 18, $vY3, $vX + 84, $vY3);
             // детское дошкольное учреждение
             break;
         default:
             break;
     }
     #       на будущее:
     #         $this->Line($vX+116, $vY1, $vX+138, $vY1);  /* карантине */
     #         $this->Line($vX+12, $vY2, $vX+91,  $vY2);   /* прочих причинах отсутствия ребенка */
     #         $this->Line($vX+75, $vY2, $vX+91,  $vY2);   /* ребенка */
     $vOutDate = Date2ReadableLong(@$AStudinfo['date']);
     //        $vOutDate = Date2ReadableLong($vDB->ConvertToDate(@$AStudinfo['date']));
     //        $vOutDate = Date2ReadableLong($vDB->ConvertToDate(time()));
     if (empty($vOutDate)) {
         $vOutDateParts = array('', '', '');
     } else {
         $vOutDateParts = explode(' ', $vOutDate);
     }
     //        Trace($vOutDate);
     //        Trace($vOutDateParts);
     $this->SetFont('times', '', 10.5);
     $vHeight = $this->FontSize;
     $this->SetXY($vX + 36, 65);
     $this->ExactCell($vHeight, 'Дата выдачи " ');
     $this->SetFont('courier', '', 12);
     $this->Cell(8, $vHeight, iconv("utf8", "windows-1251", @$vOutDateParts[0]), 'B', 0, 'C');
     $this->SetFont('times', '', 10.5);
     $this->ExactCell($vHeight, '"  ');
     $this->SetFont('courier', '', 12);
     $this->Cell(25, $vHeight, iconv("utf8", "windows-1251", @$vOutDateParts[1]), 'B', 0, 'C');
     $this->SetFont('courier', '', 12);
     $this->ExactCell($vHeight, iconv("utf8", "windows-1251", @$vOutDateParts[2]));
     $this->SetFont('times', '', 10.5);
     $this->ExactCell($vHeight, ' года ');
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 10, 71);
     $this->MultiCell(145 - 10, $this->FontSize + 0.5, "студенту, учащемуся, ребенку, посещающему дошкольное учрежде-\nние (нужное подчеркнуть)", 0, 'L');
     $vY = 71 + $this->FontSize;
     $vY1 = $vY + $this->FontSize + 0.5;
     switch (@$AStudinfo['studinfo_type']) {
         case 1:
             // студент ВУЗ
             $this->Line($vX + 11, $vY, $vX + 28, $vY);
             // студенту
             break;
         case 2:
             // студент техникума
             $this->Line($vX + 30, $vY, $vX + 51, $vY);
             // учащемуся
             break;
         case 3:
             // ПТУ
             $this->Line($vX + 30, $vY, $vX + 51, $vY);
             // учащемуся
             break;
         case 4:
             // школьник
             $this->Line($vX + 30, $vY, $vX + 51, $vY);
             // учащемуся
             break;
         case 5:
             // дошкольник
             $this->Line($vX + 53, $vY, $vX + 139, $vY);
             // посещающему дошкольное учрежде-
             $this->Line($vX + 11, $vY1, $vX + 18, $vY1);
             // ние
             break;
         default:
             break;
     }
     $this->Line($vX + 11, 86, $vX + 135, 86);
     $this->SetXY($vX + 10, 86);
     $this->SetFont('times', '', 9);
     $this->Cell(135 - 10, $this->FontSize, 'название учебного заведения, дошкольного', '', 0, 'C');
     $this->Line($vX + 11, 95, $vX + 135, 95);
     $this->SetXY($vX + 10, 95);
     $this->SetFont('times', '', 9);
     $this->Cell(135 - 10, $this->FontSize, 'учреждения', '', 0, 'C');
     $this->SetFont('courier', '', 12);
     $this->SetXY($vX + 12, 79);
     $this->MultiCell(135 - 12, 9, iconv("utf8", "windows-1251", @$AStudinfo['studinfo_target']), 0, 'L');
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 11, 101);
     $this->ExactCell($this->FontSize, 'Фамилия, имя, отчество ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, $vX + 135, $vY);
     $this->Line($vX + 12, $vY + 6.5, $vX + 135, $vY + 6.5);
     $this->SetFont('courier', '', 12);
     $this->SetXY($vX + 57, 100);
     $this->MultiCell(135 - 57, 6, iconv("utf8", "windows-1251", $vName), 0, 'L');
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 11, 114);
     $this->ExactCell($this->FontSize, 'Дата рождения (год, месяц, для детей до одного года - день) ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, $vX + 135, $vY);
     $this->Line($vX + 12, $vY + 6.5, $vX + 135, $vY + 6.5);
     $this->SetFont('courier', '', 12);
     $this->SetXY($vX + 12, $vY + 6 - $this->FontSize);
     $this->ExactCell($this->FontSize, iconv("utf8", "windows-1251", Date2ReadableLong(@$AStudinfo['born_date'])));
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 11, 127);
     $this->ExactCell($this->FontSize, 'Диагноз заболевания (прочие причины отсутствия) ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, $vX + 135, $vY);
     $this->Line($vX + 12, $vY + 6.5, $vX + 135, $vY + 6.5);
     $this->Line($vX + 12, $vY + 6.5 * 2, $vX + 135, $vY + 6.5 * 2);
     if (iconv("utf8", "windows-1251", @$AStudinfo['studinfo_show_diagnosis'])) {
         list($vDiagnosis, $vFontSize, $vStep) = $this->SelectFontSize(@$AStudinfo['diagnosis'], array(25, 125), 12, 6.5, 3);
         $vX1 = $vX + 110;
         $vY1 = 127;
         for ($i = 0; $i < count($vDiagnosis); $i++) {
             $this->SetXY($vX1, $vY1);
             $this->ExactCell($this->FontSize, $vDiagnosis[$i]);
             $vX1 = $vX + 11;
             $vY1 += $vStep;
         }
         $this->SetFont('times', '', 12.5);
         $this->SetXY($vX + 10, 192);
         $this->ExactCell($this->FontSize, 'Примечание: диагноз указан про просьбе пациента');
     }
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 11, 147);
     $this->ExactCell($this->FontSize, 'Наличие контакта с инфекционными больными (нет, да, какими)');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($vX + 105, $vY, $vX + 111, $vY);
     // нет
     $vY = $this->GetY() + $this->FontSize + 6;
     $this->Line($vX + 12, $vY, $vX + 135, $vY);
     $this->SetFont('times', '', 9);
     $this->SetXY($vX + 11, $vY);
     $this->Cell(135 - 10, $this->FontSize, '(подчеркнуть, вписать)', '', 0, 'C');
     $vY += 6.5;
     $this->Line($vX + 12, $vY, $vX + 135, $vY);
     $this->SetFont('times', '', 9);
     $this->SetXY($vX + 11, $vY);
     $this->Cell(135 - 10, $this->FontSize, 'освобожден от занятий, посещений детского дошкольного учреждения', '', 0, 'C');
     $vY += 7.5;
     $this->Line($vX + 12, $vY, $vX + 135, $vY);
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 10, 173);
     $this->ExactCell($this->FontSize, 'с ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, $vX + 68, $vY);
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 69, 173);
     $this->ExactCell($this->FontSize, 'по ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, $vX + 135, $vY);
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 10, 178);
     $this->ExactCell($this->FontSize, 'с ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, $vX + 68, $vY);
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 69, 178);
     $this->ExactCell($this->FontSize, 'по ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, $vX + 135, $vY);
     $this->SetFont('times', '', 12.5);
     $this->SetXY($vX + 10, 185);
     $this->ExactCell($this->FontSize, 'м.п. поликлиники');
     $this->SetFont('times', 'BI', 12);
     $this->SetXY($vX + 64, 186);
     $this->ExactCell($this->FontSize, 'Подпись врача  ');
     $vY = $this->GetY() + $this->FontSize;
     $this->Line($this->GetX(), $vY, $vX + 135, $vY);
     # ===============================================================
     # линия отреза
     $this->SetLineWidth(0.5);
     $this->SetDrawColor(128);
     $this->Line(149, 10, 149, 203);
 }
Example #8
0
 function Render(&$ADirection)
 {
     $vDB = GetDB();
     $vSubjectList = $vDB->GetRBList('rb_directions', 'id', 'name', true);
     $this->SetMargins(20, 20, 20);
     $this->SetAutoPageBreak(true, 30);
     $vBranchInfo = GetBranchInfo();
     $this->AddPage();
     $this->SetFont('arial_rus', '', 10);
     $vWidth = $this->GetAreaWidth();
     $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->Ln($vHeightLN);
     $this->ExactCell($vHeight, 'Код ОГРН  ');
     $this->BoxedText($vWidth, $vHeight, $vBranchInfo['OGRN']);
     $this->Ln($vHeightLN);
     $this->SetXY($vX, $vY);
     $this->Cell($vWidth, $vHeight, 'Медицинская документация', '', 0, 'R');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, 'форма № 057/у-04', '', 0, 'R');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, 'УТВЕРЖДЕНА', '', 0, 'R');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, 'Приказом Минздравсоцразвития России', '', 0, 'R');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, 'От 22 ноября 2004 г. №255', '', 0, 'R');
     $this->Ln($vHeightLN);
     $this->Ln($vHeightLN);
     $this->SetFont('arial_rus', '', 14);
     $vHeight = $this->FontSize;
     $vHeightLN = $this->FontSize * 1.5;
     $this->Cell($vWidth, $vHeight, 'НАПРАВЛЕНИЕ', '', 0, 'C');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, iconv("utf8", "windows-1251", @$vSubjectList[$ADirection['direction_subject']]), '', 0, 'C');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, iconv("utf8", "windows-1251", @$ADirection['direction_target']), 'B', 0, 'C');
     $this->Ln($vHeightLN);
     $this->Ln($vHeightLN);
     $this->SetFont('arial_rus', '', 10);
     $vHeight = $this->FontSize;
     $vHeightLN = $this->FontSize * 1.5;
     $this->ExactCell($vHeight, '1. Номер страхового полиса ОМС');
     $this->SetX(90);
     //            $this->Ln($vHeight);
     $this->BoxedText($vWidth, $vHeight, iconv("utf8", "windows-1251", @$ADirection['polis_series']) . ' ' . @$ADirection['polis_number'], 24);
     $this->Ln($vHeightLN);
     $this->ExactCell($vHeight, '2. Код льготы');
     $this->SetX(90);
     $this->BoxedText($vWidth, $vHeight, '', 3);
     $this->Ln($vHeightLN);
     $vBlock = array();
     $vBlock[] = array('title' => '3. Фамилия, Имя, Отчество', 'text' => iconv("utf8", "windows-1251", FormatNameEx($ADirection)));
     $vBlock[] = array('title' => '4. Дата рождения', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong(@$ADirection['born_date'])));
     $vBlock[] = array('title' => '5. Адрес постоянного места жительства', 'text' => iconv("utf8", "windows-1251", @FormatAddress($ADirection['addr_reg_street']), iconv("utf8", "windows-1251", $ADirection['addr_reg_num']), iconv("utf8", "windows-1251", $ADirection['addr_reg_subnum']), iconv("utf8", "windows-1251", $ADirection['addr_reg_apartment'])));
     $vBlock[] = array('title' => '6. Место работы, должность', 'text' => FormatProfession(iconv("utf8", "windows-1251", @$ADirection['employment_place']), iconv("utf8", "windows-1251", @$ADirection['profession'])));
     $vBlock[] = array('title' => '7. Диагноз', 'text' => iconv("utf8", "windows-1251", @$ADirection['diagnosis']));
     $this->BlockNotes($vBlock, $vWidth);
     $this->Ln($vHeightLN);
     $this->ExactCell($vHeight, '8. Код диагноза по МКБ');
     $this->SetX(90);
     $this->BoxedText($vWidth, $vHeight, iconv("utf8", "windows-1251", @$ADirection['diagnosis_mkb']), 5);
     $this->Ln($vHeightLN);
     $vBlock = array();
     $this->Ln($vHeightLN);
     $this->Ln($vHeightLN);
     $vBlock[] = array('title' => 'Врач', 'text' => iconv("utf8", "windows-1251", FormatUserName(@$ADirection['doctor_id'])));
     $vBlock[] = array('title' => 'Дата', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong($vDB->ConvertToDate(time()))));
     $this->BlockNotes($vBlock, 70);
     $this->Ln($vHeightLN * 2);
     $this->ExactCell($vHeight, ' М.П.');
 }
Example #9
0
 function Render($AParams)
 {
     global $RowDescr;
     $vBranchInfo = GetBranchInfo();
     $vWidths = array(35, 25, 5, 5);
     $vAligns = array('L', 'L', 'C', 'R');
     for ($i = 0; $i <= 20; $i++) {
         $vWidths[] = 10;
         $vAligns[] = 'R';
     }
     $vDB = GetDB();
     $vBegDate = $AParams['beg_date'];
     $vEndDate = $AParams['end_date'];
     $this->SetFont('arial_rus', '', 10);
     $vHeight = $this->FontSize * 1.5;
     $vWidth = $this->GetAreaWidth();
     $this->AddPage();
     $vX = $this->GetX();
     $vY = $this->GetY();
     $this->Cell($vWidth, $vHeight, iconv("utf8", "windows-1251", @$vBranchInfo['name']), '', 0, 'L');
     $this->SetXY($vX, $vY);
     $this->Cell($vWidth, $vHeight, 'Ф.57', '', 0, 'R');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'Дата создания: ' . iconv("utf8", "windows-1251", Date2ReadableLong(date('Y-m-d H:i:s'))), '', 0, 'L');
     $this->Ln($vHeight);
     $this->SetFont('arial', 'B', 12);
     $this->Cell($vWidth, $vHeight, 'СВЕДЕНИЯ О ТРАВМАХ, ОТРАВЛЕНИЯХ И НЕКОТОРЫХ ДРУГИХ ПОСЛЕДСТВИЯХ ВОЗДЕЙСТВИЯ ВНЕШНИХ ПРИЧИН', '', 0, 'C');
     $this->SetFont('arial_rus', '', 7);
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'за период с ' . iconv("utf8", "windows-1251", Date2ReadableLong($vBegDate)) . ' г. по ' . iconv("utf8", "windows-1251", Date2ReadableLong($vEndDate)) . ' г.', '', 0, 'C');
     $this->Ln($vHeight * 2);
     $this->CellML($vWidths[0], $vHeight * 6, 'Травмы, отравления и некоторые другие последствия воздействия внешних причин', 'L', 'R');
     $this->CellML($vWidths[1], $vHeight * 6, 'Код по МКБ X пересмотра', 'L', 'R');
     $this->CellML($vWidths[2], $vHeight * 6, 'Пол', 'C', 'U');
     $this->CellML($vWidths[3], $vHeight * 6, '№ строки', 'C', 'U');
     $vX = $this->GetX();
     $vY = $this->GetY();
     $this->CellML($vWidths[4] * 12, $vHeight, 'У взрослых и подростков (18 лет и старше)', 'C', 'R');
     $this->CellML($vWidths[4] * 8, $vHeight, 'У детей (0 - 17 лет включительно)', 'C', 'R');
     $this->CellML($vWidths[24], $vHeight * 6, 'ВСЕГО', 'C', 'U');
     $this->SetXY($vX, $vY + $vHeight);
     $this->CellML($vWidths[4] * 5, $vHeight, 'связанные с производством', 'C', 'R');
     $this->CellML($vWidths[9] * 6, $vHeight, 'несвязанные с производством', 'C', 'R');
     $this->CellML($vWidths[15], $vHeight * 5, 'ИТОГО', 'C', 'U');
     $this->CellML($vWidths[16], $vHeight * 5, 'бытовые', 'C', 'U');
     $this->CellML($vWidths[17], $vHeight * 5, 'уличные', 'C', 'U');
     $this->CellML($vWidths[18] * 2, $vHeight * 2, 'транспорт-ные', 'C');
     $this->CellML($vWidths[20], $vHeight * 5, 'школьные', 'C', 'U');
     $this->CellML($vWidths[21], $vHeight * 5, 'спортивные', 'C', 'U');
     $this->CellML($vWidths[22], $vHeight * 5, 'прочие', 'C', 'U');
     $this->CellML($vWidths[22], $vHeight * 5, 'ИТОГО', 'C', 'U');
     $this->SetXY($vX, $vY + $vHeight * 2);
     $this->CellML($vWidths[4], $vHeight * 4, 'в промышлен-ности', 'C', 'U');
     $this->CellML($vWidths[5], $vHeight * 4, 'в сельском хозяйстве', 'C', 'U');
     $this->CellML($vWidths[6] * 2, $vHeight * 2, 'транспорт-ные', 'C', 'R');
     $this->CellML($vWidths[8], $vHeight * 4, 'прочие', 'C', 'U');
     $this->CellML($vWidths[9], $vHeight * 4, 'бытовые', 'C', 'U');
     $this->CellML($vWidths[10], $vHeight * 4, 'уличные', 'C', 'U');
     $this->CellML($vWidths[11] * 2, $vHeight * 2, 'транспорт-ные', 'C', 'R');
     $this->CellML($vWidths[13], $vHeight * 4, 'спортивные', 'C', 'U');
     $this->CellML($vWidths[14], $vHeight * 4, 'прочие', 'C', 'U');
     $this->SetXY($vX + $vWidths[4] * 2, $vY + $vHeight * 4);
     $this->CellML($vWidths[6], $vHeight * 2, 'всего', 'C', 'U');
     $this->CellML($vWidths[7], $vHeight * 2, 'авто', 'C', 'U');
     $this->SetXY($vX + $vWidths[4] * 7, $vY + $vHeight * 4);
     $this->CellML($vWidths[11], $vHeight * 2, 'всего', 'C', 'U');
     $this->CellML($vWidths[12], $vHeight * 2, 'авто', 'C', 'U');
     $this->SetXY($vX + $vWidths[4] * 14, $vY + $vHeight * 3);
     $this->CellML($vWidths[18], $vHeight * 3, 'всего', 'C', 'U');
     $this->CellML($vWidths[19], $vHeight * 3, 'авто', 'C', 'U');
     $this->Ln($vHeight * 3);
     $vCodeToRow =& PrepareCodeToRowMap();
     $vTable = 'emst_cases LEFT JOIN rb_trauma_types ON rb_trauma_types.id = emst_cases.trauma_type_id';
     $vFields = 'count(emst_cases.id) AS cnt, diagnosis_mkb, is_male, if( DATE_ADD( born_date, INTERVAL 18 YEAR ) > create_time, rb_trauma_types.f57_col_child, rb_trauma_types.f57_col_adult) as cols';
     $vFilter = $vDB->CondGE('create_time', $vBegDate) . ' AND ' . $vDB->CondLT('create_time', DateAddDay($vEndDate)) . '  GROUP BY diagnosis_mkb, is_male, cols';
     $vOrder = '';
     $vRecords = $vDB->Select($vTable, $vFields, $vFilter, $vOrder);
     $vBadCodes = array();
     $vReport = array();
     while ($vRecord = $vRecords->Fetch()) {
         if ($vRecord['diagnosis_mkb'] === NULL || $vRecord['is_male'] === NULL || $vRecord['cols'] === NULL) {
             continue;
         }
         $vCode = str_replace(' ', '', $vRecord['diagnosis_mkb']);
         if ($vCode == '') {
             continue;
         }
         if (preg_match('/^[A-Z][0-9][0-9]$/i', $vCode)) {
             $vCode = $vCode . '.0';
         } else {
             if (preg_match('/^[A-Z][0-9][0-9]\\.[0-9].*$/i', $vCode)) {
                 $vCode = substr($vCode, 0, 5);
             }
         }
         if (empty($vCodeToRow[$vCode])) {
             $vBadCodes[$vRecord['diagnosis_mkb']] = $vRecord['diagnosis_mkb'];
             continue;
         }
         $vRowIndexes = $vCodeToRow[$vCode];
         $vIsMale = $vRecord['is_male'] ? 1 : 0;
         $vCols = explode(',', $vRecord['cols']);
         foreach ($vCols as $vCol) {
             $vColIdx = trim($vCol);
             foreach ($vRowIndexes as $vRowIndex) {
                 $vReport[$vRowIndex][$vIsMale][$vColIdx] = $vRecord['cnt'] + @$vReport[$vRowIndex][$vIsMale][$vColIdx];
             }
         }
     }
     $vRowNum = 0;
     for ($i = 0; $i < count($RowDescr); $i++) {
         $vRow = array($RowDescr[$i]['title'], $RowDescr[$i]['codes'], 'М', ++$vRowNum);
         for ($j = 0; $j <= 20; $j++) {
             $vRow[] = @$vReport[$i][1][$j];
         }
         $this->OutputTableRow($vWidths, $vHeight, $vRow, $vAligns);
         $vRow = array('', '', 'Ж', ++$vRowNum);
         for ($j = 0; $j <= 20; $j++) {
             $vRow[] = @$vReport[$i][0][$j];
         }
         $this->OutputTableRow($vWidths, $vHeight, $vRow, $vAligns);
     }
     if (@$AParams['show_unlisted_cases']) {
         $vTable = 'emst_cases';
         $vFields = 'id, diagnosis_mkb, trauma_type_id, born_date';
         $vFilter = $vDB->CondGE('create_time', $vBegDate) . ' AND ' . $vDB->CondLT('create_time', DateAddDay($vEndDate)) . ' AND (' . $vDB->CondIn('diagnosis_mkb', $vBadCodes) . ' OR diagnosis_mkb IS NULL' . ' OR trauma_type_id IS NULL' . ' OR born_date IS NULL' . ' OR born_date = 0000-00-00' . ')';
         $vOrder = 'id';
         $vRecords = $vDB->Select($vTable, $vFields, $vFilter, $vOrder);
         if ($vRecords->Count() > 0) {
             $this->AddPage();
             $this->Cell(30, $vHeight, '№ по порядку', 1, 0, 'R');
             $this->Cell(30, $vHeight, '№ истории', 1, 0, 'R');
             $this->Cell(180, $vHeight, 'причина', 1, 0, 'L');
             $this->Ln($vHeight);
             $i = 0;
             while ($vRecord = $vRecords->Fetch()) {
                 $vMessage = array();
                 $vCode = str_replace(' ', '', $vRecord['diagnosis_mkb']);
                 if ($vCode != '' && !(preg_match('/^[A-Z][0-9][0-9](\\.[0-9])?$/i', $vCode) && $vCode >= 'S00' && $vCode <= 'T98.9')) {
                     $vMessage[] = 'Код МКБ "' . $vRecord['diagnosis_mkb'] . '"';
                 }
                 if ($vRecord['trauma_type_id'] === NULL || $vRecord['trauma_type_id'] === '') {
                     $vMessage[] = 'не указан тип травмы';
                 }
                 if ($vRecord['born_date'] === NULL || $vRecord['born_date'] === '' || $vRecord['born_date'] === '0000-00-00') {
                     $vMessage[] = 'дата рождения не указана';
                 }
                 $this->Cell(30, $vHeight, ++$i, 1, 0, 'R');
                 $this->Cell(30, $vHeight, $vRecord['id'], 1, 0, 'R');
                 $this->Cell(180, $vHeight, implode(', ', $vMessage), 1, 0, 'L');
                 $this->Ln($vHeight);
             }
         }
     }
 }
Example #10
0
 function Render($AParams)
 {
     global $RowDescr;
     $vBranchInfo = GetBranchInfo();
     $vWidths = array(40, 35, 5, 5);
     $vAligns = array('L', 'L', 'C', 'R');
     for ($i = 0; $i < 12; $i++) {
         $vWidths[] = 16;
         $vAligns[] = 'R';
     }
     $vDB = GetDB();
     $vBegDate = $AParams['beg_date'];
     $vEndDate = $AParams['end_date'];
     $this->SetFont('arial_rus', '', 10);
     $vHeight = $this->FontSize * 1.5;
     $vWidth = $this->GetAreaWidth();
     $this->AddPage();
     $vX = $this->GetX();
     $vY = $this->GetY();
     $this->Cell($vWidth, $vHeight, iconv("utf8", "windows-1251", @$vBranchInfo['name']), '', 0, 'L');
     $this->SetXY($vX, $vY);
     $this->Cell($vWidth, $vHeight, 'Ф.16ВН', '', 0, 'R');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'Дата создания: ' . iconv("utf8", "windows-1251", Date2ReadableLong(date('Y-m-d H:i:s'))), '', 0, 'L');
     $this->Ln($vHeight);
     $this->SetFont('arial', 'B', 12);
     $this->Cell($vWidth, $vHeight, 'СВЕДЕНИЯ О ТРАВМАХ, ОТРАВЛЕНИЯХ И НЕКОТОРЫХ ДРУГИХ ПОСЛЕДСТВИЯХ ВОЗДЕЙСТВИЯ ВНЕШНИХ ПРИЧИН', '', 0, 'C');
     $this->SetFont('arial_rus', '', 10);
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'за период с ' . iconv("utf8", "windows-1251", Date2ReadableLong($vBegDate)) . ' г. по ' . iconv("utf8", "windows-1251", Date2ReadableLong($vEndDate)) . ' г.', '', 0, 'C');
     $this->Ln($vHeight * 2);
     $this->CellML($vWidths[0], $vHeight * 3, 'Причина нетрудоспособности', 'L', 'R');
     $this->CellML($vWidths[1], $vHeight * 3, 'Код по МКБ X пересмотра', 'L', 'R');
     $this->CellML($vWidths[2], $vHeight * 3, 'Пол', 'C', 'U');
     $this->CellML($vWidths[3], $vHeight * 3, '№ строки', 'C', 'U');
     $this->CellML($vWidths[4], $vHeight * 3, 'Число дней', 'C', 'R');
     $this->CellML($vWidths[5], $vHeight * 3, 'Число случаев', 'C', 'R');
     $vX = $this->GetX();
     $vY = $this->GetY();
     $this->CellML($vWidths[6] * 10, $vHeight, 'В том числе по возрастам', 'C', 'R');
     $this->SetXY($vX, $vY + $vHeight);
     $this->CellML($vWidths[6], $vHeight * 2, '15-19', 'C', 'R');
     $this->CellML($vWidths[7], $vHeight * 2, '20-24', 'C', 'R');
     $this->CellML($vWidths[8], $vHeight * 2, '25-29', 'C', 'R');
     $this->CellML($vWidths[9], $vHeight * 2, '30-34', 'C', 'R');
     $this->CellML($vWidths[10], $vHeight * 2, '35-39', 'C', 'R');
     $this->CellML($vWidths[11], $vHeight * 2, '40-44', 'C', 'R');
     $this->CellML($vWidths[12], $vHeight * 2, '45-49', 'C', 'R');
     $this->CellML($vWidths[13], $vHeight * 2, '50-54', 'C', 'R');
     $this->CellML($vWidths[14], $vHeight * 2, '55-69', 'C', 'R');
     $this->CellML($vWidths[15], $vHeight * 2, '60 и старше', 'C', 'R');
     $this->Ln($vHeight * 2);
     $vCodeToRow =& PrepareCodeToRowMap();
     /*
             SELECT 
               emst_cases.id as id,
               emst_cases.create_time,
               emst_cases.born_date, 
               emst_cases.is_male, 
               DATEDIFF( max(emst_surgeries.ill_end_date), 
                         emst_cases.disability_from_date
                       ) as days,
               emst_cases.diagnosis_mkb
             FROM
               emst_cases 
               JOIN emst_surgeries ON emst_surgeries.case_id = emst_cases.id
             WHERE 
               emst_surgeries.disability=2 AND 
               emst_surgeries.ill_end_date != '0000-00-00' AND
               emst_cases.disability_from_date != '0000-00-00' AND
               emst_cases.create_time >= '2006-01-01' AND
               emst_cases.create_time < '2007-01-01'
             GROUP BY
               emst_cases.id  
     */
     $vTable = 'emst_cases JOIN emst_surgeries ON emst_surgeries.case_id = emst_cases.id';
     $vFields = 'emst_cases.id as id, emst_cases.create_time, emst_cases.born_date, emst_cases.is_male, DATEDIFF( max(emst_surgeries.ill_end_date), emst_cases.disability_from_date) as days, emst_cases.diagnosis_mkb';
     $vFilterParts = array();
     $vFilterParts[] = 'emst_surgeries.disability=2';
     $vFilterParts[] = "emst_surgeries.ill_end_date != '0000-00-00'";
     $vFilterParts[] = "emst_cases.disability_from_date != '0000-00-00'";
     $vFilterParts[] = $vDB->CondGE('create_time', $vBegDate);
     $vFilterParts[] = $vDB->CondLT('create_time', DateAddDay($vEndDate));
     $vFilter = implode(' AND ', $vFilterParts) . ' GROUP BY emst_cases.id';
     $vOrder = '';
     $vRecords = $vDB->Select($vTable, $vFields, $vFilter, $vOrder);
     $vBadCodes = array();
     $vReport = array();
     while ($vRecord = $vRecords->Fetch()) {
         if ($vRecord['diagnosis_mkb'] === NULL || $vRecord['is_male'] === NULL) {
             continue;
         }
         $vCode = str_replace(' ', '', $vRecord['diagnosis_mkb']);
         if ($vCode == '') {
             continue;
         }
         if (preg_match('/^[A-Z][0-9][0-9]$/i', $vCode)) {
             $vCode = $vCode . '.0';
         } else {
             if (preg_match('/^[A-Z][0-9][0-9]\\.[0-9].*$/i', $vCode)) {
                 $vCode = substr($vCode, 0, 5);
             }
         }
         if (empty($vCodeToRow[$vCode])) {
             $vBadCodes[$vRecord['diagnosis_mkb']] = $vRecord['diagnosis_mkb'];
             continue;
         }
         $vRowIndexes = $vCodeToRow[$vCode];
         $vIsMale = $vRecord['is_male'] ? 1 : 0;
         $vAge = CalcAge($vRecord['born_date'], $vRecord['create_time']);
         $vAgeColIndex = AgeToColIndex($vAge);
         if ($vAgeColIndex > 0) {
             foreach ($vRowIndexes as $vRowIndex) {
                 $vReport[$vRowIndex][$vIsMale][0] = $vRecord['days'] + 1 + @$vReport[$vRowIndex][$vIsMale][0];
                 $vReport[$vRowIndex][$vIsMale][1] = 1 + @$vReport[$vRowIndex][$vIsMale][1];
                 $vReport[$vRowIndex][$vIsMale][$vAgeColIndex + 2] = 1 + @$vReport[$vRowIndex][$vIsMale][$vAgeColIndex + 2];
             }
         }
     }
     $vRowNum = 0;
     for ($i = 0; $i < count($RowDescr); $i++) {
         $vRow = array($RowDescr[$i]['title'], $RowDescr[$i]['codes'], 'М', ++$vRowNum);
         for ($j = 0; $j <= 20; $j++) {
             $vRow[] = @$vReport[$i][1][$j];
         }
         $this->OutputTableRow($vWidths, $vHeight, $vRow, $vAligns);
         $vRow = array('', '', 'Ж', ++$vRowNum);
         for ($j = 0; $j <= 20; $j++) {
             $vRow[] = @$vReport[$i][0][$j];
         }
         $this->OutputTableRow($vWidths, $vHeight, $vRow, $vAligns);
     }
     /*
             if ( @$AParams['show_unlisted_cases'] )
             {
                 $vTable  = 'emst_cases';
                 $vFields = 'id, diagnosis_mkb, trauma_type_id, born_date';
                 $vFilter = $vDB->CondGE('create_time', $vBegDate) .
                            ' AND '.
                            $vDB->CondLT('create_time', DateAddDay($vEndDate)).
                            ' AND ('.
                              $vDB->CondIn('diagnosis_mkb', $vBadCodes).
                               ' OR diagnosis_mkb IS NULL'.
                               ' OR trauma_type_id IS NULL'.
                               ' OR born_date IS NULL'.
                               ' OR born_date = 0000-00-00'.
                               ')';
     
                 $vOrder  = 'id';
                 $vRecords= $vDB->Select($vTable, $vFields, $vFilter, $vOrder);
                 if ( $vRecords->Count() > 0 )
                 {
                     $this->AddPage();
                     $this->Cell(30, $vHeight,  '№ по порядку', 1, 0, 'R');
                     $this->Cell(30, $vHeight,  '№ истории', 1, 0, 'R');
                     $this->Cell(180, $vHeight, 'причина', 1, 0, 'L');
                     $this->Ln($vHeight);
     
                     $i = 0;
                     while ( $vRecord = $vRecords->Fetch() )
                     {
                        $vMessage = array();
                        $vCode = str_replace(' ', '', $vRecord['diagnosis_mkb']);
                        if ( $vCode != '' &&
                             !( preg_match('/^[A-Z][0-9][0-9](\.[0-9])?$/i', $vCode) &&
                                $vCode>='S00' &&
                                $vCode<='T98.9'
                              )   
                           )
                        {
                           $vMessage[] = 'Код МКБ "'.$vRecord['diagnosis_mkb'].'"';
                        }
                        if ( $vRecord['trauma_type_id'] === NULL || $vRecord['trauma_type_id'] === '' )
                           $vMessage[] = 'не указан тип травмы';
                        if ( $vRecord['born_date'] === NULL || $vRecord['born_date'] === '' || $vRecord['born_date'] === '0000-00-00' )
                           $vMessage[] = 'дата рождения не указана';
     
                        $this->Cell(30, $vHeight, ++$i, 1, 0, 'R');
                        $this->Cell(30, $vHeight, $vRecord['id'], 1, 0, 'R');
                        $this->Cell(180, $vHeight, implode(', ', $vMessage), 1, 0, 'L');
                        $this->Ln($vHeight);
                     }
                 }
             }
     */
 }
Example #11
0
 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, @$vBranchInfo['name'], '', 0, 'L');
     $this->Cell($vWidth, $vHeight, '', '', 0, 'L');
     $this->Ln($vHeightLN);
     $this->ExactCell($vHeight, 'Код ОГРН  ');
     //        $this->BoxedText($vWidth, $vHeight, $vBranchInfo['OGRN']);
     $this->BoxedText($vWidth, $vHeight, '             ');
     $this->Ln($vHeightLN);
     $this->SetXY($vX, $vY);
     $this->Cell($vWidth, $vHeight, 'Медицинская документация', '', 0, 'R');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, 'форма № 044/у', '', 0, 'R');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, 'УТВЕРЖДЕНА', '', 0, 'R');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, 'Минздравом СССР', '', 0, 'R');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, '04.10.80 №1030', '', 0, 'R');
     $this->Ln($vHeightLN);
     $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->Cell($vWidth, $vHeight, 'больного, лечащегося в физиотерапевтическом отделении (кабинете)', '', 0, 'C');
     $this->Ln($vHeightLN);
     $this->Notes('Карта стационарного (амб.) больного №', 0, $vWidth, 1, @$AInfo['case_id']);
     $this->Notes('Лечащий врач', 0, $vWidth, 1, _2w(FormatUserName(@$AInfo['doctor_id'])));
     //        $this->Notes('Фамилия, имя, отчество', 0, $vWidth, 1, FormatShortName(@$AInfo['last_name'], @$AInfo['first_name'], @$AInfo['patr_name']));
     /*
             $this->Notes('Фамилия, имя, отчество', 0, $vWidth, 1, _2w(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, FormatSex($AInfo['is_male']));
     */
     $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, _2w(FormatSex($AInfo['is_male'])));
     $this->Notes('Адрес', 0, $vWidth, 1, _2w(FormatAddress(@$AInfo['addr_reg_street'], @$AInfo['addr_reg_num'], @$AInfo['addr_reg_subnum'], @$AInfo['addr_reg_apartment'])));
     $this->Notes('Из какого отделения (кабинета) направлен больной', 0, $vWidth, 1, _2w($vBranchInfo['name']), false);
     $vX = $this->GetX();
     $vY = $this->GetY();
     $this->Notes('Диагноз', 0, $vWidth, 4, _2w(@$AInfo['diagnosis']), false);
     $vX1 = $this->GetX();
     $vY1 = $this->GetY();
     $this->SetFont('arial_rus', '', 4);
     $this->SetXY($vX, $vY + $vHeightLN * 2 - $this->FontSize / 2);
     $this->Cell($vWidth, $vHeight, 'подчеркнуть заболевание, по поводу', '', 0, 'C');
     $this->Ln($vHeightLN);
     $this->Cell($vWidth, $vHeight, 'которого больной направлен на физиотерапию', '', 0, 'C');
     $this->SetXY($vX1, $vY1);
     $this->SetFont('arial_rus', '', 10);
     $this->Notes('Жалобы больного', 0, $vWidth, 2, '', false);
     $vX = $this->GetX();
     $vY = $this->GetY() + 3;
     $this->SetXY($vX, $vY);
     $this->Cell(35, $vHeight, 'Назначение ');
     $this->Ln($vHeight);
     $this->Cell(35, $vHeight, 'процедуры');
     $this->Ln($vHeight);
     $this->Cell(35, $vHeight, 'лечащим врачом');
     $this->Ln($vHeight);
     $this->Cell(35, $vHeight, 'или врачом-');
     $this->Ln($vHeight);
     $this->Cell(35, $vHeight, 'физиотерапевтом');
     $this->Ln($vHeight);
     $this->Cell(35, $vHeight, '(подчеркнуть)');
     $vX += 38;
     $this->SetXY($vX, $vY);
     $this->Cell(15, $vHeight, 'Дата', 'LTR', 0, 'C');
     $this->Cell(30, $vHeight, 'Наименование', 'LTR', 0, 'C');
     $this->Cell(10, $vHeight, 'К-во', 'LTR', 0, 'R');
     $this->Cell(20, $vHeight, 'Продолжи-', 'LTR', 0, 'C');
     $this->Cell(15, $vHeight, 'Дози-', 'LTR', 0, 'C');
     $this->SetXY($vX, $vY + $vHeight);
     $this->Cell(15, $vHeight, '', 'LR', 0, 'C');
     $this->Cell(30, $vHeight, 'процедуры', 'LR', 0, 'C');
     $this->Cell(10, $vHeight, '', 'LR', 0, 'C');
     $this->Cell(20, $vHeight, 'тельность', 'LR', 0, 'C');
     $this->Cell(15, $vHeight, 'ровка', 'LR', 0, 'C');
     for ($i = 0; $i < 3; $i++) {
         $this->SetXY($vX, $vY + $vHeight * 2 + $i * $vHeightLN);
         $this->Cell(15, $vHeightLN, '', 'LTRB', 0, 'C');
         $this->Cell(30, $vHeightLN, '', 'LTRB', 0, 'C');
         $this->Cell(10, $vHeightLN, '', 'LTRB', 0, 'C');
         $this->Cell(20, $vHeightLN, '', 'LTRB', 0, 'C');
         $this->Cell(15, $vHeightLN, '', 'LTRB', 0, 'C');
     }
     $this->Ln($vHeightLN);
     $vX = $this->GetX();
     $vY = $this->GetY();
     $this->Line($vX, $vY + $vHeight / 2, $vX + $vWidth, $vY + $vHeight / 2);
     $this->Ln($vHeight);
     $this->Cell($vWidth * 0.6, $vHeight, 'Место проведения процедуры: кабинет,');
     $this->Ln($vHeight);
     $this->Cell($vWidth * 0.6, $vHeight, 'перевязочная, на дому (подчеркнуть)');
     $this->Ln($vHeight);
     $this->Cell($vWidth * 0.6, $vHeight, 'Виды лечения, назначенные помимо');
     $this->Ln($vHeight);
     $this->Cell($vWidth * 0.6, $vHeight, 'физиотерапии (в том числе и медикаментозные)');
     $this->Ln($vHeight);
     $this->Notes('', 0, $vWidth * 0.6, 3, '', false);
     $this->Notes('Эпикриз', 0, $vWidth * 0.6, 2, '', false);
     $this->Notes('Врач-физиотерапевт', 0, $vWidth * 0.6, 1, '');
     $this->Image('images/angels.jpeg', $vX + $vWidth * 0.65, $vY + $vHeight, $vWidth * 0.35);
 }
Example #12
0
 function Render(&$AEpicrisis)
 {
     $vDB = GetDB();
     $this->SetMargins(20, 20, 20);
     $this->SetAutoPageBreak(true, 30);
     $vBranchInfo = GetBranchInfo();
     $this->AddPage();
     $this->SetFont('arial_rus', '', 10);
     $vWidth = $this->GetAreaWidth();
     $vHeight = $this->FontSize * 1.5;
     $vX = $this->GetX();
     $vY = $this->GetY();
     $vPos = $vWidth * 3 / 4;
     $vSmallWidth = $vWidth - $vPos;
     $vX = $this->GetX();
     $vY = $this->GetY();
     $this->SetXY($vX, $vY);
     $this->Cell($vPos, $this->FontSize, 'Министерство здравоохранения', '', 0, 'L');
     $this->Ln($vHeight);
     $this->Cell($vPos, $this->FontSize, 'и социального развития', '', 0, 'L');
     $this->Ln($vHeight);
     $this->Cell($vPos, $this->FontSize, 'Российской Федерации', '', 0, 'L');
     $this->Ln($vHeight);
     $this->Cell($vPos, $this->FontSize, iconv("utf8", "windows-1251", @$vBranchInfo['name']), '', 0, 'L');
     $this->Ln($vHeight);
     $this->ExactCell($this->FontSize, 'Код ОГРН  ');
     $this->BoxedText($vPos, $this->FontSize, iconv("utf8", "windows-1251", $vBranchInfo['OGRN']));
     $this->Ln($vHeight);
     $this->SetXY($vPos, $vY);
     $this->Cell($vSmallWidth, $this->FontSize, 'Медицинская документация', '', 0, 'L');
     $this->Ln($vHeight);
     $this->SetX($vPos);
     $this->Cell($vSmallWidth, $this->FontSize, 'Форма № 027/у', '', 0, 'L');
     $this->Ln($vHeight);
     $this->SetX($vPos);
     $this->Cell($vSmallWidth, $this->FontSize, 'Утв. Минздравом СССР', '', 0, 'L');
     $this->Ln($vHeight);
     $this->SetX($vPos);
     $this->Cell($vSmallWidth, $this->FontSize, '04.10.80 № 1030', '', 0, 'L');
     $this->Ln($vHeight * 4);
     $this->SetFont('arial_rus', '', 14);
     $vHeight = $this->FontSize * 1.5;
     $this->Cell($vWidth, $vHeight, 'ВЫПИСКА', '', 0, 'C');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, 'из медицинской карты амбулаторного больного № ' . $AEpicrisis['case_id'], '', 0, 'C');
     $this->Ln($vHeight * 2);
     $this->SetFont('arial_rus', '', 10);
     $vHeight = $this->FontSize * 1.5;
     $vBlock = array();
     //            $vBlock[] = array('title'=>'В',                         'text'=>@$AEpicrisis['target']);
     //        $vBlock[] = array('title'=>'Фамилия, имя, отчество', 'text'=>FormatName(@$AEpicrisis['last_name'], @$AEpicrisis['first_name'], @$AEpicrisis['patr_name']));
     $vBlock[] = array('title' => 'Фамилия, имя, отчество', 'text' => iconv("utf8", "windows-1251", FormatNameEx($AEpicrisis)));
     $vBlock[] = array('title' => 'Дата рождения', 'text' => iconv("utf8", "windows-1251", FormatBornDateAndAgeLong($vDB->ConvertToDate(time()), @$AEpicrisis['born_date'])));
     $vBlock[] = array('title' => 'Пол', 'text' => @$AEpicrisis['is_male'] ? 'мужской' : 'женский');
     $vBlock[] = array('title' => 'Домашний адрес', 'text' => iconv("utf8", "windows-1251", @FormatAddress($AEpicrisis['addr_reg_street'], $AEpicrisis['addr_reg_num'], $AEpicrisis['addr_reg_subnum'], $AEpicrisis['addr_reg_apartment'])));
     $vBlock[] = array('title' => 'Место работы и род занятий', 'text' => iconv("utf8", "windows-1251", FormatProfession(@$AEpicrisis['employment_place'], @$AEpicrisis['profession'])));
     $vBlock[] = array('title' => 'Полис', 'text' => iconv("utf8", "windows-1251", FormatPolis(@$AEpicrisis['insurance_company_id'], @$AEpicrisis['polis_series'], @$AEpicrisis['polis_number'])));
     $vBlock[] = array('title' => 'Дата обращения', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong(@$AEpicrisis['create_time'])));
     $vBlock[] = array('title' => 'Тип травмы', 'text' => iconv("utf8", "windows-1251", FormatTraumaType(@$AEpicrisis['trauma_type_id'])));
     $vBlock[] = array('title' => 'Со слов пострадавшего', 'text' => iconv("utf8", "windows-1251", @$AEpicrisis['accident']));
     $vBlock[] = array('title' => 'Дата и время происшествия', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong(@$AEpicrisis['accident_datetime'])));
     //            $vBlock[] = array('title'=>'Жалобы',                 'text'=>@$AEpicrisis['complaints']);
     $vBlock[] = array('title' => 'Диагноз', 'text' => iconv("utf8", "windows-1251", @$AEpicrisis['diagnosis']));
     $vBlock[] = array('title' => 'Лечение', 'text' => iconv("utf8", "windows-1251", @$AEpicrisis['cure']));
     if (!empty($AEpicrisis['dynamic_id'])) {
         $vBlock[] = array('title' => 'Динамика', 'text' => iconv("utf8", "windows-1251", FormatDynamic(@$AEpicrisis['dynamic_id'])));
     }
     if (!empty($AEpicrisis['clinical_outcome_id'])) {
         $vBlock[] = array('title' => 'Исход', 'text' => iconv("utf8", "windows-1251", FormatClinicalOutcome($AEpicrisis['clinical_outcome_id'])));
     } else {
         $vBlock[] = array('title' => 'Исход', 'text' => 'В настоящее время продолжает лечение');
     }
     $vBlock[] = array('title' => 'Лечебные и трудовые рекомендации', 'text' => iconv("utf8", "windows-1251", @$AEpicrisis['recomendation']));
     $this->BlockNotes($vBlock, $vWidth);
     $this->Ln($vHeight * 2);
     $vBlock = array();
     $vBlock[] = array('title' => 'Врач', 'text' => iconv("utf8", "windows-1251", FormatUserName(@$AEpicrisis['doctor_id'])));
     $vBlock[] = array('title' => 'Дата', 'text' => iconv("utf8", "windows-1251", Date2ReadableLong($vDB->ConvertToDate(time()))));
     $this->BlockNotes($vBlock, 70);
     $this->Ln($vHeight * 2);
     $this->ExactCell($vHeight, ' М.П.');
 }