How to delete all studies in Orthanc at once

1,618 views
Skip to first unread message

Saiteja Jayanthi

unread,
Apr 25, 2021, 11:02:16 AM4/25/21
to Orthanc Users
Hi All,
I am working with an Orthanc server with more than 100 studies, is there anyway to cleanup all the studies at once?
Looking for a solution to easily cleanup full Orthanc at once as it is painful to delete each and every study individually.
Can someone please help me on this?


Thanks,
Saiteja.

Terry Hauschulz

unread,
Apr 25, 2021, 12:40:16 PM4/25/21
to Orthanc Users
There is a simple way to empty the database.  In the configuration file orthanc.json change one of the following:

I do this for my windows install:

  // Maximum size of the storage in MB (a value of "0" indicates no
  // limit on the storage size)
  "MaximumStorageSize" : 0,   ( changer the 0 to 1, stop and restart the service, the will empty the data base to 1 MB.  give it some time to empty then change it back to 0 stop and restart the service again)

  // 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,   ( changer the 0 to 1, stop and restart the service, the will empty the data base to 1 patient.  Give it some time to empty then change it back to 0 stop and restart the service again.  Now you only have 1 patient to delete.)

Best,
Terry

Diego Victor de Jesus

unread,
Apr 25, 2021, 3:11:00 PM4/25/21
to Orthanc Users
You can make a GET request to the /studies/ endpoint of the API to get a list of studies you want to delete.

Then you can iterate that list somehow, doing each time a DELETE request to the /studies/{id} endpoint.

Salim Kanoun

unread,
Apr 25, 2021, 5:19:42 PM4/25/21
to Orthanc Users
OrthancToolsJS includes a deletion list management and delete even a long list of ressources (patient/study/series) through the GUI

Saiteja Jayanthi

unread,
Apr 26, 2021, 10:02:35 AM4/26/21
to orthan...@googlegroups.com
Thanks All,
These solutions helped me solve the problem.


--
You received this message because you are subscribed to a topic in the Google Groups "Orthanc Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orthanc-users/09LJUQcAIaY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orthanc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orthanc-users/7101271c-c4d8-4fe6-a592-a4aa8e88e594n%40googlegroups.com.


--
Thanks 




This message contains information that may be privileged or confidential and is the property of the Quantiphi Inc and/or its affiliates. It is intended only for the person to whom it is addressed. If you are not the intended recipient, any review, dissemination, distribution, copying, storage or other use of all or any portion of this message is strictly prohibited. If you received this message in error, please immediately notify the sender by reply e-mail and delete this message in its entirety
Reply all
Reply to author
Forward
0 new messages