本文整理汇总了PHP中update_field_compare函数的典型用法代码示例。如果您正苦于以下问题:PHP update_field_compare函数的具体用法?PHP update_field_compare怎么用?PHP update_field_compare使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_field_compare函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
/**
* for egfr from imported, we need a standardized creat, it must be numeric and the trust field must not be 'N'
*/
} elseif ($event['creat_im_lbstresn'] != '' && is_numeric($event['creat_im_lbstresn']) && $event['creat_im_nxtrust'] != 'N') {
if ($race != '' && $sex != '' && $age != '') {
$egfr = round((175 * pow($event['creat_im_lbstresn'], -1.154) * pow($age, -.203) * $sex_factor * $race_factor), 2);
} else {
$egfr = '';
}
update_field_compare($subject_id, $project_id, $event_id, $egfr, $event['egfr_im_lborres'], 'egfr_im_lborres', $debug);
$is_baseline = ($event['creat_lbblfl'] == 'Y' && $egfr != '') ? 'Y' : '';
update_field_compare($subject_id, $project_id, $event_id, $is_baseline, $event['egfr_im_lbblfl'], 'egfr_im_lbblfl', $debug);
} elseif ($event['creat_lbstresn'] == '') {
$egfr = '';
update_field_compare($subject_id, $project_id, $event_id, $egfr, $event['egfr_lborres'], 'egfr_lborres', $debug);
$is_baseline = ($event['creat_lbblfl'] == 'Y' && $egfr != '') ? 'Y' : '';
update_field_compare($subject_id, $project_id, $event_id, $is_baseline, $event['egfr_lbblfl'], 'egfr_lbblfl', $debug);
} elseif ($event['creat_im_lbstresn'] == '') {
$egfr = '';
update_field_compare($subject_id, $project_id, $event_id, $egfr, $event['egfr_im_lborres'], 'egfr_im_lborres', $debug);
$is_baseline = ($event['creat_lbblfl'] == 'Y' && $egfr != '') ? 'Y' : '';
update_field_compare($subject_id, $project_id, $event_id, $is_baseline, $event['egfr_im_lbblfl'], 'egfr_im_lbblfl', $debug);
}
}
}
}
if ($debug) {
$timer['main_end'] = microtime(true);
$init_time = benchmark_timing($timer);
echo $init_time;
}
示例2: BranchingLogic
$first_event_id = $Proj->firstEventId;
$plugin_title = "Reset SVR DATA PENDING flag when hidden by branching logic";
$my_branching_logic = new BranchingLogic();
/**
* plugin title
*/
echo "<h3>$plugin_title</h3>";
/**
* MAIN
*/
if ($debug) {
$timer['main_start'] = microtime(true);
}
$fields = array('dis_suppds_funcmprsn', 'hcv_suppfa_svr12dt', 'hcv_suppfa_svr24dt', 'hcv_suppfa_fuelgbl');
$data = REDCap::getData('array', $subjects, $fields, $first_event_id);
foreach ($data AS $subject_id => $subject) {
/**
* MAIN EVENT LOOP
*/
foreach ($subject AS $event_id => $event) {
$field_is_hidden = $my_branching_logic->allFieldsHidden($subject_id, $event_id, array('dis_suppds_funcmprsn'));
if ($field_is_hidden /*&& $event['dis_suppds_funcmprsn'] == 'SVR_DATA_PENDING' && ($event['hcv_suppfa_svr12dt'] != '' || $event['hcv_suppfa_fuelgbl'] == 'N')*/) {
update_field_compare($subject_id, $project_id, $event_id, '', $event['dis_suppds_funcmprsn'], 'dis_suppds_funcmprsn', $debug, $plugin_title);
}
}
}
if ($debug) {
$timer['main_end'] = microtime(true);
$init_time = benchmark_timing($timer);
echo $init_time;
}
示例3: array_pop
$stack[] = $event[$endt_prefix . '_cmendtc'];
}
}
}
sort($start_stack);
sort($stack);
if ($debug) {
show_var($start_stack, 'START STACK sort', 'red');
show_var($stack, 'STACK sort', 'red');
}
$last_date_in_start_stack = array_pop($start_stack);
$last_date_in_stack = array_pop($stack);
$stop_date = $last_date_in_stack <= $last_date_in_start_stack ? null : $last_date_in_stack;
update_field_compare($subject_id, $project_id, $first_event_id, $stop_date, $subject[$first_event_id]['dm_rfendtc'], 'dm_rfendtc', $debug);
/**
* HCV treatment duration
* dm_rfstdtc, dm_rfendtc, dis_dsstdy
*/
if (isset($stop_date)) {
$tx_start_date_obj = new DateTime($tx_start_date);
$tx_stop_date_obj = new DateTime($stop_date);
$tx_duration = $tx_start_date_obj->diff($tx_stop_date_obj);
$dis_dsstdy = $tx_duration->format('%R%a') + 1;
update_field_compare($subject_id, $project_id, $first_event_id, $dis_dsstdy, $subject[$first_event_id]['dis_dsstdy'], 'dis_dsstdy', $debug);
}
}
}
$timer['main_end'] = microtime(true);
$init_time = benchmark_timing($timer);
echo $init_time;
示例4: db_fetch_assoc
WHERE arm.project_id = '$project_id'
AND forms.form_name = '$this_form_name'");
if ($event_result) {
while ($events_row = db_fetch_assoc($event_result)) {
$events[] = $events_row['event_id'];
}
$data = REDCap::getData('array', '', array($_POST['field_name'], $this_form_name . '_complete'), $events);
$form_complete = isset($_POST['form_complete']) && $_POST['form_complete'] == 'on' ? true : false;
//d($data);
foreach ($data AS $subject_id => $subject) {
foreach ($subject AS $event_id => $event) {
$do_if_complete = $form_complete ? $event[$this_form_name . '_complete'] == '2' : true;
$all_fields_hidden = $my_branching_logic->allFieldsHidden($subject_id, $event_id, array($_POST['field_name']));
//d($event);
if (!$all_fields_hidden && $event[$_POST['field_name']] != $_POST['default_value'] && $do_if_complete) {
update_field_compare($subject_id, $project_id, $event_id, $_POST['default_value'], $event[$_POST['field_name']], $_POST['field_name'], $debug);
}
}
}
}
} else {
print "<h3>You must select field name and default value</h3>";
}
?>
<script type="text/javascript">
$(document).ready(function () {
$("#field_name").change(function () {
$("#field_val_select").trigger('submit');
});
});
</script>
示例5: elseif
update_field_compare($subjid, $project_id, $event_id, $lbstresu, $this_lab['lbstresu'], $prefix . '_im_lbstresu', $debug);
}
/**
* if the standardized value has changed since it was last standardized, reset the nxtrust flag
* Thank you , REDi.
*/
/*if ($has_valid_units && $lbstresn != $this_lab['lbstresn'] && $prefix != 'hcv') {
update_field_compare($subjid, $project_id, $event_id, '', $this_lab['nxtrust'], $prefix . '_im_nxtrust', $debug);
}*/
} elseif ($this_lab['lborresu'] == '' && $this_lab['lborres'] != '') {
/**
* NO BLANK UNITS
*/
update_field_compare($subjid, $project_id, $event_id, '', $this_lab['lbstresn'], $prefix . '_im_lbstresn', $debug);
update_field_compare($subjid, $project_id, $event_id, '', $this_lab['lbstresu'], $prefix . '_im_lbstresu', $debug);
/*if ($prefix != 'hcv') {
update_field_compare($subjid, $project_id, $event_id, '', $this_lab['nxtrust'], $prefix . '_im_nxtrust', $debug);
}*/
} else {
update_field_compare($subjid, $project_id, $event_id, $this_lab['lborres'], $this_lab['lbstresn'], $prefix . '_im_lbstresn', $debug);
update_field_compare($subjid, $project_id, $event_id, $this_lab['lborresu'], $this_lab['lbstresu'], $prefix . '_im_lbstresu', $debug);
}
}
/**
* @TODO: set form_complete
*/
}
}
$timer['main_end'] = microtime(true);
$init_time = benchmark_timing($timer);
echo $init_time;
示例6: get_single_field
$this_baseline_flag = 'Y';
} else {
/**
* Now reset all other flags that have changed
*/
foreach ($data[$subject_id] AS $flag_event_id => $flag_event) {
$reset[$flag_event_id] = $flag_event[$lab_prefix . '_im_lbblfl'];
}
foreach ($reset AS $reset_event_id => $reset_event) {
foreach ($reset_event as $reset_field => $reset_val) {
update_field_compare($subject_id, $project_id, $reset_event_id, '', $reset_val, $lab_prefix . "_im_lbblfl", $debug);
}
}
}
/**
* Baseline flag belongs in the event where the date occurs
*/
update_field_compare($subject_id, $project_id, $this_data['event_id'], $this_baseline_flag, $data[$subject_id][$this_data['event_id']][$lab_prefix . "_im_lbblfl"], $lab_prefix . "_im_lbblfl", $debug);
/**
* Baseline date belongs in Baseline event - one date for both abstracted and imported
*/
d($baseline_date);
update_field_compare($subject_id, $project_id, $initial_event, $baseline_date, get_single_field($subject_id, $project_id, $initial_event, $lab_prefix . "_supplb_lbdtbl", ''), $lab_prefix . "_supplb_lbdtbl", $debug);
}
}
}
}
}
$timer['main_end'] = microtime(true);
$init_time = benchmark_timing($timer);
echo $init_time;
示例7: array
* restricted use
*/
$allowed_pids = array('38');
REDCap::allowProjects($allowed_pids);
/**
* MAIN
*/
/**
* initial dose
*/
$fields = array('imminit_cmdose', 'imminit_cmdosrgm');
$data = REDCap::getData('array', '', $fields);
foreach ($data AS $subject_id => $subject) {
foreach ($subject AS $event_id => $event) {
if ($event['imminit_cmdose'] != '') {
update_field_compare($subject_id, $project_id, $event_id, 'FIXED', $event['imminit_cmdosrgm'], 'imminit_cmdosrgm', $debug);
}
}
}
/**
* final dose
*/
$fields = array('immfinl_cmdose', 'immfinl_cmdosrgm');
$data = REDCap::getData('array', '', $fields);
foreach ($data AS $subject_id => $subject) {
foreach ($subject AS $event_id => $event) {
if ($event['immfinl_cmdose'] != '') {
update_field_compare($subject_id, $project_id, $event_id, 'FIXED', $event['immfinl_cmdosrgm'], 'immfinl_cmdosrgm', $debug);
}
}
}
示例8: microtime
}
/**
* set overall hcvrna followup eligibility and reason if ineligible
*/
update_field_compare($subject_id, $project_id, $baseline_event_id, $eligible, $date_event['hcv_suppfa_fuelgbl'], 'hcv_suppfa_fuelgbl', $debug);
update_field_compare($subject_id, $project_id, $baseline_event_id, $reason, $date_event['hcv_suppfa_nlgblrsn'], 'hcv_suppfa_nlgblrsn', $debug);
/**
* set follow up timing - is it due?
*/
update_field_compare($subject_id, $project_id, $baseline_event_id, $data_due, $date_event['hcv_suppfa_fudue'], 'hcv_suppfa_fudue', $debug);
/**
* set outcome
*/
update_field_compare($subject_id, $project_id, $baseline_event_id, $outcome, $date_event['hcv_suppfa_hcvout'], 'hcv_suppfa_hcvout', $debug);
/**
* set 10 HCV RNA?
*/
update_field_compare($subject_id, $project_id, $baseline_event_id, $wk10_rna, $date_event['hcv_suppfa_wk10rna'], 'hcv_suppfa_wk10rna', $debug);
/**
* set HCV RNA BLOQ?
*/
update_field_compare($subject_id, $project_id, $baseline_event_id, $last_bloq, $date_event['hcv_suppfa_lastbloq'], 'hcv_suppfa_lastbloq', $debug);
/**
* set re-treat window start date
*/
update_field_compare($subject_id, $project_id, $baseline_event_id, $re_treat_date, $date_event['dm_suppdm_rtrtsdtc'], 'dm_suppdm_rtrtsdtc', $debug);
}
}
$timer['main_end'] = microtime(true);
$init_time = benchmark_timing($timer);
echo $init_time;
示例9: 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);
}
}
}
}
}
示例10: foreach
foreach ($data as $subject_id => $subject) {
foreach ($subject as $event_id => $event) {
if (isset($event['xfsn_cmtrt']) && $event['xfsn_cmtrt'] != '') {
$med = array();
$med_result = db_query("SELECT DISTINCT drug_coded FROM _target_xfsn_coding WHERE drug_name = '" . prep($event['xfsn_cmtrt']) . "'");
if ($med_result) {
$med = db_fetch_assoc($med_result);
if (isset($med['drug_coded']) && $med['drug_coded'] != '') {
update_field_compare($subject_id, $project_id, $event_id, $med['drug_coded'], $event['xfsn_cmdecod'], 'xfsn_cmdecod', $debug);
}
}
if ($debug) {
error_log("DEBUG: Coded Transfusion: subject={$subject_id}, event={$event_id} for CMTRT {$event['xfsn_cmtrt']}");
}
} else {
update_field_compare($subject_id, $project_id, $event_id, '', $event['xfsn_cmdecod'], 'xfsn_cmdecod', $debug);
}
}
}
/**
* XFSN_SUPPCM_INDCOD
*/
$fields = array("xfsn_cmindc", "xfsn_suppcm_indcod");
$data = REDCap::getData('array', $record, $fields, $redcap_event_name);
foreach ($data as $subject_id => $subject) {
foreach ($subject as $event_id => $event) {
code_llt($project_id, $subject_id, $event_id, fix_case($event['xfsn_cmindc']), fix_case($event['xfsn_oth_cmindc']), $event['xfsn_suppcm_indcod'], 'xfsn_suppcm_indcod', $debug, $recode_llt);
if ($debug) {
error_log("DEBUG: Coded XFSN INDC: subject={$subject_id}, event={$event_id} for CONMED {$event['xfsn_cmdecod']}");
}
}
示例11: array_pop
echo('<div class = "yellow">DAA MODERATE');
echo('<h4>AE: ' . $event[$decod_prefix . '_aedecod'] . '</h4>');
echo('<h4>TRTAE: ' . $tx_event[$prefix . '_aedecod'] . '</h4>');
echo('<h4>TRTACN: ' . $tx_event[$prefix . '_suppae_daaacn'] . '</h4>');
echo('</div>');
}
}
}
}
}
//}
}
/**
* find the highest grade
*/
//d('MOST SEVERE', $ae_grade);
$this_grade_array = $ae_grade;
sort($this_grade_array);
$this_grade = array_pop($this_grade_array);
d('GRADE', array_search($this_grade, $ae_grade));
if ($debug) {
error_log("INFO: AE " . $event[$decod_prefix . '_aedecod'] . " grade = " . $this_grade);
}
update_field_compare($subject_id, $project_id, $event_id, array_search($this_grade, $ae_grade), $event[$decod_prefix . '_suppae_aesevdrv'], $decod_prefix . '_suppae_aesevdrv', $debug);
}
}
}
}
$timer['main_end'] = microtime(true);
$init_time = benchmark_timing($timer);
echo $init_time;
示例12: code_terms
//.........这里部分代码省略.........
}
}
unset($data);
break;
/**
* CONMEDS
* ACTION: auto-code CONMEDS
*/
/**
* CONMEDS
* ACTION: auto-code CONMEDS
*/
case 'conmeds':
/**
* CM_CMDECOD
*/
$recode_cm = true;
$recode_llt = true;
$recode_pt = true;
$recode_soc = true;
$recode_atc = true;
$fields = array("cm_cmtrt", "cm_cmdecod", "cm_cmindc", "cm_oth_cmindc", "cm_suppcm_indcod");
$data = REDCap::getData('array', $record, $fields, $this_event_id);
code_cm($project_id, $record, $this_event_id, $data[$record][$this_event_id], $debug, $recode_cm);
/**
* cm_suppcm_mktstat
* PRESCRIPTION or OTC
*/
$fields = array("cm_cmdecod", "cm_suppcm_mktstat");
$data = REDCap::getData('array', $record, $fields, $this_event_id);
foreach ($data as $subject_id => $subject) {
foreach ($subject as $event_id => $event) {
if (isset($event['cm_cmdecod']) && $event['cm_cmdecod'] != '') {
update_field_compare($subject_id, $project_id, $event_id, get_conmed_mktg_status($event['cm_cmdecod']), $event['cm_suppcm_mktstat'], 'cm_suppcm_mktstat', $debug);
if ($debug) {
error_log("DEBUG: {$subject_id} Marketing Status = " . get_conmed_mktg_status($event['cm_cmdecod']));
}
}
}
}
/**
* CM_SUPPCM_INDCOD
*/
$fields = array("cm_cmindc", "cm_oth_cmindc", "cm_suppcm_indcmodf");
$data = REDCap::getData('array', $record, $fields, $this_event_id);
/**
* re-code all nutritional support to nutritional supplement
*/
if ($data[$record][$this_event_id]['cm_oth_cmindc'] == 'Nutritional support') {
$data[$record][$this_event_id]['cm_oth_cmindc'] = 'Nutritional supplement';
}
code_llt($project_id, $record, $this_event_id, fix_case($data[$record][$this_event_id]['cm_cmindc']), fix_case($data[$record][$this_event_id]['cm_oth_cmindc']), $data[$record][$this_event_id]['cm_suppcm_indcmodf'], 'cm_suppcm_indcmodf', $debug, $recode_llt);
if ($debug) {
error_log("DEBUG: Coded INDC LLT: {} subject={$record}, event={$this_event_id} for INDICATION {$data[$record][$this_event_id]['cm_cmindc']}");
}
/**
* CM_SUPPCM_INDCOD
*/
$fields = array("cm_suppcm_indcmodf", "cm_suppcm_indcod");
$data = REDCap::getData('array', $record, $fields, $this_event_id);
code_pt($project_id, $record, $this_event_id, $data[$record][$this_event_id]['cm_suppcm_indcmodf'], $data[$record][$this_event_id]['cm_suppcm_indcod'], 'cm_suppcm_indcod', $debug, $recode_pt);
if ($debug) {
error_log("DEBUG: Coded INDC PT: subject={$record}, event={$this_event_id} for INDICATION {$data[$record][$this_event_id]['cm_suppcm_indcod']}");
}
/**
* CM_SUPPCM_INDCSYS
示例13: set_ppi
/**
* @param $record
* @param $form_event
* @param $debug
*/
function set_ppi($record, $form_event = null, $debug)
{
global $project_id;
/**
* Proton pump inhibitor?
*/
$fields = array('cm_cmdecod', 'cm_suppcm_cmppi');
$data = REDCap::getData('array', $record, $fields, $form_event);
foreach ($data AS $subject_id => $subject) {
foreach ($subject AS $event_id => $event) {
if ($event['cm_cmdecod'] != '') {
$ppi_flag = 'N';
$ppi_meds = array();
$ppi_meds_result = db_query("SELECT * FROM _target_meds_of_interest WHERE cm_cmcat = 'PPI' AND cm_cmtrt = '{$event['cm_cmdecod']}'");
if ($ppi_meds_result) {
while ($ppi_meds_row = db_fetch_assoc($ppi_meds_result)) {
$ppi_meds[] = $ppi_meds_row['cm_cmtrt'];
}
db_free_result($ppi_meds_result);
}
if (count($ppi_meds) != 0) {
$ppi_flag = 'Y';
}
update_field_compare($subject_id, $project_id, $event_id, $ppi_flag, $event['cm_suppcm_cmppi'], 'cm_suppcm_cmppi', $debug);
}
}
}
}
示例14: array
$chem_fields = array('chem_lbdtc', 'creat_lbstresn');
$fields = array('dm_brthyr', 'weight_suppvs_wtkg', 'dm_sex');
$data = REDCap::getData('array', $record, $fields, $project->firstEventId);
foreach ($data as $vitals) {
foreach ($vitals as $vital) {
if ($vital['dm_brthyr'] != '' && $vital['weight_suppvs_wtkg'] != '' && $vital['dm_sex'] != '') {
$chem_data = REDCap::getData('array', $record, $chem_fields, $redcap_event_name);
foreach ($chem_data as $chem_values) {
foreach ($chem_values as $chem_event => $values) {
unset($creatinine_clearance);
if ($values['chem_lbdtc'] != '' && $values['creat_lbstresn'] != '') {
$sex = isset($vital['dm_sex']) ? $vital['dm_sex'] : 'F';
$chem_age = (substr($values['chem_lbdtc'], 0, 4)) - $vital['dm_brthyr'];
$sex_factor = $sex == 'F' ? .85 : 1;
$creatinine_clearance = round(((140 - $chem_age) * $vital['weight_suppvs_wtkg'] * $sex_factor) / (72 * $values['creat_lbstresn']));
update_field_compare($record, $project_id, $chem_event, $creatinine_clearance, get_single_field($record, $project_id, $chem_event, 'crcl_lborres', ''), 'crcl_lborres', $debug);
}
}
}
}
}
}
$timer_stop = microtime(true);
$timer_time = number_format(($timer_stop - $timer_start), 2);
if ($debug) {
error_log("DEBUG: This DET action (Standardize $instrument) took $timer_time seconds");
}
break;
/**
* all other forms do nothing
*/
示例15: array
/**
* restricted use
*/
$allowed_pids = array('26');
REDCap::allowProjects($allowed_pids);
global $Proj;
Kint::enabled($debug);
/**
* APRI
*/
$uln = 40;
$chem_fields = array('chem_lbdtc', 'ast_lbstresn');
$cbc_fields = array('cbc_lbdtc', 'plat_lbstresn', 'apri_lborres');
$cbc_data = REDCap::getData('array', '', $cbc_fields);
foreach ($cbc_data AS $subject_id => $subject) {
$chem_events = array();
$chem_data = REDCap::getData('array', $subject_id, $chem_fields);
foreach ($subject AS $event_id => $event) {
$apri_score = '';
if ($event['cbc_lbdtc'] != '' && $event['plat_lbstresn'] != '' && is_numeric($event['plat_lbstresn'])) {
foreach ($chem_data AS $chem_subject) {
foreach ($chem_subject AS $chem_event) {
if ($chem_event['chem_lbdtc'] != '' && $chem_event['ast_lbstresn'] != '' && $chem_event['chem_lbdtc'] == $event['cbc_lbdtc'] && is_numeric($chem_event['ast_lbstresn'])) {
$apri_score = (string)round(((($chem_event['ast_lbstresn'] / $uln) / $event['plat_lbstresn']) * 100), 2);
}
}
}
}
update_field_compare($subject_id, $project_id, $event_id, $apri_score, $event['apri_lborres'], 'apri_lborres', $debug);
}
}