Beispiel #1
0
 function Steal(&$ACase, $AField)
 {
     $vVal = @$ACase[$AField];
     // hack :(
     $vTmp = @$_SESSION['_docAccept_container'];
     if (!empty($vTmp)) {
         $vDates = $vTmp['defaults']['surgeries'];
         if (!empty($vDates) && is_array($vDates)) {
             $vDatesCount = count($vDates);
         }
         if ($vDatesCount > 0) {
             $vVal = @$vTmp['defaults']['Date0'][$AField];
             $vTmp =& $vTmp['values']['Date0'];
             if (is_array($vTmp) && array_key_exists($AField, $vTmp)) {
                 $vVal = $vTmp[$AField];
                 if (is_array($vVal)) {
                     $vVal = DateTimeValueToStr($vVal);
                 }
             }
         }
     }
     // hack end
     $ACase[$AField] = $vVal;
 }
Beispiel #2
0
function CopyRecordDateTimeValue(&$vRecord, &$vValues, $AName)
{
    $vVal = @$vValues[$AName];
    if (empty($vVal)) {
        $vRecord[$AName] = '0000-00-00 00:00:00';
    } else {
        $vRecord[$AName] = DateTimeValueToStr($vVal);
    }
}
Beispiel #3
0
 function perform(&$page, $actionName)
 {
     $page->isFormBuilt() or $page->buildForm();
     $vPageID = $page->getAttribute('id');
     $vController =& $page->controller;
     $vContainer =& $vController->container();
     $vContainer['values'][$vPageID] = $page->exportValues();
     $vContainer['valid'][$vPageID] = $page->validate();
     $vController->isValid();
     $vDefaults =& $vContainer['defaults'];
     $vValues =& $vContainer['values'];
     $vNumDates = count($vDefaults['surgeries']);
     $vBaseInfo =& $vValues['BaseInfo'];
     if ($vNumDates > 0) {
         $vFirstDate =& $vValues[DatePageName(0)];
         $vLastDate =& $vValues[DatePageName($vNumDates - 1)];
     } else {
         $vFirstDate = array();
         $vLastDate = array();
     }
     $vParams = array();
     $vParams['pdfpage'] = 'info/out_epicrisis.pdf';
     $vParams['case_id'] = $vDefaults['BaseInfo']['id'];
     $vParams2['case_id'] = $vDefaults['BaseInfo']['id'];
     $vParams2['target'] = @$vValues[$vPageID]['out_epicrisis_target'];
     $vParams2['create_time'] = $vDefaults['BaseInfo']['create_time'];
     $vParams2['last_name'] = $vBaseInfo['last_name'];
     $vParams2['first_name'] = $vBaseInfo['first_name'];
     $vParams2['patr_name'] = $vBaseInfo['patr_name'];
     $vParams2['born_date'] = DateValueToStr($vBaseInfo['born_date']);
     $vParams2['is_male'] = $vBaseInfo['is_male'];
     $vParams2['addr_reg_street'] = $vBaseInfo['addr_reg_street'];
     $vParams2['addr_reg_num'] = $vBaseInfo['addr_reg_num'];
     $vParams2['addr_reg_subnum'] = $vBaseInfo['addr_reg_subnum'];
     $vParams2['addr_reg_apartment'] = $vBaseInfo['addr_reg_apartment'];
     $vParams2['employment_place'] = $vBaseInfo['employment_place'];
     $vParams2['profession'] = $vBaseInfo['profession'];
     $vParams2['insurance_company_id'] = $vBaseInfo['insurance_company_id'];
     $vParams2['polis_series'] = $vBaseInfo['polis_series'];
     $vParams2['polis_number'] = $vBaseInfo['polis_number'];
     $vParams2['paytype'] = $vBaseInfo['paytype'];
     $vParams2['accident'] = @$vFirstDate['accident'];
     $vParams2['accident_datetime'] = DateTimeValueToStr(@$vFirstDate['accident_datetime']);
     $vParams2['accident_place'] = @$vFirstDate['accident_place'];
     $vParams2['trauma_type_id'] = @$vBaseInfo['trauma_type_id'];
     $vParams2['complaints'] = @$vFirstDate['complaints'];
     $vParams2['diagnosis'] = @$vLastDate['diagnosis'];
     $vParams2['diagnosis_mkb'] = @$vLastDate['diagnosis_mkb'];
     $vLastCure = "";
     $vCures = array();
     for ($i = 0; $i < $vNumDates; $i++) {
         $vCure = $vValues[DatePageName($i)]['cure'];
         if ($vCure != $vLastCure) {
             $vLastCure = $vCure;
             $vCures[] = $vCure;
         }
     }
     $vParams2['cure'] = $vCure;
     $vParams2['dynamic_id'] = @$vLastDate['dynamic_id'];
     $vParams2['clinical_outcome_id'] = @$vLastDate['clinical_outcome_id'];
     $vParams2['clinical_outcome_notes'] = @$vLastDate['clinical_outcome_notes'];
     $vParams2['doctor_id'] = $_SESSION['User.ID'];
     $vParams2['recomendation'] = @$vValues[$vPageID]['out_epicrisis_recomendation'];
     $_SESSION['hold']['out_epicrisis'] = $vParams2;
     $vContainer['_PopupURL'] = CompoundURL('../produce_pdf.html', $vParams);
     $page->handle('jump');
 }