Lua Syntax error

  • Hello all,


    I am trying to store DICOM files from a particular device model to different directory, could anyone see whats wrong with my lua code. Dont know much about lua


    Code
    ImportConverter0 = ifequal "%V0008,1090[0,2]","IOL";Storage 'MAG3';


    getting error below


    *** lua syntax error [string "ifequal "%V0008,1090[0,2]", "IOL"; Storage 'MAG3'"]:1: unexpected symbol near ',' in 'ifequal "%V0008,1090[0,2]", "IOL";Storage 'MAG3''

  • Hi,


    this is not lua. So put it above the [lua] block in dicom.ini. For exact syntax see manual


    ImportConverter0 = ifequal "%V0008,1090[0,2]","IOL";storage MAG3


    Lua would be:


    [lua]

    ImportConverter1 = if string.sub(Data["0008,1090"],1, 3)=="IOL" then script("storage MAG3") end

    regards,


    Marcel

  • Thank you.


    Decided to put all the storage rules in a file and call the file.


    This works but only for new patientIDs, existing are defaulting to their original folders. My filenamesyntax is 4, as thats how I want to store them but I also want to separate by specific tests.


    Any ideas

  • Hi,


    conquest will not move existing files on storage; so you will have to delete them first. Or use these are commands to move patients from one device to another.


    These commands will move 100MB old data


    dgate -as100000,0

    dgate -amMAG0,Archiving,MAG1

    Marcel

  • Thank you for the response.


    I ideally do not want to move existing patient files, just want to rearrange any new files that come in, regardless of if the patient is pre existing or not. i.e for existing patient x all new OCT files should end up in patient x folder in the OCT folder and all new VF files should end up in patient x folder in the VF folder. etc


    My code currently moves them only if the patient is not pre existing in the patients table

Participate now!

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