// include chris user_data models require_once joinPaths(CHRIS_MODEL_FOLDER, 'data_patient.model.php'); // main function $shortopts = "d:l:"; $options = getopt($shortopts); // local vars $output_directory = $options['d']; $study_directory = $options['d'] . '/' . $options['l']; // parse files in directory to know who we should email if ($handle2 = opendir($study_directory)) { /* This is the correct way to loop over the directory. */ // make an array from scanners name/conact while (false !== ($entry2 = readdir($handle2))) { if ($entry2 != "." && $entry2 != "..") { // get DCM file information $process_file = PACS::process($study_directory . '/' . $entry2); // find location in DB // process series (data) // wait for all files to be received $waiting = true; $counter = 0; $timeout = 10; //(10s) $maxtimeout = 3600; //(3600s) echo "file: " . $study_directory . '/' . $entry2 . PHP_EOL; echo "series uid: " . $process_file['SeriesInstanceUID'][0] . PHP_EOL; if ($process_file['SeriesInstanceUID'][0] == '') { echo "no series uid - skipping file" . PHP_EOL; $counter = $maxtimeout; }