function Save() { if (!$this->validate()) { return FALSE; } $vDB = GetDB(); $vValues = $this->getSubmitValues(TRUE); // $vId = $vValues['id']; $vRecord = array(); if (!empty($vValues['id'])) { $vRecord['id'] = $vValues['id']; } CopyRecordStrValue($vRecord, $vValues, 'name'); CopyRecordBoolValue($vRecord, $vValues, 'need_ill_doc'); $vResult = $vDB->InsertOrUpdateById('rb_employment_categories', $vRecord); return $vResult; }
function Save() { if (!$this->validate()) { return FALSE; } $vDB = GetDB(); $vValues = $this->getSubmitValues(TRUE); $vRecord = array(); if (!empty($vValues['id'])) { $vRecord['id'] = $vValues['id']; } CopyRecordStrValue($vRecord, $vValues, 'name'); CopyRecordBoolValue($vRecord, $vValues, 'can_skip_ill_doc_on_disability'); CopyRecordBoolValue($vRecord, $vValues, 'can_use_ill_doc_in_ability'); CopyRecordBoolValue($vRecord, $vValues, 'req_epicrisis'); $vResult = $vDB->InsertOrUpdateById('rb_clinical_outcomes', $vRecord); return $vResult; }
function Save() { if (!$this->validate()) { return FALSE; } $vDB = GetDB(); $vValues = $this->getSubmitValues(TRUE); // $vId = $vValues['id']; $vRecord = array(); if (!empty($vValues['id'])) { $vRecord['id'] = $vValues['id']; } CopyRecordStrValue($vRecord, $vValues, 'name'); CopyRecordBoolValue($vRecord, $vValues, 'is_plaster'); $vResult = $vDB->InsertOrUpdateById('rb_manipulations', $vRecord); // var_dump($vRecord); // var_dump($vDB); return $vResult; }
function Save() { if (!$this->validate()) { return FALSE; } $vDB = GetDB(); $vValues = $this->getSubmitValues(TRUE); // $vId = $vValues['id']; $vRecord = array(); if (!empty($vValues['id'])) { $vRecord['id'] = $vValues['id']; } CopyRecordStrValue($vRecord, $vValues, 'login'); CopyRecordStrValue($vRecord, $vValues, 'full_name'); CopyRecordStrValue($vRecord, $vValues, 'password'); CopyRecordStrValue($vRecord, $vValues, 'eisCode'); CopyRecordSelValue($vRecord, $vValues, 'roles'); CopyRecordBoolValue($vRecord, $vValues, 'retired'); $vResult = $vDB->InsertOrUpdateById('users', $vRecord); // var_dump($vRecord); // var_dump($vDB); return $vResult; }
function Save() { if (!$this->validate()) { return false; } $vDB = GetDB(); $vValues =& $this->getSubmitValues(); $vID = @$vValues['id']; $vRecord = array(); if (!empty($vID)) { $vRecord['id'] = $vID; } CopyRecordRefValue($vRecord, $vValues, 'user_id'); CopyRecordRefValue($vRecord, $vValues, 'case_id'); CopyRecordDateValue($vRecord, $vValues, 'date'); // CopyRecordStrValue($vRecord, $vValues, 'objective'); CopyRecordStrValue($vRecord, $vValues, 'area'); CopyRecordStrValue($vRecord, $vValues, 'diagnosis'); CopyRecordBoolValue($vRecord, $vValues, 'done'); CopyRecordStrValue($vRecord, $vValues, 'description'); $vResult = $vDB->InsertOrUpdateById('emst_rg', $vRecord); if (empty($vID) && !empty($vResult)) { $this->_submitValues['id'] = $vResult; $this->getElement('id')->setValue($vResult); $vRecord['id'] = $vResult; $_SESSION['_rg_dir_backup'] = $vRecord; } return $vResult; }
function save(&$AController) { $vDB = GetDB(); $vContainer =& $AController->container(); $vDefaults =& $vContainer['defaults']; $vValues =& $vContainer['values']; $vNumDates = count($vDefaults['surgeries']); $vBaseInfo =& $vValues['BaseInfo']; if ($vNumDates > 0) { $vFirstDate =& $vValues[DatePageName(0)]; $vFirstDateDefaults =& $vDefaults[DatePageName(0)]; $vLastDate =& $vValues[DatePageName($vNumDates - 1)]; } else { $vFirstDate = array(); $vFirstDateDefaults = array(); $vLastDate = array(); } $vBaseInfoRecord = array(); $vRecord = array(); CopyRecordRefValue($vRecord, $vBaseInfo, 'id'); $vRecord['modify_time'] = $vDB->ConvertToDateTime(time()); CopyRecordDateValue($vRecord, $vDefaults['BaseInfo'], 'create_time'); CopyRecordStrValue($vRecord, $vBaseInfo, 'last_name'); CopyRecordStrValue($vRecord, $vBaseInfo, 'first_name'); CopyRecordStrValue($vRecord, $vBaseInfo, 'patr_name'); CopyRecordBoolValue($vRecord, $vBaseInfo, 'is_male'); CopyRecordDateValue($vRecord, $vBaseInfo, 'born_date'); CopyRecordRefValue($vRecord, $vBaseInfo, 'doc_type_id'); CopyRecordStrValue($vRecord, $vBaseInfo, 'doc_series'); CopyRecordStrValue($vRecord, $vBaseInfo, 'doc_number'); CopyRecordRefValue($vRecord, $vBaseInfo, 'insurance_company_id'); CopyRecordStrValue($vRecord, $vBaseInfo, 'polis_series'); CopyRecordStrValue($vRecord, $vBaseInfo, 'polis_number'); CopyRecordDateValue($vRecord, $vValues, 'patient_polis_from'); CopyRecordDateValue($vRecord, $vValues, 'patient_polis_to'); CopyRecordStrValue($vRecord, $vBaseInfo, 'paytype'); CopyRecordStrValue($vRecord, $vBaseInfo, 'addr_reg_street'); CopyRecordStrValue($vRecord, $vBaseInfo, 'addr_reg_num'); CopyRecordStrValue($vRecord, $vBaseInfo, 'addr_reg_subnum'); CopyRecordStrValue($vRecord, $vBaseInfo, 'addr_reg_apartment'); CopyRecordStrValue($vRecord, $vBaseInfo, 'addr_phys_street'); CopyRecordStrValue($vRecord, $vBaseInfo, 'addr_phys_num'); CopyRecordStrValue($vRecord, $vBaseInfo, 'addr_phys_subnum'); CopyRecordStrValue($vRecord, $vBaseInfo, 'addr_phys_apartment'); CopyRecordStrValue($vRecord, $vBaseInfo, 'phone'); CopyRecordRefValue($vRecord, $vBaseInfo, 'employment_category_id'); CopyRecordStrValue($vRecord, $vBaseInfo, 'employment_place'); CopyRecordStrValue($vRecord, $vBaseInfo, 'profession'); CopyRecordRefValue($vRecord, $vBaseInfo, 'trauma_type_id'); CopyRecordStrValue($vRecord, $vBaseInfo, 'notes'); if ($vNumDates > 0) { $vRecord['first_doctor_id'] = @$vFirstDateDefaults['user_id']; CopyRecordStrValue($vRecord, $vFirstDate, 'accident'); CopyRecordDateTimeValue($vRecord, $vFirstDate, 'accident_datetime'); CopyRecordStrValue($vRecord, $vFirstDate, 'accident_place'); CopyRecordRefValue($vRecord, $vFirstDate, 'antitetanus_id'); CopyRecordStrValue($vRecord, $vFirstDate, 'antitetanus_series'); CopyRecordBoolValue($vRecord, $vFirstDate, 'phone_message_required'); CopyRecordBoolValue($vRecord, $vFirstDate, 'ice_trauma'); CopyRecordBoolValue($vRecord, $vFirstDate, 'animal_bite_trauma'); CopyRecordBoolValue($vRecord, $vFirstDate, 'ixodes_trauma'); CopyRecordStrValue($vRecord, $vFirstDate, 'message_number'); CopyRecordStrValue($vRecord, $vFirstDate, 'diagnosis'); CopyRecordStrValue($vRecord, $vFirstDate, 'diagnosis_mkb'); CopyRecordDateValue($vRecord, $vFirstDate, 'disability_from_date'); CopyRecordDateValue($vRecord, $vLastDate, 'next_visit_date'); CopyRecordRefValue($vRecord, $vLastDate, 'next_visit_target_id'); if (empty($vLastDate['clinical_outcome_id'])) { $vRecord['state'] = 'progress'; } else { $vRecord['state'] = 'done'; } } else { $vRecord['state'] = 'init'; } $vCaseID = $vDB->InsertOrUpdateById('emst_cases', $vRecord); $vBaseInfo['id'] = $vCaseID; $vEmptyRec = array('id' => ''); for ($i = 0; $i < $vNumDates; $i++) { $vDateValues =& $vValues[DatePageName($i)]; $vDateDefaults =& $vDefaults['surgeries'][$i]; $vRecord = array(); $vRecord['case_id'] = $vCaseID; // $vRecord['user_id'] = $_SESSION['User.ID']; $vRecord['user_id'] = $vDateDefaults['user_id']; $vRecord['date'] = $vDateDefaults['date']; $vRecord['id'] = @$vDateDefaults['id']; CopyRecordStrValue($vRecord, $vDateValues, 'complaints'); CopyRecordStrValue($vRecord, $vDateValues, 'objective'); CopyRecordStrValue($vRecord, $vDateValues, 'diagnosis'); CopyRecordStrValue($vRecord, $vDateValues, 'diagnosis_mkb'); CopyRecordRefValue($vRecord, $vDateValues, 'dynamic_id'); CopyRecordRefValue($vRecord, $vDateValues, 'manipulation_id'); CopyRecordStrValue($vRecord, $vDateValues, 'manipulation_text'); CopyRecordStrValue($vRecord, $vDateValues, 'cure'); CopyRecordStrValue($vRecord, $vDateValues, 'notes'); CopyRecordRefValue($vRecord, $vDateValues, 'disability'); if (empty($vRecord['disability'])) { $vRecord['disability'] = 0; } CopyRecordStrValue($vRecord, $vDateValues, 'ill_refused'); CopyRecordStrValue($vRecord, $vDateValues, 'ill_sertificat'); CopyRecordStrValue($vRecord, $vDateValues, 'ill_doc'); CopyRecordStrValue($vRecord, $vDateValues, 'ill_doc_closed'); CopyRecordStrValue($vRecord, $vDateValues, 'ill_doc_new'); CopyRecordBoolValue($vRecord, $vDateValues, 'ill_doc_is_continue'); CopyRecordDateValue($vRecord, $vDateValues, 'ill_beg_date'); CopyRecordDateValue($vRecord, $vDateValues, 'ill_end_date'); CopyRecordRefValue($vRecord, $vDateValues, 'clinical_outcome_id'); CopyRecordStrValue($vRecord, $vDateValues, 'clinical_outcome_notes'); CopyRecordDateValue($vRecord, $vDateValues, 'next_cec_date'); CopyRecordDateValue($vRecord, $vDateValues, 'next_visit_date'); CopyRecordRefValue($vRecord, $vDateValues, 'next_visit_target_id'); CopyRecordBoolValue($vRecord, $vDateValues, 'is_cec'); if ($vRecord['is_cec'] && empty($vDateDefaults['cec_number'])) { $vDateDefaults['cec_number'] = $vDB->Insert('reg_ceces', $vEmptyRec); } CopyRecordRefValue($vRecord, $vDateDefaults, 'cec_number'); // CopyRecordStrValue($vRecord, $vDateValues, 'cec_number'); CopyRecordDateValue($vRecord, $vDateValues, 'cec_cureup_date'); // CopyRecordStrValue($vRecord, $vDateValues, 'cec_members'); $vID = $vDB->InsertOrUpdateById('emst_surgeries', $vRecord); $vDateDefaults['id'] = $vID; } }
function Save() { if (!$this->validate()) { return FALSE; } $vDB = GetDB(); $vValues = $this->getSubmitValues(TRUE); $vId = @$vValues['id']; $vRecord = array(); if (!empty($vId)) { $vRecord['id'] = $vId; } else { $vRecord['create_time'] = $vDB->ConvertToDateTime(time()); $vRecord['next_visit_date'] = $vDB->ConvertToDate(time()); } $vRecord['modify_time'] = $vDB->ConvertToDateTime(time()); CopyRecordStrValue($vRecord, $vValues, 'last_name'); CopyRecordStrValue($vRecord, $vValues, 'first_name'); CopyRecordStrValue($vRecord, $vValues, 'patr_name'); CopyRecordBoolValue($vRecord, $vValues, 'is_male'); CopyRecordDateValue($vRecord, $vValues, 'born_date'); CopyRecordRefValue($vRecord, $vValues, 'doc_type_id'); CopyRecordStrValue($vRecord, $vValues, 'doc_series'); CopyRecordStrValue($vRecord, $vValues, 'doc_number'); CopyRecordRefValue($vRecord, $vValues, 'insurance_company_id'); CopyRecordStrValue($vRecord, $vValues, 'polis_series'); CopyRecordStrValue($vRecord, $vValues, 'polis_number'); CopyRecordDateValue($vRecord, $vValues, 'patient_polis_from'); CopyRecordDateValue($vRecord, $vValues, 'patient_polis_to'); CopyRecordStrValue($vRecord, $vValues, 'paytype'); CopyRecordStrValue($vRecord, $vValues, 'addr_reg_street'); CopyRecordStrValue($vRecord, $vValues, 'addr_reg_num'); CopyRecordStrValue($vRecord, $vValues, 'addr_reg_subnum'); CopyRecordStrValue($vRecord, $vValues, 'addr_reg_apartment'); CopyRecordStrValue($vRecord, $vValues, 'addr_phys_street'); CopyRecordStrValue($vRecord, $vValues, 'addr_phys_num'); CopyRecordStrValue($vRecord, $vValues, 'addr_phys_subnum'); CopyRecordStrValue($vRecord, $vValues, 'addr_phys_apartment'); CopyRecordStrValue($vRecord, $vValues, 'phone'); CopyRecordRefValue($vRecord, $vValues, 'employment_category_id'); CopyRecordStrValue($vRecord, $vValues, 'employment_place'); CopyRecordStrValue($vRecord, $vValues, 'profession'); CopyRecordRefValue($vRecord, $vValues, 'trauma_type_id'); CopyRecordStrValue($vRecord, $vValues, 'notes'); CopyRecordStrValue($vRecord, $vValues, 'accident'); CopyRecordDateTimeValue($vRecord, $vValues, 'accident_datetime'); CopyRecordStrValue($vRecord, $vValues, 'accident_place'); CopyRecordBoolValue($vRecord, $vValues, 'phone_message_required'); CopyRecordBoolValue($vRecord, $vValues, 'ice_trauma'); CopyRecordBoolValue($vRecord, $vValues, 'animal_bite_trauma'); CopyRecordBoolValue($vRecord, $vValues, 'ixodes_trauma'); CopyRecordStrValue($vRecord, $vValues, 'message_number'); /* Здесь нужна проверка введенных данных в поле ПОЛИС СМО*/ $vResult = $vDB->InsertOrUpdateById('emst_cases', $vRecord); // var_dump($vRecord); // var_dump($vDB); return $vResult; }
$this->setDefaults($_GET); } } class TData extends TBaseView { } // ======================================================================= if (!array_key_exists('beg_date', $_GET)) { $_GET['beg_date'] = date('Y-m-d'); } if (!array_key_exists('end_date', $_GET)) { $_GET['end_date'] = date('Y-m-d'); } RegisterListParams(); $vForm =& new TSearchForm(); if ($vForm->validate()) { $vValues = $vForm->getSubmitValues(); $vFilter = array(); CopyRecordDateValue($vFilter, $vValues, 'beg_date'); CopyRecordDateValue($vFilter, $vValues, 'end_date'); CopyRecordBoolValue($vFilter, $vValues, 'show_unlisted_cases'); Redirect(CompoundURL('report_57.pdf', $vFilter)); } else { $vTemplate =& CreateTemplate(); $vRenderer =& CreateRenderer($vTemplate); $vForm->accept($vRenderer); $vView =& new TData(); $vView->form = $vRenderer->toObject(); $vTemplate->compile('chief/report_57.html'); $vTemplate->outputObject($vView); }
function GetTable() { $vDB = GetDB(); list($vTable, $vFilter, $vOrder) = ConstructSurgeriesQuery($vDB, $_GET); $vTab =& new TTable($vTable, 'emst_surgeries.*, ' . 'emst_cases.first_name, emst_cases.last_name, emst_cases.patr_name, emst_cases.born_date, emst_cases.is_male,' . gSurgeryIsPrimary . ' as is_primary, ' . gCaseWithBadDoc . ' as is_bad_docs,' . gSurgeryWithBadIllDoc . ' as is_bad_illdoc,' . gLostOutcome . ' as is_lost_outcome', $vFilter, $vOrder, 'case_id'); $vTab->AddBoolColumn('is_primary', 'Перв.'); $vTab->AddColumn('case_id', '№', array('align' => 'right')); $vTab->AddDateColumn('date', 'Дата и время приёма'); $vTab->AddColumn('user_id', 'Врач', array('align' => 'left', 'fmt' => 'tcfUserName')); $vTab->AddColumn('id', 'Фамилия Имя Отчество', array('align' => 'left', 'fmt' => 'tcfName')); $vTab->AddColumn('date', 'Дата рождения, полных лет', array('align' => 'left', 'fmt' => 'tcfBornDate')); $vTab->AddColumn('is_male', 'Пол', array('align' => 'center', 'fmt' => 'tcfSex')); $vTab->AddTextColumn('diagnosis', 'Диагноз'); $vTab->AddColumn('diagnosis_mkb', 'МКБ'); $vTab->AddBoolColumn('is_bad_docs', 'Пробл. с док.'); $vTab->AddBoolColumn('is_bad_illdoc', 'Пробл. с б/л'); $vTab->AddBoolColumn('is_lost_outcome', 'Исход не указан'); $vTab->AddColumn('id', 'ЕИС ОМС', array('align' => 'left', 'fmt' => 'tcfEISOMS')); $vTab->AddRowAction('изменение', 'case_edit.html?id=', '../images/edit_24x24.gif', 24, 24); $vTab->AddRowAction('печать', '../reg/case.pdf?id=', '../images/print_24x24.gif', 24, 24); /* $vTab->AddRowAction('приём', 'accept.html?id=', '../images/sugrery_24x24.gif', 24, 24); $vTab->AddRowAction('изменение', 'case_edit.html?id=', '../images/edit_24x24.gif', 24, 24); $vTab->AddRowAction('печать', '../reg/case.pdf?id=', '../images/print_24x24.gif', 24, 24); */ $vFilter = array(); CopyRecordRefValue($vFilter, $_GET, 'case_id'); CopyRecordRefValue($vFilter, $_GET, 'doctor_id'); CopyRecordStrValue($vFilter, $_GET, 'first_name'); CopyRecordStrValue($vFilter, $_GET, 'last_name'); CopyRecordStrValue($vFilter, $_GET, 'patr_name'); CopyRecordDateValue($vFilter, $_GET, 'beg_date'); CopyRecordDateValue($vFilter, $_GET, 'end_date'); CopyRecordStrValue($vFilter, $_GET, 'empty_diagnosis_mkb'); CopyRecordStrValue($vFilter, $_GET, 'is_primary'); CopyRecordStrValue($vFilter, $_GET, 'is_bad_doc'); CopyRecordStrValue($vFilter, $_GET, 'is_bad_illdoc'); CopyRecordStrValue($vFilter, $_GET, 'eisoms_status'); CopyRecordBoolValue($vFilter, $_GET, 'is_lost_outcome'); // $vTab->AddTableAction('печать', CompoundURL('cases_list.pdf', $vFilter)); $vResult = $vTab->ProduceHTML($vDB, GetPageIdxOrLast(), 20); return $vResult; }