Esempio n. 1
0
writeExcel($Test_name, $results, $dataDir);
/*
* Data Dictionary construction
* This relies on the quickform_parser and data_dictionary_builder having being recently run
*/
$Test_name = "DataDictionary";
$query = "select Name, Type, Description, SourceField, SourceFrom from parameter_type where SourceField is not null order by SourceFrom";
$DB->select($query, $dictionary);
if (PEAR::isError($dictionary)) {
    PEAR::raiseError("Could not generate data dictionary. " . $dictionary->getMessage());
}
writeExcel($Test_name, $dictionary, $dataDir);
//MRI data construction
//Using CouchDBMRIImporter since same data is imported to DQT.
$Test_name = "MRI_Data";
$mriData = new CouchDBMRIImporter();
$scanTypes = $mriData->getScanTypes();
$candidateData = $mriData->getCandidateData($scanTypes);
$mriDataDictionary = $mriData->getDataDictionary($scanTypes);
//add all dictionary names as excel column headings
foreach ($mriDataDictionary as $dicKey => $dicVal) {
    //if column not already present
    if (!array_key_exists($dicKey, $candidateData[0])) {
        $candidateData[0][$dicKey] = NULL;
    }
}
writeExcel($Test_name, $candidateData, $dataDir);
// Clean up
// tar and gzip the product
$tarFile = $dumpName . ".tgz";
// produced dump file name and extension
<?php

/**
 * This file contains code to import MRI data into
 * DQT
 *
 * PHP Version 5
 *
 *  @category Main
 *  @package  Main
 *  @author   Dave MacFarlane <*****@*****.**>
 *  @license  http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
 *  @link     https://www.github.com/aces/Loris/
 */
require_once __DIR__ . "/../vendor/autoload.php";
require_once 'generic_includes.php';
require_once 'CouchDB.class.inc';
require_once 'Database.class.inc';
require_once "FeedbackMRI.class.inc";
require_once "CouchDB_MRI_Importer.php";
$Runner = new CouchDBMRIImporter();
$Runner->run();