Copying of new subfolders only in a database

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Copying of new subfolders only in a database Fri Sep 05, 2014 5:19 pm • by howardm
Hi,

I have an OsiriX Radiology Teaching File.

The [master] Database Folder is "DATABASE.noindex" Each new case (consisting of X number of dicom files) is created in a subfolder, labeled with a number , for example, "360000"

I would to use Hazel to copy any new case to a [synced] Dropbox folder so that I can then add it to another OsiriX Teaching File Database on another device.

(On the other device, I simply move the new dicom files to the INCOMING folder of OsiriX, so that the Dropbox folder remains empty. I use it as a conduit.)

I would like to simply:

1. Copy a new subfolder [case] added to the Database at a particular moment to a designated Dropbox folder.
2. Then copy over only the new case(s) I add subsequently. (I often add several new cases to the Teaching File on any particular day.)

Can someone please provide my with the conditions/rules to accomplish this.

Thanks!



Howard
howardm
 
Posts: 16
Joined: Fri Sep 05, 2014 4:51 pm

As an aside, I had to read http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCAQFjAA&url=http%3A%2F%2Fchestradiologists.org%2Fblog%2F2013%2F03%2F23%2Ftitle&ei=CXwKVNbgLPaRsQTsk4HQCQ&usg=AFQjCNG9k_9iTqymt9arSQil_G5YIABpwg&sig2=8dIxtF0tU_49kch2FBuPuw&bvm=bv.74649129,d.cWc to understand what you were talking about :D

I think i understand your workflow. Will use examples to make sure its clear.

Master folder is called Database.noindex. You add subfolders to that master folder, each being a new case - for example 0001 and 0002 are each separate cases. Contained within each of these case folders are DICOM files. You also have a Dropbox folder used as a conduit, lets call that one DropboxSyncFolder.

The following rule will 1) copy any existing case folders (i.e. 0001, 0002, 0003) in the Database.noindex folder to the DropBoxSyncFolder and 2) subsequently, only copy new cases added to the Database.noindex folder (i.e. 0004, 0005, etc) to the DropboxSyncFolder.

Folder to run rules on will be Database.noindex
Rule 1
If all of the following conditions are met:
Date added -- is after -- Date Last Matched
Kind -- is -- Folder

Do the following to the matched file or folder:
Copy -- to folder: DropboxSyncFolder

Thats it. Now if you do not want to copy existing case folders in the Database.noindex folder but only new ones, there are probably a few ways to achieve this but i would simply add one more condition to the first part of Rule 1 above that is: Date Added -- is after -- "specific date" and choose todays date or 9/6/2014). That effectively serves as the starting point for cases to be synced.

Hope that helps.
dhy8386
 
Posts: 96
Joined: Tue Nov 09, 2010 12:19 pm

Great. Thanks for your help.

This seems to be working fine.

Howard
howardm
 
Posts: 16
Joined: Fri Sep 05, 2014 4:51 pm

Hi,

I made a mistake when describing my setup in my initial post.

More than one case may go into a particular folder. So I cannot work at the folder level; I have to work at the file level.

Note also that I have started with a completely empty Database folder.

So now I have (for the Database Folder to which image files are sent over a network]:

................

* If all of the following conditions are met for any of its subfiles or subfolders

* Date Added is not in the last 5 minutes

[I added this as Hazel otherwise only copies over some of the files coming over the network to the Database folder; this seems to prevent this]

* Date Added is after Date Last Matched

* Kind is DICOM Image

Do the following to the matched file or folder:

Copy to folder [Dropbox folder]

..........

Do you see any potential problem with this ?

Thanks!


Howard
howardm
 
Posts: 16
Joined: Fri Sep 05, 2014 4:51 pm

Additional question:

The result of this the conditions/rules process mentioned above is demonstrated in this screenshot:

https://www.dropbox.com/s/i8bze1gksk52z ... y.png?dl=0

It shows the copying of five cases to the Dropbox folder, and the number of images (files) per case.

I was expecting the following result for the folders:

30000 : 69 items

30000-1 : 1 item

30000-2 : 63 items

30000-3 : 780 items

30000-4 : 733 items

.....

Instead, I get what you see in the screenshot. Each time, the entire folder of incremented files is copied, instead of just the new files.

? any idea why this is happening

Thanks.


Howard
howardm
 
Posts: 16
Joined: Fri Sep 05, 2014 4:51 pm

If you are copying folders, your options are to replace it or rename it. I suspect it is renaming it by numbering. There is no merge function so I think you need to rework your rules.

First off, read the sticky post up top about going into subfolders. Once you have that, then create a rule to copy each file. The important thing here is in the copy action, to set the option to copy the folder structure. I'm guessing in your case, "parent folder only" is the one you want. You'll have to tweak it from there but that should basically do it.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi Mr. Noodle,

I appreciate your interest.

No, I'm not copying folders. (I'm afraid the title of my posting is misleading due to a misunderstanding on my part. See my other replies.)

I am only interested in copying new files (dicom image files) to the Dropbox folder.

In the Imaging Database, the OsiriX program puts the files into a DATABASE folder and creates subfolders according to a scheme that I do not understand.

But, for this purpose, the subfolder structure is irrelevant. If Hazel would simply copy any new (arriving) files into the Dropbox folder (without the creation of a subfolder), that would work for me.

From the synced Dropbox folder (containing files only), I could easily import the files into my other OsiriX Database.

Sincerely,


Howard
howardm
 
Posts: 16
Joined: Fri Sep 05, 2014 4:51 pm

You may not want to copy folders, but you are copying folders. If you follow my instructions, it should copy files. Whether you re-create the folder structure is optional but the base method is the same.
Mr_Noodle
Site Admin
 
Posts: 11866
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi Mr. Noodle,

I'm afraid I don't understand what you mean, in spite of the fact that I've read your suggestions about going into subfolders.

Perhaps you can write the rules for me :-)

Here is my situation:

1. I am creating Radiology Teaching File cases of dicom (.dcm) files.

2. At time X, the Database.noindex folder contains one case of 64 dicom files. The files are contained in a subfolder called 10000.

3. Sometime later in the day, I add another case of 65 images to the Database.noindex folder. Subfolder 10000 now contains 129 dicom files.

4. I add another case of 66 dicom files. Subfolder 10000 now contains 195 dicom files.

5. I add another case of 68 dicom files. The OsiriX application nows puts these in a new subfolder 20000.

(etc.)

6. As I add new cases, I would like the new dicom files (of each case) copied over to the Dropbox folder.


Thanking you,



Howard
howardm
 
Posts: 16
Joined: Fri Sep 05, 2014 4:51 pm

Solved!

I didn't properly understand the notion of creating two separate rules for the folder.

The first rule addresses the notion of applying the subsequent rule(s) through all the subfolders — only.

The second rule specifies the actual conditions and actions to achieve the desired outcome.

This is easiest to appreciate in this image: https://www.dropbox.com/s/2af433tsiz95b ... s.png?dl=0

Mr. Noodle,

You may want to supplement your explanation with this kind of graphic. Thanks for your interest.

Cheers.


Howard
howardm
 
Posts: 16
Joined: Fri Sep 05, 2014 4:51 pm


Return to Support