How can i bulk delete studies of an particular institution.

1,183 views
Skip to first unread message

Nurettin KATRANCI

unread,
Feb 8, 2014, 5:08:44 AM2/8/14
to
We somehow, want to delete previous bulk studies from a particular hospital (about 30.000 studies). Is there any dcm4che2 toolkit command using institution name (or any other way) to do this.

Nurettin

Pablo

unread,
Feb 9, 2014, 5:11:56 AM2/9/14
to dcm...@googlegroups.com
You can try the following:

StudyUIDsList=`mysql  --skip-column-names pacs -ppacs pacsdb -e "select study_iuid from study, series where institution = 'INSTITUTION_NAME' and study.pk =study_fk"


for StudyUID in $StudyUIDs ; do twiddle.sh -uadmin -padmin -s jnp://localhost:1099 invoke "dcm4chee.archive:service=ContentEditService" purgeStudy  $StudyUID ; done


Assuming you type this at dcm4chee PACS terminal, it using mysql DB, substituting INSTITUTION_NAME by the required name and in a default dcm4chee installation without changes in dcm4chee database name, user names nor password. 


I hope it helps!




Dimitri Pianeta

unread,
Feb 9, 2014, 5:15:20 AM2/9/14
to dcm...@googlegroups.com
Your files DICOM are-they in a folder or in a folder with under-folder.
We use dcm4che2 or dcm4che3.

If  I have including your programm:


  1. 30.000 studies in differents folders (or folder with under-folder for example Patient1 with folders MR, CS...)
  2.  After, I make sort with dates, institution name and so on.
  3. Remove file and folder code here http://stackoverflow.com/questions/3775694/deleting-folder-from-java
  4. Or seeing the code following:


import java.io.*;

 


public class DeleteFile{

 

  private static void deletefile(String file){


  File f1 = new File(file);

 

  boolean success = f1.delete();


  if (!success){


  System.out.println("Deletion failed.");

   
System.exit(
0);

   
}
else{

   
System.out.println(
"File deleted.");

 
   }

   
}

 
 public static void main(String[] args){


  switch(args.length){

 
 case 0: System.out.println("File has not mentioned.");


  System.exit(0);

 
 case 1: deletefile(args[0]);

 
 System.exit(0);


  default : System.out.println("Multiple files are not allow.");

 

  System.exit(0);

  }

  }

}




I have a idea for making the code of this code.

Dimitri

Nurettin KATRANCI

unread,
Feb 11, 2014, 5:55:36 PM2/11/14
to dcm...@googlegroups.com
Using twiddle command seems a better solution. I will try it.

Nurettin

Jasmeet Singh

unread,
Feb 16, 2014, 7:18:49 AM2/16/14
to dcm...@googlegroups.com
Hi,

I am looking for a way to preserve the SRs while deleting studies. Is there a way to do that. If not then is there a way to delete specific series?

Please let me know. I need this done asap.

Jasmeet.

Dimitri Pianeta

unread,
Feb 16, 2014, 12:59:39 PM2/16/14
to dcm...@googlegroups.com
1. That meant SR?
2. This files Dicom find in folder or in folder and under-folder.
3. If I am understood that I am looking a serie specific or Protocol Name.

I wish that we are giving more information on your projet of program.

 

Jasmeet Singh

unread,
Feb 16, 2014, 8:17:10 PM2/16/14
to dcm...@googlegroups.com
Let me explain. I want to delete old studies but retain their structured report as my physicians only require the report after a few months.

Therefore I need a way to delete other series of a study & keep the structured report which is of modality "SR".


--
You received this message because you are subscribed to a topic in the Google Groups "dcm4che" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dcm4che/OcT9le1gww0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dcm4che+u...@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at http://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/groups/opt_out.

Dimitri Pianeta

unread,
Feb 17, 2014, 11:17:35 AM2/17/14
to
Begin this something in File "Deelete Files.pdf".
I am making this tomorrow Following something.

 
Delete Files.pdf

Dimitri Pianeta

unread,
Feb 21, 2014, 12:56:27 PM2/21/14
to dcm...@googlegroups.com
Here solving:

DeleteFolder.java : algorithm of sort file delete
TestDelet.java: Test of the class DeleteFolder


DeleteFolder.java
TestDelete.java
Reply all
Reply to author
Forward
0 new messages