Is there any documentation of the Postgress v6 Orthanc schema

Hello,
I was wondering if the database schema Orthanc uses in the postgres database is documented anywhere?

Thanks,
James

Hello,

Here is the link to the SQLite schema:
https://bitbucket.org/sjodogne/orthanc/src/default/OrthancServer/PrepareDatabase.sql

The PostgreSQL schema is essentially identical and can be found at:
https://bitbucket.org/sjodogne/orthanc-postgresql/src/default/IndexPlugin/PostgreSQLPrepare.sql

There is however no textual description of these schema in English.

HTH,
Sébastien-

Thanks for that Sebastian. What I was trying to do is to use the database to find out where the raw uploaded Dicom images are kept, I was thinking that the uuid in the attached files table would be a filename in the directory specified by StorageDirectory in the configuration file. If you’ve a quick pointer in the right direction, that would be great.

Thanks,
James

That’s indeed the case: The UUID of the attachment is used as the path inside “StorageDirectory”.

To reduce the number of files in a single directory (which is something that can some OS do not like), a 3-level hierarchy of directories is created: The first two hexadecimal characters of the UUID give the first level path, the two next characters give the second level path.

However, pay attention to the fact that this is only true when using no database plugin for Orthanc (the PostgreSQL plugin can be configured to store the attachements inside a database). Furthermore, Orthanc can be configured to compress the attachments before writing them on the disk (cf. the “StorageCompression” option). Finally, by reading “StorageDirectory”, you bypass all the locking mechanisms used by Orthanc.

As a consequence, it is HIGHLY recommended NOT to directly access “StorageDirectory” and the SQLite database. Use the REST API instead.

HTH,
Sébastien-

Thanks Sebastien, I’ll use the REST API, as you say.

James