Patient ID change

  • Marcel, is there an easier way to change a Patient ID for all of a patients studies. Right now, I am going to the database browser, right mouse clicking on a study, and selecting "change patient ID for this study". If the particular patient has several studies across different modalities, it takes a long time to do each one. Is there a dgate command line I could do, or a way to select multiple studies at a time to change?

  • Hi,


    changing a patient ID works file by file using: dgate --modifypatid:file,patid. So it is not easy to batch this. It is possible using e.g.,


    Code
    dgate "--imagelister:local|patid||%s"


    to get the list of files.


    There is no command to change the patient name. People typically use K-PACS to do this.


    Marcel

  • If I use something like K-Pacs to correct a misspelled patient, what would the process be?
    I'm guessing:
    - Find the misspelled patient
    - Retrieve all of that patient's' misspelled studies from Conquest into K-PACS.
    - Use a DICOM Editor that is built-in to K-PACS to change the name (I assume there is one)
    - Delete all of those misspelled studies in Conquest
    - Send the corrected studies from K-Pacs to Conquest


    Is there a better way? I really need to get this cleaned up...

  • Hi,


    if you change anything (name etc) but leave primary keys (patient ID, UIDs) as is, you can just write over the existing data in conquest. DO NOT CHANGE PATIENT IDs THIS WAY - use conquest instead, it will reasign new UID's.


    - Find the misspelled patient
    - Retrieve all of that patient's' misspelled studies from Conquest into K-PACS.
    - Use a DICOM Editor that is built-in to K-PACS to change the name (I assume there is one)
    YOU CAN SKIP THIS - Delete all of those misspelled studies in Conquest
    - Send the corrected studies from K-Pacs to Conquest


    Marcel

  • What path format is the --modifypatid command looking for? A full path does not seem to work...


    For testing, I created a canned batchfile that is supposed to replace patient ID 10742 with 11111


    Code
    changepatid.cmd:dgate "--imagelister:local|10742||%%s" >changeme.txtFOR /F %%A IN (changeme.txt) DO dgate --modifypatid:%%A,11111


    It seems to work, but in the PacsTrouble.log, it shows ***File to modify is not on a MAG device. Here's what the output looks like while the batch file is running:


    Please help. I think I'm almost there. -Scott

  • I figured it out! The manual has the parameters backwards. It should read --modifypatid:patid,file (and not --modifypatid:file,patid). Please correct in the manual for the next guy trying to figure this out. :lol:

  • Hi,


    this is a nice shortcut to change patient ID of a patient from a windows command prompt: It lists the files in the format of a batch file that is next run.


    Code
    dgate "--imagelister:local|OLDPATID||dgate --modifypatid:NEWPATID,%s" > t.bat
    t


    Marcel

  • Thanks, I had worked out something similar. Not being an expert with piping, I came up with:

    Code
    dgate "--imagelister:local|OLDPATID||%%s" >changeme.txt
    FOR /F %%A IN (changeme.txt) DO dgate --modifypatid:NEWPATID,%%A


    Now if only there was a command line patient name changer...

  • Hi,


    piping is not used. Many dgate commands can accept a format that can be any string. This is used heavily in HTML creation, but can also be used this way. Your script is nice too.


    Marcel

  • HI, THIS WILL BE AN OPTION OF THE NEXT RELEASE AFTER 1.4.14:


    Code
    dgate "--imagelister:local|PATID||dgate """--modifyimage:%s,set 0010,0010 to 'anonymous' "" > t.bat
    t


    Sorry about the quotes ;->>>


    WARNING: IF YOU USE THIS SCRIPT TO MODIFY PATID, STUDYUID, OR SERIESUID, YOU MAY LOSE PATIENT'S DATA


    Marcel

  • Sweet. The patient name change in the beta works on my test box. Do you know what the official DICOM format of the 0010,0010 attribute is supposed to be? And does case matter?


    In a quick search,
    Philips says:

    Code
    Patient’s Name is divided by DICOM delimiters ("^") into 3 field: Last name, first name and middle name. The maximum length of the last name field is 24, the maximum of the first and middle name is 19 characters. When the maximum length of a field is exceeded the field is truncated.


    Another Vendor says:

    Code
    LastName^FirstName^MiddleName^NamePrefix^NameSuffix
  • I found a quirk in the attribute setting related to the ^ symbol. It's probably a batch file parsing problem.


    I tried

    Code
    dgate "--imagelister:local|10101||dgate """--modifyimage:%%s,set 0010,0010 to 'LAST^FIRST^^^' "" > t.bat
    t


    but the resulting t.bat file garbled the patient name field to 'LASTFIRST^'


    I had to double the carets to change it to 'LAST^^FIRST^^^^^^' to get it to come out right.


    FYI

  • Hi


    I am using following command (dgate64.exe --modifypatid:"1234","2107260848098474","E:\Images\DX\unknown\unknown\26-07-2021\A334892-2- (^xxxxxx)\Ankle_Stress_AP\00010004.dcm") to modify wrong patient ID but it give me error:

    [PACS] Server command sent using DGATE -- option

    [PACS] ***File to modify does not exist or is not on a MAG device


    If i use this command


    PatientID -> dgate64.exe --modifystudy:Old Patient ID,Study ID,"set 0010,0020 to \"New Patient ID\"; "

    PatientName -> dgate64.exe--modifystudy:Patient ID,Study ID,"set 0010,0010 to \"New Patient Name\"; "


    Same error :

    [PACS] Server command sent using DGATE -- option

    [PACS] ***File to modify does not exist or is not on a MAG device


    Please guide

Participate now!

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