本文整理汇总了PHP中REDCap::getEventNames方法的典型用法代码示例。如果您正苦于以下问题:PHP REDCap::getEventNames方法的具体用法?PHP REDCap::getEventNames怎么用?PHP REDCap::getEventNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类REDCap
的用法示例。
在下文中一共展示了REDCap::getEventNames方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
foreach ($raw_data_rows AS $raw_data_row) {
$this_row_array = explode(': ', $raw_data_row);
$data_array[$this_row_array[0]] = $this_row_array[1];
}
ksort($data_array);
d($data_array);
/**
* we don't want to duplicate queries
* if the result is excluded or has a query history, ignore it
*/
if (!$result['exclude']) {
d($history);
//$data_row['monitor'] = $result['record'] & 1 ? 'dianne_mattingly' : 'wendy_robertson';
$data_row['subjid'] = quote_wrap($result['record']);
$data_row['usubjid'] = quote_wrap(get_single_field($result['record'], PROJECT_ID, $Proj->firstEventId, 'dm_usubjid', ''));
$data_row['event'] = quote_wrap(REDCap::getEventNames(false, false, $result['event_id']));
//$data_row['field'] = quote_wrap($Proj->metadata[$field]['element_label']);
//$data_row['data'] = quote_wrap(strip_tags(str_replace('<br>', ', ', $result['data_display'])));
foreach ($data_array AS $key => $val) {
$data_row[quote_wrap($Proj->metadata[$key]['element_label'] . " [$key]")] = quote_wrap($val);
}
$data_row['description'] = quote_wrap($rule_info['name']);
$data_row["Queries on $field"] = quote_wrap(count($history));
$row_csv = implode(',', $data_row) . "\n";
$table_csv .= $row_csv;
}
}
}
$headers = implode(',', array_keys($data_row)) . "\n";
if (!$debug) {
create_download($lang, $app_title, $userid, $headers, $user_rights, $table_csv, '', $parent_chkd_flds, $project_id, substr(camelCase($rule_info['name']), 0, 20) . "_REPORT_", $debug, $rule_info['name']);
示例2: renderTestRow
public function renderTestRow($id, $label, $selectedRecord, $selectedEvent)
{
// Make a dropdown that contains all record_ids.
$data = REDCap::getData('array', NULL, REDCap::getRecordIdField());
//error_log("data: ".print_r($data,true));
foreach ($data as $record_id => $arr) {
$record_id_options[$record_id] = $record_id;
}
// Get all Events
$events = REDCap::getEventNames(TRUE, FALSE);
$row = RCView::tr(array(), RCView::td(array('class' => 'td1'), self::insertHelp('test')) . RCView::td(array('class' => 'td2'), "<label for='test-{$id}'><b>{$label}:</b></label>") . RCView::td(array('class' => 'td3'), RCView::span(array(), "Test logic using " . REDCap::getRecordIdField() . ":" . RCView::select(array('id' => "test_record-{$id}", 'name' => "test_record-{$id}", 'class' => "tbi x-form-text x-form-field", 'style' => 'height:20px;border:0px;', 'onchange' => "testLogic('{$id}');"), $record_id_options, $selectedRecord)) . RCView::span(array('style' => 'display:' . (REDCap::isLongitudinal() ? 'inline;' : 'none;')), " of event " . RCView::select(array('id' => "test_event-{$id}", 'name' => "test_event-{$id}", 'class' => "tbi x-form-text x-form-field", 'style' => 'height:20px;border:0px;', 'onchange' => "testLogic('{$id}');"), $events, $selectedEvent)) . RCView::span(array(), RCView::button(array('class' => 'jqbuttonmed ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only', 'onclick' => 'testLogic("' . $id . '");', 'style' => 'margin:0px 10px;'), 'Test') . RCView::span(array('id' => 'result-' . $id)))));
return $row;
}
示例3: getData
//.........这里部分代码省略.........
unset($all_forms);
// Stop after we have all the fields for the first event listed (that's all we need)
break; // 2;
// }
} */
// Loop through fields in order specified in LongitudinalReport spec
foreach ($fields as $this_eventfield) {
// If field is only a sorting field and not a real data field to return, then skip it
if ($applySortFields && in_array($this_eventfield, $sortArrayRemoveFromData)) {
continue;
}
$this_eventref = LongitudinalReports::getEventFromEventField($this_eventfield);
$this_field = LongitudinalReports::getFieldFromEventField($this_eventfield);
// If a checkbox split into multiple fields
// if (is_array($this_value) && !$combine_checkbox_values) {
if ($Proj->isCheckbox($this_field) && !$combine_checkbox_values) {
// If exporting labels, get labels for this field
//if ($outputCsvHeadersAsLabels) {
$this_field_enum = parseEnum($Proj->metadata[$this_field]['element_enum']);
//}
// Loop through all checkbox choices and add as separate "fields"
foreach ($this_field_enum as $this_code => $this_checked_value) {
// Store original code before formatting
$this_code_orig = $this_code;
// If coded value is not numeric, then format to work correct in variable name (no spaces, caps, etc)
$this_code = Project::getExtendedCheckboxCodeFormatted($this_code);
// Add choice to header
// $headers[] = ($outputCsvHeadersAsLabels)
// ? str_replace($orig, $repl, strip_tags(label_decode($Proj->metadata[$this_field]['element_label'])))." (choice=".str_replace(array("'","\""),array("",""),$this_field_enum[$this_code_orig]).")"
// : $this_field."___".$this_code;
if ($outputCsvHeadersAsLabels) {
// Longitudinal Reports - also include event name in header labels/ref
$event_id = $Proj->getEventIdUsingUniqueEventName($this_eventref);
$event_name = REDCap::getEventNames(false, true, $event_id);
$hdr_display = str_replace($orig, $repl, strip_tags(label_decode($Proj->metadata[$this_field]['element_label']))) . " ({$event_name})" . " (choice=" . str_replace(array("'", "\""), array("", ""), $this_field_enum[$this_code_orig]) . ")";
$headers[] = $hdr_display;
} else {
$headers[] = "[{$this_eventref}][{$this_field}___{$this_code}]";
}
}
// If a normal field or DAG/Survey fields
} else {
// Get this field's form
$this_form = $Proj->metadata[$this_field]['form_name'];
// If the record ID field
if ($this_field == $table_pk) {
$headers[] = $outputCsvHeadersAsLabels ? str_replace($orig, $repl, strip_tags(label_decode($Proj->metadata[$table_pk]['element_label']))) : $table_pk;
// // If longitudinal, add unique event name to line
// if ($longitudinal) {
// $headers[] = ($outputCsvHeadersAsLabels) ? 'Event Name' : 'redcap_event_name';
// }
} elseif (!$outputCsvHeadersAsLabels) {
// Add field to header array
$headers[] = $this_eventfield;
// $this_field;
// Add checkbox labels to array (only for $combine_checkbox_values=TRUE)
//if (is_array($this_value) && $combine_checkbox_values) {
if ($combine_checkbox_values && $Proj->isCheckbox($this_field)) {
foreach (parseEnum($Proj->metadata[$this_field]['element_enum']) as $raw_coded_value => $checkbox_label) {
$checkbox_choice_labels[$raw_coded_value] = $checkbox_label;
}
}
/* // Output labels for normal field or DAG/Survey fields
} elseif ($this_field == 'redcap_data_access_group') {
$headers[] = 'Data Access Group';
} elseif ($this_field == 'redcap_survey_identifier') {
示例4: showError
if ($my_rights['expiration'] != "" && $my_rights['expiration'] < TODAY) {
showError('Your user account has expired for this project. Please contact the project admin.');
exit;
}
##### TEST POST #####
# Check to see if we are running a test if the logic (called from AJAX - be sure to include PID in ajax call!)
# logic = condition to be tested
# record = record to test with
# ** TO BE IMPROVED **
if (isset($_POST['test']) && $_POST['test']) {
//logIt('REQUEST:',print_r($_REQUEST,true),'DEBUG');
$logic = htmlspecialchars_decode($_POST['logic'], ENT_QUOTES);
$record = $_POST['record'];
$event_id = $_POST['event_id'];
$an->record = $record;
$an->redcap_event_name = REDCap::getEventNames(TRUE, FALSE, $event_id);
echo $an->testLogic($logic);
exit;
}
#### ADD TRIGGER ####
# Called by Ajax
if (isset($_POST['addTrigger'])) {
$index = $_POST['addTrigger'] + 1;
echo AutoNotify::renderTrigger($index);
exit;
}
##### BEGIN NORMAL PAGE RENDERING #####
# Display the project header
require_once APP_PATH_DOCROOT . 'ProjectGeneral/header.php';
# Inject the plugin tabs (must come after including tabs.php)
include APP_PATH_DOCROOT . "ProjectSetup/tabs.php";