public static function getByTestTypeId($lab_config_id, $test_type_id) { global $con; $lab_config_id = mysql_real_escape_string($lab_config_id); $test_type_id = mysql_real_escape_string($test_type_id); $saved_db = DbUtil::switchToLabConfig($lab_config_id); $query_string = "SELECT * FROM report_config WHERE test_type_id={$test_type_id} LIMIT 1"; $record = query_associative_one($query_string); $retval = ReportConfig::getObject($record, $lab_config_id); DbUtil::switchRestore($saved_db); return $retval; }
$specimen_main_field_map[$i] = 0; } } # Test main fields $test_main_field_count = 9; $test_main_field_map = array(); for ($i = 0; $i < $test_main_field_count; $i++) { if (isset($_REQUEST['t_field_' . $i])) { $test_main_field_map[$i] = 1; } else { $test_main_field_map[$i] = 0; } } $test_main_field_map[9] = $ClinicalData; # Custom fields (patients and specimens) $patient_custom_field_map = array(); $specimen_custom_field_map = array(); foreach ($_REQUEST as $key => $value) { if (strpos($key, "p_custom_") !== false) { $key_parts = explode("_", $key); $patient_custom_field_map[] = $key_parts[2]; } else { if (strpos($key, "s_custom_") !== false) { $key_parts = explode("_", $key); $specimen_custom_field_map[] = $key_parts[2]; } } } # Update DB with this entry ReportConfig::updateToDb($report_config, $margin_csv, $patient_main_field_map, $specimen_main_field_map, $test_main_field_map, $patient_custom_field_map, $specimen_custom_field_map); echo "true";