<div dir="ltr">Hi Alfredo,<div><br></div><div>So what you are saying is that the script deleted a record in table mri_upload with uploadid = 3200 but there was no corresponding UPDATE session statement? In your previous email you were referring to a session with ID 845 that had scan_done set to 'Y' even though there were no archives associated to it. Was the mri_upload with uploadid 3200 tied to session 845? Are you able to see in the backup file all the mri_uploads tied to session 845 that were deleted? </div><div><br></div><div><br></div><div>Nicolas</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 15, 2020 at 12:51 PM Morales Pinzon, Alfredo <<a href="mailto:AMORALESPINZON@bwh.harvard.edu">AMORALESPINZON@bwh.harvard.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="overflow-wrap: break-word;">
Hi Nicolas,
<div><br>
</div>
<div>I checked the records, for the 3200 deleted uploadId, and the sessionID was not in there. Also, the UPDATE statement was issues in the same table. Here is an example of INSERT and UPDATE commands in the SQL file:</div>
<div><br>
</div>
<div>===</div>
<div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"><font color="#000000">INSERT INTO `mri_upload` VALUES (9,'lorisadmin\n','2017-11-28 16:30:47',’/ABC/AAB21935_880779_m00.tar.gz','/tmp/ImagingUpload-16-30-jIjf1G',1,0,'AAB21935_880779_m00',8,8,6,</font><font color="#ff1f00">4</font><font color="#000000">,1,1,'N');</font></span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">UPDATE session s SET Scan_done = 'Y' WHERE s.ID IN (4) AND (SELECT COUNT(*) FROM mri_upload m WHERE m.SessionID=s.ID) > 0; </span></div>
</div>
<div>===</div>
<div><br>
</div>
<div>Maybe the insertion process didn’t finish properly but the state of the database was updated? As you can see this images were uploaded in 2017 using LORIS v17.0.0 or v18.0.0. Let me know if you have more suggestions on what to check and how we
 can solve this.</div>
<div><br>
</div>
<div>Best,</div>
<div>Alfredo.</div>
<div>
<div><br>
<blockquote type="cite">
<div>On Apr 13, 2020, at 8:37 PM, Nicolas Brossard <<a href="mailto:nicolasbrossard.mni@gmail.com" target="_blank">nicolasbrossard.mni@gmail.com</a>> wrote:</div>
<br>
<div>
<p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)">        External Email - Use Caution        </span></p>
<div><br>
</div>
<div dir="ltr">Hi Alfredo,
<div><br>
</div>
<div>I am curious to see the actual records that the delete script removed from your mri_upload table. Since the delete script backs up what it deletes, you can have a look inside the backup file it created. By default, this file is named imaging_upload_backup.tar.gz.
 Inside, you'll find an SQL file that should contain all the entries in mri_upload that were deleted. Can you check if all of them have a sessionID set to 845 (they should)? Can you also check in the same file the UPDATE statement that was issued on the session
 table? We'll start with these checks first.</div>
<div><br>
</div>
<div><br>
</div>
<div>Best,</div>
<div>Nicolas</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Apr 13, 2020 at 8:16 PM Morales Pinzon, Alfredo <<a href="mailto:AMORALESPINZON@bwh.harvard.edu" target="_blank">AMORALESPINZON@bwh.harvard.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Dear LorisDev Team,
<div><br>
</div>
<div>I recently removed all the UploadIDs from a study using the script “<font face="Helvetica Neue"><span><a href="http://delete_imaging_upload.pl/" target="_blank">delete_imaging_upload.pl</a></span><span>”</span><span>.
 However, in the front-end I can see some </span><span>imaging visits for some candidates of the study. </span></font></div>
<div><font face="Helvetica Neue"><span><br>
</span></font></div>
<div><font face="Helvetica Neue"><span>Here is an example for one visit:</span></font></div>
<div><br>
</div>
<div>Here is the imaging session for one the Candidates with the issue:</div>
<div><font face="Helvetica Neue"><span>===</span></font></div>
<div>
<div><font face="Menlo">select * from session where CandID in (450030) \G;</font></div>
<div><font face="Menlo">*************************** 1. row ***************************</font></div>
<div><font face="Menlo">                  <font color="#ff1f00">
ID: 845</font></font></div>
<div><font face="Menlo">              CandID: 450030</font></div>
<div><font face="Menlo">            CenterID: 60</font></div>
<div><font face="Menlo">             VisitNo: 1</font></div>
<div><font face="Menlo">         Visit_label: m00</font></div>
<div><font face="Menlo">        SubprojectID: 2</font></div>
<div><font face="Menlo">           Submitted: N</font></div>
<div><font face="Menlo">       Current_stage: Not Started</font></div>
<div><font face="Menlo">   Date_stage_change: NULL</font></div>
<div><font face="Menlo">           Screening: NULL</font></div>
<div><font face="Menlo">      Date_screening: NULL</font></div>
<div><font face="Menlo">               Visit: NULL</font></div>
<div><font face="Menlo">          Date_visit: NULL</font></div>
<div><font face="Menlo">            Approval: NULL</font></div>
<div><font face="Menlo">       Date_approval: NULL</font></div>
<div><font face="Menlo">              Active: Y</font></div>
<div><font face="Menlo">         Date_active: 2017-11-10</font></div>
<div><font face="Menlo">        RegisteredBy: 5216-ICR_dataman</font></div>
<div><font face="Menlo">              UserID: 5216-ICR_dataman</font></div>
<div><font face="Menlo">     Date_registered: 2017-11-10</font></div>
<div><font face="Menlo">            Testdate: 2017-11-30 11:07:25</font></div>
<div><font face="Menlo">    Hardcopy_request: -</font></div>
<div><font face="Menlo">         BVLQCStatus: NULL</font></div>
<div><font face="Menlo">           BVLQCType: NULL</font></div>
<div><font face="Menlo">      BVLQCExclusion: NULL</font></div>
<div><font face="Menlo">                 QCd: NULL</font></div>
<div><font face="Menlo">          <font color="#ff1f00">
 Scan_done: Y</font></font></div>
<div><font face="Menlo">         MRIQCStatus:</font></div>
<div><font face="Menlo">        MRIQCPending: N</font></div>
<div><font face="Menlo">MRIQCFirstChangeTime: NULL</font></div>
<div><font face="Menlo"> MRIQCLastChangeTime: NULL</font></div>
<div><font face="Menlo">           MRICaveat: false</font></div>
</div>
<div><font face="Helvetica Neue"><span>===</span></font></div>
<div><font face="Helvetica Neue"><span><br>
</span></font></div>
<div><font face="Helvetica Neue"><span>However, there is no TarchiveID associated with the session id in the mri_upload table</span></font></div>
<div><span><font face="Menlo">===</font></span></div>
<div><span><font face="Menlo">
<div><span>select TarchiveID from mri_upload where SessionID=</span><font color="#ff1f00">845</font><span> \G;</span></div>
<div>Empty set (0.00 sec)</div>
</font></span></div>
<div><span><font face="Menlo">===</font></span></div>
<div><font face="Helvetica Neue"><span><br>
</span></font></div>
<div><font face="Helvetica Neue"><span>Any ideas on how can I fix this.</span></font></div>
<div><font face="Helvetica Neue"><span><br>
</span></font></div>
<div><font face="Helvetica Neue"><span>Thank you in advance for your help.</span></font></div>
<div><font face="Helvetica Neue"><span><br>
</span></font></div>
<div><font face="Helvetica Neue"><span>Regards,</span></font></div>
<div><font face="Helvetica Neue"><span>Alfredo.</span></font></div>
<div><font face="Helvetica Neue"><span><br>
</span></font></div>
<div><font face="Helvetica Neue"><span><br>
</span></font></div>
</div>
_______________________________________________<br>
Loris-dev mailing list<br>
<a href="mailto:Loris-dev@bic.mni.mcgill.ca" target="_blank">Loris-dev@bic.mni.mcgill.ca</a><br>
<a href="https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev" rel="noreferrer" target="_blank">https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev</a><br>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>

</blockquote></div>