I’ve been using the STABLE_STUDY event for a while and it works pretty well. Here are some remarks:
You need to properly set the StableAge variable to a reasonable time.
When studies are resubmitted, you must decide what to do with the STABLE_STUDY event triggered again. However, Orthanc behavior changes slightly depending on the value of OverwriteInstances.
When you have OverwriteInstances = true, and a study is resubmitted, the only possibility is:
All instances are identified/rewritten ← Does not trigger NEW_STUDY / Triggers STABLE_STUDY
When you have OverwriteInstances = false, and a study is resubmitted, there are two possibilities:
New instances were identified ← Does not trigger NEW_STUDY / Triggers STABLE_STUDY
All instances resubmitted were already stored ← Does not trigger NEW_STUDY / Does not trigger STABLE_STUDY
Notice that in all cases the NEW_STUDY event is not triggered, which makes sense. The only problem is the scenario i highlighted above. Let me explain:
Since the NEW_STUDY event is not triggered for resubmitted studies, you don’t have an entrypoint to react to them, so you resort to the OnStoredInstance event.
However, already-stored instances triggers OnStoredInstance without a variable indicating so.
And since the STABLE_STUDY event is not triggered in this case, you have no way of handling the incoming study.
I think we need more generic events regarding the lifecycle of an incoming study to Orthanc, something like INCOMING_STUDY / FINISHED_STUDY (think of finally in a catch block). With this, we would be able to handle specific events once without relying on the instance level events.
A sexta-feira, 29 de abril de 2022 à(s) 16:45:52 UTC+1, thorsten.r...@gmail.com escreveu: