[BitBucket user: Alain Mazy] [BitBucket date: 2017-07-19.13:17:16] There's a workaround however by implementing a lua script (http://book.orthanc-server.com/users/lua.html) which will protect and unprotect a patient each time a new study is received for this patient. This way, everytime a new study is received, the patient will be moved to the last position in the recycling order. ``` function OnStablePatient(patientId) local protectedStatus = RestApiGet('patients/' .. patientId .. '/protected') if protectedStatus == '1' then RestApiPut('/patients/' .. patientId .. '/protected', '0') RestApiPut('/patients/' .. patientId .. '/protected', '1') else RestApiPut('/patients/' .. patientId .. '/protected', '1') RestApiPut('/patients/' .. patientId .. '/protected', '0') end end ```
[BitBucket user: Sébastien Jodogne] [BitBucket date: 2019-01-15.19:59:59] The decision was taken to modify the patient recycling order as follows: Whenever a new **instance** is received, its parent patient is moved to the end of the recycling order.
[BitBucket user: Sébastien Jodogne] [BitBucket date: 2019-01-15.20:09:39] Fix issue #58 (Patient recycling order should be defined by their received last instance) → https://hg.orthanc-server.com/orthanc/changeset/c0d7aee8c3f8