How to Forward most recent Prior

  • Conquest v.1417d


    Hi,


    I need to figure out how to forward the most recent prior for a patient when a new study has arrived. For example, when a study arrives with a study description of 'MR Brain' I need to forward that patients most recent 'MR Brain' to a specific remote AE Title. Is this possible?


    thanks


    PacsDude

  • Hi,


    this particular forward command exists (see manual)


    "forward patient study STUDYUID to AE"


    So you need to find studyuid. Then maybe this lua script could work, put it in a separate file.


    script.lua


    call it as:


    ImportConverter0 = script.lua


    Marcel

  • Marcel,


    in your code below:



    does it watch incoming studies? How would I modify the script to look for 'MR Brains' only?

  • Hi,


    You can add. e.g.,


    if Data.StudyDescription ~= 'MRI Brain' then return end


    at the start. Note that this script will be run for every image. The forwarder has a timeout that will ensure the actual forward is only run once.


    Marcel

  • Marcel,


    On this line:


    'script("forward patient study ".. s[1].StudyInstanceUID .. "to AE")'


    if I wanted the study to go to 'SERVER1' would it look like:


    script("forward patient study ".. s[1].StudyInstanceUID .. "to SERVER1")


    OR


    script("forward patient study ".. s[1].StudyInstanceUID .. "SERVER1")


    thanks


    REPLY: "to SERVER1"

  • Marcel,


    running the code below:



    and it comes back with '...:10: attempt to get length of global 'r' (a nill value)'


    this is after I had sent it a 'MR Brain' study waiting for it to forward me the recent 'MR Brain' from this example patient. There is a prior 'MR Brain' for this patient, as I have verified this.


    thanks

  • Marcel,


    Yes, its actually the conquest server. I can use different applications to query, push, & pull studies from it right now.


    I can run this:


    Code
    q = newdicomobject()
    q.PatientID = ''
    q.StudyInstanceUID = ''
    q.StudyDescription = '*MR BRAIN*'
    q.StudyDate = '20140604'
    q.QueryRetrieveLevel = 'STUDY'
    r = dicomquery('RADARCH4', 'STUDY', q)
    print('found', #r, 'studies')


    that comes back with '4' results for today.

  • Marcel,


    I've corrected the capitalization error, but it is still complaining about line 10 '...lua:10: attempt to get length of global 'r' (a nil value)' error message


    also added a space for line 9 before and after the '='


    here is the code now:


  • Small errors:



    end

  • Marcel,


    -thanks for fixing that. The script doesn't error anymore, but nothing gets forwarded to me


    I even changed what I was looking for in the 'StudyDescription' to '*brain*'. Is the "to SERVER1" correct in the code below? It IS in the 'acrnema.map' file.


  • Marcel,


    I've told it to print as you suggested above, but nothing shows up in my 'serverstatus.log'. I"m running an old copy of 'dicom.ini' from before the v1.4.16 days. Could there be a setting in the .ini I'm missing since v1.14.17d?


    thanks

  • Marcel,


    now it isn't printing anything, do I have to wait for 5 min?


    On line 13, there is a print function


  • Marcel,


    I'm guessing that the 'If' statement isn't working. I've created another basic script to just print something and I have called it in the dicom.ini file as:


    ImportConverter0 = print.lua


    Here is the code:


    Code
    if string.find(Data.StudyDescription, 'brain') then
    print ("Is this what you are looking for?--", Data.StudyDescription)
    end


    This should print out 'MR Brain w+wo Contrast' when it receives a study with the word 'brain' in the study description.


    this will not print anything in the 'serverstatus.log' file.


    correct me if I'm wrong, but this 'if string.find' will only work on incoming images correct?


    thanks

Participate now!

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