<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear Alfredo,<div><br></div><div>As a convention, we try to avoid using "_" or "-" in our visit labels (or IDs or scan types) since the "_" (or "-") could be used on filenames to separate PSCID, DCCID, VisitLabels and ScanTypes. In your case, your Visit label could probably be renamed ADDTC1 to remove the underscore. </div><div><br></div><div>If it is absolutely vital to have "_" in your visit labels, you just need to modify the if statement in the function getSubjectIDs of your prod file. I tried running a dataset with an underscore in the visit label on my sandbox and the dataset was attached to the correct visit label with the underscore. Here is the modification of the if statement I did to the prod file: </div><div><br></div><div><font face="monospace, monospace">if ($patientName=~ /([^_]+)_(\d+)_([A-Z]+_\d+)/) {</font></div><div><div><font face="monospace, monospace">        $subjectID{'PSCID'} = NeuroDB::MRI::my_trim($1);</font></div><div><font face="monospace, monospace">        $subjectID{'CandID'} = NeuroDB::MRI::my_trim($2);</font></div></div><div><font face="monospace, monospace">        $subjectID{'visitLabel'} = NeuroDB::MRI::my_trim($3);</font></div><div><font face="monospace, monospace">}</font></div><div><font face="monospace, monospace"><br></font></div><div>However, I cannot guaranty you won't regret having "_" in your names later on as I am not sure 100% that it would not break other things down the line. I believe the CCNA group are using "_" in their visit labels and it added a few complications for them. I'll let them comment on this since they have more experience with this than I.</div><div><br></div><div>Hope this helps!</div><div><br></div><div>Cécile</div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 4, 2019 at 7:14 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 dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Dear LORIS-dev team,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
In the IPMSA project for the first time we are using visit labels for the MRI visits including the character "_" in the visit label, for instance ADDTC<span style="color:rgb(200,38,19)">_</span>1. This however cannot be handle by the MRI batch uploader
 because it uses the first part the name as visit label, in the previous example it uses "ADDTC" which is not a valid visit label. I can help modifying the code where the split using "_" is used (if this is used) but need indications on where to do it.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Here is the log from the file log_batch_imageuploader_YYY12345_123456_ADDTC_1.txt (I modified the PSCID to be YYY12345, the CandidateId to be 123456, and the path to the project to the location of loris to /XXX/):</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
---------------------------------------------------------------------------------------</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>Running now the following command: /XXX/bin/mri/uploadNeuroDB/<a href="http://imaging_upload_file.pl" target="_blank">imaging_upload_file.pl</a> -profile prod -upload_id 8299 /XXX/YYY12345_123456_ADDTC_1.tar.gz -verbose<br>
</span>
<div><br>
</div>
<div>/XXX/bin/mri/dicom-archive/dicomTar.pl /tmp/ImagingUpload-17-7-AkVEyo /XXX/data/tarchive -clobber -database -profile prod -verbose<br>
</div>
<div> Source: /tmp/ImagingUpload-17-7-AkVEyo<br>
</div>
<div>Target: /XXX/data/tarchive<br>
</div>
<div><br>
</div>
<div>Testing for database connectivity.<br>
</div>
<div>Database is available.<br>
</div>
<div><br>
</div>
<div>You will archive the dir                : ImagingUpload-17-7-AkVEyo<br>
</div>
<div><br>
</div>
<div>You are creating a tar with the following command:<br>
</div>
<div>tar -cf /XXX/data/tarchive/ImagingUpload-17-7-AkVEyo.tar ImagingUpload-17-7-AkVEyo<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>getting md5sums and gzipping!!<br>
</div>
<div><br>
</div>
<div>* Taken from dir                   :    /tmp/ImagingUpload-17-7-AkVEyo<br>
</div>
<div>* Archive target location          :    /XXX/data/tarchive/DCM_2011-02-17_ImagingUpload-17-7-AkVEyo.tar<br>
</div>
<div>* Name of creating host            :    132.206.178.78<br>
</div>
<div>* Name of host OS                  :    Linux<br>
</div>
<div>* Created by user                  :    lorisadmin<br>
</div>
<div>* Archived on                      :    2019-02-04 17:07:43<br>
</div>
<div>* dicomSummary version             :    1<br>
</div>
<div>* dicomTar version                 :    1<br>
</div>
<div>* md5sum for DICOM tarball         :    6ca6a6e5c3a77bb8a15dc1eeae3147a7  ImagingUpload-17-7-AkVEyo.tar<br>
</div>
<div>* md5sum for DICOM tarball gzipped :    eda7f62c570818aa0d96a73ded441345  ImagingUpload-17-7-AkVEyo.tar.gz<br>
</div>
<div>* md5sum for complete archive      :    79d919f5676aadeea91762a4a07c165e  DCM_2011-02-17_ImagingUpload-17-7-AkVEyo.tar<br>
</div>
<div><br>
</div>
<div>Adding archive info into database<br>
</div>
<div><br>
</div>
<div>Removing temporary files from target location<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Done adding archive info into database<br>
</div>
<div><br>
</div>
<div>/XXX/bin/mri/uploadNeuroDB/tarchiveLoader -globLocation -profile prod /XXX/data/tarchive/DCM_2011-02-17_ImagingUpload-17-7-AkVEyo.tar -verbose<br>
</div>
<div> md5sum /XXX/data/tarchive/DCM_2011-02-17_ImagingUpload-17-7-AkVEyo.tar<br>
</div>
<div>PSCID is: YYY12345<br>
</div>
<div> CandID id: 123456<br>
</div>
<div> <span style="color:rgb(200,38,19)">visit_label is: ADDTC</span><br>
</div>
<span>candidate id 123456</span><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span><span style="color:rgb(200,38,19)">=> No Visit labelVisit label does not exist</span><span><br>
</span>
<div>Set newVisitNo = 5 and centerID = 316<br>
</div>
<div>PSCID is: <span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline">
YYY12345</span><br>
</div>
<div> CandID id: <span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline">
123456</span><br>
</div>
<div> <span style="color:rgb(200,38,19)">visit_label is: </span><span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);color:rgb(200,38,19);display:inline">ADDTC</span><br>
</div>
<div><br>
</div>
<span>Number of MINC files that will be considered for inserting into the database: 5</span><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span><span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline">---------------------------------------------------------------------------------------</span><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Let me know if the issue is clear and if you need more information. We have more than 20 visit label with "_" in the name.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Best,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Alfredo.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
P.S. We previously modified the name of the visit label to replace the character "-" with "_" because the API cannot handle "-" in the url.</div>
<div id="gmail-m_-3359311575631631911signature">
<div class="gmail-m_-3359311575631631911BodyFragment"></div>
</div>
<p></p>

<p>The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.</p></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>