ArchiveStudiesInTimeRange little bug + error

hello

  1. I had found a bug in ArchiveStudiesInTimeRange.py

The problem is with name of arhive.
It is structured : date- patientID PatientName-StudiesDescription.zip

If a patient had 2 studies in same day, at diferen time will arhive only 1 studies, because the zip file will be rewrite with same name.
My purpose is : Replace at line 74 : GetTag(study, ‘StudyDescription’)) with GetTag(study, ‘StudyTime’))
In this way will be generated 2 files coresponding with time of each studies, with name: date- patientID PatientName-StudiesTime.zip

  1. And a second problem with this file is the follow: it gives error after arhiving few patients, in special when it work with a patient with 5000-6000 instances.
    The RAM memory get 80-95% full and sometime get error, as is in the pictures attached
    Thanks

ArchiveStudiesInTimeRange1.png

ArchiveStudiesInTimeRange2.png

ArchiveStudiesInTimeRange3.png

I identify error cause: tmp size is too small for arhiving multiple studies .
Solution : increase tmp folder size (mount -o remount,size=5G /tmp/) in Debian, or set the TemporaryFolder in other place. Default : “TemporaryDirectory” : “/tmp/Orthanc/”.

joi, 27 februarie 2020, 14:10:43 UTC+2, Adrian Schiopu a scris:

Hello again
The arhiving process still not working. It feeze all the time, wihtout log any error, sometime afrer few minutes, sometime after few hours.
Sometime orthanc server still running (I can acces in via http on port 8042, or via radiant software on port 4242), but sometime the orthanc server stop and can not be accesed.
My machine is in production , I can’t stop it to make arhiving…
I had made some test on another machine, clean install, but still some problem (the attached image is from test machine)

joi, 27 februarie 2020, 18:25:41 UTC+2, Adrian Schiopu a scris:

Arh1.png

Why don’t use use the REST API if the “/archive” endpoint doesn’t work for you?

Just create an external script (e.g. in Python) that downloads the DICOM images, and that implements the ZIP compression outside of an Orthanc job. As a system administrator, this will give you full control over the archiving process.
https://book.orthanc-server.com/users/rest.html

Also, if you don’t provide any log in “–verbose” mode and if you don’t provide a minimal working example to reproduce your issue, don’t expect any support:
https://book.orthanc-server.com/users/support.html

  1. I had found a bug in ArchiveStudiesInTimeRange.py

The problem is with name of arhive.
It is structured : date- patientID PatientName-StudiesDescription.zip

If a patient had 2 studies in same day, at diferen time will arhive only 1 studies, because the zip file will be rewrite with same name.

Yes, this is why this Python script is part of the “Samples” folder:
https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/Python/

By definition, a “sample” must be adapted to your very specific situation. This is not a bug at all.