Example #1
0
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructQuery($vDB, $AParams);
     $this->BegDate = Date2ReadableLong($AParams['beg_date']);
     $this->EndDate = Date2ReadableLong($AParams['end_date']);
     $this->AddPage();
     $vCaseID = 'not an id';
     $vSurgeries = array();
     $vRecords = $vDB->Select($vTable, '*', $vFilter, $vOrder);
     while ($vRecord = $vRecords->Fetch()) {
         $vRecCaseID = $vRecord['case_id'];
         if ($vCaseID !== $vRecCaseID) {
             if (count($vSurgeries) > 0) {
                 $this->OutCard($vCaseID, $vSurgeries);
                 $vSurgeries = array();
             }
             $vCaseID = $vRecCaseID;
         }
         $vSurgeries[] = $vRecord;
     }
     if (count($vSurgeries) > 0) {
         $this->OutCard($vCaseID, $vSurgeries);
     }
 }
Example #2
0
function ProduceHeader($vBegDate, $vEndDate)
{
    print '<table width=90% border="0" cellspacing="0" cellpadding="0"><tr><td>';
    print '<h3 align="center">АДМИНИСТРАЦИЯ МОСКОВСКОВСКОГО РАЙОНА САНКТ-ПЕТЕРБУРГА<br>';
    print 'ОТДЕЛ ЗДРАВООХРАНЕНИЯ</h3>';
    print '</td></tr><tr><td>';
    print '<h2 align="center">Санкт-Петербургское государственное учреждение здравоохранения<br>';
    print '"Городская  поликлиника № 51"</h2>';
    print '</td></tr><tr><td>';
    print '<h1 align="center">Сведения<br>';
    print 'о травматизме граждан<br>';
    print 'вследствие гололеда, падания наледей и сосулей с крыш зданий<br>';
    print 'с ' . Date2ReadableLong($vBegDate) . ' г. по ' . Date2ReadableLong($vEndDate) . ' г.</h3>';
    print '</td></tr></table>';
    print "\n";
    print '<table width=90% border="4" cellspacing="0" cellpadding="2">';
    print '<thead>';
    print '<th valign=top width=10%>' . tcfText("№") . '</th>';
    print '<th valign=top width=18%>' . tcfText("ФИО постр.год рожд.\n(адрес прож.,\nконт.тел.)") . '</th>';
    print '<th valign=top width=12%>' . tcfText("дата,\nвремя\nполуч.\nтравмы") . '</th>';
    print '<th valign=top width=15%>' . tcfText("точный адрес\nполуч.травмы\n(c указ.конкр.\nместа)") . '</th>';
    print '<th valign=top width=15%>' . tcfText("название обсл.\nорганизации,\nна терр.кот.\nполуч. травма") . '</th>';
    print '<th valign=top width=15%>' . tcfText("№ участка,\nФИО, должн.\nлица, ответст.за\nданн.террит.") . '</th>';
    print '<th valign=top width=15%>' . tcfText("госпит.в\n(назв. мед.\nучрежд.,\nдиагноз)") . '</th>';
    print '</thead><tbody>';
    print "\n";
}
Example #3
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 #4
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 #5
0
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $AParams);
     $this->BegDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['beg_date']));
     $this->EndDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['end_date']));
     $vRecords = $vDB->Select($vTable, 'emst_cases.*, emst_surgeries.manipulation_text, rb_manipulations.name as manipulation_name', $vFilter, $vOrder);
     $this->AddPage();
     while ($vRecord = $vRecords->Fetch()) {
         $this->DrawLine($vRecord);
     }
 }
Example #6
0
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $AParams);
     $this->BegDate = Date2ReadableLong(iconv('utf-8', 'cp1251', $AParams['beg_date']));
     $this->EndDate = Date2ReadableLong(iconv('utf-8', 'cp1251', $AParams['end_date']));
     $vRecords = $vDB->Select($vTable, '*', $vFilter, $vOrder);
     $this->AddPage();
     while ($vRecord = $vRecords->Fetch()) {
         $this->DrawLine($vRecord);
     }
 }
Example #7
0
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructQuery($vDB, $AParams);
     $this->BegDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['beg_date']));
     $this->EndDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['end_date']));
     $vFields = 'emst_rg.*, emst_cases.last_name, emst_cases.first_name, emst_cases.patr_name, emst_cases.born_date, emst_cases.is_male,' . 'emst_cases.addr_reg_street,  emst_cases.addr_reg_num,  emst_cases.addr_reg_subnum,  emst_cases.addr_reg_apartment,' . 'emst_cases.addr_phys_street, emst_cases.addr_phys_num, emst_cases.addr_phys_subnum, emst_cases.addr_phys_apartment,' . 'emst_cases.phone';
     $vRecords = $vDB->Select($vTable, $vFields, $vFilter, $vOrder);
     $this->AddPage();
     while ($vRecord = $vRecords->Fetch()) {
         $this->DrawLine($vRecord);
     }
 }
Example #8
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 #9
0
 function Render($AParams)
 {
     global $RowDescr;
     $this->SetFont('arial_rus', '', 9);
     $vHeight = $this->FontSize * 1.5;
     $vWidth = $this->GetAreaWidth();
     $vDB = GetDB();
     $vBegDate = $AParams['beg_date'];
     $vEndDate = $AParams['end_date'];
     list($vTable, $vFilter, $vOrder) = ConstructSurgeriesQuery($vDB, $AParams);
     $vSurgeries = $vDB->Select($vTable, 'emst_surgeries.case_id, emst_surgeries.date, emst_surgeries.user_id,' . 'emst_surgeries.diagnosis, emst_surgeries.diagnosis_mkb,' . 'emst_surgeries.ill_doc, ' . 'emst_cases.first_name, emst_cases.last_name, emst_cases.patr_name, emst_cases.born_date, emst_cases.is_male,' . 'emst_cases.addr_reg_street, emst_cases.addr_reg_num, emst_cases.addr_reg_subnum, emst_cases.addr_reg_apartment, ' . 'emst_cases.employment_place, emst_cases.profession', $vFilter, $vOrder);
     foreach ($vSurgeries as &$v2) {
         $v2 = iconv('utf-8', 'cp1251', $v2);
     }
     $this->AddPage();
     $this->Cell($vWidth, $vHeight, iconv('utf-8', 'cp1251', 'КНИГА'), '', 0, 'C');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, iconv('utf-8', 'cp1251', 'учета выборочного контроля'), '', 0, 'C');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, iconv('utf-8', 'cp1251', 'за выданными листками нетрудоспособности'), '', 0, 'C');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, iconv('utf-8', 'cp1251', 'с ') . iconv('utf-8', 'cp1251', Date2ReadableLong($vBegDate)) . iconv('utf-8', 'cp1251', ' г. по ') . iconv('utf-8', 'cp1251', Date2ReadableLong($vEndDate)) . iconv('utf-8', 'cp1251', ' г.'), '', 0, 'C');
     $this->Ln($vHeight * 2);
     $vCols = array('№', 'дата проверки', 'врач', "ФИО,\nдата рождения,\nадрес", 'место работы', 'диагноз', "Л/Н", 'д/к', "допо-\nлнено к обсле-\nдованию", "допо-\nлнено к лече-\nнию", "допо-\nлнено к диаг-\nнозу", "Л/Н выдан необос-\nнованно", "нару-\nшение инстру-\nкций", "дефек-\nты в докумен-\nтации", 'подписи врачей');
     foreach ($vCols as &$v) {
         $v = iconv('utf-8', 'cp1251', $v);
     }
     $this->OutTableRow($vHeight, $vCols);
     $this->OutColNumbers();
     while ($vRecord = $vSurgeries->Fetch()) {
         $vRowData = array($vRecord['case_id'], Date2Readable($vRecord['date']), FormatUserName($vRecord['user_id']), FormatNameEx($vRecord) . "\n" . Date2Readable($vRecord['born_date']) . "\n" . FormatAddress($vRecord['addr_reg_street'], $vRecord['addr_reg_num'], $vRecord['addr_reg_subnum'], $vRecord['addr_reg_apartment']), $vRecord['employment_place'] . "\n" . $vRecord['profession'], $vRecord['diagnosis'], $vRecord['ill_doc'], 1, '', '', '', '', '', '', '');
         // подписи врачей
         foreach ($vRowData as &$vq) {
             $vq = iconv('utf-8', 'cp1251', $vq);
         }
         $this->OutTableRow($vHeight, $vRowData);
     }
 }
Example #10
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 #11
0
 function &loadDefaults()
 {
     global $gAddTodaySugrery;
     $vDB = GetDB();
     $vID = @$_GET['id'];
     if (!empty($vID)) {
         $vBaseInfo = $vDB->GetById('emst_cases', $vID);
         if (!is_array($vBaseInfo)) {
             $vBaseInfo = array();
         }
     } else {
         $vBaseInfo = array();
         $vBaseInfo['create_time'] = $vDB->ConvertToDateTime(time());
         $vBaseInfo['next_visit_date'] = $vDB->ConvertToDate(time());
         CopyRecordStrValue($vBaseInfo, $_GET, 'first_name');
         CopyRecordStrValue($vBaseInfo, $_GET, 'last_name');
         CopyRecordStrValue($vBaseInfo, $_GET, 'patr_name');
     }
     $vResult = array();
     $vResult['BaseInfo'] =& $vBaseInfo;
     if (!empty($vID)) {
         $vSurgeries =& $vDB->SelectList('emst_surgeries', '*', $vDB->CondEqual('case_id', $vID), 'date, id');
         // order
     } else {
         $vSurgeries = array();
     }
     $vNow = $vDB->ConvertToDateTime(time());
     $vToday = ExtractWord($vNow, ' ', 0);
     $vCount = count($vSurgeries);
     if ($gAddTodaySugrery && ($vCount == 0 || ExtractWord($vSurgeries[$vCount - 1]['date'], ' ', 0) != $vToday)) {
         $vSurgeries[] = array('date' => $vNow);
         if ($vCount == 0) {
             if (@DateIsEmpty($vBaseInfo['accident_datetime'])) {
                 $vBaseInfo['accident_datetime'] = $vToday;
             }
             $vBaseInfo['disability_from_date'] = $vToday;
             $vSurgeries[$vCount]['objective'] = 'Общее состояние удовлетворительное';
         } else {
             CopyValues($vSurgeries[$vCount], $vSurgeries[$vCount - 1], array('complaints', 'dynamic_id', 'diagnosis', 'diagnosis_mkb', 'disability', 'ill_refused', 'ill_sertificat', 'ill_doc', 'ill_doc_is_continue', 'ill_beg_date', 'ill_end_date', 'next_cec_date'));
             if (!empty($vSurgeries[$vCount - 1]['ill_doc_new'])) {
                 $vSurgeries[$vCount]['ill_doc'] = $vSurgeries[$vCount - 1]['ill_doc_new'];
                 $vSurgeries[$vCount]['ill_doc_is_continue'] = true;
             }
             if ($vSurgeries[$vCount - 1]['ill_end_date'] == $vToday) {
                 $vSurgeries[$vCount]['ill_beg_date'] = DateAddDay($vSurgeries[$vCount - 1]['ill_end_date']);
                 $vSurgeries[$vCount]['ill_end_date'] = '';
             }
             $vObjectiveList = array();
             $vClinicalOutcomeID = $vSurgeries[$vCount - 1]['clinical_outcome_id'];
             if (!empty($vClinicalOutcomeID)) {
                 $vList = GetClinicalOutcomesList();
                 $vObjectiveList[] = 'На предыдущем приёме был установлен исход "' . $vList[$vClinicalOutcomeID] . '". явку объясняет тем, что ... ';
             }
             $vNextVisitDate = $vSurgeries[$vCount - 1]['next_visit_date'];
             if ($vNextVisitDate != '0000-00-00' && $vNextVisitDate < $vToday) {
                 $vObjectiveList[] = 'На приём ' . Date2ReadableLong($vNextVisitDate) . " не явился, объясняет это тем, что ... ";
             }
             $vObjectiveList[] = 'Общее состояние удовлетворительное';
             $vSurgeries[$vCount]['objective'] = implode(".\n", $vObjectiveList);
             CopyValues($vSurgeries[$vCount], $vSurgeries[$vCount - 1], array('cure'));
             /*
                                 CopyValues($vSurgeries[$vCount],
                                            $vSurgeries[$vCount-1],
                                            array('objective',  'cure', 'notes'));
             */
             for ($i = $vCount - 1; $i >= 0; $i--) {
                 if ($vSurgeries[$i]['is_cec']) {
                     $vSurgeries[$vCount]['next_cec_date'] = $vSurgeries[$i]['cec_cureup_date'];
                     break;
                 }
             }
             if ($vSurgeries[$vCount - 1]['next_cec_date'] == $vToday) {
                 $vSurgeries[$vCount]['is_cec'] = 1;
             }
         }
         $vSurgeries[$vCount]['user_id'] = $_SESSION['User.ID'];
     }
     $vCount = count($vSurgeries);
     $vResult['surgeries'] =& $vSurgeries;
     for ($i = 0; $i < $vCount; $i++) {
         $vResult[DatePageName($i)] =& $vSurgeries[$i];
     }
     //            CopyValues($vSurgeries[0], $vBaseInfo, array('accident', 'accident_datetime', 'accident_place', 'antitetanus_id', 'antitetanus_series', 'phone_message_required', 'ice_trauma', 'animal_bite_trauma', 'ixodes_trauma', 'message_number', 'diagnosis', 'diagnosis_mkb', 'disability_from_date'));
     if ($vCount > 0) {
         CopyValues($vSurgeries[0], $vBaseInfo, array('accident', 'accident_datetime', 'accident_place', 'antitetanus_id', 'antitetanus_series', 'phone_message_required', 'ice_trauma', 'animal_bite_trauma', 'ixodes_trauma', 'message_number', 'disability_from_date'));
     }
     $vResult['MiscDocs']['studinfo_freed_beg_date'] = @$vBaseInfo['create_time'];
     $vResult['MiscDocs']['studinfo_freed_end_date'] = $vToday;
     $vResult['html_referer'] = $_SESSION['PrevPage'];
     return $vResult;
 }
Example #12
0
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $AParams);
     $this->BegDate = Date2ReadableLong($AParams['beg_date']);
     $this->EndDate = Date2ReadableLong($AParams['end_date']);
     $vRecords = $vDB->Select($vTable, '*', $vFilter, $vOrder);
     $this->AddPage();
     $vNo = 0;
     while ($vRecord = $vRecords->Fetch()) {
         $this->DrawLine($vDB, ++$vNo, $vRecord);
     }
     $this->SetFont('arial_rus', '', 1);
     $this->ExactCell(1, 'Вечная слава Российской Прокуратуре -- самому законному сливальщику государственных денег!');
 }
Example #13
0
 function Render($AParams)
 {
     $vWidths = array(50, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20);
     $vAligns = array('L', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'R');
     $vDB = GetDB();
     $vBegDate = $AParams['beg_date'];
     $vEndDate = $AParams['end_date'];
     $vPayType = $AParams['paytype'];
     $this->SetFont('arial_rus', '', 10);
     $vHeight = $this->FontSize * 1.5;
     $vWidth = $this->GetAreaWidth();
     $this->AddPage();
     $this->Cell($vWidth, $vHeight, iconv('utf-8', 'cp1251', 'Отчет по явкам'), '', 0, 'C');
     $this->Ln($vHeight);
     $this->Cell($vWidth, $vHeight, iconv('utf-8', 'cp1251', 'за период с ') . iconv('utf-8', 'cp1251', Date2ReadableLong($vBegDate)) . iconv('utf-8', 'cp1251', ' г. по ') . iconv('utf-8', 'cp1251', Date2ReadableLong($vEndDate)) . iconv('utf-8', 'cp1251', ' г.'), '', 0, 'C');
     $this->Ln($vHeight * 2);
     $vTable = 'emst_surgeries' . '  LEFT JOIN emst_cases ON emst_surgeries.case_id=emst_cases.id' . '  LEFT JOIN users      ON emst_surgeries.user_id=users.id' . '  LEFT JOIN rb_employment_categories ON emst_cases.employment_category_id = rb_employment_categories.id' . '  LEFT JOIN rb_clinical_outcomes     ON emst_surgeries.clinical_outcome_id = rb_clinical_outcomes.id';
     $vFields = 'emst_surgeries.user_id as user_id,' . 'users.full_name as full_name,' . '(DATE(emst_surgeries.date)=DATE(emst_cases.create_time)) as is_primary,' . '(emst_cases.doc_series="" OR emst_cases.doc_number="" OR emst_cases.polis_series="" OR emst_cases.polis_number="") as is_bad_doc,' . gSurgeryWithBadIllDoc . ' as is_bad_illdoc,' . gLostOutcome . ' as is_lost_outcome,' . 'emst_surgeries.eisoms_status as eisoms_status,' . 'count(emst_surgeries.id) as surgeries_count';
     $vFilter = $vDB->CondGE('date', $vBegDate) . ' AND ' . $vDB->CondLT('date', DateAddDay($vEndDate)) . ' AND ' . $vDB->CondEqual('paytype', $vPayType) . '  GROUP BY emst_surgeries.user_id, is_primary, is_bad_doc, eisoms_status, is_bad_illdoc, is_lost_outcome';
     $vOrder = 'users.full_name';
     $vReport = array();
     $vRecords = $vDB->Select($vTable, $vFields, $vFilter, $vOrder);
     while ($vRecord = $vRecords->Fetch()) {
         $vUserID = '_' . @$vRecord['user_id'];
         if (empty($vReport[$vUserID])) {
             $vReport[$vUserID] = array('name' => $vRecord['full_name']);
         }
         $vReportLine =& $vReport[$vUserID];
         $vColName = 'Col' . $vRecord['is_primary'] . $vRecord['is_bad_doc'];
         $vReportLine[$vColName] = @$vReportLine[$vColName] + $vRecord['surgeries_count'];
         $vColName = 'IllDoc' . $vRecord['is_bad_illdoc'];
         $vReportLine[$vColName] = @$vReportLine[$vColName] + $vRecord['surgeries_count'];
         $vColName = 'IsLostOutcome' . $vRecord['is_lost_outcome'];
         $vReportLine[$vColName] = @$vReportLine[$vColName] + $vRecord['surgeries_count'];
         $vColName = 'EISOMSStatus' . $vRecord['eisoms_status'];
         $vReportLine[$vColName] = @$vReportLine[$vColName] + $vRecord['surgeries_count'];
     }
     $vTotalCol00 = 0;
     $vTotalCol01 = 0;
     $vTotalCol10 = 0;
     $vTotalCol11 = 0;
     $vTotalIllDoc1 = 0;
     $vTotalIsLostOutcome1 = 0;
     $vTotalEISOMSStatus0 = 0;
     $vTotalEISOMSStatus1 = 0;
     $vTotalEISOMSStatus2 = 0;
     $vRowData = array(iconv('utf-8', 'cp1251', 'Врач'), iconv('utf-8', 'cp1251', 'Первичные'), iconv('utf-8', 'cp1251', 'в т.ч. с ошибками в документах'), iconv('utf-8', 'cp1251', 'Повторные'), iconv('utf-8', 'cp1251', 'в т.ч. с ошибками в документах'), iconv('utf-8', 'cp1251', 'всего'), iconv('utf-8', 'cp1251', 'в т.ч. с ошибками в документах'), iconv('utf-8', 'cp1251', 'с ошибками в б/л'), iconv('utf-8', 'cp1251', 'Без указания исхода'), iconv('utf-8', 'cp1251', 'ЕИС ОМС: не отпр.'), iconv('utf-8', 'cp1251', 'ЕИС ОМС: ошибки'), iconv('utf-8', 'cp1251', 'ЕИС ОМС: приняты'));
     $this->OutputTableRow($vWidths, $vHeight, $vRowData, $vAligns);
     foreach ($vReport as $vUserID => $vUserData) {
         $vName = iconv('utf-8', 'cp1251', $vUserData['name']);
         $vCol00 = @$vUserData['Col00'];
         // повторные, нормальные
         $vCol01 = @$vUserData['Col01'];
         // повторные, док
         $vCol10 = @$vUserData['Col10'];
         // первичные, нормальные
         $vCol11 = @$vUserData['Col11'];
         // первичные, док
         $vEISOMSStatus0 = @$vUserData['EISOMSStatus0'];
         // не отправлялось в ЕИС ОМС
         $vEISOMSStatus1 = @$vUserData['EISOMSStatus1'];
         // не принято ЕИС ОМС (ошибки)
         $vEISOMSStatus2 = @$vUserData['EISOMSStatus2'];
         // приняты ЕИС ОМС
         $vIllDoc1 = @$vUserData['IllDoc1'];
         // б/л
         $vIsLostOutcome1 = @$vUserData['IsLostOutcome1'];
         // нет исхода
         $vRowData = array($vName, $vCol10 + $vCol11, $vCol11, $vCol00 + $vCol01, $vCol01, $vCol00 + $vCol01 + $vCol10 + $vCol11, $vCol11 + $vCol01, $vIllDoc1, $vIsLostOutcome1, $vEISOMSStatus0, $vEISOMSStatus1, $vEISOMSStatus2);
         $this->OutputTableRow($vWidths, $vHeight, $vRowData, $vAligns);
         $vTotalCol00 += $vCol00;
         $vTotalCol01 += $vCol01;
         $vTotalCol10 += $vCol10;
         $vTotalCol11 += $vCol11;
         $vTotalEISOMSStatus0 += $vEISOMSStatus0;
         $vTotalEISOMSStatus1 += $vEISOMSStatus1;
         $vTotalEISOMSStatus2 += $vEISOMSStatus2;
         $vTotalIllDoc1 += $vIllDoc1;
         $vTotalIsLostOutcome1 += $vIsLostOutcome1;
     }
     $vRowData = array(iconv('utf-8', 'cp1251', 'Всего'), $vTotalCol10 + $vTotalCol11, $vTotalCol11, $vTotalCol00 + $vTotalCol01, $vTotalCol01, $vTotalCol00 + $vTotalCol01 + $vTotalCol10 + $vTotalCol11, $vTotalCol11 + $vTotalCol01, $vTotalIllDoc1, $vTotalIsLostOutcome1, $vTotalEISOMSStatus0, $vTotalEISOMSStatus1, $vTotalEISOMSStatus2);
     $this->OutputTableRow($vWidths, $vHeight, $vRowData, $vAligns);
 }
Example #14
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 #15
0
function FormatBornDateAndAgeLong($AToday, $ABornDate)
{
    $vResult = Date2ReadableLong($ABornDate);
    return $vResult . ', полных лет ' . CalcAge($ABornDate, $AToday);
}
Example #16
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 #17
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 #18
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 #19
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, ' М.П.');
 }
Example #20
-1
 function Render($AParams)
 {
     $vDB = GetDB();
     list($vTable, $vFilter, $vOrder) = ConstructCaseQuery($vDB, $AParams);
     $this->BegDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['beg_date']));
     $this->EndDate = iconv('utf-8', 'cp1251', Date2ReadableLong($AParams['end_date']));
     $vRecords = $vDB->Select($vTable, 'emst_surgeries.*, emst_cases.first_name, emst_cases.last_name, emst_cases.patr_name, emst_cases.is_male, emst_cases.born_date, emst_cases.doc_type_id, emst_cases.doc_series, emst_cases.doc_number, emst_cases.polis_series, emst_cases.polis_number, emst_cases.addr_reg_street, emst_cases.addr_reg_num, emst_cases.addr_reg_subnum, emst_cases.addr_reg_apartment, emst_cases.phone, emst_cases.employment_category_id, emst_cases.employment_place, emst_cases.profession, emst_cases.disability_from_date', $vFilter, $vOrder);
     $this->AddPage();
     while ($vRecord = $vRecords->Fetch()) {
         $this->DrawLine($vRecord);
     }
 }