function removeParticipant($pGUID) { $d = loadParticipants(); $found = 0; foreach ($d as $key => $ds) { if ($ds['pGUID'] == $pGUID) { unset($d[$key]); $found = $found + 1; } } if ($found == 1) { saveParticipants(array_values($d)); } return $found; }
// create an event that alerts the user that image data has been reviewed, shows the resulting 'score' $p = loadParticipants(); // add an event for this pGUID $found = false; $entry = array(); foreach ($p as &$pa) { if ($pa['pGUID'] == $pGUID) { $entry = array("eventType" => "DICOM reviewed", "eventNotes" => "score: " . $score . "<br>" . $_POST['other_notes'], "username" => "RadReview <span class=\"label label-info\">" . $score . "</span>", "date" => date(DATE_ATOM), "serverdate" => date(DATE_ATOM), "payload" => $_POST); $pa['events'][] = $entry; $found = true; break; } } if ($found) { logmsg("Save participants with reviewed event and score: " . $score . ".\nData: " . json_encode($_POST)); saveParticipants($p); } else { logmsg("Warning: reviewed received but nothing was saved\nData: " . json_encode($_POST)); } // if we have an event with a score >= 2 we should send an email to alert DAIC $emails = array("*****@*****.**", "*****@*****.**", "*****@*****.**", "*****@*****.**"); //$emails = array( "*****@*****.**" ); if ($score > 1) { foreach ($emails as $to) { $subject = "Actionable imaging event (score: " . $score . ", site: " . $site . ")"; $txt = "<html><body>" . "<p>A radiology review was submitted with a score of " . $score . ".</p><p> This requires a followup with the site: " . $site . ".</p>"; $txt = "<p>You are receiving this email as part of the ABCD pilot project. You have been identified as a clinician or PI responsible for incidental findings with ABCD subjects. Data from your site was sent to a radiologist (Rahul Desikan, rahul.desikan@ucsf.edu) for review and we received the attached imaging report.</p><p>The report requires an action from your end.</p><p>Please acknowledge the receipt of this email in our database (<a href=\"https://abcd-rc.ucsd.edu/redcap/redcap_v6.16.5/DataEntry/index.php?pid=12&id=" . $pGUID . "&event_id=40&page=mr_findings_resolution\">Link to REDCap (confirm received notice)</a>).</p><p>Also, indicate in REDCap once this finding has been resolved (<a href=\"https://abcd-rc.ucsd.edu/redcap/redcap_v6.16.5/DataEntry/index.php?pid=12&id=" . $pGUID . "&event_id=40&page=mr_findings_resolution\">Link to REDCap (resolution)</a>).</p>"; $txt = $txt . "<h3>Detailed Report</h3><p><dl>"; $txt = $txt . "<p><b>" . $_POST['other_notes'] . "</b></p>"; foreach ($_POST as $key => $value) { $txt = $txt . " <dt>" . $key . "</dt> <dd>" . $value . "</dd><br>";