How to generate a .txt file of results based on query

  • Conquest Version 1417Beta


    Hi,


    I am trying to figure out how I can generate a .txt file of Study IUIDs based on a query? Could I use a LUA script to generate a .txt file with the results of a query?


    If this is the correct way to do this, could I have small LUA example of it?


    thank you! :o

  • Ok try,


    dgate "--lua:dofile('query.lua')"


    query.lua

    Code
    a=DicomObject:new()
    a.QueryRetrieveLevel='STUDY'
    a.StudyInstanceUID=''
    a.StudyDate='20110101-20130404'
    b=dicomquery('CONQUESTSRV1', 'STUDY', a)
    f=io.open('file.txt', 'wt')
    for i=0, #b-1 do
    f:write(b[i].StudyInstanceUID .. '\n')
    end
    f:close()


    Marcel

Participate now!

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