A CRF with a file

One of the neat things of OpenClinica is the option to "attach" a file to a CRF. This can be useful if in your study X-rays are used. Another example could be pdf's of letters of specialists, etc.

Setting up this facility is very straight-forward: in your CRF-XLS file you add an item for the file. Give ITEM_NAME etc. as appropriate. For both RESPONSE_TYPE (N) and RESPONSE_LABEL (O) fill in "file"; for DATA_TYPE (T) also "FILE" (fig. 1)

fig. 1: XL of CRF with file

You can upload this XL-file in the normal way and assign it to one or more of your events. When data-entry opens it, a button "Click to upload file" is displayed and the user can browse in the normal way to the file, confirm the upload and that's it (fig. 2).

fig. 2: empty CRF with file

Once the file is uploaded, the CRF changes: now two buttons appear: "Replace" and "Remove" (fig. 3). Clicking on the file will open it in the application, associated with this type of file.

fig. 3: complete CRF with file

Where are these files stored?

All the "normal" data of your study are stored in your Postgres or Oracle database, but not so the uploaded files. They are renamed uniquely and stored in the directory that also contains XL-s, XML-files, etc. This directory is (for Linux) /usr/local/tomcat/openclinica.data/attached_files. If you browse to that directory, you'll see subdirectories with the names of your studies, i.e. the Unique Protocol ID. The consequence of this is that you must not change the Unique Protocol ID after you have uploaded one or more files, because then OpenClinica can not retrieve them anymore!
And this is one more reason for including this directory in your backup-procedures.