コード例 #1
0
ファイル: stats_list_pdf.php プロジェクト: uisluu/emst
 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);
 }
コード例 #2
0
ファイル: rg_dir_pdf.php プロジェクト: uisluu/emst
 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);
 }
コード例 #3
0
ファイル: out_epicrisis_pdf.php プロジェクト: uisluu/emst
 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, ' М.П.');
 }