[Loris-dev] [IPMSA] MRI batch uploader cannot handle visits labels with "_"

Cecile Madjar cecile.madjar at mcin.ca
Tue Feb 5 10:49:13 EST 2019


Dear Alfredo,

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.

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:

if ($patientName=~ /([^_]+)_(\d+)_([A-Z]+_\d+)/) {
        $subjectID{'PSCID'} = NeuroDB::MRI::my_trim($1);
        $subjectID{'CandID'} = NeuroDB::MRI::my_trim($2);
        $subjectID{'visitLabel'} = NeuroDB::MRI::my_trim($3);
}

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.

Hope this helps!

Cécile

On Mon, Feb 4, 2019 at 7:14 PM Morales Pinzon, Alfredo <
AMORALESPINZON at bwh.harvard.edu> wrote:

> Dear LORIS-dev team,
>
> 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_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.
>
> 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/):
>
>
>
> ---------------------------------------------------------------------------------------
> Running now the following command: /XXX/bin/mri/uploadNeuroDB/
> imaging_upload_file.pl -profile prod -upload_id 8299
> /XXX/YYY12345_123456_ADDTC_1.tar.gz -verbose
>
> /XXX/bin/mri/dicom-archive/dicomTar.pl /tmp/ImagingUpload-17-7-AkVEyo
> /XXX/data/tarchive -clobber -database -profile prod -verbose
>  Source: /tmp/ImagingUpload-17-7-AkVEyo
> Target: /XXX/data/tarchive
>
> Testing for database connectivity.
> Database is available.
>
> You will archive the dir                : ImagingUpload-17-7-AkVEyo
>
> You are creating a tar with the following command:
> tar -cf /XXX/data/tarchive/ImagingUpload-17-7-AkVEyo.tar
> ImagingUpload-17-7-AkVEyo
>
>
> getting md5sums and gzipping!!
>
> * Taken from dir                   :    /tmp/ImagingUpload-17-7-AkVEyo
> * Archive target location          :
>  /XXX/data/tarchive/DCM_2011-02-17_ImagingUpload-17-7-AkVEyo.tar
> * Name of creating host            :    132.206.178.78
> * Name of host OS                  :    Linux
> * Created by user                  :    lorisadmin
> * Archived on                      :    2019-02-04 17:07:43
> * dicomSummary version             :    1
> * dicomTar version                 :    1
> * md5sum for DICOM tarball         :    6ca6a6e5c3a77bb8a15dc1eeae3147a7
>  ImagingUpload-17-7-AkVEyo.tar
> * md5sum for DICOM tarball gzipped :    eda7f62c570818aa0d96a73ded441345
>  ImagingUpload-17-7-AkVEyo.tar.gz
> * md5sum for complete archive      :    79d919f5676aadeea91762a4a07c165e
>  DCM_2011-02-17_ImagingUpload-17-7-AkVEyo.tar
>
> Adding archive info into database
>
> Removing temporary files from target location
>
>
> Done adding archive info into database
>
> /XXX/bin/mri/uploadNeuroDB/tarchiveLoader -globLocation -profile prod
> /XXX/data/tarchive/DCM_2011-02-17_ImagingUpload-17-7-AkVEyo.tar -verbose
>  md5sum /XXX/data/tarchive/DCM_2011-02-17_ImagingUpload-17-7-AkVEyo.tar
> PSCID is: YYY12345
>  CandID id: 123456
>  visit_label is: ADDTC
> candidate id 123456
>
> => No Visit labelVisit label does not exist
> Set newVisitNo = 5 and centerID = 316
> PSCID is: YYY12345
>  CandID id: 123456
>  visit_label is: ADDTC
>
> Number of MINC files that will be considered for inserting into the
> database: 5
>
> ---------------------------------------------------------------------------------------
>
> 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.
>
> Best,
> Alfredo.
>
> P.S. We previously modified the name of the visit label to replace the
> character "-" with "_" because the API cannot handle "-" in the url.
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
> _______________________________________________
> Loris-dev mailing list
> Loris-dev at bic.mni.mcgill.ca
> https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20190205/e7cbde7b/attachment-0001.html>


More information about the Loris-dev mailing list