Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ImgBrowser] Add DICOM Download #2791

Closed

Conversation

christinerogers
Copy link
Contributor

@christinerogers christinerogers commented May 8, 2017

This pull request adds DICOM download to the Imaging Browser View Session page, via a button in the navigation panel.
All files for the given session (specifically, tarchiveID) will be downloaded.
get_file.php is also modified to identify DICOM tarchives as type of file for download.

Note that your Dicom tarchives (and above directories) must be Executable* (unix permission-wise) for the download (get_file.php) to work.

@christinerogers christinerogers added the Category: Feature PR or issue that aims to introduce a new feature label May 8, 2017
@christinerogers christinerogers added this to the 17-1 milestone May 8, 2017
// To enable DICOM download: Add pair: tarchiveID, ArchiveLocation
$tarchiveIDLoc = $DB->pselect(
"SELECT TarchiveID, ArchiveLocation
FROM tarchive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a prepared statement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the catch 👍

@jstirling91 jstirling91 modified the milestones: 17.1, 17-1 May 10, 2017
@mohadesz mohadesz added the State: Needs work PR awaiting additional work by the author to proceed label May 10, 2017
@mohadesz
Copy link
Contributor

mohadesz commented May 10, 2017

Clicking on the download link doesn't do anything.

@mohadesz -- Are your Dicom tarchives (and above directories) Executable? (will only work if so, i'll amend the PR blurb at top)

@MounaSafiHarab
Copy link
Contributor

@christinerogers

I meant to push to your branch not this pull request; I did not know it would make it directly here without you approving it first. Sorry!

@@ -136,10 +136,10 @@
$MimeType = 'image/vnd.nrrd';
$DownloadFilename = basename($File);
break;
case 'DICOMTAR':
case 'tar':
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MounaSafiHarab - good improvement to just handle all Tars.

  • if using 'tar' over DICOMTAR, let's also remove the code at that sets $FileExt = 'DICOMTAR'
  • I specified dicomtar, envisioning that Media Module etc might store other tars of stimulus files, or other non-imaging tars stored elsewhere (even genetics). i.e. Will all future tars in Loris be images accessible on the Imaging path?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christinerogers

In the last commit,

  1. I switched it back to have the option to allow other tar to be downloaded (so I went back to dicomtar), but I changed the "trachive" to "DCM_" which is automatically appended by the pipeline (tarchive no longer exists in the archivelocation as it is now a relative location).
  2. ran phpcs

@@ -131,6 +137,12 @@
$MimeType = 'image/vnd.nrrd';
$DownloadFilename = basename($File);
break;
case 'DICOMTAR':
// ADD case for DICOMTAR
$FullPath = $imagePath . '/' . $File;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christinerogers

$imagePath can eventually be changed to get the tarchiveLibraryDir from Config table (once #2649 is merged).

<li><a href="{$baseurl}/dicom_archive/viewDetails/?tarchiveID={$tarchive}&backURL={$backURL|escape:"url"}">DICOM Archive(s) {$tarchive}</a></li>
{/foreach}
{foreach from=$subject.tarchiveidLoc item=tarchiveLoc}
<li><a href="/mri/jiv/get_file.php?file=tarchive/{$tarchiveLoc}" class="btn btn-primary btn-small">
Copy link
Contributor

@MounaSafiHarab MounaSafiHarab May 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christinerogers

once this is merged (#2649); and get_file.php is made to use the Config variable tarchiveLibraryDir, the hardcoded tarchive in file=tarchive/{$tarchiveLoc} can be removed

// To enable DICOM download: Add pair: tarchiveID, ArchiveLocation
$qresult = $DB->pselectRow(
"SELECT TarchiveID, ArchiveLocation
FROM tarchive
WHERE PatientName LIKE $ID",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christinerogers

not sure how to use a prepared query with $ID being defined a few lines earlier with 2 cases and the second case being a concat of 3 different variables)...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed with @AnyhowStep, and he did not see the query the way it is as a security risk.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just not obvious in the diff that $ID is safe since GitHub is hiding that part of the code unless you manually expand it..

Copy link
Contributor

@MounaSafiHarab MounaSafiHarab Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christinerogers

discussed at the Imaging meeting of July 18th, 2017:

  1. pselectRow should be pselect (we might have more than one tarchiveID per session)

  2. Have the download DICOM button next to the Dicom Archive Link; and /or have the download cloud list the Dicom Tarchive ID next to it

  3. add the download cloud in the dicom archive module as well (RM #9865); @davidblader

@johnsaigle
Copy link
Contributor

johnsaigle commented Jun 14, 2017

Please see my PR as it touches the same file.

Since my PR is being sent to 17.0, the changes in this file should be updated to match the new formatting.

Please let me know if you have questions.

I'm using a different approach now; these changes shouldn't cause any issues. Removing the Blocked tag.

@johnsaigle johnsaigle added State: Blocked PR or issue awaiting an external event such as the merge or another PR to proceed and removed State: Blocked PR or issue awaiting an external event such as the merge or another PR to proceed labels Jun 14, 2017
@MounaSafiHarab MounaSafiHarab self-assigned this Jul 5, 2017
@samirdas samirdas modified the milestones: 17.1, 17.2 Jul 6, 2017
@davidblader davidblader self-assigned this Jul 18, 2017
@MounaSafiHarab
Copy link
Contributor

MounaSafiHarab commented Jul 20, 2017

@christinerogers

for item 1. above, please see this:
christinerogers@c00366a
(and the snapshot in that pull request to your branch to have an idea of what it looks like in the front end)

@driusan driusan removed this from the 18.1 milestone Oct 2, 2017
@ridz1208 ridz1208 changed the base branch from 17.1-dev to minor October 21, 2017 17:24
@MounaSafiHarab
Copy link
Contributor

@christinerogers
any news on this PR? what is the status? which release is it going to?

@MounaSafiHarab
Copy link
Contributor

MounaSafiHarab commented Jan 4, 2018

@christinerogers

  1. let me know if you will update this or if you prefer that someone else to work on this so we can finalise it.
  2. also now that the design specs are there for this module (depending on which release this pull request will go to), the README.md needs to be updated to account for the new feature introduced in this pull request.

@MounaSafiHarab MounaSafiHarab added the State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) label Jan 4, 2018
@christinerogers
Copy link
Contributor Author

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Feature PR or issue that aims to introduce a new feature State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) State: Needs work PR awaiting additional work by the author to proceed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants