Converter: check for already-routed studies

  • Apologies if this has been asked before, I browsed a few pages in the forum and ran a search and didn't find anything.


    I'd like to add some logic to prevent routing for studies that have already been routed to the destination system. I can think of a couple logical ways to do this, but I don't know of the mechanism to achieve it.


    1. Check if the file already exists in Conquest; I'm forwarding everything that comes through, so if the file exists it will have been forwarded previously.
    2. Query the destination system for the StuInsUID and then discard the file or stop the converter if it does exist there.


    Would this be doable with Lua? I don't see that any of the built-in functions will do what I want. Thanks!


    Edit: one thing that's troubling me with the fundamental idea is that if there's been a change in the DICOM, implementing this may cause me to lose updated studies from facility QC, etc. Is there a way to evaluate whether an incoming file is different from an existing file?


    Chris

  • Hi,


    both may be possible but currently likely be slow as the query would have to be done for each incoming image, unless it can be cached, e.g. in untested code:


    Association = cache = {}
    ImportConverter0 = if cache[1]==nil then cache[1]=dbquery('DicomStudies', 'StudyInstanceUID', 'StudyInstanceUID='..Data.StudyInstanceUID) end
    ImportConverter0 = if cache[1]==nil then script('forward study to SERVER') end


    Marcel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!