Delete studies


Is there a way to delete studies by period interval?

Thanks for all help

The can delete them automatically setting a max patient count or max storage size in the config file.

// Maximum size of the storage in MB (a value of “0” indicates no
// limit on the storage size)
“MaximumStorageSize” : 0,

// Maximum number of patients that can be stored at a given time
// in the storage (a value of “0” indicates no limit on the number
// of patients)
“MaximumPatientCount” : 0,

more info here

Hello Alberto,

Many thanks for the help …

What I need is to exclude through the API, passing a range of StudyDate to delete, do you know if this is possible?

Thank you one more time!

I don’t know if orthanc can do this itself, but you can do it yourself. To do that you have to create a script or program to:

  • Get all the studies id accessing to “orthanc_ip:orthanc_http_port/studies” (usually localhost:8042/studies)
  • Get all study data for each study individually (localhost:8042/studies/any_id).
  • Parse the date.
    Date example — StudyDate: “19991115”
  • Check if this that is in the range to delete.

Hello Alberto,

I appreciate the solution, thank you very much, I will follow this path, but it would be really cool if Orthanc would abstract this one day.

Thank you very much!


This is possible using the REST API as follows:

$ curl http://localhost:8042/tools/find -d ‘{“Level”:“Study”,“Query”:{“StudyDate”:“20120101-20121231”}}’
$ curl -X DELETE http://localhost:8042/studies/6e2c0ec2-5d99c8ca-c1c21cee-79a09605-68391d12

$ curl -X DELETE http://localhost:8042/studies/ef2ce55f-9342856a-aee23907-2667e859-9f3b734d