Esempio n. 1
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);
 }
Esempio n. 2
0
 function DrawLine($ACEC)
 {
     $vBranchInfo = GetBranchInfo();
     $vHeight = $this->FontSize * 1.5;
     $vRowData = array();
     $vCECDate = ExtractWord($ACEC['date'], ' ', 0);
     $vCaseID = $ACEC['case_id'];
     $vNumCECesBefore = GetNumCECes($vCaseID, $vCECDate, $ACEC['id']);
     $vCECNumber = $ACEC['cec_number'];
     if ($vCECNumber == 0) {
         $vCECNumber = '';
     }
     $vRowData[] = $vCECNumber . "\n(" . ($vNumCECesBefore + 1) . ')';
     //   'Дата',
     $vRowData[] = Date2Readable($vCECDate);
     //   'Врач',
     $vRowData[] = FormatUserName($ACEC['user_id']);
     //   'Ф.И.О. больного' & 'Дата рождения'
     //            $vRowData[] = FormatName($ACEC['last_name'], $ACEC['first_name'],$ACEC['patr_name'])
     $vRowData[] = FormatNameEx($ACEC) . "\n" . FormatBornDateAndAge($vCECDate, $ACEC['born_date']) . "\nи.б. " . $vCaseID;
     //            $vRowData[] = FormatSex($ACase['is_male']);
     //   'Адрес',
     $vRowData[] = FormatAddress($ACEC['addr_reg_street'], $ACEC['addr_reg_num'], $ACEC['addr_reg_subnum'], $ACEC['addr_reg_apartment']);
     //            $vRowData[] = $ACase['phone'];
     //   'Место работы' & 'Профессия'
     $vTmpList = array();
     $vTmp = FormatWorkableAge($vCECDate, $ACEC['born_date'], $ACEC['is_male']);
     if (!empty($vTmp)) {
         $vTmpList[] = $vTmp;
     }
     $vTmp = FormatCategory($ACEC['employment_category_id']);
     if (!empty($vTmp)) {
         $vTmpList[] = $vTmp;
     }
     $vTmp = $ACEC['employment_place'];
     if (!empty($vTmp)) {
         $vTmpList[] = $vTmp;
     }
     $vTmp = $ACEC['profession'];
     if (!empty($vTmp)) {
         $vTmpList[] = $vTmp;
     }
     $vRowData[] = implode(",\n", $vTmpList);
     //   'Диагноз',
     $vRowData[] = $ACEC['diagnosis'];
     //   '№ листка нетрудоспособности',
     $vTmp = $ACEC['ill_doc'];
     if (!empty($vTmp)) {
         $vTmp .= "\n" . Date2Readable($ACEC['disability_from_date']);
         $vTmp .= "\n" . Date2Readable($vCECDate);
         $vTmp .= "\n(" . (DateDiff($vCECDate, $ACEC['disability_from_date']) + 1) . ')';
     }
     $vRowData[] = $vTmp;
     //   'Заключение комиссии'
     $vRowData[] = "лечение продлено\nс " . Date2Readable(DateAddDay($vCECDate)) . "\nпо " . Date2Readable($ACEC['cec_cureup_date']) . "\n(" . DateDiff($ACEC['cec_cureup_date'], $vCECDate) . ')';
     //   'Подписи членов комиссии'
     $vTmp = $ACEC['cec_members'];
     if (empty($vTmp)) {
         $vTmp = $vBranchInfo['cec_members'];
     }
     $vRowData[] = $vTmp;
     foreach ($vRowData as &$v) {
         $v = iconv('utf-8', 'cp1251', $v);
     }
     $this->OutTableRow($vHeight, $vRowData);
 }
Esempio n. 3
0
 function _renderForm(&$page)
 {
     global $gTemplateName;
     $vContainer =& $page->controller->container();
     $vTemplate =& CreateTemplate();
     $vRenderer =& CreateRenderer($vTemplate);
     $page->accept($vRenderer);
     $vView = new TPageView();
     $vView->page =& $page;
     $vView->form =& $vRenderer->toObject();
     $vDefaults =& $vContainer['defaults'];
     $vValues =& $vContainer['values'];
     $vBaseInfoDefaults =& $vDefaults['BaseInfo'];
     $vBaseInfoValues =& $vValues['BaseInfo'];
     $vFirstPageDefaults =& $vDefaults[DatePageName(0)];
     $vFirstPageValues =& $vValues[DatePageName(0)];
     $vView->case_id = @$vBaseInfoDefaults['id'];
     $vView->create_time = @Date2ReadableLong($vBaseInfoDefaults['create_time']);
     $vBaseInfo =& $vBaseInfoDefaults;
     if (DataAvailable($vBaseInfoValues)) {
         $vBaseInfo =& $vBaseInfoValues;
     }
     $vView->name = FormatNameEx($vBaseInfo);
     if (DocsEmpty($vBaseInfo)) {
         $vView->docs_is_empty = true;
     }
     $vView->category = @FormatCategory($vBaseInfo['employment_category_id']);
     $vView->age = 'полных лет ' . CalcAge(DateValueToStr($vBaseInfo['born_date']));
     $vView->paytype = @GetPaytypeName($vBaseInfo['paytype']);
     if (DataAvailable($vFirstPageValues)) {
         $vView->disability_from_date = empty($vFirstPageValues['ill_doc']) ? '' : Date2ReadableLong(DateValueToStr($vFirstPageValues['disability_from_date']));
     } else {
         $vView->disability_from_date = empty($vFirstPageDefaults['ill_doc']) ? '' : Date2ReadableLong($vBaseInfoDefaults['disability_from_date']);
     }
     if (!empty($vContainer['_PopupURL'])) {
         $vView->popup_url = $vContainer['_PopupURL'];
         unset($vContainer['_PopupURL']);
     }
     $vTemplate->compile($gTemplateName);
     $vTemplate->outputObject($vView);
 }