当前位置: 首页>>代码示例>>PHP>>正文


PHP REDCap::getFieldNames方法代码示例

本文整理汇总了PHP中REDCap::getFieldNames方法的典型用法代码示例。如果您正苦于以下问题:PHP REDCap::getFieldNames方法的具体用法?PHP REDCap::getFieldNames怎么用?PHP REDCap::getFieldNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在REDCap的用法示例。


在下文中一共展示了REDCap::getFieldNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: filesize

	header('Content-Disposition: attachment; filename="'.$target_filename.'"');
	header('Content-Length: ' . filesize($target_file));
	ob_end_flush();
	readfile_chunked($target_file);
//	unlink($target_file);
	REDCap::logEvent("Full Export Downloaded");
	exit();
}


// Render the page
include APP_PATH_DOCROOT . 'ProjectGeneral/header.php';
//header( 'Content-type: text/html; charset=utf-8' );

// Get name of first field:
$fields = REDCap::getFieldNames();
$field_count = count($fields);
$first_field = array_shift($fields);
//echo "First field of $field_count is $first_field\n";
d($first_field, $fields);

// Get all record_ids
$ids = REDCap::getData('array',NULL,array($first_field));
$ids = array_keys($ids);
$id_count = count($ids);
//echo "Records are: <pre>" . print_r($ids,true) . "</pre>";
//echo "\nRecord count is " . count($ids);
d($ids);

// Determine batching size (with a minimum of 1 record per export).
$records_per_batch = max(1,floor($fields_per_batch / $field_count));
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:export_all.php

示例2: db_query

 * forms with locked records
 */
$table_csv = "";
$locked_forms = db_query("SELECT DISTINCT form_name FROM redcap_locking_data WHERE project_id = '$project_id' ORDER BY form_name ASC");
if ($locked_forms) {
	while ($locked_forms_array = db_fetch_assoc($locked_forms)) {
		$filled_locked = 0;
		$avail_locked = 0;
		$filled_complete = 0;
		$avail_complete = 0;
		$filled_incomplete = 0;
		$avail_incomplete = 0;
		$filled_all = 0;
		$avail_all = 0;
		$data_row = array();
		$fields = REDCap::getFieldNames($locked_forms_array['form_name']);
		$fields_string = "'" . implode("', '", $fields) . "'";
		/**
		 * pretty form names
		 */
		$pretty_form_names = array();
		$pretty_form_name_result = db_query("SELECT form_menu_description FROM redcap_metadata WHERE project_id = '$project_id' AND form_name = '{$locked_forms_array['form_name']}' AND form_menu_description IS NOT NULL");
		if ($pretty_form_name_result) {
			$form_name_row = db_fetch_assoc($pretty_form_name_result);
			db_free_result($pretty_form_name_result);
		}
		/**
		 * subjects with locked forms
		 */
		$subject_lock_result = db_query("SELECT record, event_id FROM `redcap_locking_data` WHERE project_id = '$project_id' AND form_name = '{$locked_forms_array['form_name']}'");
		if ($subject_lock_result) {
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:report-locked-fields-completed.php

示例3: db_query

$subjects_result = db_query("SELECT DISTINCT record FROM redcap_data WHERE project_id = '$project_id' AND field_name = 'dm_usubjid' AND left(value, 3) = '017'");
if ($subjects_result) {
	while ($subjects_row = db_fetch_array($subjects_result)) {
		$subjects[] = $subjects_row['record'];
	}
}
d($subjects);
//$subjects = '42';
/**
 * labs field names
 */
$change_message = 'Purging imported labs, standardizations and related derivations for site 017 (Yale) prior to REDI refresh for this site';
$forms = array('cbc_imported', 'cbc_im_standard', 'chemistry_imported', 'chemistry_im_standard', 'inr_imported', 'hcv_rna_imported', 'hcv_rna_im_standard', 'derived_values_baseline', 'derived_values');
//$forms = array('derived_values_baseline', 'derived_values');
foreach ($forms AS $form) {
	$fields = REDCap::getFieldNames($form);
	if (in_array($form, array('derived_values_baseline', 'derived_values'))) {
		$fields = array_filter($fields, "is_imported");
	}
	d($form, $fields);
	$data = REDCap::getData('array', $subjects, $fields);
	foreach ($data AS $subject_id => $subject) {
		foreach ($subject AS $event_id => $event) {
			foreach ($event AS $field => $value) {
				if ($value != '' && strpos($field, 'complete') === false) {
					update_field_compare($subject_id, $project_id, $event_id, '', $value, $field, $debug, $change_message);
				}
			}
		}
	}
}
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:flush_yale_import_labs.php


注:本文中的REDCap::getFieldNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。