$logFile .= 'getting patient id...' . PHP_EOL; $logFile .= 'PatientID exists...? -> ' . array_key_exists('PatientID', $process_file) . PHP_EOL; $patient_chris_id = -1; //$db, $process_file, $patient_chris_id $p_success = PACS::AddPatient($db, $process_file, $patient_chris_id); if ($p_success == 0) { echo $logFile; return; } $logFile .= 'patient success: ' . $p_success . PHP_EOL; $logFile .= 'patient id: ' . $patient_chris_id . PHP_EOL; $logFile .= 'getting data id...' . PHP_EOL; //get data id $data_chris_id = -1; $series_description = ''; $d_success = PACS::AddData($db, $process_file, $data_chris_id, $series_description); if ($d_success == 0) { echo $logFile; return; } // keep track of processed series if (!in_array($data_chris_id, $received)) { array_push($received, $data_chris_id); } $logFile .= 'data success: ' . $d_success . PHP_EOL; $logFile .= 'data id: ' . $data_chris_id . PHP_EOL; // if doesnt exist, add data $study_chris_id = -1; $study_description = ''; $s_success = PACS::AddStudy($db, $process_file, $study_chris_id, $study_description); if ($s_success == 0) {