"); // setup automatic refresh of this page at 5 minutes echo (""); echo ("PET Web Search Tool ... imgsearch.php3 v1.1"); echo (""); // reset submit button on each reload of search tool page echo (""); echo ("
"); echo ("
"); // Variables SN(Study Number) PN(Patient Name) LN(Last 4 SSN) SD(Study Date) // are passed into this php3 script in the URL ... i.e. // http://10.11.12.13/imgsearch.php3?SN=P01000&PN=Public,Joe&LN=1234 echo ("

PET Web Image Search Results
$PN   ($LN)   $SD

"); echo ("
"); // define directories and load directory array $miDirName = "Main Image Directory"; $miDirPath = '/ecat_data/'; // main ecat folder $dirArray["$miDirName"] = "$miDirPath"; // $wbDirName = "Archive Image Directory"; $wbDirPath = sprintf("%swb%s/%s/",$miDirPath,substr($SN,2,1),substr($SN,3,1)); $dirArray["$wbDirName"] = "$wbDirPath"; // $kmDirName = "Kaiser Reports Directory"; $kmDirPath = '/reports/kaiser/'; // main kaiser folder $dirArray["$kmDirName"] = "$kmDirPath"; // $ksDirName = "Kaiser Archive Directory"; $ksDirPath = sprintf("%sP0%s000/",$kmDirPath,substr($SN,2,1)); $dirArray["$ksDirName"] = "$ksDirPath"; // $vnDirName = "VISN 22 Image Directory"; $vnDirPath = '/reports/visn22/'; // main visn22 folder $dirArray["$vnDirName"] = "$vnDirPath"; // start form and link to next script (imgconvert.php3) echo ("
"); // loop and search each item in directory array while (list ($DirName,$DirPath) = each ($dirArray)) { chdir("$DirPath"); // get percent usage of partition containing directory $Usage = exec("df $DirPath | awk '/[0-9]%/ {if ($6) print $5; else print $4}' -"); echo ("

$DirName ... $DirPath   ($Usage full)

"); $dir = opendir("."); echo (""); while ($file=readdir($dir)) { // limit display to files that match the study number if (eregi("^$SN",$file)) { echo (""); // create full path name of selected file $imgfullpath = sprintf("%s%s",$DirPath,$file); echo (""); } } echo ("
"); // limit conversions to .img and .wbp files // only these files will have radio buttons if (eregi("img$|wbp$",$file)) { echo (""); } echo (""); // create hyperlink for downloading of this file echo ("$file"); echo (""); // display file size in bytes printf("%s%d%s","................ (",filesize($imgfullpath)," Bytes)
\n"); echo ("
"); closedir($dir); } // end of main search loop // complete form options echo ("
"); echo ("Format   :  "); echo ("Dicom   "); echo ("Analyze   "); echo ("Analyze-SPM   "); echo ("Gif/PNG   "); echo ("Gif/Jpeg  "); echo (""); echo ("
"); echo ("Reslice (~128 images)  :  "); echo ("Off   "); echo ("Coronal   "); echo ("Sagittal   "); echo ("Transverse "); echo ("
"); echo ("Please Select A File and Conversion Option(s) From Above   : "); echo ("
"); echo ("
"); echo ("  "); echo ("
"); // store patient name and last 4 in hidden variables for next script echo (""); echo (""); echo (""); // end of form echo ("
"); echo ("
"); echo (""); // end of php3 script ?>