lua script - how to call 'sleep' function?

  • OS: Win Server 2008 R2
    Conquest Version: 1.4.17 Beta


    Marcel,


    HI. I am doing two things with lua right now and both are related. What I am trying to accomplish is deletion of our prior exams that we no longer need according to our storage policy (we keep 6 years of each patients exams). I am currently working on the year 2005 and our volume increased dramatically during this year and I simply cannot use a .lua script to delete all of our studies from Conquest that fall within our deletion rules. Dgate crashes when it is given too much to do, so for right now I have to break up the work by giving it the following example.


    Only CR exams with study dates from 5/1/2005 - 5/31/2005. This will yield about 10K to 12K studies. I would like to just give the command to dgate via a .lua script once for it to do 'all; of the work instead of 'breaking up the work' and making sure that dgate doesn't crash (because it will if its given too much work via the script).


    Here is what I am doing with LUA right now.


    first step: I run the following code to generate a list of Study UIDs to delete:


    --suid.lua

    Code
    a=DicomObject:new() a.QueryRetrieveLevel='STUDY' a.StudyInstanceUID='' --a.PatientName='*test*' --a.AccessionNumber='6419216' a.StudyDate='20050501-20050531' a.PatientBirthDate = '19000101-19920423' a.ModalitiesInStudy = 'CR' b=dicomquery('RADARCH4', 'STUDY', a) f=io.open('suid.txt', 'wt') for i=0, #b-1 do f:write(b[i].StudyInstanceUID .. '\n') end f:close()


    2nd step is that I run this code below calling the file generated from the code above:


    --delete.lua


    What I would like to do is generate a larger 'SUID.txt' file so that I can pass more Study UIDs to dgate via the .lua script. My question is can I pass a 'sleep' command to my 'delete.lua' script to wait for 5 seconds after it passes one line to dgate?


    I was reading this page http://stackoverflow.com/quest…p-block-for-a-few-seconds and someone said that this could be used for windows:


    os.execute("CHOICE /n /d:y /c:yn /t:5")


    I'm unsure though, do you have any thoughts on how to tell the .lua script to pause/wait for a set period of time before it reads the next line of a input file?


    thanks


    Jamie

Participate now!

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