zip archive study

  • Is there any possibility to use ExportConverter or any function to make Zip archive study in conquest.
    for example:
    1. Conquest must archive a study in standard mode \direcotry\patient_id\images
    2. Conquest must in the same time crate zip archive of current study in other directory.


    Thank's for any sugestions.

  • Hi,


    if you update to 1,4,16k there is a lua export command:


    servertask('export:patientid,studyuid,seriesuid,sopuis,targetfile,script')


    This zips the selection to a file. You would need to experiment to get this to zip the data it recieves in one go, and not again and again for every received image.


    Marcel

  • Hi
    I have a little problem with your example
    [lua]
    endassociation = servertask('export:'..Data.PatientName'..'PatientName.zip')


    [LUKASZC] *** lua syntax error [string "servertask('export:'..Data.PatientName'..'PatientName.zip')"]:1: ')' expected near 'PatientName' in 'servertask('export:'..Data.PatientName'..'PatientName.zip')'

  • Hi,


    I wrote a quote too much and the example was wrong anyway. The four comma's are required, here you can (must or leave empty) list PatientID, StudyInstanceUID, SeriesInstanceUID, and SOPInstanceUID. Two dots means string concatenation, and Data is the dicom object.


    Try:


    [lua]
    ImportConverter0 = servertask('export:'..Data.PatientID..',,,,'..Data.PatientID..'.zip')


    This will do way too much but might point to the right solution. The endassociation event does not pass the Data object, so you can not use that directly.


    Marcel

  • Hi,


    This works but it is a kludge:


    Code
    [lua]
    ImportConverter0 = Global.AutoRoutePipe = Data.PatientID; print(Global.AutoRoutePipe)
    EndAssociation = if Global.AutoRoutePipe~='' then servercommand('export:'..Global.AutoRoutePipe..',,,,'..Global.AutoRoutePipe..'.zip') end; Global.AutoRoutePipe=''


    Patient ID is saved in a free global variable (there are not many) and used on EndAssociation.


    I need to add a better option to exchange data between ImportConverter0 and EndAssociation...


    Marcel

  • Hi I would like to refresh topic
    I am wondering, is any possibility to convert my bash script to lua
    My script makes zip's file include e-film-light browser and dicom DICOMDIR files.
    example


    #!/bin/bash
    src="/PLYTY"
    for dir in `ls "$src/"`
    do


    for file in "$src/$dir"/*;
    do
    source="$file"
    target=$(echo "$file" | sed -e "s/\.dcm//")
    mv "$source" "$target"
    done
    #################################################################
    #if use v2 file
    #################################################################
    # for file in "$src/$dir"/*;
    # do
    # source="$file"
    # target=$(echo "$file" |sed -e "s/\.v2//")
    # mv "$source" "$target"
    # done


    for FILE in "$src/$dir"/* ; do mv "$FILE" `echo "$FILE" | tr "a-z" "A-Z"`; done
    for plik in "$src/$dir"/*; do dcmconv +te "$plik" "$plik"; done
    mkdir "$src/$dir/"DATA
    for plik in "$src/$dir"/*; do mv "$plik" "$src/$dir"/DATA; done


    cd "/$src/$dir/"
    for ddir in *; do dcmmkdir DATA/* +D DICOMDIR; done


    cp -r /pacs/efilm/* "$src/$dir"/


    ##cd "$src/$dir"


    for f in "$src/$dir";
    do if [ -d "$f" ]; then zip -r "$f".zip "$f";
    fi
    done
    done


    mv "$src"/*.zip /var/www/study/zip/
    rm -rf /PLYTY/*


    I would like to somebody help me to convert my bash script to lua script which made a zip file include study, DICOMDIR with efilmlt.

  • Hi, Marcel
    I already use lua to make zip archive and it's work fine.
    Now zip archives make in the pacs directory /pacs/pacs_files.....
    How to move them "on lua script" to the /pacs/www/study/%V0008,0050/zip/


    [lua]
    ImportConverter0 = Global.AutoRoutePipe = Data.PatientID; print(Global.AutoRoutePipe)
    EndAssociation = if Global.AutoRoutePipe~='' then servercommand('export:'..Global.AutoRoutePipe..',,,,'..Global.AutoRoutePipe..'.zip') end; Global.AutoRoutePipe=''

Participate now!

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