Kint::enabled($enable_kint);
/**
 * project metadata
 */
global $Proj;
$baseline_event_id = $Proj->firstEventId;
$plugin_title = "Derive values";
/**
 * plugin title
 */
echo "<h3>$plugin_title</h3>";

$timer['set tx data'] = microtime(true);
set_tx_data($subjects, $debug);
$timer['set bmi'] = microtime(true);
set_bmi($subjects, $debug);
$timer['set cbc'] = microtime(true);
set_cbc_flags($subjects, $debug);
$timer['set cirrhosis'] = microtime(true);
set_cirrhosis($subjects, $debug);
$timer['set crcl'] = microtime(true);
set_crcl($subjects, null, 'both', $debug);
$timer['set trt exp'] = microtime(true);
set_treatment_exp($subjects, $debug);
$timer['set egfr'] = microtime(true);
set_egfr($subjects, null, 'both', $debug);
/**
 * timing
 */
$timer['main_end'] = microtime(true);
$init_time = benchmark_timing($timer);
 */
$allowed_pids = array('26');
REDCap::allowProjects($allowed_pids);
Kint::enabled($debug);
/**
 * per-instrument operations
 * perform different actions depending upon which form ($instrument) was submitted
 */
if (!is_form_locked($record, $instrument, $redcap_event_name)) {
    switch ($instrument) {
        case 'demographics':
            /**
             * SET Data Access Group based upon dm_usubjid prefix
             */
            $debug = false;
            set_bmi($record, $debug);
            set_dag($record, $instrument, $debug);
            if ($debug) {
                $timer['main_end'] = microtime(true);
                error_log(benchmark_timing($timer));
            }
            break;
            /**
             * SITE SOURCE UPLOAD FORM
             * ACTION: when a site uploads new source, record it for later retrieval by send_siteupload_digest.php
             */
        /**
         * SITE SOURCE UPLOAD FORM
         * ACTION: when a site uploads new source, record it for later retrieval by send_siteupload_digest.php
         */
        case 'site_source_upload_form':