} if (empty($sono)) { $sono = 0; } if (empty($mammograph)) { $mammograph = 0; } if (empty($mrt)) { $mrt = 0; } if (empty($nuclear)) { $nuclear = 0; } $sql = "INSERT INTO care_test_request_" . $db_request_table . "\r\n\t\t\t(batch_nr, encounter_nr, dept_nr,\r\n\t\t\txray, ct, sono, mammograph, mrt, nuclear,\r\n\t\t\t if_patmobile, if_allergy, if_hyperten, if_pregnant,\r\n\t\t\tclinical_info, test_request, number_of_tests, send_date,\r\n\t\t\tsend_doctor, status,\r\n\t\t\thistory,\r\n\t\t\tcreate_id,\r\n\t\t\tcreate_time,\r\n\t\t\tresults)\r\n\t\t\tVALUES\r\n\t\t\t(\r\n\t\t\t'" . $batch_nr . "','" . $pn . "','" . $dept_nr . "',\r\n\t\t\t'" . $xray . "','" . $ct . "','" . $sono . "','" . $mammograph . "','" . $mrt . "','" . $nuclear . "',\r\n\t\t\t'" . $if_patmobile . "','" . $if_allergy . "','" . $if_hyperten . "','" . $if_pregnant . "',\r\n\t\t\t'" . htmlspecialchars($clinical_info) . "','" . htmlspecialchars($test_request) . "','" . $number_of_tests . "','" . date('Y-m-d') . "',\r\n\t\t\t'" . htmlspecialchars($send_doctor) . "', 'pending',\r\n\t\t\t'Create: " . date('Y-m-d H:i:s') . " = " . $_SESSION['sess_user_name'] . "\n',\r\n\t\t\t'" . $_SESSION['sess_user_name'] . "',\r\n\t\t\t'" . date('YmdHis') . "',\r\n\t\t\t''\r\n\t\t\t)"; $presc_obj = new Prescription(); $drug_list_id = $presc_obj->GetItemIDByName($_POST['test_request']); $presc_obj->insert_prescription_Radio($pn, $drug_list_id, $_POST['number_of_tests']); if ($ergebnis = $core->Transact($sql)) { //echo $sql; // Load the visual signalling functions include_once $root_path . 'include/inc_visual_signalling_fx.php'; // Set the visual signal setEventSignalColor($pn, SIGNAL_COLOR_RADIOLOGY_REQUEST); header("location:" . $root_path . "modules/laboratory/labor_test_request_aftersave.php?sid={$sid}&lang={$lang}&edit={$edit}&saved=insert&pn={$pn}&station={$station}&user_origin={$user_origin}&status={$status}&target={$target}&noresize={$noresize}&batch_nr={$batch_nr}"); exit; } else { echo "<p>{$sql}<p>{$LDDbNoSave}"; $mode = ""; } break; // end of case 'save'