OnStableStudy and create-dicom

Good Day,
Wondering if anyone has run into this and the best way around.
When a study is stable, I sent a HTTP Get Message to an interface engine. That HTTP Get creates a PDF Report and uses tools/create-dicom to attach the PDF Report to the study.

Unfortunately, when that happens another OnStableStudy is initiated. Anyone know an easy way to ignore the second OnStableStudy? I was thinking of parsing and looking for the series description I am using and filtering on that, but hoping I could find an easier option.


Might be easier if you did not have to use the ChangeType.STABLE_STUDY as the triggering event for the PDF report creation in the first place, otherwise you have a loop that you have to catch as you suggest.

I ran into a similar issue and solved it by capturing some other event to trigger my procedure, rather than using the STABLE_STUDY, which is pretty non-specific.

Another option might be to somehow use the core MetaTags or a UserDefined one to indicate that you want to by-pass your usual procedure for the STABLE_STUDY event. You could maybe even unset such a flag that way, but seems like using a way that does not depend upon the STABLE_STUDY would be preferred.

If your initial request is coming from DICOM protocol and the later coming from HTTP, then you could definitely use the origin param from OnStablexxx callback to differentiate the logics

Vào Thứ Tư, 15 tháng 9, 2021, Bryan Dearlove <bdearlove@gmail.com> đã viết:


I am not sure if you are talking about a script, a C/C++ plugin, or a Python plugin.

In either case, when you attach the PDF report to the study, you could simply tag the study as complete by associating a metadata to it:

In the “OnStableStudy” study, you would check the value of the metadata to ignore the second event.

Another option would be to use a global variable in your script/plugin that would maintain the set of studies that have been attached with a PDF report. In the “OnStableStudy”, you would ignore the studies that are present in this set.


Great, thank you. I will give the metadata route a try, thanks.