예제 #1
0
파일: Full.php 프로젝트: spaiva/Loris
     *
     * @return array
     */
    protected function getHeaders()
    {
        $factory = \NDB_Factory::singleton();
        $db = $factory->Database();
        // Get all fields from parameter_type "magically created by
        // neurodb", since those are the dicom headers.
        // There's a few headers that get magically created which
        // aren't header fields, so we manually exclude them.
        // Namely:
        //
        // md5hash, tarchiveMD5, image_comments, check_pic_filename,
        // jiv_path
        return $db->pselect("SELECT pt.Name as Header, Value\n            FROM parameter_file pf \n                JOIN parameter_type pt USING (ParameterTypeID)\n                JOIN files f USING (FileID)\n                JOIN session s ON (f.SessionID=s.ID)\n                JOIN candidate c ON (s.CandID=c.CandID)\n            WHERE c.Active='Y' AND s.Active='Y' AND c.CandID=:CID AND \n                s.Visit_label=:VL AND f.File LIKE CONCAT('%', :Fname) \n                AND pt.Description LIKE '%magically%'\n                AND pt.Name NOT IN (\n                    'md5hash',\n                    'tarchiveMD5',\n                    'image_comments',\n                    'check_pic_filename',\n                    'jiv_path'\n                )\n                ", array('CID' => $this->CandID, 'VL' => $this->VisitLabel, 'Fname' => $this->Filename));
    }
    /**
     * Calculate the entity tag for this URL
     *
     * @return string
     */
    public function calculateETag()
    {
        return null;
    }
}
if (isset($_REQUEST['PrintHeadersFull'])) {
    $obj = new Full($_SERVER['REQUEST_METHOD'], $_REQUEST['CandID'], $_REQUEST['VisitLabel'], $_REQUEST['Filename']);
    print $obj->toJSONString();
}