Batch dicom change question

  • We have picked up some new clinics and have a problem with overlapping patient IDs. So I need to change the ID for one of the clinics. Basically this amounts to taking all the patients in a directory and changing the patient IDs from #### to FMI####. So, for every image, the patient ID would change from say "1234" to "FMI1234". Does anyone know of a tool that could do this? We are talking about housands of patients, well over a million images.So an automated process is needed.
    I think a simple batch file using dgate --modifypatid * FMI* would work... Anyone have comments?

  • I'm still struggling with this issue. I still want to change many patient files from patid=xxxx to patid=FMIxxxx with as little input as possible.


    It seems I can't use wild cards so "dgate --modifypatid:*,FMI*" does not work.


    I tried a batch file idea from a different thread:
    dgate "--imagelister:local|OLDPATID||dgate --modifypatid:NEWPATID,%s" > t.bat
    but t.bat remains empty when I run this. I have replaced OLDPATID with the ID of my test patient, and the NEWPATID with my new id.


    I tried command line dgate "--imagelister:local|patid||%s"
    There is no output.


    Right now I am working in a test directory, a few patient files, dgate.exe, dgate.dic and dicom.ini.


    I am not understanding something. I think maybe dgate is not looking in the right place (my test directory). Any ideas? Help?

  • Hi,


    the best moment to change patient ID's is when the files are recieved using an importconverter.


    To list images:


    dgate "--imagelister:local|207*||%s|t.t"


    This lists all images of patient ID 207* to file t.t


    To make this work you have to run it from the same directory as where the server is.


    Marcel

  • Still having hard time. Here is what is happening:
    I open command window.
    I change to d:\conquest1 (my conquest directory)
    I execute dgate "--imagelister:local|*||%s|patient.txt"; I want every patient to be listed in patient.txt
    The system runs for about a minute, patient.txt is created in the directory.
    When I get the command prompt back, patient.txt is empty.
    If I try to delete patient.txt I can't, it says it's being used...
    I've waited about 10 minutes now, no change.Patient.txt is locked and empty. The number of patients in this conquest instance is not great, maybe 100 patients. This is conquest v.14, native mySQL. No messages show up in pacstrouble.log

  • Oops, it just finished!
    Patient.txt now has the image files. Hmm, it has both local and mirror drive files. That's why it was so slow, it was going through the whole offsite backup network drive too. Shouldn't the "local" setting limit it to MAG0?

  • Thank you Marcel, one more question:


    the statement: dgate "--imagelister:local|*||dgate --modifypatid:FMI*,%s" > t.bat


    will produce a t.bat file that will change all patid on all images to "FMI*" literally. What I want is the patients ID to be changed to the same number with a FMI in front.
    So 1234 will change to FMI1234. Can you help me rewrite the statement to do that?


    Would this work? Or am I still missing it?

    Code
    dgate "--imagelister:local|*||dgate --modifypatid:FMI%id,%s" > t.bat


    update: I tried the above code and it did not work, the t.bat file did not contain the file names...
    I also tried

    Code
    dgate "--imagelister:local|*||dgate --modifypatid:FMI%(0010,0020),%s" > t.bat


    That produced a bat file that looks like: dgate --modifypatid:FMI(0010,0020),F:the file name.
    I tried it just to see and it produces 100% **File to modify does not exist or is not on a MAG device error.


    Ok, I'm open to suggestions, I'm still not sure how to structure this command.

  • Hi,


    These commands are not easy to use..... ;->>>


    imagelister only returns the filenames, not the patient ID. So you can only run this command for one patient at a time. For patient 9901234, you can e.g., do:


    Code
    dgate "--imagelister:local|9901234||dgate --modifypatid:FMI9901234,%s" > 9901234.bat


    To list all patient ID's you can do:


    Code
    dgate "--patientfinder:local|12|%0.0s%s"


    because patientfinder return first name (printed as %0.0s, i.e., NOT) and then ID (printed as %s)


    Marcel

Participate now!

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