Delete old exam

  • HI,

    I want to delete the exams of the year 2015 using this lua file:

    x = DicomObject:new()

    x.PatientName = ''

    x.PatientID = ''

    x.StudyDate = '20030101-20050322' -- date range match

    x.PatientBirthDate = '19000101-19920322'

    x.QueryRetrieveLevel = 'STUDY'

    x.StudyInstanceUID = '' -- you want these returned for the loop

    x.ModalitiesInStudy = ''


    y = dicomquery('CONQUESTSRV1', 'STUDY', x)

    -- now y is an array with all requested items


    print('fixin to delete', #y, 'Studies')

    for i=0, #y-1 do

    print('testing', y[i].PatientID, y[i].PatientName, y[i].StudyDate, y[i].ModalitiesInStudy)

    if string.find(y[i].ModalitiesInStudy, 'MG')==nil then

    z = DicomObject:new()

    z.PatientID = y[i].PatientID

    z.StudyInstanceUID = y[i].StudyInstanceUID

    print('deleting', y[i].PatientID, y[i].PatientName, y[i].StudyDate, y[i].ModalitiesInStudy)

    --dicomdelete(z)

    end

    end




    please how can i run it.

  • Hi,


    The best way is to download zerobrane studio (a generic Lua debugger), and run the install script in conquest's ZeroBraneStudio folder. Then you can start the script from the IDE, including debugging.


    https://studio.zerobrane.com/


    Note that you may have to set conquest's port in user.lua as described in readme.txt


    Regards,


    Marcel

  • Obviously you can also use the command line options of dgate e.g.


    dgate(64) --deletestudies:20150101-20150131


    would delete january 2015.


    The lua code allows you more of a preview though.


    Marcel

Participate now!

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